@akairos/myno 0.3.1 → 0.4.0

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 (85) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +14 -0
  3. package/dist/.vite/manifest.json +48 -48
  4. package/dist/assets/image-markdown-D_KxLndJ.js +1265 -0
  5. package/dist/assets/image-markdown-DjLPX8Cn.js +1265 -0
  6. package/dist/assets/image-markdown-flIFnZQz.js +1263 -0
  7. package/dist/assets/index-66BBLxhh.js +6 -0
  8. package/dist/assets/index-B4ecS-cF.js +1 -0
  9. package/dist/assets/index-BADrVn75.js +1 -0
  10. package/dist/assets/index-BTretno4.js +1 -0
  11. package/dist/assets/index-BXlZZMOz.js +1 -0
  12. package/dist/assets/index-BZ-5737Z.js +1 -0
  13. package/dist/assets/index-BZem0vzC.js +3 -0
  14. package/dist/assets/index-Bd0I8kF1.js +1 -0
  15. package/dist/assets/index-BfO3YJzD.js +1 -0
  16. package/dist/assets/index-BhUr-B6E.js +1 -0
  17. package/dist/assets/index-BsUkmM8V.js +1 -0
  18. package/dist/assets/index-Bvh2Wgzo.js +1 -0
  19. package/dist/assets/index-C5i0rs3g.js +2 -0
  20. package/dist/assets/index-C8MZF2M1.js +1 -0
  21. package/dist/assets/index-CDQ6fPsF.js +7 -0
  22. package/dist/assets/index-CERUTt28.js +1 -0
  23. package/dist/assets/index-CHAJKy6Z.js +1 -0
  24. package/dist/assets/index-CNRHxRLz.js +1 -0
  25. package/dist/assets/index-COuMfdWH.js +3 -0
  26. package/dist/assets/index-CT1Zmf0B.js +2 -0
  27. package/dist/assets/index-CZq60G2m.js +1 -0
  28. package/dist/assets/index-C_mIGN7h.js +1 -0
  29. package/dist/assets/index-Cgs3alSt.js +2 -0
  30. package/dist/assets/index-Ci1ADeNw.js +1 -0
  31. package/dist/assets/index-Cl8ck_yS.js +1 -0
  32. package/dist/assets/index-Clh0l7tA.js +6 -0
  33. package/dist/assets/index-CmmXvZ6J.js +1 -0
  34. package/dist/assets/index-CoD6FnDs.js +1 -0
  35. package/dist/assets/index-CsnJQClJ.js +1 -0
  36. package/dist/assets/index-Cu7G95Iq.js +1 -0
  37. package/dist/assets/index-D-v57VOj.js +1 -0
  38. package/dist/assets/index-D4yhPgHm.js +1 -0
  39. package/dist/assets/index-D96XFM__.js +1 -0
  40. package/dist/assets/index-DHqWq6xc.js +1 -0
  41. package/dist/assets/index-DI76JKrp.js +1 -0
  42. package/dist/assets/index-DK8kmMNZ.js +1 -0
  43. package/dist/assets/index-DKRYs_np.js +1 -0
  44. package/dist/assets/index-DNMR53rb.js +1 -0
  45. package/dist/assets/index-DNTDwjMb.js +1 -0
  46. package/dist/assets/index-DTBc-iCV.js +1 -0
  47. package/dist/assets/index-DYzqKMaM.js +7 -0
  48. package/dist/assets/index-DdtnTgdR.js +1 -0
  49. package/dist/assets/index-DgUo7cv1.js +1 -0
  50. package/dist/assets/index-DickJnaB.js +1 -0
  51. package/dist/assets/index-DlWplKCS.js +13 -0
  52. package/dist/assets/index-Dni2u4TR.js +1 -0
  53. package/dist/assets/index-DoiEiA2M.js +1 -0
  54. package/dist/assets/index-DqPLvEv8.js +1 -0
  55. package/dist/assets/index-Dt8w_V-H.js +1 -0
  56. package/dist/assets/index-Du_1nXQ0.js +1 -0
  57. package/dist/assets/index-DvFEir78.js +7 -0
  58. package/dist/assets/index-DyFBKBTt.js +6 -0
  59. package/dist/assets/index-KmRmudm8.js +13 -0
  60. package/dist/assets/index-Qt71JNB9.js +1 -0
  61. package/dist/assets/index-Vb_uz0jk.js +3 -0
  62. package/dist/assets/index-cPhT19Rl.js +1 -0
  63. package/dist/assets/index-ktq63SwX.js +1 -0
  64. package/dist/assets/index-lzIwkAor.js +1 -0
  65. package/dist/assets/index-nZYfY4TR.js +1 -0
  66. package/dist/assets/index-pGJ67V8L.js +1 -0
  67. package/dist/assets/index-pMBzGDJd.js +1 -0
  68. package/dist/assets/index-tEdwQR6u.js +1 -0
  69. package/dist/assets/index-tLrnxT69.js +13 -0
  70. package/dist/editor/image-markdown.d.ts +13 -0
  71. package/dist/editor/image-markdown.d.ts.map +1 -0
  72. package/dist/editor/image-markdown.js +88 -0
  73. package/dist/editor/image-markdown.js.map +1 -0
  74. package/dist/editor/myno-editor.d.ts.map +1 -1
  75. package/dist/editor/myno-editor.js +3 -0
  76. package/dist/editor/myno-editor.js.map +1 -1
  77. package/dist/editor-export.js +2 -2
  78. package/dist/src/studio/studio.html +1 -1
  79. package/dist/studio/editor-export.d.ts.map +1 -1
  80. package/dist/studio/editor-export.js +2 -1
  81. package/dist/studio/editor-export.js.map +1 -1
  82. package/dist/studio/studio.js +3 -1
  83. package/dist/studio/studio.js.map +1 -1
  84. package/dist/studio.js +127 -129
  85. package/package.json +1 -1
@@ -0,0 +1,1265 @@
1
+ var Ny=e=>{throw TypeError(e)};var Oy=(e,t,n)=>t.has(e)||Ny("Cannot "+n);var Ee=(e,t,n)=>(Oy(e,t,"read from private field"),n?n.call(e):t.get(e)),wt=(e,t,n)=>t.has(e)?Ny("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),st=(e,t,n,r)=>(Oy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var mn=(function(e){return e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e.aiProviderError="aiProviderError",e.aiBuildContextError="aiBuildContextError",e})({}),gn=class extends Error{constructor(e,t,n){super(t,n),this.name="MilkdownError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},oR=(e,t)=>typeof t=="function"?"[Function]":t,El=e=>JSON.stringify(e,oR);function sR(e){return new gn(mn.docTypeError,`Doc type error, unsupported type: ${El(e)}`)}function aR(e){return new gn(mn.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function lR(e){return new gn(mn.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function Qu(){return new gn(mn.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function cR(e,t,n){const r=`Cannot create node for ${"name"in e?e.name:e}`,i=s=>{if(s==null)return"null";if(Array.isArray(s))return`[${s.map(i).join(", ")}]`;if(typeof s=="object")return"toJSON"in s&&typeof s.toJSON=="function"?JSON.stringify(s.toJSON()):"spec"in s?JSON.stringify(s.spec):JSON.stringify(s);if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return JSON.stringify(s);if(typeof s=="function")return`[Function: ${s.name||"anonymous"}]`;try{return String(s)}catch{return"[Unserializable]"}},o=[["[Description]",r],["[Attributes]",t],["[Content]",(n??[]).map(s=>s?typeof s=="object"&&"type"in s?`${s}`:i(s):"null")]].reduce((s,[a,l])=>{const c=`${a}: ${i(l)}.`;return s.concat(c)},[]);return new gn(mn.createNodeInParserFail,o.join(`
2
+ `))}function Uk(){return new gn(mn.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function uR(e){return new gn(mn.parserMatchError,`Cannot match target parser for node: ${El(e)}.`)}function fR(e){return new gn(mn.serializerMatchError,`Cannot match target serializer for node: ${El(e)}.`)}function hR(e,t){return new gn(mn.getAtomFromSchemaFail,`Cannot get ${e}: ${t} from schema.`)}function dr(e){return new gn(mn.expectDomTypeError,`Expect to be a dom, but get: ${El(e)}.`)}function Qf(){return new gn(mn.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function dR(e){return new gn(mn.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function pR(e){return new gn(mn.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}function Hk(e){try{return El(e)}catch{return"[Unserializable]"}}function Hq(e){const t=e instanceof Error?e.message:Hk(e);return new gn(mn.aiProviderError,`AI provider error: ${t}`,{cause:e})}function Kq(e){const t=e instanceof Error?e.message:Hk(e);return new gn(mn.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:e})}var Kk=class{constructor(){this.sliceMap=new Map,this.get=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);if(!t){const n=typeof e=="string"?e:e.name;throw aR(n)}return t},this.remove=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},mR=class{#t;#e;#r;constructor(t,n,r){this.#t=[],this.#r=()=>{this.#t.forEach(i=>i(this.#e))},this.set=i=>{this.#e=i,this.#r()},this.get=()=>this.#e,this.update=i=>{this.#e=i(this.#e),this.#r()},this.type=r,this.#e=n,t.set(r.id,this)}on(t){return this.#t.push(t),()=>{this.#t=this.#t.filter(n=>n!==t)}}once(t){const n=this.on(r=>{t(r),n()});return n}off(t){this.#t=this.#t.filter(n=>n!==t)}offAll(){this.#t=[]}},gR=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw Qu()}}create(e,t=this._defaultValue){return new mR(e,t,this)}},Ue=(e,t)=>new gR(e,t),AR=class{#t;#e;#r;#n;#o;#s;#i;constructor(e,t,n){this.#n=new Set,this.#o=new Set,this.#s=new Map,this.#i=new Map,this.read=()=>({metadata:this.#t,injectedSlices:[...this.#n].map(r=>({name:typeof r=="string"?r:r.name,value:this.#a(r)})),consumedSlices:[...this.#o].map(r=>({name:typeof r=="string"?r:r.name,value:this.#a(r)})),recordedTimers:[...this.#s].map(([r,{duration:i}])=>({name:r.name,duration:i,status:this.#l(r)})),waitTimers:[...this.#i].map(([r,{duration:i}])=>({name:r.name,duration:i,status:this.#l(r)}))}),this.onRecord=r=>{this.#s.set(r,{start:Date.now(),duration:0})},this.onClear=r=>{this.#s.delete(r)},this.onDone=r=>{const i=this.#s.get(r);i&&(i.duration=Date.now()-i.start)},this.onWait=(r,i)=>{const o=Date.now();i.finally(()=>{this.#i.set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{this.#n.add(r)},this.onRemove=r=>{this.#n.delete(r)},this.onUse=r=>{this.#o.add(r)},this.#a=r=>this.#e.get(r).get(),this.#l=r=>this.#r.get(r).status,this.#e=e,this.#r=t,this.#t=n}#a;#l},yR=class Jk{#t;#e;#r;#n;constructor(t,n,r){this.produce=i=>i&&Object.keys(i).length?new Jk(this.#t,this.#e,{...i}):this,this.inject=(i,o)=>{const s=i.create(this.#t.sliceMap);return o!=null&&s.set(o),this.#n?.onInject(i),this},this.remove=i=>(this.#t.remove(i),this.#n?.onRemove(i),this),this.record=i=>(i.create(this.#e.store),this.#n?.onRecord(i),this),this.clearTimer=i=>(this.#e.remove(i),this.#n?.onClear(i),this),this.isInjected=i=>this.#t.has(i),this.isRecorded=i=>this.#e.has(i),this.use=i=>(this.#n?.onUse(i),this.#t.get(i)),this.get=i=>this.use(i).get(),this.set=(i,o)=>this.use(i).set(o),this.update=(i,o)=>this.use(i).update(o),this.timer=i=>this.#e.get(i),this.done=i=>{this.timer(i).done(),this.#n?.onDone(i)},this.wait=i=>{const o=this.timer(i).start();return this.#n?.onWait(i,o),o},this.waitTimers=async i=>{await Promise.all(this.get(i).map(o=>this.wait(o)))},this.#t=t,this.#e=n,this.#r=r,r&&(this.#n=new AR(t,n,r))}get meta(){return this.#r}get inspector(){return this.#n}},bR=class{constructor(){this.store=new Map,this.get=e=>{const t=this.store.get(e.id);if(!t)throw lR(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},wR=class{#t;#e;#r;#n;#o;constructor(e,t){this.#t=null,this.#e=null,this.#n="pending",this.#o=null,this.start=()=>(this.#t??=new Promise((n,r)=>{this.#e=i=>{i instanceof CustomEvent&&i.detail.id===this.#r&&(this.#n="resolved",this.#s(),i.stopImmediatePropagation(),n())},this.#i(()=>{this.#n==="pending"&&(this.#n="rejected"),this.#s(),r(new Error(`Timing ${this.type.name} timeout.`))}),this.#n="pending",addEventListener(this.type.name,this.#e)}),this.#t),this.done=()=>{const n=new CustomEvent(this.type.name,{detail:{id:this.#r}});dispatchEvent(n)},this.#s=()=>{this.#o!==null&&(clearTimeout(this.#o),this.#o=null),this.#e&&removeEventListener(this.type.name,this.#e)},this.#i=n=>{this.#o=setTimeout(()=>{this.#o=null,n()},this.type.timeout)},this.#r=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#n}#s;#i},xR=class{constructor(e,t=3e3){this.create=n=>new wR(n,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},Br=(e,t=3e3)=>new xR(e,t);const kR={};function Cm(e,t){const n=kR,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vk(e,r,i)}function Vk(e,t,n){if(CR(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Dy(e.children,t,n)}return Array.isArray(e)?Dy(e,t,n):""}function Dy(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Vk(e[i],t,n);return r.join("")}function CR(e){return!!(e&&typeof e=="object")}const My=document.createElement("i");function vm(e){const t="&"+e+";";My.innerHTML=t;const n=My.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function In(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Jn(e,t){return e.length>0?(In(e,e.length,0,t),e):t}const By={}.hasOwnProperty;function qk(e){const t={};let n=-1;for(;++n<e.length;)vR(t,e[n]);return t}function vR(e,t){let n;for(n in t){const i=(By.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){By.call(i,s)||(i[s]=[]);const a=o[s];SR(i[s],Array.isArray(a)?a:a?[a]:[])}}}function SR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);In(e,0,0,r)}function Gk(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ir(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ht=Qi(/[A-Za-z]/),fn=Qi(/[\dA-Za-z]/),IR=Qi(/[#-'*+\--9=?A-Z^-~]/);function ou(e){return e!==null&&(e<32||e===127)}const Xd=Qi(/\d/),ER=Qi(/[\dA-Fa-f]/),Qk=Qi(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const Yu=Qi(new RegExp("\\p{P}|\\p{S}","u")),Fo=Qi(/\s/);function Qi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qe(e,t,n,r){const i=r?r-1:1/0;let o=0;return s;function s(l){return Pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return Pe(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}function Yk(e,t,n,r,i,o){let s=0;return a;function a(u){return Pe(u)?(e.enter(r),l(u)):c(u)}function l(u){return Pe(u)&&s<o?(e.consume(u),s++,l):(e.exit(r),c(u))}function c(u){return s>=i?t(u):n(u)}}const TR={tokenize:RR};function RR(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}let su=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Py(this,t,n,r,!1)}addBefore(t,n,r){Py(this,t,n,r,!0)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0,this.index.clear()}};function Py(e,t,n,r,i){if(n===0&&r.length===0)return;const o=e.index.get(t);if(o){o[1]+=n,i?(r.push(...o[2]),o[2]=r):o[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}const _R={tokenize:NR},Fy={tokenize:OR};function NR(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const y=n[r];return t.containerState=y[1],e.attempt(y[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const y=t.events.length;let C=y,w;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){w=t.events[C][1].end;break}A(r);let v=y;for(;v<t.events.length;)t.events[v][1].end={...w},v++;const D=new su;return D.add(C+1,0,t.events.slice(y)),D.add(y,v-y,[]),D.consume(t.events),c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return d(b);if(i.currentConstruct&&i.currentConstruct.concrete)return p(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fy,u,f)(b)}function u(b){return i&&x(),A(r),d(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(b)}function d(b){return t.containerState={},e.attempt(Fy,h,p)(b)}function h(b){return r++,n.push([t.currentConstruct,t.containerState]),d(b)}function p(b){if(b===null){i&&x(),A(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(b)}function m(b){if(b===null){g(e.exit("chunkFlow"),!0),A(0),e.consume(b);return}return Ce(b)?(e.consume(b),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),m)}function g(b,y){const C=t.sliceStream(b);if(y&&C.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(C),t.parser.lazy[b.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<s&&(!i.events[w][1].end||i.events[w][1].end.offset>s))return;const v=t.events.length;let D=v,N,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(N){T=t.events[D][1].end;break}N=!0}for(A(r),w=v;w<t.events.length;)t.events[w][1].end={...T},w++;const L=new su;L.add(D+1,0,t.events.slice(v)),L.add(v,w-v,[]),L.consume(t.events)}}function A(b){let y=n.length;for(;y-- >b;){const C=n[y];t.containerState=C[1],C[0].exit.call(t,e)}n.length=b}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function OR(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gn(e){if(e===null||ot(e)||Fo(e))return 1;if(Yu(e))return 2}function Tl(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ep={name:"attention",resolveAll:DR,tokenize:MR};function DR(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const o=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,s={...e[i][1].end},a={...e[n][1].start};Ly(s,-o),Ly(a,o);const l={type:o>1?"strongSequence":"emphasisSequence",start:s,end:{...e[i][1].end}},c={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:a},u={type:o>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},f={type:o>1?"strong":"emphasis",start:{...l.start},end:{...c.end}};e[i][1].end={...l.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Jn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=Jn(r,[["enter",f,t],["enter",l,t],["exit",l,t],["enter",u,t]]),r=Jn(r,Tl(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Jn(r,[["exit",u,t],["enter",c,t],["exit",c,t],["exit",f,t]]);let d=0;e[n][1].end.offset-e[n][1].start.offset&&(d=2,r=Jn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),In(e,i-1,n-i+3,r),n=i+r.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MR(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Gn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Gn(l),f=!u||u===2&&i||n.includes(l)&&l!==42&&l!==95,d=!i||i===2&&u||n.includes(r)&&r!==42&&r!==95;return c._open=!!(o===42?f:f&&(i||!d)),c._close=!!(o===42?d:d&&(u||!f)),t(l)}}function Ly(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const BR={name:"autolink",tokenize:PR};function PR(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return Ht(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||fn(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||fn(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||ou(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):IR(h)?(e.consume(h),c):n(h)}function u(h){return fn(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):d(h)}function d(h){if((h===45||fn(h))&&r++<63){const p=h===45?d:f;return e.consume(h),p}return n(h)}}const Rl={partial:!0,tokenize:FR};function FR(e,t,n){return r;function r(o){return Pe(o)?qe(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ce(o)?t(o):n(o)}}const $k={continuation:{tokenize:zR},exit:WR,name:"blockQuote",tokenize:LR};function LR(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function zR(e,t,n){const r=this;return i;function i(s){return Pe(s)?qe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt($k,t,n)(s)}}function WR(e){e.exit("blockQuote")}const Zk={name:"characterEscape",tokenize:jR};function jR(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Qk(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Xk={name:"characterReference",tokenize:UR};function UR(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=fn,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=ER,u):(e.enter("characterReferenceValue"),o=7,s=Xd,u(f))}function u(f){if(f===59&&i){const d=e.exit("characterReferenceValue");return s===fn&&!vm(r.sliceSerialize(d))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),u):n(f)}}const tp={partial:!0,tokenize:HR};function HR(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const zy={concrete:!0,name:"codeFenced",tokenize:KR};function KR(e,t,n){const r=this,i={partial:!0,tokenize:C};let o=0,s=0,a;return l;function l(w){return c(w)}function c(w){const v=r.events[r.events.length-1];return o=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===a?(s++,e.consume(w),u):s<3?n(w):(e.exit("codeFencedFenceSequence"),Pe(w)?qe(e,f,"whitespace")(w):f(w))}function f(w){return w===null||Ce(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(tp,m,y)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||Ce(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):Pe(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,h,"whitespace")(w)):w===96&&w===a?n(w):(e.consume(w),d)}function h(w){return w===null||Ce(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||Ce(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===a?n(w):(e.consume(w),p)}function m(w){return e.attempt(i,y,g)(w)}function g(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),A}function A(w){return o>0&&Pe(w)?qe(e,x,"linePrefix",o+1)(w):x(w)}function x(w){return w===null||Ce(w)?e.check(tp,m,y)(w):(e.enter("codeFlowValue"),b(w))}function b(w){return w===null||Ce(w)?(e.exit("codeFlowValue"),x(w)):(e.consume(w),b)}function y(w){return e.exit("codeFenced"),t(w)}function C(w,v,D){let N=0;return T;function T(z){return w.enter("lineEnding"),w.consume(z),w.exit("lineEnding"),L}function L(z){return w.enter("codeFencedFence"),Pe(z)?qe(w,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):G(z)}function G(z){return z===a?(w.enter("codeFencedFenceSequence"),X(z)):D(z)}function X(z){return z===a?(N++,w.consume(z),X):N>=s?(w.exit("codeFencedFenceSequence"),Pe(z)?qe(w,Y,"whitespace")(z):Y(z)):D(z)}function Y(z){return z===null||Ce(z)?(w.exit("codeFencedFence"),v(z)):D(z)}}}const Yf={name:"codeIndented",tokenize:VR},JR={partial:!0,tokenize:qR};function VR(e,t,n){return r;function r(a){return e.enter("codeIndented"),Yk(e,i,n,"linePrefix",4,4)(a)}function i(a){return a===null?s(a):Ce(a)?e.attempt(JR,i,s)(a):(e.enter("codeFlowValue"),o(a))}function o(a){return a===null||Ce(a)?(e.exit("codeFlowValue"),i(a)):(e.consume(a),o)}function s(a){return e.exit("codeIndented"),t(a)}}function qR(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Yk(e,t,o,"linePrefix",4,4)(s)}function o(s){return Ce(s)?i(s):n(s)}}const GR={name:"codeText",previous:YR,resolve:QR,tokenize:$R};function QR(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function YR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $R(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,u(f)):Ce(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Ce(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}class ZR{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&na(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),na(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),na(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);na(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);na(this.left,n.reverse())}}}function na(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function e1(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new ZR(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,XR(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return In(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function XR(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,f,d=-1,h=n,p=0,m=0;const g=[m];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(m=d+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),d=g.length;d--;){const A=a.slice(g[d],g[d+1]),x=o.pop();l.push([x,x+A.length-1]),e.splice(x,2,A)}for(l.reverse(),d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const e_={resolve:n_,tokenize:r_},t_={partial:!0,tokenize:i_};function n_(e){return e1(e),e}function r_(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ce(a)?e.check(t_,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function i_(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qe(e,o,"linePrefix")}function o(s){if(s===null||Ce(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function t1(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(A){return A===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(A),e.exit(o),d):A===null||A===32||A===41||ou(A)?n(A):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(A))}function d(A){return A===62?(e.enter(o),e.consume(A),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===62?(e.exit("chunkString"),e.exit(a),d(A)):A===null||A===60||Ce(A)?n(A):(e.consume(A),A===92?p:h)}function p(A){return A===60||A===62||A===92?(e.consume(A),h):h(A)}function m(A){return!u&&(A===null||A===41||ot(A))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(A)):u<c&&A===40?(e.consume(A),u++,m):A===41?(e.consume(A),u--,m):A===null||A===32||A===40||ou(A)?n(A):(e.consume(A),A===92?g:m)}function g(A){return A===40||A===41||A===92?(e.consume(A),m):m(A)}}function n1(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Ce(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Pe(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function r1(e,t,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),c(d))}function c(d){return d===s?(e.exit(o),l(s)):d===null?n(d):Ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),qe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Ce(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(e.consume(d),u):u(d)}}function ka(e,t){let n;return r;function r(i){return Ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pe(i)?qe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const o_={name:"definition",tokenize:a_},s_={partial:!0,tokenize:l_};function a_(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return n1.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ir(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return ot(h)?ka(e,c)(h):c(h)}function c(h){return t1(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(s_,f,f)(h)}function f(h){return Pe(h)?qe(e,d,"whitespace")(h):d(h)}function d(h){return h===null||Ce(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function l_(e,t,n){return r;function r(a){return ot(a)?ka(e,i)(a):n(a)}function i(a){return r1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Pe(a)?qe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ce(a)?t(a):n(a)}}const c_={name:"hardBreakEscape",tokenize:u_};function u_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const f_={name:"headingAtx",resolve:h_,tokenize:d_};function h_(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};In(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])}return e}function d_(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||ot(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Ce(u)?(e.exit("atxHeading"),t(u)):Pe(u)?qe(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||ot(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const i1=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],np=["pre","script","style","textarea"],p_={concrete:!0,name:"htmlFlow",resolveTo:g_,tokenize:A_},m_={partial:!0,tokenize:y_};function g_(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function A_(e,t,n){const r=this;let i,o,s,a,l;return c;function c(k){return u(k)}function u(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),f}function f(k){return k===33?(e.consume(k),d):k===47?(e.consume(k),o=!0,m):k===63?(e.consume(k),i=3,r.interrupt?t:R):Ht(k)?(e.consume(k),s=String.fromCharCode(k),g):n(k)}function d(k){return k===45?(e.consume(k),i=2,h):k===91?(e.consume(k),i=5,a=0,p):Ht(k)?(e.consume(k),i=4,r.interrupt?t:R):n(k)}function h(k){return k===45?(e.consume(k),r.interrupt?t:R):n(k)}function p(k){const K="CDATA[";return k===K.charCodeAt(a++)?(e.consume(k),a===K.length?r.interrupt?t:G:p):n(k)}function m(k){return Ht(k)?(e.consume(k),s=String.fromCharCode(k),g):n(k)}function g(k){if(k===null||k===47||k===62||ot(k)){const K=k===47,M=s.toLowerCase();return!K&&!o&&np.includes(M)?(i=1,r.interrupt?t(k):G(k)):i1.includes(s.toLowerCase())?(i=6,K?(e.consume(k),A):r.interrupt?t(k):G(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):o?x(k):b(k))}return k===45||fn(k)?(e.consume(k),s+=String.fromCharCode(k),g):n(k)}function A(k){return k===62?(e.consume(k),r.interrupt?t:G):n(k)}function x(k){return Pe(k)?(e.consume(k),x):T(k)}function b(k){return k===47?(e.consume(k),T):k===58||k===95||Ht(k)?(e.consume(k),y):Pe(k)?(e.consume(k),b):T(k)}function y(k){return k===45||k===46||k===58||k===95||fn(k)?(e.consume(k),y):C(k)}function C(k){return k===61?(e.consume(k),w):Pe(k)?(e.consume(k),C):b(k)}function w(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),l=k,v):Pe(k)?(e.consume(k),w):D(k)}function v(k){return k===l?(e.consume(k),l=null,N):k===null||Ce(k)?n(k):(e.consume(k),v)}function D(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||ot(k)?C(k):(e.consume(k),D)}function N(k){return k===47||k===62||Pe(k)?b(k):n(k)}function T(k){return k===62?(e.consume(k),L):n(k)}function L(k){return k===null||Ce(k)?G(k):Pe(k)?(e.consume(k),L):n(k)}function G(k){return k===45&&i===2?(e.consume(k),ue):k===60&&i===1?(e.consume(k),re):k===62&&i===4?(e.consume(k),H):k===63&&i===3?(e.consume(k),R):k===93&&i===5?(e.consume(k),Be):Ce(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(m_,_,X)(k)):k===null||Ce(k)?(e.exit("htmlFlowData"),X(k)):(e.consume(k),G)}function X(k){return e.check(tp,Y,_)(k)}function Y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),z}function z(k){return k===null||Ce(k)?X(k):(e.enter("htmlFlowData"),G(k))}function ue(k){return k===45?(e.consume(k),R):G(k)}function re(k){return k===47?(e.consume(k),s="",le):G(k)}function le(k){if(k===62){const K=s.toLowerCase();return np.includes(K)?(e.consume(k),H):G(k)}return Ht(k)&&s.length<8?(e.consume(k),s+=String.fromCharCode(k),le):G(k)}function Be(k){return k===93?(e.consume(k),R):G(k)}function R(k){return k===62?(e.consume(k),H):k===45&&i===2?(e.consume(k),R):G(k)}function H(k){return k===null||Ce(k)?(e.exit("htmlFlowData"),_(k)):(e.consume(k),H)}function _(k){return e.exit("htmlFlow"),t(k)}}function y_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Rl,t,n)}}const b_={name:"htmlText",tokenize:w_};function w_(e,t,n){const r=this;let i,o,s;return a;function a(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),l}function l(R){return R===33?(e.consume(R),c):R===47?(e.consume(R),C):R===63?(e.consume(R),b):Ht(R)?(e.consume(R),D):n(R)}function c(R){return R===45?(e.consume(R),u):R===91?(e.consume(R),o=0,p):Ht(R)?(e.consume(R),x):n(R)}function u(R){return R===45?(e.consume(R),h):n(R)}function f(R){return R===null?n(R):R===45?(e.consume(R),d):Ce(R)?(s=f,re(R)):(e.consume(R),f)}function d(R){return R===45?(e.consume(R),h):f(R)}function h(R){return R===62?ue(R):R===45?d(R):f(R)}function p(R){const H="CDATA[";return R===H.charCodeAt(o++)?(e.consume(R),o===H.length?m:p):n(R)}function m(R){return R===null?n(R):R===93?(e.consume(R),g):Ce(R)?(s=m,re(R)):(e.consume(R),m)}function g(R){return R===93?(e.consume(R),A):m(R)}function A(R){return R===62?ue(R):R===93?(e.consume(R),A):m(R)}function x(R){return R===null||R===62?ue(R):Ce(R)?(s=x,re(R)):(e.consume(R),x)}function b(R){return R===null?n(R):R===63?(e.consume(R),y):Ce(R)?(s=b,re(R)):(e.consume(R),b)}function y(R){return R===62?ue(R):b(R)}function C(R){return Ht(R)?(e.consume(R),w):n(R)}function w(R){return R===45||fn(R)?(e.consume(R),w):v(R)}function v(R){return Ce(R)?(s=v,re(R)):Pe(R)?(e.consume(R),v):ue(R)}function D(R){return R===45||fn(R)?(e.consume(R),D):R===47||R===62||ot(R)?N(R):n(R)}function N(R){return R===47?(e.consume(R),ue):R===58||R===95||Ht(R)?(e.consume(R),T):Ce(R)?(s=N,re(R)):Pe(R)?(e.consume(R),N):ue(R)}function T(R){return R===45||R===46||R===58||R===95||fn(R)?(e.consume(R),T):L(R)}function L(R){return R===61?(e.consume(R),G):Ce(R)?(s=L,re(R)):Pe(R)?(e.consume(R),L):N(R)}function G(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,X):Ce(R)?(s=G,re(R)):Pe(R)?(e.consume(R),G):(e.consume(R),Y)}function X(R){return R===i?(e.consume(R),i=void 0,z):R===null?n(R):Ce(R)?(s=X,re(R)):(e.consume(R),X)}function Y(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||ot(R)?N(R):(e.consume(R),Y)}function z(R){return R===47||R===62||ot(R)?N(R):n(R)}function ue(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function re(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),le}function le(R){return Pe(R)?qe(e,Be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Be(R)}function Be(R){return e.enter("htmlTextData"),s(R)}}const Sm={name:"labelEnd",resolveAll:v_,resolveTo:S_,tokenize:I_},x_={tokenize:E_},k_={tokenize:T_},C_={tokenize:R_};function v_(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&In(e,0,e.length,n),e}function S_(e,t){let n=e.length,r=0,i,o,s;for(;n--;){const u=e[n][1];if(i){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[n][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(i=n,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(o=n)}const a={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return s=[["enter",a,t],["enter",l,t]],s=Jn(s,e.slice(i+1,i+r+3)),s=Jn(s,[["enter",c,t]]),s=Jn(s,Tl(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),s=Jn(s,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),s=Jn(s,e.slice(o+1)),s=Jn(s,[["exit",a,t]]),In(e,i,e.length,s),e}function I_(e,t,n){const r=this,i=r._labelStarts;let o,s;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();o=i[i.length-1]}return a;function a(d){return o?o._inactive?f(d):(s=r.parser.defined.includes(ir(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),l):n(d)}function l(d){return d===40?e.attempt(x_,u,s?u:f)(d):d===91?e.attempt(k_,u,s?c:f)(d):s?u(d):f(d)}function c(d){return e.attempt(C_,u,f)(d)}function u(d){return i.pop(),t(d)}function f(d){return o._balanced=!0,n(d)}}function E_(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ot(f)?ka(e,o)(f):o(f)}function o(f){return f===41?u(f):t1(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ot(f)?ka(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?r1(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return ot(f)?ka(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function T_(e,t,n){const r=this;return i;function i(a){return n1.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ir(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function R_(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const __={name:"labelStartImage",resolveAll:Sm.resolveAll,tokenize:N_};function N_(e,t,n){const r=this;let i;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),i=e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(l))}}const O_={name:"labelStartLink",resolveAll:Sm.resolveAll,tokenize:D_};function D_(e,t,n){const r=this;let i;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),i=e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(a))}}const $f={name:"lineEnding",tokenize:M_};function M_(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const Wc={name:"thematicBreak",tokenize:B_};function B_(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Ce(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Pe(c)?qe(e,a,"whitespace")(c):a(c))}}const kn={continuation:{tokenize:z_},exit:j_,name:"list",tokenize:L_},P_={partial:!0,tokenize:U_},F_={partial:!0,tokenize:W_};function L_(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Xd(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Wc,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Xd(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Rl,r.interrupt?n:u,e.attempt(P_,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return Pe(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function z_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Rl,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Pe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(F_,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function W_(e,t,n){const r=this;return qe(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function j_(e){e.exit(this.containerState.type)}function U_(e,t,n){const r=this;return qe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Pe(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Wy={name:"setextUnderline",resolveTo:H_,tokenize:K_};function H_(e,t){const n=new su;let r=e.length,i,o,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!s&&e[r][1].type==="definition"&&(s=r);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(n.add(o,0,[["enter",a,t]]),n.add(s+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[s][1].end}):e[i][1]=a,n.add(e.length,0,[["exit",a,t]]),n.consume(e),e}function K_(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Pe(c)?qe(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Ce(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const J_={tokenize:V_};function V_(e){const t=this,n=e.attempt(Rl,r,e.attempt(this.parser.constructs.flowInitial,i,qe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(e_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const q_={resolveAll:s1()},G_=o1("string"),Q_=o1("text");function o1(e){return{resolveAll:s1(e==="text"?Y_:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d<f.length;){const h=f[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function s1(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Y_(e,t){const n=new su;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],o=t.sliceStream(i);let s=o.length,a=-1,l=0,c;for(;s--;){const u=o[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(u===-2)c=!0,l++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const u={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:i.start._bufferIndex+a,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...u.start},i.start.offset===i.end.offset?Object.assign(i,u):n.add(r,0,[["enter",u,t],["exit",u,t]])}r++}return n.consume(e),e}const $_={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:$k},Z_={91:o_},X_={[-2]:Yf,[-1]:Yf,32:Yf},eN={35:f_,42:Wc,45:[Wy,Wc],60:p_,61:Wy,95:Wc,96:zy,126:zy},tN={38:Xk,92:Zk},nN={[-5]:$f,[-4]:$f,[-3]:$f,33:__,38:Xk,42:ep,60:[BR,b_],91:O_,92:[c_,Zk],93:Sm,95:ep,96:GR},rN={null:[ep,q_]},iN={null:[42,95]},oN={null:[]},sN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iN,contentInitial:Z_,disable:oN,document:$_,flow:eN,flowInitial:X_,insideSpan:rN,string:tN,text:nN},Symbol.toStringTag,{value:"Module"}));function aN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:v(C),check:v(w),consume:x,enter:b,exit:y,interrupt:v(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(L){return s=Jn(s,L),g(),s[s.length-1]!==null?[]:(D(t,0),c.events=Tl(o,c.events,c),c.events)}function d(L,G){return cN(h(L),G)}function h(L){return lN(s,L)}function p(){const{_bufferIndex:L,_index:G,line:X,column:Y,offset:z}=r;return{_bufferIndex:L,_index:G,line:X,column:Y,offset:z}}function m(L){i[L.line]=L.column,T()}function g(){for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string"){const G=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<L.length;)A(L.charCodeAt(r._bufferIndex))}else A(L)}}function A(L){u=u(L)}function x(L){Ce(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,T()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function b(L,G){const X=G||{};return X.type=L,X.start=p(),c.events.push(["enter",X,c]),a.push(X),X}function y(L){const G=a.pop();return G.end=p(),c.events.push(["exit",G,c]),G}function C(L,G){D(L,G.from)}function w(L,G){G.restore()}function v(L,G){return X;function X(Y,z,ue){let re,le,Be,R;return Array.isArray(Y)?_(Y):"tokenize"in Y?_([Y]):H(Y);function H(V){return me;function me(fe){const ae=fe!==null&&V[fe],we=fe!==null&&V.null,I=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(we)?we:we?[we]:[]];return _(I)(fe)}}function _(V){return re=V,le=0,V.length===0?ue:k(V[le])}function k(V){return me;function me(fe){return R=N(),Be=V,V.partial||(c.currentConstruct=V),V.name&&c.parser.constructs.disable.null.includes(V.name)?M():V.tokenize.call(G?Object.assign(Object.create(c),G):c,l,K,M)(fe)}}function K(V){return L(Be,R),z}function M(V){return R.restore(),++le<re.length?k(re[le]):ue}}}function D(L,G){L.resolveAll&&!o.includes(L)&&o.push(L),L.resolve&&In(c.events,G,c.events.length-G,L.resolve(c.events.slice(G),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function N(){const L=p(),G=c.previous,X=c.currentConstruct,Y=c.events.length,z=Array.from(a);return{from:Y,restore:ue};function ue(){r=L,c.previous=G,c.currentConstruct=X,c.events.length=Y,a=z,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lN(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function cN(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
3
+ `;break}case-3:{s=`\r
4
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function uN(e){const r={constructs:qk([sN,...(e||{}).extensions||[]]),content:i(TR),defined:[],document:i(_R),flow:i(J_),lazy:{},string:i(G_),text:i(Q_)};return r;function i(o){return s;function s(a){return aN(r,o,a)}}}function fN(e){for(;!e1(e););return e}const jy=/[\0\t\n\r]/g;function hN(){let e=1,t="",n=!0,r;return i;function i(o,s,a){o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o));const l=[];let c=0;for(t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){jy.lastIndex=c;const u=jy.exec(o),f=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(f);if(!u){t=o.slice(c);break}if(d===10&&c===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<f&&(l.push(o.slice(c,f)),e+=f-c),d){case 0:{l.push(65533),e++;break}case 9:{const h=Math.ceil(e/4)*4;for(l.push(-2);e++<h;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const dN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function a1(e){return e.replace(dN,pN)}function pN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Gk(n.slice(o?2:1),o?16:10)}return vm(n)||e}function Ca(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uy(e.position):"start"in e||"end"in e?Uy(e):"line"in e||"column"in e?rp(e):""}function rp(e){return Hy(e&&e.line)+":"+Hy(e&&e.column)}function Uy(e){return rp(e&&e.start)+"-"+rp(e&&e.end)}function Hy(e){return e&&typeof e=="number"?e:1}const l1={}.hasOwnProperty;function mN(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),gN(n)(fN(uN(n).document().write(hN()(e,t,!0))))}function gN(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(j),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(F),blockQuote:s(I),characterEscape:T,characterReference:T,codeFenced:s(E),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(E,a),codeText:s(B,a),codeTextData:T,data:T,codeFlowValue:T,definition:s(q),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(U),hardBreakEscape:s(ee),hardBreakTrailing:s(ee),htmlFlow:s(W,a),htmlFlowData:T,htmlText:s(W,a),htmlTextData:T,image:s(ne),label:a,link:s(j),listItem:s(se),listItemValue:h,listOrdered:s(he,d),listUnordered:s(he),paragraph:s(de),reference:K,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(F),strong:s(ye),thematicBreak:s(ze)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:we,autolinkProtocol:ae,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:me,characterReference:fe,codeFenced:c(A),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:c(x),codeText:c(ue),codeTextData:L,data:L,definition:c(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(X),hardBreakTrailing:c(X),htmlFlow:c(Y),htmlFlowData:L,htmlText:c(z),htmlTextData:L,image:c(le),label:R,labelText:Be,lineEnding:G,link:c(re),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:M,resourceDestinationString:H,resourceTitleString:_,resource:k,setextHeading:c(N),setextHeadingLineSequence:D,setextHeadingText:v,strong:c(),thematicBreak:c()}};c1(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(P){let Q={type:"root",children:[],position:void 0};const pe={stack:[Q],tokenStack:[],config:t,enter:l,exit:u,buffer:a,resume:f,data:n},ge=[],Ze=[];let We=-1;for(;++We<P.length;)if(Ze.push(P[We]),P[We][1].type==="listOrdered"||P[We][1].type==="listUnordered")if(P[We][0]==="enter")ge.push(Ze.length-1);else{const bt=ge.pop();o(Ze,bt)}for(P=Ze,We=-1;++We<P.length;){const bt=t[P[We][0]];P[We][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...pe,sliceSerialize:P[We][2].sliceSerialize},P[We][1]),l1.call(bt,P[We][1].type)&&bt[P[We][1].type].call({...pe,sliceSerialize:P[We][2].sliceSerialize},P[We][1]),P[We][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...pe,sliceSerialize:P[We][2].sliceSerialize},P[We][1])}if(pe.tokenStack.length>0){const bt=pe.tokenStack[pe.tokenStack.length-1];(bt[1]||Ky).call(pe,void 0,bt[0])}for(Q.position={start:mi(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:mi(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<t.transforms.length;)Q=t.transforms[We](Q)||Q;return Q}function i(P,Q,pe){let ge=-1;for(;++ge<P.length;)P[ge].call(Q,pe)}function o(P,Q){const pe=P.length-1;let ge=Q-1,Ze=-1,We=!1,bt,nt,gt,_n;const Nn=[];for(;++ge<=pe;){const Gt=P[ge];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?Ze++:Ze--,_n=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(bt&&!_n&&!Ze&&!gt&&(gt=ge),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!Ze&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||Ze===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(bt){let mr=ge;for(nt=void 0;mr--;){const On=P[mr];if(On[1].type==="lineEnding"||On[1].type==="lineEndingBlank"){if(On[0]==="exit")continue;nt&&(P[nt][1].type="lineEndingBlank",We=!0),On[1].type="lineEnding",nt=mr}else if(!(On[1].type==="linePrefix"||On[1].type==="blockQuotePrefix"||On[1].type==="blockQuotePrefixWhitespace"||On[1].type==="blockQuoteMarker"||On[1].type==="listItemIndent"))break}gt&&(!nt||gt<nt)&&(bt._spread=!0),bt.end=Object.assign({},nt?P[nt][1].start:Gt[1].end),Nn.push({at:nt||ge,event:["exit",bt,Gt[2]]})}if(Gt[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};bt=mr,Nn.push({at:ge,event:["enter",mr,Gt[2]]}),gt=void 0,_n=!0}}}const Zs=P.splice(Q);let Zo=0;for(ge=-1;++ge<Zs.length;){for(;Zo<Nn.length&&Nn[Zo].at===Q+ge;)P.push(Nn[Zo++].event);P.push(Zs[ge])}P[Q][1]._spread=We}function s(P,Q){return pe;function pe(ge){l.call(this,P(ge),ge),Q&&Q.call(this,ge)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(P,Q,pe){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([Q,pe||void 0]),P.position={start:mi(Q.start),end:void 0}}function c(P){return Q;function Q(pe){P&&P.call(this,pe),u.call(this,pe)}}function u(P,Q){const pe=this.stack.pop(),ge=this.tokenStack.pop();if(!ge)throw new Error("Cannot close `"+P.type+"` ("+Ca({start:P.start,end:P.end})+"): it’s not open");ge[0].type!==P.type&&(Q?Q.call(this,P,ge[0]):(ge[1]||Ky).call(this,P,ge[0])),pe.position.end=mi(P.end)}function f(){return Cm(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(P){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function p(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=P}function m(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=P}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.value=P.replace(/(\r?\n|\r)$/g,"")}function b(P){const Q=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Q,pe.identifier=ir(this.sliceSerialize(P)).toLowerCase()}function y(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.title=P}function C(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.url=P}function w(P){const Q=this.stack[this.stack.length-1];if(!Q.depth){const pe=this.sliceSerialize(P).length;Q.depth=pe}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function D(P){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function T(P){const pe=this.stack[this.stack.length-1].children;let ge=pe[pe.length-1];(!ge||ge.type!=="text")&&(ge=De(),ge.position={start:mi(P.start),end:void 0},pe.push(ge)),this.stack.push(ge)}function L(P){const Q=this.stack.pop();Q.value+=this.sliceSerialize(P),Q.position.end=mi(P.end)}function G(P){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=Q.children[Q.children.length-1];pe.position.end=mi(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(T.call(this,P),L.call(this,P))}function X(){this.data.atHardBreak=!0}function Y(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.value=P}function z(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.value=P}function ue(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.value=P}function re(){const P=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=Q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function le(){const P=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=Q,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function Be(P){const Q=this.sliceSerialize(P),pe=this.stack[this.stack.length-2];pe.label=a1(Q),pe.identifier=ir(Q).toLowerCase()}function R(){const P=this.stack[this.stack.length-1],Q=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const ge=P.children;pe.children=ge}else pe.alt=Q}function H(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.url=P}function _(){const P=this.resume(),Q=this.stack[this.stack.length-1];Q.title=P}function k(){this.data.inReference=void 0}function K(){this.data.referenceType="collapsed"}function M(P){const Q=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Q,pe.identifier=ir(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function V(P){this.data.characterReferenceType=P.type}function me(P){const Q=this.sliceSerialize(P),pe=this.data.characterReferenceType;let ge;pe?(ge=Gk(Q,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=vm(Q);const Ze=this.stack[this.stack.length-1];Ze.value+=ge}function fe(P){const Q=this.stack.pop();Q.position.end=mi(P.end)}function ae(P){L.call(this,P);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(P)}function we(P){L.call(this,P);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(P)}function I(){return{type:"blockquote",children:[],position:void 0}}function E(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function B(){return{type:"inlineCode",value:"",position:void 0}}function q(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function U(){return{type:"emphasis",children:[],position:void 0}}function F(){return{type:"heading",depth:0,children:[],position:void 0}}function ee(){return{type:"break",position:void 0}}function W(){return{type:"html",value:"",position:void 0}}function ne(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function j(){return{type:"link",title:null,url:"",children:[],position:void 0}}function he(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[],position:void 0}}function se(P){return{type:"listItem",spread:P._spread,checked:null,children:[],position:void 0}}function de(){return{type:"paragraph",children:[],position:void 0}}function ye(){return{type:"strong",children:[],position:void 0}}function De(){return{type:"text",value:"",position:void 0}}function ze(){return{type:"thematicBreak",position:void 0}}}function mi(e){return{line:e.line,column:e.column,offset:e.offset}}function c1(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?c1(e,r):AN(e,r)}}function AN(e,t){let n;for(n in t)if(l1.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ky(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ca({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ca({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ca({start:t.start,end:t.end})+") is still open")}function ip(e){const t=this;t.parser=n;function n(r){return mN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const $u=(function(e){if(e==null)return xN;if(typeof e=="function")return Zu(e);if(typeof e=="object")return Array.isArray(e)?yN(e):bN(e);if(typeof e=="string")return wN(e);throw new Error("Expected function, string, or object as test")});function yN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$u(e[n]);return Zu(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function bN(e){const t=e;return Zu(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function wN(e){return Zu(t);function t(n){return n&&n.type===e}}function Zu(e){return t;function t(n,r,i){return!!(kN(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function xN(){return!0}function kN(e){return e!==null&&typeof e=="object"&&"type"in e}const u1=$u(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]),Jy={}.hasOwnProperty;function CN(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Jy.call(i,e)){const l=String(i[e]);s=Jy.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const vN={}.hasOwnProperty;function f1(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)f1(e,t.extensions[n]);for(r in t)if(vN.call(t,r))switch(r){case"extensions":break;case"unsafe":{Vy(e[r],t[r]);break}case"join":{Vy(e[r],t[r]);break}case"handlers":{SN(e[r],t[r]);break}default:e.options[r]=t[r]}return e}function Vy(e,t){t&&e.push(...t)}function SN(e,t){t&&Object.assign(e,t)}function IN(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),EN);return i(),s}function EN(e,t,n){return">"+(n?"":" ")+e}function h1(e,t){return qy(e,t.inConstruct,!0)&&!qy(e,t.notInConstruct,!1)}function qy(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Gy(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const o=n.unsafe[i];if(o.character===`
5
+ `&&!o.before&&!o.after&&h1(n.stack,o))return/[\t ]/.test(r.before)?"":" "}return`\\
6
+ `}function TN(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function op(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function RN(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _N(e,t,n,r){const i=RN(n),o=e.value||"";if(op(e,n)){const f=n.enter("codeIndented"),d=n.indentLines(o,NN);return f(),d}const s=n.createTracker(r),a=i.repeat(Math.max(TN(o,i)+1,3)),l=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let u=s.move(a);if(e.lang){const f=n.enter(`codeFencedLang${c}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${c}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
7
+ `,encode:["`"],...s.current()})),f()}return u+=s.move(`
8
+ `),o&&(u+=s.move(o+`
9
+ `)),u+=s.move(a),l(),u}function NN(e,t,n){return(n?"":" ")+e}function Im(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ON(e,t,n,r){const i=Im(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
10
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function DN(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Em.attention=MN;Em.peek=BN;function Em(e,t,n,r){const i=n.enter("phrasing"),o=n.containerPhrasing({type:"root",children:[e]},r);return i(),o}function MN(e,t){return{construct:"emphasis",markers:DN(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function BN(e,t,n){return n.options.emphasis||"*"}function Tm(e){return"&#x"+e.toString(16).toUpperCase()+";"}const d1=[],PN=!0,sp=!1,au="skip";function Rm(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=$u(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=d1,p,m,g;if((!t||o(l,c,u[u.length-1]||void 0))&&(h=FN(n(l,u)),h[0]===sp))return h;if("children"in l&&l.children){const A=l;if(A.children&&h[0]!==au)for(m=(r?A.children.length:-1)+s,g=u.concat(A);m>-1&&m<A.children.length;){const x=A.children[m];if(p=a(x,m,g)(),p[0]===sp)return p;m=typeof p[1]=="number"?p[1]:m+s}}return h}}}function FN(e){return Array.isArray(e)?e:typeof e=="number"?[PN,e]:e==null?d1:[e]}function qo(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Rm(e,o,a,i);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}function p1(e,t){let n=!1;return qo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,sp}),!!((!e.depth||e.depth<3)&&Cm(e)&&(t.options.setext||n))}function LN(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(p1(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
11
+ `,after:`
12
+ `});return d(),f(),h+`
13
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
14
+ `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
15
+ `,...o.current()});const u=c.charCodeAt(0);return(u===9||u===32)&&(c=Tm(u)+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}m1.peek=zN;function m1(e){return e.value||""}function zN(){return"<"}g1.peek=WN;function g1(e,t,n,r){const i=Im(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),s(),c}function WN(){return"!"}A1.peek=jN;function A1(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=u.filter(function(d){return d!=="phrasing"}),s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function jN(){return"!"}y1.peek=UN;function y1(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);if(!s.atBreak)continue;let l;for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function UN(){return"`"}function b1(e,t){const n=Cm(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}w1.peek=HN;function w1(e,t,n,r){const i=Im(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);if(b1(e,n)){const u=n.stack;n.stack=u.filter(function(h){return h!=="phrasing"});const f=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),f(),n.stack=u,d}const a=n.enter("link");let l=n.enter("label"),c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function HN(e,t,n){return b1(e,n)?"<":"["}x1.peek=KN;function x1(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=u.filter(function(d){return d!=="phrasing"}),s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function KN(){return"["}function _m(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function JN(e){const t=_m(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VN(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function k1(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function qN(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?VN(n):_m(n);const a=e.ordered?s==="."?")":".":JN(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),k1(n)===s&&u){let f=-1;for(;++f<e.children.length;){const d=e.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function GN(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QN(e,t,n,r){const i=GN(n);let o=n.bulletCurrent||_m(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,d,h){return d?(h?"":" ".repeat(s))+f:(h?o:o+" ".repeat(s-o.length))+f}}function YN(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}function $N(e,t,n,r){if(!e.children.some(function(a){return u1(a)}))return n.containerFlow(e,r);const o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),s}function ZN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Nm.attention=XN;Nm.peek=eO;function Nm(e,t,n,r){const i=n.enter("phrasing"),o=n.containerPhrasing({type:"root",children:[e]},r);return i(),o}function XN(e,t){return{construct:"strong",markers:ZN(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function eO(e,t,n){return n.options.strong||"*"}function tO(e,t,n,r){const i=t?t.children:[],o=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[o+1],beforeNode:i[o-1]})}function nO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function rO(e,t,n){const r=(k1(n)+(n.options.ruleSpaces?" ":"")).repeat(nO(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Om={blockquote:IN,break:Gy,code:_N,definition:ON,emphasis:Em,hardBreak:Gy,heading:LN,html:m1,image:g1,imageReference:A1,inlineCode:y1,link:w1,linkReference:x1,list:qN,listItem:QN,paragraph:YN,root:$N,strong:Nm,text:tO,thematicBreak:rO};function ap(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const a=e.charCodeAt(2);return a===45?2:a===91?5:Ht(a)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,o=e.charCodeAt(i);if(!Ht(o))return;for(;o===45||fn(o);)o=e.charCodeAt(++i);const s=e.slice(r,i).toLowerCase();return!n&&o!==47&&np.includes(s)?1:i1.includes(s)?6:7}const iO=[oO];function oO(e,t,n,r){if(t.type==="code"&&op(t,r)&&(e.type==="list"||e.type===t.type&&op(e,r)))return!1;if("spread"in n&&typeof n.spread=="boolean"){if(e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&p1(t,r)))return;if(e.type==="html"){const i=ap(e.value);if(i===void 0||i===6||i===7)return 1}if(e.type==="paragraph"&&t.type==="html"){const i=ap(t.value);if(i===void 0||i===7)return 1}return n.spread?1:0}}const so=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],C1=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
16
+ `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\r",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\r",after:"\\r",inConstruct:"phrasing"},{character:`
17
+ `,before:"\\n",inConstruct:"phrasing"},{character:`
18
+ `,after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:so},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
19
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:so},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
20
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:so},{atBreak:!0,character:"+",after:`(?:[ \r
21
+ ])`},{atBreak:!0,character:"-",after:`(?:[ \r
22
+ -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
23
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:so},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:so},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:so},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:so},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"",inConstruct:"autolink"}];let Qy=-1;for(;++Qy<33;)C1.push({character:String.fromCharCode(Qy),inConstruct:"autolink"});function sO(e){return e.label||!e.identifier?e.label||"":a1(e.identifier)}function aO(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((e.beforeNode?"^":t?"("+t+")":"")+(/[$()*+.?[\\\]^{|}]/.test(e.character)?"\\":"")+e.character+(e.afterNode?"$":e.after?"(?:"+e.after+")":""),e.unicode?"gu":"g")}return e._compiled}function lu(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function va(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Yy(e,t,n){const r=Gn(e),i=Gn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}const lO=new Map([["*",!1],["_",!0]]);function cO(e,t,n){const r=new Set;for(const o of e){const s=n.get(o);if(s&&o.attention&&t.some(a=>a.attention===o.attention))for(const a of s.tokens)r.add(a.attention)}const i=[];for(const o of e)o.attention&&r.delete(o.attention)&&i.push(o.attention);return i.reverse(),i}function v1(e,t,n){const r=[],i=new Map,o=new Map;let s=0;for(;s<e.length;){if(!e[s].attention){s++;continue}const a=e[s].value.charAt(0),l=lO.get(a);let c=s+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===a;)c++;const u=s?e[s-1].value:t,f=Gn(u.charCodeAt(u.length-1)),d=Gn((c<e.length?e[c].value:n).charCodeAt(0)),h=!d||d===2&&!!f,p=!f||f===2&&!!d,m={tokens:e.slice(s,c),markers:[],start:0,end:0,open:l?h&&(!!f||!p):h,close:l?p&&(!!d||!h):p,split:l!==void 0};for(const g of m.tokens){i.set(g,[...m.tokens]),o.set(g,m);let A=g.value.length;for(;A--;)m.markers.push(g)}m.end=m.markers.length,r.push(m),s=c}for(hO(r,i),s=-1;++s<e.length;){const a=i.get(e[s]);if(a)return{attention:cO(e,a,o),index:s}}}function uO(e,t,n){return lp(S1(e,t,n),n.before,n.after)}function hc(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?lu(n.value):va(n.value),i=Tm(r.codePointAt(0));n.value=t?i+n.value.slice(r.length):n.value.slice(0,n.value.length-r.length)+i}function fO(e,t,n,r,i){for(const o of n.attention){const s=t.get(o)||o.sequences[0];for(const a of o.sequences){if(a===s)continue;const l=new Map(t);l.set(o,a);const c=Dm(e,l,r,i),u=v1(c,r,i);if(!u||u.index>n.index)return{chosen:l,mistake:u,tokens:c}}}}function hO(e,t){let n=0;for(;n<e.length;){const r=e[n],i=r.tokens[0].value.charAt(0),o=r.end-r.start;let s=r.close&&o?n:0;for(;s--;){const a=e[s],l=a.end-a.start;if(a.tokens[0].value.charAt(0)===i&&a.open&&l&&(r.split?!((a.close||r.open)&&o%3)||(l+o)%3:l===a.markers.length&&l===o)){const c=r.split?l>1&&o>1?2:1:o,u=a.markers.slice(a.end-c,a.end),f=r.markers.slice(r.start,r.start+c),d=u[0],h=f[0];if(d===u[c-1]&&d.value.length===c&&h===f[c-1]&&h.value.length===c&&d.attention===h.attention)t.delete(d),t.delete(h);else{const p=[...new Set([...u,...f])];for(const m of p){const g=t.get(m);g&&g.push(...p)}}a.end-=c,r.start+=c;break}}(s===-1||r.start===r.end)&&n++}}function dO(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!Qk(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const o of n)r.push(i.repeat(o))}return r}function S1(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<i.length;){const c=i[s];let u;if(r[r.length-1]=s,s+1<i.length){let h=t.handle.handlers[i[s+1].type];h&&h.peek&&(h=h.peek),u=h?lu(h(i[s+1],e,t,{before:"",after:"",...l.current()})):""}else u=n.after;const f=o[o.length-1];typeof f=="string"&&(a==="\r"||a===`
24
+ `)&&c.type==="html"&&ap(c.value)!==7&&(o[o.length-1]=f.replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(lp(o,n.before,n.after)));const d=t.handle.handlers[c.type];if(d&&d.attention){const{construct:h,markers:p,sizes:m}=d.attention(c,t),g=dO(c.type,p,m),A=g[0],x=t.enter(h);l.move(A);const b=S1(c,t,{...l.current(),before:A,after:A});l.move(lp(b,A,A)),l.move(A),x(),o.push({children:b,sequences:g}),a=A.charAt(A.length-1)}else{const h=t.handle(c,e,t,{...l.current(),after:u,before:a});if(!h)continue;l.move(h),o.push(h),a=va(h)}}return r.pop(),o}function Dm(e,t,n,r){const i=[];let o,s=va(n),a=-1;for(;++a<e.length;){const l=e[a];if(typeof l=="string"){const b={value:l,attention:void 0};o&&o===lu(l)&&hc([b],!0),o=void 0,i.push(b),b.value&&(s=va(b.value));continue}const c=t.get(l)||l.sequences[0],u=c.charAt(0),f=e[a+1],d=s,h=lu(f===void 0?r:typeof f=="string"?f:t.get(f)||f.sequences[0]),p=Dm(l.children,t,c,c),m=p.length>0?p[0].value:"",g=Yy(d.charCodeAt(d.length-1),m.charCodeAt(0),u);g.inside&&hc(p,!0);const A=p.length>0?va(p[p.length-1].value):"",x=Yy(h.charCodeAt(0),A.charCodeAt(A.length-1),u);x.inside&&hc(p,!1),g.outside&&d!==`
25
+ `&&d!=="\r"&&hc(i,!1),x.outside&&(o=h),i.push({value:c,attention:l},...p,{value:c,attention:l}),s=c.charAt(c.length-1)}return i}function lp(e,t,n){let r=new Map;const i=Dm(e,r,t,n);let o=i,s=v1(o,t,n);for(;s;){const l=fO(e,r,s,t,n);if(!l){o=i;break}r=l.chosen,o=l.tokens,s=l.mistake}let a="";for(const l of o)a+=l.value;return a}function pO(e,t,n){const r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<i.length;){const l=i[a];r[r.length-1]=a,s.push(o.move(t.handle(l,e,t,{before:`
26
+ `,after:`
27
+ `,...o.current()}))),l.type!=="list"&&(t.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(mO(l,i[a+1],e,t)))}return r.pop(),s.join("")}function mO(e,t,n,r){let i=r.join.length;for(;i--;){const o=r.join[i](e,t,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
28
+ `.repeat(1+o);if(o===!1)return`
29
+
30
+ <!---->
31
+
32
+ `}return`
33
+
34
+ `}const gO=/\r?\n|\r/g;function AO(e,t){const n=[];let r=0,i=0,o;for(;o=gO.exec(e);)s(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),n.join("");function s(a){n.push(t(a,i,!a))}}const Zf={}.hasOwnProperty;function yO(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],s={},a=e.stack.includes("autolink"),l=n.before?n.before.length:0,c=r.length-(n.after?n.after.length:0);let u=-1;for(;++u<e.unsafe.length;){const h=e.unsafe[u];if(!h1(e.stack,h)||!$y(h.beforeNode,n.beforeNode)||!$y(h.afterNode,n.afterNode))continue;const p=e.compilePattern(h),m=h.beforeNode?l:0,g=r.slice(m,h.afterNode?c:void 0);let A;for(;A=p.exec(g);){const x="before"in h||!!h.atBreak,b="after"in h,y=m+A.index+(x?A[1].length:0);Zf.call(s,y)?(s[y].before&&!x&&(s[y].before=!1),s[y].after&&!b&&(s[y].after=!1)):(i.push(y),s[y]={before:x,after:b})}}i.sort(bO);let f=l;for(u=-1;++u<i.length;){const h=i[u];if(!(h<f||h>=c)){if(r.charAt(h)==="_"&&h>0&&Gn(r.charCodeAt(h-1))===void 0&&!Zf.call(s,h-1)&&!(h-1===l&&/[*_]/.test(r.charAt(l-1)))){let p=h+1;for(;p<c&&r.charAt(p)==="_";)p++;const m=p-h-1;if(i[u+m]===p-1&&p<r.length&&Gn(r.charCodeAt(p))===void 0&&!Zf.call(s,p)&&!(p===c-1&&/[*_]/.test(r.charAt(c)))){u+=m;continue}}if(!(h+1<c&&i[u+1]===h+1&&s[h].after&&!s[h+1].before&&!s[h+1].after||i[u-1]===h-1&&s[h].before&&!s[h-1].before&&!s[h-1].after)){if(f!==h){const p=r.slice(f,h);o.push(a?p:Zy(p,"\\"))}f=h,a?(o.push("%"+r.charCodeAt(h).toString(16).toUpperCase().padStart(2,"0")),f++):/[!-/:-@[-`{-~]/.test(r.charAt(h))&&(!n.encode||!n.encode.includes(r.charAt(h)))?o.push("\\"):(o.push(Tm(r.charCodeAt(h))),f++)}}}const d=r.slice(f,c);return o.push(a?d:Zy(d,n.after)),o.join("")}function $y(e,t){return e?t?typeof e=="string"?e===t.type:e.includes(t.type):!1:!0}function bO(e,t){return e-t}function Zy(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+t;let s=-1,a=0,l;for(;l=n.exec(o);)r.push(l.index);for(;++s<r.length;)a!==r[s]&&i.push(e.slice(a,r[s])),i.push("\\"),a=r[s];return i.push(e.slice(a)),i.join("")}function wO(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:l,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:r}}function a(c){r+=c}function l(c){const u=c||"",f=u.split(/\r?\n|\r/g),d=f[f.length-1];return i+=f.length-1,o=f.length===1?o+d.length:1+d.length+r,u}}function xO(e,t){const n=t||{},r={associationId:sO,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:SO,containerFlow:IO,createTracker:wO,compilePattern:aO,enter:o,handlers:{...Om},handle:void 0,indentLines:AO,indexStack:[],join:[...iO],options:{},safe:EO,stack:[],unsafe:[...C1]};f1(r,n),r.options.tightDefinitions&&r.join.push(vO),r.handle=CN("type",{invalid:kO,unknown:CO,handlers:r.handlers});let i=r.handle(u1(e)?{type:"root",children:[e]}:e,void 0,r,{before:`
35
+ `,after:`
36
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
37
+ `),i;function o(s){return r.stack.push(s),a;function a(){r.stack.pop()}}}function kO(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function CO(e){const t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function vO(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function SO(e,t){return uO(e,this,t)}function IO(e,t){return pO(e,this,t)}function EO(e,t){return yO(this,e,t)}function cp(e){const t=this;t.compiler=n;function n(r){return xO(r,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function Xy(e){if(e)throw e}var eb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TO(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Xf,tb;function RO(){if(tb)return Xf;tb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var d;for(d in c);return typeof d>"u"||e.call(c,d)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Xf=function l(){var c,u,f,d,h,p,m=arguments[0],g=1,A=arguments.length,x=!1;for(typeof m=="boolean"&&(x=m,m=arguments[1]||{},g=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});g<A;++g)if(c=arguments[g],c!=null)for(u in c)f=a(m,u),d=a(c,u),m!==d&&(x&&d&&(o(d)||(h=i(d)))?(h?(h=!1,p=f&&i(f)?f:[]):p=f&&o(f)?f:{},s(m,{name:u,newValue:l(x,p,d)})):typeof d<"u"&&s(m,{name:u,newValue:d}));return m},Xf}var _O=RO();const eh=_l(_O);function qq(){}function up(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NO(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let f=-1;if(l){s(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?OO(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function OO(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}class Tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ca(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tn.prototype.file="";Tn.prototype.name="";Tn.prototype.reason="";Tn.prototype.message="";Tn.prototype.stack="";Tn.prototype.column=void 0;Tn.prototype.line=void 0;Tn.prototype.ancestors=void 0;Tn.prototype.cause=void 0;Tn.prototype.fatal=void 0;Tn.prototype.place=void 0;Tn.prototype.ruleId=void 0;Tn.prototype.source=void 0;const br={basename:DO,dirname:MO,extname:BO,join:PO,sep:"/"};function DO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nl(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function MO(e){if(Nl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function BO(e){Nl(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function PO(...e){let t=-1,n;for(;++t<e.length;)Nl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":FO(n)}function FO(e){Nl(e);const t=e.codePointAt(0)===47;let n=LO(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function LO(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Nl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zO={cwd:WO};function WO(){return"/"}function fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jO(e){if(typeof e=="string")e=new URL(e);else if(!fp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return UO(e)}function UO(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const th=["history","path","basename","stem","extname","dirname"];class HO{constructor(t){let n;t?fp(t)?n={path:t}:typeof t=="string"||KO(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":zO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<th.length;){const o=th[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)th.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){rh(t,"basename"),nh(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){nb(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(nh(t,"extname"),nb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){fp(t)&&(t=jO(t)),rh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){rh(t,"stem"),nh(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Tn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function nh(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function rh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JO=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),VO={}.hasOwnProperty;class Mm extends JO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=NO()}copy(){const t=new Mm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(eh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(sh("data",this.frozen),this.namespace[t]=n,this):VO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(sh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=dc(t),r=this.parser||this.Parser;return ih("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ih("process",this.parser||this.Parser),oh("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=dc(t),l=r.parse(a);r.run(l,a,function(u,f,d){if(u||!f||!d)return c(u);const h=f,p=r.stringify(h,d);GO(p)?d.value=p:d.result=p,c(u,d)});function c(u,f){u||!f?s(u):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ih("processSync",this.parser||this.Parser),oh("processSync",this.compiler||this.Compiler),this.process(t,i),ib("processSync","process",n),r;function i(o,s){n=!0,Xy(o),r=s}}run(t,n,r){rb(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=dc(n);i.run(t,l,c);function c(u,f,d){const h=f||t;u?a(u):s?s(h):r(void 0,h,d)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),ib("runSync","run",r),i;function o(s,a){Xy(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=dc(n),i=this.compiler||this.Compiler;return oh("stringify",i),rb(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(sh("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=eh(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];o(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===c){d=f;break}if(d===-1)r.push([c,...u]);else if(u.length>0){let[h,...p]=u;const m=r[d][1];up(m)&&up(h)&&(h=eh(!0,m,h)),r[d]=[c,h,...p]}}}}const hp=new Mm().freeze();function ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function oh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rb(e){if(!up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ib(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function dc(e){return qO(e)?e:new HO(e)}function qO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function GO(e){return typeof e=="string"||QO(e)}function QO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function zt(e){this.content=e}zt.prototype={constructor:zt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new zt(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new zt(n)},addToStart:function(e,t){return new zt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new zt(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new zt(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=zt.from(e),e.size?new zt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=zt.from(e),e.size?new zt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=zt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};zt.from=function(e){if(e instanceof zt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new zt(t)};function I1(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){let s=i.text,a=o.text,l=0;for(;s[l]==a[l];l++)n++;return l&&l<s.length&&l<a.length&&R1(s.charCodeAt(l-1))&&T1(s.charCodeAt(l))&&n--,n}if(i.content.size||o.content.size){let s=I1(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function E1(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=s.text,u=a.text,f=c.length,d=u.length;for(;f>0&&d>0&&c[f-1]==u[d-1];)f--,d--,n--,r--;return f&&d&&f<c.length&&R1(c.charCodeAt(f-1))&&T1(c.charCodeAt(f))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let c=E1(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function T1(e){return e>=56320&&e<57344}function R1(e){return e>=55296&&e<56320}let oe=class on{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new on(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new on(r,i)}cutByIndex(t,n){return t==n?on.empty:t==0&&n==this.content.length?this:new on(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new on(i,o)}addToStart(t){return new on([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new on(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return I1(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return E1(this,t,n,r)}findIndex(t){if(t==0)return pc(0,t);if(t==this.size)return pc(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?pc(n+1,o):pc(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return on.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return on.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return on.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new on(n||t,r)}static from(t){if(!t)return on.empty;if(t instanceof on)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new on([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};oe.empty=new oe([],0);const ah={index:0,offset:0};function pc(e,t){return ah.index=e,ah.offset=t,ah}function cu(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!cu(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!cu(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Ve{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&cu(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ve.none;if(t instanceof Ve)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}Ve.none=[];class Ja extends Error{}class ce{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=N1(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new ce(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ce(_1(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ce.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ce(oe.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ce(t,r,i)}}ce.empty=new ce(oe.empty,0,0);function _1(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(_1(o.content,t-i-1,n-i-1)))}function N1(e,t,n,r,i,o){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=N1(l.content,t-a-1,n,s==0?r-1:0,s==e.childCount-1?i-1:0,l);return c&&e.replaceChild(s,l.copy(c))}function YO(e,t,n){if(n.openStart>e.depth)throw new Ja("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ja("Inconsistent open depths");return O1(e,t,n,0)}function O1(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=O1(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return vo(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=$O(n,e);return vo(o,M1(e,s,a,t,r))}else return vo(o,uu(e,t,r))}function D1(e,t){if(!t.type.compatibleContent(e.type))throw new Ja("Cannot join "+t.type.name+" onto "+e.type.name)}function dp(e,t,n){let r=e.node(n);return D1(r,t.node(n)),r}function Co(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Sa(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Co(e.nodeAfter,r),o++));for(let a=o;a<s;a++)Co(i.child(a),r);t&&t.depth==n&&t.textOffset&&Co(t.nodeBefore,r)}function vo(e,t){if(!e.type.validContent(t))throw new Ja("Invalid content for node "+e.type.name);return e.copy(t)}function M1(e,t,n,r,i){let o=e.depth>i&&dp(e,t,i+1),s=r.depth>i&&dp(n,r,i+1),a=[];return Sa(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(D1(o,s),Co(vo(o,M1(e,t,n,r,i+1)),a)):(o&&Co(vo(o,uu(e,t,i+1)),a),Sa(t,n,i,a),s&&Co(vo(s,uu(n,r,i+1)),a)),Sa(r,null,i,a),new oe(a)}function uu(e,t,n){let r=[];if(Sa(null,e,n,r),e.depth>n){let i=dp(e,t,n+1);Co(vo(i,uu(e,t,n+1)),r)}return Sa(t,null,n,r),new oe(r)}function $O(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(oe.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Va{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ve.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new B1(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Va(n,r,o)}static resolveCached(t,n){let r=ob.get(t);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else ob.set(t,r=new ZO);let i=r.elts[r.i]=Va.resolve(t,n);return r.i=(r.i+1)%XO,i}}class ZO{constructor(){this.elts=[],this.i=0}}const XO=12,ob=new WeakMap;class B1{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const eD=Object.create(null);let ei=class pp{constructor(t,n,r,i=Ve.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&cu(this.attrs,n||t.defaultAttrs||eD)&&Ve.sameSet(this.marks,r||Ve.none)}copy(t=null){return t==this.content?this:new pp(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new pp(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ce.empty;let i=this.resolve(t),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new ce(c,i.depth-s,o.depth-s)}replace(t,n,r){return YO(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Va.resolveCached(this,t)}resolveNoCache(t){return Va.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),P1(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=oe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),sb(this.type.attrs,this.attrs,"node",this.type.name);let t=Ve.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];sb(r.type.attrs,r.attrs,"mark",r.type.name),t=r.addToSet(t)}if(!Ve.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=oe.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};ei.prototype.text=void 0;class fu extends ei{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new fu(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new fu(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function P1(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function sb(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in e)e[i].validate&&e[i].validate(t[i])}class Lo{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new tD(t,n);if(r.next==null)return Lo.empty;let i=F1(r);r.next&&r.err("Unexpected trailing text");let o=lD(aD(i));return cD(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return oe.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,a.concat(u));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return o}).join(`
38
+ `)}}Lo.empty=new Lo(!0);class tD{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function F1(e){let t=[];do t.push(nD(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function nD(e){let t=[];do t.push(rD(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function rD(e){let t=sD(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=iD(e,t);else break;return t}function ab(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function iD(e,t){let n=ab(e),r=n;return e.eat(",")&&(e.next!="}"?r=ab(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function oD(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function sD(e){if(e.eat("(")){let t=F1(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=oD(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function aD(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function L1(e,t){return t-e}function lb(e,t){let n=[];return r(t),n.sort(L1);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function lD(e){let t=Object.create(null);return n(lb(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);lb(e,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=t[r.join(",")]=new Lo(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(L1);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function cD(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function z1(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W1(e,t){let n=Object.create(null);for(let r in e){let i=e[r],o=t&&t[r];if(o===void 0)if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r);else i.validate&&i.validate(o);n[r]=o}return n}function j1(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new fD(e,r,t[r]);return n}let hu=class U1{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=j1(t,r.attrs),this.defaultAttrs=z1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Lo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:W1(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ei(this,this.computeAttrs(t),oe.from(n),Ve.setFrom(r))}createChecked(t=null,n,r){return n=oe.from(n),this.checkContent(n),new ei(this,this.computeAttrs(t),n,Ve.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=oe.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(oe.empty,!0);return o?new ei(this,t,n.append(o),Ve.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ve.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new U1(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function uD(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class fD{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?uD(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Xu{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=j1(t,i.attrs),this.excluded=null;let o=z1(this.attrs);this.instance=o?new Ve(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ve(this,W1(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Xu(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class hD{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=zt.from(t.nodes),n.marks=zt.from(t.marks||{}),this.nodes=hu.compile(this.spec.nodes,this),this.marks=Xu.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Lo.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?cb(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:cb(this,s.split(" "))}this.nodeFromJSON=i=>ei.fromJSON(this,i),this.markFromJSON=i=>Ve.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof hu){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new fu(r,r.defaultAttrs,t,Ve.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function cb(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let a in e.marks){let l=e.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function dD(e){return e.tag!=null}function pD(e){return e.style!=null}let Bm=class mp{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(dD(i))this.tags.push(i);else if(pD(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new fb(this,n,!1);return r.addAll(t,Ve.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new fb(this,n,!0);return r.addAll(t,Ve.none,n.from,n.to),ce.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(AD(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(t);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=hb(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=hb(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new mp(t,mp.schemaRules(t)))}};const H1={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},mD={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},K1={ol:!0,ul:!0},qa=1,gp=2,Ia=4;function ub(e,t,n){return t!=null?(t?qa:0)|(t==="full"?gp:0):e&&e.whitespace=="pre"?qa|gp:n&~Ia}class mc{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ve.none,this.match=o||(s&Ia?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(oe.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&qa)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=oe.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!H1.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class fb{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=ub(null,n.preserveWhitespace,0)|(r?Ia:0);i?o=new mc(i.type,i.attrs,Ve.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new mc(null,null,Ve.none,!0,null,s):o=new mc(t.schema.topNodeType,null,Ve.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&gp?"full":this.localPreserveWS||(i.options&qa)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
39
+ `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(s.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=t.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;K1.hasOwnProperty(s)&&this.parser.normalizeLists&&gD(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:mD.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,u=this.needsBlock;if(H1.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
40
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(t);if(c&&(!i||i.length>c.length+a)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=Ve.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):db(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=ub(t,o,s.options);s.options&Ia&&s.content.length==0&&(a|=Ia);let l=Ve.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):db(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new mc(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=qa)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function gD(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&K1.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function AD(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function hb(e){let t={};for(let n in e)t[n]=e[n];return t}function db(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==t||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Yi{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=gc(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){if(t.isText)return gc(n).createTextNode(t.text);let{dom:r,contentDOM:i}=jc(gc(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&jc(gc(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return typeof n=="string"?{dom:t.createTextNode(n)}:jc(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Yi(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=pb(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return pb(t.marks)}}function pb(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function gc(e){return e.document||window.document}const mb=new WeakMap;function yD(e){let t=mb.get(e);return t===void 0&&mb.set(e,t=bD(e)),t}function bD(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function jc(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=yD(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=u;f<t.length;f++){let d=t[f];if(d===0){if(f<t.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof d=="string")l.appendChild(e.createTextNode(d));else{let{dom:h,contentDOM:p}=jc(e,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const J1=65535,V1=Math.pow(2,16);function wD(e,t){return e+t*V1}function gb(e){return e&J1}function xD(e){return(e-(e&J1))/V1}const q1=1,G1=2,Uc=4,Q1=8;class Ap{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Q1)>0}get deletedBefore(){return(this.delInfo&(q1|Uc))>0}get deletedAfter(){return(this.delInfo&(G1|Uc))>0}get deletedAcross(){return(this.delInfo&Uc)>0}}class Mn{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Mn.empty)return Mn.empty}recover(t){let n=0,r=gb(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+xD(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(t<=f){let d=c?t==l?-1:t==f?1:n:n,h=l+i+(d<0?0:u);if(r)return h;let p=t==(n<0?l:f)?null:wD(a/3,t-l),m=0;return c&&(m|=t==l?G1:t==f?q1:Uc,(n<0?t!=l:t!=f)&&(m|=Q1)),new Ap(h,m,p)}i+=u-c}return r?t+i:new Ap(t+i,0,null)}touches(t,n){let r=0,i=gb(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+o],u=l+c;if(t<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(a,a+c,l,l+u),o+=u-c}}invert(){return new Mn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Mn.empty:new Mn(t<0?[0,-t,0]:[0,0,t])}}Mn.empty=new Mn([]);class du{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new du(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new du;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new Ap(t,i,null)}}const lh=Object.create(null);class tn{getMap(){return Mn.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=lh[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in lh)throw new RangeError("Duplicate use of step JSON ID "+t);return lh[t]=n,n.prototype.jsonID=t,n}}class Rt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Rt(t,null)}static fail(t){return new Rt(null,t)}static fromReplace(t,n,r,i){try{return Rt.ok(t.replace(n,r,i))}catch(o){if(o instanceof Ja)return Rt.fail(o.message);throw o}}}function Pm(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Pm(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return oe.fromArray(r)}class Yr extends tn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ce(Pm(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Rt.fromReplace(t,this.from,this.to,o)}invert(){return new Er(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Yr(n.pos,r.pos,this.mark)}merge(t){return t instanceof Yr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yr(n.from,n.to,t.markFromJSON(n.mark))}}tn.jsonID("addMark",Yr);class Er extends tn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ce(Pm(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Rt.fromReplace(t,this.from,this.to,r)}invert(){return new Yr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Er(n.pos,r.pos,this.mark)}merge(t){return t instanceof Er&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Er(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Er(n.from,n.to,t.markFromJSON(n.mark))}}tn.jsonID("removeMark",Er);class Li extends tn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Rt.fromReplace(t,this.pos,this.pos+1,new ce(oe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Li(this.pos,n.marks[i]);return new Li(this.pos,this.mark)}}return new zo(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Li(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Li(n.pos,t.markFromJSON(n.mark))}}tn.jsonID("addNodeMark",Li);class zo extends tn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Rt.fromReplace(t,this.pos,this.pos+1,new ce(oe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Li(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new zo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new zo(n.pos,t.markFromJSON(n.mark))}}tn.jsonID("removeNodeMark",zo);class Tt extends tn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&yp(t,this.from,this.to)?Rt.fail("Structure replace would overwrite content"):Rt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Mn([this.from,this.to-this.from,this.slice.size])}invert(t){return new Tt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&Tt.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Tt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Tt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ce.empty:new ce(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Tt(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ce.empty:new ce(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Tt(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Tt(n.from,n.to,ce.fromJSON(t,n.slice),!!n.structure)}}Tt.MAP_BIAS=1;tn.jsonID("replace",Tt);class Zt extends tn{constructor(t,n,r,i,o,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(t){if(this.structure&&(yp(t,this.from,this.gapFrom)||yp(t,this.gapTo,this.to)))return Rt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Rt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Rt.fromReplace(t,this.from,this.to,r):Rt.fail("Content does not fit in gap")}getMap(){return new Mn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Zt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Zt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Zt(n.from,n.to,n.gapFrom,n.gapTo,ce.fromJSON(t,n.slice),n.insert,!!n.structure)}}tn.jsonID("replaceAround",Zt);function yp(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function kD(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,t),h=Math.min(c+l.nodeSize,n),p=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(p)||(s&&s.to==d&&s.mark.eq(f[m])?s.to=h:i.push(s=new Er(d,h,f[m])));a&&a.to==d?a.to=h:o.push(a=new Yr(d,h,r))}}),i.forEach(l=>e.step(l)),o.forEach(l=>e.step(l))}function CD(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Xu){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(a,t),to:c,step:o})}}}),i.forEach(s=>e.step(new Er(s.from,s.to,s.style)))}function Fm(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new Tt(a,u,ce.empty));else{r=f;for(let d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||e.step(new Er(a,u,c.marks[d]));if(i&&c.isText&&n.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new ce(oe.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Tt(a+d.index,a+d.index+d[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(oe.empty,!0);e.replace(a,a,new ce(l,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function vD(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ef(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,l=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(a,l,n))return r;if(r==0||s.type.spec.isolating||!vD(s,a,l))break;a&&(i=1),l<s.childCount&&(o=1)}return null}function SD(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=oe.empty,f=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=oe.from(r.node(p).copy(u)),f++):l--;let d=oe.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=oe.from(i.node(p).copy(d)),h++):c++;e.step(new Zt(l,c,s,a,new ce(u.append(d),f,h),u.size-f,!0))}function Lm(e,t,n=null,r=e){let i=ID(e,t),o=i&&ED(r,t);return o?i.map(Ab).concat({type:t,attrs:n}).concat(o.map(Ab)):null}function Ab(e){return{type:e,attrs:null}}function ID(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}function ED(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function TD(e,t,n){let r=oe.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=oe.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Zt(i,o,i,o,new ce(r,0,0),n.length,!0))}function RD(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&_D(e.doc,e.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&$1(e,s,a,o),Fm(e,e.mapping.slice(o).map(a,1),r,void 0,c===null);let u=e.mapping.slice(o),f=u.map(a,1),d=u.map(a+s.nodeSize,1);return e.step(new Zt(f,d,f+1,d-1,new ce(oe.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Y1(e,s,a,o),!1}})}function Y1(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function $1(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(`
41
+ `))}})}function _D(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function ND(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Zt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ce(oe.from(s),0,0),1,!0))}function Ea(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function OD(e,t,n=1,r){let i=e.doc.resolve(t),o=oe.empty,s=oe.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=oe.from(i.node(a).copy(o));let u=r&&r[c];s=oe.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}e.step(new Tt(t,t,new ce(o.append(s),n,n),!0))}function tf(e,t){let n=e.resolve(t),r=n.index();return MD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function DD(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function MD(e,t){return!!(e&&t&&!e.isLeaf&&DD(e,t))}function BD(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let a=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);$1(e,u.node(),u.before(),a)}s.inlineContent&&Fm(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new Tt(c,l.map(t+n,-1),ce.empty,!0)),r===!0){let u=e.doc.resolve(c);Y1(e,u.node(),u.before(),e.steps.length)}return e}function PD(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function FD(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function nf(e,t,n=t,r=ce.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Z1(i,o,r)?new Tt(t,n,r):new LD(i,o,r).fit()}function Z1(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class LD{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=oe.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=oe.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new ce(o,s,a);return t>-1?new Zt(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Tt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=yb(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(oe.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced;return bb(t,-1)<=n?!1:(this.unplaced.size>1&&bb(t,1)>r&&r++,this.unplaced=new ce(t,n+1,r),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=yb(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ce(ma(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ce(ma(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,c=0,u=[],{match:f,type:d}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)u.push(i.child(m));f=f.matchFragment(i)}let h=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),g=f.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(f=g,u.push(X1(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=ga(this.placed,n,oe.from(u)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<h;m++){let A=g.lastChild;this.frontier.push({type:A.type,match:A.contentMatchAt(A.childCount)}),g=A.content}this.unplaced=p?t==0?ce.empty:new ce(ma(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new ce(ma(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!ch(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=ch(t,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=ch(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ga(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=ga(this.placed,this.depth,oe.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(oe.empty,!0);n.childCount&&(this.placed=ga(this.placed,this.frontier.length,n))}}function ma(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ma(e.firstChild.content,t-1,n)))}function ga(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ga(e.lastChild.content,t-1,n)))}function yb(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function X1(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,X1(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(oe.empty,!0)))),e.copy(r)}function ch(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!zD(n,o.content,s)?a:null}function zD(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function WD(e){return e.spec.defining||e.spec.definingForContent}function bb(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function jD(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Z1(i,o,r))return e.step(new Tt(t,n,r));let s=tC(i,o);s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=WD(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],A=!0;g<0&&(A=!1,g=-g);let x=i.node(g-1),b=i.index(g-1);if(x.canReplaceWith(b,b,p.type,p.marks))return e.replace(i.before(g),A?o.after(g):n,new ce(eC(r.content,0,r.openStart,h),h,r.openEnd))}}let f=e.steps.length;for(let d=s.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let h=s[d];h<0||(t=i.before(h),n=o.after(h))}}function eC(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(eC(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(oe.empty,!0))}return e}function UD(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=PD(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ce(oe.from(r),0,0))}function HD(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let s=r.sharedDepth(n),a=!1;for(let l=r.depth;l>s;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=tC(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function tC(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class ws extends tn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Rt.fromReplace(t,this.pos,this.pos+1,new ce(oe.from(i),0,n.isLeaf?0:1))}getMap(){return Mn.empty}invert(t){return new ws(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ws(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ws(n.pos,n.attr,n.value)}}tn.jsonID("attr",ws);class Ga extends tn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Rt.ok(r)}getMap(){return Mn.empty}invert(t){return new Ga(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ga(n.attr,n.value)}}tn.jsonID("docAttr",Ga);let Ms=class extends Error{};Ms=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ms.prototype=Object.create(Error.prototype);Ms.prototype.constructor=Ms;Ms.prototype.name="TransformError";class nC{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new du}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ms(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((o,s,a,l)=>{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ce.empty){let i=nf(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ce(oe.from(r),0,0))}delete(t,n){return this.replace(t,n,ce.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return jD(this,t,n,r),this}replaceRangeWith(t,n,r){return UD(this,t,n,r),this}deleteRange(t,n){return HD(this,t,n),this}lift(t,n){return SD(this,t,n),this}join(t,n=1){return BD(this,t,n),this}wrap(t,n){return TD(this,t,n),this}setBlockType(t,n=t,r,i=null){return RD(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return ND(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new ws(t,n,r)),this}setDocAttribute(t,n){return this.step(new Ga(t,n)),this}addNodeMark(t,n){return this.step(new Li(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof Ve)n.isInSet(r.marks)&&this.step(new zo(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new zo(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return OD(this,t,n,r),this}addMark(t,n,r){return kD(this,t,n,r),this}removeMark(t,n,r){return CD(this,t,n,r),this}clearIncompatible(t,n,r){return Fm(this,t,n,r),this}}const uh=Object.create(null);class Re{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new rC(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ce.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(o);t.replaceRange(u.map(l.pos),u.map(c.pos),a?ce.empty:n),a==0&&kb(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=t.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);o?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),kb(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new _e(t):fs(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let s=n<0?fs(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):fs(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Fn(t.node(0))}static atStart(t){return fs(t,t,0,0,1)||new Fn(t)}static atEnd(t){return fs(t,t,t.content.size,t.childCount,-1)||new Fn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=uh[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in uh)throw new RangeError("Duplicate use of selection JSON ID "+t);return uh[t]=n,n.prototype.jsonID=t,n}getBookmark(){return _e.between(this.$anchor,this.$head).getBookmark()}}Re.prototype.visible=!0;class rC{constructor(t,n){this.$from=t,this.$to=n}}let wb=!1;function xb(e){!wb&&!e.parent.inlineContent&&(wb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class _e extends Re{constructor(t,n=t){xb(t),xb(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Re.near(r);let i=t.resolve(n.map(this.anchor));return new _e(i.parent.inlineContent?i:r,r)}replace(t,n=ce.empty){if(super.replace(t,n),n==ce.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof _e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new rf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new _e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Re.findFrom(n,r,!0)||Re.findFrom(n,-r,!0);if(o)n=o.$head;else return Re.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Re.findFrom(t,-r,!0)||Re.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new _e(t,n)}}Re.jsonID("text",_e);class rf{constructor(t,n){this.anchor=t,this.head=n}map(t){return new rf(t.map(this.anchor),t.map(this.head))}resolve(t){return _e.between(t.resolve(this.anchor),t.resolve(this.head))}}class Te extends Re{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Re.near(o):new Te(o)}content(){return new ce(oe.from(this.node),0,0)}eq(t){return t instanceof Te&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zm(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Te(t.resolve(n.anchor))}static create(t,n){return new Te(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Te.prototype.visible=!1;Re.jsonID("node",Te);class zm{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new rf(r,r):new zm(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Te.isSelectable(r)?new Te(n):Re.near(n)}}class Fn extends Re{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ce.empty){if(n==ce.empty){t.delete(0,t.doc.content.size);let r=Re.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Fn(t)}map(t){return new Fn(t)}eq(t){return t instanceof Fn}getBookmark(){return KD}}Re.jsonID("all",Fn);const KD={map(){return this},resolve(e){return new Fn(e)}};function fs(e,t,n,r,i,o=!1){if(t.inlineContent)return _e.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&Te.isSelectable(a))return Te.create(e,n-(i<0?a.nodeSize:0))}else{let l=fs(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function kb(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Tt||i instanceof Zt))return;let o=e.mapping.maps[r],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),e.setSelection(Re.near(e.doc.resolve(s),n))}const Cb=1,Ac=2,vb=4;class JD extends nC{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Cb)&~Ac,this.storedMarks=null,this}get selectionSet(){return(this.updated&Cb)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Ac,this}ensureMarks(t){return Ve.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ac)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Ac,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ve.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Re.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=vb,this}get scrolledIntoView(){return(this.updated&vb)>0}}function Sb(e,t){return!t||!e?e:e.bind(t)}class Aa{constructor(t,n,r){this.name=t,this.init=Sb(n.init,r),this.apply=Sb(n.apply,r)}}const VD=[new Aa("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Aa("selection",{init(e,t){return e.selection||Re.atStart(t.doc)},apply(e){return e.selection}}),new Aa("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Aa("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class fh{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=VD.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Aa(r.key,r.spec.state,r))})}}class ys{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ys(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new JD(this)}static create(t){let n=new fh(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new ys(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new fh(this.schema,t.plugins),r=n.fields,i=new ys(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new fh(t.schema,t.plugins),o=new ys(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=ei.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Re.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}}function iC(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=iC(i,t,{})),n[r]=i}return n}class An{constructor(t){this.spec=t,this.props={},t.props&&iC(t.props,this,this.props),this.key=t.key?t.key.key:oC("plugin")}getState(t){return t[this.key]}}const hh=Object.create(null);function oC(e){return e in hh?e+"$"+ ++hh[e]:(hh[e]=0,e+"$")}class zn{constructor(t="key"){this.key=oC(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Wm=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function sC(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const aC=(e,t,n)=>{let r=sC(e,n);if(!r)return!1;let i=jm(r);if(!i){let s=r.blockRange(),a=s&&ef(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(uC(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Bs(o,"end")||Te.isSelectable(o)))for(let s=r.depth;;s--){let a=nf(e.doc,r.before(s),r.after(s),ce.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=e.tr.step(a);l.setSelection(Bs(o,"end")?Re.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Te.create(l.doc,i.pos-o.nodeSize)),t(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},qD=(e,t,n)=>{let r=sC(e,n);if(!r)return!1;let i=jm(r);return i?GD(e,i,t):!1};function GD(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=nf(e.doc,o,l,ce.empty);if(!c||c.from!=o||c instanceof Tt&&c.slice.size>=l-o)return!1;if(n){let u=e.tr.step(c);u.setSelection(_e.create(u.doc,o)),n(u.scrollIntoView())}return!0}function Bs(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const lC=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=jm(r)}let s=o&&o.nodeBefore;return!s||!Te.isSelectable(s)?!1:(t&&t(e.tr.setSelection(Te.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function jm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function QD(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const YD=(e,t,n)=>{let r=QD(e,n);if(!r)return!1;let i=cC(r);if(!i)return!1;let o=i.nodeAfter;if(uC(e,i,t,1))return!0;if(r.parent.content.size==0&&(Bs(o,"start")||Te.isSelectable(o))){let s=nf(e.doc,r.before(),r.after(),ce.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Bs(o,"start")?Re.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Te.create(a.doc,a.mapping.map(i.pos))),t(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},$D=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=cC(r)}let s=o&&o.nodeAfter;return!s||!Te.isSelectable(s)?!1:(t&&t(e.tr.setSelection(Te.create(e.doc,o.pos)).scrollIntoView()),!0)};function cC(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const ZD=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
42
+ `).scrollIntoView()),!0)};function Um(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const XD=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Um(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Re.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},eM=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Um(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(_e.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},tM=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ea(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ef(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function nM(e){return(t,n)=>{if(t.selection instanceof Te&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!Ea(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof _e||t.selection instanceof Fn)&&r.deleteSelection();let{$from:i}=r.selection,o=r.steps.length,s=[],a,l,c=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){c=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),l=Um(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),s.unshift(c&&l?{type:l}:null),a=h;break}else{if(h==1)return!1;s.unshift(null)}let f=i.pos,d=Ea(r.doc,f,s.length,s);if(d||(s[0]=l?{type:l}:null,d=Ea(r.doc,f,s.length,s)),!d)return!1;if(r.split(f,s.length,s),!c&&u&&i.node(a).type!=l){let h=r.mapping.slice(o),p=h.map(i.before(a)),m=r.doc.resolve(p);l&&i.node(a-1).canReplaceWith(m.index(),m.index()+1,l)&&r.setNodeMarkup(h.map(i.before(a)),l)}return n&&n(r.scrollIntoView()),!0}}const rM=nM(),iM=(e,t)=>(t&&t(e.tr.setSelection(new Fn(e.doc))),!0);function oM(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||tf(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function uC(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&oM(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,p=oe.empty;for(let A=s.length-1;A>=0;A--)p=oe.from(s[A].create(null,p));p=oe.from(i.copy(p));let m=e.tr.step(new Zt(t.pos-1,h,t.pos,h,new ce(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&tf(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:Re.findFrom(t,1),f=u&&u.$from.blockRange(u.$to),d=f&&ef(f);if(d!=null&&d>=t.depth)return n&&n(e.tr.lift(f,d).scrollIntoView()),!0;if(c&&Bs(o,"start",!0)&&Bs(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let A=oe.empty;for(let b=p.length-1;b>=0;b--)A=oe.from(p[b].copy(A));let x=e.tr.step(new Zt(t.pos-p.length,t.pos+o.nodeSize,t.pos+g,t.pos+o.nodeSize-g,new ce(A,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function fC(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(_e.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const sM=fC(-1),aM=fC(1);function Hm(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Lm(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Qa(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,e,t)}r(o.scrollIntoView())}return!0}}function lM(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:o,$to:s}=t[i],a=o.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(o.pos,s.pos,(l,c)=>{if(a)return!1;a=l.inlineContent&&l.type.allowsMarkType(n)}),a)return!0}return!1}function of(e,t=null,n){return function(r,i){let{empty:o,$cursor:s,ranges:a}=r.selection;if(o&&!s||!lM(r.doc,a,e))return!1;if(i)if(s)e.isInSet(r.storedMarks||s.marks())?i(r.tr.removeStoredMark(e)):i(r.tr.addStoredMark(e.create(t)));else{let l,c=r.tr;l=!a.some(u=>r.doc.rangeHasMark(u.$from.pos,u.$to.pos,e));for(let u=0;u<a.length;u++){let{$from:f,$to:d}=a[u];if(!l)c.removeMark(f.pos,d.pos,e);else{let h=f.pos,p=d.pos,m=f.nodeAfter,g=d.nodeBefore,A=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,x=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;h+A<p&&(h+=A,p-=x),c.addMark(h,p,e.create(t))}}i(c.scrollIntoView())}return!0}}function Us(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let dh=Us(Wm,aC,lC),Ib=Us(Wm,YD,$D);const qr={Enter:Us(ZD,eM,tM,rM),"Mod-Enter":XD,Backspace:dh,"Mod-Backspace":dh,"Shift-Backspace":dh,Delete:Ib,"Mod-Delete":Ib,"Mod-a":iM},hC={"Ctrl-h":qr.Backspace,"Alt-Backspace":qr["Mod-Backspace"],"Ctrl-d":qr.Delete,"Ctrl-Alt-Backspace":qr["Mod-Delete"],"Alt-Delete":qr["Mod-Delete"],"Alt-d":qr["Mod-Delete"],"Ctrl-a":sM,"Ctrl-e":aM};for(let e in qr)hC[e]=qr[e];const cM=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,uM=cM?hC:qr;class yn{constructor(t,n,r={}){this.match=t,this.match=t,this.handler=typeof n=="string"?fM(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}}function fM(e){return function(t,n,r,i){let o=e;if(n[1]){let s=n[0].lastIndexOf(n[1]);o+=n[0].slice(s+n[1].length),r+=s;let a=r-i;a>0&&(o=n[0].slice(s-a,s)+o,r=i)}return t.tr.insertText(o,r,i)}}const hM=500;function dM({rules:e}){let t=new An({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,o){return Eb(n,r,i,o,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&Eb(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function Eb(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t),l=a.parent.textBetween(Math.max(0,a.parentOffset-hM),a.parentOffset,null,"")+r;for(let c=0;c<i.length;c++){let u=i[c];if(!u.inCodeMark&&a.marks().some(p=>p.type.spec.code))continue;if(a.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode==="only")continue;let f=u.match.exec(l);if(!f||f[0].length<r.length)continue;let d=t-(f[0].length-r.length);if(!u.inCodeMark){let p=!1;if(s.doc.nodesBetween(d,a.pos,m=>{m.isInline&&m.marks.some(g=>g.type.spec.code)&&(p=!0)}),p)continue}let h=u.handler(s,f,d,n);if(h)return u.undoable&&h.setMeta(o,{transform:h,from:t,to:n,text:r}),e.dispatch(h),!0}return!1}const pM=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let s=e.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else s.delete(o.from,o.to);t(s)}return!0}}return!1};new yn(/--$/,"—",{inCodeMark:!1});new yn(/\.\.\.$/,"…",{inCodeMark:!1});new yn(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1});new yn(/"$/,"”",{inCodeMark:!1});new yn(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1});new yn(/'$/,"’",{inCodeMark:!1});function Km(e,t,n=null,r){return new yn(e,(i,o,s,a)=>{let l=n instanceof Function?n(o):n,c=i.tr.delete(s,a),u=c.doc.resolve(s),f=u.blockRange(),d=f&&Lm(f,t,l);if(!d)return null;c.wrap(f,d);let h=c.doc.resolve(s-1).nodeBefore;return h&&h.type==t&&tf(c.doc,s-1)&&(!r||r(o,h))&&c.join(s-1),c})}function dC(e,t,n=null){return new yn(e,(r,i,o,s)=>{let a=r.doc.resolve(o),l=n instanceof Function?n(i):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?r.tr.delete(o,s).setBlockType(o,o,t,l):null})}const Ji=typeof navigator<"u"?navigator:null,Tb=typeof document<"u"?document:null,$i=Ji&&Ji.userAgent||"",bp=/Edge\/(\d+)/.exec($i),pC=/MSIE \d/.exec($i),wp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($i),sf=!!(pC||wp||bp),mM=pC?document.documentMode:wp?+wp[1]:bp?+bp[1]:0,mC=!sf&&/gecko\/(\d+)/i.test($i),gM=mC&&+(/Firefox\/(\d+)/.exec($i)||[0,0])[1],xp=!sf&&/Chrome\/(\d+)/.exec($i),gC=!!xp,AM=xp?+xp[1]:0,AC=!sf&&!!Ji&&/Apple Computer/.test(Ji.vendor),yC=AC&&(/Mobile\/\w+/.test($i)||!!Ji&&Ji.maxTouchPoints>2),yM=yC||(Ji?/Mac/.test(Ji.platform):!1),bC=/Android \d/.test($i),wC=!!Tb&&"webkitFontSmoothing"in Tb.documentElement.style,bM=wC?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var Gq=Object.freeze({__proto__:null,android:bC,chrome:gC,chrome_version:AM,gecko:mC,gecko_version:gM,ie:sf,ie_version:mM,ios:yC,mac:yM,safari:AC,webkit:wC,webkit_version:bM});function ph(e,t,n,r,i,o){if(e.composing)return!1;const s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+r;for(let c of i){const u=c,f=u.match.exec(l),d=f&&f[0]&&u.handler(s,f,t-(f[0].length-r.length),n);if(d)return u.undoable!==!1&&d.setMeta(o,{transform:d,from:t,to:n,text:r}),e.dispatch(d),!0}return!1}const wM=new zn("MILKDOWN_CUSTOM_INPUTRULES");function xM({rules:e}){const t=new An({key:wM,isInputRules:!0,state:{init(){return null},apply(n,r){const i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,o){return ph(n,r,i,o,e,t)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{const{$cursor:r}=n.state.selection;r&&ph(n,r.pos,r.pos,"",e,t)}),!1),keydown:(n,r)=>!(bC&&gC&&r.key==="Enter")||n.composing?!1:n.someProp("handleKeyDown",i=>i(n,r))?(r.preventDefault(),!0):!1},handleKeyDown(n,r){if(r.key!=="Enter")return!1;const{$cursor:i}=n.state.selection;return i?ph(n,i.pos,i.pos,`
43
+ `,e,t):!1}}});return t}function xC(e){return e.some(t=>t.type.spec.code)}function Rb(e,t,n){if(t>=n)return!1;let r=!1;return e.doc.nodesBetween(t,n,i=>(i.isInline&&xC(i.marks)&&(r=!0),!r)),r}function kM(e,t){var n;return xC((n=e.storedMarks)!=null?n:e.doc.resolve(t).marks())}function Ol(e,t,n={}){return new yn(e,(r,i,o,s)=>{var a,l,c,u;const{tr:f}=r,d=i.length;let h=i[d-1],p=i[0],m=[],g;const A={group:h,fullMatch:p,start:o,end:s},x=(a=n.updateCaptured)==null?void 0:a.call(n,A);if(Object.assign(A,x),{group:h,fullMatch:p,start:o,end:s}=A,p===null||h?.trim()==="")return null;if(h){const b=p.search(/\S/),y=o+p.indexOf(h),C=y+h.length,w=Rb(r,o+b,y),v=C<s&&Rb(r,C,s);if(w||v||kM(r,s))return null;m=(l=f.storedMarks)!=null?l:[],C<s&&f.delete(C,s),y>o&&f.delete(o+b,y),g=o+b+h.length;const D=(c=n.getAttr)==null?void 0:c.call(n,i);f.addMark(o,g,t.create(D)),f.setStoredMarks(m),(u=n.beforeDispatch)==null||u.call(n,{match:i,start:o,end:s,tr:f})}return f})}function Qq(e,t,n={}){return new yn(e,(r,i,o,s)=>{var a,l,c;const{tr:u}=r;let f=i[1],d=i[0];const h={group:f,fullMatch:d,start:o,end:s},p=(a=n.updateCaptured)==null?void 0:a.call(n,h);if(Object.assign(h,p),{group:f,fullMatch:d,start:o,end:s}=h,d===null||!f||f.trim()==="")return null;const m=(l=n.getAttr)==null?void 0:l.call(n,i),g=t.createAndFill(m);return g&&(u.replaceRangeWith(t.isBlock?u.doc.resolve(o).before():o,s,g),(c=n.beforeDispatch)==null||c.call(n,{match:[d,f],start:o,end:s,tr:u})),u})}var CM=Object.defineProperty,vM=Object.defineProperties,SM=Object.getOwnPropertyDescriptors,_b=Object.getOwnPropertySymbols,IM=Object.prototype.hasOwnProperty,EM=Object.prototype.propertyIsEnumerable,Nb=(e,t,n)=>t in e?CM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TM=(e,t)=>{for(var n in t||(t={}))IM.call(t,n)&&Nb(e,n,t[n]);if(_b)for(var n of _b(t))EM.call(t,n)&&Nb(e,n,t[n]);return e},RM=(e,t)=>vM(e,SM(t));function Ob(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Yq(e,t,n){const i=e.state.doc.content.size,o=Ob(t,0,i),s=Ob(n,0,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-f,p=u-c,A={top:c,bottom:u,left:f,right:d,width:h,height:p,x:f,y:c};return RM(TM({},A),{toJSON:()=>A})}function kC(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function _M(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function $q(e){if(e.content.childCount===1){const t=e.content.firstChild;if(t?.type.name==="text"&&t.marks.length===0)return t;if(t?.type.name==="paragraph"&&t.childCount===1){const n=t.firstChild;if(n?.type.name==="text"&&n.marks.length===0)return n}}return!1}function NM(e){return t=>{for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r)){const i=t.before(n),o=t.after(n);return{from:i,to:o,node:r}}}}}function OM(e,t){return NM(n=>n.type===t)(e)}function Zq(e,t){const n=t.nodes[e];if(!n)throw hR("node",e);return n}function CC(e){return t=>{for(let n=t.depth;n>0;n--){const r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}function Xq(e){return t=>CC(e)(t.$from)}function DM(e,t){if(!(e instanceof Te))return;const{node:n,$from:r}=e;if(_M(t,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}const MM=(e,t)=>{const{selection:n,doc:r}=e;if(n instanceof Te)return{hasNode:n.node.type===t,pos:n.from,target:n.node};const{from:i,to:o}=n;let s=!1,a=-1,l=null;return r.nodesBetween(i,o,(c,u)=>l?!1:c.type===t?(s=!0,a=u,l=c,!1):!0),{hasNode:s,pos:a,target:l}};var Vi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},pu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},BM=typeof navigator<"u"&&/Mac/.test(navigator.platform),PM=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Wt=0;Wt<10;Wt++)Vi[48+Wt]=Vi[96+Wt]=String(Wt);for(var Wt=1;Wt<=24;Wt++)Vi[Wt+111]="F"+Wt;for(var Wt=65;Wt<=90;Wt++)Vi[Wt]=String.fromCharCode(Wt+32),pu[Wt]=String.fromCharCode(Wt);for(var mh in Vi)pu.hasOwnProperty(mh)||(pu[mh]=Vi[mh]);function FM(e){var t=BM&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||PM&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?pu:Vi)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const LM=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zM=typeof navigator<"u"&&/Win/.test(navigator.platform);function WM(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))LM?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function jM(e){let t=Object.create(null);for(let n in e)t[WM(n)]=e[n];return t}function gh(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function UM(e){return new An({props:{handleKeyDown:vC(e)}})}function vC(e){let t=jM(e);return function(n,r){let i=FM(r),o,s=t[gh(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=t[gh(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(zM&&r.ctrlKey&&r.altKey)&&(o=Vi[r.keyCode])&&o!=i){let a=t[gh(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var SC=class{},IC=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{const e=this.elements.pop();if(!e)throw Uk();return e}}},HM=class EC extends SC{constructor(t,n,r){super(),this.type=t,this.content=n,this.attrs=r}push(t,...n){this.content.push(t,...n)}pop(){return this.content.pop()}static create(t,n,r){return new EC(t,n,r)}},tr,Es,Al,yl,bl,Ts,Rs,Mo,KM=(Mo=class extends IC{constructor(n){super();wt(this,tr);wt(this,Es);wt(this,Al);wt(this,yl);wt(this,bl);wt(this,Ts);wt(this,Rs);st(this,tr,Ve.none),st(this,Es,r=>r.isText),st(this,Al,(r,i)=>{if(Ee(this,Es).call(this,r)&&Ee(this,Es).call(this,i)&&Ve.sameSet(r.marks,i.marks))return this.schema.text(r.text+i.text,r.marks)}),st(this,yl,r=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.parseMarkdown.match(r));if(!i)throw uR(r);return i}),st(this,bl,r=>{const i=Ee(this,yl).call(this,r);i.spec.parseMarkdown.runner(this,r,i)}),this.injectRoot=(r,i,o)=>(this.openNode(i,o),this.next(r.children),this),this.openNode=(r,i)=>(this.open(HM.create(r,[],i)),this),st(this,Ts,()=>{st(this,tr,Ve.none);const r=this.close();return Ee(this,Rs).call(this,r.type,r.attrs,r.content)}),this.closeNode=()=>{try{Ee(this,Ts).call(this)}catch(r){console.error(r)}return this},st(this,Rs,(r,i,o)=>{const s=r.createAndFill(i,o,Ee(this,tr));if(!s)throw cR(r,i,o);return this.push(s),s}),this.addNode=(r,i,o)=>{try{Ee(this,Rs).call(this,r,i,o)}catch(s){console.error(s)}return this},this.openMark=(r,i)=>{const o=r.create(i);return st(this,tr,o.addToSet(Ee(this,tr))),this},this.closeMark=r=>(st(this,tr,r.removeFromSet(Ee(this,tr))),this),this.addText=r=>{try{const i=this.top();if(!i)throw Uk();const o=i.pop(),s=this.schema.text(r,Ee(this,tr));if(!o)return i.push(s),this;const a=Ee(this,Al).call(this,o,s);return a?(i.push(a),this):(i.push(o,s),this)}catch(i){return console.error(i),this}},this.build=()=>{let r;do r=Ee(this,Ts).call(this);while(this.size());return r},this.next=(r=[])=>([r].flat().forEach(i=>Ee(this,bl).call(this,i)),this),this.toDoc=()=>this.build(),this.run=(r,i)=>{const o=r.runSync(r.parse(i),i);return this.next(o),this},this.schema=n}},tr=new WeakMap,Es=new WeakMap,Al=new WeakMap,yl=new WeakMap,bl=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Mo.create=(n,r)=>{const i=new Mo(n);return o=>(i.run(r,o),i.toDoc())},Mo),Bo,Db=(Bo=class extends SC{constructor(t,n,r,i={}){super(),this.type=t,this.children=n,this.value=r,this.props=i,this.push=(o,...s)=>{this.children||(this.children=[]),this.children.push(o,...s)},this.pop=()=>this.children?.pop()}},Bo.create=(t,n,r,i={})=>new Bo(t,n,r,i),Bo),JM=e=>Object.prototype.hasOwnProperty.call(e,"size"),an,_s,wl,xl,kl,Cl,Ns,Os,vl,Sl,ko,Fi,Il,Ds,Po,VM=(Po=class extends IC{constructor(n){super();wt(this,an);wt(this,_s);wt(this,wl);wt(this,xl);wt(this,kl);wt(this,Cl);wt(this,Ns);wt(this,Os);wt(this,vl);wt(this,Sl);wt(this,ko);wt(this,Fi);wt(this,Il);wt(this,Ds);st(this,an,[]),st(this,_s,r=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.toMarkdown.match(r));if(!i)throw fR(r.type);return i}),st(this,wl,r=>Ee(this,_s).call(this,r).spec.toMarkdown.runner(this,r)),st(this,xl,(r,i)=>Ee(this,_s).call(this,r).spec.toMarkdown.runner(this,r,i)),st(this,kl,r=>{const i=a=>a.type.spec.priority??50,o=[...r].sort((a,l)=>i(a)-i(l)),s=[];return Ee(this,an).forEach(({mark:a})=>{const l=o.findIndex(c=>c.eq(a));l>=0&&s.push(...o.splice(l,1))}),s.concat(o)}),st(this,Cl,r=>{const i=r?.marks;let o=0;for(;o<Ee(this,an).length;){const{mark:s,spanning:a}=Ee(this,an)[o];if(a&&i?.some(l=>l.eq(s)))o++;else break}for(let s=Ee(this,an).length-1;s>=o;s--)Ee(this,Ds).call(this,Ee(this,an)[s].mark)}),st(this,Ns,(r,i)=>{Ee(this,kl).call(this,r.marks).every(o=>!Ee(this,xl).call(this,o,r))&&Ee(this,wl).call(this,r),Ee(this,Cl).call(this,i)}),st(this,Os,r=>{const{children:i}=r;return i&&(r.children=i.reduce((o,s,a)=>{if(a===0)return[s];const l=o.at(-1);if(l&&l.isMark&&s.isMark){const{children:c,...u}=s,{children:f,...d}=l;if(s.type===l.type&&c&&f&&JSON.stringify(u)===JSON.stringify(d)){const h={...d,children:[...f,...c]};return o.slice(0,-1).concat(Ee(this,Os).call(this,h))}}return o.concat(s)},[])),r}),st(this,vl,r=>{const i={...r.props,type:r.type};return r.children&&(i.children=r.children),r.value&&(i.value=r.value),i}),this.openNode=(r,i,o)=>(this.open(Db.create(r,void 0,i,o)),this),st(this,Sl,(r,i)=>{let o="",s="";const a=r.children;if(a){const c=a[0],u=a.at(-1);if(u&&u.type==="text"&&u.value.endsWith(" ")){const f=u.value,d=f.trimEnd();s=f.slice(d.length),u.value=d}if(c&&c.type==="text"&&c.value.startsWith(" ")){const f=c.value,d=f.trimStart();o=f.slice(0,f.length-d.length),c.value=d}}o.length&&Ee(this,Fi).call(this,"text",void 0,o);const l=i();return s.length&&Ee(this,Fi).call(this,"text",void 0,s),l}),st(this,ko,(r=!1)=>{const i=this.close(),o=()=>Ee(this,Fi).call(this,i.type,i.children,i.value,i.props);return r?Ee(this,Sl).call(this,i,o):o()}),this.closeNode=()=>(Ee(this,ko).call(this),this),st(this,Fi,(r,i,o,s)=>{const a=Db.create(r,i,o,s),l=Ee(this,Os).call(this,Ee(this,vl).call(this,a));return this.push(l),l}),this.addNode=(r,i,o,s)=>(Ee(this,Fi).call(this,r,i,o,s),this),st(this,Il,(r,i,o,s)=>Ee(this,an).some(a=>a.mark.eq(r))?this:(Ee(this,an).push({mark:r,spanning:o==null}),this.openNode(i,o,{...s,isMark:!0}))),st(this,Ds,r=>{let i=-1;for(let o=Ee(this,an).length-1;o>=0;o--)if(Ee(this,an)[o].mark.eq(r)){i=o;break}i<0||(Ee(this,an).splice(i,1),Ee(this,ko).call(this,!0))}),this.withMark=(r,i,o,s)=>(Ee(this,Il).call(this,r,i,o,s),this),this.closeMark=r=>(Ee(this,Ds).call(this,r),this),this.build=()=>{let r=null;do r=Ee(this,ko).call(this);while(this.size());return r.children||(r.children=[]),r},this.next=r=>JM(r)?(r.forEach((i,o,s)=>{Ee(this,Ns).call(this,i,r.maybeChild(s+1)??void 0)}),this):(Ee(this,Ns).call(this,r),this),this.toString=r=>r.stringify(this.build()),this.run=r=>(st(this,an,[]),this.next(r),this),this.schema=n}},an=new WeakMap,_s=new WeakMap,wl=new WeakMap,xl=new WeakMap,kl=new WeakMap,Cl=new WeakMap,Ns=new WeakMap,Os=new WeakMap,vl=new WeakMap,Sl=new WeakMap,ko=new WeakMap,Fi=new WeakMap,Il=new WeakMap,Ds=new WeakMap,Po.create=(n,r)=>{const i=new Po(n);return o=>(i.run(o),i.toString(r))},Po);const jt=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ps=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let kp=null;const Jr=function(e,t,n){let r=kp||(kp=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},qM=function(){kp=null},Wo=function(e,t,n,r){return n&&(Mb(e,t,n,r,-1)||Mb(e,t,n,r,1))},GM=/^(img|br|input|textarea|hr)$/i;function Mb(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:$t(e))){let s=e.parentNode;if(!s||!be(s)||Dl(e)||GM.test(e.nodeName)||e.contentEditable=="false")return!1;t=jt(e)+(i<0?0:1),e=s}else if(be(e)){let s=e.childNodes[t+(i<0?-1:0)];if(be(s)&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?$t(e):0}else return!1}}function $t(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function be(e){return e.nodeType==1}function Dt(e){return e.nodeType==3}function jo(e,t){return t?e.contains(be(t)?t:t.parentNode):!1}function QM(e,t){for(;;){if(Dt(e)&&t)return e;if(be(e)&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=$t(e)}else if(e.parentNode&&!Dl(e))t=jt(e),e=e.parentNode;else return null}}function YM(e,t){for(;;){if(Dt(e)&&t<e.nodeValue.length)return e;if(be(e)&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Dl(e))t=jt(e)+1,e=e.parentNode;else return null}}function $M(e,t,n){for(let r=t==0,i=t==$t(e);r||i;){if(e==n)return!0;let o=jt(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==$t(e)}}function Dl(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const af=function(e){return e.focusNode&&Wo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function go(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ZM(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function XM(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min($t(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min($t(r.startContainer),r.startOffset)}}}const Rr=typeof navigator<"u"?navigator:null,Bb=typeof document<"u"?document:null,Zi=Rr&&Rr.userAgent||"",Cp=/Edge\/(\d+)/.exec(Zi),TC=/MSIE \d/.exec(Zi),vp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zi),En=!!(TC||vp||Cp),ji=TC?document.documentMode:vp?+vp[1]:Cp?+Cp[1]:0,Ln=!En&&/gecko\/(\d+)/i.test(Zi);Ln&&+(/Firefox\/(\d+)/.exec(Zi)||[0,0])[1];const Sp=!En&&/Chrome\/(\d+)/.exec(Zi),Kt=!!Sp,RC=Sp?+Sp[1]:0,en=!En&&!!Rr&&/Apple Computer/.test(Rr.vendor),Fs=en&&(/Mobile\/\w+/.test(Zi)||!!Rr&&Rr.maxTouchPoints>2),Hn=Fs||(Rr?/Mac/.test(Rr.platform):!1),_C=Rr?/Win/.test(Rr.platform):!1,$r=/Android \d/.test(Zi),lf=!!Bb&&"webkitFontSmoothing"in Bb.documentElement.style,eB=lf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tB(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lr(e,t){return typeof e=="number"?e:e[t]}function nB(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Pb(e,t,n){if(!Ip(t)&&t.left==0)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(!be(s)){s=Ps(s);continue}let a=s==o.body,l=a?tB(o):nB(s),c=0,u=0;if(t.top<l.top+Lr(r,"top")?u=-(l.top-t.top+Lr(i,"top")):t.bottom>l.bottom-Lr(r,"bottom")&&(u=t.bottom-t.top>l.bottom-l.top?t.top+Lr(i,"top")-l.top:t.bottom-l.bottom+Lr(i,"bottom")),t.left<l.left+Lr(r,"left")?c=-(l.left-t.left+Lr(i,"left")):t.right>l.right-Lr(r,"right")&&(c=t.right-l.right+Lr(i,"right")),c||u)if(a)o.defaultView.scrollBy(c,u);else{let d=s.scrollLeft,h=s.scrollTop;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);let p=s.scrollLeft-d,m=s.scrollTop-h;t={left:t.left-p,top:t.top-m,right:t.right-p,bottom:t.bottom-m}}let f=a?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:Ps(s)}}function rB(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(o,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:NC(e.dom)}}function NC(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ps(r));return t}function iB({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;OC(n,r==0?0:r-t)}function OC(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ss=null;function oB(e){if(e.setActive)return e.setActive();if(ss)return e.focus(ss);let t=NC(e);e.focus(ss==null?{get preventScroll(){return ss={preventScroll:!0},!0}}:void 0),ss||(ss=!1,OC(t,0))}function DC(e,t){let n,r=2e8,i,o=0,s=t.top,a=t.top,l,c;for(let u=e.firstChild,f=0;u;u=u.nextSibling,f++){let d;if(be(u))d=u.getClientRects();else if(Dt(u))d=Jr(u).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<r){n=u,r=m,i=m&&Dt(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,be(u)&&m&&(o=f+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&Dt(n)?sB(n,i):!n||r?{node:e,offset:o}:DC(n,i)}function sB(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let s=_i(r,1);if(s.top!=s.bottom&&Jm(t,s)){i={node:e,offset:o+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function Jm(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function aB(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function lB(e,t,n){let{node:r,offset:i}=DC(t,n),o=-1;if(be(r)&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function cB(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),l;if(!a)return null;if(be(a.dom)&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function MC(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=e.childNodes[o];if(be(s)){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Jm(t,c))return MC(s,t,c)}}if((o=(o+1)%r)==i)break}return e}function uB(e,t){let n=e.dom.ownerDocument,r,i=0,o=XM(n,t.left,t.top);o&&({node:r,offset:i}=o);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s)){let c=e.dom.getBoundingClientRect();if(!Jm(t,c)||(s=MC(e.dom,t,c),!s))return null}if(en)for(let c=s;r&&c;c=Ps(c))c.draggable&&(r=void 0);if(s=aB(s,t),r){if(Ln&&be(r)&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&i++}let c;lf&&i&&be(r)&&be(c=r.childNodes[i-1])&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&be(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||!be(r)||r.childNodes[i-1].nodeName!="BR")&&(a=cB(e,r,i,t))}a==null&&(a=lB(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Ip(e){return e.top<e.bottom||e.left<e.right}function _i(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(Ip(r))return r}return Array.prototype.find.call(n,Ip)||e.getBoundingClientRect()}const fB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function BC(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=lf||Ln;if(Dt(r))if(s&&(fB.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=_i(Jr(r,i,i),n);if(Ln&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=_i(Jr(r,i-1,i-1),-1);if(c.top==l.top){let u=_i(Jr(r,i,i+1),-1);if(u.top!=l.top)return ra(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,ra(_i(Jr(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==$t(r))){let l=r.childNodes[i-1];if(be(l))return Ah(l.getBoundingClientRect(),!1)}if(o==null&&i<$t(r)){let l=r.childNodes[i];if(be(l))return Ah(l.getBoundingClientRect(),!0)}return Ah(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==$t(r))){let l=r.childNodes[i-1],c=Dt(l)?Jr(l,$t(l)-(s?0:1)):be(l)&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ra(_i(c,1),!1)}if(o==null&&i<$t(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?Dt(l)?Jr(l,0,s?0:1):be(l)?l:null:null;if(c)return ra(_i(c,-1),!0)}return ra(_i(Dt(r)?Jr(r):r,-n),n>=0)}function ra(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ah(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function PC(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function hB(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return PC(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=BC(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(be(a))l=a.getClientRects();else if(Dt(a))l=Jr(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const dB=/[\u0590-\u08ac]/;function pB(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!dB.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:PC(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=e.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!jo(h,p)||l==p&&c==m;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),g}):r.pos==r.start()||r.pos==r.end()}let Fb=null,Lb=null,zb=!1;function mB(e,t,n){return Fb==t&&Lb==n?zb:(Fb=t,Lb=n,zb=n=="up"||n=="down"?hB(e,t,n):pB(e,t,n))}const Vn=0,Wb=1,yo=2,or=3;class Ml{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Vn,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&jo(this.contentDOM,t))if(r<0){let o,s;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>jt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(t.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(be(s)?jo(s,t):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>t){i=t-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(;r>0;r--){let o=this.children[r-1];if(o.size||!(o instanceof LC||o instanceof FC&&o.side>=0))break}if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?jt(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?jt(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&t<=c){let u=s+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=jt(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=jt(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(!be(n)||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),s=Math.max(t,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],g=p+m.size;if(o>p&&s<g)return m.setSelection(t-p-m.border,n-p-m.border,r,i);p=g}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((Ln||en)&&t==n){let{node:h,offset:p}=a;if(Dt(h)){if(f=!!(p&&h.nodeValue[p-1]==`
44
+ `),f&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:jt(g)+1});break}let A=m.pmViewDesc;if(A&&A.node&&A.node.isBlock)break}}else{let m=h.childNodes[p-1];f=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Ln&&u.focusNode&&u.focusNode!=l.node&&be(u.focusNode)){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&en)&&Wo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Wo(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((c.extend||t==n)&&!(f&&Ln)){c.collapse(a.node,a.offset);try{t!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(t>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?yo:Wb,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=or:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?yo:or}r=s}this.dirty=yo}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?yo:Wb;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class FC extends Ml{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){let a=be(s)?s:document.createElement("span");a!=s&&a.appendChild(s),a.hasAttribute("contenteditable")||(a.contentEditable="false"),a.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Vn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class gB extends Ml{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ui extends Ml{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Yi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ui(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=or&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Vn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Vn}}slice(t,n,r){let i=Ui.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Tp(o,n,s,r)),t>0&&(o=Tp(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Hi extends Ml{constructor(t,n,r,i,o,s,a){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!Dt(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Yi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=jC(u,r,n),c?l=new AB(t,n,r,i,u,f||null,d,c):n.isText?new cf(t,n,r,i,u,d):new Hi(t,n,r,i,u,f||null,d)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){n.contentElement=i.dom.parentNode;break}}if(!n.contentElement){let r=t&&t.find(i=>be(i)&&t.indexOf(i.parentNode)<0&&this.dom.contains(i));r?n.contentElement=r:n.getContent=()=>oe.empty}}return n}matchesNode(t,n,r){return this.dirty==Vn&&t.eq(this.node)&&mu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new bB(this,s&&s.node,t),c=this.node.inlineContent,u=c&&this.node.isBlock;kB(this.node,this.innerDeco,(f,d,h)=>{f.spec.marks?l.syncToMarks(f.spec.marks,r,t,d):f.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?Ve.none:this.node.child(d).marks,r,t,d),l.placeWidget(f,t,i)},(f,d,h,p)=>{l.syncToMarks(f.marks,r,t,p),u&&f.isAtom&&!f.isText&&l.addHackNode("IMG",l.top);let m;l.findNodeMatch(f,d,h,p)||a&&t.state.selection.from>i&&t.state.selection.to<i+f.nodeSize&&(m=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(f,d,h,m,t)||l.updateNextNode(f,d,h,t,p,i)||l.addNode(f,d,h,t,i),i+=f.nodeSize,c&&(u=f.isAtom&&!f.isText)}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==yo)&&(s&&this.protectLocalComposition(t,s),zC(this.contentDOM,this.children,t),Fs&&CB(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof _e)||r<n||i>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=vB(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new gB(this,o,n,i);t.input.compositionNodes.push(s),this.children=Tp(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==or||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Vn}updateOuterDeco(t){if(mu(t,this.outerDeco))return;let n=!be(this.nodeDOM),r=this.dom;this.dom=WC(this.dom,this.nodeDOM,Ep(this.outerDeco,this.node,n),Ep(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){be(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){be(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function jb(e,t,n,r,i){jC(r,t,e);let o=new Hi(void 0,e,t,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o}class cf extends Hi{constructor(t,n,r,i,o,s){super(t,n,r,i,o,null,s)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==or||this.dirty!=Vn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Vn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Vn,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new cf(this.parent,i,this.outerDeco,this.innerDeco,o,o)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=or)}get domAtom(){return!1}isText(t){return this.node.text==t}}class LC extends Ml{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Vn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class AB extends Hi{constructor(t,n,r,i,o,s,a,l){super(t,n,r,i,o,s,a),this.spec=l}update(t,n,r,i){if(this.dirty==or)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function zC(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Ub(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Ui){let l=r?r.previousSibling:e.lastChild;zC(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=Ub(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Ta=function(e){e&&(this.nodeName=e)};Ta.prototype=Object.create(null);const bo=[new Ta];function Ep(e,t,n){if(e.length==0)return bo;let r=n?bo[0]:new Ta,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Ta(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Ta(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function WC(e,t,n,r){if(n==bo&&r==bo)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=bo[0]),i=l}yB(i,a||bo[0],s)}return i}function yB(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function jC(e,t,n){return WC(e,e,bo,Ep(t,n,!be(e)))}function mu(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Ub(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class bB{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=wB(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let o=0,s=this.stack.length>>1,a=Math.min(s,t.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=Vn,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let f=this.top.children[u];if(f.matchesMark(t[s])&&!this.isLocked(f.dom)){l=u;break}}if(l<0&&this.index<this.top.children.length){let u=this.top.children[this.index];u instanceof Ui&&u.dirty!=or&&u.mark.type==t[s].type&&u.spec.update&&!this.isLocked(u.dom)&&u.spec.update(t[s])&&(u.mark=t[s],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Ui.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let s=this.top.children[i];return s.dirty==or&&s.dom==s.contentDOM&&(s.dirty=yo),s.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Hi){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=or&&mu(n,l.outerDeco));if(!d&&l.update(t,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,t,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=yo,f.updateChildren(i,s+1),f.dirty=Vn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!mu(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let a=Hi.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,i,o){let s=Hi.create(this.top,t,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new FC(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Ui;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof cf)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((en||Kt)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new LC(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||be(t)&&t.contains(this.lock.parentNode))}}function wB(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ui)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function xB(e,t){return e.type.side-t.type.side}function kB(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,i,t.forChild(o,u),c),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(xB);for(let g=0;g<f.length;g++)n(f[g],c,!!l)}else n(u,c,!!l);let d,h;if(l)h=-1,d=l,l=null;else if(c<e.childCount)h=c,d=e.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=o&&a.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let g=p;s<i.length&&i[s].from<g&&(g=i[s].from);for(let A=0;A<a.length;A++)a[A].to<g&&(g=a[A].to);g<p&&(l=d.cut(g-o),d=d.cut(0,g-o),p=g,h=-1)}else for(;s<i.length&&i[s].to<p;)s++;let m=d.isInline&&!d.isLeaf?a.filter(g=>!g.inline):a.slice();r(d,m,t.forChild(o,d),h),o=p}}function CB(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function vB(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function Tp(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Vm(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(af(n)){for(l=s;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&Te.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&$M(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new Te(s==f?a:r.resolve(f))}else if(Ln&&t=="key"&&s>e.state.selection.to&&be(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let f=n.focusNode;;f=f.parentNode){if(getComputedStyle(f).overflow!="visible"){c=Re.findFrom(r.resolve(i.posAtStart),1);break}if(f==i.dom||f.nextSibling||!f.parentNode||!be(f.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,d=s;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);f=Math.min(f,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(f<0)return null;[l,s]=d==e.state.selection.anchor?[d,f]:[f,d],a=r.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=t=="pointer"||e.state.selection.head<a.pos&&!o?1:-1;c=qm(e,u,a,f)}return c}function UC(e){return e.editable?e.hasFocus():KC(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ti(e,t=!1){let n=e.state.selection;if(HC(e,n),!UC(e))return;let r=e.input.mouseDown;if(!t&&Kt&&r){let i=e.domSelectionRange(),o=e.domObserver.currentSelection;if(i.anchorNode&&o.anchorNode&&Wo(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)IB(e);else{let{anchor:i,head:o}=n,s,a;Hb&&!(n instanceof _e)&&(n.$from.parent.inlineContent||(s=Kb(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=Kb(e,n.to))),e.docView.setSelection(i,o,e,t),Hb&&(s&&Jb(s),a&&Jb(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&SB(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const Hb=en||Kt&&RC<63;function Kb(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(en&&i&&i.contentEditable=="false")return yh(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return yh(i);if(o)return yh(o)}}function yh(e){return e.contentEditable="true",en&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Jb(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function SB(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!UC(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function IB(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,jt(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&En&&ji<=11&&(n.disabled=!0,n.disabled=!1)}function HC(e,t){if(t instanceof Te){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vb(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vb(e)}function Vb(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function qm(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||_e.between(t,n,r)}function qb(e){return e.editable&&!e.hasFocus()?!1:KC(e)}function KC(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return jo(e.dom,t.anchorNode)&&(e.editable||jo(e.dom,t.focusNode))}catch{return!1}}function EB(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Wo(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Rp(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Re.findFrom(o,t)}function Ni(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Gb(e,t,n){let r=e.state.selection;if(r instanceof _e)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Ni(e,new _e(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=Rp(e.state,t);return i&&i instanceof Te?Ni(e,i):!1}else if(!(Hn&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?Te.isSelectable(o)?Ni(e,new Te(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Ni(e,new _e(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1}}else return!1;else{if(r instanceof Te&&r.node.isInline)return Ni(e,new _e(t>0?r.$to:r.$from));{let i=Rp(e.state,t);return i?Ni(e,i):!1}}}function Ra(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR"):be(e)&&e.contentEditable=="false"}function as(e,t){return t<0?TB(e):RB(e)}function TB(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Ln&&be(n)&&r<$t(n)&&Ra(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(!be(n))break;let a=n.childNodes[r-1];if(Ra(a,-1))i=n,o=--r;else if(Dt(a))n=a,r=n.nodeValue.length;else break}else{if(JC(n))break;{let a=n.previousSibling;for(;a&&Ra(a,-1);)i=n.parentNode,o=jt(a),a=a.previousSibling;if(a)n=a,r=$t(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?_p(e,n,r):i&&_p(e,i,o)}function RB(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=$t(n),o,s;for(;;)if(r<i){if(!be(n))break;let a=n.childNodes[r];if(Ra(a,1))o=n,s=++r;else break}else{if(JC(n))break;{let a=n.nextSibling;for(;a&&Ra(a,1);)o=a.parentNode,s=jt(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=$t(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&_p(e,o,s)}function JC(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function _B(e,t){for(;e&&t==e.childNodes.length&&!Dl(e);)t=jt(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(Dt(n))return n;if(be(n)&&n.contentEditable=="false")break;e=n,t=0}}function NB(e,t){for(;e&&!t&&!Dl(e);)t=jt(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(Dt(n))return n;if(be(n)&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function _p(e,t,n){if(!Dt(t)){let o,s;(s=_B(t,n))?(t=s,n=0):(o=NB(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(af(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&ti(e)},50)}function Qb(e,t){let n=e.state.doc.resolve(t);if(!(Kt||_C)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Yb(e,t,n){let r=e.state.selection;if(r instanceof _e&&!r.empty||n.indexOf("s")>-1||Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Rp(e.state,t);if(s&&s instanceof Te)return Ni(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof Fn?Re.near(s,t):Re.findFrom(s,t);return a?Ni(e,a):!1}return!1}function $b(e,t){if(!(e.state.selection instanceof _e))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function Zb(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function OB(e){if(!en||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&be(t)&&n==0&&t.firstChild&&be(t.firstChild)&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Zb(e,r,"true"),setTimeout(()=>Zb(e,r,"false"),20)}return!1}function DB(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function MB(e,t){let n=t.keyCode,r=DB(t);if(n==8||Hn&&n==72&&r=="c")return $b(e,-1)||as(e,-1);if(n==46&&!t.shiftKey||Hn&&n==68&&r=="c")return $b(e,1)||as(e,1);if(n==13||n==27)return!0;if(n==37||Hn&&n==66&&r=="c"){let i=n==37?Qb(e,e.state.selection.from)=="ltr"?-1:1:-1;return Gb(e,i,r)||as(e,i)}else if(n==39||Hn&&n==70&&r=="c"){let i=n==39?Qb(e,e.state.selection.from)=="ltr"?1:-1:1;return Gb(e,i,r)||as(e,i)}else{if(n==38||Hn&&n==80&&r=="c")return Yb(e,-1,r)||as(e,-1);if(n==40||Hn&&n==78&&r=="c")return OB(e)||Yb(e,1,r)||as(e,1);if(r==(Hn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Gm(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||Yi.fromSchema(e.state.schema),a=$C(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&be(c)&&(u=YC[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}c=l.firstChild}c&&be(c)&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
45
+
46
+ `);return{dom:l,text:d,slice:t}}function VC(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=!!t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return a=new ce(oe.from(e.state.schema.text(t.replace(/\r\n?/g,`
47
+ `))),0,0),e.someProp("transformPasted",d=>{a=d(a,e,!0)}),a;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)a=f;else{let d=i.marks(),{schema:h}=e.state,p=Yi.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=LB(n),lf&&zB(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&!be(d);)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Bm.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!BB.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=WB(Xb(a,+u[1],+u[2]),u[4]);else if(a=ce.maxOpen(PB(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f<a.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=a.content.lastChild;d<a.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);a=Xb(a,f,d)}return e.someProp("transformPasted",f=>{a=f(a,e,l)}),a}const BB=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function PB(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&GC(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=QC(s[s.length-1],o.length));let u=qC(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return oe.from(s)}return e}function qC(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,oe.from(e));return e}function GC(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=GC(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(oe.from(qC(n,e,i+1))))}}function QC(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,QC(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(oe.empty,!0);return e.copy(n.append(r))}function Np(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=Np(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(oe.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Xb(e,t,n){return t<e.openStart&&(e=new ce(Np(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ce(Np(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const YC={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function $C(){return document.implementation.createHTMLDocument("title")}let ia=null;function FB(e){let t=window.trustedTypes;if(!t)return e;if(!ia){if(ia=t.defaultPolicy)try{return ia.createHTML(e)}catch{}ia=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return ia.createHTML(e)}function LB(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=$C(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),o;if((o=i&&YC[i[1].toLowerCase()])&&(e=o.map(s=>"<"+s+">").join("")+e+o.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=FB(e),o)for(let s=0;s<o.length;s++)r=r.querySelector(o[s])||r;for(let s=0;s<n.styleSheets.length;s++){let a=n.styleSheets[s];for(let l=0;l<a.rules.length;l++){let c=a.rules[l];if(c instanceof CSSStyleRule){let u=r.querySelectorAll(c.selectorText);for(let f=0;f<u.length;f++)u[f].style.cssText+=c.style.cssText}}}return r}function zB(e){let t=e.querySelectorAll(Kt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function WB(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{i=oe.from(l.create(r[a+1],i))}catch{break}o++,s++}return new ce(i,o,s)}const dn={},pn={},jB={touchstart:!0,touchmove:!0};class UB{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function HB(e){for(let t in dn){let n=dn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{JB(e,r)&&!Qm(e,r)&&(e.editable||!(r.type in pn))&&n(e,r)},jB[t]?{passive:!0}:void 0)}en&&e.dom.addEventListener("input",()=>null),Op(e)}function Zr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function KB(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Op(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>Qm(e,r))})}function Qm(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function JB(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function VB(e,t){!Qm(e,t)&&dn[t.type]&&(e.editable||!(t.type in pn))&&dn[t.type](e,t)}pn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!tv(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!($r&&Kt&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Fs&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,go(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||MB(e,n)?n.preventDefault():Zr(e,"key")};pn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};pn.keypress=(e,t)=>{let n=t;if(tv(e)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof _e)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function Bl(e){return{left:e.clientX,top:e.clientY}}function qB(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Ym(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Pl(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function GB(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Te.isSelectable(r)?(Pl(e,new Te(n)),!0):!1}function QB(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Te&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(Te.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Pl(e,Te.create(e.state.doc,i)),!0):!1}function YB(e,t,n,r,i){return Ym(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?QB(e,n):GB(e,n))}function $B(e,t,n,r){return Ym(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function ZB(e,t,n,r){return Ym(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||XB(e,n,r)}function XB(e,t,n){if(n.button!=0)return!1;let r=ZC(e,t,!0),i=e.state.doc;return r?(Pl(e,r),r instanceof _e&&i.eq(e.state.doc)&&(e.input.mouseDown=new tP(e,r)),!0):!1}function ZC(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?_e.create(r,0,r.content.size):null;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)return _e.create(r,a+1,a+1+s.content.size);if(n&&Te.isSelectable(s))return Te.create(r,a)}return null}function $m(e){return gu(e)}const XC=Hn?"metaKey":"ctrlKey";dn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=$m(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&qB(n,e.input.lastClick)&&!n[XC]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(Bl(n));s&&(o=="singleClick"?e.input.mouseDown=new eP(e,s,n,!!r):(o=="doubleClick"?$B:ZB)(e,s.pos,s.inside,n)?n.preventDefault():Zr(e,"pointer"))};class ev{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class eP extends ev{constructor(t,n,r,i){super(t),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[XC],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&be(l.nodeDOM)?l.nodeDOM:null;let{selection:c}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Te&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ln&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Zr(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ti(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Bl(t))),this.updateAllowDefault(t),this.allowDefault||!n?Zr(this.view,"pointer"):YB(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||en&&this.mightDrag&&!this.mightDrag.node.isAtom||Kt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Pl(this.view,Re.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Zr(this.view,"pointer")}move(t){this.updateAllowDefault(t),Zr(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class tP extends ev{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),Zr(this.view,"pointer");let n=this.view.posAtCoords(Bl(t)),r=n&&ZC(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,o=this.startSelection,[s,a]=r.from<o.from?[o.to,r.from]:[o.from,r.to];Pl(this.view,_e.create(i,s,a))}}dn.touchstart=e=>{e.input.lastTouch=Date.now(),$m(e),Zr(e,"pointer")};dn.touchmove=e=>{e.input.lastTouch=Date.now(),Zr(e,"pointer")};dn.contextmenu=e=>$m(e);function tv(e,t){return e.composing?!0:en&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const nP=$r?5e3:-1;pn.compositionstart=pn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof _e&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Kt&&_C&&rP(e)))e.markCursor=e.state.storedMarks||n.marks(),gu(e,!0),e.markCursor=null;else if(gu(e,!t.selection.empty),Ln&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&be(i)&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(Dt(s)){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}nv(e,nP)};function rP(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!be(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return be(r)&&r.contentEditable=="false"}pn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,nv(e,20))};function nv(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>gu(e),t))}function rv(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function iP(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=QM(t.focusNode,t.focusOffset),r=YM(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function gu(e,t=!1){if(!($r&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rv(e),t||e.docView&&e.docView.dirty){let n=Vm(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function oP(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Ya=En&&ji<15||Fs&&eB<604;dn.copy=pn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Ya?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Gm(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):oP(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function sP(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function aP(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?$a(e,r.value,null,i,t):$a(e,r.textContent,r.innerHTML,i,t)},50)}function $a(e,t,n,r,i){let o=VC(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||ce.empty)))return!0;if(!o)return!1;let s=sP(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function iv(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}pn.paste=(e,t)=>{let n=t;if(e.composing&&!$r)return;let r=Ya?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&$a(e,iv(r),r.getData("text/html"),i,n)?n.preventDefault():aP(e,n)};class ov{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const lP=Hn?"altKey":"ctrlKey";function sv(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[lP]}dn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Bl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Te?i.to-1:i.to))){if(r&&r.mightDrag)s=Te.create(e.state.doc,r.mightDrag.pos);else if(n.target&&be(n.target)){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(s=Te.create(e.state.doc,f.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:c,slice:u}=Gm(e,a);(!n.dataTransfer.files.length||!Kt||RC>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ya?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ya||n.dataTransfer.setData("text/plain",c),e.dragging=new ov(u,sv(e,n),s)};dn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};pn.dragover=pn.dragenter=(e,t)=>t.preventDefault();pn.drop=(e,t)=>{try{cP(e,t,e.dragging)}finally{e.dragging=null}};function cP(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Bl(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",h=>{o=h(o,e,!1)}):o=VC(e,iv(t.dataTransfer),Ya?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&sv(e,t));if(e.someProp("handleDrop",h=>h(e,t,o||ce.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?FD(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let l=e.state.tr;if(s){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(u?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o),l.doc.eq(f))return;let d=l.doc.resolve(c);if(u&&Te.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new Te(d));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,m,g,A)=>h=A),l.setSelection(qm(e,d,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}dn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ti(e)},20))};dn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};dn.beforeinput=(e,t)=>{if($r&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,go(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in pn)dn[e]=pn[e];function Za(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Au{constructor(t,n){this.toDOM=t,this.spec=n||So,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Jt(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Au&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Za(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ki{constructor(t,n){this.attrs=t,this.spec=n||So}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Jt(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ki&&Za(this.attrs,t.attrs)&&Za(this.spec,t.spec)}static is(t){return t.type instanceof Ki}destroy(){}}class Zm{constructor(t,n){this.attrs=t,this.spec=n||So}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let s=t.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Jt(o.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof Zm&&Za(this.attrs,t.attrs)&&Za(this.spec,t.spec)}destroy(){}}class Jt{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Jt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Jt(t,t,new Au(n,r))}static inline(t,n,r,i){return new Jt(t,n,new Ki(r,i))}static node(t,n,r,i){return new Jt(t,n,new Zm(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ki}get widget(){return this.type instanceof Au}}const hs=[],So={};class dt{constructor(t,n){this.local=t.length?t:hs,this.children=n.length?n:hs}static create(t,n){return n.length?yu(n,t,0,So):Qt}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==Qt||t.maps.length==0?this:this.mapInner(t,n,0,0,r||So)}mapInner(t,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?uP(this.children,s||[],t,n,r,i,o):s?new dt(s.sort(Io),hs):Qt}add(t,n){return n.length?this==Qt?dt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((a,l)=>{let c=l+r,u;if(u=lv(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,yu(u,a,c+1,So)),o+=3}});let s=av(o?cv(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new dt(s.length?this.local.concat(s).sort(Io):this.local,i||this.children)}remove(t){return t.length==0||this==Qt?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<t.length;u++)(f=t[u])&&f.from>a&&f.to<l&&(t[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=Qt?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<t.length;o++)if(s=t[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new dt(i,r):Qt}forChild(t,n){if(this==Qt)return this;if(n.isLeaf)return dt.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Ki){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new dt(i.sort(Io),hs);return r?new Mi([a,r]):a}return r||Qt}eq(t){if(this==t)return!0;if(!(t instanceof dt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return Xm(this.localsInner(t))}localsInner(t){if(this==Qt)return hs;if(t.inlineContent||!this.local.some(Ki.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ki||n.push(this.local[r]);return n}forEachSet(t){t(this)}}dt.empty=new dt([],[]);dt.removeOverlap=Xm;const Qt=dt.empty;class Mi{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,So));return Mi.from(r)}forChild(t,n){if(n.isLeaf)return dt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Qt&&(o instanceof Mi?r=r.concat(o.members):r.push(o))}return Mi.from(r)}eq(t){if(!(t instanceof Mi)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Xm(r?n:n.sort(Io)):hs}static from(t){switch(t.length){case 0:return Qt;case 1:return t[0];default:return new Mi(t.every(n=>n instanceof dt)?t:t.reduce((n,r)=>n.concat(r instanceof dt?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function uP(e,t,n,r,i,o,s){let a=e.slice();for(let c=0,u=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,h,p,m)=>{let g=m-p-(h-d);for(let A=0;A<a.length;A+=3){let x=a[A+1];if(x<0||d>x+u-f)continue;let b=a[A]+u-f;h>=b?a[A+1]=d<=b?-2:-1:d>=u&&g&&(a[A]+=g,a[A+1]+=g)}f+=g}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(e[c]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(e[c+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),g=r.maybeChild(p);if(g&&m==f&&m+g.nodeSize==h){let A=a[c+2].mapInner(n,g,u+1,e[c]+o+1,s);A!=Qt?(a[c]=f,a[c+1]=h,a[c+2]=A):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=fP(a,e,t,n,i,o,s),u=yu(c,r,0,s);t=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<u.children.length;f+=3){let h=u.children[f];for(;d<a.length&&a[d]<h;)d+=3;a.splice(d,0,u.children[f],u.children[f+1],u.children[f+2])}}return new dt(t.sort(Io),a)}function av(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Jt(i.from+t,i.to+t,i.type))}return n}function fP(e,t,n,r,i,o,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+o+1);return n}function lv(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,s;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function cv(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function yu(e,t,n,r){let i=[],o=!1;t.forEach((a,l)=>{let c=lv(e,a,l+n);if(c){o=!0;let u=yu(c,a,n+l+1,r);u!=Qt&&i.push(l,l+a.nodeSize,u)}});let s=av(o?cv(e):e,-n).sort(Io);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new dt(s,i):Qt}function Io(e,t){return e.from-t.from||e.to-t.to}function Xm(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),ew(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),ew(t,i,r.copy(o.from,r.to)));break}}}return t}function ew(e,t,n){for(;t<e.length&&Io(n,e[t])>0;)t++;e.splice(t,0,n)}function bh(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Qt&&t.push(r)}),e.cursorWrapper&&t.push(dt.create(e.state.doc,[e.cursorWrapper.deco])),Mi.from(t)}const hP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dP=En&&ji<=11;class pP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class mP{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);En&&ji<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():en&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dP&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,hP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(qb(this.view)){if(this.suppressingSelectionUpdates)return ti(this.view);if(En&&ji<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Wo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Ps(o))n.add(o);for(let o=t.anchorNode;o;o=Ps(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:Dt(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&qb(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||Kt&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let f=u.nextSibling;for(;f&&be(f);){if(f.contentEditable=="false"){u.parentNode.removeChild(u);break}f=f.firstChild}}}else if(Ln&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||yP(t,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&af(r)&&(c=Vm(t))&&c.eq(Re.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ti(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),gP(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,bP(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ti(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++){let f=t.addedNodes[u];n.push(f),Dt(f)&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(En&&ji<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=t.addedNodes[u];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==t.target?jt(i)+1:0,a=r.localPosFromDOM(t.target,s,-1),l=o&&o.parentNode==t.target?jt(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let tw=new WeakMap,nw=!1;function gP(e){if(!tw.has(e)&&(tw.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ln,nw)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),nw=!0}}function rw(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Wo(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function AP(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return rw(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?rw(e,n):null}function yP(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function bP(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=o.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let a=s;for(;;){let l=a.firstChild;if(!l||!be(l)||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(o,a.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function wP(e,t,n,r){let{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u,f=c.anchorNode;if(f&&jo(e.dom,f)&&(u=[{node:f,offset:c.anchorOffset}],af(c)||u.push({node:c.focusNode,offset:c.focusOffset})),Kt&&e.input.lastKeyCode===8)for(let A=s;A>o;A--){let x=i.childNodes[A-1],b=x.pmViewDesc;if(x.nodeName=="BR"&&!b){s=A;break}if(!b||b.size)break}let d=e.state.doc,h=e.someProp("domParser")||Bm.fromSchema(e.state.schema),p=d.resolve(a),m=null,g=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:xP(r),context:p});if(u&&u[0].pos!=null){let A=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=A),m={anchor:A+a,head:x+a}}return{doc:g,sel:m,from:a,to:l}}const xP=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(en&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||en&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},kP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function CP(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let v=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,D=Vm(e,v);if(D&&!e.state.selection.eq(D)){if(Kt&&$r&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",T=>T(e,go(13,"Enter"))))return;let N=e.state.tr.setSelection(D);v=="pointer"?N.setMeta("pointer",!0):v=="key"&&N.scrollIntoView(),o&&N.setMeta("composition",o),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,c=wP(e,t,n,i),u=e.state.doc,f=u.slice(c.from,c.to),d,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,h="end"):(d=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let p=EP(f.content,c.doc.content,c.from,d,h);if(p&&e.input.domChangeCount++,(Fs&&e.input.lastIOSEnter>Date.now()-225||$r)&&i.some(v=>be(v)&&!kP.test(v.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",v=>v(e,go(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof _e&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let v=iw(e,e.state.doc,c.sel);if(v&&!v.eq(e.state.selection)){let D=e.state.tr.setSelection(v);o&&D.setMeta("composition",o),e.dispatch(D)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof _e&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),En&&ji<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),A=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&A.end()>=p.endA;if((Fs&&e.input.lastIOSEnter>Date.now()-225&&(!x||i.some(v=>v.nodeName=="DIV"||v.nodeName=="P"))||!x&&IP(c.doc,m.pos,g.pos))&&e.someProp("handleKeyDown",v=>v(e,go(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&SP(u,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",v=>v(e,go(8,"Backspace")))){$r&&Kt&&e.domObserver.suppressSelectionUpdates();return}Kt&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),$r&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(v){return v(e,go(13,"Enter"))})},20));let b=p.start,y=p.endA,C=v=>{let D=v||e.state.tr.replace(b,y,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let N=iw(e,D.doc,c.sel);N&&!(Kt&&e.composing&&N.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(N.head==b||N.head==D.mapping.map(y)-1)||En&&N.empty&&N.head==b)&&D.setSelection(N)}return o&&D.setMeta("composition",o),D.scrollIntoView()},w;if(x)if(m.pos==g.pos){En&&ji<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ti(e),20));let v=C(e.state.tr.delete(b,y)),D=u.resolve(p.start).marksAcross(u.resolve(p.endA));D&&v.ensureMarks(D),e.dispatch(v)}else if(p.endA==p.endB&&(w=vP(m.parent.content.cut(m.parentOffset,g.parentOffset),A.parent.content.cut(A.parentOffset,p.endA-A.start())))){let v=C(e.state.tr);w.type=="add"?v.addMark(b,y,w.mark):v.removeMark(b,y,w.mark),e.dispatch(v)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let v=m.parent.textBetween(m.parentOffset,g.parentOffset),D=()=>C(e.state.tr.insertText(v,b,y));e.someProp("handleTextInput",N=>N(e,b,y,v,D))||e.dispatch(D())}else e.dispatch(C());else e.dispatch(C())}function iw(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:qm(e,t.resolve(n.anchor),t.resolve(n.head))}function vP(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(oe.from(c).eq(e))return{mark:a,type:s}}function SP(e,t,n,r,i){if(n-t<=i.pos-r.pos||wh(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==t+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(wh(o,!0,!0));return!s.parent.isTextblock||s.pos>n||wh(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function IP(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(o,s)=>{o.isTextblock&&s>=t&&s<n?r++:(o.isText?/\S/.test(o.text.slice(Math.max(0,t-s),Math.min(o.nodeSize,n-s))):o.isLeaf)&&i++}),i==0&&r==1}function wh(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function EP(e,t,n,r,i){let o=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(o==null)return null;let{a:l,b:c}=e.findDiffEnd(t,s,a);if(i=="end"){let u=Math.max(0,o-Math.min(l,c));r-=l+u-o}if(l<o&&s<a){let u=r<=o&&r>=l?o-r:0;o-=u,c=o+(c-l),l=o}else if(c<o){let u=r<=o&&r>=c?o-r:0;o-=u,l=o+(l-c),c=o}return{start:o,endA:l,endB:c}}class uv{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new UB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(cw),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=aw(this),sw(this),this.nodeViews=lw(this),this.docView=jb(this.state.doc,ow(this),bh(this),this.dom,this),this.domObserver=new mP(this,(r,i,o,s)=>CP(this,r,i,o,s)),this.domObserver.start(),HB(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Op(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(cw),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(rv(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=lw(this);RP(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Op(this),this.editable=aw(this),sw(this);let l=bh(this),c=ow(this),u=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,c,l);(f||!t.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&rB(this);if(s){this.domObserver.stop();let h=f&&(En||Kt)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&TP(i.selection,t.selection);if(f){let m=Kt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=iP(this)),(o||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=jb(t.doc,c,l,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let p=this.input.mouseDown;h||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&EB(this)&&p.delaySelUpdate())?ti(this,h):(HC(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&iB(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!jo(this.dom,t))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Te){let n=this.docView.domAfterPos(this.state.selection.from);be(n)&&Pb(this,n.getBoundingClientRect(),t)}else Pb(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new ov(t.slice,t.move,i<0?void 0:Te.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[t];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(En){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&oB(this.dom),ti(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return uB(this,t)}coordsAtPos(t,n=1){return BC(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return mB(this,n||this.state,t)}pasteHTML(t,n){return $a(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return $a(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Gm(this,t)}destroy(){this.docView&&(KB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bh(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,qM())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return VB(this,t)}domSelectionRange(){let t=this.dom.isConnected!==!1&&this.domSelection();return t?en&&this.root.nodeType===11&&ZM(this.dom.ownerDocument)==this.dom&&AP(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}uv.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ow(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Jt.node(0,e.state.doc.content.size,t)]}function sw(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Jt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function aw(e){return!e.someProp("editable",t=>t(e.state)===!1)}function TP(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function lw(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function RP(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function cw(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function li(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}var fv={text:(e,t,n,r)=>{const i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(e,t,n,r)=>{const i=e.marker||n.options.strong||"*",o=n.enter("strong"),s=n.createTracker(r);let a=s.move(i+i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i+i),o(),a},emphasis:(e,t,n,r)=>{const i=e.marker||n.options.emphasis||"*",o=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}},ni=Ue({},"editorView"),ya=Ue({},"editorState"),xh=Ue([],"initTimer"),uw=Ue({},"editor"),Xa=Ue([],"inputRules"),Uo=Ue([],"prosePlugins"),el=Ue([],"remarkPlugins"),tl=Ue([],"nodeView"),nl=Ue([],"markView"),Eo=Ue(hp().use(ip).use(cp),"remark"),_a=Ue({handlers:fv,encode:[]},"remarkStringifyOptions"),Hc=Br("ConfigReady");function _P(e){const t=n=>(n.record(Hc),async()=>(await e(n),n.done(Hc),()=>{n.clearTimer(Hc)}));return li(t,{displayName:"Config"}),t}var xs=Br("InitReady");function NP(e){const t=n=>(n.inject(uw,e).inject(Uo,[]).inject(el,[]).inject(Xa,[]).inject(tl,[]).inject(nl,[]).inject(_a,{handlers:fv,encode:[]}).inject(Eo,hp().use(ip).use(cp)).inject(xh,[Hc]).record(xs),async()=>{await n.waitTimers(xh);const r=n.get(_a);return n.set(Eo,hp().use(ip).use(cp,r)),n.done(xs),()=>{n.remove(uw).remove(Uo).remove(el).remove(Xa).remove(tl).remove(nl).remove(_a).remove(Eo).remove(xh).clearTimer(xs)}});return li(t,{displayName:"Init"}),t}var hn=Br("SchemaReady"),kh=Ue([],"schemaTimer"),sr=Ue({},"schema"),Na=Ue([],"nodes"),Oa=Ue([],"marks");function fw(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var hv=e=>(e.inject(sr,{}).inject(Na,[]).inject(Oa,[]).inject(kh,[xs]).record(hn),async()=>{await e.waitTimers(kh);const t=e.get(Eo),n=e.get(el).reduce((s,a)=>s.use(a.plugin,a.options),t);e.set(Eo,n);const r=Object.fromEntries(e.get(Na).map(([s,a])=>[s,fw(a)])),i=Object.fromEntries(e.get(Oa).map(([s,a])=>[s,fw(a)])),o=new hD({nodes:r,marks:i});return e.set(sr,o),e.done(hn),()=>{e.remove(sr).remove(Na).remove(Oa).remove(kh).clearTimer(hn)}});li(hv,{displayName:"Schema"});var dv=class{constructor(){this.#t=new Kk,this.#e=null,this.setCtx=e=>{this.#e=e},this.chain=()=>{if(this.#e==null)throw Qf();const e=this.#e,t=[],n=this.get.bind(this),r={run:()=>{const o=Us(...t),s=e.get(ni);return o(s.state,s.dispatch,s)},inline:o=>(t.push(o),r),pipe:i.bind(this)};function i(o,s){const a=n(o);return t.push(a(s)),r}return r}}#t;#e;get ctx(){return this.#e}create(e,t){const n=e.create(this.#t.sliceMap);return n.set(t),n}get(e){return this.#t.get(e).get()}remove(e){return this.#t.remove(e)}call(e,t){if(this.#e==null)throw Qf();const n=this.get(e)(t),r=this.#e.get(ni);return n(r.state,r.dispatch,r)}inline(e){if(this.#e==null)throw Qf();const t=this.#e.get(ni);return e(t.state,t.dispatch,t)}};function OP(e="cmdKey"){return Ue((()=>()=>!1),e)}var tt=Ue(new dv,"commands"),Ch=Ue([hn],"commandsTimer"),Da=Br("CommandsReady"),pv=e=>{const t=new dv;return t.setCtx(e),e.inject(tt,t).inject(Ch,[hn]).record(Da),async()=>(await e.waitTimers(Ch),e.done(Da),()=>{e.remove(tt).remove(Ch).clearTimer(Da)})};li(pv,{displayName:"Commands"});function DP(e){return e.Backspace=Us(pM,Wm,qD,lC),e}var mv=class{constructor(){this.#t=null,this.#e=[],this.setCtx=e=>{this.#t=e},this.add=e=>(this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}),this.addObjectKeymap=e=>{const t=[];return Object.entries(e).forEach(([n,r])=>{if(typeof r=="function"){const i={key:n,onRun:()=>r};this.#e.push(i),t.push(()=>{this.#e=this.#e.filter(o=>o!==i)})}else this.#e.push(r),t.push(()=>{this.#e=this.#e.filter(i=>i!==r)})}),()=>{t.forEach(n=>n())}},this.addBaseKeymap=()=>{const e=DP(uM);return this.addObjectKeymap(e)},this.build=()=>{const e={};return this.#e.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([t,n])=>{const r=n.sort((o,s)=>(s.priority??50)-(o.priority??50));return[t,(o,s,a)=>{const l=this.#t;if(l==null)throw Qu();const c=r.map(u=>u.onRun(l));return Us(...c)(o,s,a)}]}))}}#t;#e;get ctx(){return this.#t}},bu=Ue(new mv,"keymap"),vh=Ue([hn],"keymapTimer"),Ma=Br("KeymapReady"),MP=e=>{const t=new mv;return t.setCtx(e),e.inject(bu,t).inject(vh,[hn]).record(Ma),async()=>(await e.waitTimers(vh),e.done(Ma),()=>{e.remove(bu).remove(vh).clearTimer(Ma)})},Kc=Br("ParserReady"),gv=(()=>{throw Qu()}),Jc=Ue(gv,"parser"),Sh=Ue([],"parserTimer"),Av=e=>(e.inject(Jc,gv).inject(Sh,[hn]).record(Kc),async()=>{await e.waitTimers(Sh);const t=e.get(Eo),n=e.get(sr);return e.set(Jc,KM.create(n,t)),e.done(Kc),()=>{e.remove(Jc).remove(Sh).clearTimer(Kc)}});li(Av,{displayName:"Parser"});var Vc=Br("SerializerReady"),Ih=Ue([],"serializerTimer"),yv=(()=>{throw Qu()}),qc=Ue(yv,"serializer"),bv=e=>(e.inject(qc,yv).inject(Ih,[hn]).record(Vc),async()=>{await e.waitTimers(Ih);const t=e.get(Eo),n=e.get(sr);return e.set(qc,VM.create(n,t)),e.done(Vc),()=>{e.remove(qc).remove(Ih).clearTimer(Vc)}});li(bv,{displayName:"Serializer"});var Eh=Ue("","defaultValue"),Th=Ue(e=>e,"stateOptions"),Rh=Ue([],"editorStateTimer"),Gc=Br("EditorStateReady");function BP(e,t,n){if(typeof e=="string")return t(e);if(e.type==="html")return Bm.fromSchema(n).parse(e.dom);if(e.type==="json")return ei.fromJSON(n,e.value);throw sR(e)}var PP=new zn("MILKDOWN_STATE_TRACKER"),wv=e=>(e.inject(Eh,"").inject(ya,{}).inject(Th,t=>t).inject(Rh,[Kc,Vc,Da,Ma]).record(Gc),async()=>{await e.waitTimers(Rh);const t=e.get(sr),n=e.get(Jc),r=e.get(Xa),i=e.get(Th),o=e.get(Uo),s=BP(e.get(Eh),n,t),a=e.get(bu),l=a.addBaseKeymap(),c=[...o,new An({key:PP,state:{init:()=>{},apply:(d,h,p,m)=>{e.set(ya,m)}}}),xM({rules:r}),UM(a.build())];e.set(Uo,c);const u=i({schema:t,doc:s,plugins:c}),f=ys.create(u);return e.set(ya,f),e.done(Gc),()=>{l(),e.remove(Eh).remove(ya).remove(Th).remove(Rh).clearTimer(Gc)}});li(wv,{displayName:"EditorState"});var rl=Ue([],"pasteRule"),_h=Ue([hn],"pasteRuleTimer"),Qc=Br("PasteRuleReady"),xv=e=>(e.inject(rl,[]).inject(_h,[hn]).record(Qc),async()=>(await e.waitTimers(_h),e.done(Qc),()=>{e.remove(rl).remove(_h).clearTimer(Qc)}));li(xv,{displayName:"PasteRule"});var Nh=Br("EditorViewReady"),Oh=Ue([],"editorViewTimer"),Dh=Ue({},"editorViewOptions"),Mh=Ue(null,"root"),Dp=Ue(null,"rootDOM"),Mp=Ue({},"rootAttrs");function FP(e,t){const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set(Dp,n);const r=t.get(Mp);return Object.entries(r).forEach(([i,o])=>n.setAttribute(i,o)),n}function LP(e){e.classList.add("editor"),e.setAttribute("role","textbox")}var zP=new zn("MILKDOWN_VIEW_CLEAR"),kv=e=>(e.inject(Mh,document.body).inject(ni,{}).inject(Dh,{}).inject(Dp,null).inject(Mp,{}).inject(Oh,[Gc,Qc]).record(Nh),async()=>{await e.wait(xs);const t=e.get(Mh)||document.body,n=typeof t=="string"?document.querySelector(t):t;e.update(Uo,l=>[new An({key:zP,view:c=>{const u=n?FP(n,e):void 0;return(()=>{if(u&&n){const d=c.dom;n.replaceChild(u,d),u.appendChild(d)}})(),{destroy:()=>{u?.parentNode&&u?.parentNode.replaceChild(c.dom,u),u?.remove()}}}}),...l]),await e.waitTimers(Oh);const r=e.get(ya),i=e.get(Dh),o=Object.fromEntries(e.get(tl)),s=Object.fromEntries(e.get(nl)),a=new uv(n,{state:r,nodeViews:o,markViews:s,transformPasted:(l,c,u)=>(e.get(rl).sort((f,d)=>(d.priority??50)-(f.priority??50)).map(f=>f.run).forEach(f=>{l=f(l,c,u)}),l),...i});return LP(a.dom),e.set(ni,a),e.done(Nh),()=>{a?.destroy(),e.remove(Mh).remove(ni).remove(Dh).remove(Dp).remove(Mp).remove(Oh).clearTimer(Nh)}});li(kv,{displayName:"EditorView"});var eG=(function(e){return e.Idle="Idle",e.OnCreate="OnCreate",e.Created="Created",e.OnDestroy="OnDestroy",e.Destroyed="Destroyed",e})({}),tG=class Cv{constructor(){this.#t=!1,this.#e="Idle",this.#r=[],this.#n=()=>{},this.#o=new Kk,this.#s=new bR,this.#i=new Map,this.#a=new Map,this.#l=new yR(this.#o,this.#s),this.#d=()=>{const t=_P(async r=>{await Promise.all(this.#r.map(i=>Promise.resolve(i(r))))}),n=[hv,Av,bv,pv,MP,xv,wv,kv,NP(this),t];this.#u(n,this.#a)},this.#u=(t,n)=>{t.forEach(r=>{const i=this.#l.produce(this.#t?r.meta:void 0),o=r(i);n.set(r,{ctx:i,handler:o,cleanup:void 0})})},this.#f=(t,n=!1)=>Promise.all([t].flat().map(async r=>{const i=this.#i.get(r)?.cleanup;return n?this.#i.delete(r):this.#i.set(r,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof i=="function"?i():i})),this.#p=async()=>{await Promise.all([...this.#a.entries()].map(async([t,{cleanup:n}])=>typeof n=="function"?n():n)),this.#a.clear()},this.#c=t=>{this.#e=t,this.#n(t)},this.#h=t=>[...t.entries()].map(async([n,r])=>{const{ctx:i,handler:o}=r;if(!o)return;const s=await o();t.set(n,{ctx:i,handler:o,cleanup:s})}),this.enableInspector=(t=!0)=>(this.#t=t,this),this.onStatusChange=t=>(this.#n=t,this),this.config=t=>(this.#r.push(t),this),this.removeConfig=t=>(this.#r=this.#r.filter(n=>n!==t),this),this.use=t=>{const n=[t].flat();return n.flat().forEach(r=>{this.#i.set(r,{ctx:void 0,handler:void 0,cleanup:void 0})}),this.#e==="Created"&&this.#u(n,this.#i),this},this.remove=async t=>this.#e==="OnCreate"?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(n=>{setTimeout(()=>{n(this.remove(t))},50)})):(await this.#f([t].flat(),!0),this),this.create=async()=>this.#e==="OnCreate"?this:(this.#e==="Created"&&await this.destroy(),this.#c("OnCreate"),this.#d(),this.#u([...this.#i.keys()],this.#i),await Promise.all([this.#h(this.#a),this.#h(this.#i)].flat()),this.#c("Created"),this),this.destroy=async(t=!1)=>this.#e==="Destroyed"||this.#e==="OnDestroy"?this:this.#e==="OnCreate"?new Promise(n=>{setTimeout(()=>{n(this.destroy(t))},50)}):(t&&(this.#r=[]),this.#c("OnDestroy"),await this.#f([...this.#i.keys()],t),await this.#p(),this.#c("Destroyed"),this),this.action=t=>t(this.#l),this.inspect=()=>this.#t?[...this.#a.values(),...this.#i.values()].map(({ctx:t})=>t?.inspector?.read()).filter(t=>!!t):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new Cv}#t;#e;#r;#n;#o;#s;#i;#a;#l;#d;#u;#f;#p;#c;#h;get ctx(){return this.#l}get status(){return this.#e}};function vv(e,t,n){const r=e.findIndex(([o])=>o===t);if(r===-1)return[...e,n];const i=e.slice();return i[r]=n,i}function Oe(e,t){const n=OP(e),r=i=>async()=>{r.key=n,await i.wait(Da);const o=t(i);return i.get(tt).create(n,o),r.run=s=>i.get(tt).call(e,s),()=>{i.get(tt).remove(n)}};return r}function Rn(e){const t=n=>async()=>{await n.wait(hn);const r=e(n);return n.update(Xa,i=>[...i,r]),t.inputRule=r,()=>{n.update(Xa,i=>i.filter(o=>o!==r))}};return t}function WP(e){const t=n=>async()=>{await n.wait(hn);const r=e(n);return n.update(rl,i=>[...i,r]),t.pasteRule=r,()=>{n.update(rl,i=>i.filter(o=>o!==r))}};return t}function jP(e,t){const n=r=>async()=>{const i=t(r);return r.update(Oa,o=>vv(o,e,[e,i])),n.id=e,n.schema=i,()=>{r.update(Oa,o=>o.filter(([s])=>s!==e))}};return n.type=r=>{const i=r.get(sr).marks[e];if(!i)throw pR(e);return i},n}function eg(e,t){const n=r=>async()=>{const i=t(r);return r.update(Na,o=>vv(o,e,[e,i])),n.id=e,n.schema=i,()=>{r.update(Na,o=>o.filter(([s])=>s!==e))}};return n.type=r=>{const i=r.get(sr).nodes[e];if(!i)throw dR(e);return i},n}function fr(e){let t;const n=r=>async()=>(await r.wait(hn),t=e(r),r.update(Uo,i=>[...i,t]),()=>{r.update(Uo,i=>i.filter(o=>o!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function UP(e){const t=n=>async()=>{await n.wait(Ma);const r=n.get(bu),i=e(n),o=r.addObjectKeymap(i);return t.keymap=i,()=>{o()}};return t}function tg(e,t){const n=r=>async()=>{await r.wait(hn);const i=t(r);return e.type(r)instanceof hu?r.update(tl,o=>[...o,[e.id,i]]):r.update(nl,o=>[...o,[e.id,i]]),n.view=i,n.type=e,()=>{e.type(r)instanceof hu?r.update(tl,o=>o.filter(s=>s[0]!==e.id)):r.update(nl,o=>o.filter(s=>s[0]!==e.id))}};return n}function Pr(e,t){const n=Ue(e,t),r=i=>(i.inject(n),()=>()=>{i.remove(n)});return r.key=n,r}function xt(e,t){const n=Pr(t,e),r=eg(e,o=>o.get(n.key)(o)),i=[n,r];return i.id=r.id,i.node=r,i.type=o=>r.type(o),i.ctx=n,i.key=n.key,i.extendSchema=o=>xt(e,o(t)),i}function ci(e,t){const n=Pr(t,e),r=jP(e,o=>o.get(n.key)(o)),i=[n,r];return i.id=r.id,i.mark=r,i.type=o=>r.type(o),i.ctx=n,i.key=n.key,i.extendSchema=o=>ci(e,o(t)),i}function Wn(e,t){const n=Pr(Object.fromEntries(Object.entries(t).map(([o,{shortcuts:s,priority:a}])=>[o,{shortcuts:s,priority:a}])),`${e}Keymap`),r=UP(o=>{const s=o.get(n.key),a=Object.entries(t).flatMap(([l,{command:c}])=>{const u=s[l],f=[u.shortcuts].flat(),d=u.priority;return f.map(h=>[h,{key:h,onRun:c,priority:d}])});return Object.fromEntries(a)}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}var pr=(e,t=()=>({}))=>Pr(t,`${e}Attr`),Fl=(e,t=()=>({}))=>Pr(t,`${e}Attr`);function bn(e,t,n){const r=Pr({},e),i=s=>async()=>{await s.wait(xs);const a={plugin:t(s),options:s.get(r.key)};return s.update(el,l=>[...l,a]),()=>{s.update(el,l=>l.filter(c=>c!==a))}},o=[r,i];return o.id=e,o.plugin=i,o.options=r,o}function nG(){return e=>{const t=document.createElement("div"),n=e.get(sr),r=e.get(ni),i=Yi.fromSchema(n).serializeFragment(r.state.doc.content);return t.appendChild(i),t.innerHTML}}function rG(e){return t=>{const n=t.get(ni);return t.get(sr),t.get(qc)(n.state.doc)}}function HP(e,t){return function(n,r){let{$from:i,$to:o,node:s}=n.selection;if(s&&s.isBlock||i.depth<2||!i.sameParent(o))return!1;let a=i.node(-1);if(a.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let f=oe.empty,d=i.index(-1)?1:i.index(-2)?2:3;for(let A=i.depth-d;A>=i.depth-3;A--)f=oe.from(i.node(A).copy(f));let h=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;f=f.append(oe.from(e.createAndFill()));let p=i.before(i.depth-(d-1)),m=n.tr.replace(p,i.after(-h),new ce(f,4-d,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(A,x)=>{if(g>-1)return!1;A.isTextblock&&A.content.size==0&&(g=x+1)}),g>-1&&m.setSelection(Re.near(m.doc.resolve(g))),r(m.scrollIntoView())}return!0}let l=o.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,o.pos),u=l?[null,{type:l}]:void 0;return Ea(c.doc,i.pos,2,u)?(r&&r(c.split(i.pos,2,u).scrollIntoView()),!0):!1}}function KP(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?JP(t,n,e,o):VP(t,n,o):!0:!1}}function JP(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Zt(o-1,s,o,s,new ce(oe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new B1(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=ef(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return tf(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}function VP(e,t,n){let r=e.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?oe.empty:oe.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Zt(f-(a?1:0),d+(l?1:0),f+1,d-1,new ce((a?oe.empty:oe.from(i.copy(oe.empty))).append(l?oe.empty:oe.from(i.copy(oe.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}function qP(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=oe.from(c?e.create():null),f=new ce(oe.from(e.create(null,oe.from(a.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;n(t.tr.step(new Zt(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function GP(e){const t=new Map;if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return qo(e,"definition",function(r){const i=hw(r.identifier);i&&!t.get(i)&&t.set(i,r)}),n;function n(r){const i=hw(r);return t.get(i)}}function hw(e){return String(e||"").toUpperCase()}function QP(){return function(e){const t=GP(e);qo(e,function(n,r,i){if(n.type==="definition"&&i!==void 0&&typeof r=="number")return i.children.splice(r,1),[au,r];if(n.type==="imageReference"||n.type==="linkReference"){const o=t(n.identifier);if(o&&i&&typeof r=="number")return i.children[r]=n.type==="imageReference"?{type:"image",url:o.url,title:o.title,alt:n.alt}:{type:"link",url:o.url,title:o.title,children:n.children},[au,r]}})}}function YP(e){const t={...e};return t.position&&(t.position={start:{...t.position.start},end:{...t.position.end}}),delete t.children,t}var $P="<br />",ZP=/^<br\s*\/?\s*>$/i,XP=e=>typeof e=="string"&&ZP.test(e.trim());function Sv(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name==="hardbreak")){e.next(t.content);return}const n=[];t.content.forEach((r,i,o)=>{o!==t.childCount-1&&n.push(r)}),e.next(oe.fromArray(n))}function J(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}var ng=Fl("emphasis");J(ng,{displayName:"Attr<emphasis>",group:"Emphasis"});var Hs=ci("emphasis",e=>({attrs:{marker:{default:e.get(_a).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:t=>t==="italic"}],toDOM:t=>["em",e.get(ng.key)(t)],parseMarkdown:{match:t=>t.type==="emphasis",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="emphasis",runner:(t,n)=>{t.withMark(n,"emphasis",void 0,{marker:n.attrs.marker})}}}));J(Hs.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});J(Hs.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var rg=Oe("ToggleEmphasis",e=>()=>of(Hs.type(e)));J(rg,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var Iv=Rn(e=>Ol(/(?:^|[^*])\*([^*]+)\*$/,Hs.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("*")?{}:{fullMatch:t.slice(1),start:n+1}}));J(Iv,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var Ev=Rn(e=>Ol(/\b_(?![_\s])(.*?[^_\s])_$/,Hs.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("_")?{}:{fullMatch:t.slice(1),start:n+1}}));J(Ev,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var ig=Wn("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(tt);return()=>t.call(rg.key)}}});J(ig.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});J(ig.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var og=Fl("strong");J(og,{displayName:"Attr<strong>",group:"Strong"});var Ll=ci("strong",e=>({attrs:{marker:{default:e.get(_a).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:t=>t==="bold"},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:t=>["strong",e.get(og.key)(t)],parseMarkdown:{match:t=>t.type==="strong",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="strong",runner:(t,n)=>{t.withMark(n,"strong",void 0,{marker:n.attrs.marker})}}}));J(Ll.mark,{displayName:"MarkSchema<strong>",group:"Strong"});J(Ll.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var sg=Oe("ToggleStrong",e=>()=>of(Ll.type(e)));J(sg,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var Tv=Rn(e=>Ol(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Ll.type(e),{getAttr:t=>({marker:t[0].startsWith("*")?"*":"_"})}));J(Tv,{displayName:"InputRule<strong>",group:"Strong"});var ag=Wn("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(tt);return()=>t.call(sg.key)}}});J(ag.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});J(ag.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var lg=Fl("inlineCode");J(lg,{displayName:"Attr<inlineCode>",group:"InlineCode"});var zi=ci("inlineCode",e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(lg.key)(t)],parseMarkdown:{match:t=>t.type==="inlineCode",runner:(t,n,r)=>{t.openMark(r),t.addText(n.value),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="inlineCode",runner:(t,n,r)=>(t.withMark(n,"inlineCode",r.text||""),!0)}}));J(zi.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});J(zi.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var cg=Oe("ToggleInlineCode",e=>()=>(t,n)=>{const{selection:r,tr:i}=t;if(r.empty)return!1;const{from:o,to:s}=r;return t.doc.rangeHasMark(o,s,zi.type(e))?(n?.(i.removeMark(o,s,zi.type(e))),!0):(Object.keys(t.schema.marks).filter(a=>a!==zi.type.name).map(a=>t.schema.marks[a]).forEach(a=>{i.removeMark(o,s,a)}),n?.(i.addMark(o,s,zi.type(e).create())),!0)});J(cg,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var Rv=Rn(e=>Ol(/(?:`)([^`]+)(?:`)$/,zi.type(e)));J(Rv,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var ug=Wn("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(tt);return()=>t.call(cg.key)}}});J(ug.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});J(ug.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var eF=new Set(["http:","https:","mailto:","tel:","ftp:"]);function tF(e){return e<=32||e>=127&&e<=160||e>=8203&&e<=8205||e===8232||e===8233||e===65279}function nF(e){let t="";for(const n of e)tF(n.codePointAt(0)??0)||(t+=n);return t}function rF(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";const n=nF(t),r=/^([a-z][a-z0-9+.-]*):/i.exec(n)?.[1];return!r||eF.has(`${r.toLowerCase()}:`)?t:""}var fg=Fl("link");J(fg,{displayName:"Attr<link>",group:"Link"});var ks=ci("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(fg.key)(t),...t.attrs,href:rF(t.attrs.href)}],parseMarkdown:{match:t=>t.type==="link",runner:(t,n,r)=>{const i=n.url,o=n.title;t.openMark(r,{href:i,title:o}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="link",runner:(t,n)=>{t.withMark(n,"link",void 0,{title:n.attrs.title,url:n.attrs.href})}}}));J(ks.mark,{displayName:"MarkSchema<link>",group:"Link"});var _v=Oe("ToggleLink",e=>(t={})=>of(ks.type(e),t));J(_v,{displayName:"Command<toggleLinkCommand>",group:"Link"});var Nv=Oe("UpdateLink",e=>(t={})=>(n,r)=>{if(!r)return!1;let i,o=-1;const{selection:s}=n,{from:a,to:l}=s;if(n.doc.nodesBetween(a,a===l?l+1:l,(p,m)=>{if(ks.type(e).isInSet(p.marks))return i=p,o=m,!1}),!i)return!1;const c=i.marks.find(({type:p})=>p===ks.type(e));if(!c)return!1;const u=o,f=o+i.nodeSize,{tr:d}=n,h=ks.type(e).create({...c.attrs,...t});return h?(r(d.removeMark(u,f,c).addMark(u,f,h).setSelection(new _e(d.selection.$anchor)).scrollIntoView()),!0):!1});J(Nv,{displayName:"Command<updateLinkCommand>",group:"Link"});var Ov=eg("doc",()=>({content:"block+",parseMarkdown:{match:({type:e})=>e==="root",runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name==="doc",runner:(e,t)=>{e.openNode("root");const n=t.childCount>0?t.child(t.childCount-1):null,r=n?.type.name==="paragraph"&&n.content.size===0?t.content.cut(0,t.content.size-n.nodeSize):t.content;e.next(r)}}}));J(Ov,{displayName:"NodeSchema<doc>",group:"Doc"});var Dv=Object.freeze(["root","blockquote","listItem","footnoteDefinition"]),iF=new Set(["paragraph","heading","tableCell","link","linkReference","emphasis","strong","delete","footnote"]),wu=Pr(Dv,"blockContainerTypes");J(wu,{displayName:"Ctx<blockContainerTypes>",group:"Remark"});var dw=new Set;function Mv(e){const t=e.isInjected(wu.key)?e.get(wu.key):Dv,n=new Set;for(const r of t){if(iF.has(r)){dw.has(r)||(dw.add(r),console.warn(`[milkdown/preset-commonmark] "${r}" holds phrasing content and cannot be a block container; it is ignored in blockContainerTypes.`));continue}n.add(r)}return n}var oF=new Set(["paragraph","tableCell"]);function sF(e,t){return Rm(e,n=>n.type==="html"&&XP(n.value),(n,r)=>{const i=r[r.length-1];if(i){if(oF.has(i.type)){i.children.length===1&&(i.children=[]);return}if(t.has(i.type)){const o=n;return o.children=[],delete o.value,o.type="paragraph",au}}})}var uf=bn("remark-preserve-empty-line",e=>()=>t=>sF(t,Mv(e)));J(uf.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});J(uf.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var hg=pr("paragraph");J(hg,{displayName:"Attr<paragraph>",group:"Paragraph"});var _r=xt("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(hg.key)(t),0],parseMarkdown:{match:t=>t.type==="paragraph",runner:(t,n,r)=>{t.openNode(r),n.children?t.next(n.children):t.addText(n.value||""),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="paragraph",runner:(t,n)=>{t.openNode("paragraph"),(!n.content||n.content.size===0)&&aF(e)?t.addNode("html",void 0,$P):Sv(t,n),t.closeNode()}}}));function aF(e){return e.isInjected(uf.options.key)}J(_r.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});J(_r.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var dg=Oe("TurnIntoText",e=>()=>Qa(_r.type(e)));J(dg,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var pg=Wn("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(tt);return()=>t.call(dg.key)}}});J(pg.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});J(pg.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var lF=Array(6).fill(0).map((e,t)=>t+1);function cF(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")}var ff=Pr(cF,"headingIdGenerator");J(ff,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var mg=pr("heading");J(mg,{displayName:"Attr<heading>",group:"Heading"});var Go=xt("heading",e=>{const t=e.get(ff.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:lF.map(n=>({tag:`h${n}`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw dr(r);return{level:n,id:r.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(mg.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:n})=>n==="heading",runner:(n,r,i)=>{const o=r.depth;n.openNode(i,{level:o}),n.next(r.children),n.closeNode()}},toMarkdown:{match:n=>n.type.name==="heading",runner:(n,r)=>{n.openNode("heading",void 0,{depth:r.attrs.level}),Sv(n,r),n.closeNode()}}}});J(Go.node,{displayName:"NodeSchema<heading>",group:"Heading"});J(Go.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var Bv=Rn(e=>dC(/^(?<hashes>#+)\s$/,Go.type(e),t=>{const n=t.groups?.hashes?.length||0,{$from:r}=e.get(ni).state.selection,i=r.node();if(i.type.name==="heading"){let o=Number(i.attrs.level)+Number(n);return o>6&&(o=6),{level:o}}return{level:n}}));J(Bv,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var Oi=Oe("WrapInHeading",e=>t=>(t??=1,t<1?Qa(_r.type(e)):Qa(Go.type(e),{level:t})));J(Oi,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var gg=Oe("DowngradeHeading",e=>()=>(t,n,r)=>{const{$from:i}=t.selection,o=i.node();if(o.type!==Go.type(e)||!t.selection.empty||i.parentOffset!==0)return!1;const s=o.attrs.level-1;return s?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...o.attrs,level:s})),!0):Qa(_r.type(e))(t,n)});J(gg,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var Ag=Wn("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(tt);return()=>t.call(Oi.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(tt);return()=>t.call(gg.key)}}});J(Ag.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});J(Ag.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var yg=pr("blockquote");J(yg,{displayName:"Attr<blockquote>",group:"Blockquote"});var zl=xt("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(yg.key)(t),0],parseMarkdown:{match:({type:t})=>t==="blockquote",runner:(t,n,r)=>{t.openNode(r).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="blockquote",runner:(t,n)=>{t.openNode("blockquote").next(n.content).closeNode()}}}));J(zl.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});J(zl.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var Pv=Rn(e=>Km(/^\s*>\s$/,zl.type(e)));J(Pv,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var bg=Oe("WrapInBlockquote",e=>()=>Hm(zl.type(e)));J(bg,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var wg=Wn("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(tt);return()=>t.call(bg.key)}}});J(wg.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});J(wg.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var xg=pr("codeBlock",()=>({pre:{},code:{}}));J(xg,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var Wl=xt("code_block",e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{language:t.dataset.language}}}],toDOM:t=>{const n=e.get(xg.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return["pre",{...n.pre,...i},["code",n.code,0]]},parseMarkdown:{match:({type:t})=>t==="code",runner:(t,n,r)=>{const i=n.lang??"",o=n.value;t.openNode(r,{language:i}),o&&t.addText(o),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="code_block",runner:(t,n)=>{t.addNode("code",void 0,n.content.firstChild?.text||"",{lang:n.attrs.language})}}}));J(Wl.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});J(Wl.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var Fv=Rn(e=>dC(/^```(?<language>[a-z]*)?[\s\n]$/,Wl.type(e),t=>({language:t.groups?.language??""})));J(Fv,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var kg=Oe("CreateCodeBlock",e=>(t="")=>Qa(Wl.type(e),{language:t}));J(kg,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var uF=Oe("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0?(r?.(n.tr.setNodeAttribute(e,"language",t)),!0):!1);J(uF,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Cg=Wn("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(tt);return()=>t.call(kg.key)}}});J(Cg.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});J(Cg.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var vg=pr("image");J(vg,{displayName:"Attr<image>",group:"Image"});var Ks=xt("image",e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",title:t.getAttribute("title")||t.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(vg.key)(t),...t.attrs}],parseMarkdown:{match:({type:t})=>t==="image",runner:(t,n,r)=>{const i=n.url,o=n.alt??"",s=n.title??"";t.addNode(r,{src:i,alt:o,title:s})}},toMarkdown:{match:t=>t.type.name==="image",runner:(t,n)=>{t.addNode("image",void 0,void 0,{title:n.attrs.title,url:n.attrs.src,alt:n.attrs.alt})}}}));J(Ks.node,{displayName:"NodeSchema<image>",group:"Image"});J(Ks.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var Lv=Oe("InsertImage",e=>(t={})=>(n,r)=>{if(!r)return!0;const{src:i="",alt:o="",title:s=""}=t,a=Ks.type(e).create({src:i,alt:o,title:s});return a&&r(n.tr.replaceSelectionWith(a).scrollIntoView()),!0});J(Lv,{displayName:"Command<insertImageCommand>",group:"Image"});var zv=Oe("UpdateImage",e=>(t={})=>(n,r)=>{const i=DM(n.selection,Ks.type(e));if(!i)return!1;const{node:o,pos:s}=i,a={...o.attrs},{src:l,alt:c,title:u}=t;return l!==void 0&&(a.src=l),c!==void 0&&(a.alt=c),u!==void 0&&(a.title=u),r?.(n.tr.setNodeMarkup(s,void 0,a).scrollIntoView()),!0});J(zv,{displayName:"Command<updateImageCommand>",group:"Image"});var fF=Rn(e=>new yn(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{const[o,s,a="",l]=n;return o?t.tr.replaceWith(r,i,Ks.type(e).create({src:a,alt:s,title:l})):null}));J(fF,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var xu=pr("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));J(xu,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var To=xt("hardbreak",e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?["span",e.get(xu.key)(t)," "]:["br",e.get(xu.key)(t)],parseMarkdown:{match:({type:t})=>t==="break",runner:(t,n,r)=>{t.addNode(r,{isInline:!!n.data?.isInline})}},leafText:()=>`
48
+ `,toMarkdown:{match:t=>t.type.name==="hardbreak",runner:(t,n)=>{n.attrs.isInline?t.addNode("text",void 0,`
49
+ `):t.addNode("break")}}}));J(To.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});J(To.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var Sg=Oe("InsertHardbreak",e=>()=>(t,n)=>{const{selection:r,tr:i}=t;if(!(r instanceof _e))return!1;if(r.empty){const o=r.$from.node();if(o.childCount>0&&o.lastChild?.type.name==="hardbreak")return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node("paragraph")).setSelection(Re.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta("hardbreak",!0).replaceSelectionWith(To.type(e).create()).scrollIntoView()),!0});J(Sg,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var Ig=Wn("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(tt);return()=>t.call(Sg.key)}}});J(Ig.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});J(Ig.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var Eg=pr("hr");J(Eg,{displayName:"Attr<hr>",group:"Hr"});var jl=xt("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(Eg.key)(t)],parseMarkdown:{match:({type:t})=>t==="thematicBreak",runner:(t,n,r)=>{t.addNode(r)}},toMarkdown:{match:t=>t.type.name==="hr",runner:t=>{t.addNode("thematicBreak")}}}));J(jl.node,{displayName:"NodeSchema<hr>",group:"Hr"});J(jl.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var Wv=Rn(e=>new yn(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{const{tr:o}=t;return n[0]&&o.replaceWith(r-1,i,jl.type(e).create()),o}));J(Wv,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var jv=Oe("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;const r=_r.node.type(e).create(),{tr:i,selection:o}=t,{from:s}=o,a=jl.type(e).create();if(!a)return!0;const l=i.replaceSelectionWith(a).insert(s,r),c=Re.findFrom(l.doc.resolve(s),1,!0);return c&&n(l.setSelection(c).scrollIntoView()),!0});J(jv,{displayName:"Command<insertHrCommand>",group:"Hr"});var Tg=pr("bulletList");J(Tg,{displayName:"Attr<bulletList>",group:"BulletList"});var Js=xt("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{spread:t.dataset.spread==="true"}}}],toDOM:t=>["ul",{...e.get(Tg.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!n,runner:(t,n,r)=>{const i=n.spread??!1;t.openNode(r,{spread:i}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="bullet_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!1,spread:n.attrs.spread}).next(n.content).closeNode()}}}));J(Js.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});J(Js.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var Uv=Rn(e=>Km(/^\s*([-+*])\s$/,Js.type(e)));J(Uv,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var Rg=Oe("WrapInBulletList",e=>()=>Hm(Js.type(e)));J(Rg,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var _g=Wn("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(tt);return()=>t.call(Rg.key)}}});J(_g.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});J(_g.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var Ng=pr("orderedList");J(Ng,{displayName:"Attr<orderedList>",group:"OrderedList"});var Vs=xt("ordered_list",e=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{spread:t.dataset.spread==="true",order:t.hasAttribute("start")?Number(t.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Ng.key)(t),...t.attrs.order===1?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!!n,runner:(t,n,r)=>{const i=n.spread??!0;t.openNode(r,{spread:i,order:n.start??1}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="ordered_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!0,start:n.attrs.order??1,spread:n.attrs.spread}),t.next(n.content),t.closeNode()}}}));J(Vs.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});J(Vs.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var Hv=Rn(e=>Km(/^\s*(\d+)\.\s$/,Vs.type(e),t=>({order:Number(t[1])}),(t,n)=>n.childCount+n.attrs.order===Number(t[1])));J(Hv,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var Og=Oe("WrapInOrderedList",e=>()=>Hm(Vs.type(e)));J(Og,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var Dg=Wn("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(tt);return()=>t.call(Og.key)}}});J(Dg.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});J(Dg.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var Mg=pr("listItem");J(Mg,{displayName:"Attr<listItem>",group:"ListItem"});var ui=xt("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:t=>{if(!(t instanceof HTMLElement))throw dr(t);return{label:t.dataset.label,listType:t.dataset.listType,spread:t.dataset.spread==="true"}}}],toDOM:t=>["li",{...e.get(Mg.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t})=>t==="listItem",runner:(t,n,r)=>{const i=n.label!=null?`${n.label}.`:"•",o=n.label!=null?"ordered":"bullet",s=n.spread??!0;t.openNode(r,{label:i,listType:o,spread:s}),t.next(n.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="list_item",runner:(t,n)=>{t.openNode("listItem",void 0,{spread:n.attrs.spread}),t.next(n.content),t.closeNode()}}}));J(ui.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});J(ui.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var Bg=Oe("SinkListItem",e=>()=>qP(ui.type(e)));J(Bg,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var Pg=Oe("LiftListItem",e=>()=>KP(ui.type(e)));J(Pg,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var Fg=Oe("SplitListItem",e=>()=>HP(ui.type(e)));J(Fg,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function hF(e){return(t,n,r)=>{const{selection:i}=t;if(!(i instanceof _e))return!1;const{empty:o,$from:s}=i;return!o||s.parentOffset!==0||s.node(-1).type!==ui.type(e)?!1:aC(t,n,r)}}var Lg=Oe("LiftFirstListItem",e=>()=>hF(e));J(Lg,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var zg=Wn("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(tt);return()=>t.call(Fg.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(tt);return()=>t.call(Bg.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(tt);return()=>t.call(Pg.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{const t=e.get(tt);return()=>t.call(Lg.key)}}});J(zg.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});J(zg.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var Kv=eg("text",()=>({group:"inline",parseMarkdown:{match:({type:e})=>e==="text",runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name==="text",runner:(e,t)=>{e.addNode("text",void 0,t.text)}}}));J(Kv,{displayName:"NodeSchema<text>",group:"Text"});var Wg=pr("html");J(Wg,{displayName:"Attr<html>",group:"Html"});var jg=xt("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{const n=document.createElement("span"),r={...e.get(Wg.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:t=>({value:t.dataset.value??""})}],parseMarkdown:{match:({type:t})=>t==="html",runner:(t,n,r)=>{t.addNode(r,{value:n.value})}},toMarkdown:{match:t=>t.type.name==="html",runner:(t,n)=>{t.addNode("html",void 0,n.attrs.value)}}}));J(jg.node,{displayName:"NodeSchema<html>",group:"Html"});J(jg.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var dF=[Ov,hg,_r,ff,mg,Go,xu,To,yg,zl,xg,Wl,Eg,jl,vg,Ks,Tg,Js,Ng,Vs,Mg,ui,ng,Hs,og,Ll,lg,zi,fg,ks,Wg,jg,Kv].flat(),pF=[Pv,Uv,Hv,Fv,Wv,Bv].flat(),mF=[Iv,Ev,Rv,Tv],gF=Oe("IsMarkSelected",()=>e=>t=>{if(!e)return!1;const{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),AF=Oe("IsNoteSelected",()=>e=>t=>e?MM(t,e).hasNode:!1),yF=Oe("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr;const{$from:r,$to:i}=n.selection,{pos:o}=r,{pos:s}=i,a=o-r.node().content.size;return a<0?!1:(n=n.deleteRange(a,s),t?.(n),!0)}),bF=Oe("SetBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;const o=t.tr,{from:s,to:a}=o.selection;try{o.setBlockType(s,a,r,i)}catch{return!1}return n?.(o),!0}),wF=Oe("WrapInBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let o=t.tr;try{const{$from:s,$to:a}=o.selection,l=s.blockRange(a),c=l&&Lm(l,r,i);if(!c)return!1;o=o.wrap(l,c)}catch{return!1}return n?.(o),!0}),xF=Oe("AddBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;const o=t.tr;try{const s=r instanceof ei?r:r.createAndFill(i);if(!s)return!1;o.replaceSelectionWith(s)}catch{return!1}return n?.(o),!0}),kF=Oe("SelectTextNearPos",()=>e=>(t,n)=>{const{pos:r}=e??{};if(r==null)return!1;const i=(s,a,l)=>Math.min(Math.max(s,a),l),o=t.tr;try{const s=t.doc.resolve(i(r,0,t.doc.content.size));o.setSelection(_e.near(s))}catch{return!1}return n?.(o.scrollIntoView()),!0}),CF=[dg,bg,Oi,gg,kg,Sg,jv,Lv,zv,Og,Rg,Bg,Fg,Pg,Lg,rg,cg,sg,_v,Nv,gF,AF,yF,bF,wF,xF,kF],vF=[wg,Cg,Ig,Ag,zg,Dg,_g,pg,ig,ug,ag].flat(),Ug=bn("remarkAddOrderInList",()=>()=>e=>{qo(e,"list",t=>{if(t.ordered){const n=t.start??1;t.children.forEach((r,i)=>{r.label=i+n})}})});J(Ug.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});J(Ug.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var Hg=bn("remarkLineBreak",()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;qo(e,"text",(n,r,i)=>{if(!n.value||typeof n.value!="string")return;const o=[];let s=0;t.lastIndex=0;let a=t.exec(n.value);for(;a;){const l=a.index;s!==l&&o.push({type:"text",value:n.value.slice(s,l)}),o.push({type:"break",data:{isInline:!0}}),s=l+a[0].length,a=t.exec(n.value)}if(o.length>0&&i&&typeof r=="number")return s<n.value.length&&o.push({type:"text",value:n.value.slice(s)}),i.children.splice(r,1,...o),r+o.length})});J(Hg.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});J(Hg.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var Kg=bn("remarkInlineLink",()=>QP);J(Kg.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});J(Kg.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var SF=e=>!!e.children,IF=e=>e.type==="html";function EF(e,t){return n(e,0,null)[0];function n(r,i,o){if(SF(r)){const s=[];for(let a=0,l=r.children.length;a<l;a++){const c=r.children[a];if(c){const u=n(c,a,r);if(u)for(let f=0,d=u.length;f<d;f++){const h=u[f];h&&s.push(h)}}}r.children=s}return t(r,i,o)}}var Jg=bn("remarkHTMLTransformer",e=>()=>t=>{const n=Mv(e);EF(t,(r,i,o)=>IF(r)?(o&&n.has(o.type)&&(r.children=[YP(r)],delete r.value,r.type="paragraph"),[r]):[r])});J(Jg.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});J(Jg.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var Vg=bn("remarkMarker",()=>()=>(e,t)=>{const n=r=>t.value.charAt(r.position.start.offset);qo(e,r=>["strong","emphasis"].includes(r.type),r=>{r.marker=n(r)})});J(Vg.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});J(Vg.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var Jv=fr(()=>{let e=!1;const t=new zn("MILKDOWN_INLINE_NODES_CURSOR"),n=new An({key:t,state:{init(){return!1},apply(r){if(!r.selection.empty)return!1;const i=r.selection.$from,o=i.nodeBefore,s=i.nodeAfter;return!!(o&&s&&o.isInline&&!o.isText&&s.isInline&&!s.isText)}},props:{handleDOMEvents:{compositionend:(r,i)=>e?(e=!1,requestAnimationFrame(()=>{if(n.getState(r.state)){const o=r.state.selection.from;i.preventDefault(),r.dispatch(r.state.tr.insertText(i.data||"",o))}}),!0):!1,compositionstart:r=>(n.getState(r.state)&&(e=!0),!1),beforeinput:(r,i)=>{if(n.getState(r.state)&&i instanceof InputEvent&&i.data&&!e){const o=r.state.selection.from;return i.preventDefault(),r.dispatch(r.state.tr.insertText(i.data||"",o)),!0}return!1}},decorations(r){if(n.getState(r)){const i=r.selection.$from.pos,o=document.createElement("span"),s=Jt.widget(i,o,{side:-1}),a=document.createElement("span"),l=Jt.widget(i,a);return setTimeout(()=>{o.contentEditable="true",a.contentEditable="true"}),dt.create(r.doc,[s,l])}return dt.empty}}});return n});J(Jv,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var Vv=fr(e=>new An({key:new zn("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,r)=>{if(!t.length)return;const[i]=t;if(!i)return;const[o]=i.steps;if(i.getMeta("hardbreak")){if(!(o instanceof Tt))return;const{from:s}=o;return r.tr.setNodeMarkup(s,To.type(e),void 0,[])}if(o instanceof Yr){let s=r.tr;const{from:a,to:l}=o;return r.doc.nodesBetween(a,l,(c,u)=>{c.type===To.type(e)&&(s=s.setNodeMarkup(u,To.type(e),void 0,[]))}),s}}}));J(Vv,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var qg=Pr(["table","code_block"],"hardbreakFilterNodes");J(qg,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var qv=fr(e=>{const t=e.get(qg.key);return new An({key:new zn("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(n,r)=>{const i=n.getMeta("hardbreak"),[o]=n.steps;if(i&&o){const{from:s}=o,a=r.doc.resolve(s);let l=a.depth,c=!0;for(;l>0;)t.includes(a.node(l).type.name)&&(c=!1),l--;return c}return!0}})});J(qv,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var Gv=fr(e=>{const t=new zn("MILKDOWN_HEADING_ID"),n=r=>{if(r.composing)return;const i=e.get(ff.key),o=r.state.tr.setMeta("addToHistory",!1);let s=!1;const a={};r.state.doc.descendants((l,c)=>{if(l.type===Go.type(e)){if(l.textContent.trim().length===0)return;const u=l.attrs;let f=i(l);a[f]?(a[f]+=1,f+=`-#${a[f]}`):a[f]=1,u.id!==f&&(s=!0,o.setMeta(t,!0).setNodeMarkup(c,void 0,{...u,id:f}))}}),s&&r.dispatch(o)};return new An({key:t,view:r=>(n(r),{update:(i,o)=>{i.state.doc.eq(o.doc)||n(i)}})})});J(Gv,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var Qv=fr(e=>{const t=(n,r,i)=>{if(!i.selection||n.some(f=>f.getMeta("addToHistory")===!1||!f.isGeneric))return null;const o=Vs.type(e),s=Js.type(e),a=ui.type(e),l=(f,d,h=1)=>{let p=!1;const m=`${d+h}.`;return f.label!==m&&(f.label=m,p=!0),p};let c=i.tr,u=!1;return i.doc.descendants((f,d,h,p)=>{if(f.type===s){const m=f.maybeChild(0);m?.type===a&&m.attrs.listType==="ordered"&&(u=!0,c.setNodeMarkup(d,o,{spread:!0}),f.descendants((g,A,x,b)=>{if(g.type===a){const y={...g.attrs};l(y,b)&&(c=c.setNodeMarkup(A,void 0,y))}return!1}))}else if(f.type===a&&h?.type===o){const m={...f.attrs};let g=!1;m.listType!=="ordered"&&(m.listType="ordered",g=!0),h?.maybeChild(0)&&(g=l(m,p,h?.attrs.order??1)),g&&(c=c.setNodeMarkup(d,void 0,m),u=!0)}}),u?c.setMeta("addToHistory",!1):null};return new An({key:new zn("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:t})});J(Qv,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var TF=[Vv,qg,qv,Jv,wu,Ug,Kg,Hg,Jg,Vg,uf,Gv,Qv].flat(),iG=[dF,pF,mF,CF,vF,TF].flat();let Bp,Pp;if(typeof WeakMap<"u"){let e=new WeakMap;Bp=t=>e.get(t),Pp=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Bp=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},Pp=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var $e=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[t+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[t+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let s=t+e*this.width;const a=(e+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(e){return Bp(e)||Pp(e,RF(e))}};function RF(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=_F(e),n=e.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,u=t*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=e.child(c);u++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;const m=f.child(p),{colspan:g,rowspan:A,colwidth:x}=m.attrs;for(let b=0;b<A;b++){if(b+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:A-b});break}const y=i+b*t;for(let C=0;C<g;C++){r[y+C]==0?r[y+C]=u:(o||(o=[])).push({type:"collision",row:c,pos:u,n:g-C});const w=x&&x[C];if(w){const v=(y+C)%t*2,D=s[v];D==null||D!=w&&s[v+1]==1?(s[v]=w,s[v+1]=1):D==w&&s[v+1]++}}}i+=g,u+=m.nodeSize}const d=(c+1)*t;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),u++}(t===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const a=new $e(t,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&NF(a,s,e),a}function _F(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let s=0;s<r;s++){const a=e.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function NF(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=OF(l)))[c]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function OF(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function pw(e,t){if(typeof e=="string")return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(s=>Number(s)):null,i=Number(e.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(const s in t){const a=t[s].getFromDOM,l=a&&a(e);l!=null&&(o[s]=l)}return o}function mw(e,t){const n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function DF(e){if(e!==null){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(const t of e)if(typeof t!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function MF(e){const t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:DF}};for(const r in t)n[r]={default:t[r].default,validate:t[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>pw(r,t)}],toDOM(r){return["td",mw(r,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>pw(r,t)}],toDOM(r){return["th",mw(r,t),0]}}}}function Qn(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}const Bi=new zn("selectingCells");function Ls(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Yn(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function hf(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=Ls(t.$head)||BF(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function BF(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Fp(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function PF(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Gg(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Yv(e,t,n){const r=e.node(-1),i=$e.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return s==null?null:e.node(0).resolve(o+s)}function Ho(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function FF(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(t,0,0)}return r}function LF(e,t,n){const r=Qn(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var ht=class Hr extends Re{constructor(t,n=t){const r=t.node(-1),i=$e.get(r),o=t.start(-1),s=i.rectBetween(t.pos-o,n.pos-o),a=t.node(0),l=i.cellsInRect(s).filter(u=>u!=n.pos-o);l.unshift(n.pos-o);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw new RangeError(`No cell with offset ${u} found`);const d=o+u+1;return new rC(a.resolve(d),a.resolve(d+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Fp(r)&&Fp(i)&&Gg(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Hr.rowSelection(r,i):o&&this.isColSelection()?Hr.colSelection(r,i):new Hr(r,i)}return _e.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=$e.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*n.width+i.left,f=i.left;f<i.right;f++,u++){const d=n.map[u];if(o[d])continue;o[d]=!0;const h=n.findCell(d);let p=t.nodeAt(d);if(!p)throw new RangeError(`No cell with offset ${d} found`);const m=i.left-h.left,g=h.right-i.right;if(m>0||g>0){let A=p.attrs;if(m>0&&(A=Ho(A,0,m)),g>0&&(A=Ho(A,A.colspan-g,g)),h.left<i.left){if(p=p.type.createAndFill(A),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(A)}`)}else p=p.type.create(A,p.content)}if(h.top<i.top||h.bottom>i.bottom){const A={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(A):p=p.type.create(A,p.content)}c.push(p)}s.push(t.child(l).copy(oe.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?t:s;return new ce(oe.from(a),1,1)}replace(t,n=ce.empty){const r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=t.mapping.slice(r);t.replace(c.map(a.pos),c.map(l.pos),s?ce.empty:n)}const o=Re.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new ce(oe.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=$e.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)t(n.nodeAt(o[s]),i+o[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=$e.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.top<=a.top?(s.top>0&&(t=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(t=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Hr(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=$e.get(t),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(t){return t instanceof Hr&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=$e.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.left<=a.left?(s.left>0&&(t=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(t=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new Hr(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Hr(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new Hr(t.resolve(n),t.resolve(r))}getBookmark(){return new zF(this.$anchorCell.pos,this.$headCell.pos)}};ht.prototype.visible=!1;Re.jsonID("cell",ht);var zF=class $v{constructor(t,n){this.anchor=t,this.head=n}map(t){return new $v(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Gg(n,r)?new ht(n,r):Re.near(r,1)}};function WF(e){if(!(e.selection instanceof ht))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(Jt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),dt.create(e.doc,t)}function jF({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function UF({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function HF(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,s;if(r instanceof Te&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=ht.create(i,r.from);else if(s=="row"){const a=i.resolve(r.from+1);o=ht.rowSelection(a,a)}else if(!n){const a=$e.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=ht.create(i,l+1,c)}}else r instanceof _e&&jF(r)?o=_e.create(i,r.from):r instanceof _e&&UF(r)&&(o=_e.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}const KF=new zn("fix-tables");function Zv(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let s=0,a=0;s<o;s++){const l=t.child(s);for(let c=a,u=Math.min(i,s+3);c<u;c++)if(e.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&e.child(a).sameMarkup(l)?Zv(e.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function JF(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=VF(e,i,o,n))};return t?t.doc!=e.doc&&Zv(t.doc,e.doc,0,r):e.doc.descendants(r),n}function VF(e,t,n,r){const i=$e.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let d=0;d<f.rowspan;d++)o[c.row+d]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ho(f,f.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+t.nodeSize)}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<i.height;l++){const u=t.child(l),f=c+u.nodeSize,d=o[l];if(d>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<d;g++){const A=Qn(e.schema)[h].createAndFill();A&&p.push(A)}const m=(l==0||s==l-1)&&a==l?c+1:f-1;r.insert(r.mapping.map(m),p)}c=f}return r.setMeta(KF,{fixTables:!0})}function Xv(e){const t=$e.get(e),n=[],r=t.height,i=t.width;for(let o=0;o<r;o++){const s=[];for(let a=0;a<i;a++){const l=o*i+a,c=t.map[l];if(o>0){const u=l-i;if(c===t.map[u]){s.push(null);continue}}if(a>0){const u=l-1;if(c===t.map[u]){s.push(null);continue}}s.push(e.nodeAt(c))}n.push(s)}return n}function eS(e,t){const n=[],r=$e.get(e),i=r.height,o=r.width;for(let s=0;s<i;s++){const a=e.child(s),l=[];for(let u=0;u<o;u++){const f=t[s][u];if(!f)continue;const d=r.map[s*r.width+u],h=e.nodeAt(d);if(!h)continue;const p=h.type.createChecked(f.attrs,f.content,f.marks);l.push(p)}const c=a.type.createChecked(a.attrs,l,a.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function tS(e,t,n,r){const i=t[0]>n[0]?-1:1,o=e.splice(t[0],t.length),s=o.length%2===0?1:0;let a;return a=i===-1?n[0]:n[n.length-1]-s,e.splice(a,0,...o),e}function Ul(e){return qF(t=>t.type.spec.tableRole==="table",e)}function qF(e,t){for(let n=t.depth;n>=0;n-=1){const r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function ds(e,t){const n=Ul(t.$from);if(!n)return;const r=$e.get(n.node);if(!(e<0||e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(i=>{const o=n.node.nodeAt(i),s=i+n.start;return{pos:s,start:s+1,node:o,depth:n.depth+2}})}function ps(e,t){const n=Ul(t.$from);if(!n)return;const r=$e.get(n.node);if(!(e<0||e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(i=>{const o=n.node.nodeAt(i),s=i+n.start;return{pos:s,start:s+1,node:o,depth:n.depth+2}})}function gw(e,t,n=t){let r=t,i=n;for(let u=t;u>=0;u--){const f=ds(u,e.selection);f&&f.forEach(d=>{const h=d.node.attrs.colspan+u-1;h>=r&&(r=u),h>i&&(i=h)})}for(let u=t;u<=i;u++){const f=ds(u,e.selection);f&&f.forEach(d=>{const h=d.node.attrs.colspan+u-1;d.node.attrs.colspan>1&&h>i&&(i=h)})}const o=[];for(let u=r;u<=i;u++){const f=ds(u,e.selection);f&&f.length>0&&o.push(u)}r=o[0],i=o[o.length-1];const s=ds(r,e.selection),a=ps(0,e.selection);if(!s||!a)return;const l=e.doc.resolve(s[s.length-1].pos);let c;for(let u=i;u>=r;u--){const f=ds(u,e.selection);if(f&&f.length>0){for(let d=a.length-1;d>=0;d--)if(a[d].pos===f[0].pos){c=f[0];break}if(c)break}}if(c)return{$anchor:l,$head:e.doc.resolve(c.pos),indexes:o}}function Aw(e,t,n=t){let r=t,i=n;for(let u=t;u>=0;u--){const f=ps(u,e.selection);f&&f.forEach(d=>{const h=d.node.attrs.rowspan+u-1;h>=r&&(r=u),h>i&&(i=h)})}for(let u=t;u<=i;u++){const f=ps(u,e.selection);f&&f.forEach(d=>{const h=d.node.attrs.rowspan+u-1;d.node.attrs.rowspan>1&&h>i&&(i=h)})}const o=[];for(let u=r;u<=i;u++){const f=ps(u,e.selection);f&&f.length>0&&o.push(u)}r=o[0],i=o[o.length-1];const s=ps(r,e.selection),a=ds(0,e.selection);if(!s||!a)return;const l=e.doc.resolve(s[s.length-1].pos);let c;for(let u=i;u>=r;u--){const f=ps(u,e.selection);if(f&&f.length>0){for(let d=a.length-1;d>=0;d--)if(a[d].pos===f[0].pos){c=f[0];break}if(c)break}}if(c)return{$anchor:l,$head:e.doc.resolve(c.pos),indexes:o}}function yw(e){return e[0].map((t,n)=>e.map(r=>r[n]))}function GF(e){var t,n;const{tr:r,originIndex:i,targetIndex:o,select:s,pos:a}=e,l=Ul(r.doc.resolve(a));if(!l)return!1;const c=(t=gw(r,i))===null||t===void 0?void 0:t.indexes,u=(n=gw(r,o))===null||n===void 0?void 0:n.indexes;if(!c||!u||c.includes(o))return!1;const f=QF(l.node,c,u);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!s)return!0;const d=$e.get(f),h=l.start,p=o,m=d.positionAt(d.height-1,p,f),g=r.doc.resolve(h+m),A=d.positionAt(0,p,f),x=r.doc.resolve(h+A);return r.setSelection(ht.colSelection(g,x)),!0}function QF(e,t,n,r){let i=yw(Xv(e));return i=tS(i,t,n),i=yw(i),eS(e,i)}function YF(e){var t,n;const{tr:r,originIndex:i,targetIndex:o,select:s,pos:a}=e,l=Ul(r.doc.resolve(a));if(!l)return!1;const c=(t=Aw(r,i))===null||t===void 0?void 0:t.indexes,u=(n=Aw(r,o))===null||n===void 0?void 0:n.indexes;if(!c||!u||c.includes(o))return!1;const f=$F(l.node,c,u);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!s)return!0;const d=$e.get(f),h=l.start,p=o,m=d.positionAt(p,d.width-1,f),g=r.doc.resolve(h+m),A=d.positionAt(p,0,f),x=r.doc.resolve(h+A);return r.setSelection(ht.rowSelection(g,x)),!0}function $F(e,t,n,r){let i=Xv(e);return i=tS(i,t,n),eS(e,i)}function Xi(e){const t=e.selection,n=hf(e),r=n.node(-1),i=n.start(-1),o=$e.get(r);return{...t instanceof ht?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function nS(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;LF(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let s=0;s<t.height;s++){const a=s*t.width+i;if(i>0&&i<t.width&&t.map[a-1]==t.map[a]){const l=t.map[a],c=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,FF(c.attrs,i-t.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?Qn(r.type.schema).cell:r.nodeAt(t.map[a+o]).type,c=t.positionAt(s,i,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function ZF(e,t){if(!Yn(e))return!1;if(t){const n=Xi(e);t(nS(e.tr,n,n.left))}return!0}function XF(e,t){if(!Yn(e))return!1;if(t){const n=Xi(e);t(nS(e.tr,n,n.right))}return!0}function eL(e,{map:t,table:n,tableStart:r},i){const o=e.mapping.maps.length;for(let s=0;s<t.height;){const a=s*t.width+i,l=t.map[a],c=n.nodeAt(l),u=c.attrs;if(i>0&&t.map[a-1]==l||i<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,Ho(u,i-t.colCount(l)));else{const f=e.mapping.slice(o).map(r+l);e.delete(f,f+c.nodeSize)}s+=u.rowspan}}function tL(e,t){if(!Yn(e))return!1;if(t){const n=Xi(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;eL(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw new RangeError("No table found");n.table=o,n.map=$e.get(o)}t(r)}return!0}function nL(e,{map:t,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;const s=o+n.child(i).nodeSize,a=e.mapping.maps.length;e.delete(o+r,s+r);const l=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const f=t.map[u];if(!l.has(f)){if(l.add(f),i>0&&f==t.map[u-t.width]){const d=n.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(a).map(f+r),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i<t.height&&f==t.map[u+t.width]){const d=n.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),m=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(a).map(r+m),p),c+=h.colspan-1}}}}function rL(e,t){if(!Yn(e))return!1;if(t){const n=Xi(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;nL(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw new RangeError("No table found");n.table=o,n.map=$e.get(n.table)}t(r)}return!0}function iL(e,t){return function(n,r){if(!Yn(n))return!1;const i=hf(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof ht?n.selection.forEachCell((s,a)=>{s.attrs[e]!==t&&o.setNodeMarkup(a,null,{...s.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function oL(e){return function(t,n){if(!Yn(t))return!1;if(n){const r=Qn(t.schema),i=Xi(t),o=t.tr,s=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length===0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o)}return!0}}function bw(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const o=t.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Qg(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?oL(e):function(n,r){if(!Yn(n))return!1;if(r){const i=Qn(n.schema),o=Xi(n),s=n.tr,a=bw("row",o,i),l=bw("column",o,i),c=(e==="column"?a:e==="row"&&l)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:o.map.height}:e=="row"?{left:c,top:0,right:o.map.width,bottom:1}:o,f=e=="column"?l?i.cell:i.header_cell:e=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(u).forEach(d=>{const h=d+o.tableStart,p=s.doc.nodeAt(h);p&&s.setNodeMarkup(h,f,p.attrs)}),r(s)}return!0}}Qg("row",{useDeprecatedLogic:!0});Qg("column",{useDeprecatedLogic:!0});Qg("cell",{useDeprecatedLogic:!0});function sL(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function rS(e){return function(t,n){if(!Yn(t))return!1;const r=sL(hf(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(_e.between(i,PF(i))).scrollIntoView())}return!0}}function aL(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function yc(e,t){const n=e.selection;if(!(n instanceof ht))return!1;if(t){const r=e.tr,i=Qn(e.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new ce(i,0,0))}),r.docChanged&&t(r)}return!0}function lL(e){return(t,n)=>{const{from:r,to:i,select:o=!0,pos:s=t.selection.from}=e,a=t.tr;return YF({tr:a,originIndex:r,targetIndex:i,select:o,pos:s})?(n?.(a),!0):!1}}function cL(e){return(t,n)=>{const{from:r,to:i,select:o=!0,pos:s=t.selection.from}=e,a=t.tr;return GF({tr:a,originIndex:r,targetIndex:i,select:o,pos:s})?(n?.(a),!0):!1}}function uL(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const u=l?0:Math.max(0,n-1),f=l<t.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=Lp(Qn(s).row,new ce(c,u,f)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?Lp(Qn(s).row,new ce(t,n,r)).content:t);else return null;return fL(s,a)}function fL(e,t){const n=[];for(let i=0;i<t.length;i++){const o=t[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(oe.empty),n[i]<r){const o=Qn(e).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);t[i]=t[i].append(oe.from(s))}return{height:t.length,width:r,rows:t}}function Lp(e,t){const n=e.createAndFill();return new nC(n).replace(0,n.content.size,t).doc}function hL({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=o[a]||0,f=0;u<r;f++){let d=l.child(f%l.childCount);u+d.attrs.colspan>r&&(d=d.type.createChecked(Ho(d.attrs,d.attrs.colspan,u+d.attrs.colspan-r),d.content)),c.push(d),u+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)o[a+h]=(o[a+h]||0)+d.attrs.colspan}s.push(oe.from(c))}n=s,e=r}if(t!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=n[a%t];for(let u=0;u<c.childCount;u++){let f=c.child(u);s+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(oe.from(l))}n=o,t=i}return{width:e,height:t,rows:n}}function dL(e,t,n,r,i,o,s){const a=e.doc.type.schema,l=Qn(a);let c,u;if(i>t.width)for(let f=0,d=0;f<t.height;f++){const h=n.child(f);d+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=u||(u=l.header_cell.createAndFill());for(let g=t.width;g<i;g++)p.push(m);e.insert(e.mapping.slice(s).map(d-1+r),p)}if(o>t.height){const f=[];for(let p=0,m=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const g=p>=t.width?!1:n.nodeAt(t.map[m+p]).type==l.header_cell;f.push(g?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const d=l.row.create(null,oe.from(f)),h=[];for(let p=t.height;p<o;p++)h.push(d);e.insert(e.mapping.slice(s).map(r+n.nodeSize-2),h)}return!!(c||u)}function ww(e,t,n,r,i,o,s,a){if(s==0||s==t.height)return!1;let l=!1;for(let c=i;c<o;c++){const u=s*t.width+c,f=t.map[u];if(t.map[u-t.width]==f){l=!0;const d=n.nodeAt(f),{top:h,left:p}=t.findCell(f);e.setNodeMarkup(e.mapping.slice(a).map(f+r),null,{...d.attrs,rowspan:s-h}),e.insert(e.mapping.slice(a).map(t.positionAt(s,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-s})),c+=d.attrs.colspan-1}}return l}function xw(e,t,n,r,i,o,s,a){if(s==0||s==t.width)return!1;let l=!1;for(let c=i;c<o;c++){const u=c*t.width+s,f=t.map[u];if(t.map[u-1]==f){l=!0;const d=n.nodeAt(f),h=t.colCount(f),p=e.mapping.slice(a).map(f+r);e.setNodeMarkup(p,null,Ho(d.attrs,s-h,d.attrs.colspan-(s-h))),e.insert(p+d.nodeSize,d.type.createAndFill(Ho(d.attrs,0,s-h))),c+=d.attrs.rowspan-1}}return l}function kw(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let s=$e.get(o);const{top:a,left:l}=r,c=l+i.width,u=a+i.height,f=e.tr;let d=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");s=$e.get(o),d=f.mapping.maps.length}dL(f,s,o,n,c,u,d)&&h(),ww(f,s,o,n,l,c,a,d)&&h(),ww(f,s,o,n,l,c,u,d)&&h(),xw(f,s,o,n,a,u,l,d)&&h(),xw(f,s,o,n,a,u,c,d)&&h();for(let p=a;p<u;p++){const m=s.positionAt(p,l,o),g=s.positionAt(p,c,o);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new ce(i.rows[p-a],0,0))}h(),f.setSelection(new ht(f.doc.resolve(n+s.positionAt(a,l,o)),f.doc.resolve(n+s.positionAt(u-1,c-1,o)))),t(f)}const pL=vC({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1),"Shift-ArrowLeft":wc("horiz",-1),"Shift-ArrowRight":wc("horiz",1),"Shift-ArrowUp":wc("vert",-1),"Shift-ArrowDown":wc("vert",1),Backspace:yc,"Mod-Backspace":yc,Delete:yc,"Mod-Delete":yc});function Yc(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function bc(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof ht)return Yc(n,r,Re.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const s=iS(i,e,t);if(s==null)return!1;if(e=="horiz")return Yc(n,r,Re.near(n.doc.resolve(o.head+t),t));{const a=n.doc.resolve(s),l=Yv(a,e,t);let c;return l?c=Re.near(l,1):t<0?c=Re.near(n.doc.resolve(a.before(-1)),-1):c=Re.near(n.doc.resolve(a.after(-1)),1),Yc(n,r,c)}}}function wc(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof ht)s=o;else{const l=iS(i,e,t);if(l==null)return!1;s=new ht(n.doc.resolve(l))}const a=Yv(s.$headCell,e,t);return a?Yc(n,r,new ht(s.$anchorCell,a)):!1}}function mL(e,t){const n=e.state.doc,r=Ls(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new ht(r))),!0):!1}function gL(e,t,n){if(!Yn(e.state))return!1;let r=uL(n);const i=e.state.selection;if(i instanceof ht){r||(r={width:1,height:1,rows:[oe.from(Lp(Qn(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=$e.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=hL(r,a.right-a.left,a.bottom-a.top),kw(e.state,e.dispatch,s,a,r),!0}else if(r){const o=hf(e.state),s=o.start(-1);return kw(e.state,e.dispatch,s,$e.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function AL(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const r=Cw(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof ht)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=Ls(e.state.selection.$anchor))!=null&&((n=Bh(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(l,c){let u=Bh(e,c);const f=Bi.getState(e.state)==null;if(!u||!Gg(l,u))if(f)u=l;else return;const d=new ht(l,u);if(f||!e.state.selection.eq(d)){const h=e.state.tr.setSelection(d);f&&h.setMeta(Bi,l.pos),e.dispatch(h)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),Bi.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Bi,-1))}function a(l){const c=l,u=Bi.getState(e.state);let f;if(u!=null)f=e.state.doc.resolve(u);else if(Cw(e,c.target)!=r&&(f=Bh(e,t),!f))return s();f&&o(f,c)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function iS(e,t,n){if(!(e.state.selection instanceof _e))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const s=r.before(i),a=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?s:null}}return null}function Cw(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Bh(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Ls(e.state.doc.resolve(r))||Ls(e.state.doc.resolve(i))}var yL=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),zp(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,zp(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function zp(e,t,n,r,i,o){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let f=0,d=0;f<c.childCount;f++){const{colspan:h,colwidth:p}=c.child(f).attrs;for(let m=0;m<h;m++,d++){const g=i==d?o:p&&p[m],A=g?g+"px":"";if(s+=g||r,g||(a=!1),l)l.style.width!=A&&(l.style.width=A),l=l.nextSibling;else{const x=document.createElement("col");x.style.width=A,t.appendChild(x)}}}for(;l;){var u;const f=l.nextSibling;(u=l.parentNode)===null||u===void 0||u.removeChild(l),l=f}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const Bn=new zn("tableColumnResizing");function bL({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=yL,lastColumnResizable:i=!0}={}){const o=new An({key:Bn,state:{init(s,a){var l;const c=(l=o.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,u=Qn(a.schema).table.name;return r&&c&&(c[u]=(f,d)=>new r(f,n,d)),new wL(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=Bn.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{xL(s,a,e,i)},mouseleave:s=>{kL(s)},mousedown:(s,a)=>{CL(s,a,t,n)}},decorations:s=>{const a=Bn.getState(s);if(a&&a.activeHandle>-1)return TL(s,a.activeHandle)},nodeViews:{}}});return o}var wL=class $c{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(Bn);if(r&&r.setHandle!=null)return new $c(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new $c(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return Fp(t.doc.resolve(i))||(i=-1),new $c(i,n.dragging)}return n}};function xL(e,t,n,r){if(!e.editable)return;const i=Bn.getState(e.state);if(i&&!i.dragging){const o=SL(t.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();t.clientX-a<=n?s=vw(e,t,"left",n):l-t.clientX<=n&&(s=vw(e,t,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const a=e.state.doc.resolve(s),l=a.node(-1),c=$e.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}oS(e,s)}}}function kL(e){if(!e.editable)return;const t=Bn.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&oS(e,-1)}function CL(e,t,n,r){var i;if(!e.editable)return!1;const o=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,s=Bn.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=e.state.doc.nodeAt(s.activeHandle),l=vL(e,s.activeHandle,a.attrs);e.dispatch(e.state.tr.setMeta(Bn,{setDragging:{startX:t.clientX,startWidth:l}}));function c(f){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);const d=Bn.getState(e.state);d?.dragging&&(IL(e,d.activeHandle,Sw(d.dragging,f,n)),e.dispatch(e.state.tr.setMeta(Bn,{setDragging:null})))}function u(f){if(!f.which)return c(f);const d=Bn.getState(e.state);if(d&&d.dragging){const h=Sw(d.dragging,f,n);Iw(e,d.activeHandle,h,r)}}return Iw(e,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),t.preventDefault(),!0}function vL(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let s=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],a--);return s/a}function SL(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function vw(e,t,n,r){const i=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!o)return-1;const{pos:s}=o,a=Ls(e.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=$e.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function Sw(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function oS(e,t){e.dispatch(e.state.tr.setMeta(Bn,{setHandle:t}))}function IL(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=$e.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<o.height;c++){const u=c*o.width+a;if(c&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],d=i.nodeAt(f).attrs,h=d.colspan==1?0:a-o.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;const p=d.colwidth?d.colwidth.slice():EL(d.colspan);p[h]=n,l.setNodeMarkup(s+f,null,{...d,colwidth:p})}l.docChanged&&e.dispatch(l)}function Iw(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),s=i.start(-1),a=$e.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=e.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&zp(o,l.firstChild,l,r,a,n)}function EL(e){return Array(e).fill(0)}function TL(e,t){const n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return dt.empty;const o=$e.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<o.height;c++){const u=a+c*o.width;if((a==o.width-1||o.map[u]!=o.map[u+1])&&(c==0||o.map[u]!=o.map[u-o.width])){var l;const f=o.map[u],d=s+f+i.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((l=Bn.getState(e))===null||l===void 0)&&l.dragging&&n.push(Jt.node(s+f,s+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),n.push(Jt.widget(d,h))}}return dt.create(e.doc,n)}function RL({allowTableNodeSelection:e=!1}={}){return new An({key:Bi,state:{init(){return null},apply(t,n){const r=t.getMeta(Bi);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:i,pos:o}=t.mapping.mapResult(n);return i?null:o}},props:{decorations:WF,handleDOMEvents:{mousedown:AL},createSelectionBetween(t){return Bi.getState(t.state)!=null?t.state.selection:null},handleTripleClick:mL,handleKeyDown:pL,handlePaste:gL},appendTransaction(t,n,r){return HF(r,JF(r,n),e)}})}var ku=typeof navigator<"u"?navigator:null,Yg=ku&&ku.userAgent||"",_L=/Edge\/(\d+)/.exec(Yg),NL=/MSIE \d/.exec(Yg),OL=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yg),DL=!!(NL||OL||_L),ML=!DL&&!!ku&&/Apple Computer/.test(ku.vendor),sS=new zn("safari-ime-span"),Wp=!1,BL={key:sS,props:{decorations:PL,handleDOMEvents:{compositionstart:()=>{Wp=!0},compositionend:()=>{Wp=!1}}}};function PL(e){const{$from:t,$to:n,to:r}=e.selection;if(Wp&&t.sameParent(n)){const i=Jt.widget(r,FL,{ignoreSelection:!0,key:"safari-ime-span"});return dt.create(e.doc,[i])}}function FL(e){const t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var LL=new An(ML?BL:{key:sS});function Ew(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function zL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WL(e,t,n){const i=$u((n||{}).ignore||[]),o=jL(t);let s=-1;for(;++s<o.length;)Rm(e,"text",a);function a(c,u){let f=-1,d;for(;++f<u.length;){const h=u[f],p=d?d.children:void 0;if(i(h,p?p.indexOf(h):void 0,d))return;d=h}if(d)return l(c,u)}function l(c,u){const f=u[u.length-1],d=o[s][0],h=o[s][1];let p=0;const g=f.children.indexOf(c);let A=!1,x=[];d.lastIndex=0;let b=d.exec(c.value);for(;b;){const C=b.index,w={index:b.index,input:b.input,stack:[...u,c]};let v=h(...b,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1)d.lastIndex=C+1;else{if(p!==C&&y({type:"text",value:c.value.slice(p,C)}),Array.isArray(v))for(const D of v)y(D);else v&&y(v);p=C+b[0].length,A=!0}if(!d.global)break;b=d.exec(c.value)}return A?(p<c.value.length&&y({type:"text",value:c.value.slice(p)}),f.children.splice(g,1,...x)):x=[c],g+x.length;function y(C){const w=x[x.length-1];w&&w.type==="text"&&C.type==="text"?w.value+=C.value:x.push(C)}}}function jL(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([UL(i[0]),HL(i[1])])}return t}function UL(e){return typeof e=="string"?new RegExp(zL(e),"g"):e}function HL(e){return typeof e=="function"?e:function(){return e}}const Ph="phrasing",Fh=["autolink","link","image","label"];function KL(){return{transforms:[$L],enter:{literalAutolink:VL,literalAutolinkEmail:Lh,literalAutolinkHttp:Lh,literalAutolinkWww:Lh},exit:{literalAutolink:YL,literalAutolinkEmail:QL,literalAutolinkHttp:qL,literalAutolinkWww:GL}}}function JL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ph,notInConstruct:Fh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ph,notInConstruct:Fh},{character:":",before:"[ps]",after:"\\/",inConstruct:Ph,notInConstruct:Fh}]}}function VL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lh(e){this.config.enter.autolinkProtocol.call(this,e)}function qL(e){this.config.exit.autolinkProtocol.call(this,e)}function GL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function QL(e){this.config.exit.autolinkEmail.call(this,e)}function YL(e){this.exit(e)}function $L(e){WL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ZL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),XL]],{ignore:["link","linkReference"]})}function ZL(e,t,n,r,i){let o="";if(!aS(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!e2(n)))return!1;const s=t2(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function XL(e,t,n,r){return!aS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function e2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function t2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ew(e,"(");let o=Ew(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function aS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fo(n)||Yu(n))&&(!t||n!==47)}lS.peek=u2;function n2(){this.buffer()}function r2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i2(){this.buffer()}function o2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function s2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function a2(e){this.exit(e)}function l2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function c2(e){this.exit(e)}function u2(){return"["}function lS(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function f2(){return{enter:{gfmFootnoteCallString:n2,gfmFootnoteCall:r2,gfmFootnoteDefinitionLabelString:i2,gfmFootnoteDefinition:o2},exit:{gfmFootnoteCallString:s2,gfmFootnoteCall:a2,gfmFootnoteDefinitionLabelString:l2,gfmFootnoteDefinition:c2}}}function h2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
50
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?cS:d2))),c(),l}}function d2(e,t,n){return t===0?e:cS(e,t,n)}function cS(e,t,n){return(n?"":" ")+e}const p2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$g.attention=b2;$g.peek=w2;function m2(){return{canContainEols:["delete"],enter:{strikethrough:A2},exit:{strikethrough:y2}}}function g2(){return{handlers:{delete:$g},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p2}]}}function A2(e){this.enter({type:"delete",children:[],position:void 0},e)}function y2(e){this.exit(e)}function $g(e,t,n,r){const i=n.createTracker(r),o=n.stack.includes("strikethrough")?"~":"~~",s=n.enter("strikethrough");let a=i.move(o);return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move(o),s(),a}function b2(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function w2(){return"~"}function x2(e){return e.length}function k2(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||x2,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],g=[];let A=-1;for(e[u].length>c&&(c=e[u].length);++A<e[u].length;){const x=C2(e[u][A]);if(n.alignDelimiters!==!1){const b=i(x);g[A]=b,(l[A]===void 0||b>l[A])&&(l[A]=b)}m.push(x)}s[u]=m,a[u]=g}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)o[f]=Tw(r[f]);else{const m=Tw(r);for(;++f<c;)o[f]=m}f=-1;const d=[],h=[];for(;++f<c;){const m=o[f];let g="",A="";m===99?(g=":",A=":"):m===108?g=":":m===114&&(A=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[f]-g.length-A.length);const b=g+"-".repeat(x)+A;n.alignDelimiters!==!1&&(x=g.length+x+A.length,x>l[f]&&(l[f]=x),h[f]=x),d[f]=b}s.splice(1,0,d),a.splice(1,0,h),u=-1;const p=[];for(;++u<s.length;){const m=s[u],g=a[u];f=-1;const A=[];for(;++f<c;){const x=m[f]||"";let b="",y="";if(n.alignDelimiters!==!1){const C=l[f]-(g[f]||0),w=o[f];w===114?b=" ".repeat(C):w===99?C%2?(b=" ".repeat(C/2+.5),y=" ".repeat(C/2-.5)):(b=" ".repeat(C/2),y=b):y=" ".repeat(C)}n.delimiterStart!==!1&&!f&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||f)&&A.push(" "),n.alignDelimiters!==!1&&A.push(b),A.push(x),n.alignDelimiters!==!1&&A.push(y),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&A.push("|")}p.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return p.join(`
51
+ `)}function C2(e){return e==null?"":String(e)}function Tw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function v2(){return{enter:{table:S2,tableData:Rw,tableHeader:Rw,tableRow:E2},exit:{codeText:T2,table:I2,tableData:zh,tableHeader:zh,tableRow:zh}}}function S2(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function I2(e){this.exit(e),this.data.inTable=void 0}function E2(e){this.enter({type:"tableRow",children:[]},e)}function zh(e){this.exit(e)}function Rw(e){this.enter({type:"tableCell",children:[]},e)}function T2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,R2));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function R2(e,t){return t==="|"?t:e}function _2(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
52
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:l,tableRow:a}};function s(h,p,m,g){return c(u(h,m,g),h.align)}function a(h,p,m,g){const A=f(h,m,g),x=c([A]);return x.slice(0,x.indexOf(`
53
+ `))}function l(h,p,m,g){const A=m.enter("tableCell"),x=m.enter("phrasing"),b=m.containerPhrasing(h,{...g,before:o,after:o});return x(),A(),b}function c(h,p){return k2(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(h,p,m){const g=h.children;let A=-1;const x=[],b=p.enter("table");for(;++A<g.length;)x[A]=f(g[A],p,m);return b(),x}function f(h,p,m){const g=h.children;let A=-1;const x=[],b=p.enter("tableRow");for(;++A<g.length;)x[A]=l(g[A],h,p,m);return b(),x}function d(h,p,m){let g=Om.inlineCode(h,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function N2(){return{exit:{taskListCheckValueChecked:_w,taskListCheckValueUnchecked:_w,paragraph:D2}}}function O2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:M2}}}function _w(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function D2(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function M2(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Om.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function B2(){return[KL(),f2(),m2(),v2(),N2()]}function P2(e){return{extensions:[JL(),h2(e),g2(),_2(e),O2()]}}const F2={tokenize:H2,partial:!0},uS={tokenize:K2,partial:!0},fS={tokenize:J2,partial:!0},hS={tokenize:V2,partial:!0},L2={tokenize:q2,partial:!0},dS={name:"wwwAutolink",tokenize:j2,previous:mS},pS={name:"protocolAutolink",tokenize:U2,previous:gS},fi={name:"emailAutolink",tokenize:W2,previous:AS},Fr={};function z2(){return{text:Fr}}let ao=48;for(;ao<123;)Fr[ao]=fi,ao++,ao===58?ao=65:ao===91&&(ao=97);Fr[43]=fi;Fr[45]=fi;Fr[46]=fi;Fr[95]=fi;Fr[72]=[fi,pS];Fr[104]=[fi,pS];Fr[87]=[fi,dS];Fr[119]=[fi,dS];function W2(e,t,n){const r=this;let i,o;return s;function s(f){return!jp(f)||!AS.call(r,r.previous)||Zg(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return jp(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(L2,u,c)(f):f===45||f===95||fn(f)?(o=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return o&&i&&Ht(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function j2(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!mS.call(r,r.previous)||Zg(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(F2,e.attempt(uS,e.attempt(fS,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function U2(e,t,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&gS.call(r,r.previous)&&!Zg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(Ht(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),o?c:(o=!0,l)):n(f)}function c(f){return f===null||ou(f)||ot(f)||Fo(f)||Yu(f)?n(f):e.attempt(uS,e.attempt(fS,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function H2(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function K2(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(hS,l,a)(c):c===null||ot(c)||Fo(c)||c!==45&&Yu(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function J2(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(hS,t,o)(s):s===null||ot(s)||Fo(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function V2(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||ot(a)||Fo(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||ot(a)||Fo(a)?t(a):r(a)}function o(a){return Ht(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):Ht(a)?(e.consume(a),s):n(a)}}function q2(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return fn(o)?n(o):t(o)}}function mS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ot(e)}function gS(e){return!Ht(e)}function AS(e){return!(e===47||jp(e))}function jp(e){return e===43||e===45||e===46||e===95||fn(e)}function Zg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const G2={tokenize:nz,partial:!0};function Q2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:X2,continuation:{tokenize:ez},exit:tz}},text:{91:{name:"gfmFootnoteCall",tokenize:Z2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Y2,resolveTo:$2}}}}function Y2(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const c=ir(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function $2(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Z2(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(o>999||f===93&&!s||f===null||f===91||ot(f))return n(f);if(f===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(ir(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ot(f)||(s=!0),o++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function X2(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(s>999||p===93&&!a||p===null||p===91||ot(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return o=ir(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return ot(p)||(a=!0),s++,e.consume(p),p===92?f:u}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),qe(e,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return t(p)}}function ez(e,t,n){return e.check(Rl,t,e.attempt(G2,t,n))}function tz(e){e.exit("gfmFootnoteDefinition")}function nz(e,t,n){const r=this;return qe(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function rz(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},d=[["enter",u,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",f,a]],h=a.parser.constructs.insideSpan.null;h&&In(d,d.length,0,Tl(h,s.slice(c+1,l),a)),In(d,d.length,0,[["exit",f,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),In(s,c-1,l-c+3,d),l=c+d.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const c=this.previous,u=this.events;let f=0;return d;function d(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),h(p))}function h(p){const m=Gn(c);if(p===126)return f>1?l(p):(s.consume(p),f++,h);if(f<2&&!n)return l(p);const g=s.exit("strikethroughSequenceTemporary"),A=Gn(p);return g._open=!A||A===2&&!!m,g._close=!m||m===2&&!!A,a(p)}}}class iz{constructor(){this.map=[],this.index=new Map}add(t,n,r){oz(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0,this.index.clear()}}function oz(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const o=[t,n,r];e.map.push(o),e.index.set(t,o)}function sz(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function az(){return{flow:{null:{name:"table",tokenize:lz,resolveAll:cz}}}}function lz(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let L=r.events.length-1;for(;L>-1;){const{type:Y}=r.events[L][1];if(Y==="lineEnding"||Y==="linePrefix")L--;else break}const G=L>-1?r.events[L][1].type:null,X=G==="tableHead"||G==="tableRow"?w:l;return X===w&&r.parser.lazy[r.now().line]?n(T):X(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(s=!0,o+=1),u(T)}function u(T){return T===null?n(T):Ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),h):n(T):Pe(T)?qe(e,u,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ot(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?d:f)}function d(T){return T===92||T===124?(e.consume(T),f):f(T)}function h(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,Pe(T)?qe(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):p(T))}function p(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):C(T)}function m(T){return Pe(T)?qe(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),A):T===45?(o+=1,A(T)):T===null||Ce(T)?y(T):C(T)}function A(T){return T===45?(e.enter("tableDelimiterFiller"),x(T)):C(T)}function x(T){return T===45?(e.consume(T),x):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(T))}function b(T){return Pe(T)?qe(e,y,"whitespace")(T):y(T)}function y(T){return T===124?p(T):T===null||Ce(T)?!s||i!==o?C(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):C(T)}function C(T){return n(T)}function w(T){return e.enter("tableRow"),v(T)}function v(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),v):T===null||Ce(T)?(e.exit("tableRow"),t(T)):Pe(T)?qe(e,v,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||ot(T)?(e.exit("data"),v(T)):(e.consume(T),T===92?N:D)}function N(T){return T===92||T===124?(e.consume(T),D):D(T)}}function cz(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,f;const d=new iz;for(;++n<e.length;){const h=e[n],p=h[1];h[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(Nw(d,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=xc(d,t,o,i,void 0,f),o=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],f=xc(d,t,o,i,void 0,f)),o=s,s=[o[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],f=xc(d,t,o,i,n,f)):s[1]!==0&&(f=xc(d,t,s,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Nw(d,t,l,c,u),d.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=sz(t.events,n))}return e}function xc(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},ms(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=ms(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=ms(t.events,n[2]),u=ms(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const d=t.events[n[2]],h=t.events[n[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},ms(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Nw(e,t,n,r,i){const o=[],s=ms(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function ms(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const uz={name:"tasklistCheck",tokenize:hz};function fz(){return{text:{91:uz}}}function hz(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return ot(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Ce(l)?t(l):Pe(l)?e.check({tokenize:dz},t,n)(l):n(l)}}function dz(e,t,n){return qe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function pz(e){return qk([z2(),Q2(),rz(e),az(),fz()])}const mz={};function gz(e){const t=this,n=e||mz,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(pz(n)),o.push(B2()),s.push(P2(n))}function ve(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var Xg=Fl("strike_through");ve(Xg,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var Hl=ci("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:t=>t==="line-through"}],toDOM:t=>["del",e.get(Xg.key)(t)],parseMarkdown:{match:t=>t.type==="delete",runner:(t,n,r)=>{t.openMark(r),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="strike_through",runner:(t,n)=>{t.withMark(n,"delete")}}}));ve(Hl.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});ve(Hl.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var eA=Oe("ToggleStrikeThrough",e=>()=>of(Hl.type(e)));ve(eA,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var yS=Rn(e=>Ol(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)$"),Hl.type(e)));ve(yS,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var tA=Wn("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(tt);return()=>t.call(eA.key)}}});ve(tA.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});ve(tA.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});function bS(e,t){const n=t.content.firstChild;if(t.childCount!==1||n?.type.name!=="paragraph"){e.next(t.content);return}const r=n.lastChild,i=r?.type.name==="hardbreak"?n.content.cut(0,n.content.size-r.nodeSize):n.content;e.next(i)}var Kl=MF({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),ri=xt("table",()=>({...Kl.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="table",runner:(e,t,n)=>{const r=t.align,i=t.children.map((o,s)=>({...o,align:r,isHeader:s===0}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table",runner:(e,t)=>{const n=t.content.firstChild?.content;if(!n)return;const r=[];n.forEach(i=>{r.push(i.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));ve(ri.node,{displayName:"NodeSchema<table>",group:"Table"});ve(ri.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var Jl=xt("table_header_row",()=>({...Kl.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&e.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type==="tableRow"&&e.isHeader),runner:(e,t,n)=>{const r=t.align,i=t.children.map((o,s)=>({...o,align:r[s],isHeader:t.isHeader}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));ve(Jl.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});ve(Jl.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var qs=xt("table_row",()=>({...Kl.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>e.type==="tableRow",runner:(e,t,n)=>{const r=t.align,i=t.children.map((o,s)=>({...o,align:r[s]}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));ve(qs.node,{displayName:"NodeSchema<tableRow>",group:"Table"});ve(qs.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var Vl=xt("table_cell",()=>({...Kl.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name==="table_cell",runner:(e,t)=>{e.openNode("tableCell"),bS(e,t),e.closeNode()}}}));ve(Vl.node,{displayName:"NodeSchema<tableCell>",group:"Table"});ve(Vl.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var zs=xt("table_header",()=>({...Kl.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header",runner:(e,t)=>{e.openNode("tableCell"),bS(e,t),e.closeNode()}}}));ve(zs.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});ve(zs.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function wS(e,t=3,n=3){const r=Array(n).fill(0).map(()=>Vl.type(e).createAndFill()),i=Array(n).fill(0).map(()=>zs.type(e).createAndFill()),o=Array(t).fill(0).map((s,a)=>a===0?Jl.type(e).create(null,i):qs.type(e).create(null,r));return ri.type(e).create(null,o)}function xS(e){return(t,n)=>r=>{n=n??r.selection.from;const i=r.doc.resolve(n),o=CC(l=>l.type.name==="table")(i),s=o?{node:o.node,from:o.start}:void 0,a=e==="row";if(s){const l=$e.get(s.node);if(t>=0&&t<(a?l.height:l.width)){const c=l.positionAt(a?t:l.height-1,a?l.width-1:t,s.node),u=r.doc.resolve(s.from+c),f=a?ht.rowSelection:ht.colSelection,d=l.positionAt(a?t:0,a?0:t,s.node),h=r.doc.resolve(s.from+d);return kC(r.setSelection(f(u,h)))}}return r}}var Az=xS("row"),yz=xS("col");function kS(e,t,{map:n,tableStart:r,table:i},o){const s=Array(o).fill(0).reduce((l,c,u)=>l+i.child(u).nodeSize,r),a=Array(n.width).fill(0).map((l,c)=>{const u=i.nodeAt(n.map[c]);return Vl.type(e).createAndFill({alignment:u?.attrs.alignment})});return t.insert(s,qs.type(e).create(null,a)),t}function bz(e){const t=Ul(e.$from);if(!t)return;const n=$e.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(r=>{const i=t.node.nodeAt(r),o=r+t.start;return{pos:o,start:o+1,node:i}})}function wz(e){const t=bz(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const i=e.doc.resolve(r.pos);return kC(e.setSelection(new ht(i,n)))}}return e}var nA=Oe("GoToPrevTableCell",()=>()=>rS(-1));ve(nA,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var rA=Oe("GoToNextTableCell",()=>()=>rS(1));ve(rA,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var iA=Oe("ExitTable",e=>()=>(t,n)=>{if(!Yn(t))return!1;const{$head:r}=t.selection,i=OM(r,ri.type(e));if(!i)return!1;const{to:o}=i,s=t.tr.replaceWith(o,o,_r.type(e).createAndFill());return s.setSelection(Re.near(s.doc.resolve(o),1)).scrollIntoView(),n?.(s),!0});ve(iA,{displayName:"Command<breakTableCommand>",group:"Table"});var CS=Oe("InsertTable",e=>({row:t,col:n}={})=>(r,i)=>{const{selection:o,tr:s}=r,{from:a}=o,l=wS(e,t,n),c=s.replaceSelectionWith(l),u=Re.findFrom(c.doc.resolve(a),1,!0);return u&&c.setSelection(u),i?.(c),!0});ve(CS,{displayName:"Command<insertTableCommand>",group:"Table"});var vS=Oe("MoveRow",()=>({from:e,to:t,pos:n}={})=>lL({from:e??0,to:t??0,pos:n}));ve(vS,{displayName:"Command<moveRowCommand>",group:"Table"});var SS=Oe("MoveCol",()=>({from:e,to:t,pos:n}={})=>cL({from:e??0,to:t??0,pos:n}));ve(SS,{displayName:"Command<moveColCommand>",group:"Table"});var IS=Oe("SelectRow",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t;return!!n?.(Az(e.index,e.pos)(r))});ve(IS,{displayName:"Command<selectRowCommand>",group:"Table"});var ES=Oe("SelectCol",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t;return!!n?.(yz(e.index,e.pos)(r))});ve(ES,{displayName:"Command<selectColCommand>",group:"Table"});var TS=Oe("SelectTable",()=>()=>(e,t)=>{const{tr:n}=e;return!!t?.(wz(n))});ve(TS,{displayName:"Command<selectTableCommand>",group:"Table"});var RS=Oe("DeleteSelectedCells",()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof ht))return!1;const r=n.isRowSelection(),i=n.isColSelection();return r&&i?aL(e,t):i?tL(e,t):rL(e,t)});ve(RS,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var _S=Oe("AddColBefore",()=>()=>ZF);ve(_S,{displayName:"Command<addColBeforeCommand>",group:"Table"});var NS=Oe("AddColAfter",()=>()=>XF);ve(NS,{displayName:"Command<addColAfterCommand>",group:"Table"});var OS=Oe("AddRowBefore",e=>()=>(t,n)=>{if(!Yn(t))return!1;if(n){const r=Xi(t);n(kS(e,t.tr,r,r.top))}return!0});ve(OS,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var DS=Oe("AddRowAfter",e=>()=>(t,n)=>{if(!Yn(t))return!1;if(n){const r=Xi(t);n(kS(e,t.tr,r,r.bottom))}return!0});ve(DS,{displayName:"Command<addRowAfterCommand>",group:"Table"});var MS=Oe("SetAlign",()=>(e="left")=>iL("alignment",e));ve(MS,{displayName:"Command<setAlignCommand>",group:"Table"});var BS=Rn(e=>new yn(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,i)=>{const o=t.doc.resolve(r);if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),ri.type(e)))return null;const s=wS(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),a=t.tr.replaceRangeWith(r,i,s);return a.setSelection(_e.create(a.doc,r+3)).scrollIntoView()}));ve(BS,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var PS=WP(e=>({run:(t,n,r)=>{if(r)return t;function i(c){const u=c.childCount,f=c.lastChild?.childCount??0;if(u===0||f===0)return _r.type(e).create();const d=c.firstChild;if(!(f>0&&d&&d.childCount===0))return c;if(u>=3){const g=c.child(1),A=[];for(let y=0;y<g.childCount;y++){const C=g.child(y);A.push(zs.type(e).create(C.attrs,C.content,C.marks))}const x=d.type.create(d.attrs,A),b=[];for(let y=2;y<u;y++)b.push(c.child(y));return c.type.create(c.attrs,[x,...b])}const h=Array(f).fill(0).map(()=>zs.type(e).createAndFill()),p=new ce(oe.from(h),0,0),m=d.replace(0,0,p);return c.replace(0,d.nodeSize,new ce(oe.from(m),0,0))}function o(c){const u=qs.type(e),f=[];let d=[],h=!1;function p(){if(d.length===0)return;const m=Jl.type(e).createAndFill(),g=ri.type(e).create(null,[m,...d]);f.push(i(g)),d=[]}return c.forEach(m=>{m.type===u?(h=!0,d.push(m)):(p(),f.push(m))}),p(),h?oe.from(f):c}function s(c){let u=o(c),f=u!==c;const d=[];return u.forEach(h=>{if(h.type===ri.type(e)){const p=i(h);p!==h&&(f=!0),d.push(p)}else if(h.childCount>0){const p=s(h.content);p!==h.content?(f=!0,d.push(h.copy(p))):d.push(h)}else d.push(h)}),f?oe.from(d):c}function a(c){const u=[],f=[];c.forEach(d=>f.push(d));for(let d=0;d<f.length;d++){const h=f[d],p=f[d+1];h.type===_r.type(e)&&h.content.size===0&&p&&p.type===ri.type(e)||u.push(h)}return u.length<f.length?oe.from(u):c}let l=s(t.content);return l=a(l),new ce(oe.from(l),t.openStart,t.openEnd)}}));ve(PS,{displayName:"PasteRule<table>",group:"Table"});var oA=Wn("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(tt);return()=>t.call(rA.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(tt);return()=>t.call(nA.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{const t=e.get(tt);return()=>t.call(iA.key)}}});ve(oA.ctx,{displayName:"KeymapCtx<table>",group:"Table"});ve(oA.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Wh="footnote_definition",Ow="footnoteDefinition",sA=xt("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Wh}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dr(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":Wh},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===Ow,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Wh,runner:(e,t)=>{e.openNode(Ow,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));ve(sA.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});ve(sA.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var jh="footnote_reference",aA=xt("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${jh}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dr(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":jh},t]},parseMarkdown:{match:({type:e})=>e==="footnoteReference",runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===jh,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));ve(aA.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});ve(aA.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var lA=ui.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:r=>{if(!(r instanceof HTMLElement))throw dr(r);return{label:r.dataset.label,listType:r.dataset.listType,spread:r.dataset.spread==="true",checked:r.dataset.checked?r.dataset.checked==="true":null}}},...n?.parseDOM||[]],toDOM:r=>n.toDOM&&r.attrs.checked==null?n.toDOM(r):["li",{"data-item-type":"task","data-label":r.attrs.label,"data-list-type":r.attrs.listType,"data-spread":r.attrs.spread,"data-checked":r.attrs.checked},0],parseMarkdown:{match:({type:r})=>r==="listItem",runner:(r,i,o)=>{if(i.checked==null){n.parseMarkdown.runner(r,i,o);return}const s=i.label!=null?`${i.label}.`:"•",a=i.checked!=null?!!i.checked:null,l=i.label!=null?"ordered":"bullet",c=i.spread??!0;r.openNode(o,{label:s,listType:l,spread:c,checked:a}),r.next(i.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="list_item",runner:(r,i)=>{if(i.attrs.checked==null){n.toMarkdown.runner(r,i);return}const o=i.attrs.label,s=i.attrs.listType,a=i.attrs.spread,l=i.attrs.checked;r.openNode("listItem",void 0,{label:o,listType:s,spread:a,checked:l}),r.next(i.content),r.closeNode()}}}});ve(lA.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});ve(lA.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var FS=Rn(()=>new yn(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{const i=e.doc.resolve(n);let o=0,s=i.node(o);for(;s&&s.type.name!=="list_item";)o--,s=i.node(o);if(!s||s.attrs.checked!=null)return null;const a=t.groups?.checked==="x",l=i.before(o),c=e.tr;return c.deleteRange(n,r).setNodeMarkup(l,void 0,{...s.attrs,checked:a}),c}));ve(FS,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var xz=[tA,oA].flat(),kz=[BS,FS],Cz=[yS],vz=[PS],LS=fr(()=>LL);ve(LS,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var Sz=fr(()=>bL({}));ve(Sz,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var zS=fr(()=>RL({allowTableNodeSelection:!0}));ve(zS,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var cA=bn("remarkGFM",()=>gz);ve(cA.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});ve(cA.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Iz=new zn("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function Ez(e,t){let n=0;return t.forEach((r,i,o)=>{r===e&&(n=o)}),n}function Tz(e,t){const n=e.content.findDiffStart(t.content);if(n==null)return null;const r=e.content.findDiffEnd(t.content);return r?{from:n,to:Math.max(r.b,n)}:null}var WS=fr(()=>new An({key:Iz,appendTransaction:(e,t,n)=>{if(t.doc===n.doc)return;const r=Tz(t.doc,n.doc);if(!r)return;let i;const o=(s,a)=>{if(s.type.name!=="table_cell")return;const l=n.doc.resolve(a),c=l.node(l.depth),u=l.node(l.depth-1).firstChild;if(!u)return;const f=Ez(s,c),d=u.maybeChild(f);if(!d)return;const h=d.attrs.alignment;h!==s.attrs.alignment&&(i||(i=n.tr),i.setNodeMarkup(a,void 0,{...s.attrs,alignment:h}))};return n.doc.nodesBetween(r.from,r.to,(s,a)=>s.type.name!=="table"?!0:(n.doc.nodesBetween(a,a+s.nodeSize,o),!1)),i}}));ve(WS,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Rz=[WS,LS,cA,zS].flat(),_z=[lA,ri,Jl,qs,zs,Vl,sA,aA,Xg,Hl].flat(),Nz=[rA,nA,iA,CS,vS,SS,IS,ES,TS,RS,OS,DS,_S,NS,MS,eA],oG=[_z,kz,vz,Cz,xz,Nz,Rz].flat();const sG=`/*
54
+ * @akairos/myno — article typography
55
+ *
56
+ * Consumers:
57
+ * - zzhub-pipeline wechat-export (Juice inlines these rules)
58
+ * - myno editor and Studio (live editor preview)
59
+ *
60
+ * Selectors stay on \`.milkdown .editor\` so both hosts share the same cascade.
61
+ * Prefer semantic tags; \`data-wechat-node\` hooks are export-only and safe to
62
+ * leave in place when the host never sets them.
63
+ *
64
+ * Theme tokens: tokens-default.css (live hosts); pipeline export also injects
65
+ * via themes.ts / buildWechatThemeCss.
66
+ */
67
+
68
+ .milkdown .editor {
69
+ max-width: 100%;
70
+ margin: 0;
71
+ padding: 8px 4px 28px;
72
+ background: #ffffff;
73
+ box-sizing: border-box;
74
+ color: var(--wx-body-color);
75
+ font-family: var(--wx-font-family);
76
+ font-size: 16px;
77
+ font-weight: 400;
78
+ line-height: var(--wx-body-line-height);
79
+ letter-spacing: var(--wx-body-letter-spacing);
80
+ overflow-wrap: break-word;
81
+ word-break: break-word;
82
+ -webkit-text-size-adjust: 100%;
83
+ }
84
+
85
+ .milkdown .editor p {
86
+ margin: 0 0 1.18em;
87
+ color: var(--wx-body-color);
88
+ font-family: var(--wx-font-family);
89
+ font-size: 16px;
90
+ line-height: var(--wx-body-line-height);
91
+ letter-spacing: var(--wx-body-letter-spacing);
92
+ text-align: justify;
93
+ overflow-wrap: break-word;
94
+ word-break: break-word;
95
+ }
96
+
97
+ /*
98
+ * Heading hierarchy (WeChat-safe):
99
+ * - Primary levers: asymmetric margin (far above / near below) + chroma steps.
100
+ * - Keep font-weight at 700 (600 often snaps to 700 on Android CJK faces).
101
+ * - Adjacent rules (h2+p, h2+h3) are evaluated at export by Juice and baked into
102
+ * inline styles; WeChat runtime never re-runs selectors.
103
+ */
104
+ .milkdown .editor h1,
105
+ .milkdown .editor h2,
106
+ .milkdown .editor h3,
107
+ .milkdown .editor h4,
108
+ .milkdown .editor h5,
109
+ .milkdown .editor h6 {
110
+ font-family: var(--wx-font-family);
111
+ font-weight: 700;
112
+ text-align: left;
113
+ overflow-wrap: break-word;
114
+ word-break: break-word;
115
+ }
116
+
117
+ .milkdown .editor h1 {
118
+ margin: 2.45em 0 0.85em;
119
+ color: var(--wx-h2-color, var(--wx-body-color));
120
+ font-size: 26px;
121
+ line-height: 1.38;
122
+ letter-spacing: -0.01em;
123
+ }
124
+
125
+ /* H2 = major section break: more air above, stick to following copy */
126
+ .milkdown .editor h2 {
127
+ margin: 2.7em 0 0.7em;
128
+ padding-left: 0;
129
+ padding-bottom: 0;
130
+ border-left: 0;
131
+ border-bottom: none;
132
+ color: var(--wx-h2-color, #1f1b1c);
133
+ font-size: 20px;
134
+ line-height: 1.38;
135
+ letter-spacing: 0.005em;
136
+ text-decoration: none;
137
+ }
138
+
139
+ /* H3 = in-section label: near body size, mid chroma, less top air */
140
+ .milkdown .editor h3 {
141
+ margin: 1.55em 0 0.4em;
142
+ padding-bottom: 0;
143
+ border-bottom: none;
144
+ color: var(--wx-h3-color, #5c5658);
145
+ font-size: 16px;
146
+ line-height: 1.48;
147
+ letter-spacing: 0.02em;
148
+ text-decoration: none;
149
+ }
150
+
151
+ .milkdown .editor h4,
152
+ .milkdown .editor h5,
153
+ .milkdown .editor h6 {
154
+ margin: 1.45em 0 0.45em;
155
+ color: var(--wx-h3-color, #5c5658);
156
+ font-size: 16px;
157
+ line-height: 1.55;
158
+ letter-spacing: 0.02em;
159
+ }
160
+
161
+ /* Opening heading should not dump a large white gap under chrome */
162
+ .milkdown .editor > h1:first-child,
163
+ .milkdown .editor > h2:first-child,
164
+ .milkdown .editor > h3:first-child,
165
+ .milkdown .editor > h4:first-child {
166
+ margin-top: 0.25em;
167
+ }
168
+
169
+ /* Title sticks to following paragraph (Juice bakes margin-top onto that p) */
170
+ .milkdown .editor h1 + p,
171
+ .milkdown .editor h2 + p,
172
+ .milkdown .editor h3 + p,
173
+ .milkdown .editor h4 + p {
174
+ margin-top: 0;
175
+ }
176
+
177
+ /* Avoid stacked air when a subsection title follows a section title */
178
+ .milkdown .editor h2 + h3,
179
+ .milkdown .editor h2 + h4,
180
+ .milkdown .editor h3 + h4 {
181
+ margin-top: 1.1em;
182
+ }
183
+
184
+ .milkdown .editor strong,
185
+ .milkdown .editor b {
186
+ color: var(--wx-body-color);
187
+ font-weight: 700;
188
+ }
189
+
190
+ .milkdown .editor em,
191
+ .milkdown .editor i {
192
+ color: var(--wx-body-color);
193
+ font-style: italic;
194
+ }
195
+
196
+ .milkdown .editor s,
197
+ .milkdown .editor del {
198
+ color: var(--wx-muted-color);
199
+ text-decoration: line-through;
200
+ text-decoration-color: var(--wx-muted-color);
201
+ }
202
+
203
+ .milkdown .editor a,
204
+ .milkdown .editor [data-wechat-node="external-link"] {
205
+ border-bottom: 1px solid var(--wx-brand-accent);
206
+ color: var(--wx-brand-ink);
207
+ text-decoration: none;
208
+ }
209
+
210
+ .milkdown .editor [data-wechat-node="link-marker"] {
211
+ margin-left: 2px;
212
+ color: var(--wx-brand-ink);
213
+ font-size: 11px;
214
+ line-height: 1;
215
+ vertical-align: super;
216
+ }
217
+
218
+ /* Live editor uses bare <code>; export marks nodes with data-wechat-node. */
219
+ .milkdown .editor code:not(pre code),
220
+ .milkdown .editor [data-wechat-node="inline-code"] {
221
+ margin: 0 2px;
222
+ padding: 2px 5px;
223
+ border: 1px solid #ded9db;
224
+ border-radius: 4px;
225
+ background-color: #f7f5f6;
226
+ color: #4d484a;
227
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
228
+ font-size: 14px;
229
+ line-height: 1.55;
230
+ overflow-wrap: break-word;
231
+ word-break: break-word;
232
+ }
233
+
234
+ .milkdown .editor [data-wechat-node="code-block"] {
235
+ margin: 1.55em 0;
236
+ border: 1px solid var(--wx-divider-color);
237
+ border-radius: 7px;
238
+ background-color: var(--wx-soft-surface);
239
+ overflow: hidden;
240
+ }
241
+
242
+ .milkdown .editor [data-wechat-node="code-language"] {
243
+ margin: 0;
244
+ padding: 7px 13px 6px;
245
+ border-bottom: 1px solid var(--wx-divider-color);
246
+ color: var(--wx-muted-color);
247
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
248
+ font-size: 11px;
249
+ font-weight: 600;
250
+ line-height: 1.4;
251
+ letter-spacing: 0.08em;
252
+ text-align: left;
253
+ }
254
+
255
+ /* Export wraps <pre> in [data-wechat-node="code-block"] (outer chrome).
256
+ * Live editors only have bare <pre> — give them the same chrome. */
257
+ .milkdown .editor pre {
258
+ margin: 1.55em 0;
259
+ padding: 15px 14px 16px;
260
+ border: 1px solid var(--wx-divider-color);
261
+ border-radius: 7px;
262
+ background-color: var(--wx-soft-surface);
263
+ color: var(--wx-body-color);
264
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
265
+ font-size: 13px;
266
+ line-height: 1.72;
267
+ overflow-x: auto;
268
+ white-space: pre;
269
+ word-break: normal;
270
+ }
271
+
272
+ .milkdown .editor [data-wechat-node="code-block"] pre {
273
+ margin: 0;
274
+ border: 0;
275
+ border-radius: 0;
276
+ }
277
+
278
+ .milkdown .editor pre code {
279
+ display: block;
280
+ margin: 0;
281
+ padding: 0;
282
+ border: 0;
283
+ background: transparent;
284
+ color: var(--wx-body-color);
285
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
286
+ font-size: 13px;
287
+ line-height: 1.72;
288
+ overflow-wrap: normal;
289
+ white-space: pre;
290
+ word-break: normal;
291
+ }
292
+
293
+ .milkdown .editor figure,
294
+ .milkdown .editor [data-wechat-node="image-block"] {
295
+ margin: 1.65em 0 1.8em;
296
+ text-align: center;
297
+ }
298
+
299
+ .milkdown .editor img {
300
+ display: block;
301
+ width: auto;
302
+ max-width: 100%;
303
+ height: auto;
304
+ margin: 0 auto;
305
+ border-radius: 4px;
306
+ box-sizing: border-box;
307
+ }
308
+
309
+ .milkdown .editor figcaption,
310
+ .milkdown .editor [data-wechat-node="image-caption"] {
311
+ margin: 9px 0 0;
312
+ color: var(--wx-muted-color);
313
+ font-family: var(--wx-font-family);
314
+ font-size: 13px;
315
+ line-height: 1.62;
316
+ letter-spacing: 0.015em;
317
+ text-align: center;
318
+ }
319
+
320
+ .milkdown .editor blockquote {
321
+ margin: 1.48em 0;
322
+ padding: 0.82em 1em 0.82em 1.08em;
323
+ border-left: 3px solid var(--wx-blockquote-border, var(--wx-brand-accent));
324
+ border-radius: 0 5px 5px 0;
325
+ background-color: #fbfafb;
326
+ color: var(--wx-muted-color);
327
+ }
328
+
329
+ .milkdown .editor blockquote p {
330
+ margin: 0.35em 0;
331
+ color: var(--wx-muted-color);
332
+ font-size: 15px;
333
+ line-height: 1.78;
334
+ text-align: left;
335
+ }
336
+
337
+ .milkdown .editor ul,
338
+ .milkdown .editor ol {
339
+ margin: 1.05em 0 1.3em;
340
+ padding-left: 1.55em;
341
+ color: var(--wx-body-color);
342
+ list-style-position: outside;
343
+ }
344
+
345
+ .milkdown .editor ul {
346
+ list-style-type: disc;
347
+ }
348
+
349
+ .milkdown .editor ol {
350
+ list-style-type: decimal;
351
+ }
352
+
353
+ .milkdown .editor li {
354
+ margin: 0.42em 0;
355
+ padding-left: 0.12em;
356
+ color: var(--wx-body-color);
357
+ font-size: 16px;
358
+ line-height: 1.78;
359
+ overflow-wrap: break-word;
360
+ word-break: break-word;
361
+ }
362
+
363
+ .milkdown .editor li p {
364
+ margin: 0.18em 0;
365
+ line-height: 1.78;
366
+ text-align: left;
367
+ }
368
+
369
+ .milkdown .editor [data-wechat-node="task-list-item"] {
370
+ list-style: none;
371
+ }
372
+
373
+ .milkdown .editor [data-wechat-node="task-marker"] {
374
+ display: inline-block;
375
+ min-width: 1.35em;
376
+ color: var(--wx-brand-ink);
377
+ font-weight: 700;
378
+ }
379
+
380
+ .milkdown .editor table {
381
+ display: block;
382
+ width: 100%;
383
+ max-width: 100%;
384
+ margin: 1.5em 0;
385
+ border-collapse: collapse;
386
+ table-layout: auto;
387
+ overflow-x: auto;
388
+ box-sizing: border-box;
389
+ color: var(--wx-body-color);
390
+ font-size: 14px;
391
+ line-height: 1.62;
392
+ }
393
+
394
+ .milkdown .editor th,
395
+ .milkdown .editor td {
396
+ padding: 8px 9px;
397
+ border: 1px solid var(--wx-divider-color);
398
+ color: var(--wx-body-color);
399
+ text-align: left;
400
+ vertical-align: top;
401
+ overflow-wrap: break-word;
402
+ word-break: break-word;
403
+ }
404
+
405
+ .milkdown .editor th {
406
+ background-color: var(--wx-soft-surface);
407
+ color: var(--wx-brand-ink);
408
+ font-weight: 700;
409
+ }
410
+
411
+ .milkdown .editor th p,
412
+ .milkdown .editor td p {
413
+ margin: 0;
414
+ font-size: 14px;
415
+ line-height: 1.62;
416
+ text-align: left;
417
+ }
418
+
419
+ .milkdown .editor th p {
420
+ color: var(--wx-brand-ink);
421
+ }
422
+
423
+ /* 表头保持单行,超宽表格通过自身横向滚动。 */
424
+ .milkdown .editor th,
425
+ .milkdown .editor th p {
426
+ white-space: nowrap;
427
+ overflow-wrap: normal;
428
+ word-break: normal;
429
+ }
430
+
431
+ .milkdown .editor td p {
432
+ color: var(--wx-body-color);
433
+ }
434
+
435
+ .milkdown .editor hr {
436
+ display: block;
437
+ height: 0;
438
+ margin: 2.15em 0;
439
+ padding: 0;
440
+ border: 0;
441
+ border-top: 1px solid var(--wx-divider-color);
442
+ background: transparent;
443
+ }
444
+
445
+ .milkdown .editor [data-wechat-node="references"] {
446
+ margin-top: 2.6em;
447
+ padding-top: 1.05em;
448
+ border-top: 1px solid var(--wx-divider-color);
449
+ }
450
+
451
+ .milkdown .editor [data-wechat-node="references-title"] {
452
+ margin: 0 0 0.65em;
453
+ color: var(--wx-body-color);
454
+ font-size: 15px;
455
+ font-weight: 700;
456
+ line-height: 1.55;
457
+ text-align: left;
458
+ }
459
+
460
+ .milkdown .editor [data-wechat-node="references-list"] {
461
+ margin: 0;
462
+ padding-left: 1.5em;
463
+ }
464
+
465
+ .milkdown .editor [data-wechat-node="reference-item"] {
466
+ margin: 0.42em 0;
467
+ color: var(--wx-muted-color);
468
+ font-size: 12px;
469
+ line-height: 1.62;
470
+ overflow-wrap: break-word;
471
+ word-break: break-word;
472
+ }
473
+
474
+ .milkdown .editor [data-wechat-node="footer"] {
475
+ margin-top: 2.5em;
476
+ padding-top: 0.9em;
477
+ border-top: 1px solid var(--wx-divider-color);
478
+ text-align: center;
479
+ }
480
+
481
+ .milkdown .editor [data-wechat-node="footer-text"] {
482
+ margin: 0;
483
+ color: var(--wx-muted-color);
484
+ font-size: 12px;
485
+ line-height: 1.6;
486
+ letter-spacing: 0.08em;
487
+ text-align: center;
488
+ }
489
+
490
+ /*
491
+ * ==========================================================================
492
+ * Kairos Extended Article Components (Editorial Standard)
493
+ *
494
+ * 注:以下为作者 Kairos 个人公众号与 Milkdown 写作的标准组件排版样式。
495
+ * 宿主应用或用户可按需通过自定义 CSS 变量或选择器进行重写与覆盖。
496
+ * ==========================================================================
497
+ */
498
+
499
+ /* 1. 高亮标记 (Highlight Mark) */
500
+ .milkdown .editor mark {
501
+ background-color: #fef08a;
502
+ color: inherit;
503
+ padding: 0.1em 0.3em;
504
+ border-radius: 2px;
505
+ box-decoration-break: clone;
506
+ -webkit-box-decoration-break: clone;
507
+ }
508
+
509
+ /* 2. 提示卡片 (Callout GFM Alerts) */
510
+ .milkdown .editor section[data-wechat-node="callout"],
511
+ .milkdown .editor .wechat-callout {
512
+ margin: 1.6em 0;
513
+ padding: 14px 16px;
514
+ border-radius: 6px;
515
+ border-left-width: 4px;
516
+ border-left-style: solid;
517
+ border-left-color: #3b82f6;
518
+ background-color: rgba(59, 130, 246, 0.08);
519
+ box-sizing: border-box;
520
+ }
521
+ .milkdown .editor .wechat-callout-note,
522
+ .milkdown .editor section[data-callout-type="note"] {
523
+ border-left-color: #3b82f6 !important;
524
+ background-color: rgba(59, 130, 246, 0.08) !important;
525
+ }
526
+ .milkdown .editor .wechat-callout-tip,
527
+ .milkdown .editor section[data-callout-type="tip"] {
528
+ border-left-color: #10b981 !important;
529
+ background-color: rgba(16, 185, 129, 0.08) !important;
530
+ }
531
+ .milkdown .editor .wechat-callout-important,
532
+ .milkdown .editor section[data-callout-type="important"] {
533
+ border-left-color: #8b5cf6 !important;
534
+ background-color: rgba(139, 92, 246, 0.08) !important;
535
+ }
536
+ .milkdown .editor .wechat-callout-warning,
537
+ .milkdown .editor section[data-callout-type="warning"] {
538
+ border-left-color: #f59e0b !important;
539
+ background-color: rgba(245, 158, 11, 0.08) !important;
540
+ }
541
+ .milkdown .editor .wechat-callout-caution,
542
+ .milkdown .editor section[data-callout-type="caution"] {
543
+ border-left-color: #ef4444 !important;
544
+ background-color: rgba(239, 68, 68, 0.08) !important;
545
+ }
546
+ .milkdown .editor section[data-wechat-node="callout-header"],
547
+ .milkdown .editor .wechat-callout-header {
548
+ margin-bottom: 6px;
549
+ font-size: 14px;
550
+ font-weight: 700;
551
+ color: var(--wx-h2-color, #1f1b1c);
552
+ }
553
+ .milkdown .editor .wechat-callout-icon {
554
+ margin-right: 6px;
555
+ font-size: 15px;
556
+ display: inline-block;
557
+ vertical-align: middle;
558
+ }
559
+ .milkdown .editor .wechat-callout-title {
560
+ display: inline-block;
561
+ vertical-align: middle;
562
+ }
563
+ .milkdown .editor .wechat-callout p {
564
+ margin: 0.3em 0;
565
+ font-size: 14.5px;
566
+ line-height: 1.68;
567
+ }
568
+
569
+ /* 3. 键盘按键 (Keyboard Key) */
570
+ .milkdown .editor span[data-wechat-node="kbd"],
571
+ .milkdown .editor .wechat-kbd {
572
+ display: inline-block;
573
+ padding: 1.5px 5.5px;
574
+ font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
575
+ font-size: 0.82em;
576
+ font-weight: 500;
577
+ line-height: 1.35;
578
+ color: var(--wx-text-mid, #3c4043);
579
+ background-color: #f3f4f6;
580
+ border: 1px solid #d1d5db;
581
+ border-bottom-width: 2px;
582
+ border-radius: 4px;
583
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
584
+ margin: 0 2px;
585
+ vertical-align: baseline;
586
+ }
587
+
588
+ /* 4. 状态徽章 (Status Badge) */
589
+ .milkdown .editor span[data-wechat-node="badge"],
590
+ .milkdown .editor .wechat-badge {
591
+ display: inline-block;
592
+ padding: 1.5px 7px;
593
+ font-size: 11px;
594
+ font-weight: 600;
595
+ line-height: 1.3;
596
+ border-radius: 9999px;
597
+ margin: 0 3px;
598
+ vertical-align: middle;
599
+ }
600
+ .milkdown .editor .wechat-badge-brand {
601
+ background-color: rgba(202, 96, 147, 0.12);
602
+ color: var(--wx-brand-accent, #ca6093);
603
+ }
604
+ .milkdown .editor .wechat-badge-success {
605
+ background-color: #dcfce7;
606
+ color: #15803d;
607
+ }
608
+ .milkdown .editor .wechat-badge-warning {
609
+ background-color: #fef3c7;
610
+ color: #b45309;
611
+ }
612
+ .milkdown .editor .wechat-badge-danger {
613
+ background-color: #fee2e2;
614
+ color: #b91c1c;
615
+ }
616
+ .milkdown .editor .wechat-badge-info {
617
+ background-color: #e0f2fe;
618
+ color: #0369a1;
619
+ }
620
+
621
+ /* 5. 篇章结构卡片 (Article Cards: Intro & CTA) */
622
+ .milkdown .editor section[data-wechat-node="article-card"],
623
+ .milkdown .editor .wechat-article-card {
624
+ margin: 1.8em 0;
625
+ padding: 16px 20px;
626
+ border-radius: 10px;
627
+ box-sizing: border-box;
628
+ overflow: hidden;
629
+ }
630
+ .milkdown .editor .wechat-article-card-intro {
631
+ background-color: var(--wx-soft-surface, #faf8f9);
632
+ border: 1px solid var(--wx-divider, #eae4e7);
633
+ }
634
+ .milkdown .editor .wechat-article-card-cta {
635
+ background-color: rgba(202, 96, 147, 0.04);
636
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
637
+ text-align: center;
638
+ }
639
+ .milkdown .editor section[data-wechat-node="card-eyebrow"],
640
+ .milkdown .editor .wechat-card-eyebrow {
641
+ margin-bottom: 10px;
642
+ }
643
+ .milkdown .editor .wechat-article-card-cta section[data-wechat-node="card-eyebrow"],
644
+ .milkdown .editor .wechat-article-card-cta .wechat-card-eyebrow {
645
+ text-align: center;
646
+ }
647
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
648
+ .milkdown .editor .wechat-card-eyebrow-badge {
649
+ display: inline-block;
650
+ padding: 2px 8px;
651
+ border-radius: 4px;
652
+ background-color: rgba(202, 96, 147, 0.08);
653
+ color: var(--wx-brand-accent, #ca6093);
654
+ font-size: 11px;
655
+ font-weight: 700;
656
+ letter-spacing: 0.06em;
657
+ line-height: 1.5;
658
+ }
659
+ .milkdown .editor .wechat-card-eyebrow-icon {
660
+ margin-right: 4px;
661
+ font-size: 12px;
662
+ display: inline-block;
663
+ vertical-align: middle;
664
+ }
665
+ .milkdown .editor .wechat-card-eyebrow-label {
666
+ display: inline-block;
667
+ vertical-align: middle;
668
+ }
669
+ .milkdown .editor .wechat-article-card p {
670
+ margin: 0.4em 0;
671
+ font-size: 13px;
672
+ line-height: 1.72;
673
+ color: var(--wx-text-soft, #555555);
674
+ letter-spacing: 0.02em;
675
+ }
676
+ .milkdown .editor p[data-wechat-node="intro-meta"],
677
+ .milkdown .editor .wechat-intro-meta {
678
+ margin: 4px 0 10px 0 !important;
679
+ padding-bottom: 8px;
680
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
681
+ font-size: 12px !important;
682
+ color: var(--wx-muted-color, #756b6e) !important;
683
+ line-height: 1.5 !important;
684
+ }
685
+ .milkdown .editor p[data-wechat-node="intro-meta"] strong,
686
+ .milkdown .editor .wechat-intro-meta strong {
687
+ color: var(--wx-brand-accent, #ca6093);
688
+ font-weight: 600;
689
+ }
690
+ .milkdown .editor p[data-wechat-node="intro-guide"],
691
+ .milkdown .editor .wechat-intro-guide {
692
+ margin-top: 10px !important;
693
+ padding-top: 8px;
694
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
695
+ font-size: 12px !important;
696
+ color: var(--wx-brand-accent, #ca6093) !important;
697
+ line-height: 1.6 !important;
698
+ }
699
+ `;var Dw=Object.prototype.hasOwnProperty;function Mw(e,t,n){for(n of e.keys())if(Ba(n,t))return n}function Ba(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ba(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Mw(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Mw(t,i),!i)||!Ba(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Dw.call(e,n)&&++r&&!Dw.call(t,n)||!(n in t)||!Ba(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Oz={};let Up,jS,US,HS,KS=!0;typeof process<"u"&&({FORCE_COLOR:Up,NODE_DISABLE_COLORS:jS,NO_COLOR:US,TERM:HS}=Oz||{},KS=process.stdout&&process.stdout.isTTY);const je={enabled:!jS&&US==null&&HS!=="dumb"&&(Up!=null&&Up!=="0"||KS),reset:at(0,0),bold:at(1,22),dim:at(2,22),italic:at(3,23),underline:at(4,24),inverse:at(7,27),hidden:at(8,28),strikethrough:at(9,29),black:at(30,39),red:at(31,39),green:at(32,39),yellow:at(33,39),blue:at(34,39),magenta:at(35,39),cyan:at(36,39),white:at(37,39),gray:at(90,39),grey:at(90,39),bgBlack:at(40,49),bgRed:at(41,49),bgGreen:at(42,49),bgYellow:at(43,49),bgBlue:at(44,49),bgMagenta:at(45,49),bgCyan:at(46,49),bgWhite:at(47,49)};function Bw(e,t){let n=0,r,i="",o="";for(;n<e.length;n++)r=e[n],i+=r.open,o+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+o}function Dz(e,t){let n={has:e,keys:t};return n.reset=je.reset.bind(n),n.bold=je.bold.bind(n),n.dim=je.dim.bind(n),n.italic=je.italic.bind(n),n.underline=je.underline.bind(n),n.inverse=je.inverse.bind(n),n.hidden=je.hidden.bind(n),n.strikethrough=je.strikethrough.bind(n),n.black=je.black.bind(n),n.red=je.red.bind(n),n.green=je.green.bind(n),n.yellow=je.yellow.bind(n),n.blue=je.blue.bind(n),n.magenta=je.magenta.bind(n),n.cyan=je.cyan.bind(n),n.white=je.white.bind(n),n.gray=je.gray.bind(n),n.grey=je.grey.bind(n),n.bgBlack=je.bgBlack.bind(n),n.bgRed=je.bgRed.bind(n),n.bgGreen=je.bgGreen.bind(n),n.bgYellow=je.bgYellow.bind(n),n.bgBlue=je.bgBlue.bind(n),n.bgMagenta=je.bgMagenta.bind(n),n.bgCyan=je.bgCyan.bind(n),n.bgWhite=je.bgWhite.bind(n),n}function at(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:je.enabled?Bw(this.keys,r+""):r+""):r===void 0?Dz([e],[n]):je.enabled?Bw([n],r+""):r+""}}function eo(){}eo.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.callback;typeof i=="function"&&(o=i,i={}),this.options=i;var s=this;function a(y){return o?(setTimeout(function(){o(void 0,y)},0),!0):y}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var l=n.length,c=t.length,u=1,f=l+c;i.maxEditLength&&(f=Math.min(f,i.maxEditLength));var d=(r=i.timeout)!==null&&r!==void 0?r:1/0,h=Date.now()+d,p=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(p[0],n,t,0);if(p[0].oldPos+1>=c&&m+1>=l)return a([{value:this.join(n),count:n.length}]);var g=-1/0,A=1/0;function x(){for(var y=Math.max(g,-u);y<=Math.min(A,u);y+=2){var C=void 0,w=p[y-1],v=p[y+1];w&&(p[y-1]=void 0);var D=!1;if(v){var N=v.oldPos-y;D=v&&0<=N&&N<l}var T=w&&w.oldPos+1<c;if(!D&&!T){p[y]=void 0;continue}if(!T||D&&w.oldPos+1<v.oldPos?C=s.addToPath(v,!0,void 0,0):C=s.addToPath(w,void 0,!0,1),m=s.extractCommon(C,n,t,y),C.oldPos+1>=c&&m+1>=l)return a(Mz(s,C.lastComponent,n,t,s.useLongestToken));p[y]=C,C.oldPos+1>=c&&(A=Math.min(A,y-1)),m+1>=l&&(g=Math.max(g,y+1))}u++}if(o)(function y(){setTimeout(function(){if(u>f||Date.now()>h)return o();x()||y()},0)})();else for(;u<=f&&Date.now()<=h;){var b=x();if(b)return b}},addToPath:function(t,n,r,i){var o=t.lastComponent;return o&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}},extractCommon:function(t,n,r,i){for(var o=n.length,s=r.length,a=t.oldPos,l=a-i,c=0;l+1<o&&a+1<s&&this.equals(n[l+1],r[a+1]);)l++,a++,c++;return c&&(t.lastComponent={count:c,previousComponent:t.lastComponent}),t.oldPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Mz(e,t,n,r,i){for(var o=[],s;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();for(var a=0,l=o.length,c=0,u=0;a<l;a++){var f=o[a];if(f.removed){if(f.value=e.join(r.slice(u,u+f.count)),u+=f.count,a&&o[a-1].added){var h=o[a-1];o[a-1]=o[a],o[a]=h}}else{if(!f.added&&i){var d=n.slice(c,c+f.count);d=d.map(function(m,g){var A=r[u+g];return A.length>m.length?A:m}),f.value=e.join(d)}else f.value=e.join(n.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}var p=o[l-1];return l>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(o[l-2].value+=p.value,o.pop()),o}var Pw=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Fw=/\S/,JS=new eo;JS.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Fw.test(e)&&!Fw.test(t)};JS.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&Pw.test(t[n])&&Pw.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var VS=new eo;VS.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
700
+ `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var Bz=new eo;Bz.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Pz=new eo;Pz.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Zc(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zc=function(t){return typeof t}:Zc=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(e)}var Fz=Object.prototype.toString,il=new eo;il.useLongestToken=!0;il.tokenize=VS.tokenize;il.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(o,s){return typeof s>"u"?n:s}:r;return typeof e=="string"?e:JSON.stringify(Hp(e,null,null,i),i," ")};il.equals=function(e,t){return eo.prototype.equals.call(il,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Hp(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var s;if(Fz.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),o=0;o<e.length;o+=1)s[o]=Hp(e[o],t,n,r,i);return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),Zc(e)==="object"&&e!==null){t.push(e),s={},n.push(s);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),o=0;o<a.length;o+=1)l=a[o],s[l]=Hp(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}var Kp=new eo;Kp.tokenize=function(e){return e.slice()};Kp.join=Kp.removeEmpty=function(e){return e};je.red,je.grey,je.green;je.dim().italic;je.dim("→");je.dim("·");je.dim("↵");function Cu(e){e=e.replace(/\r?\n/g,`
701
+ `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class Lz extends Error{constructor(t={}){super(t.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=t.details||!1,this.generated=!!t.generated,this.operator=t.operator,this.expects=t.expects,this.actual=t.actual}}function qn(e,t,n,r,i,o,s){if(e)return;let a=s||o;if(s instanceof Error)throw s;let l=i;throw new Lz({actual:t,expects:n,operator:r,message:a,details:l,generated:!s})}function zz(e,t){qn(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function oi(e,t){qn(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}oi.ok=oi;oi.equal=function(e,t,n){qn(!Ba(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};oi.type=function(e,t,n){let r=typeof e;qn(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};oi.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";qn(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};oi.snapshot=function(e,t,n){e=Cu(e),t=Cu(t),qn(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};oi.fixture=function(e,t,n){e=Cu(e),t=Cu(t),qn(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};oi.match=function(e,t,n){typeof t=="string"?qn(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):qn(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};oi.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?qn(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?qn(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||qn(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const oa={equalsTo:61},Lw={attentionSideAfter:2},zw={data:"data",characterEscape:"characterEscape"};var sa="highlightSequenceTemporary",Ww="highlightSequence",Wz="highlight",jz="highlightText";function Uz(){const e={name:"highlight",tokenize:n,resolveAll:t};return{text:{[oa.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[oa.equalsTo]}};function t(r,i){let o=-1;for(;++o<r.length;)if(r[o][0]==="enter"&&r[o][1].type===sa&&r[o][1]._close){let s=o;for(;s--;)if(r[s][0]==="exit"&&r[s][1].type===sa&&r[s][1]._open&&r[o][1].end.offset-r[o][1].start.offset===r[s][1].end.offset-r[s][1].start.offset){r[o][1].type=Ww,r[s][1].type=Ww;const a={type:Wz,start:Object.assign({},r[s][1].start),end:Object.assign({},r[o][1].end)},l={type:jz,start:Object.assign({},r[s][1].end),end:Object.assign({},r[o][1].start)},c=[["enter",a,i],["enter",r[s][1],i],["exit",r[s][1],i],["enter",l,i]],u=i.parser.constructs.insideSpan.null;u&&In(c,c.length,0,Tl(u,r.slice(s+1,o),i)),In(c,c.length,0,[["exit",l,i],["enter",r[o][1],i],["exit",r[o][1],i],["exit",a,i]]),In(r,s-1,o-s+3,c),o=s+c.length-2;break}}for(o=-1;++o<r.length;)r[o][1].type===sa&&(r[o][1].type=zw.data);return r}function n(r,i,o){const s=this.previous,a=this.events;let l=0;return c;function c(f){return zz(f===oa.equalsTo,"expected `=`"),s===oa.equalsTo&&a[a.length-1][1].type!==zw.characterEscape?o(f):(r.enter(sa),u(f))}function u(f){const d=Gn(s);if(f===oa.equalsTo)return l>1?o(f):(r.consume(f),l++,u);if(l<2)return o(f);const h=r.exit(sa),p=Gn(f);return h._open=!p||p===Lw.attentionSideAfter&&!!d,h._close=!d||d===Lw.attentionSideAfter&&!!p,i(f)}}}qS.peek=Gz;var Hz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Kz={canContainEols:["highlight"],enter:{highlight:Jz},exit:{highlight:Vz}};function Jz(e){this.enter({type:"highlight",children:[]},e)}function Vz(e){this.exit(e)}var qz={unsafe:[{character:"=",inConstruct:"phrasing",notInConstruct:Hz}],handlers:{highlight:qS}};function qS(e,t,n,r){const o=n.createTracker(r),s=n.enter("highlight");let a=o.move("==");return a+=o.move(n.containerPhrasing(e,{before:a,after:"=",...o.current()})),a+=o.move("=="),s(),a}function Gz(){return"="}function Uh(e,t,n){var r;if(Array.isArray(n)){(r=e.fromMarkdownExtensions)!=null||(e.fromMarkdownExtensions=[]),e.fromMarkdownExtensions.push(n);return}e[t]?e[t].push(n):e[t]=[n]}const Qz=function(){const t=this.data();Uh(t,"micromarkExtensions",Uz()),Uh(t,"fromMarkdownExtensions",Kz),Uh(t,"toMarkdownExtensions",qz)},Yz=[bn("remarkHighlightMark",()=>Qz),ci("highlight",()=>({parseDOM:[{tag:"mark"}],toDOM:()=>["mark",0],parseMarkdown:{match:e=>e.type==="highlight",runner:(e,t,n)=>{e.openMark(n,{}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="highlight",runner:(e,t)=>{e.withMark(t,"highlight")}}}))].flat(),$z={doc:{id:"highlight",name:"高亮标记 (Highlight)",category:"inline",description:"使用 ==文本== 添加荧光笔黄色高亮背景",sampleMarkdown:"这里支持 ==重要结论== 与 ==关键观点== 的高亮展示。",syntaxGuide:"==高亮文本==",cssSelectors:["mark",".milkdown .editor mark"]},milkdownPlugins:Yz,defaultCss:`
702
+ .milkdown .editor mark {
703
+ background-color: #fff0a8;
704
+ color: inherit;
705
+ padding: 1px 3px;
706
+ border-radius: 2px;
707
+ }
708
+ `.trim()};function GS(e){return t=>{const n=t.type.spec.toDOM(t),{dom:r,contentDOM:i}=Yi.renderSpec(document,[n[0],n[1],["section",{"data-article-content":""},0]]),o=r;return e.prepare?.(o,{document}),o.firstElementChild?.setAttribute("contenteditable","false"),{dom:o,contentDOM:i,update:s=>s.type===t.type&&s.attrs.type===t.attrs.type&&s.attrs.title===t.attrs.title,ignoreMutation:s=>s.type!=="selection"&&!i.contains(s.target)}}}const kc={note:{title:"提示",icon:"💡",borderColor:"#3b82f6",bgColor:"rgba(59, 130, 246, 0.08)",textColor:"#1d4ed8"},tip:{title:"建议",icon:"✨",borderColor:"#10b981",bgColor:"rgba(16, 185, 129, 0.08)",textColor:"#047857"},important:{title:"重点",icon:"📌",borderColor:"#8b5cf6",bgColor:"rgba(139, 92, 246, 0.08)",textColor:"#6d28d9"},warning:{title:"警告",icon:"⚠️",borderColor:"#f59e0b",bgColor:"rgba(245, 158, 11, 0.08)",textColor:"#b45309"},caution:{title:"注意",icon:"🛑",borderColor:"#ef4444",bgColor:"rgba(239, 68, 68, 0.08)",textColor:"#b91c1c"}};function Zz(){return e=>{function t(n){if(!(!n||typeof n!="object")){if(n.type==="blockquote"&&Array.isArray(n.children)&&n.children.length>0){const r=n.children[0];if(r&&r.type==="paragraph"&&Array.isArray(r.children)&&r.children.length>0){const i=r.children[0];if(i&&i.type==="text"&&typeof i.value=="string"){const o=i.value.match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\](?:[ \t]+([^\r\n]+))?(?:\r?\n|$)/i);if(o){const s=o[1].toLowerCase(),a=o[2]?o[2].trim():"";i.value=i.value.slice(o[0].length),!i.value.trim()&&r.children.length>1?r.children.shift():!i.value.trim()&&r.children.length===1&&n.children.shift(),n.type="callout",n.calloutType=s,n.customTitle=a}}}}if(Array.isArray(n.children))for(const r of n.children)t(r)}}t(e)}}const jw=xt("callout",()=>({content:"block+",group:"block",defining:!0,attrs:{type:{default:"note"},title:{default:""}},parseDOM:[{tag:"section[data-wechat-node='callout']",contentElement:e=>e.querySelector("[data-article-content]")||e,getAttrs:e=>({type:e.getAttribute("data-callout-type")||"note",title:e.getAttribute("data-callout-title")||""})}],toDOM:e=>["section",{class:`wechat-callout wechat-callout-${e.attrs.type}`,"data-wechat-node":"callout","data-callout-type":e.attrs.type,...e.attrs.title?{"data-callout-title":e.attrs.title}:{}},0],parseMarkdown:{match:e=>e.type==="callout",runner:(e,t,n)=>{e.openNode(n,{type:t.calloutType||"note",title:t.customTitle||""}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="callout",runner:(e,t)=>{e.openNode("callout",void 0,{calloutType:t.attrs.type,customTitle:t.attrs.title}),e.next(t.content),e.closeNode()}}})),Xz=[bn("remarkCallout",()=>Zz),jw,tg(jw.node,()=>GS(QS))].flat(),QS={kind:"callout",selector:'section[data-wechat-node="callout"]',prepare(e,t){const n=e.getAttribute("data-callout-type")||"note",r=e.getAttribute("data-callout-title"),i=t.structure?.calloutPresets?.[n],s={...kc[n]||kc.note,...i};let a=s.icon,l=s.title;if(r&&r.trim()){const d=r.trim(),h=d.match(new RegExp("^((?:(?:\\p{Extended_Pictographic}|\\p{Emoji_Presentation})\\uFE0F?)+)\\s*(.*)$","u"));h?(a=h[1],l=h[2].trim()||s.title):l=d}const c=t.document.createElement("section");c.className="wechat-callout-header",c.setAttribute("data-wechat-node","callout-header"),c.style&&(c.style.color=s.textColor,c.style.fontSize="14px",c.style.fontWeight="bold",c.style.marginBottom="6px",c.style.lineHeight="1.4");const u=t.document.createElement("span");u.className="wechat-callout-icon",u.textContent=a,c.appendChild(u);const f=t.document.createElement("strong");f.className="wechat-callout-title",f.style&&(f.style.color=s.textColor,f.style.fontSize="14px",f.style.fontWeight="bold",f.style.display="inline-block",f.style.verticalAlign="middle"),f.textContent=l,c.appendChild(f),e.prepend(c)},finalize(e){const t=e.getAttribute("data-callout-type")||"note",n=kc[t]||kc.note;e.style&&(e.style.borderLeftColor=n.borderColor,e.style.backgroundColor=n.bgColor)}},eW={doc:{id:"callout",name:"提示卡片 (Callout)",category:"block",description:"使用 GFM 规范语法 (> [!NOTE]) 生成带左侧边框与图标的微信高亮卡片",sampleMarkdown:`> [!NOTE]
709
+ > 这里是一条标准提示,适用于操作备忘。
710
+
711
+ > [!TIP] 实用技巧
712
+ > 这是带自定义标题的建议卡片。
713
+
714
+ > [!WARNING] ⚠️ 重点防护
715
+ > 这是带自定义 Emoji 与标题的警告卡片。`,syntaxGuide:`> [!NOTE] 自定义标题 (可选,可包含 Emoji)
716
+ > 提示内容...`,cssSelectors:['section[data-wechat-node="callout"]',".wechat-callout",".wechat-callout-note",".wechat-callout-tip",".wechat-callout-warning"]},milkdownPlugins:Xz,wechatRenderer:QS,defaultCss:`
717
+ .milkdown .editor section[data-wechat-node="callout"],
718
+ .milkdown .editor .wechat-callout {
719
+ margin: 1.2em 0;
720
+ padding: 12px 16px;
721
+ border-radius: 6px;
722
+ border-left-width: 4px;
723
+ border-left-style: solid;
724
+ box-sizing: border-box;
725
+ }
726
+ .milkdown .editor .wechat-callout-note {
727
+ border-left-color: #3b82f6;
728
+ background-color: rgba(59, 130, 246, 0.08);
729
+ }
730
+ .milkdown .editor .wechat-callout-tip {
731
+ border-left-color: #10b981;
732
+ background-color: rgba(16, 185, 129, 0.08);
733
+ }
734
+ .milkdown .editor .wechat-callout-important {
735
+ border-left-color: #8b5cf6;
736
+ background-color: rgba(139, 92, 246, 0.08);
737
+ }
738
+ .milkdown .editor .wechat-callout-warning {
739
+ border-left-color: #f59e0b;
740
+ background-color: rgba(245, 158, 11, 0.08);
741
+ }
742
+ .milkdown .editor .wechat-callout-caution {
743
+ border-left-color: #ef4444;
744
+ background-color: rgba(239, 68, 68, 0.08);
745
+ }
746
+ .milkdown .editor section[data-wechat-node="callout-header"] {
747
+ font-size: 14px;
748
+ font-weight: bold;
749
+ margin-bottom: 6px;
750
+ line-height: 1.4;
751
+ }
752
+ .milkdown .editor .wechat-callout-icon {
753
+ font-family: -apple-system, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
754
+ font-size: 16px;
755
+ line-height: 1;
756
+ margin-right: 6px;
757
+ display: inline-block;
758
+ vertical-align: middle;
759
+ }
760
+ .milkdown .editor .wechat-callout p {
761
+ margin: 0.4em 0;
762
+ font-size: 15px;
763
+ line-height: 1.7;
764
+ }
765
+ `.trim()};function tW(){return e=>{function t(n){if(!(!n||typeof n!="object")){if((n.type==="paragraph"||n.type==="listItem"||n.type==="heading")&&Array.isArray(n.children)){const r=[];for(const i of n.children){if(i.type==="text"&&typeof i.value=="string"){const o=/\[\[kbd:([^\]]+)\]\]/g;let s=0,a,l=!1;for(;(a=o.exec(i.value))!==null;)l=!0,a.index>s&&r.push({type:"text",value:i.value.slice(s,a.index)}),r.push({type:"kbd",children:[{type:"text",value:a[1]}]}),s=o.lastIndex;if(l){s<i.value.length&&r.push({type:"text",value:i.value.slice(s)});continue}}r.push(i)}n.children=r}if(Array.isArray(n.children))for(const r of n.children)t(r)}}t(e)}}const nW=[bn("remarkKbd",()=>tW),ci("kbd",()=>({inclusive:!1,parseDOM:[{tag:"kbd"},{tag:"span[data-wechat-node='kbd']"}],toDOM:()=>["span",{class:"wechat-kbd","data-wechat-node":"kbd"},0],parseMarkdown:{match:e=>e.type==="kbd",runner:(e,t,n)=>{e.openMark(n,{}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="kbd",runner:(e,t)=>{e.withMark(t,"kbd")}}}))].flat(),rW={kind:"kbd",selector:'span[data-wechat-node="kbd"], kbd',finalize(e){if(e.tagName.toLowerCase()==="kbd"){const t=e.ownerDocument.createElement("span");for(const n of Array.from(e.attributes))t.setAttribute(n.name,n.value);for(;e.firstChild;)t.appendChild(e.firstChild);e.replaceWith(t)}}},iW={doc:{id:"kbd",name:"按键标记 (Keyboard Key)",category:"inline",description:"使用 [[kbd:按键]] 输出带轻拟物阴影的键盘按键胶囊",sampleMarkdown:"按下快捷键 [[kbd:Cmd]] + [[kbd:K]] 快速唤起全局指令台。",syntaxGuide:"[[kbd:按键名称]]",cssSelectors:['span[data-wechat-node="kbd"]',".wechat-kbd"]},milkdownPlugins:nW,wechatRenderer:rW,defaultCss:`
766
+ .milkdown .editor .wechat-kbd,
767
+ .milkdown .editor span[data-wechat-node="kbd"] {
768
+ display: inline-block;
769
+ padding: 2px 6px;
770
+ font-family: -apple-system, SFMono-Regular, Consolas, Menlo, monospace;
771
+ font-size: 0.85em;
772
+ line-height: 1.2;
773
+ color: #374151;
774
+ background-color: #f3f4f6;
775
+ border: 1px solid #d1d5db;
776
+ border-bottom-width: 2px;
777
+ border-radius: 4px;
778
+ margin: 0 2px;
779
+ box-sizing: border-box;
780
+ }
781
+ `.trim()};function oW(){return e=>{function t(n){if(!(!n||typeof n!="object")){if((n.type==="paragraph"||n.type==="listItem"||n.type==="heading")&&Array.isArray(n.children)){const r=[];for(const i of n.children){if(i.type==="text"&&typeof i.value=="string"){const o=/\[badge:(brand|success|warning|danger|info)\|([^\]]+)\]/gi;let s=0,a,l=!1;for(;(a=o.exec(i.value))!==null;){l=!0,a.index>s&&r.push({type:"text",value:i.value.slice(s,a.index)});const c=a[1].toLowerCase(),u=a[2];r.push({type:"badge",badgeType:c,children:[{type:"text",value:u}]}),s=o.lastIndex}if(l){s<i.value.length&&r.push({type:"text",value:i.value.slice(s)});continue}}r.push(i)}n.children=r}if(Array.isArray(n.children))for(const r of n.children)t(r)}}t(e)}}const sW=[bn("remarkBadge",()=>oW),ci("badge",()=>({inclusive:!1,attrs:{type:{default:"brand"}},parseDOM:[{tag:"span[data-wechat-node='badge']",getAttrs:e=>({type:e.getAttribute("data-badge-type")||"brand"})}],toDOM:e=>["span",{class:`wechat-badge wechat-badge-${e.attrs.type}`,"data-wechat-node":"badge","data-badge-type":e.attrs.type},0],parseMarkdown:{match:e=>e.type==="badge",runner:(e,t,n)=>{e.openMark(n,{type:t.badgeType||"brand"}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="badge",runner:(e,t)=>{e.withMark(t,"badge",void 0,{badgeType:t.attrs.type})}}}))].flat(),aW={kind:"badge",selector:'span[data-wechat-node="badge"]'},lW={doc:{id:"badge",name:"状态徽章 (Badge)",category:"inline",description:"使用 [badge:类型|文字] 插入圆角状态胶囊标签(支持 brand/success/warning/danger/info)",sampleMarkdown:"当前服务状态:[badge:success|运行正常],新版特性:[badge:brand|重点推荐]!",syntaxGuide:"[badge:类型|标签文字]",cssSelectors:['span[data-wechat-node="badge"]',".wechat-badge"]},milkdownPlugins:sW,wechatRenderer:aW,defaultCss:`
782
+ .milkdown .editor .wechat-badge,
783
+ .milkdown .editor span[data-wechat-node="badge"] {
784
+ display: inline-block;
785
+ padding: 1px 7px;
786
+ font-size: 0.78em;
787
+ font-weight: 600;
788
+ line-height: 1.4;
789
+ border-radius: 999px;
790
+ margin: 0 3px;
791
+ vertical-align: baseline;
792
+ box-sizing: border-box;
793
+ }
794
+ .milkdown .editor .wechat-badge-brand {
795
+ background-color: rgba(202, 96, 147, 0.12);
796
+ color: #a94473;
797
+ }
798
+ .milkdown .editor .wechat-badge-success {
799
+ background-color: #e8f6ec;
800
+ color: #2f7d4a;
801
+ }
802
+ .milkdown .editor .wechat-badge-warning {
803
+ background-color: #fef3c7;
804
+ color: #b45309;
805
+ }
806
+ .milkdown .editor .wechat-badge-danger {
807
+ background-color: #fee2e2;
808
+ color: #b91c1c;
809
+ }
810
+ .milkdown .editor .wechat-badge-info {
811
+ background-color: #eff6ff;
812
+ color: #1d4ed8;
813
+ }
814
+ `.trim()};function cW(e){const t=e.trim();return/^(?:\*{0,2}(?:文\s*[/::]|作者[::]|By\s+|执笔[::]|策划[::]|编辑[::])|预计阅读|阅读需|字数[::]|共\s*\d+\s*字)/i.test(t)}function uW(e){const t=e.trim();return/(?:欢迎关注|关注公众号|星标|不错过|点击右下角|扫码关注|关注我们|回复「)/i.test(t)}function fW(){return e=>{function t(n){if(!(!n||typeof n!="object")){if(n.type==="blockquote"&&Array.isArray(n.children)&&n.children.length>0){const r=n.children[0];if(r&&r.type==="paragraph"&&Array.isArray(r.children)&&r.children.length>0){const i=r.children[0];if(i&&i.type==="text"&&typeof i.value=="string"){const o=i.value.match(/^\[!(INTRO|PREFACE|CTA|OUTRO)\](?:[ \t]+([^\r\n]+))?(?:\r?\n|$)/i);if(o){const s=o[1].toUpperCase();let a="intro";(s==="CTA"||s==="OUTRO")&&(a="cta");const l=o[2]?o[2].trim():"";i.value=i.value.slice(o[0].length),!i.value.trim()&&r.children.length>1?r.children.shift():!i.value.trim()&&r.children.length===1&&n.children.shift(),n.type="articleCard",n.cardType=a,n.customTitle=l}}}}if(Array.isArray(n.children))for(const r of n.children)t(r)}}t(e)}}const Uw=xt("articleCard",()=>({content:"block+",group:"block",defining:!0,attrs:{type:{default:"intro"},title:{default:""}},parseDOM:[{tag:"section[data-wechat-node='article-card']",contentElement:e=>e.querySelector("[data-article-content]")||e,getAttrs:e=>({type:e.getAttribute("data-card-type")||"intro",title:e.getAttribute("data-card-title")||""})}],toDOM:e=>["section",{class:`wechat-article-card wechat-article-card-${e.attrs.type}`,"data-wechat-node":"article-card","data-card-type":e.attrs.type,...e.attrs.title?{"data-card-title":e.attrs.title}:{}},0],parseMarkdown:{match:e=>e.type==="articleCard",runner:(e,t,n)=>{e.openNode(n,{type:t.cardType||"intro",title:t.customTitle||""}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="articleCard",runner:(e,t)=>{e.openNode("articleCard",void 0,{cardType:t.attrs.type,customTitle:t.attrs.title}),e.next(t.content),e.closeNode()}}})),hW=[bn("remarkArticleCards",()=>fW),Uw,tg(Uw.node,()=>GS(YS))].flat(),YS={kind:"article-card",selector:'section[data-wechat-node="article-card"]',prepare(e,t){const n=e.getAttribute("data-card-type")||"intro",r=e.getAttribute("data-card-title")||"";if(n==="intro"){const i=t.document.createElement("section");i.className="wechat-card-eyebrow",i.setAttribute("data-wechat-node","card-eyebrow");const o=t.document.createElement("span");o.className="wechat-card-eyebrow-badge",o.setAttribute("data-wechat-node","card-eyebrow-badge");const s=t.document.createElement("span");s.className="wechat-card-eyebrow-icon",s.textContent="📖",o.appendChild(s);const a=t.document.createElement("span");a.className="wechat-card-eyebrow-label",a.textContent=r.trim()||"导读 · READING GUIDE",o.appendChild(a),i.appendChild(o),e.prepend(i);const l=Array.from(e.querySelectorAll("p"));for(const c of l){const u=c.textContent?.trim()||"";cW(u)?(c.className=(c.className?c.className+" ":"")+"wechat-intro-meta",c.setAttribute("data-wechat-node","intro-meta")):uW(u)&&(c.className=(c.className?c.className+" ":"")+"wechat-intro-guide",c.setAttribute("data-wechat-node","intro-guide"))}return}if(n==="cta"){const i=t.document.createElement("section");i.className="wechat-card-eyebrow",i.setAttribute("data-wechat-node","card-eyebrow");const o=t.document.createElement("span");o.className="wechat-card-eyebrow-badge",o.setAttribute("data-wechat-node","card-eyebrow-badge");const s=t.document.createElement("span");s.className="wechat-card-eyebrow-icon",s.textContent="✨",o.appendChild(s);const a=t.document.createElement("span");a.className="wechat-card-eyebrow-label",a.textContent=r.trim()||"互动交流 · CONNECT",o.appendChild(a),i.appendChild(o),e.prepend(i)}}},dW={doc:{id:"article-card",name:"篇章结构卡片 (Article Card)",category:"block",description:"专为文章开头的精修导读卡 (> [!INTRO]) 和结尾互动号召 (> [!CTA]) 设计的高级结构化卡片,去引用化设计,支持悬挂作者与元信息条、引导关注及精致小字排版",sampleMarkdown:`> [!INTRO] 导读
815
+ > **文 / Aatrox** · 预计阅读 5 分钟
816
+ >
817
+ > 本文系统解析工作流核心状态机与排版架构。从 AST 转换到微信安全内联,带你掌握定制化排版全流程。
818
+ >
819
+ > 💡 欢迎关注公众号「早早集市」,星标不错过每次更新。
820
+
821
+ > [!CTA] 欢迎交流与关注
822
+ > 如果这篇文章对你有所启发,欢迎点击右下角 **「点赞」** 和 **「在看」** 支持!`,syntaxGuide:`> [!INTRO] 自定义标题 (可选)
823
+ > **文 / 作者** · 预计阅读 5 分钟 (可选悬挂元信息)
824
+ > 导读正文...
825
+ > 💡 欢迎关注... (可选引导关注)
826
+
827
+ > [!CTA] 互动标题 (可选)
828
+ > 互动号召正文...`,cssSelectors:['section[data-wechat-node="article-card"]',".wechat-article-card",".wechat-article-card-intro",".wechat-article-card-cta",'section[data-wechat-node="card-eyebrow"]','span[data-wechat-node="card-eyebrow-badge"]','p[data-wechat-node="intro-meta"]','p[data-wechat-node="intro-guide"]']},milkdownPlugins:hW,wechatRenderer:YS,defaultCss:`
829
+ .milkdown .editor section[data-wechat-node="article-card"],
830
+ .milkdown .editor .wechat-article-card {
831
+ margin: 1.8em 0;
832
+ padding: 16px 20px;
833
+ border-radius: 10px;
834
+ box-sizing: border-box;
835
+ overflow: hidden;
836
+ }
837
+ .milkdown .editor .wechat-article-card-intro {
838
+ background-color: var(--wx-soft-surface, #faf8f9);
839
+ border: 1px solid var(--wx-divider, #eae4e7);
840
+ }
841
+ .milkdown .editor .wechat-article-card-cta {
842
+ background-color: rgba(202, 96, 147, 0.04);
843
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
844
+ text-align: center;
845
+ }
846
+ .milkdown .editor section[data-wechat-node="card-eyebrow"],
847
+ .milkdown .editor .wechat-card-eyebrow {
848
+ margin-bottom: 10px;
849
+ }
850
+ .milkdown .editor .wechat-article-card-cta section[data-wechat-node="card-eyebrow"],
851
+ .milkdown .editor .wechat-article-card-cta .wechat-card-eyebrow {
852
+ text-align: center;
853
+ }
854
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
855
+ .milkdown .editor .wechat-card-eyebrow-badge {
856
+ display: inline-block;
857
+ padding: 2px 8px;
858
+ border-radius: 4px;
859
+ background-color: rgba(202, 96, 147, 0.08);
860
+ color: var(--wx-brand-accent, #ca6093);
861
+ font-size: 11px;
862
+ font-weight: 700;
863
+ letter-spacing: 0.06em;
864
+ line-height: 1.5;
865
+ }
866
+ .milkdown .editor .wechat-card-eyebrow-icon {
867
+ margin-right: 4px;
868
+ font-size: 12px;
869
+ display: inline-block;
870
+ vertical-align: middle;
871
+ }
872
+ .milkdown .editor .wechat-card-eyebrow-label {
873
+ display: inline-block;
874
+ vertical-align: middle;
875
+ }
876
+ .milkdown .editor .wechat-article-card p {
877
+ margin: 0.4em 0;
878
+ font-size: 13px;
879
+ line-height: 1.72;
880
+ color: var(--wx-text-soft, #555555);
881
+ letter-spacing: 0.02em;
882
+ }
883
+ .milkdown .editor p[data-wechat-node="intro-meta"],
884
+ .milkdown .editor .wechat-intro-meta {
885
+ margin: 4px 0 10px 0 !important;
886
+ padding-bottom: 8px;
887
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
888
+ font-size: 12px !important;
889
+ color: var(--wx-muted-color, #756b6e) !important;
890
+ line-height: 1.5 !important;
891
+ }
892
+ .milkdown .editor p[data-wechat-node="intro-meta"] strong,
893
+ .milkdown .editor .wechat-intro-meta strong {
894
+ color: var(--wx-brand-accent, #ca6093);
895
+ font-weight: 600;
896
+ }
897
+ .milkdown .editor p[data-wechat-node="intro-guide"],
898
+ .milkdown .editor .wechat-intro-guide {
899
+ margin-top: 10px !important;
900
+ padding-top: 8px;
901
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
902
+ font-size: 12px !important;
903
+ color: var(--wx-brand-accent, #ca6093) !important;
904
+ line-height: 1.6 !important;
905
+ }
906
+ `.trim()};function pW(){const e=this.data(),t=(r,i,o)=>i.containerPhrasing(r,{...o,before:"",after:""}),n=(r,i,o,s)=>{const a=r.customTitle?` ${r.customTitle}`:"",l=i.containerFlow(r,o);return`> [!${s}]${a}
907
+ >
908
+ ${l.split(`
909
+ `).map(c=>c?`> ${c}`:">").join(`
910
+ `)}`};(e.toMarkdownExtensions??=[]).push({handlers:{callout:(r,i,o,s)=>n(r,o,s,r.calloutType.toUpperCase()),articleCard:(r,i,o,s)=>n(r,o,s,r.cardType==="cta"?"CTA":"INTRO"),kbd:(r,i,o,s)=>`[[kbd:${t(r,o,s)}]]`,badge:(r,i,o,s)=>`[badge:${r.badgeType}|${t(r,o,s)}]`}})}const mW=bn("remarkArticleSerialization",()=>pW);function gW(e){return[{pattern:/==([^=\n]+)==$/,name:"highlight",text:1},{pattern:/\[\[kbd:([^\]\n]+)\]\]$/,name:"kbd",text:1},{pattern:/\[badge:(brand|success|warning|danger|info)\|([^\]\n]+)\]$/i,name:"badge",text:2}].map(({pattern:t,name:n,text:r})=>new yn(t,(i,o,s,a)=>{const l=i.doc.resolve(s);if((l.parent.textBetween(0,l.parentOffset).match(/\\+$/)?.[0].length??0)%2)return null;const u=o[r],f=e.marks[n].create(n==="badge"?{type:o[1].toLowerCase()}:{});return i.tr.insertText(u,s,a).addMark(s,s+u.length,f).removeStoredMark(f.type)},{inCodeMark:!1}))}function AW(){return new An({props:{handleKeyDown(e,t){if(t.key!=="Enter"||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return!1;const{state:n}=e,{$from:r,empty:i}=n.selection;if(!i||r.parent.type.name!=="paragraph"||r.parentOffset!==r.parent.content.size)return!1;const o=r.parent.textContent.match(/^\[!(INTRO|PREFACE|CTA|OUTRO|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\](?:[ \t]+(.*))?$/i);if(!o)return!1;const s=o[1].toUpperCase(),a=["INTRO","PREFACE","CTA","OUTRO"].includes(s),l=n.schema.nodes[a?"articleCard":"callout"],c={type:a?["CTA","OUTRO"].includes(s)?"cta":"intro":s.toLowerCase(),title:o[2]?.trim()||""};let u=r.depth;u>1&&r.node(u-1).type.name==="blockquote"&&r.node(u-1).childCount===1&&u--;const f=r.before(u),d=n.tr.replaceWith(f,r.after(u),l.create(c,n.schema.nodes.paragraph.create()));return d.setSelection(_e.near(d.doc.resolve(f+2))),e.dispatch(d.scrollIntoView()),!0}}})}const yW=[fr(e=>dM({rules:gW(e.get(sr))})),fr(()=>AW())],bW=[$z,eW,iW,lW,dW],wW=[];function df(){return[...bW,...wW]}function aG(){return df().map(e=>e.doc)}function lG(){const e=[...mW,...yW];for(const t of df())e.push(...t.milkdownPlugins);return e}function xW(){const e=[];for(const t of df())t.wechatRenderer&&e.push(t.wechatRenderer);return e}function kW(){const e=[];for(const t of df())t.defaultCss&&e.push(t.defaultCss);return e.join(`
911
+
912
+ `)}const CW={_useHtmlParser2:!1};function Jp(e,t){if(!e)return t??CW;const n={_useHtmlParser2:!!e.xmlMode,...t,...e};return e.xml?(n._useHtmlParser2=!0,n.xmlMode=!0,e.xml!==!0&&Object.assign(n,e.xml)):e.xmlMode&&(n._useHtmlParser2=!0),n}var Qe;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(Qe||(Qe={}));function vW(e){return e.type===Qe.Tag||e.type===Qe.Script||e.type===Qe.Style}const uA=Qe.Root,$S=Qe.Text,SW=Qe.Directive,ZS=Qe.Comment,IW=Qe.Script,EW=Qe.Style,Vp=Qe.Tag,TW=Qe.CDATA,RW=Qe.Doctype;class XS{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return sl(this,t)}}class fA extends XS{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}let vu=class extends fA{constructor(){super(...arguments),this.type=Qe.Text}get nodeType(){return 3}},eI=class extends fA{constructor(){super(...arguments),this.type=Qe.Comment}get nodeType(){return 8}};class tI extends fA{constructor(t,n){super(n),this.name=t,this.type=Qe.Directive}get nodeType(){return 1}}class hA extends XS{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}}class nI extends hA{constructor(){super(...arguments),this.type=Qe.CDATA}get nodeType(){return 4}}class ol extends hA{constructor(){super(...arguments),this.type=Qe.Root}get nodeType(){return 9}}let rI=class extends hA{constructor(t,n,r=[],i=t==="script"?Qe.Script:t==="style"?Qe.Style:Qe.Tag){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,r;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(r=this["x-attribsPrefix"])===null||r===void 0?void 0:r[t]}})}};function Ie(e){return vW(e)}function pf(e){return e.type===Qe.CDATA}function Ko(e){return e.type===Qe.Text}function dA(e){return e.type===Qe.Comment}function _W(e){return e.type===Qe.Directive}function Qo(e){return e.type===Qe.Root}function Ct(e){return Object.prototype.hasOwnProperty.call(e,"children")}function sl(e,t=!1){let n;if(Ko(e))n=new vu(e.data);else if(dA(e))n=new eI(e.data);else if(Ie(e)){const r=t?Hh(e.children):[],i=new rI(e.name,{...e.attribs},r);r.forEach(o=>o.parent=i),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...e["x-attribsPrefix"]}),n=i}else if(pf(e)){const r=t?Hh(e.children):[],i=new nI(r);r.forEach(o=>o.parent=i),n=i}else if(Qo(e)){const r=t?Hh(e.children):[],i=new ol(r);r.forEach(o=>o.parent=i),e["x-mode"]&&(i["x-mode"]=e["x-mode"]),n=i}else if(_W(e)){const r=new tI(e.name,e.data);e["x-name"]!=null&&(r["x-name"]=e["x-name"],r["x-publicId"]=e["x-publicId"],r["x-systemId"]=e["x-systemId"]),n=r}else throw new Error(`Not implemented yet: ${e.type}`);return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function Hh(e){const t=e.map(n=>sl(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}const Hw={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class NW{constructor(t,n,r){this.dom=[],this.root=new ol(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(r=n,n=Hw),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??Hw,this.elementCB=r??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new ol(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;const t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){const r=this.options.xmlMode?Qe.Tag:void 0,i=new rI(t,n,void 0,r);this.addNode(i),this.tagStack.push(i)}ontext(t){const{lastNode:n}=this;if(n&&n.type===Qe.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{const r=new vu(t);this.addNode(r),this.lastNode=r}}oncomment(t){if(this.lastNode&&this.lastNode.type===Qe.Comment){this.lastNode.data+=t;return}const n=new eI(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){const t=new vu(""),n=new nI([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){const r=new tI(t,n);this.addNode(r)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){const n=this.tagStack[this.tagStack.length-1],r=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),r&&(t.prev=r,r.next=t),t.parent=n,this.lastNode=null}}const Kw=/["&'<>$\x80-\uFFFF]/g,OW=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),DW=String.prototype.codePointAt!=null?(e,t)=>e.codePointAt(t):(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function iI(e){let t="",n=0,r;for(;(r=Kw.exec(e))!==null;){const i=r.index,o=e.charCodeAt(i),s=OW.get(o);s!==void 0?(t+=e.substring(n,i)+s,n=i+1):(t+=`${e.substring(n,i)}&#x${DW(e,i).toString(16)};`,n=Kw.lastIndex+=+((o&64512)===55296))}return t+e.substr(n)}function oI(e,t){return function(r){let i,o=0,s="";for(;i=e.exec(r);)o!==i.index&&(s+=r.substring(o,i.index)),s+=t.get(i[0].charCodeAt(0)),o=i.index+1;return s+r.substring(o)}}const MW=oI(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),BW=oI(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),PW=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","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","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),FW=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),LW=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function zW(e){return e.replace(/"/g,"&quot;")}function WW(e,t){var n;if(!e)return;const r=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?zW:t.xmlMode||t.encodeEntities!=="utf8"?iI:MW;return Object.keys(e).map(i=>{var o,s;const a=(o=e[i])!==null&&o!==void 0?o:"";return t.xmlMode==="foreign"&&(i=(s=FW.get(i))!==null&&s!==void 0?s:i),!t.emptyAttrs&&!t.xmlMode&&a===""?i:`${i}="${r(a)}"`}).join(" ")}const Jw=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function mf(e,t={}){const n="length"in e?e:[e];let r="";for(let i=0;i<n.length;i++)r+=jW(n[i],t);return r}function jW(e,t){switch(e.type){case uA:return mf(e.children,t);case RW:case SW:return JW(e);case ZS:return GW(e);case TW:return qW(e);case IW:case EW:case Vp:return KW(e,t);case $S:return VW(e,t)}}const UW=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),HW=new Set(["svg","math"]);function KW(e,t){var n;t.xmlMode==="foreign"&&(e.name=(n=PW.get(e.name))!==null&&n!==void 0?n:e.name,e.parent&&UW.has(e.parent.name)&&(t={...t,xmlMode:!1})),!t.xmlMode&&HW.has(e.name)&&(t={...t,xmlMode:"foreign"});let r=`<${e.name}`;const i=WW(e.attribs,t);return i&&(r+=` ${i}`),e.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&Jw.has(e.name))?(t.xmlMode||(r+=" "),r+="/>"):(r+=">",e.children.length>0&&(r+=mf(e.children,t)),(t.xmlMode||!Jw.has(e.name))&&(r+=`</${e.name}>`)),r}function JW(e){return`<${e.data}>`}function VW(e,t){var n;let r=e.data||"";return((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&LW.has(e.parent.name))&&(r=t.xmlMode||t.encodeEntities!=="utf8"?iI(r):BW(r)),r}function qW(e){return`<![CDATA[${e.children[0].data}]]>`}function GW(e){return`<!--${e.data}-->`}function sI(e,t){return mf(e,t)}function QW(e,t){return Ct(e)?e.children.map(n=>sI(n,t)).join(""):""}function Xc(e){return Array.isArray(e)?e.map(Xc).join(""):Ie(e)?e.name==="br"?`
913
+ `:Xc(e.children):pf(e)?Xc(e.children):Ko(e)?e.data:""}function Ws(e){return Array.isArray(e)?e.map(Ws).join(""):Ct(e)&&!dA(e)?Ws(e.children):Ko(e)?e.data:""}function Su(e){return Array.isArray(e)?e.map(Su).join(""):Ct(e)&&(e.type===Qe.Tag||pf(e))?Su(e.children):Ko(e)?e.data:""}function gf(e){return Ct(e)?e.children:[]}function aI(e){return e.parent||null}function lI(e){const t=aI(e);if(t!=null)return gf(t);const n=[e];let{prev:r,next:i}=e;for(;r!=null;)n.unshift(r),{prev:r}=r;for(;i!=null;)n.push(i),{next:i}=i;return n}function YW(e,t){var n;return(n=e.attribs)===null||n===void 0?void 0:n[t]}function $W(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function ZW(e){return e.name}function pA(e){let{next:t}=e;for(;t!==null&&!Ie(t);)({next:t}=t);return t}function mA(e){let{prev:t}=e;for(;t!==null&&!Ie(t);)({prev:t}=t);return t}function Yo(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){const t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function XW(e,t){const n=t.prev=e.prev;n&&(n.next=t);const r=t.next=e.next;r&&(r.prev=t);const i=t.parent=e.parent;if(i){const o=i.children;o[o.lastIndexOf(e)]=t,e.parent=null}}function ej(e,t){if(Yo(t),t.next=null,t.parent=e,e.children.push(t)>1){const n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null}function tj(e,t){Yo(t);const{parent:n}=e,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){const i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else n&&n.children.push(t)}function nj(e,t){if(Yo(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){const n=e.children[1];n.prev=t,t.next=n}else t.next=null}function rj(e,t){Yo(t);const{parent:n}=e;if(n){const r=n.children;r.splice(r.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}function ql(e,t,n=!0,r=1/0){return gA(e,Array.isArray(t)?t:[t],n,r)}function gA(e,t,n,r){const i=[],o=[Array.isArray(t)?t:[t]],s=[0];for(;;){if(s[0]>=o[0].length){if(s.length===1)return i;o.shift(),s.shift();continue}const a=o[0][s[0]++];if(e(a)&&(i.push(a),--r<=0))return i;n&&Ct(a)&&a.children.length>0&&(s.unshift(0),o.unshift(a.children))}}function ij(e,t){return t.find(e)}function AA(e,t,n=!0){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const o=r[i];if(Ie(o)&&e(o))return o;if(n&&Ct(o)&&o.children.length>0){const s=AA(e,o.children,!0);if(s)return s}}return null}function cI(e,t){return(Array.isArray(t)?t:[t]).some(n=>Ie(n)&&e(n)||Ct(n)&&cI(e,n.children))}function oj(e,t){const n=[],r=[Array.isArray(t)?t:[t]],i=[0];for(;;){if(i[0]>=r[0].length){if(r.length===1)return n;r.shift(),i.shift();continue}const o=r[0][i[0]++];Ie(o)&&e(o)&&n.push(o),Ct(o)&&o.children.length>0&&(i.unshift(0),r.unshift(o.children))}}const Iu={tag_name(e){return typeof e=="function"?t=>Ie(t)&&e(t.name):e==="*"?Ie:t=>Ie(t)&&t.name===e},tag_type(e){return typeof e=="function"?t=>e(t.type):t=>t.type===e},tag_contains(e){return typeof e=="function"?t=>Ko(t)&&e(t.data):t=>Ko(t)&&t.data===e}};function yA(e,t){return typeof t=="function"?n=>Ie(n)&&t(n.attribs[e]):n=>Ie(n)&&n.attribs[e]===t}function sj(e,t){return n=>e(n)||t(n)}function uI(e){const t=Object.keys(e).map(n=>{const r=e[n];return Object.prototype.hasOwnProperty.call(Iu,n)?Iu[n](r):yA(n,r)});return t.length===0?null:t.reduce(sj)}function aj(e,t){const n=uI(e);return n?n(t):!0}function lj(e,t,n,r=1/0){const i=uI(e);return i?ql(i,t,n,r):[]}function cj(e,t,n=!0){return Array.isArray(t)||(t=[t]),AA(yA("id",e),t,n)}function Gs(e,t,n=!0,r=1/0){return ql(Iu.tag_name(e),t,n,r)}function uj(e,t,n=!0,r=1/0){return ql(yA("class",e),t,n,r)}function fj(e,t,n=!0,r=1/0){return ql(Iu.tag_type(e),t,n,r)}function hj(e){let t=e.length;for(;--t>=0;){const n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(let r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e}var Kn;(function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"})(Kn||(Kn={}));function fI(e,t){const n=[],r=[];if(e===t)return 0;let i=Ct(e)?e:e.parent;for(;i;)n.unshift(i),i=i.parent;for(i=Ct(t)?t:t.parent;i;)r.unshift(i),i=i.parent;const o=Math.min(n.length,r.length);let s=0;for(;s<o&&n[s]===r[s];)s++;if(s===0)return Kn.DISCONNECTED;const a=n[s-1],l=a.children,c=n[s],u=r[s];return l.indexOf(c)>l.indexOf(u)?a===t?Kn.FOLLOWING|Kn.CONTAINED_BY:Kn.FOLLOWING:a===e?Kn.PRECEDING|Kn.CONTAINS:Kn.PRECEDING}function Qs(e){return e=e.filter((t,n,r)=>!r.includes(t,n+1)),e.sort((t,n)=>{const r=fI(t,n);return r&Kn.PRECEDING?-1:r&Kn.FOLLOWING?1:0}),e}function dj(e){const t=Eu(yj,e);return t?t.name==="feed"?pj(t):mj(t):null}function pj(e){var t;const n=e.children,r={type:"atom",items:Gs("entry",n).map(s=>{var a;const{children:l}=s,c={media:hI(l)};Sn(c,"id","id",l),Sn(c,"title","title",l);const u=(a=Eu("link",l))===null||a===void 0?void 0:a.attribs.href;u&&(c.link=u);const f=Wi("summary",l)||Wi("content",l);f&&(c.description=f);const d=Wi("updated",l);return d&&(c.pubDate=new Date(d)),c})};Sn(r,"id","id",n),Sn(r,"title","title",n);const i=(t=Eu("link",n))===null||t===void 0?void 0:t.attribs.href;i&&(r.link=i),Sn(r,"description","subtitle",n);const o=Wi("updated",n);return o&&(r.updated=new Date(o)),Sn(r,"author","email",n,!0),r}function mj(e){var t,n;const r=(n=(t=Eu("channel",e.children))===null||t===void 0?void 0:t.children)!==null&&n!==void 0?n:[],i={type:e.name.substr(0,3),id:"",items:Gs("item",e.children).map(s=>{const{children:a}=s,l={media:hI(a)};Sn(l,"id","guid",a),Sn(l,"title","title",a),Sn(l,"link","link",a),Sn(l,"description","description",a);const c=Wi("pubDate",a)||Wi("dc:date",a);return c&&(l.pubDate=new Date(c)),l})};Sn(i,"title","title",r),Sn(i,"link","link",r),Sn(i,"description","description",r);const o=Wi("lastBuildDate",r);return o&&(i.updated=new Date(o)),Sn(i,"author","managingEditor",r,!0),i}const gj=["url","type","lang"],Aj=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function hI(e){return Gs("media:content",e).map(t=>{const{attribs:n}=t,r={medium:n.medium,isDefault:!!n.isDefault};for(const i of gj)n[i]&&(r[i]=n[i]);for(const i of Aj)n[i]&&(r[i]=parseInt(n[i],10));return n.expression&&(r.expression=n.expression),r})}function Eu(e,t){return Gs(e,t,!0,1)[0]}function Wi(e,t,n=!1){return Ws(Gs(e,t,n,1)).trim()}function Sn(e,t,n,r,i=!1){const o=Wi(n,r,i);o&&(e[t]=o)}function yj(e){return e==="rss"||e==="feed"||e==="rdf:RDF"}const Af=Object.freeze(Object.defineProperty({__proto__:null,get DocumentPosition(){return Kn},append:tj,appendChild:ej,compareDocumentPosition:fI,existsOne:cI,filter:ql,find:gA,findAll:oj,findOne:AA,findOneChild:ij,getAttributeValue:YW,getChildren:gf,getElementById:cj,getElements:lj,getElementsByClassName:uj,getElementsByTagName:Gs,getElementsByTagType:fj,getFeed:dj,getInnerHTML:QW,getName:ZW,getOuterHTML:sI,getParent:aI,getSiblings:lI,getText:Xc,hasAttrib:$W,hasChildren:Ct,innerText:Su,isCDATA:pf,isComment:dA,isDocument:Qo,isTag:Ie,isText:Ko,nextElementSibling:pA,prepend:rj,prependChild:nj,prevElementSibling:mA,removeElement:Yo,removeSubsets:hj,replaceElement:XW,testElement:aj,textContent:Ws,uniqueSort:Qs},Symbol.toStringTag,{value:"Module"}));function dI(e,t,n){return e?e(t??e._root.children,null,void 0,n).toString():""}function bj(e,t){return typeof e=="object"&&e!=null&&!("length"in e)&&!("type"in e)}function wj(e,t){const n=bj(e)?(t=e,void 0):e,r={...this===null||this===void 0?void 0:this._options,...Jp(t)};return dI(this,n,r)}function xj(e){const t={...this._options,xmlMode:!0};return dI(this,e,t)}function al(e){const t=e??(this?this.root():[]);let n="";for(let r=0;r<t.length;r++)n+=Ws(t[r]);return n}function kj(e,t,n=typeof t=="boolean"?t:!1){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t);const r=this.load(e,this._options,!1);return n||r("script").remove(),[...r.root()[0].children]}function Cj(){return this(this._root)}function pI(e,t){if(t===e)return!1;let n=t;for(;n&&n!==n.parent;)if(n=n.parent,n===e)return!0;return!1}function vj(e){return this.root().extract(e)}function Sj(e,t){if(!Vw(e)||!Vw(t))return;let n=e.length;const r=+t.length;for(let i=0;i<r;i++)e[n++]=t[i];return e.length=n,e}function Vw(e){if(Array.isArray(e))return!0;if(typeof e!="object"||e===null||!("length"in e)||typeof e.length!="number"||e.length<0)return!1;for(let t=0;t<e.length;t++)if(!(t in e))return!1;return!0}const Ij=Object.freeze(Object.defineProperty({__proto__:null,contains:pI,extract:vj,html:wj,merge:Sj,parseHTML:kj,root:Cj,text:al,xml:xj},Symbol.toStringTag,{value:"Module"}));function ii(e){return e.cheerio!=null}function Ej(e){return e.replace(/[._-](\w|$)/g,(t,n)=>n.toUpperCase())}function Tj(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase()}function yt(e,t){const n=e.length;for(let r=0;r<n;r++)t(e[r],r);return e}var Ao;(function(e){e[e.LowerA=97]="LowerA",e[e.LowerZ=122]="LowerZ",e[e.UpperA=65]="UpperA",e[e.UpperZ=90]="UpperZ",e[e.Exclamation=33]="Exclamation"})(Ao||(Ao={}));function qp(e){if(typeof e!="string")return!1;const t=e.indexOf("<");if(t===-1||t>e.length-3)return!1;const n=e.charCodeAt(t+1);return(n>=Ao.LowerA&&n<=Ao.LowerZ||n>=Ao.UpperA&&n<=Ao.UpperZ||n===Ao.Exclamation)&&e.includes(">",t+2)}var Kh;const Rj=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),qw=(Kh=String.fromCodePoint)!==null&&Kh!==void 0?Kh:(e=>{let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function _j(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Rj.get(e))!==null&&t!==void 0?t:e}function mI(e){const t=typeof atob=="function"?atob(e):typeof Buffer.from=="function"?Buffer.from(e,"base64").toString("binary"):new Buffer(e,"base64").toString("binary"),n=t.length&-2,r=new Uint16Array(n/2);for(let i=0,o=0;i<n;i+=2){const s=t.charCodeAt(i),a=t.charCodeAt(i+1);r[o++]=s|a<<8}return r}const Nj=mI("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg"),Oj=mI("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var ln;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ln||(ln={}));var At;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(At||(At={}));const Gw=32;function Gp(e){return e>=At.ZERO&&e<=At.NINE}function Dj(e){return e>=At.UPPER_A&&e<=At.UPPER_F||e>=At.LOWER_A&&e<=At.LOWER_F}function Mj(e){return e>=At.UPPER_A&&e<=At.UPPER_Z||e>=At.LOWER_A&&e<=At.LOWER_Z||Gp(e)}function Bj(e){return e===At.EQUALS||Mj(e)}var Bt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Bt||(Bt={}));var Cr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Cr||(Cr={}));class Pj{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Bt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Cr.Strict,this.runConsumed=0}startEntity(t){this.decodeMode=t,this.state=Bt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case Bt.EntityStart:return t.charCodeAt(n)===At.NUM?(this.state=Bt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Bt.NamedEntity,this.stateNamedEntity(t,n));case Bt.NumericStart:return this.stateNumericStart(t,n);case Bt.NumericDecimal:return this.stateNumericDecimal(t,n);case Bt.NumericHex:return this.stateNumericHex(t,n);case Bt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Gw)===At.LOWER_X?(this.state=Bt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Bt.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Gp(r)||Dj(r)){const i=r<=At.NINE?r-At.ZERO:(r|Gw)-At.LOWER_A+10;this.result=this.result*16+i,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Gp(r))this.result=this.result*10+(r-At.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===At.SEMI)this.consumed+=1;else if(this.decodeMode===Cr.Strict)return 0;return this.emitCodePoint(_j(this.result),this.consumed),this.errors&&(t!==At.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&ln.VALUE_LENGTH)>>14;for(;n<t.length;){if(o===0&&(i&ln.FLAG13)!==0){const a=(i&ln.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const l=i&ln.JUMP_TABLE;if(t.charCodeAt(n)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const l=this.runConsumed-1,c=r[this.treeIndex+1+(l>>1)],u=l%2===0?c&255:c>>8&255;if(t.charCodeAt(n)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),i=r[this.treeIndex],o=(i&ln.VALUE_LENGTH)>>14}if(n>=t.length)break;const s=t.charCodeAt(n);if(s===At.SEMI&&o!==0&&(i&ln.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Fj(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Cr.Attribute&&(o===0||Bj(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&ln.VALUE_LENGTH)>>14,o!==0){if(s===At.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Cr.Strict&&(i&ln.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&ln.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~(ln.VALUE_LENGTH|ln.FLAG13):i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Bt.NamedEntity:return this.result!==0&&(this.decodeMode!==Cr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Bt.NumericDecimal:return this.emitNumericEntity(0,2);case Bt.NumericHex:return this.emitNumericEntity(0,3);case Bt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Bt.EntityStart:return 0}}}function Fj(e,t,n,r){const i=(t&ln.BRANCH_LENGTH)>>7,o=t&ln.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const c=r-o;return c<0||c>=i?-1:e[n+c]-1}const s=i+1>>1;let a=0,l=i-1;for(;a<=l;){const c=a+l>>>1,u=c>>1,d=e[n+u]>>(c&1)*8&255;if(d<r)a=c+1;else if(d>r)l=c-1;else return e[n+s+c]}return-1}var xe;(function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"})(xe||(xe={}));var ie;(function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"})(ie||(ie={}));function Kr(e){return e===xe.Space||e===xe.NewLine||e===xe.Tab||e===xe.FormFeed||e===xe.CarriageReturn}function Cc(e){return e===xe.Slash||e===xe.Gt||Kr(e)}function Lj(e){return e>=xe.LowerA&&e<=xe.LowerZ||e>=xe.UpperA&&e<=xe.UpperZ}var vr;(function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"})(vr||(vr={}));const vt={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};class zj{constructor({xmlMode:t=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=ie.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=ie.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=t,this.decodeEntities=n,this.entityDecoder=new Pj(t?Oj:Nj,(i,o)=>this.emitCodePoint(i,o))}reset(){this.state=ie.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ie.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(t){t===xe.Lt||!this.decodeEntities&&this.fastForwardTo(xe.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ie.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===xe.Amp&&this.startEntity()}stateSpecialStartSequence(t){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Cc(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=ie.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===xe.Gt||Kr(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(t);return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===vt.TitleEnd?this.decodeEntities&&t===xe.Amp&&this.startEntity():this.fastForwardTo(xe.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===xe.Lt)}stateCDATASequence(t){t===vt.Cdata[this.sequenceIndex]?++this.sequenceIndex===vt.Cdata.length&&(this.state=ie.InCommentLike,this.currentSequence=vt.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=ie.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===vt.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=ie.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!Cc(t):Lj(t)}startSpecial(t,n){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=n,this.state=ie.SpecialStartSequence}stateBeforeTagName(t){if(t===xe.ExclamationMark)this.state=ie.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===xe.Questionmark)this.state=ie.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){const n=t|32;this.sectionStart=this.index,this.xmlMode?this.state=ie.InTagName:n===vt.ScriptEnd[2]?this.state=ie.BeforeSpecialS:n===vt.TitleEnd[2]||n===vt.XmpEnd[2]?this.state=ie.BeforeSpecialT:this.state=ie.InTagName}else t===xe.Slash?this.state=ie.BeforeClosingTagName:(this.state=ie.Text,this.stateText(t))}stateInTagName(t){Cc(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=ie.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){Kr(t)||(t===xe.Gt?this.state=ie.Text:(this.state=this.isTagStartChar(t)?ie.InClosingTagName:ie.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===xe.Gt||Kr(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=ie.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===xe.Gt||this.fastForwardTo(xe.Gt))&&(this.state=ie.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===xe.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=ie.InSpecialTag,this.sequenceIndex=0):this.state=ie.Text,this.sectionStart=this.index+1):t===xe.Slash?this.state=ie.InSelfClosingTag:Kr(t)||(this.state=ie.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===xe.Gt?(this.cbs.onselfclosingtag(this.index),this.state=ie.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Kr(t)||(this.state=ie.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===xe.Eq||Cc(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=ie.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===xe.Eq?this.state=ie.BeforeAttributeValue:t===xe.Slash||t===xe.Gt?(this.cbs.onattribend(vr.NoValue,this.sectionStart),this.sectionStart=-1,this.state=ie.BeforeAttributeName,this.stateBeforeAttributeName(t)):Kr(t)||(this.cbs.onattribend(vr.NoValue,this.sectionStart),this.state=ie.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===xe.DoubleQuote?(this.state=ie.InAttributeValueDq,this.sectionStart=this.index+1):t===xe.SingleQuote?(this.state=ie.InAttributeValueSq,this.sectionStart=this.index+1):Kr(t)||(this.sectionStart=this.index,this.state=ie.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,n){t===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===xe.DoubleQuote?vr.Double:vr.Single,this.index+1),this.state=ie.BeforeAttributeName):this.decodeEntities&&t===xe.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,xe.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,xe.SingleQuote)}stateInAttributeValueNoQuotes(t){Kr(t)||t===xe.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(vr.Unquoted,this.index),this.state=ie.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===xe.Amp&&this.startEntity()}stateBeforeDeclaration(t){t===xe.OpeningSquareBracket?(this.state=ie.CDATASequence,this.sequenceIndex=0):this.state=t===xe.Dash?ie.BeforeComment:ie.InDeclaration}stateInDeclaration(t){(t===xe.Gt||this.fastForwardTo(xe.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=ie.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===xe.Gt||this.fastForwardTo(xe.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=ie.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===xe.Dash?(this.state=ie.InCommentLike,this.currentSequence=vt.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=ie.InDeclaration}stateInSpecialComment(t){(t===xe.Gt||this.fastForwardTo(xe.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ie.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){const n=t|32;n===vt.ScriptEnd[3]?this.startSpecial(vt.ScriptEnd,4):n===vt.StyleEnd[3]?this.startSpecial(vt.StyleEnd,4):(this.state=ie.InTagName,this.stateInTagName(t))}stateBeforeSpecialT(t){switch(t|32){case vt.TitleEnd[3]:{this.startSpecial(vt.TitleEnd,4);break}case vt.TextareaEnd[3]:{this.startSpecial(vt.TextareaEnd,4);break}case vt.XmpEnd[3]:{this.startSpecial(vt.XmpEnd,4);break}default:this.state=ie.InTagName,this.stateInTagName(t)}}startEntity(){this.baseState=this.state,this.state=ie.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?Cr.Strict:this.baseState===ie.Text||this.baseState===ie.InSpecialTag?Cr.Legacy:Cr.Attribute)}stateInEntity(){const t=this.index-this.offset,n=this.entityDecoder.write(this.buffer,t);if(n>=0)this.state=this.baseState,n===0&&(this.index-=1);else{if(t<this.buffer.length&&this.buffer.charCodeAt(t)===xe.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===ie.Text||this.state===ie.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===ie.InAttributeValueDq||this.state===ie.InAttributeValueSq||this.state===ie.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const t=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case ie.Text:{this.stateText(t);break}case ie.SpecialStartSequence:{this.stateSpecialStartSequence(t);break}case ie.InSpecialTag:{this.stateInSpecialTag(t);break}case ie.CDATASequence:{this.stateCDATASequence(t);break}case ie.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(t);break}case ie.InAttributeName:{this.stateInAttributeName(t);break}case ie.InCommentLike:{this.stateInCommentLike(t);break}case ie.InSpecialComment:{this.stateInSpecialComment(t);break}case ie.BeforeAttributeName:{this.stateBeforeAttributeName(t);break}case ie.InTagName:{this.stateInTagName(t);break}case ie.InClosingTagName:{this.stateInClosingTagName(t);break}case ie.BeforeTagName:{this.stateBeforeTagName(t);break}case ie.AfterAttributeName:{this.stateAfterAttributeName(t);break}case ie.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(t);break}case ie.BeforeAttributeValue:{this.stateBeforeAttributeValue(t);break}case ie.BeforeClosingTagName:{this.stateBeforeClosingTagName(t);break}case ie.AfterClosingTagName:{this.stateAfterClosingTagName(t);break}case ie.BeforeSpecialS:{this.stateBeforeSpecialS(t);break}case ie.BeforeSpecialT:{this.stateBeforeSpecialT(t);break}case ie.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(t);break}case ie.InSelfClosingTag:{this.stateInSelfClosingTag(t);break}case ie.InDeclaration:{this.stateInDeclaration(t);break}case ie.BeforeDeclaration:{this.stateBeforeDeclaration(t);break}case ie.BeforeComment:{this.stateBeforeComment(t);break}case ie.InProcessingInstruction:{this.stateInProcessingInstruction(t);break}case ie.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===ie.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const t=this.buffer.length+this.offset;this.sectionStart>=t||(this.state===ie.InCommentLike?this.currentSequence===vt.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===ie.InTagName||this.state===ie.BeforeAttributeName||this.state===ie.BeforeAttributeValue||this.state===ie.AfterAttributeName||this.state===ie.InAttributeName||this.state===ie.InAttributeValueSq||this.state===ie.InAttributeValueDq||this.state===ie.InAttributeValueNq||this.state===ie.InClosingTagName||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,n){this.baseState!==ie.Text&&this.baseState!==ie.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(t)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(t,this.sectionStart))}}const ls=new Set(["input","option","optgroup","select","button","datalist","textarea"]),rt=new Set(["p"]),Qw=new Set(["thead","tbody"]),Yw=new Set(["dd","dt"]),$w=new Set(["rt","rp"]),Wj=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",rt],["h1",rt],["h2",rt],["h3",rt],["h4",rt],["h5",rt],["h6",rt],["select",ls],["input",ls],["output",ls],["button",ls],["datalist",ls],["textarea",ls],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Yw],["dt",Yw],["address",rt],["article",rt],["aside",rt],["blockquote",rt],["details",rt],["div",rt],["dl",rt],["fieldset",rt],["figcaption",rt],["figure",rt],["footer",rt],["form",rt],["header",rt],["hr",rt],["main",rt],["nav",rt],["ol",rt],["pre",rt],["section",rt],["table",rt],["ul",rt],["rt",$w],["rp",$w],["tbody",Qw],["tfoot",Qw]]),jj=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),Zw=new Set(["math","svg"]),Xw=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Uj=/\s|\//;class Hj{constructor(t,n={}){var r,i,o,s,a,l;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(o=n.recognizeSelfClosing)!==null&&o!==void 0?o:!this.htmlMode,this.tokenizer=new((s=n.Tokenizer)!==null&&s!==void 0?s:zj)(this.options,this),this.foreignContext=[!this.htmlMode],(l=(a=this.cbs).onparserinit)===null||l===void 0||l.call(a,this)}ontext(t,n){var r,i;const o=this.getSlice(t,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,o),this.startIndex=n}ontextentity(t,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,qw(t)),this.startIndex=n}isVoidElement(t){return this.htmlMode&&jj.has(t)}onopentagname(t,n){this.endIndex=n;let r=this.getSlice(t,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(t){var n,r,i,o;this.openTagStart=this.startIndex,this.tagname=t;const s=this.htmlMode&&Wj.get(t);if(s)for(;this.stack.length>0&&s.has(this.stack[0]);){const a=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,a,!0)}this.isVoidElement(t)||(this.stack.unshift(t),this.htmlMode&&(Zw.has(t)?this.foreignContext.unshift(!0):Xw.has(t)&&this.foreignContext.unshift(!1))),(o=(i=this.cbs).onopentagname)===null||o===void 0||o.call(i,t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){var r,i,o,s,a,l,c,u;this.endIndex=n;let f=this.getSlice(t,n);if(this.lowerCaseTagNames&&(f=f.toLowerCase()),this.htmlMode&&(Zw.has(f)||Xw.has(f))&&this.foreignContext.shift(),this.isVoidElement(f))this.htmlMode&&f==="br"&&((s=(o=this.cbs).onopentagname)===null||s===void 0||s.call(o,"br"),(l=(a=this.cbs).onopentag)===null||l===void 0||l.call(a,"br",{},!0),(u=(c=this.cbs).onclosetag)===null||u===void 0||u.call(c,"br",!1));else{const d=this.stack.indexOf(f);if(d!==-1)for(let h=0;h<=d;h++){const p=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,p,h!==d)}else this.htmlMode&&f==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}closeCurrentTag(t){var n,r;const i=this.tagname;this.endOpenTag(t),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!t),this.stack.shift())}onattribname(t,n){this.startIndex=t;const r=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=qw(t)}onattribend(t,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,t===vr.Double?'"':t===vr.Single?"'":t===vr.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){const n=t.search(Uj);let r=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(t,n,r){var i,o,s,a;this.endIndex=n,(o=(i=this.cbs).oncomment)===null||o===void 0||o.call(i,this.getSlice(t,n-r)),(a=(s=this.cbs).oncommentend)===null||a===void 0||a.call(s),this.startIndex=n+1}oncdata(t,n,r){var i,o,s,a,l,c,u,f,d,h;this.endIndex=n;const p=this.getSlice(t,n-r);!this.htmlMode||this.options.recognizeCDATA?((o=(i=this.cbs).oncdatastart)===null||o===void 0||o.call(i),(a=(s=this.cbs).ontext)===null||a===void 0||a.call(s,p),(c=(l=this.cbs).oncdataend)===null||c===void 0||c.call(l)):((f=(u=this.cbs).oncomment)===null||f===void 0||f.call(u,`[CDATA[${p}]]`),(h=(d=this.cbs).oncommentend)===null||h===void 0||h.call(d)),this.startIndex=n+1}onend(){var t,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(t=this.cbs).onend)===null||n===void 0||n.call(t)}reset(){var t,n,r,i;(n=(t=this.cbs).onreset)===null||n===void 0||n.call(t),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(t){this.write(t)}done(t){this.end(t)}}function Kj(e,t){const n=new NW(void 0,t);return new Hj(n,t).end(e),n.root}var Jh;const ll=(Jh=Object.hasOwn)!==null&&Jh!==void 0?Jh:((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),cl=/\s+/,Qp="data-",bA=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Jj=/^{[^]*}$|^\[[^]*]$/;function Tu(e,t,n){var r;if(!(!e||!Ie(e))){if((r=e.attribs)!==null&&r!==void 0||(e.attribs={}),!t)return e.attribs;if(ll(e.attribs,t))return!n&&bA.test(t)?t:e.attribs[t];if(e.name==="option"&&t==="value")return al(e.children);if(e.name==="input"&&(e.attribs.type==="radio"||e.attribs.type==="checkbox")&&t==="value")return"on"}}function Cs(e,t,n){n===null?AI(e,t):e.attribs[t]=`${n}`}function Vj(e,t){if(typeof e=="object"||t!==void 0){if(typeof t=="function"){if(typeof e!="string")throw new Error("Bad combination of arguments.");return yt(this,(n,r)=>{Ie(n)&&Cs(n,e,t.call(n,r,n.attribs[e]))})}return yt(this,n=>{if(Ie(n))if(typeof e=="object")for(const r of Object.keys(e)){const i=e[r];Cs(n,r,i)}else Cs(n,e,t)})}return arguments.length>1?this:Tu(this[0],e,this.options.xmlMode)}function e0(e,t,n){return t in e?e[t]:!n&&bA.test(t)?Tu(e,t,!1)!==void 0:Tu(e,t,n)}function Vh(e,t,n,r){t in e?e[t]=n:Cs(e,t,!r&&bA.test(t)?n?"":null:`${n}`)}function qj(e,t){var n;if(typeof e=="string"&&t===void 0){const r=this[0];if(!r)return;switch(e){case"style":{const i=this.css(),o=Object.keys(i);for(let s=0;s<o.length;s++)i[s]=o[s];return i.length=o.length,i}case"tagName":case"nodeName":return Ie(r)?r.name.toUpperCase():void 0;case"href":case"src":{if(!Ie(r))return;const i=(n=r.attribs)===null||n===void 0?void 0:n[e];return typeof URL<"u"&&(e==="href"&&(r.tagName==="a"||r.tagName==="link")||e==="src"&&(r.tagName==="img"||r.tagName==="iframe"||r.tagName==="audio"||r.tagName==="video"||r.tagName==="source"))&&i!==void 0&&this.options.baseURI?new URL(i,this.options.baseURI).href:i}case"innerText":return Su(r);case"textContent":return Ws(r);case"outerHTML":return r.type===uA?this.html():this.clone().wrap("<container />").parent().html();case"innerHTML":return this.html();default:return Ie(r)?e0(r,e,this.options.xmlMode):void 0}}if(typeof e=="object"||t!==void 0){if(typeof t=="function"){if(typeof e=="object")throw new TypeError("Bad combination of arguments.");return yt(this,(r,i)=>{Ie(r)&&Vh(r,e,t.call(r,i,e0(r,e,this.options.xmlMode)),this.options.xmlMode)})}return yt(this,r=>{if(Ie(r))if(typeof e=="object")for(const i of Object.keys(e)){const o=e[i];Vh(r,i,o,this.options.xmlMode)}else Vh(r,e,t,this.options.xmlMode)})}}function t0(e,t,n){var r;(r=e.data)!==null&&r!==void 0||(e.data={}),typeof t=="object"?Object.assign(e.data,t):typeof t=="string"&&n!==void 0&&(e.data[t]=n)}function Gj(e){for(const t of Object.keys(e.attribs)){if(!t.startsWith(Qp))continue;const n=Ej(t.slice(Qp.length));ll(e.data,n)||(e.data[n]=gI(e.attribs[t]))}return e.data}function Qj(e,t){const n=Qp+Tj(t),r=e.data;if(ll(r,t))return r[t];if(ll(e.attribs,n))return r[t]=gI(e.attribs[n])}function gI(e){if(e==="null")return null;if(e==="true")return!0;if(e==="false")return!1;const t=Number(e);if(e===String(t))return t;if(Jj.test(e))try{return JSON.parse(e)}catch{}return e}function Yj(e,t){var n;const r=this[0];if(!r||!Ie(r))return;const i=r;return(n=i.data)!==null&&n!==void 0||(i.data={}),e==null?Gj(i):typeof e=="object"||t!==void 0?(yt(this,o=>{Ie(o)&&(typeof e=="object"?t0(o,e):t0(o,e,t))}),this):Qj(i,e)}function $j(e){const t=arguments.length===0,n=this[0];if(!n||!Ie(n))return t?void 0:this;switch(n.name){case"textarea":return this.text(e);case"select":{const r=this.find("option:selected");if(!t){if(this.attr("multiple")==null&&typeof e=="object")return this;this.find("option").removeAttr("selected");const i=typeof e=="object"?e:[e];for(const o of i)this.find(`option[value="${o}"]`).attr("selected","");return this}return this.attr("multiple")?r.toArray().map(i=>al(i.children)):r.attr("value")}case"button":case"input":case"option":return t?this.attr("value"):this.attr("value",e)}}function AI(e,t){!e.attribs||!ll(e.attribs,t)||delete e.attribs[t]}function Ru(e){return e?e.trim().split(cl):[]}function Zj(e){const t=Ru(e);for(const n of t)yt(this,r=>{Ie(r)&&AI(r,n)});return this}function Xj(e){return this.toArray().some(t=>{const n=Ie(t)&&t.attribs.class;let r=-1;if(n&&e.length>0)for(;(r=n.indexOf(e,r+1))>-1;){const i=r+e.length;if((r===0||cl.test(n[r-1]))&&(i===n.length||cl.test(n[i])))return!0}return!1})}function yI(e){if(typeof e=="function")return yt(this,(r,i)=>{if(Ie(r)){const o=r.attribs.class||"";yI.call([r],e.call(r,i,o))}});if(!e||typeof e!="string")return this;const t=e.split(cl),n=this.length;for(let r=0;r<n;r++){const i=this[r];if(!Ie(i))continue;const o=Tu(i,"class",!1);if(o){let s=` ${o} `;for(const a of t){const l=`${a} `;s.includes(` ${l}`)||(s+=l)}Cs(i,"class",s.trim())}else Cs(i,"class",t.join(" ").trim())}return this}function bI(e){if(typeof e=="function")return yt(this,(i,o)=>{Ie(i)&&bI.call([i],e.call(i,o,i.attribs.class||""))});const t=Ru(e),n=t.length,r=arguments.length===0;return yt(this,i=>{if(Ie(i))if(r)i.attribs.class="";else{const o=Ru(i.attribs.class);let s=!1;for(let a=0;a<n;a++){const l=o.indexOf(t[a]);l!==-1&&(o.splice(l,1),s=!0,a--)}s&&(i.attribs.class=o.join(" "))}})}function wI(e,t){if(typeof e=="function")return yt(this,(s,a)=>{Ie(s)&&wI.call([s],e.call(s,a,s.attribs.class||"",t),t)});if(!e||typeof e!="string")return this;const n=e.split(cl),r=n.length,i=typeof t=="boolean"?t?1:-1:0,o=this.length;for(let s=0;s<o;s++){const a=this[s];if(!Ie(a))continue;const l=Ru(a.attribs.class);for(let c=0;c<r;c++){const u=l.indexOf(n[c]);i>=0&&u===-1?l.push(n[c]):i<=0&&u!==-1&&l.splice(u,1)}a.attribs.class=l.join(" ")}return this}const e3=Object.freeze(Object.defineProperty({__proto__:null,addClass:yI,attr:Vj,data:Yj,hasClass:Xj,prop:qj,removeAttr:Zj,removeClass:bI,toggleClass:wI,val:$j},Symbol.toStringTag,{value:"Module"}));var ke;(function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"})(ke||(ke={}));var Ot;(function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"})(Ot||(Ot={}));const n0=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,t3=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,n3=new Map([[126,Ot.Element],[94,Ot.Start],[36,Ot.End],[42,Ot.Any],[33,Ot.Not],[124,Ot.Hyphen]]),r3=new Set(["has","not","matches","is","where","host","host-context"]);function Pa(e){switch(e.type){case ke.Adjacent:case ke.Child:case ke.Descendant:case ke.Parent:case ke.Sibling:case ke.ColumnCombinator:return!0;default:return!1}}const i3=new Set(["contains","icontains"]);function o3(e,t,n){const r=parseInt(t,16)-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function aa(e){return e.replace(t3,o3)}function qh(e){return e===39||e===34}function r0(e){return e===32||e===9||e===10||e===12||e===13}function yf(e){const t=[],n=xI(t,`${e}`,0);if(n<e.length)throw new Error(`Unmatched selector: ${e.slice(n)}`);return t}function xI(e,t,n){let r=[];function i(d){const h=t.slice(n+d).match(n0);if(!h)throw new Error(`Expected name, found ${t.slice(n)}`);const[p]=h;return n+=d+p.length,aa(p)}function o(d){for(n+=d;n<t.length&&r0(t.charCodeAt(n));)n++}function s(){n+=1;const d=n;let h=1;for(;h>0&&n<t.length;n++)t.charCodeAt(n)===40&&!a(n)?h++:t.charCodeAt(n)===41&&!a(n)&&h--;if(h)throw new Error("Parenthesis not matched");return aa(t.slice(d,n-1))}function a(d){let h=0;for(;t.charCodeAt(--d)===92;)h++;return(h&1)===1}function l(){if(r.length>0&&Pa(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(d){if(r.length>0&&r[r.length-1].type===ke.Descendant){r[r.length-1].type=d;return}l(),r.push({type:d})}function u(d,h){r.push({type:ke.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(r.length&&r[r.length-1].type===ke.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");e.push(r)}if(o(0),t.length===n)return n;e:for(;n<t.length;){const d=t.charCodeAt(n);switch(d){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==ke.Descendant)&&(l(),r.push({type:ke.Descendant})),o(1);break}case 62:{c(ke.Child),o(1);break}case 60:{c(ke.Parent),o(1);break}case 126:{c(ke.Sibling),o(1);break}case 43:{c(ke.Adjacent),o(1);break}case 46:{u("class",Ot.Element);break}case 35:{u("id",Ot.Equals);break}case 91:{o(1);let h,p=null;t.charCodeAt(n)===124?h=i(1):t.startsWith("*|",n)?(p="*",h=i(2)):(h=i(0),t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==61&&(p=h,h=i(1))),o(0);let m=Ot.Exists;const g=n3.get(t.charCodeAt(n));if(g){if(m=g,t.charCodeAt(n+1)!==61)throw new Error("Expected `=`");o(2)}else t.charCodeAt(n)===61&&(m=Ot.Equals,o(1));let A="",x=null;if(m!=="exists"){if(qh(t.charCodeAt(n))){const C=t.charCodeAt(n);let w=n+1;for(;w<t.length&&(t.charCodeAt(w)!==C||a(w));)w+=1;if(t.charCodeAt(w)!==C)throw new Error("Attribute value didn't end");A=aa(t.slice(n+1,w)),n=w+1}else{const C=n;for(;n<t.length&&(!r0(t.charCodeAt(n))&&t.charCodeAt(n)!==93||a(n));)n+=1;A=aa(t.slice(C,n))}o(0);const y=t.charCodeAt(n)|32;y===115?(x=!1,o(1)):y===105&&(x=!0,o(1))}if(t.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const b={type:ke.Attribute,name:h,action:m,value:A,namespace:p,ignoreCase:x};r.push(b);break}case 58:{if(t.charCodeAt(n+1)===58){r.push({type:ke.PseudoElement,name:i(2).toLowerCase(),data:t.charCodeAt(n)===40?s():null});continue}const h=i(1).toLowerCase();let p=null;if(t.charCodeAt(n)===40)if(r3.has(h)){if(qh(t.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${h} cannot be quoted`);if(p=[],n=xI(p,t,n+1),t.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${h} (${t})`);n+=1}else{if(p=s(),i3.has(h)){const m=p.charCodeAt(0);m===p.charCodeAt(p.length-1)&&qh(m)&&(p=p.slice(1,-1))}p=aa(p)}r.push({type:ke.Pseudo,name:h,data:p});break}case 44:{f(),r=[],o(1);break}default:{if(t.startsWith("/*",n)){const m=t.indexOf("*/",n+2);if(m<0)throw new Error("Comment was not terminated");n=m+2,r.length===0&&o(0);break}let h=null,p;if(d===42)n+=1,p="*";else if(d===124){if(p="",t.charCodeAt(n+1)===124){c(ke.ColumnCombinator),o(2);break}}else if(n0.test(t.slice(n)))p=i(0);else break e;t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==124&&(h=p,t.charCodeAt(n+1)===42?(p="*",n+=2):p=i(1)),r.push(p==="*"?{type:ke.Universal,namespace:h}:{type:ke.Tag,name:p,namespace:h})}}}return f(),n}var Gh,i0;function s3(){return i0||(i0=1,Gh={trueFunc:function(){return!0},falseFunc:function(){return!1}}),Gh}var _u=s3();const Le=_l(_u),kI=new Map([[ke.Universal,50],[ke.Tag,30],[ke.Attribute,1],[ke.Pseudo,0]]);function wA(e){return!kI.has(e.type)}const a3=new Map([[Ot.Exists,10],[Ot.Equals,8],[Ot.Not,7],[Ot.Start,6],[Ot.End,6],[Ot.Any,5]]);function l3(e){const t=e.map(CI);for(let n=1;n<e.length;n++){const r=t[n];if(!(r<0))for(let i=n-1;i>=0&&r<t[i];i--){const o=e[i+1];e[i+1]=e[i],e[i]=o,t[i+1]=t[i],t[i]=r}}}function CI(e){var t,n;let r=(t=kI.get(e.type))!==null&&t!==void 0?t:-1;return e.type===ke.Attribute?(r=(n=a3.get(e.action))!==null&&n!==void 0?n:4,e.action===Ot.Equals&&e.name==="id"&&(r=9),e.ignoreCase&&(r>>=1)):e.type===ke.Pseudo&&(e.data?e.name==="has"||e.name==="contains"?r=0:Array.isArray(e.data)?(r=Math.min(...e.data.map(i=>Math.min(...i.map(CI)))),r<0&&(r=0)):r=2:r=3),r}const c3=/[-[\]{}()*+?.,\\^$|#\s]/g;function o0(e){return e.replace(c3,"\\$&")}const u3=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function lo(e,t){return typeof e.ignoreCase=="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!t.quirksMode:!t.xmlMode&&u3.has(e.name)}const f3={equals(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:o}=t;return lo(t,n)?(o=o.toLowerCase(),s=>{const a=r.getAttributeValue(s,i);return a!=null&&a.length===o.length&&a.toLowerCase()===o&&e(s)}):s=>r.getAttributeValue(s,i)===o&&e(s)},hyphen(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:o}=t;const s=o.length;return lo(t,n)?(o=o.toLowerCase(),function(l){const c=r.getAttributeValue(l,i);return c!=null&&(c.length===s||c.charAt(s)==="-")&&c.substr(0,s).toLowerCase()===o&&e(l)}):function(l){const c=r.getAttributeValue(l,i);return c!=null&&(c.length===s||c.charAt(s)==="-")&&c.substr(0,s)===o&&e(l)}},element(e,t,n){const{adapter:r}=n,{name:i,value:o}=t;if(/\s/.test(o))return Le.falseFunc;const s=new RegExp(`(?:^|\\s)${o0(o)}(?:$|\\s)`,lo(t,n)?"i":"");return function(l){const c=r.getAttributeValue(l,i);return c!=null&&c.length>=o.length&&s.test(c)&&e(l)}},exists(e,{name:t},{adapter:n}){return r=>n.hasAttrib(r,t)&&e(r)},start(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:o}=t;const s=o.length;return s===0?Le.falseFunc:lo(t,n)?(o=o.toLowerCase(),a=>{const l=r.getAttributeValue(a,i);return l!=null&&l.length>=s&&l.substr(0,s).toLowerCase()===o&&e(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.startsWith(o))&&e(a)}},end(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:o}=t;const s=-o.length;return s===0?Le.falseFunc:lo(t,n)?(o=o.toLowerCase(),a=>{var l;return((l=r.getAttributeValue(a,i))===null||l===void 0?void 0:l.substr(s).toLowerCase())===o&&e(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.endsWith(o))&&e(a)}},any(e,t,n){const{adapter:r}=n,{name:i,value:o}=t;if(o==="")return Le.falseFunc;if(lo(t,n)){const s=new RegExp(o0(o),"i");return function(l){const c=r.getAttributeValue(l,i);return c!=null&&c.length>=o.length&&s.test(c)&&e(l)}}return s=>{var a;return!!(!((a=r.getAttributeValue(s,i))===null||a===void 0)&&a.includes(o))&&e(s)}},not(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:o}=t;return o===""?s=>!!r.getAttributeValue(s,i)&&e(s):lo(t,n)?(o=o.toLowerCase(),s=>{const a=r.getAttributeValue(s,i);return(a==null||a.length!==o.length||a.toLowerCase()!==o)&&e(s)}):s=>r.getAttributeValue(s,i)!==o&&e(s)}},h3=new Set([9,10,12,13,32]),s0=48,d3=57;function p3(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];if(e==="odd")return[2,1];let t=0,n=0,r=o(),i=s();if(t<e.length&&e.charAt(t)==="n"&&(t++,n=r*(i??1),a(),t<e.length?(r=o(),a(),i=s()):r=i=0),i===null||t<e.length)throw new Error(`n-th rule couldn't be parsed ('${e}')`);return[n,r*i];function o(){return e.charAt(t)==="-"?(t++,-1):(e.charAt(t)==="+"&&t++,1)}function s(){const l=t;let c=0;for(;t<e.length&&e.charCodeAt(t)>=s0&&e.charCodeAt(t)<=d3;)c=c*10+(e.charCodeAt(t)-s0),t++;return t===l?null:c}function a(){for(;t<e.length&&h3.has(e.charCodeAt(t));)t++}}function m3(e){const t=e[0],n=e[1]-1;if(n<0&&t<=0)return Le.falseFunc;if(t===-1)return o=>o<=n;if(t===0)return o=>o===n;if(t===1)return n<0?Le.trueFunc:o=>o>=n;const r=Math.abs(t),i=(n%r+r)%r;return t>1?o=>o>=n&&o%r===i:o=>o<=n&&o%r===i}function vc(e){return m3(p3(e))}function Sc(e,t){return n=>{const r=t.getParent(n);return r!=null&&t.isTag(r)&&e(n)}}const Yp={contains(e,t,{adapter:n}){return function(i){return e(i)&&n.getText(i).includes(t)}},icontains(e,t,{adapter:n}){const r=t.toLowerCase();return function(o){return e(o)&&n.getText(o).toLowerCase().includes(r)}},"nth-child"(e,t,{adapter:n,equals:r}){const i=vc(t);return i===Le.falseFunc?Le.falseFunc:i===Le.trueFunc?Sc(e,n):function(s){const a=n.getSiblings(s);let l=0;for(let c=0;c<a.length&&!r(s,a[c]);c++)n.isTag(a[c])&&l++;return i(l)&&e(s)}},"nth-last-child"(e,t,{adapter:n,equals:r}){const i=vc(t);return i===Le.falseFunc?Le.falseFunc:i===Le.trueFunc?Sc(e,n):function(s){const a=n.getSiblings(s);let l=0;for(let c=a.length-1;c>=0&&!r(s,a[c]);c--)n.isTag(a[c])&&l++;return i(l)&&e(s)}},"nth-of-type"(e,t,{adapter:n,equals:r}){const i=vc(t);return i===Le.falseFunc?Le.falseFunc:i===Le.trueFunc?Sc(e,n):function(s){const a=n.getSiblings(s);let l=0;for(let c=0;c<a.length;c++){const u=a[c];if(r(s,u))break;n.isTag(u)&&n.getName(u)===n.getName(s)&&l++}return i(l)&&e(s)}},"nth-last-of-type"(e,t,{adapter:n,equals:r}){const i=vc(t);return i===Le.falseFunc?Le.falseFunc:i===Le.trueFunc?Sc(e,n):function(s){const a=n.getSiblings(s);let l=0;for(let c=a.length-1;c>=0;c--){const u=a[c];if(r(s,u))break;n.isTag(u)&&n.getName(u)===n.getName(s)&&l++}return i(l)&&e(s)}},root(e,t,{adapter:n}){return r=>{const i=n.getParent(r);return(i==null||!n.isTag(i))&&e(r)}},scope(e,t,n,r){const{equals:i}=n;return!r||r.length===0?Yp.root(e,t,n):r.length===1?o=>i(r[0],o)&&e(o):o=>r.includes(o)&&e(o)},hover:Qh("isHovered"),visited:Qh("isVisited"),active:Qh("isActive")};function Qh(e){return function(n,r,{adapter:i}){const o=i[e];return typeof o!="function"?Le.falseFunc:function(a){return o(a)&&n(a)}}}const a0={empty(e,{adapter:t}){return!t.getChildren(e).some(n=>t.isTag(n)||t.getText(n)!=="")},"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return t.prevElementSibling(e)==null;const r=t.getSiblings(e).find(i=>t.isTag(i));return r!=null&&n(e,r)},"last-child"(e,{adapter:t,equals:n}){const r=t.getSiblings(e);for(let i=r.length-1;i>=0;i--){if(n(e,r[i]))return!0;if(t.isTag(r[i]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){const r=t.getSiblings(e),i=t.getName(e);for(let o=0;o<r.length;o++){const s=r[o];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===i)break}return!1},"last-of-type"(e,{adapter:t,equals:n}){const r=t.getSiblings(e),i=t.getName(e);for(let o=r.length-1;o>=0;o--){const s=r[o];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===i)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){const r=t.getName(e);return t.getSiblings(e).every(i=>n(e,i)||!t.isTag(i)||t.getName(i)!==r)},"only-child"(e,{adapter:t,equals:n}){return t.getSiblings(e).every(r=>n(e,r)||!t.isTag(r))}};function l0(e,t,n,r){if(n===null){if(e.length>r)throw new Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===r)throw new Error(`Pseudo-class :${t} doesn't have any arguments`)}const g3={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
914
+ :is(button, input, select, textarea, optgroup, option)[disabled],
915
+ optgroup[disabled] > option,
916
+ fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
917
+ )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},vI={};function A3(e,t){return e===Le.falseFunc?Le.falseFunc:n=>t.isTag(n)&&e(n)}function SI(e,t){const n=t.getSiblings(e);if(n.length<=1)return[];const r=n.indexOf(e);return r<0||r===n.length-1?[]:n.slice(r+1).filter(t.isTag)}function $p(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}const Yh=(e,t,n,r,i)=>{const o=i(t,$p(n),r);return o===Le.trueFunc?e:o===Le.falseFunc?Le.falseFunc:s=>o(s)&&e(s)},$h={is:Yh,matches:Yh,where:Yh,not(e,t,n,r,i){const o=i(t,$p(n),r);return o===Le.falseFunc?e:o===Le.trueFunc?Le.falseFunc:s=>!o(s)&&e(s)},has(e,t,n,r,i){const{adapter:o}=n,s=$p(n);s.relativeSelector=!0;const a=t.some(u=>u.some(wA))?[vI]:void 0,l=i(t,s,a);if(l===Le.falseFunc)return Le.falseFunc;const c=A3(l,o);if(a&&l!==Le.trueFunc){const{shouldTestNextSiblings:u=!1}=l;return f=>{if(!e(f))return!1;a[0]=f;const d=o.getChildren(f),h=u?[...d,...SI(f,o)]:d;return o.existsOne(c,h)}}return u=>e(u)&&o.existsOne(c,o.getChildren(u))}};function y3(e,t,n,r,i){var o;const{name:s,data:a}=t;if(Array.isArray(a)){if(!(s in $h))throw new Error(`Unknown pseudo-class :${s}(${a})`);return $h[s](e,a,n,r,i)}const l=(o=n.pseudos)===null||o===void 0?void 0:o[s],c=typeof l=="string"?l:g3[s];if(typeof c=="string"){if(a!=null)throw new Error(`Pseudo ${s} doesn't have any arguments`);const u=yf(c);return $h.is(e,u,n,r,i)}if(typeof l=="function")return l0(l,s,a,1),u=>l(u,a)&&e(u);if(s in Yp)return Yp[s](e,a,n,r);if(s in a0){const u=a0[s];return l0(u,s,a,2),f=>u(f,n,a)&&e(f)}throw new Error(`Unknown pseudo-class :${s}`)}function Zh(e,t){const n=t.getParent(e);return n&&t.isTag(n)?n:null}function b3(e,t,n,r,i){const{adapter:o,equals:s}=n;switch(t.type){case ke.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case ke.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case ke.Attribute:{if(t.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),f3[t.action](e,t,n)}case ke.Pseudo:return y3(e,t,n,r,i);case ke.Tag:{if(t.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:a}=t;return(!n.xmlMode||n.lowerCaseTags)&&(a=a.toLowerCase()),function(c){return o.getName(c)===a&&e(c)}}case ke.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(c){let u=c;for(;u=Zh(u,o);)if(e(u))return!0;return!1};const a=new WeakSet;return function(c){let u=c;for(;u=Zh(u,o);)if(!a.has(u)){if(o.isTag(u)&&e(u))return!0;a.add(u)}return!1}}case"_flexibleDescendant":return function(l){let c=l;do if(e(c))return!0;while(c=Zh(c,o));return!1};case ke.Parent:return function(l){return o.getChildren(l).some(c=>o.isTag(c)&&e(c))};case ke.Child:return function(l){const c=o.getParent(l);return c!=null&&o.isTag(c)&&e(c)};case ke.Sibling:return function(l){const c=o.getSiblings(l);for(let u=0;u<c.length;u++){const f=c[u];if(s(l,f))break;if(o.isTag(f)&&e(f))return!0}return!1};case ke.Adjacent:return o.prevElementSibling?function(l){const c=o.prevElementSibling(l);return c!=null&&e(c)}:function(l){const c=o.getSiblings(l);let u;for(let f=0;f<c.length;f++){const d=c[f];if(s(l,d))break;o.isTag(d)&&(u=d)}return!!u&&e(u)};case ke.Universal:{if(t.namespace!=null&&t.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return e}}}function II(e){return e.type===ke.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some(t=>t.some(II)))}const w3={type:ke.Descendant},x3={type:"_flexibleDescendant"},k3={type:ke.Pseudo,name:"scope",data:null};function C3(e,{adapter:t},n){const r=!!n?.every(i=>{const o=t.isTag(i)&&t.getParent(i);return i===vI||o&&t.isTag(o)});for(const i of e){if(!(i.length>0&&wA(i[0])&&i[0].type!==ke.Descendant))if(r&&!i.some(II))i.unshift(w3);else continue;i.unshift(k3)}}function EI(e,t,n){var r;e.forEach(l3),n=(r=t.context)!==null&&r!==void 0?r:n;const i=Array.isArray(n),o=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==!1)C3(e,t,o);else if(e.some(l=>l.length>0&&wA(l[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let s=!1;const a=e.map(l=>{if(l.length>=2){const[c,u]=l;c.type!==ke.Pseudo||c.name!=="scope"||(i&&u.type===ke.Descendant?l[1]=x3:(u.type===ke.Adjacent||u.type===ke.Sibling)&&(s=!0))}return v3(l,t,o)}).reduce(S3,Le.falseFunc);return a.shouldTestNextSiblings=s,a}function v3(e,t,n){var r;return e.reduce((i,o)=>i===Le.falseFunc?Le.falseFunc:b3(i,o,t,n,EI),(r=t.rootFunc)!==null&&r!==void 0?r:Le.trueFunc)}function S3(e,t){return t===Le.falseFunc||e===Le.trueFunc?e:e===Le.falseFunc||t===Le.trueFunc?t:function(r){return e(r)||t(r)}}const TI=(e,t)=>e===t,I3={adapter:Af,equals:TI};function E3(e){var t,n,r,i;const o=e??I3;return(t=o.adapter)!==null&&t!==void 0||(o.adapter=Af),(n=o.equals)!==null&&n!==void 0||(o.equals=(i=(r=o.adapter)===null||r===void 0?void 0:r.equals)!==null&&i!==void 0?i:TI),o}function T3(e){return function(n,r,i){const o=E3(r);return e(n,o,i)}}const xA=T3(EI);function RI(e,t,n=!1){return n&&(e=R3(e,t)),Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}function R3(e,t){const n=Array.isArray(e)?e.slice(0):[e],r=n.length;for(let i=0;i<r;i++){const o=SI(n[i],t);n.push(...o)}return n}const _3=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function Nu(e){return e.type!=="pseudo"?!1:_3.has(e.name)?!0:e.name==="not"&&Array.isArray(e.data)?e.data.some(t=>t.some(Nu)):!1}function N3(e,t,n){const r=t!=null?parseInt(t,10):NaN;switch(e){case"first":return 1;case"nth":case"eq":return isFinite(r)?r>=0?r+1:1/0:0;case"lt":return isFinite(r)?r>=0?Math.min(r,n):1/0:0;case"gt":return isFinite(r)?1/0:0;case"odd":return 2*n;case"even":return 2*n-1;case"last":case"not":return 1/0}}function O3(e){for(;e.parent;)e=e.parent;return e}function kA(e){const t=[],n=[];for(const r of e)r.some(Nu)?t.push(r):n.push(r);return[n,t]}const D3={type:ke.Universal,namespace:null},M3={type:ke.Pseudo,name:"scope",data:null};function _I(e,t,n={}){return NI([e],t,n)}function NI(e,t,n={}){if(typeof t=="function")return e.some(t);const[r,i]=kA(yf(t));return r.length>0&&e.some(xA(r,n))||i.some(o=>MI(o,e,n).length>0)}function B3(e,t,n,r){const i=typeof n=="string"?parseInt(n,10):NaN;switch(e){case"first":case"lt":return t;case"last":return t.length>0?[t[t.length-1]]:t;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<t.length?[i<0?t[t.length+i]:t[i]]:[];case"gt":return isFinite(i)?t.slice(i+1):[];case"even":return t.filter((o,s)=>s%2===0);case"odd":return t.filter((o,s)=>s%2===1);case"not":{const o=new Set(DI(n,t,r));return t.filter(s=>!o.has(s))}}}function OI(e,t,n={}){return DI(yf(e),t,n)}function DI(e,t,n){if(t.length===0)return[];const[r,i]=kA(e);let o;if(r.length){const s=Xp(t,r,n);if(i.length===0)return s;s.length&&(o=new Set(s))}for(let s=0;s<i.length&&o?.size!==t.length;s++){const a=i[s];if((o?t.filter(u=>Ie(u)&&!o.has(u)):t).length===0)break;const c=MI(a,t,n);if(c.length)if(o)c.forEach(u=>o.add(u));else{if(s===i.length-1)return c;o=new Set(c)}}return typeof o<"u"?o.size===t.length?t:t.filter(s=>o.has(s)):[]}function MI(e,t,n){var r;if(e.some(Pa)){const i=(r=n.root)!==null&&r!==void 0?r:O3(t[0]),o={...n,context:t,relativeSelector:!1};return e.push(M3),Ou(i,e,o,!0,t.length)}return Ou(t,e,n,!1,t.length)}function P3(e,t,n={},r=1/0){if(typeof e=="function")return BI(t,e);const[i,o]=kA(yf(e)),s=o.map(a=>Ou(t,a,n,!0,r));return i.length&&s.push(Zp(t,i,n,r)),s.length===0?[]:s.length===1?s[0]:Qs(s.reduce((a,l)=>[...a,...l]))}function Ou(e,t,n,r,i){const o=t.findIndex(Nu),s=t.slice(0,o),a=t[o],l=t.length-1===o?i:1/0,c=N3(a.name,a.data,l);if(c===0)return[];const f=(s.length===0&&!Array.isArray(e)?gf(e).filter(Ie):s.length===0?(Array.isArray(e)?e:[e]).filter(Ie):r||s.some(Pa)?Zp(e,[s],n,c):Xp(e,[s],n)).slice(0,c);let d=B3(a.name,f,a.data,n);if(d.length===0||t.length===o+1)return d;const h=t.slice(o+1),p=h.some(Pa);if(p){if(Pa(h[0])){const{type:m}=h[0];(m===ke.Sibling||m===ke.Adjacent)&&(d=RI(d,Af,!0)),h.unshift(D3)}n={...n,relativeSelector:!1,rootFunc:m=>d.includes(m)}}else n.rootFunc&&n.rootFunc!==_u.trueFunc&&(n={...n,rootFunc:_u.trueFunc});return h.some(Nu)?Ou(d,h,n,!1,i):p?Zp(d,[h],n,i):Xp(d,[h],n)}function Zp(e,t,n,r){const i=xA(t,n,e);return BI(e,i,r)}function BI(e,t,n=1/0){const r=RI(e,Af,t.shouldTestNextSiblings);return gA(i=>Ie(i)&&t(i),r,!0,n)}function Xp(e,t,n){const r=(Array.isArray(e)?e:[e]).filter(Ie);if(r.length===0)return r;const i=xA(t,n);return i===_u.trueFunc?r:r.filter(i)}const F3=/^\s*(?:[+~]|:scope\b)/;function L3(e){if(!e)return this._make([]);if(typeof e!="string"){const t=ii(e)?e.toArray():[e],n=this.toArray();return this._make(t.filter(r=>n.some(i=>pI(i,r))))}return this._findBySelector(e,Number.POSITIVE_INFINITY)}function z3(e,t){var n;const r=this.toArray(),i=F3.test(e)?r:this.children().toArray(),o={context:r,root:(n=this._root)===null||n===void 0?void 0:n[0],xmlMode:this.options.xmlMode,lowerCaseTags:this.options.lowerCaseTags,lowerCaseAttributeNames:this.options.lowerCaseAttributeNames,pseudos:this.options.pseudos,quirksMode:this.options.quirksMode};return this._make(P3(e,i,o,t))}function CA(e){return function(t,...n){return function(r){var i;let o=e(t,this);return r&&(o=IA(o,r,this.options.xmlMode,(i=this._root)===null||i===void 0?void 0:i[0])),this._make(this.length>1&&o.length>1?n.reduce((s,a)=>a(s),o):o)}}}const Gl=CA((e,t)=>{let n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i.length>0&&(n=n.concat(i))}return n}),vA=CA((e,t)=>{const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i!==null&&n.push(i)}return n});function SA(e,...t){let n=null;const r=CA((i,o)=>{const s=[];return yt(o,a=>{for(let l;(l=i(a))&&!n?.(l,s.length);a=l)s.push(l)}),s})(e,...t);return function(i,o){n=typeof i=="string"?a=>_I(a,i,this.options):i?Ql(i):null;const s=r.call(this,o);return n=null,s}}function Ys(e){return e.length>1?Array.from(new Set(e)):e}const W3=vA(({parent:e})=>e&&!Qo(e)?e:null,Ys),j3=Gl(e=>{const t=[];for(;e.parent&&!Qo(e.parent);)t.push(e.parent),e=e.parent;return t},Qs,e=>e.reverse()),U3=SA(({parent:e})=>e&&!Qo(e)?e:null,Qs,e=>e.reverse());function H3(e){var t;const n=[];if(!e)return this._make(n);const r={xmlMode:this.options.xmlMode,root:(t=this._root)===null||t===void 0?void 0:t[0]},i=typeof e=="string"?o=>_I(o,e,r):Ql(e);return yt(this,o=>{for(o&&!Qo(o)&&!Ie(o)&&(o=o.parent);o&&Ie(o);){if(i(o,0)){n.includes(o)||n.push(o);break}o=o.parent}}),this._make(n)}const K3=vA(e=>pA(e)),J3=Gl(e=>{const t=[];for(;e.next;)e=e.next,Ie(e)&&t.push(e);return t},Ys),V3=SA(e=>pA(e),Ys),q3=vA(e=>mA(e)),G3=Gl(e=>{const t=[];for(;e.prev;)e=e.prev,Ie(e)&&t.push(e);return t},Ys),Q3=SA(e=>mA(e),Ys),Y3=Gl(e=>lI(e).filter(t=>Ie(t)&&t!==e),Qs),$3=Gl(e=>gf(e).filter(Ie),Ys);function Z3(){const e=this.toArray().reduce((t,n)=>Ct(n)?t.concat(n.children):t,[]);return this._make(e)}function X3(e){let t=0;const n=this.length;for(;t<n&&e.call(this[t],t,this[t])!==!1;)++t;return this}function eU(e){let t=[];for(let n=0;n<this.length;n++){const r=this[n],i=e.call(r,n,r);i!=null&&(t=t.concat(i))}return this._make(t)}function Ql(e){return typeof e=="function"?(t,n)=>e.call(t,n,t):ii(e)?t=>Array.prototype.includes.call(e,t):function(t){return e===t}}function tU(e){var t;return this._make(IA(this.toArray(),e,this.options.xmlMode,(t=this._root)===null||t===void 0?void 0:t[0]))}function IA(e,t,n,r){return typeof t=="string"?OI(t,e,{xmlMode:n,root:r}):e.filter(Ql(t))}function nU(e){const t=this.toArray();return typeof e=="string"?NI(t.filter(Ie),e,this.options):e?t.some(Ql(e)):!1}function rU(e){let t=this.toArray();if(typeof e=="string"){const n=new Set(OI(e,t,this.options));t=t.filter(r=>!n.has(r))}else{const n=Ql(e);t=t.filter((r,i)=>!n(r,i))}return this._make(t)}function iU(e){return this.filter(typeof e=="string"?`:has(${e})`:(t,n)=>this._make(n).find(e).length>0)}function oU(){return this.length>1?this._make(this[0]):this}function sU(){return this.length>0?this._make(this[this.length-1]):this}function aU(e){var t;return e=+e,e===0&&this.length<=1?this:(e<0&&(e=this.length+e),this._make((t=this[e])!==null&&t!==void 0?t:[]))}function lU(e){return e==null?this.toArray():this[e<0?this.length+e:e]}function cU(){return Array.prototype.slice.call(this)}function uU(e){let t,n;return e==null?(t=this.parent().children(),n=this[0]):typeof e=="string"?(t=this._make(e),n=this[0]):(t=this,n=ii(e)?e[0]:e),Array.prototype.indexOf.call(t,n)}function fU(e,t){return this._make(Array.prototype.slice.call(this,e,t))}function hU(){var e;return(e=this.prevObject)!==null&&e!==void 0?e:this._make([])}function dU(e,t){const n=this._make(e,t),r=Qs([...this.get(),...n.get()]);return this._make(r)}function pU(e){return this.prevObject?this.add(e?this.prevObject.filter(e):this.prevObject):this}const mU=Object.freeze(Object.defineProperty({__proto__:null,_findBySelector:z3,add:dU,addBack:pU,children:$3,closest:H3,contents:Z3,each:X3,end:hU,eq:aU,filter:tU,filterArray:IA,find:L3,first:oU,get:lU,has:iU,index:uU,is:nU,last:sU,map:eU,next:K3,nextAll:J3,nextUntil:V3,not:rU,parent:W3,parents:j3,parentsUntil:U3,prev:q3,prevAll:G3,prevUntil:Q3,siblings:Y3,slice:fU,toArray:cU},Symbol.toStringTag,{value:"Module"}));function gU(e){return function(n,r,i,o){if(typeof Buffer<"u"&&Buffer.isBuffer(n)&&(n=n.toString()),typeof n=="string")return e(n,r,i,o);const s=n;if(!Array.isArray(s)&&Qo(s))return s;const a=new ol([]);return Jo(s,a),a}}function Jo(e,t){const n=Array.isArray(e)?e:[e];t?t.children=n:t=null;for(let r=0;r<n.length;r++){const i=n[r];i.parent&&i.parent.children!==n&&Yo(i),t?(i.prev=n[r-1]||null,i.next=n[r+1]||null):i.prev=i.next=null,i.parent=t}return t}function AU(e,t){if(e==null)return[];if(typeof e=="string")return this._parse(e,this.options,!1,null).children.slice(0);if("length"in e){if(e.length===1)return this._makeDomArray(e[0],t);const n=[];for(let r=0;r<e.length;r++){const i=e[r];if(typeof i=="object"){if(i==null)continue;if(!("length"in i)){n.push(t?sl(i,!0):i);continue}}n.push(...this._makeDomArray(i,t))}return n}return[t?sl(e,!0):e]}function PI(e){return function(...t){const n=this.length-1;return yt(this,(r,i)=>{if(!Ct(r))return;const o=typeof t[0]=="function"?t[0].call(r,i,this._render(r.children)):t,s=this._makeDomArray(o,i<n);e(s,r.children,r)})}}function to(e,t,n,r,i){var o,s;const a=[t,n,...r],l=t===0?null:e[t-1],c=t+n>=e.length?null:e[t+n];for(let u=0;u<r.length;++u){const f=r[u],d=f.parent;if(d){const p=d.children.indexOf(f);p!==-1&&(d.children.splice(p,1),i===d&&t>p&&a[0]--)}f.parent=i,f.prev&&(f.prev.next=(o=f.next)!==null&&o!==void 0?o:null),f.next&&(f.next.prev=(s=f.prev)!==null&&s!==void 0?s:null),f.prev=u===0?l:r[u-1],f.next=u===r.length-1?c:r[u+1]}return l&&(l.next=r[0]),c&&(c.prev=r[r.length-1]),e.splice(...a)}function yU(e){return(ii(e)?e:this._make(e)).append(this),this}function bU(e){return(ii(e)?e:this._make(e)).prepend(this),this}const wU=PI((e,t,n)=>{to(t,t.length,0,e,n)}),xU=PI((e,t,n)=>{to(t,0,0,e,n)});function FI(e){return function(t){const n=this.length-1,r=this.parents().last();for(let i=0;i<this.length;i++){const o=this[i],s=typeof t=="function"?t.call(o,i,o):typeof t=="string"&&!qp(t)?r.find(t).clone():t,[a]=this._makeDomArray(s,i<n);if(!a||!Ct(a))continue;let l=a,c=0;for(;c<l.children.length;){const u=l.children[c];Ie(u)?(l=u,c=0):c++}e(o,l,[a])}return this}}const kU=FI((e,t,n)=>{const{parent:r}=e;if(!r)return;const i=r.children,o=i.indexOf(e);Jo([e],t),to(i,o,0,n,r)}),CU=FI((e,t,n)=>{Ct(e)&&(Jo(e.children,t),Jo(n,e))});function vU(e){return this.parent(e).not("body").each((t,n)=>{this._make(n).replaceWith(n.children)}),this}function SU(e){const t=this[0];if(t){const n=this._make(typeof e=="function"?e.call(t,0,t):e).insertBefore(t);let r;for(let o=0;o<n.length;o++)n[o].type===Vp&&(r=n[o]);let i=0;for(;r&&i<r.children.length;){const o=r.children[i];o.type===Vp?(r=o,i=0):i++}r&&this._make(r).append(this)}return this}function IU(...e){const t=this.length-1;return yt(this,(n,r)=>{if(!Ct(n)||!n.parent)return;const i=n.parent.children,o=i.indexOf(n);if(o===-1)return;const s=typeof e[0]=="function"?e[0].call(n,r,this._render(n.children)):e,a=this._makeDomArray(s,r<t);to(i,o+1,0,a,n.parent)})}function EU(e){typeof e=="string"&&(e=this._make(e)),this.remove();const t=[];for(const n of this._makeDomArray(e)){const r=this.clone().toArray(),{parent:i}=n;if(!i)continue;const o=i.children,s=o.indexOf(n);s!==-1&&(to(o,s+1,0,r,i),t.push(...r))}return this._make(t)}function TU(...e){const t=this.length-1;return yt(this,(n,r)=>{if(!Ct(n)||!n.parent)return;const i=n.parent.children,o=i.indexOf(n);if(o===-1)return;const s=typeof e[0]=="function"?e[0].call(n,r,this._render(n.children)):e,a=this._makeDomArray(s,r<t);to(i,o,0,a,n.parent)})}function RU(e){const t=this._make(e);this.remove();const n=[];return yt(t,r=>{const i=this.clone().toArray(),{parent:o}=r;if(!o)return;const s=o.children,a=s.indexOf(r);a!==-1&&(to(s,a,0,i,o),n.push(...i))}),this._make(n)}function _U(e){const t=e?this.filter(e):this;return yt(t,n=>{Yo(n),n.prev=n.next=n.parent=null}),this}function NU(e){return yt(this,(t,n)=>{const{parent:r}=t;if(!r)return;const i=r.children,o=typeof e=="function"?e.call(t,n,t):e,s=this._makeDomArray(o);Jo(s,null);const a=i.indexOf(t);to(i,a,1,s,r),s.includes(t)||(t.parent=t.prev=t.next=null)})}function OU(){return yt(this,e=>{if(Ct(e)){for(const t of e.children)t.next=t.prev=t.parent=null;e.children.length=0}})}function DU(e){if(e===void 0){const t=this[0];return!t||!Ct(t)?null:this._render(t.children)}return yt(this,t=>{if(!Ct(t))return;for(const r of t.children)r.next=r.prev=r.parent=null;const n=ii(e)?e.toArray():this._parse(`${e}`,this.options,!1,t).children;Jo(n,t)})}function MU(){return this._render(this)}function BU(e){return e===void 0?al(this):typeof e=="function"?yt(this,(t,n)=>this._make(t).text(e.call(t,n,al([t])))):yt(this,t=>{if(!Ct(t))return;for(const r of t.children)r.next=r.prev=r.parent=null;const n=new vu(`${e}`);Jo(n,t)})}function PU(){const e=Array.prototype.map.call(this.get(),n=>sl(n,!0)),t=new ol(e);for(const n of e)n.parent=t;return this._make(e)}const FU=Object.freeze(Object.defineProperty({__proto__:null,_makeDomArray:AU,after:IU,append:wU,appendTo:yU,before:TU,clone:PU,empty:OU,html:DU,insertAfter:EU,insertBefore:RU,prepend:xU,prependTo:bU,remove:_U,replaceWith:NU,text:BU,toString:MU,unwrap:vU,wrap:kU,wrapAll:SU,wrapInner:CU},Symbol.toStringTag,{value:"Module"}));function LU(e,t){if(e!=null&&t!=null||typeof e=="object"&&!Array.isArray(e))return yt(this,(n,r)=>{Ie(n)&&LI(n,e,t,r)});if(this.length!==0)return zI(this[0],e)}function LI(e,t,n,r){if(typeof t=="string"){const i=zI(e),o=typeof n=="function"?n.call(e,r,i[t]):n;o===""?delete i[t]:o!=null&&(i[t]=o),e.attribs.style=zU(i)}else if(typeof t=="object"){const i=Object.keys(t);for(let o=0;o<i.length;o++){const s=i[o];LI(e,s,t[s],o)}}}function zI(e,t){if(!e||!Ie(e))return;const n=WU(e.attribs.style);if(typeof t=="string")return n[t];if(Array.isArray(t)){const r={};for(const i of t)n[i]!=null&&(r[i]=n[i]);return r}return n}function zU(e){return Object.keys(e).reduce((t,n)=>`${t}${t?" ":""}${n}: ${e[n]};`,"")}function WU(e){if(e=(e||"").trim(),!e)return{};const t={};let n;for(const r of e.split(";")){const i=r.indexOf(":");if(i<1||i===r.length-1){const o=r.trimEnd();o.length>0&&n!==void 0&&(t[n]+=`;${o}`)}else n=r.slice(0,i).trim(),t[n]=r.slice(i+1).trim()}return t}const jU=Object.freeze(Object.defineProperty({__proto__:null,css:LU},Symbol.toStringTag,{value:"Module"})),c0="input,select,textarea,keygen",UU=/%20/g,u0=/\r?\n/g;function HU(){return this.serializeArray().map(n=>`${encodeURIComponent(n.name)}=${encodeURIComponent(n.value)}`).join("&").replace(UU,"+")}function KU(){return this.map((e,t)=>{const n=this._make(t);return Ie(t)&&t.name==="form"?n.find(c0).toArray():n.filter(c0).toArray()}).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((e,t)=>{var n;const r=this._make(t),i=r.attr("name"),o=(n=r.val())!==null&&n!==void 0?n:"";return Array.isArray(o)?o.map(s=>({name:i,value:s.replace(u0,`\r
918
+ `)})):{name:i,value:o.replace(u0,`\r
919
+ `)}}).toArray()}const JU=Object.freeze(Object.defineProperty({__proto__:null,serialize:HU,serializeArray:KU},Symbol.toStringTag,{value:"Module"}));function VU(e){var t;return typeof e=="string"?{selector:e,value:"textContent"}:{selector:e.selector,value:(t=e.value)!==null&&t!==void 0?t:"textContent"}}function qU(e){const t={};for(const n in e){const r=e[n],i=Array.isArray(r),{selector:o,value:s}=VU(i?r[0]:r),a=typeof s=="function"?s:typeof s=="string"?l=>this._make(l).prop(s):l=>this._make(l).extract(s);if(i)t[n]=this._findBySelector(o,Number.POSITIVE_INFINITY).map((l,c)=>a(c,n,t)).get();else{const l=this._findBySelector(o,1);t[n]=l.length>0?a(l[0],n,t):void 0}}return t}const GU=Object.freeze(Object.defineProperty({__proto__:null,extract:qU},Symbol.toStringTag,{value:"Module"}));class Yl{constructor(t,n,r){if(this.length=0,this.options=r,this._root=n,t){for(let i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}}Yl.prototype.cheerio="[cheerio object]";Yl.prototype.splice=Array.prototype.splice;Yl.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(Yl.prototype,e3,mU,FU,jU,JU,GU);function QU(e,t){return function n(r,i,o=!0){if(r==null)throw new Error("cheerio.load() expects a string");const s=Jp(i),a=e(r,s,o,null);class l extends Yl{_make(f,d){const h=c(f,d);return h.prevObject=this,h}_parse(f,d,h,p){return e(f,d,h,p)}_render(f){return t(f,this.options)}}function c(u,f,d=a,h){if(u&&ii(u))return u;const p=Jp(h,s),m=typeof d=="string"?[e(d,p,!1,null)]:"length"in d?d:[d],g=ii(m)?m:new l(m,null,p);if(g._root=g,!u)return new l(void 0,g,p);const A=typeof u=="string"&&qp(u)?e(u,p,!1,null).children:YU(u)?[u]:Array.isArray(u)?u:void 0,x=new l(A,g,p);if(A)return x;if(typeof u!="string")throw new TypeError("Unexpected type of selector");let b=u;const y=f?typeof f=="string"?qp(f)?new l([e(f,p,!1,null)],g,p):(b=`${f} ${b}`,g):ii(f)?f:new l(Array.isArray(f)?f:[f],g,p):g;return y?y.find(b):x}return Object.assign(c,Ij,{load:n,_root:a,_options:s,fn:l.prototype,prototype:l.prototype}),c}}function YU(e){return!!e.name||e.type===uA||e.type===$S||e.type===ZS}const f0=QU(gU(Kj),mf);var Ic={exports:{}},h0;function $U(){if(h0)return Ic.exports;h0=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Ic.exports=t(),Ic.exports.createColors=t,Ic.exports}const ZU={},XU=Object.freeze(Object.defineProperty({__proto__:null,default:ZU},Symbol.toStringTag,{value:"Module"})),nr=TO(XU);var Xh,d0;function EA(){if(d0)return Xh;d0=1;let e=$U(),t=nr;class n extends Error{constructor(i,o,s,a,l,c){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),a&&(this.source=a),c&&(this.plugin=c),typeof o<"u"&&typeof s<"u"&&(typeof o=="number"?(this.line=o,this.column=s):(this.line=o.line,this.column=o.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=e.isColorSupported);let s=h=>h,a=h=>h,l=h=>h;if(i){let{bold:h,gray:p,red:m}=e.createColors(!0);a=g=>h(m(g)),s=g=>p(g),t&&(l=g=>t(g))}let c=o.split(/\r?\n/),u=Math.max(this.line-3,0),f=Math.min(this.line+2,c.length),d=String(f).length;return c.slice(u,f).map((h,p)=>{let m=u+1+p,g=" "+(" "+m).slice(-d)+" | ";if(m===this.line){if(h.length>160){let x=20,b=Math.max(0,this.column-x),y=Math.max(this.column+x,this.endColumn+x),C=h.slice(b,y),w=s(g.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,x-1)).replace(/[^\t]/g," ");return a(">")+s(g)+l(C)+`
920
+ `+w+a("^")}let A=s(g.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+s(g)+l(h)+`
921
+ `+A+a("^")}return" "+s(g)+l(h)}).join(`
922
+ `)}toString(){let i=this.showSourceCode();return i&&(i=`
923
+
924
+ `+i+`
925
+ `),this.name+": "+this.message+i}}return Xh=n,n.default=n,Xh}var ed,p0;function WI(){if(p0)return ed;p0=1;const e=/[\t\n\f\r "#'()/;[\\\]{}]/,t={after:`
926
+ `,beforeClose:`
927
+ `,beforeComment:`
928
+ `,beforeDecl:`
929
+ `,beforeOpen:" ",beforeRule:`
930
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function n(l){return l[0].toUpperCase()+l.slice(1)}function r(l,c){let u="@"+c.name,f=c.params?l.rawValue(c,"params"):"",d=c.raws.afterName;return typeof d>"u"?d=f?" ":"":d===""&&f&&!e.test(f[0])&&(d=" "),u+d+f}function i(l){if(!l.prop.startsWith("--"))return!1;let c=l.raws.before;return typeof c>"u"||!/[^\s;]$/.test(c)}function o(l,c,u){let f=u.nodes,d=f.length-1;for(;d>0&&f[d].type==="comment";)d-=1;let h=l.raw(u,"semicolon"),p=u.type==="document";for(let m=f.length-1;m>=0;m--){let g=f[m],A=d!==m||h;!A&&m<f.length-1&&(g.type==="atrule"&&!g.nodes||g.type==="decl"&&i(g))&&(A=!0),c.push({document:p,node:g,semicolon:A})}}function s(l,c,u,f){let d=l.raw(u,"between","beforeOpen");l.builder(f+d+"{",u,"start");let h=u.nodes&&u.nodes.length,p=()=>{let m=h?l.raw(u,"after"):l.raw(u,"after","emptyBody");m&&l.builder(m),l.builder("}",u,"end"),u.type==="rule"&&u.raws.ownSemicolon&&l.builder(u.raws.ownSemicolon,u,"end")};h?(c.push(p),o(l,c,u)):p()}class a{constructor(c){this.builder=c}atrule(c,u){let f=r(this,c);if(c.nodes)this.block(c,f);else{let d=(c.raws.between||"")+(u?";":"");this.builder(f+d,c)}}beforeAfter(c,u){let f;c.type==="decl"?f=this.raw(c,null,"beforeDecl"):c.type==="comment"?f=this.raw(c,null,"beforeComment"):u==="before"?f=this.raw(c,null,"beforeRule"):f=this.raw(c,null,"beforeClose");let d=c.parent,h=0;for(;d&&d.type!=="root";)h+=1,d=d.parent;if(f.includes(`
931
+ `)){let p=this.raw(c,null,"indent");if(p.length)for(let m=0;m<h;m++)f+=p}return f}block(c,u){let f=this.raw(c,"between","beforeOpen");this.builder(u+f+"{",c,"start");let d;c.nodes&&c.nodes.length?(this.body(c),d=this.raw(c,"after")):d=this.raw(c,"after","emptyBody"),d&&this.builder(d),this.builder("}",c,"end")}body(c){let u=a.prototype,f=["atrule","block","body","rule","stringify"].every(h=>this[h]===u[h]),d=[];for(o(this,d,c);d.length>0;){let h=d.pop();if(typeof h=="function"){h();continue}let p=h.node,m=this.raw(p,"before");m&&this.builder(m),f&&p.type==="rule"?s(this,d,p,this.rawValue(p,"selector")):f&&p.type==="atrule"&&p.nodes?s(this,d,p,r(this,p)):this.stringify(p,h.semicolon)}}comment(c){let u=this.raw(c,"left","commentLeft"),f=this.raw(c,"right","commentRight");this.builder("/*"+u+c.text+f+"*/",c)}decl(c,u){let f=c.raws,d=this.raw(c,"between","colon"),h=c.prop+d+this.rawValue(c,"value");c.important&&(h+=f.important||" !important"),u&&(h+=";"),this.builder(h,c)}document(c){this.body(c)}raw(c,u,f){let d;if(f||(f=u),u&&(d=c.raws[u],typeof d<"u"))return d;let h=c.parent;if(f==="before"&&(!h||h.type==="root"&&h.first===c||h&&h.type==="document"))return"";if(!h)return t[f];let p=c.root(),m=p.rawCache||(p.rawCache={});if(typeof m[f]<"u")return m[f];if(f==="before"||f==="after")return this.beforeAfter(c,f);{let g="raw"+n(f);this[g]?d=this[g](p,c):p.walk(A=>{if(d=A.raws[u],typeof d<"u")return!1})}return typeof d>"u"&&(d=t[f]),m[f]=d,d}rawBeforeClose(c){let u;return c.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return u=f.raws.after,u.includes(`
932
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawBeforeComment(c,u){let f;return c.walkComments(d=>{if(typeof d.raws.before<"u")return f=d.raws.before,f.includes(`
933
+ `)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(u,null,"beforeDecl"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeDecl(c,u){let f;return c.walkDecls(d=>{if(typeof d.raws.before<"u")return f=d.raws.before,f.includes(`
934
+ `)&&(f=f.replace(/[^\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(u,null,"beforeRule"):f&&(f=f.replace(/\S/g,"")),f}rawBeforeOpen(c){let u;return c.walk(f=>{if(f.type!=="decl"&&(u=f.raws.between,typeof u<"u"))return!1}),u}rawBeforeRule(c){let u;return c.walk(f=>{if(f.nodes&&(f.parent!==c||c.first!==f)&&typeof f.raws.before<"u")return u=f.raws.before,u.includes(`
935
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawColon(c){let u;return c.walkDecls(f=>{if(typeof f.raws.between<"u")return u=f.raws.between.replace(/[^\s:]/g,""),!1}),u}rawEmptyBody(c){let u;return c.walk(f=>{if(f.nodes&&f.nodes.length===0&&(u=f.raws.after,typeof u<"u"))return!1}),u}rawIndent(c){if(c.raws.indent)return c.raws.indent;let u;return c.walk(f=>{let d=f.parent;if(d&&d!==c&&d.parent&&d.parent===c&&typeof f.raws.before<"u"){let h=f.raws.before.split(`
936
+ `);return u=h[h.length-1],u=u.replace(/\S/g,""),!1}}),u}rawSemicolon(c){let u;return c.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(u=f.raws.semicolon,typeof u<"u"))return!1}),u}rawValue(c,u){let f=c[u],d=c.raws[u];return d&&d.value===f?d.raw:f}root(c){!(c.parent&&c.parent.type==="document")&&c.source&&c.source.input.hasBOM&&this.builder("\uFEFF",c,"start"),this.body(c),c.raws.after&&this.builder(c.raws.after)}rule(c){this.block(c,this.rawValue(c,"selector")),c.raws.ownSemicolon&&this.builder(c.raws.ownSemicolon,c,"end")}stringify(c,u){if(!this[c.type])throw new Error("Unknown AST node type "+c.type+". Maybe you need to change PostCSS stringifier.");this[c.type](c,u)}}return ed=a,a.default=a,ed}var td,m0;function bf(){if(m0)return td;m0=1;let e=WI();const t=/(<)(\/?style\b)/gi,n=/(<)(!--)/g;function r(s){return s.includes("<")?s.replace(t,"\\3c $2").replace(n,"\\3c $2"):s}class i extends e{escapeHTML(a,l){let c=this.builder,u,f;if(this.builder=(h,p,m)=>{u?(f+=h,u.push(h,p,m)):h.includes("<")?(f=h,u=[h,p,m]):c(h,p,m)},l(),this.builder=c,!u)return;let d=r(f);if(d===f)for(let h=0;h<u.length;h+=3)c(u[h],u[h+1],u[h+2]);else c(d,a,"start")}root(a){a.parent&&a.parent.type==="document"?(this.escapeHTML(a,()=>this.body(a)),a.raws.after&&this.builder(a.raws.after)):this.escapeHTML(a,()=>super.root(a))}}function o(s,a){let l=new i(a);s.type==="root"||s.type==="document"?l.stringify(s):l.escapeHTML(s,()=>l.stringify(s))}return td=o,o.default=o,td}var Ec={},g0;function wf(){return g0||(g0=1,Ec.isClean=Symbol("isClean"),Ec.my=Symbol("my")),Ec}var nd,A0;function xf(){if(A0)return nd;A0=1;let e=EA(),t=WI(),n=bf(),{isClean:r,my:i}=wf();function o(l,c){let u=new l.constructor,f=[[l,u,c]];for(;f.length>0;){let[d,h,p]=f.pop();for(let m in d){if(!Object.prototype.hasOwnProperty.call(d,m)||m==="proxyCache")continue;let g=d[m],A=typeof g;if(m==="parent"&&A==="object")p&&(h[m]=p);else if(m==="source")h[m]=g;else if(Array.isArray(g)){let x=[];h[m]=x;for(let b of g){let y=new b.constructor;x.push(y),f.push([b,y,h])}}else{if(A==="object"&&g!==null){let x=new g.constructor;f.push([g,x,void 0]),g=x}h[m]=g}}}return u}function s(l,c){if(c&&typeof c.offset<"u")return c.offset;let u=1,f=1,d=0;for(let h=0;h<l.length;h++){if(f===c.line&&u===c.column){d=h;break}l[h]===`
937
+ `?(u=1,f+=1):u+=1}return d}class a{get proxyOf(){return this}constructor(c={}){this.raws={},this[r]=!1,this[i]=!0;for(let u of Object.keys(c))if(u!=="__proto__")if(u==="nodes"){this.nodes=[];for(let f of c[u])typeof f.clone=="function"&&f.parent?this.append(f.clone()):this.append(f)}else this[u]=c[u]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\n\s{4}at /.test(c.stack)){let u=this.source;c.stack=c.stack.replace(/\n\s{4}at /,`$&${u.input.from}:${u.start.line}:${u.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let u in c)this[u]=c[u];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let u=o(this);for(let f in c)u[f]=c[f];return u}cloneAfter(c={}){let u=this.clone(c);return this.parent.insertAfter(this,u),u}cloneBefore(c={}){let u=this.clone(c);return this.parent.insertBefore(this,u),u}error(c,u={}){if(this.source){let{end:f,start:d}=this.rangeBy(u);return this.source.input.error(c,{column:d.column,line:d.line},{column:f.column,line:f.line},u)}return new e(c)}getProxyProcessor(){return{get(c,u){return u==="proxyOf"?c:u==="root"?()=>c.root().toProxy():c[u]},set(c,u,f){return c[u]===f||(c[u]=f,(u==="prop"||u==="value"||u==="name"||u==="params"||u==="important"||u==="text")&&c.markDirty()),!0}}}markClean(){this[r]=!0}markDirty(){if(this[r]){this[r]=!1;let c=this;for(;c=c.parent;)c[r]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c={}){let u="document"in this.source.input?this.source.input.document:this.source.input.css,f={column:this.source.start.column,line:this.source.start.line,offset:s(u,this.source.start)};if(c.index)f=this.positionInside(c.index);else if(c.word){let h=u.slice(s(u,this.source.start),s(u,this.source.end)).indexOf(c.word);h!==-1&&(f=this.positionInside(h))}return f}positionInside(c){let u=this.source.start.column,f=this.source.start.line,d="document"in this.source.input?this.source.input.document:this.source.input.css,h=s(d,this.source.start),p=h+c;for(let m=h;m<p;m++)d[m]===`
938
+ `?(u=1,f+=1):u+=1;return{column:u,line:f,offset:p}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c={}){let u="document"in this.source.input?this.source.input.document:this.source.input.css,f={column:this.source.start.column,line:this.source.start.line,offset:s(u,this.source.start)},d=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:s(u,this.source.end)+1}:{column:f.column+1,line:f.line,offset:f.offset+1};if(c.word){let p=u.slice(s(u,this.source.start),s(u,this.source.end)).indexOf(c.word);p!==-1&&(f=this.positionInside(p),d=this.positionInside(p+c.word.length))}else c.start?f={column:c.start.column,line:c.start.line,offset:s(u,c.start)}:typeof c.index=="number"&&(f=this.positionInside(c.index)),c.end?d={column:c.end.column,line:c.end.line,offset:s(u,c.end)}:typeof c.endIndex=="number"?d=this.positionInside(c.endIndex):typeof c.index=="number"&&(d=this.positionInside(c.index+1));return(d.line<f.line||d.line===f.line&&d.column<=f.column)&&(d={column:f.column+1,line:f.line,offset:f.offset+1}),{end:d,start:f}}raw(c,u){return new t().raw(this,c,u)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let u=this,f=!1;for(let d of c)d===this?f=!0:f?(this.parent.insertAfter(u,d),u=d):this.parent.insertBefore(u,d);f||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,u){let f=u==null;u=u||new Map;let d=[],h=[[this,d,0]];for(let m=0;m<h.length;m++){let[g,A,x]=h[m],b={};A[x]=b;for(let y in g){if(!Object.prototype.hasOwnProperty.call(g,y)||y==="parent"||y==="proxyCache")continue;let C=g[y];if(Array.isArray(C)){let w=[];b[y]=w;for(let v=0;v<C.length;v++){let D=C[v];typeof D=="object"&&D.toJSON?D.toJSON===a.prototype.toJSON?h.push([D,w,v]):w[v]=D.toJSON(null,u):w[v]=D}}else if(typeof C=="object"&&C.toJSON)C.toJSON===a.prototype.toJSON?h.push([C,b,y]):b[y]=C.toJSON(null,u);else if(y==="source"){if(C==null)continue;let w=u.get(C.input);w==null&&(w=u.size,u.set(C.input,w)),b[y]={end:C.end,inputId:w,start:C.start}}else b[y]=C}}let p=d[0];return f&&(p.inputs=[...u.keys()].map(m=>m.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=n){c.stringify&&(c=c.stringify);let u="";return c(this,f=>{u+=f}),u}warn(c,u,f={}){let d={node:this};for(let h in f)d[h]=f[h];return c.warn(u,d)}}return nd=a,a.default=a,nd}var rd,y0;function $l(){if(y0)return rd;y0=1;let e=xf();class t extends e{constructor(r){super(r),this.type="comment"}}return rd=t,t.default=t,rd}var id,b0;function kf(){if(b0)return id;b0=1;let e=xf();class t extends e{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(r){r&&typeof r.value<"u"&&typeof r.value!="string"&&(r={...r,value:String(r.value)}),super(r),this.type="decl"}}return id=t,t.default=t,id}var od,w0;function no(){if(w0)return od;w0=1;let e=$l(),t=kf(),n=xf(),{isClean:r,my:i}=wf(),o,s,a,l;function c(d){let h=d.slice();for(;h.length>0;){let p=h.pop();if(delete p.source,p.nodes){p.nodes=p.nodes.slice();for(let m of p.nodes)h.push(m)}}return d.slice()}function u(d){let h=[d];for(;h.length>0;){let p=h.pop();if(p[r]=!1,p.proxyOf.nodes)for(let m of p.proxyOf.nodes)h.push(m)}}class f extends n{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...h){for(let p of h){let m=this.normalize(p,this.last);for(let g of m)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(h){let p=[this];for(;p.length>0;){let m=p.pop();if(m!==this&&m.cleanRaws!==f.prototype.cleanRaws){m.cleanRaws(h);continue}if(n.prototype.cleanRaws.call(m,h),m.nodes)for(let g of m.nodes)p.push(g)}}each(h){if(!this.proxyOf.nodes)return;let p=this.getIterator(),m,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(m=this.indexes[p],g=h(this.proxyOf.nodes[m],m),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(h){return this.nodes.every(h)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let h=this.lastEach;return this.indexes[h]=0,h}getProxyProcessor(){return{get(h,p){return p==="proxyOf"?h:h[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...m)=>h[p](...m.map(g=>typeof g=="function"?(A,x)=>g(A.toProxy(),x):g)):p==="every"||p==="some"?m=>h[p]((g,...A)=>m(g.toProxy(),...A)):p==="root"?()=>h.root().toProxy():p==="nodes"?h.nodes.map(m=>m.toProxy()):p==="first"||p==="last"?h[p].toProxy():h[p]:h[p]},set(h,p,m){return h[p]===m||(h[p]=m,(p==="name"||p==="params"||p==="selector")&&h.markDirty()),!0}}}index(h){return typeof h=="number"?h:(h.proxyOf&&(h=h.proxyOf),this.proxyOf.nodes.indexOf(h))}insertAfter(h,p){let m=this.index(h),g=this.normalize(p,this.proxyOf.nodes[m]).reverse();m=this.index(h);for(let x of g)this.proxyOf.nodes.splice(m+1,0,x);let A;for(let x in this.indexes)A=this.indexes[x],m<A&&(this.indexes[x]=A+g.length);return this.markDirty(),this}insertBefore(h,p){let m=this.index(h),g=m===0?"prepend":!1,A=this.normalize(p,this.proxyOf.nodes[m],g).reverse();m=this.index(h);for(let b of A)this.proxyOf.nodes.splice(m,0,b);let x;for(let b in this.indexes)x=this.indexes[b],m<=x&&(this.indexes[b]=x+A.length);return this.markDirty(),this}normalize(h,p){if(typeof h=="string")h=c(s(h).nodes);else if(typeof h>"u")h=[];else if(Array.isArray(h)){h=h.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type==="root"&&this.type!=="document"){h=h.nodes.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type)h=[h];else if(h.prop){if(typeof h.value>"u")throw new Error("Value field is missed in node creation");typeof h.value!="string"&&(h.value=String(h.value)),h=[new t(h)]}else if(h.selector||h.selectors)h=[new l(h)];else if(h.name)h=[new o(h)];else if(h.text)h=[new e(h)];else throw new Error("Unknown node type in node creation");return h.map(g=>(g[i]||f.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[r]&&u(g),g.raws||(g.raws={}),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...h){h=h.reverse();for(let p of h){let m=this.normalize(p,this.first,"prepend").reverse();for(let g of m)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+m.length}return this.markDirty(),this}push(h){return h.parent=this,this.proxyOf.nodes.push(h),this}removeAll(){for(let h of this.proxyOf.nodes)h.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(h){h=this.index(h),this.proxyOf.nodes[h].parent=void 0,this.proxyOf.nodes.splice(h,1);let p;for(let m in this.indexes)p=this.indexes[m],p>=h&&(this.indexes[m]=p-1);return this.markDirty(),this}replaceValues(h,p,m){return m||(m=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(h,m))}),this.markDirty(),this}some(h){return this.nodes.some(h)}walk(h){if(!this.proxyOf.nodes)return;let p=[{iterator:this.getIterator(),node:this.proxyOf}];for(;p.length>0;){let{iterator:m,node:g}=p[p.length-1],A=g.indexes[m];if(A>=g.proxyOf.nodes.length){delete g.indexes[m],p.pop();let y=p[p.length-1];y&&(y.node.indexes[y.iterator]+=1);continue}let x=g.proxyOf.nodes[A],b;try{b=h(x,A)}catch(y){throw x.addToError(y)}if(b===!1){for(let y of p)delete y.node.indexes[y.iterator];return!1}x.walk&&x.proxyOf.nodes?p.push({iterator:x.getIterator(),node:x}):g.indexes[m]+=1}}walkAtRules(h,p){return p?h instanceof RegExp?this.walk((m,g)=>{if(m.type==="atrule"&&h.test(m.name))return p(m,g)}):this.walk((m,g)=>{if(m.type==="atrule"&&m.name===h)return p(m,g)}):(p=h,this.walk((m,g)=>{if(m.type==="atrule")return p(m,g)}))}walkComments(h){return this.walk((p,m)=>{if(p.type==="comment")return h(p,m)})}walkDecls(h,p){return p?h instanceof RegExp?this.walk((m,g)=>{if(m.type==="decl"&&h.test(m.prop))return p(m,g)}):this.walk((m,g)=>{if(m.type==="decl"&&m.prop===h)return p(m,g)}):(p=h,this.walk((m,g)=>{if(m.type==="decl")return p(m,g)}))}walkRules(h,p){return p?h instanceof RegExp?this.walk((m,g)=>{if(m.type==="rule"&&h.test(m.selector))return p(m,g)}):this.walk((m,g)=>{if(m.type==="rule"&&m.selector===h)return p(m,g)}):(p=h,this.walk((m,g)=>{if(m.type==="rule")return p(m,g)}))}}return f.registerParse=d=>{s=d},f.registerRule=d=>{l=d},f.registerAtRule=d=>{o=d},f.registerRoot=d=>{a=d},od=f,f.default=f,f.rebuild=d=>{let h=[d];for(;h.length>0;){let p=h.pop();if(p.type==="atrule"?Object.setPrototypeOf(p,o.prototype):p.type==="rule"?Object.setPrototypeOf(p,l.prototype):p.type==="decl"?Object.setPrototypeOf(p,t.prototype):p.type==="comment"?Object.setPrototypeOf(p,e.prototype):p.type==="root"&&Object.setPrototypeOf(p,a.prototype),p[i]=!0,p.nodes)for(let m of p.nodes)h.push(m)}},od}var sd,x0;function TA(){if(x0)return sd;x0=1;let e=no();class t extends e{constructor(r){super(r),this.type="atrule"}append(...r){return this.proxyOf.nodes||(this.nodes=[]),super.append(...r)}prepend(...r){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...r)}}return sd=t,t.default=t,e.registerAtRule(t),sd}var ad,k0;function RA(){if(k0)return ad;k0=1;let e=no(),t,n;class r extends e{constructor(o){super({type:"document",...o}),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new n,this,o).stringify()}}return r.registerLazyResult=i=>{t=i},r.registerProcessor=i=>{n=i},ad=r,r.default=r,ad}var ld,C0;function eH(){if(C0)return ld;C0=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return ld={nanoid:(r=21)=>{let i="",o=r|0;for(;o-- >0;)i+=e[Math.random()*64|0];return i},customAlphabet:(r,i=21)=>(o=i)=>{let s="",a=o|0;for(;a-- >0;)s+=r[Math.random()*r.length|0];return s}},ld}var cd,v0;function jI(){if(v0)return cd;v0=1;let{existsSync:e,readFileSync:t,realpathSync:n}=nr,{dirname:r,isAbsolute:i,join:o,relative:s,sep:a}=nr,{SourceMapConsumer:l,SourceMapGenerator:c}=nr;function u(h){try{return n(h)}catch{return h}}function f(h){return Buffer?Buffer.from(h,"base64").toString():window.atob(h)}class d{constructor(p,m){if(m.map===!1)return;m.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(p),this.inline=this.startWith(this.annotation,"data:");let g=m.map?m.map.prev:void 0,A=this.loadMap(m.from,g);!this.mapFile&&m.from&&(this.mapFile=m.from),this.mapFile&&(this.root=r(this.mapFile)),A&&(this.text=A)}consumer(){return this.consumerCache||(this.consumerCache=new l(this.json||this.text)),this.consumerCache}decodeInline(p){let m=/^data:application\/json;charset=utf-?8;base64,/,g=/^data:application\/json;base64,/,A=/^data:application\/json;charset=utf-?8,/,x=/^data:application\/json,/,b=p.match(A)||p.match(x);if(b)return decodeURIComponent(p.substr(b[0].length));let y=p.match(m)||p.match(g);if(y)return f(p.substr(y[0].length));let C=p.slice(22);throw C=C.slice(0,C.indexOf(",")),new Error("Unsupported source map encoding "+C)}getAnnotationURL(p){return p.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(p){return typeof p!="object"?!1:typeof p.mappings=="string"||typeof p._mappings=="string"||Array.isArray(p.sections)}loadAnnotation(p){let m=p.match(/\/\*\s*# sourceMappingURL=/g);if(!m)return;let g=p.lastIndexOf(m.pop()),A=p.indexOf("*/",g);g>-1&&A>-1&&(this.annotation=this.getAnnotationURL(p.substring(g,A)))}loadFile(p,m,g){if(!g&&!this.unsafeMap){if(!/\.map$/i.test(p)||!m)return;let A=s(u(r(m)),u(p));if(A===".."||A.startsWith(".."+a)||i(A))return}if(this.root=r(p),e(p))return this.mapFile=p,t(p,"utf-8").toString().trim()}loadMap(p,m){if(m===!1)return!1;if(m){if(typeof m=="string")return m;if(typeof m=="function"){let g=m(p);if(g){let A=this.loadFile(g,p,!0);if(!A)throw new Error("Unable to load previous source map: "+g.toString());return A}}else{if(m instanceof l)return c.fromSourceMap(m).toString();if(m instanceof c)return m.toString();if(this.isMap(m))return JSON.stringify(m);throw new Error("Unsupported previous source map format: "+m.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let g=this.annotation;p&&(g=o(r(p),g));let A=this.loadFile(g,p,!1);if(A)try{this.json=JSON.parse(A.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return A}}}startWith(p,m){return p?p.substr(0,m.length)===m:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return cd=d,d.default=d,cd}var ud,S0;function Cf(){if(S0)return ud;S0=1;let{nanoid:e}=eH(),{isAbsolute:t,resolve:n}=nr,{SourceMapConsumer:r,SourceMapGenerator:i}=nr,{fileURLToPath:o,pathToFileURL:s}=nr,a=EA(),l=jI(),c=nr,u=Symbol("lineToIndexCache"),f=!!(r&&i),d=!!(n&&t);function h(m){if(m[u])return m[u];let g=m.css.split(`
939
+ `),A=new Array(g.length),x=0;for(let b=0,y=g.length;b<y;b++)A[b]=x,x+=g[b].length+1;return m[u]=A,A}class p{get from(){return this.file||this.id}constructor(g,A={}){if(g===null||typeof g>"u"||typeof g=="object"&&!g.toString)throw new Error(`PostCSS received ${g} instead of CSS string`);if(this.css=g.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,A.document&&(this.document=A.document.toString()),A.from&&(!d||/^\w+:\/\//.test(A.from)||t(A.from)?this.file=A.from:this.file=n(A.from)),d&&f){let x=new l(this.css,A);if(x.text){this.map=x;let b=x.consumer().file;!this.file&&b&&(this.file=this.mapResolve(b))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,A,x,b={}){let y,C,w,v,D;if(A&&typeof A=="object"){let T=A,L=x;if(typeof T.offset=="number"){v=T.offset;let G=this.fromOffset(v);A=G.line,x=G.col}else A=T.line,x=T.column,v=this.fromLineAndColumn(A,x);if(typeof L.offset=="number"){w=L.offset;let G=this.fromOffset(w);C=G.line,y=G.col}else C=L.line,y=L.column,w=this.fromLineAndColumn(L.line,L.column)}else if(x)v=this.fromLineAndColumn(A,x);else{v=A;let T=this.fromOffset(v);A=T.line,x=T.col}let N=this.origin(A,x,C,y);return N?D=new a(g,N.endLine===void 0?N.line:{column:N.column,line:N.line},N.endLine===void 0?N.column:{column:N.endColumn,line:N.endLine},N.source,N.file,b.plugin):D=new a(g,C===void 0?A:{column:x,line:A},C===void 0?x:{column:y,line:C},this.css,this.file,b.plugin),D.input={column:x,endColumn:y,endLine:C,endOffset:w,line:A,offset:v,source:this.css},this.file&&(s&&(D.input.url=s(this.file).toString()),D.input.file=this.file),D}fromLineAndColumn(g,A){return h(this)[g-1]+A-1}fromOffset(g){let A=h(this),x=A[A.length-1],b=0;if(g>=x)b=A.length-1;else{let y=A.length-2,C;for(;b<y;)if(C=b+(y-b>>1),g<A[C])y=C-1;else if(g>=A[C+1])b=C+1;else{b=C;break}}return{col:g-A[b]+1,line:b+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:n(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,A,x,b){if(!this.map)return!1;let y=this.map.consumer(),C=y.originalPositionFor({column:A-1,line:g});if(!C.source)return!1;let w;if(typeof x=="number"){let T=y.originalPositionFor({column:b-1,line:x});T.source&&(w=T)}let v;t(C.source)?v=s(C.source):v=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let D={column:C.column+1,endColumn:w&&w.column+1,endLine:w&&w.line,line:C.line,url:v.toString()};if(v.protocol==="file:")if(o)D.file=o(v);else throw new Error("file: protocol is not available in this PostCSS build");let N=y.sourceContentFor(C.source);return N&&(D.source=N),D}toJSON(){let g={};for(let A of["hasBOM","css","file","id"])this[A]!=null&&(g[A]=this[A]);return this.map&&(g.map={...this.map},g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return ud=p,p.default=p,c&&c.registerInput&&c.registerInput(p),ud}var fd,I0;function Zl(){if(I0)return fd;I0=1;let e=no(),t,n;class r extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,s,a){let l=new Set;for(let u of Array.isArray(o)?o:[o])u&&typeof u=="object"&&!u.parent&&u.raws&&typeof u.raws.before<"u"&&l.add(u.raws);let c=super.normalize(o);if(s){if(a==="prepend")this.nodes.length>1?s.raws.before=this.nodes[1].raws.before:delete s.raws.before;else if(this.first!==s)for(let u of c)l.has(u.raws)||(u.raws.before=s.raws.before)}return c}removeChild(o,s){let a=this.index(o);return!s&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(o)}toResult(o={}){return new t(new n,this,o).stringify()}}return r.registerLazyResult=i=>{t=i},r.registerProcessor=i=>{n=i},fd=r,r.default=r,e.registerRoot(r),fd}var hd,E0;function UI(){if(E0)return hd;E0=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let n=[" ",`
940
+ `," "];return e.split(t,n)},split(t,n,r){if(typeof t!="string")return[];let i=[],o="",s=!1,a=0,l=!1,c="",u=!1,f=!1;for(let h=0;h<t.length;h++){let p=t[h];if(f){o+=p,p==="*"&&t[h+1]==="/"&&(o+="/",h+=1,f=!1);continue}if(u)u=!1;else if(p==="\\")u=!0;else if(l)p===c&&(l=!1);else if(p==='"'||p==="'")l=!0,c=p;else if(p==="/"&&t[h+1]==="*"){o+="/*",h+=1,f=!0;continue}else p==="("?a+=1:p===")"?a>0&&(a-=1):a===0&&n.includes(p)&&(s=!0);if(s){let m=o.trim();(r||m!=="")&&i.push(m),o="",s=!1}else o+=p}let d=o.trim();return(r||d!=="")&&i.push(d),i}};return hd=e,e.default=e,hd}var dd,T0;function _A(){if(T0)return dd;T0=1;let e=no(),t=UI();class n extends e{get selectors(){return t.comma(this.selector)}set selectors(i){let o=this.selector?this.selector.match(/,\s*/):null,s=o?o[0]:","+this.raw("between","beforeOpen");this.selector=i.join(s)}constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}}return dd=n,n.default=n,e.registerRule(n),dd}var pd,R0;function tH(){if(R0)return pd;R0=1;let e=TA(),t=$l(),n=kf(),r=Cf(),i=jI(),o=Zl(),s=_A();function a(u,f){return u.inputs?u.inputs.map(d=>{let h={...d,__proto__:r.prototype};return h.map&&(h.map={...h.map,__proto__:i.prototype}),h}):f}function l(u,f,d){let h={...u};if(delete h.inputs,delete h.nodes,h.source){let{inputId:m,...g}=h.source;h.source=g,m!=null&&(h.source.input=f[m])}let p;if(h.type==="root")p=new o(h);else if(h.type==="decl")p=new n(h);else if(h.type==="rule")p=new s(h);else if(h.type==="comment")p=new t(h);else if(h.type==="atrule")p=new e(h);else throw new Error("Unknown node type: "+u.type);if(d){p.nodes=d;for(let m of d)m.parent=p}return p}function c(u,f){if(Array.isArray(u))return u.map(p=>c(p));let d,h=[{childIndex:0,children:[],inputs:a(u,f),json:u}];for(;h.length>0;){let p=h[h.length-1],m=p.json.nodes;if(m&&p.childIndex<m.length){let A=m[p.childIndex];p.childIndex+=1,h.push({childIndex:0,children:[],inputs:a(A,p.inputs),json:A});continue}h.pop();let g=l(p.json,p.inputs,m?p.children:void 0);h.length>0?h[h.length-1].children.push(g):d=g}return d}return pd=c,c.default=c,pd}var md,_0;function HI(){if(_0)return md;_0=1;let{dirname:e,relative:t,resolve:n,sep:r}=nr,{SourceMapConsumer:i,SourceMapGenerator:o}=nr,{pathToFileURL:s}=nr,a=Cf(),l=!!(i&&o),c=!!(e&&n&&t&&r);class u{constructor(d,h,p,m){this.stringify=d,this.mapOpts=p.map||{},this.root=h,this.opts=p,this.css=m,this.originalCSS=m,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let d;this.isInline()?d="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?d=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?d=this.mapOpts.annotation(this.opts.to,this.root):d=this.outputFile()+".map";let h=`
941
+ `;this.css.includes(`\r
942
+ `)&&(h=`\r
943
+ `),this.css+=h+"/*# sourceMappingURL="+d+" */"}applyPrevMaps(){for(let d of this.previous()){let h=this.toUrl(this.path(d.file)),p=d.root||e(d.file),m;this.mapOpts.sourcesContent===!1?(m=new i(d.text),m.sourcesContent&&(m.sourcesContent=null)):m=d.consumer(),this.map.applySourceMap(m,h,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let d;for(let h=this.root.nodes.length-1;h>=0;h--)d=this.root.nodes[h],d.type==="comment"&&d.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(h)}else if(this.css){let d="/*# sourceMappingURL=",h="",p=0,m;for(;(m=this.css.indexOf(d,p))!==-1;){let g=this.css.indexOf("*/",m+d.length);if(g===-1)break;for(;m>p&&this.css[m-1]===`
944
+ `;)m--;h+=this.css.slice(p,m),p=g+2}p>0&&(this.css=h+this.css.slice(p))}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let d="";return this.stringify(this.root,h=>{d+=h}),[d]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let d=this.previous()[0].consumer();d.file=this.outputFile(),this.map=o.fromSourceMap(d,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let d=1,h=1,p="<no source>",m={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,A;this.stringify(this.root,(x,b,y)=>{if(this.css+=x,b&&y!=="end"&&(m.generated.line=d,m.generated.column=h-1,b.source&&b.source.start?(m.source=this.sourcePath(b),m.original.line=b.source.start.line,m.original.column=b.source.start.column-1,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,this.map.addMapping(m))),A=x.match(/\n/g),A?(d+=A.length,g=x.lastIndexOf(`
945
+ `),h=x.length-g):h+=x.length,b&&y!=="start"){let C=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==C.last||C.raws.semicolon)&&(b.source&&b.source.end?(m.source=this.sourcePath(b),m.original.line=b.source.end.line,m.original.column=b.source.end.column-1,m.generated.line=d,m.generated.column=h-2,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,m.generated.line=d,m.generated.column=h-1,this.map.addMapping(m)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(d=>d.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let d=this.mapOpts.annotation;return typeof d<"u"&&d!==!0?!1:this.previous().length?this.previous().some(h=>h.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(d=>d.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(d){if(this.mapOpts.absolute||d.charCodeAt(0)===60||/^\w+:\/\//.test(d))return d;let h=this.memoizedPaths.get(d);if(h)return h;let p=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=e(n(p,this.mapOpts.annotation)));let m=t(p,d);return this.memoizedPaths.set(d,m),m}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(d=>{if(d.source&&d.source.input.map){let h=d.source.input.map;this.previousMaps.includes(h)||this.previousMaps.push(h)}});else{let d=new a(this.originalCSS,this.opts);d.map&&this.previousMaps.push(d.map)}return this.previousMaps}setSourcesContent(){let d={};if(this.root)this.root.walk(h=>{if(h.source){let p=h.source.input.from;if(p&&!d[p]){d[p]=!0;let m=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(m,h.source.input.css)}}});else if(this.css){let h=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(h,this.css)}}sourcePath(d){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(d.source.input.from):this.toUrl(this.path(d.source.input.from))}toBase64(d){return Buffer?Buffer.from(d).toString("base64"):window.btoa(unescape(encodeURIComponent(d)))}toFileUrl(d){let h=this.memoizedFileURLs.get(d);if(h)return h;if(s){let p=s(d).toString();return this.memoizedFileURLs.set(d,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(d){let h=this.memoizedURLs.get(d);if(h)return h;r==="\\"&&(d=d.replace(/\\/g,"/"));let p=encodeURI(d).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(d,p),p}}return md=u,md}var gd,N0;function KI(){if(N0)return gd;N0=1;const e=39,t=34,n=92,r=47,i=10,o=32,s=12,a=9,l=13,c=91,u=93,f=40,d=41,h=123,p=125,m=59,g=42,A=58,x=64,b=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,C=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return gd=function(D,N={}){let T=D.css.valueOf(),L=N.ignoreErrors,G,X,Y,z,ue,re,le,Be,R,H,_=T.length,k=0,K=[],M=[],V=-1;function me(){return k}function fe(E){throw D.error("Unclosed "+E,k)}function ae(){return M.length===0&&k>=_}function we(E){if(M.length)return M.pop();if(k>=_)return;let B=E?E.ignoreUnclosed:!1;switch(G=T.charCodeAt(k),G){case i:case o:case a:case l:case s:{z=k;do z+=1,G=T.charCodeAt(z);while(G===o||G===i||G===a||G===l||G===s);re=["space",T.slice(k,z)],k=z-1;break}case c:case u:case h:case p:case A:case m:case d:{let q=String.fromCharCode(G);re=[q,q,k];break}case f:{if(H=K.length?K.pop()[1]:"",R=T.charCodeAt(k+1),H==="url"&&R!==e&&R!==t&&R!==o&&R!==i&&R!==a&&R!==s&&R!==l){z=k;do{if(le=!1,z=T.indexOf(")",z+1),z===-1)if(L||B){z=k;break}else fe("bracket");for(Be=z;T.charCodeAt(Be-1)===n;)Be-=1,le=!le}while(le);re=["brackets",T.slice(k,z+1),k,z],k=z}else k<=V?re=["(","(",k]:(z=T.indexOf(")",k+1),X=T.slice(k,z+1),z===-1||C.test(X)?(V=z===-1?_:z,re=["(","(",k]):(re=["brackets",X,k,z],k=z));break}case e:case t:{ue=G===e?"'":'"',z=k;do{if(le=!1,z=T.indexOf(ue,z+1),z===-1)if(L||B){z=k+1;break}else fe("string");for(Be=z;T.charCodeAt(Be-1)===n;)Be-=1,le=!le}while(le);re=["string",T.slice(k,z+1),k,z],k=z;break}case x:{b.lastIndex=k+1,b.test(T),b.lastIndex===0?z=T.length-1:z=b.lastIndex-2,re=["at-word",T.slice(k,z+1),k,z],k=z;break}case n:{for(z=k,Y=!0;T.charCodeAt(z+1)===n;)z+=1,Y=!Y;if(G=T.charCodeAt(z+1),Y&&G!==r&&G!==o&&G!==i&&G!==a&&G!==l&&G!==s&&(z+=1,w.test(T.charAt(z)))){for(;w.test(T.charAt(z+1));)z+=1;T.charCodeAt(z+1)===o&&(z+=1)}re=["word",T.slice(k,z+1),k,z],k=z;break}default:{G===r&&T.charCodeAt(k+1)===g?(z=T.indexOf("*/",k+2)+1,z===0&&(L||B?z=T.length:fe("comment")),re=["comment",T.slice(k,z+1),k,z],k=z):(y.lastIndex=k+1,y.test(T),y.lastIndex===0?z=T.length-1:z=y.lastIndex-2,re=["word",T.slice(k,z+1),k,z],K.push(re),k=z);break}}return k++,re}function I(E){M.push(E)}return{back:I,endOfFile:ae,nextToken:we,position:me}},gd}var Ad,O0;function JI(){if(O0)return Ad;O0=1;let e=TA(),t=$l(),n=kf(),r=Zl(),i=_A(),o=KI();const s={empty:!0,space:!0};function a(u){for(let f=u.length-1;f>=0;f--){let d=u[f],h=d[3]||d[2];if(h)return h}}function l(u,f,d){let h="";for(let p=f;p<d;p++)h+=u[p][1];return h}class c{constructor(f){this.input=f,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:f,start:{column:1,line:1,offset:0}}}atrule(f){let d=new e;d.name=f[1].slice(1),d.name===""&&this.unnamedAtrule(d,f),this.init(d,f[2]);let h,p,m,g=!1,A=!1,x=[],b=[];for(;!this.tokenizer.endOfFile();){if(f=this.tokenizer.nextToken(),h=f[0],h==="("||h==="["?b.push(h==="("?")":"]"):h==="{"&&b.length>0?b.push("}"):h===b[b.length-1]&&b.pop(),b.length===0)if(h===";"){d.source.end=this.getPosition(f[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){A=!0;break}else if(h==="}"){if(x.length>0){for(m=x.length-1,p=x[m];p&&p[0]==="space";)p=x[--m];p&&(d.source.end=this.getPosition(p[3]||p[2]),d.source.end.offset++)}this.end(f);break}else x.push(f);else x.push(f);if(this.tokenizer.endOfFile()){g=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(x),x.length?(d.raws.afterName=this.spacesAndCommentsFromStart(x),this.raw(d,"params",x),g&&(f=x[x.length-1],d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),A&&(d.nodes=[],this.current=d)}checkMissedSemicolon(f){let d=this.colon(f);if(d===!1)return;let h=0,p;for(let m=d-1;m>=0&&(p=f[m],!(p[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",p[0]==="word"?p[3]+1:p[2])}colon(f){let d=0,h,p,m;for(let[g,A]of f.entries()){if(p=A,m=p[0],m==="("&&(d+=1),m===")"&&(d-=1),d===0&&m===":")if(!h)this.doubleColon(p);else{if(h[0]==="word"&&h[1]==="progid")continue;return g}h=p}return!1}comment(f){let d=new t;this.init(d,f[2]),d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++;let h=f[1].slice(2,-2);if(!h.trim())d.text="",d.raws.left=h,d.raws.right="";else{let p=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=p[2],d.raws.left=p[1],d.raws.right=p[3]}}createTokenizer(){this.tokenizer=o(this.input)}decl(f,d){let h=new n;this.init(h,f[0][2]);let p=f[f.length-1];p[0]===";"&&(this.semicolon=!0,f.pop()),h.source.end=this.getPosition(p[3]||p[2]||a(f)),h.source.end.offset++;let m=0;for(;f[m][0]!=="word";)m===f.length-1&&this.unknownWord([f[m]]),m++;h.raws.before+=l(f,0,m),h.source.start=this.getPosition(f[m][2]);let g=m;for(;m<f.length;){let w=f[m][0];if(w===":"||w==="space"||w==="comment")break;m++}h.prop=l(f,g,m);let A=m,x;for(;m<f.length&&(x=f[m],m++,x[0]!==":");)x[0]==="word"&&/\w/.test(x[1])&&this.unknownWord([x]);h.raws.between=l(f,A,m),(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let b=m;for(;m<f.length;){let w=f[m][0];if(w!=="space"&&w!=="comment")break;m++}let y=f.slice(b,m);f=f.slice(m),this.precheckMissedSemicolon(f);for(let w=f.length-1;w>=0;w--){if(x=f[w],x[1].toLowerCase()==="!important"){h.important=!0;let v=this.stringFrom(f,w);v=this.spacesFromEnd(f)+v,v!==" !important"&&(h.raws.important=v);break}else if(x[1].toLowerCase()==="important"){let v=f.slice(0),D="";for(let N=w;N>0;N--){let T=v[N][0];if(D.trim().startsWith("!")&&T!=="space")break;D=v.pop()[1]+D}D.trim().startsWith("!")&&(h.important=!0,h.raws.important=D,f=v)}if(x[0]!=="space"&&x[0]!=="comment")break}f.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(h.raws.between+=y.map(w=>w[1]).join(""),y=[]),this.raw(h,"value",y.concat(f),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(f)}doubleColon(f){throw this.input.error("Double colon",{offset:f[2]},{offset:f[2]+f[1].length})}emptyRule(f){let d=new i;this.init(d,f[2]),d.selector="",d.raws.between="",this.current=d}end(f){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(f[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(f)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(f){if(this.spaces+=f[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="",d.source.end=this.getPosition(f[2]),d.source.end.offset++)}}getPosition(f){let d=this.input.fromOffset(f);return{column:d.col,line:d.line,offset:f}}init(f,d){this.current.push(f),f.source={input:this.input,start:this.getPosition(d)},f.raws.before=this.spaces,this.spaces="",f.type!=="comment"&&(this.semicolon=!1)}other(f){let d=!1,h=null,p=!1,m=null,g=[],A=f[1].startsWith("--"),x=[],b=f;for(;b;){if(h=b[0],x.push(b),h==="("||h==="[")m||(m=b),g.push(h==="("?")":"]");else if(A&&p&&h==="{")m||(m=b),g.push("}");else if(g.length===0)if(h===";")if(p){this.decl(x,A);return}else break;else if(h==="{"){this.rule(x);return}else if(h==="}"){this.tokenizer.back(x.pop()),d=!0;break}else h===":"&&(p=!0);else h===g[g.length-1]&&(g.pop(),g.length===0&&(m=null));b=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),g.length>0&&this.unclosedBracket(m),d&&p){if(!A)for(;x.length&&(b=x[x.length-1][0],!(b!=="space"&&b!=="comment"));)this.tokenizer.back(x.pop());this.decl(x,A)}else this.unknownWord(x)}parse(){let f;for(;!this.tokenizer.endOfFile();)switch(f=this.tokenizer.nextToken(),f[0]){case"space":this.spaces+=f[1];break;case";":this.freeSemicolon(f);break;case"}":this.end(f);break;case"comment":this.comment(f);break;case"at-word":this.atrule(f);break;case"{":this.emptyRule(f);break;default:this.other(f);break}this.endFile()}precheckMissedSemicolon(){}raw(f,d,h,p){let m,g,A=h.length,x="",b="",y=!0,C,w;for(let v=0;v<A;v+=1)m=h[v],g=m[0],g==="space"&&v===A-1&&!p?y=!1:g==="comment"?(w=h[v-1]?h[v-1][0]:"empty",C=h[v+1]?h[v+1][0]:"empty",!s[w]&&!s[C]?b===","?y=!1:(x+=m[1],b=m[1].slice(-1)):y=!1):(x+=m[1],b=m[1].slice(-1));if(!y){let v=h.reduce((D,N)=>D+N[1],"");f.raws[d]={raw:v,value:x}}f[d]=x}rule(f){f.pop();let d=new i;this.init(d,f[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(f),this.raw(d,"selector",f),this.current=d}spacesAndCommentsFromEnd(f){let d,h="";for(;f.length&&(d=f[f.length-1][0],!(d!=="space"&&d!=="comment"));)h=f.pop()[1]+h;return h}spacesAndCommentsFromStart(f){let d,h="";for(;f.length&&(d=f[0][0],!(d!=="space"&&d!=="comment"));)h+=f.shift()[1];return h}spacesFromEnd(f){let d,h="";for(;f.length&&(d=f[f.length-1][0],d==="space");)h=f.pop()[1]+h;return h}stringFrom(f,d){let h="";for(let p=d;p<f.length;p++)h+=f[p][1];return f.splice(d,f.length-d),h}unclosedBlock(){let f=this.current.source.start;throw this.input.error("Unclosed block",f.line,f.column)}unclosedBracket(f){throw this.input.error("Unclosed bracket",{offset:f[2]},{offset:f[2]+1})}unexpectedClose(f){throw this.input.error("Unexpected }",{offset:f[2]},{offset:f[2]+1})}unknownWord(f){throw this.input.error("Unknown word "+f[0][1],{offset:f[0][2]},{offset:f[0][2]+f[0][1].length})}unnamedAtrule(f,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return Ad=c,Ad}var yd,D0;function NA(){if(D0)return yd;D0=1;let e=no(),t=Cf(),n=JI();function r(i,o){let s=new t(i,o),a=new n(s);try{a.parse()}catch(l){throw l}return a.root}return yd=r,r.default=r,e.registerParse(r),yd}var bd,M0;function VI(){if(M0)return bd;M0=1;let e=no(),{my:t}=wf();class n{constructor(i,o={}){if(this.type="warning",this.text=i,o.node&&o.node.source){o.node[t]||e.rebuild(o.node);let s=o.node.rangeBy(o);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in o)this[s]=o[s]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return bd=n,n.default=n,bd}var wd,B0;function OA(){if(B0)return wd;B0=1;let e=VI();class t{get content(){return this.css}constructor(r,i,o){this.processor=r,this.messages=[],this.root=i,this.opts=o,this.css="",this.map=void 0}toString(){return this.css}warn(r,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let o=new e(r,i);return this.messages.push(o),o}warnings(){return this.messages.filter(r=>r.type==="warning")}}return wd=t,t.default=t,wd}var xd,P0;function qI(){if(P0)return xd;P0=1;let e=no(),t=RA(),n=HI(),r=NA(),i=OA(),o=Zl(),s=bf(),{isClean:a,my:l}=wf();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},d=0;function h(b){return typeof b=="object"&&typeof b.then=="function"}function p(b){let y=!1,C=c[b.type];return b.type==="decl"?y=b.prop.toLowerCase():b.type==="atrule"&&(y=b.name.toLowerCase()),y&&b.append?[C,C+"-"+y,d,C+"Exit",C+"Exit-"+y]:y?[C,C+"-"+y,C+"Exit",C+"Exit-"+y]:b.append?[C,d,C+"Exit"]:[C,C+"Exit"]}function m(b){let y;return b.type==="document"?y=["Document",d,"DocumentExit"]:b.type==="root"?y=["Root",d,"RootExit"]:y=p(b),{eventIndex:0,events:y,iterator:0,node:b,visitorIndex:0,visitors:[]}}function g(b){let y=[b];for(;y.length>0;){let C=y.pop();if(C[a]=!1,C.nodes)for(let w of C.nodes)y.push(w)}return b}let A={};class x{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(y,C,w){this.stringified=!1,this.processed=!1;let v;if(typeof C=="object"&&C!==null&&(C.type==="root"||C.type==="document"))v=g(C);else if(C instanceof x||C instanceof i)v=g(C.root),C.map&&(typeof w.map>"u"&&(w.map={}),w.map.inline||(w.map.inline=!1),w.map.prev=C.map);else{let D=r;w.syntax&&(D=w.syntax.parse),w.parser&&(D=w.parser),D.parse&&(D=D.parse);try{v=D(C,w)}catch(N){this.processed=!0,this.error=N}v&&!v[l]&&e.rebuild(v)}this.result=new i(y,v,w),this.helpers={...A,postcss:A,result:this.result},this.plugins=this.processor.plugins.map(D=>typeof D=="object"&&D.prepare?{...D,...D.prepare(this.result)}:D)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(y){return this.async().catch(y)}finally(y){return this.async().then(y,y)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(y,C){let w=this.result.lastPlugin;try{C&&C.addToError(y),this.error=y,y.name==="CssSyntaxError"&&!y.plugin?(y.plugin=w.postcssPlugin,y.setMessage()):w.postcssVersion}catch(v){console&&console.error&&console.error(v)}return y}prepareVisitors(){this.listeners={};let y=(C,w,v)=>{this.listeners[w]||(this.listeners[w]=[]),this.listeners[w].push([C,v])};for(let C of this.plugins)if(typeof C=="object")for(let w in C){if(!u[w]&&/^[A-Z]/.test(w))throw new Error(`Unknown event ${w} in ${C.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[w])if(typeof C[w]=="object")for(let v in C[w])v==="*"?y(C,w,C[w][v]):y(C,w+"-"+v.toLowerCase(),C[w][v]);else typeof C[w]=="function"&&y(C,w,C[w])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let y=0;y<this.plugins.length;y++){let C=this.plugins[y],w=this.runOnRoot(C);if(h(w))try{await w}catch(v){throw this.handleError(v)}}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[a];){y[a]=!0;let C=[m(y)];for(;C.length>0;){let w=this.visitTick(C);if(h(w))try{await w}catch(v){let D=C[C.length-1].node;throw this.handleError(v,D)}}}if(this.listeners.OnceExit)for(let[C,w]of this.listeners.OnceExit){this.result.lastPlugin=C;try{if(y.type==="document"){let v=y.nodes.map(D=>w(D,this.helpers));await Promise.all(v)}else await w(y,this.helpers)}catch(v){throw this.handleError(v)}}}return this.processed=!0,this.stringify()}runOnRoot(y){this.result.lastPlugin=y;try{if(typeof y=="object"&&y.Once){if(this.result.root.type==="document"){let C=this.result.root.nodes.map(w=>y.Once(w,this.helpers));return h(C[0])?Promise.all(C):C}return y.Once(this.result.root,this.helpers)}else if(typeof y=="function")return y(this.result.root,this.result)}catch(C){throw this.handleError(C)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let y=this.result.opts,C=s;y.syntax&&(C=y.syntax.stringify),y.stringifier&&(C=y.stringifier),C.stringify&&(C=C.stringify);let w=this.result.root.source;if(y.map===void 0&&!(w&&w.input&&w.input.map)){let N="";return C(this.result.root,T=>{N+=T}),this.result.css=N,this.result}let D=new n(C,this.result.root,this.result.opts).generate();return this.result.css=D[0],this.result.map=D[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let y of this.plugins){let C=this.runOnRoot(y);if(h(C))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[a];)y[a]=!0,this.walkSync(y);if(this.listeners.OnceExit)if(y.type==="document")for(let C of y.nodes)this.visitSync(this.listeners.OnceExit,C);else this.visitSync(this.listeners.OnceExit,y)}return this.result}then(y,C){return this.async().then(y,C)}toString(){return this.css}visitSync(y,C){for(let[w,v]of y){this.result.lastPlugin=w;let D;try{D=v(C,this.helpers)}catch(N){throw this.handleError(N,C.proxyOf)}if(C.type!=="root"&&C.type!=="document"&&!C.parent)return!0;if(h(D))throw this.getAsyncError()}}visitTick(y){let C=y[y.length-1],{node:w,visitors:v}=C;if(w.type!=="root"&&w.type!=="document"&&!w.parent){y.pop();return}if(v.length>0&&C.visitorIndex<v.length){let[N,T]=v[C.visitorIndex];C.visitorIndex+=1,C.visitorIndex===v.length&&(C.visitors=[],C.visitorIndex=0),this.result.lastPlugin=N;try{return T(w.toProxy(),this.helpers)}catch(L){throw this.handleError(L,w)}}if(C.iterator!==0){let N=C.iterator;C.descending&&(C.descending=!1,w.indexes[N]+=1);let T;for(;T=w.nodes[w.indexes[N]];){if(!T[a]){T[a]=!0,C.descending=!0,y.push(m(T));return}w.indexes[N]+=1}C.iterator=0,delete w.indexes[N]}let D=C.events;for(;C.eventIndex<D.length;){let N=D[C.eventIndex];if(C.eventIndex+=1,N===d){w.nodes&&w.nodes.length&&(w[a]=!0,C.iterator=w.getIterator());return}else if(this.listeners[N]){C.visitors=this.listeners[N];return}}y.pop()}walkSync(y){y[a]=!0;let C=[{eventIndex:0,events:p(y),iterator:0,node:y}];for(;C.length>0;){let w=C[C.length-1],v=w.node;if(w.iterator!==0){let D=w.iterator;w.descending&&(w.descending=!1,v.indexes[D]+=1);let N,T=!1;for(;N=v.nodes[v.indexes[D]];){if(!N[a]){N[a]=!0,w.descending=!0,C.push({eventIndex:0,events:p(N),iterator:0,node:N}),T=!0;break}v.indexes[D]+=1}if(T)continue;w.iterator=0,delete v.indexes[D]}if(w.eventIndex<w.events.length){let D=w.events[w.eventIndex];if(w.eventIndex+=1,D===d)v.nodes&&v.nodes.length&&(w.iterator=v.getIterator());else{let N=this.listeners[D];N&&this.visitSync(N,v.toProxy())&&C.pop()}continue}C.pop()}}warnings(){return this.sync().warnings()}}return x.registerPostcss=b=>{A=b},xd=x,x.default=x,o.registerLazyResult(x),t.registerLazyResult(x),xd}var kd,F0;function nH(){if(F0)return kd;F0=1;let e=HI(),t=NA(),n=OA(),r=bf();class i{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let s,a=t;try{s=a(this._css,this._opts)}catch(l){this.error=l}if(this.error)throw this.error;return this._root=s,s}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(s,a,l){a=a.toString(),this.stringified=!1,this._processor=s,this._css=a,this._opts=l,this._map=void 0;let c=r;this.result=new n(this._processor,void 0,this._opts),this.result.css=a;let u=this;Object.defineProperty(this.result,"root",{get(){return u.root}});let f=new e(c,void 0,this._opts,a);if(f.isMap()){let[d,h]=f.generate();d&&(this.result.css=d),h&&(this.result.map=h)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(s){return this.async().catch(s)}finally(s){return this.async().then(s,s)}sync(){if(this.error)throw this.error;return this.result}then(s,a){return this.async().then(s,a)}toString(){return this._css}warnings(){return[]}}return kd=i,i.default=i,kd}var Cd,L0;function rH(){if(L0)return Cd;L0=1;let e=RA(),t=qI(),n=nH(),r=Zl();class i{constructor(s=[]){this.version="8.5.30",this.plugins=this.normalize(s)}normalize(s){let a=[];for(let l of s)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))a=a.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)a.push(l);else if(typeof l=="function")a.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return a}process(s,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new n(this,s,a):new t(this,s,a)}use(s){return this.plugins=this.plugins.concat(this.normalize([s])),this}}return Cd=i,i.default=i,r.registerProcessor(i),e.registerProcessor(i),Cd}var vd,z0;function GI(){if(z0)return vd;z0=1;var e={};let t=TA(),n=$l(),r=no(),i=EA(),o=kf(),s=RA(),a=tH(),l=Cf(),c=qI(),u=UI(),f=xf(),d=NA(),h=rH(),p=OA(),m=Zl(),g=_A(),A=bf(),x=VI();function b(...y){return y.length===1&&Array.isArray(y[0])&&(y=y[0]),new h(y)}return b.plugin=function(C,w){let v=!1;function D(...T){console&&console.warn&&!v&&(v=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
946
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),e.LANG&&e.LANG.startsWith("zh")&&console.warn(C+`: 里面 postcss.plugin 被弃用. 迁移指南:
947
+ https://www.w3ctech.com/topic/2226`));let L=w(...T);return L.postcssPlugin=C,L.postcssVersion=new h().version,L}let N;return Object.defineProperty(D,"postcss",{get(){return N||(N=D()),N}}),D.process=function(T,L,G){return b([D(G)]).process(T,L)},D},b.stringify=A,b.parse=d,b.fromJSON=a,b.list=u,b.comment=y=>new n(y),b.atRule=y=>new t(y),b.decl=y=>new o(y),b.rule=y=>new g(y),b.root=y=>new m(y),b.document=y=>new s(y),b.CssSyntaxError=i,b.Declaration=o,b.Container=r,b.Processor=h,b.Document=s,b.Comment=n,b.Warning=x,b.AtRule=t,b.Result=p,b.Input=l,b.Rule=g,b.Root=m,b.Node=f,c.registerPostcss(b),vd=b,b.default=b,vd}var iH=GI();const ft=_l(iH);ft.stringify;ft.fromJSON;ft.plugin;ft.parse;ft.list;ft.document;ft.comment;ft.atRule;ft.rule;ft.decl;ft.root;ft.CssSyntaxError;ft.Declaration;ft.Container;ft.Processor;ft.Document;ft.Comment;ft.Warning;ft.AtRule;ft.Result;ft.Input;ft.Rule;ft.Root;ft.Node;var Sd,W0;function oH(){if(W0)return Sd;W0=1;let e=$l(),t=JI(),n=KI();class r extends t{checkMissedSemicolon(){}comment(o){let s=new e;this.init(s,o[2]);let a=this.input.fromOffset(o[3])||this.input.fromOffset(this.input.css.length-1);s.source.end={column:a.col,line:a.line,offset:o[3]+1};let l=o[1].slice(2);if(l.slice(-2)==="*/"&&(l=l.slice(0,-2)),/^\s*$/.test(l))s.text="",s.raws.left=l,s.raws.right="";else{let c=l.match(/^(\s*)([^]*\S)(\s*)$/);s.text=c[2],s.raws.left=c[1],s.raws.right=c[3]}}createTokenizer(){this.tokenizer=n(this.input,{ignoreErrors:!0})}decl(o){o.length>1&&o.some(s=>s[0]==="word")&&super.decl(o)}doubleColon(){}endFile(){for(this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.current.parent;)this.current=this.current.parent,this.current.raws.after="";this.root.source.end=this.getPosition(this.tokenizer.position())}precheckMissedSemicolon(o){let s=this.colon(o);if(s===!1)return;let a,l;for(a=s-1;a>=0&&o[a][0]!=="word";a--);if(a<=0)return;for(l=a-1;l>=0;l--)if(o[l][0]!=="space"){l+=1;break}let c=o.slice(a),u=o.slice(l,a);o.splice(l,o.length-l),this.spaces=u.map(f=>f[1]).join(""),this.decl(c)}unclosedBracket(){}unexpectedClose(){this.current.raws.after+="}"}unknownWord(o){this.spaces+=o.map(s=>s[1]).join("")}unnamedAtrule(o){o.name=""}}return Sd=r,Sd}var Id,j0;function sH(){if(j0)return Id;j0=1;let{Input:e}=GI(),t=oH();return Id=function(r,i){let o=new e(r,i),s=new t(o);return s.parse(),s.root},Id}var aH=sH();const QI=_l(aH);var cs={},Mt={},gi={},St={},la={},Tc={},U0;function YI(){if(U0)return Tc;U0=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=n;function e(r){for(var i=r.toLowerCase(),o="",s=!1,a=0;a<6&&i[a]!==void 0;a++){var l=i.charCodeAt(a),c=l>=97&&l<=102||l>=48&&l<=57;if(s=l===32,!c)break;o+=i[a]}if(o.length!==0){var u=parseInt(o,16),f=u>=55296&&u<=57343;return f||u===0||u>1114111?["�",o.length+(s?1:0)]:[String.fromCodePoint(u),o.length+(s?1:0)]}}var t=/\\/;function n(r){var i=t.test(r);if(!i)return r;for(var o="",s=0;s<r.length;s++){if(r[s]==="\\"){var a=e(r.slice(s+1,s+7));if(a!==void 0){o+=a[0],s+=a[1];continue}if(r[s+1]==="\\"){o+="\\",s++;continue}r.length===s+1&&(o+=r[s]);continue}o+=r[s]}return o}return Tc}var Rc={},H0;function lH(){if(H0)return Rc;H0=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.default=e;function e(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(;n.length>0;){var i=n.shift();if(!t[i])return;t=t[i]}return t}return Rc}var _c={},K0;function cH(){if(K0)return _c;K0=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.default=e;function e(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(;n.length>0;){var i=n.shift();t[i]||(t[i]={}),t=t[i]}}return _c}var Nc={},J0;function uH(){if(J0)return Nc;J0=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.default=e;function e(t){for(var n="",r=t.indexOf("/*"),i=0;r>=0;){n=n+t.slice(i,r);var o=t.indexOf("*/",r+2);if(o<0)return n;i=o+2,r=t.indexOf("/*",i)}return n=n+t.slice(i),n}return Nc}var Ed={},V0;function fH(){return V0||(V0=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_NESTING_DEPTH=void 0,e.default=t,e.MAX_NESTING_DEPTH=256;function t(n){return Number.isSafeInteger(n)&&n>=0?n:e.MAX_NESTING_DEPTH}})(Ed)),Ed}var q0;function Xl(){return q0||(q0=1,(function(e){var t=la&&la.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_NESTING_DEPTH=e.resolveMaxNestingDepth=e.stripComments=e.ensureObject=e.getProp=e.unesc=void 0;var n=YI();Object.defineProperty(e,"unesc",{enumerable:!0,get:function(){return t(n).default}});var r=lH();Object.defineProperty(e,"getProp",{enumerable:!0,get:function(){return t(r).default}});var i=cH();Object.defineProperty(e,"ensureObject",{enumerable:!0,get:function(){return t(i).default}});var o=uH();Object.defineProperty(e,"stripComments",{enumerable:!0,get:function(){return t(o).default}});var s=fH();Object.defineProperty(e,"resolveMaxNestingDepth",{enumerable:!0,get:function(){return t(s).default}}),Object.defineProperty(e,"MAX_NESTING_DEPTH",{enumerable:!0,get:function(){return s.MAX_NESTING_DEPTH}})})(la)),la}var Oc={},G0;function ro(){if(G0)return Oc;G0=1,Object.defineProperty(Oc,"__esModule",{value:!0});var e=Xl(),t=function(r,i,o){if(o===void 0&&(o=0),o>e.MAX_NESTING_DEPTH)throw new Error("Cannot clone selector: nesting depth exceeds the maximum of ".concat(e.MAX_NESTING_DEPTH,"."));if(typeof r!="object"||r===null)return r;var s=new r.constructor;for(var a in r)if(r.hasOwnProperty(a)){var l=r[a],c=typeof l;a==="parent"&&c==="object"?i&&(s[a]=i):l instanceof Array?s[a]=l.map(function(u){return t(u,s,o+1)}):s[a]=t(l,s,o+1)}return s},n=(function(){function r(i){i===void 0&&(i={}),Object.assign(this,i),this.spaces=this.spaces||{},this.spaces.before=this.spaces.before||"",this.spaces.after=this.spaces.after||""}return r.prototype.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},r.prototype.replaceWith=function(){if(this.parent){for(var i in arguments)this.parent.insertBefore(this,arguments[i]);this.remove()}return this},r.prototype.next=function(){return this.parent.at(this.parent.index(this)+1)},r.prototype.prev=function(){return this.parent.at(this.parent.index(this)-1)},r.prototype.clone=function(i){i===void 0&&(i={});var o=t(this);for(var s in i)o[s]=i[s];return o},r.prototype.appendToPropertyAndEscape=function(i,o,s){this.raws||(this.raws={});var a=this[i],l=this.raws[i];this[i]=a+o,l||s!==o?this.raws[i]=(l||a)+s:delete this.raws[i]},r.prototype.setPropertyAndEscape=function(i,o,s){this.raws||(this.raws={}),this[i]=o,this.raws[i]=s},r.prototype.setPropertyWithoutEscape=function(i,o){this[i]=o,this.raws&&delete this.raws[i]},r.prototype.isAtPosition=function(i,o){if(this.source&&this.source.start&&this.source.end)return!(this.source.start.line>i||this.source.end.line<i||this.source.start.line===i&&this.source.start.column>o||this.source.end.line===i&&this.source.end.column<o)},r.prototype.stringifyProperty=function(i){return this.raws&&this.raws[i]||this[i]},Object.defineProperty(r.prototype,"rawSpaceBefore",{get:function(){var i=this.raws&&this.raws.spaces&&this.raws.spaces.before;return i===void 0&&(i=this.spaces&&this.spaces.before),i||""},set:function(i){(0,e.ensureObject)(this,"raws","spaces"),this.raws.spaces.before=i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rawSpaceAfter",{get:function(){var i=this.raws&&this.raws.spaces&&this.raws.spaces.after;return i===void 0&&(i=this.spaces.after),i||""},set:function(i){(0,e.ensureObject)(this,"raws","spaces"),this.raws.spaces.after=i},enumerable:!1,configurable:!0}),r.prototype.valueToString=function(){return String(this.stringifyProperty("value"))},r.prototype.toString=function(){return[this.rawSpaceBefore,this.valueToString(),this.rawSpaceAfter].join("")},r.prototype._stringify=function(){return this.toString()},r})();return Oc.default=n,Oc}var it={},Q0;function nn(){return Q0||(Q0=1,Object.defineProperty(it,"__esModule",{value:!0}),it.UNIVERSAL=it.ATTRIBUTE=it.CLASS=it.COMBINATOR=it.COMMENT=it.ID=it.NESTING=it.PSEUDO=it.ROOT=it.SELECTOR=it.STRING=it.TAG=void 0,it.TAG="tag",it.STRING="string",it.SELECTOR="selector",it.ROOT="root",it.PSEUDO="pseudo",it.NESTING="nesting",it.ID="id",it.COMMENT="comment",it.COMBINATOR="combinator",it.CLASS="class",it.ATTRIBUTE="attribute",it.UNIVERSAL="universal"),it}var Y0;function DA(){if(Y0)return St;Y0=1;var e=St&&St.__extends||(function(){var d=function(h,p){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var A in g)Object.prototype.hasOwnProperty.call(g,A)&&(m[A]=g[A])},d(h,p)};return function(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");d(h,p);function m(){this.constructor=h}h.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})(),t=St&&St.__createBinding||(Object.create?(function(d,h,p,m){m===void 0&&(m=p);var g=Object.getOwnPropertyDescriptor(h,p);(!g||("get"in g?!h.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return h[p]}}),Object.defineProperty(d,m,g)}):(function(d,h,p,m){m===void 0&&(m=p),d[m]=h[p]})),n=St&&St.__setModuleDefault||(Object.create?(function(d,h){Object.defineProperty(d,"default",{enumerable:!0,value:h})}):function(d,h){d.default=h}),r=St&&St.__importStar||(function(){var d=function(h){return d=Object.getOwnPropertyNames||function(p){var m=[];for(var g in p)Object.prototype.hasOwnProperty.call(p,g)&&(m[m.length]=g);return m},d(h)};return function(h){if(h&&h.__esModule)return h;var p={};if(h!=null)for(var m=d(h),g=0;g<m.length;g++)m[g]!=="default"&&t(p,h,m[g]);return n(p,h),p}})(),i=St&&St.__values||function(d){var h=typeof Symbol=="function"&&Symbol.iterator,p=h&&d[h],m=0;if(p)return p.call(d);if(d&&typeof d.length=="number")return{next:function(){return d&&m>=d.length&&(d=void 0),{value:d&&d[m++],done:!d}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")},o=St&&St.__read||function(d,h){var p=typeof Symbol=="function"&&d[Symbol.iterator];if(!p)return d;var m=p.call(d),g,A=[],x;try{for(;(h===void 0||h-- >0)&&!(g=m.next()).done;)A.push(g.value)}catch(b){x={error:b}}finally{try{g&&!g.done&&(p=m.return)&&p.call(m)}finally{if(x)throw x.error}}return A},s=St&&St.__spreadArray||function(d,h,p){if(p||arguments.length===2)for(var m=0,g=h.length,A;m<g;m++)(A||!(m in h))&&(A||(A=Array.prototype.slice.call(h,0,m)),A[m]=h[m]);return d.concat(A||Array.prototype.slice.call(h))},a=St&&St.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(St,"__esModule",{value:!0});var l=Xl(),c=a(ro()),u=r(nn()),f=(function(d){e(h,d);function h(p){var m=d.call(this,p)||this;return m.nodes||(m.nodes=[]),m}return h.prototype.append=function(p){return p.parent=this,this.nodes.push(p),this},h.prototype.prepend=function(p){p.parent=this,this.nodes.unshift(p);for(var m in this.indexes)this.indexes[m]++;return this},h.prototype.at=function(p){return this.nodes[p]},h.prototype.index=function(p){return typeof p=="number"?p:this.nodes.indexOf(p)},Object.defineProperty(h.prototype,"first",{get:function(){return this.at(0)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"last",{get:function(){return this.at(this.length-1)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"length",{get:function(){return this.nodes.length},enumerable:!1,configurable:!0}),h.prototype.removeChild=function(p){p=this.index(p),this.at(p).parent=void 0,this.nodes.splice(p,1);var m;for(var g in this.indexes)m=this.indexes[g],m>=p&&(this.indexes[g]=m-1);return this},h.prototype.removeAll=function(){var p,m;try{for(var g=i(this.nodes),A=g.next();!A.done;A=g.next()){var x=A.value;x.parent=void 0}}catch(b){p={error:b}}finally{try{A&&!A.done&&(m=g.return)&&m.call(g)}finally{if(p)throw p.error}}return this.nodes=[],this},h.prototype.empty=function(){return this.removeAll()},h.prototype.insertAfter=function(p,m){var g;m.parent=this;for(var A=this.index(p),x=[],b=2;b<arguments.length;b++)x.push(arguments[b]);(g=this.nodes).splice.apply(g,s([A+1,0,m],o(x),!1)),m.parent=this;var y;for(var C in this.indexes)y=this.indexes[C],A<y&&(this.indexes[C]=y+arguments.length-1);return this},h.prototype.insertBefore=function(p,m){var g;m.parent=this;for(var A=this.index(p),x=[],b=2;b<arguments.length;b++)x.push(arguments[b]);(g=this.nodes).splice.apply(g,s([A,0,m],o(x),!1)),m.parent=this;var y;for(var C in this.indexes)y=this.indexes[C],y>=A&&(this.indexes[C]=y+arguments.length-1);return this},h.prototype._findChildAtPosition=function(p,m){var g=void 0;return this.each(function(A){if(A.atPosition){var x=A.atPosition(p,m);if(x)return g=x,!1}else if(A.isAtPosition(p,m))return g=A,!1}),g},h.prototype.atPosition=function(p,m){if(this.isAtPosition(p,m))return this._findChildAtPosition(p,m)||this},h.prototype._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},h.prototype.each=function(p){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var m=this.lastEach;if(this.indexes[m]=0,!!this.length){for(var g,A;this.indexes[m]<this.length&&(g=this.indexes[m],A=p(this.at(g),g),A!==!1);)this.indexes[m]+=1;if(delete this.indexes[m],A===!1)return!1}},h.prototype.walk=function(p,m){if(m===void 0&&(m=0),m>l.MAX_NESTING_DEPTH)throw new Error("Cannot walk selector: nesting depth exceeds the maximum of ".concat(l.MAX_NESTING_DEPTH,"."));return this.each(function(g,A){var x=p(g,A);if(x!==!1&&g.length&&(x=g.walk(p,m+1)),x===!1)return!1})},h.prototype.walkAttributes=function(p){var m=this;return this.walk(function(g){if(g.type===u.ATTRIBUTE)return p.call(m,g)})},h.prototype.walkClasses=function(p){var m=this;return this.walk(function(g){if(g.type===u.CLASS)return p.call(m,g)})},h.prototype.walkCombinators=function(p){var m=this;return this.walk(function(g){if(g.type===u.COMBINATOR)return p.call(m,g)})},h.prototype.walkComments=function(p){var m=this;return this.walk(function(g){if(g.type===u.COMMENT)return p.call(m,g)})},h.prototype.walkIds=function(p){var m=this;return this.walk(function(g){if(g.type===u.ID)return p.call(m,g)})},h.prototype.walkNesting=function(p){var m=this;return this.walk(function(g){if(g.type===u.NESTING)return p.call(m,g)})},h.prototype.walkPseudos=function(p){var m=this;return this.walk(function(g){if(g.type===u.PSEUDO)return p.call(m,g)})},h.prototype.walkTags=function(p){var m=this;return this.walk(function(g){if(g.type===u.TAG)return p.call(m,g)})},h.prototype.walkUniversals=function(p){var m=this;return this.walk(function(g){if(g.type===u.UNIVERSAL)return p.call(m,g)})},h.prototype.split=function(p){var m=this,g=[];return this.reduce(function(A,x,b){var y=p.call(m,x);return g.push(x),y?(A.push(g),g=[]):b===m.length-1&&A.push(g),A},[])},h.prototype.map=function(p){return this.nodes.map(p)},h.prototype.reduce=function(p,m){return this.nodes.reduce(p,m)},h.prototype.every=function(p){return this.nodes.every(p)},h.prototype.some=function(p){return this.nodes.some(p)},h.prototype.filter=function(p){return this.nodes.filter(p)},h.prototype.sort=function(p){return this.nodes.sort(p)},h.prototype.toString=function(p){return p===void 0&&(p={}),this._stringify(p,0,(0,l.resolveMaxNestingDepth)(p.maxNestingDepth))},h.prototype._stringify=function(p,m,g){var A=this;return this.map(function(x){return A._stringifyChild(x,p,m,g)}).join("")},h.prototype._stringifyChild=function(p,m,g,A){return typeof p._stringify=="function"?p._stringify(m,g,A):String(p)},h})(c.default);return St.default=f,St}var $0;function $I(){if($0)return gi;$0=1;var e=gi&&gi.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=gi&&gi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(gi,"__esModule",{value:!0});var n=t(DA()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.ROOT,l}return s.prototype._stringify=function(a,l,c){var u=this,f=this.reduce(function(d,h){return d.push(u._stringifyChild(h,a,l,c)),d},[]).join(",");return this.trailingComma?f+",":f},s.prototype.error=function(a,l){return this._error?this._error(a,l):new Error(a)},Object.defineProperty(s.prototype,"errorGenerator",{set:function(a){this._error=a},enumerable:!1,configurable:!0}),s})(n.default);return gi.default=i,gi}var Ai={},Z0;function ZI(){if(Z0)return Ai;Z0=1;var e=Ai&&Ai.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=Ai&&Ai.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ai,"__esModule",{value:!0});var n=t(DA()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.SELECTOR,l}return s})(n.default);return Ai.default=i,Ai}var yi={};var Td,X0;function MA(){if(X0)return Td;X0=1;var e={},t=e.hasOwnProperty,n=function(l,c){if(!l)return c;var u={};for(var f in c)u[f]=t.call(l,f)?l[f]:c[f];return u},r=/[ -,\.\/:-@\[-\^`\{-~]/,i=/[ -,\.\/:-@\[\]\^`\{-~]/,o=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,s=function a(l,c){c=n(c,a.options),c.quotes!="single"&&c.quotes!="double"&&(c.quotes="single");for(var u=c.quotes=="double"?'"':"'",f=c.isIdentifier,d=l.charAt(0),h="",p=0,m=l.length;p<m;){var g=l.charAt(p++),A=g.charCodeAt(),x=void 0;if(A<32||A>126){if(A>=55296&&A<=56319&&p<m){var b=l.charCodeAt(p++);(b&64512)==56320?A=((A&1023)<<10)+(b&1023)+65536:p--}x="\\"+A.toString(16).toUpperCase()+" "}else c.escapeEverything?r.test(g)?x="\\"+g:x="\\"+A.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(g)?x="\\"+A.toString(16).toUpperCase()+" ":g=="\\"||!f&&(g=='"'&&u==g||g=="'"&&u==g)||f&&i.test(g)?x="\\"+g:x=g;h+=x}return f&&(/^-[-\d]/.test(h)?h="\\-"+h.slice(1):/\d/.test(d)&&(h="\\3"+d+" "+h.slice(1))),h=h.replace(o,function(y,C,w){return C&&C.length%2?y:(C||"")+w}),!f&&c.wrap?u+h+u:h};return s.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},s.version="3.0.0",Td=s,Td}var ex;function XI(){if(ex)return yi;ex=1;var e=yi&&yi.__extends||(function(){var a=function(l,c){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d])},a(l,c)};return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");a(l,c);function u(){this.constructor=l}l.prototype=c===null?Object.create(c):(u.prototype=c.prototype,new u)}})(),t=yi&&yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(yi,"__esModule",{value:!0});var n=t(MA()),r=Xl(),i=t(ro()),o=nn(),s=(function(a){e(l,a);function l(c){var u=a.call(this,c)||this;return u.type=o.CLASS,u._constructed=!0,u}return Object.defineProperty(l.prototype,"value",{get:function(){return this._value},set:function(c){if(this._constructed){var u=(0,n.default)(c,{isIdentifier:!0});u!==c?((0,r.ensureObject)(this,"raws"),this.raws.value=u):this.raws&&delete this.raws.value}this._value=c},enumerable:!1,configurable:!0}),l.prototype.valueToString=function(){return"."+a.prototype.valueToString.call(this)},l})(i.default);return yi.default=s,yi}var bi={},tx;function eE(){if(tx)return bi;tx=1;var e=bi&&bi.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=bi&&bi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(bi,"__esModule",{value:!0});var n=t(ro()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.COMMENT,l}return s})(n.default);return bi.default=i,bi}var wi={},nx;function tE(){if(nx)return wi;nx=1;var e=wi&&wi.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=wi&&wi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(wi,"__esModule",{value:!0});var n=t(ro()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.ID,l}return s.prototype.valueToString=function(){return"#"+o.prototype.valueToString.call(this)},s})(n.default);return wi.default=i,wi}var xi={},ki={},rx;function BA(){if(rx)return ki;rx=1;var e=ki&&ki.__extends||(function(){var s=function(a,l){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,u){c.__proto__=u}||function(c,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(c[f]=u[f])},s(a,l)};return function(a,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");s(a,l);function c(){this.constructor=a}a.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)}})(),t=ki&&ki.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ki,"__esModule",{value:!0});var n=t(MA()),r=Xl(),i=t(ro()),o=(function(s){e(a,s);function a(){return s!==null&&s.apply(this,arguments)||this}return Object.defineProperty(a.prototype,"namespace",{get:function(){return this._namespace},set:function(l){if(l===!0||l==="*"||l==="&"){this._namespace=l,this.raws&&delete this.raws.namespace;return}var c=(0,n.default)(l,{isIdentifier:!0});this._namespace=l,c!==l?((0,r.ensureObject)(this,"raws"),this.raws.namespace=c):this.raws&&delete this.raws.namespace},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ns",{get:function(){return this._namespace},set:function(l){this.namespace=l},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"namespaceString",{get:function(){if(this.namespace){var l=this.stringifyProperty("namespace");return l===!0?"":l}else return""},enumerable:!1,configurable:!0}),a.prototype.qualifiedName=function(l){return this.namespace?"".concat(this.namespaceString,"|").concat(l):l},a.prototype.valueToString=function(){return this.qualifiedName(s.prototype.valueToString.call(this))},a})(i.default);return ki.default=o,ki}var ix;function nE(){if(ix)return xi;ix=1;var e=xi&&xi.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=xi&&xi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(xi,"__esModule",{value:!0});var n=t(BA()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.TAG,l}return s})(n.default);return xi.default=i,xi}var Ci={},ox;function rE(){if(ox)return Ci;ox=1;var e=Ci&&Ci.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+i(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=Ci&&Ci.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ci,"__esModule",{value:!0});var n=t(ro()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.STRING,l}return s})(n.default);return Ci.default=i,Ci}var vi={},sx;function iE(){if(sx)return vi;sx=1;var e=vi&&vi.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=vi&&vi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(vi,"__esModule",{value:!0});var n=t(DA()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.PSEUDO,l}return s.prototype._stringify=function(a,l,c){var u=this;if(l>=c)throw new Error("Cannot serialize selector: nesting depth exceeds the maximum of ".concat(c,"."));var f=this.length?"("+this.map(function(d){return u._stringifyChild(d,a,l+1,c)}).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),f,this.rawSpaceAfter].join("")},s})(n.default);return vi.default=i,vi}var zr={},Rd,ax;function hH(){if(ax)return Rd;ax=1,Rd=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function o(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return o}function t(n){try{if(!eb.localStorage)return!1}catch{return!1}var r=eb.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return Rd}var lx;function oE(){if(lx)return zr;lx=1;var e=zr&&zr.__extends||(function(){var A=function(x,b){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,C){y.__proto__=C}||function(y,C){for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(y[w]=C[w])},A(x,b)};return function(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");A(x,b);function y(){this.constructor=x}x.prototype=b===null?Object.create(b):(y.prototype=b.prototype,new y)}})(),t=zr&&zr.__importDefault||function(A){return A&&A.__esModule?A:{default:A}},n;Object.defineProperty(zr,"__esModule",{value:!0}),zr.unescapeValue=d;var r=t(MA()),i=t(YI()),o=t(BA()),s=nn(),a=hH(),l=/^('|")([^]*)\1$/,c=a(function(){},"Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."),u=a(function(){},"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."),f=a(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function d(A){var x=!1,b=null,y=A,C=y.match(l);return C&&(b=C[1],y=C[2]),y=(0,i.default)(y),y!==A&&(x=!0),{deprecatedUsage:x,unescaped:y,quoteMark:b}}function h(A){if(A.quoteMark!==void 0||A.value===void 0)return A;f();var x=d(A.value),b=x.quoteMark,y=x.unescaped;return A.raws||(A.raws={}),A.raws.value===void 0&&(A.raws.value=A.value),A.value=y,A.quoteMark=b,A}var p=(function(A){e(x,A);function x(b){b===void 0&&(b={});var y=A.call(this,h(b))||this;return y.type=s.ATTRIBUTE,y.raws=y.raws||{},Object.defineProperty(y.raws,"unquoted",{get:a(function(){return y.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:a(function(){return y.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),y._constructed=!0,y}return x.prototype.getQuotedValue=function(b){b===void 0&&(b={});var y=this._determineQuoteMark(b),C=m[y],w=(0,r.default)(this._value,C);return w},x.prototype._determineQuoteMark=function(b){return b.smart?this.smartQuoteMark(b):this.preferredQuoteMark(b)},x.prototype.setValue=function(b,y){y===void 0&&(y={}),this._value=b,this._quoteMark=this._determineQuoteMark(y),this._syncRawValue()},x.prototype.smartQuoteMark=function(b){var y=this.value,C=y.replace(/[^']/g,"").length,w=y.replace(/[^"]/g,"").length;if(C+w===0){var v=(0,r.default)(y,{isIdentifier:!0});if(v===y)return x.NO_QUOTE;var D=this.preferredQuoteMark(b);if(D===x.NO_QUOTE){var N=this.quoteMark||b.quoteMark||x.DOUBLE_QUOTE,T=m[N],L=(0,r.default)(y,T);if(L.length<v.length)return N}return D}else return w===C?this.preferredQuoteMark(b):w<C?x.DOUBLE_QUOTE:x.SINGLE_QUOTE},x.prototype.preferredQuoteMark=function(b){var y=b.preferCurrentQuoteMark?this.quoteMark:b.quoteMark;return y===void 0&&(y=b.preferCurrentQuoteMark?b.quoteMark:this.quoteMark),y===void 0&&(y=x.DOUBLE_QUOTE),y},Object.defineProperty(x.prototype,"quoted",{get:function(){var b=this.quoteMark;return b==="'"||b==='"'},set:function(b){u()},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"quoteMark",{get:function(){return this._quoteMark},set:function(b){if(!this._constructed){this._quoteMark=b;return}this._quoteMark!==b&&(this._quoteMark=b,this._syncRawValue())},enumerable:!1,configurable:!0}),x.prototype._syncRawValue=function(){var b=(0,r.default)(this._value,m[this.quoteMark]);b===this._value?this.raws&&delete this.raws.value:this.raws.value=b},Object.defineProperty(x.prototype,"qualifiedAttribute",{get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"insensitiveFlag",{get:function(){return this.insensitive?"i":""},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"value",{get:function(){return this._value},set:function(b){if(this._constructed){var y=d(b),C=y.deprecatedUsage,w=y.unescaped,v=y.quoteMark;if(C&&c(),w===this._value&&v===this._quoteMark)return;this._value=w,this._quoteMark=v,this._syncRawValue()}else this._value=b},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"insensitive",{get:function(){return this._insensitive},set:function(b){b||(this._insensitive=!1,this.raws&&(this.raws.insensitiveFlag==="I"||this.raws.insensitiveFlag==="i")&&(this.raws.insensitiveFlag=void 0)),this._insensitive=b},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"attribute",{get:function(){return this._attribute},set:function(b){this._handleEscapes("attribute",b),this._attribute=b},enumerable:!1,configurable:!0}),x.prototype._handleEscapes=function(b,y){if(this._constructed){var C=(0,r.default)(y,{isIdentifier:!0});C!==y?this.raws[b]=C:delete this.raws[b]}},x.prototype._spacesFor=function(b){var y={before:"",after:""},C=this.spaces[b]||{},w=this.raws.spaces&&this.raws.spaces[b]||{};return Object.assign(y,C,w)},x.prototype._stringFor=function(b,y,C){y===void 0&&(y=b),C===void 0&&(C=g);var w=this._spacesFor(y);return C(this.stringifyProperty(b),w)},x.prototype.offsetOf=function(b){var y=1,C=this._spacesFor("attribute");if(y+=C.before.length,b==="namespace"||b==="ns")return this.namespace?y:-1;if(b==="attributeNS"||(y+=this.namespaceString.length,this.namespace&&(y+=1),b==="attribute"))return y;y+=this.stringifyProperty("attribute").length,y+=C.after.length;var w=this._spacesFor("operator");y+=w.before.length;var v=this.stringifyProperty("operator");if(b==="operator")return v?y:-1;y+=v.length,y+=w.after.length;var D=this._spacesFor("value");y+=D.before.length;var N=this.stringifyProperty("value");if(b==="value")return N?y:-1;y+=N.length,y+=D.after.length;var T=this._spacesFor("insensitive");return y+=T.before.length,b==="insensitive"&&this.insensitive?y:-1},x.prototype.toString=function(){var b=this,y=[this.rawSpaceBefore,"["];return y.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||this.value==="")&&(y.push(this._stringFor("operator")),y.push(this._stringFor("value")),y.push(this._stringFor("insensitiveFlag","insensitive",function(C,w){return C.length>0&&!b.quoted&&w.before.length===0&&!(b.spaces.value&&b.spaces.value.after)&&(w.before=" "),g(C,w)}))),y.push("]"),y.push(this.rawSpaceAfter),y.join("")},x.NO_QUOTE=null,x.SINGLE_QUOTE="'",x.DOUBLE_QUOTE='"',x})(o.default);zr.default=p;var m=(n={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}},n[null]={isIdentifier:!0},n);function g(A,x){return"".concat(x.before).concat(A).concat(x.after)}return zr}var Si={},cx;function sE(){if(cx)return Si;cx=1;var e=Si&&Si.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=Si&&Si.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Si,"__esModule",{value:!0});var n=t(BA()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.UNIVERSAL,l.value="*",l}return s})(n.default);return Si.default=i,Si}var Ii={},ux;function aE(){if(ux)return Ii;ux=1;var e=Ii&&Ii.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=Ii&&Ii.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ii,"__esModule",{value:!0});var n=t(ro()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.COMBINATOR,l}return s})(n.default);return Ii.default=i,Ii}var Ei={},fx;function lE(){if(fx)return Ei;fx=1;var e=Ei&&Ei.__extends||(function(){var o=function(s,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(l[u]=c[u])},o(s,a)};return function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(s,a);function l(){this.constructor=s}s.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}})(),t=Ei&&Ei.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ei,"__esModule",{value:!0});var n=t(ro()),r=nn(),i=(function(o){e(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.NESTING,l.value="&",l}return s})(n.default);return Ei.default=i,Ei}var Dc={},hx;function dH(){if(hx)return Dc;hx=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.default=e;function e(t){return t.sort(function(n,r){return n-r})}return Dc}var jn={},_d={},dx;function cE(){return dx||(dx=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combinator=e.word=e.comment=e.str=e.tab=e.newline=e.feed=e.cr=e.backslash=e.bang=e.slash=e.doubleQuote=e.singleQuote=e.space=e.greaterThan=e.pipe=e.equals=e.plus=e.caret=e.tilde=e.dollar=e.closeSquare=e.openSquare=e.closeParenthesis=e.openParenthesis=e.semicolon=e.colon=e.comma=e.at=e.asterisk=e.ampersand=void 0,e.ampersand=38,e.asterisk=42,e.at=64,e.comma=44,e.colon=58,e.semicolon=59,e.openParenthesis=40,e.closeParenthesis=41,e.openSquare=91,e.closeSquare=93,e.dollar=36,e.tilde=126,e.caret=94,e.plus=43,e.equals=61,e.pipe=124,e.greaterThan=62,e.space=32,e.singleQuote=39,e.doubleQuote=34,e.slash=47,e.bang=33,e.backslash=92,e.cr=13,e.feed=12,e.newline=10,e.tab=9,e.str=e.singleQuote,e.comment=-1,e.word=-2,e.combinator=-3})(_d)),_d}var px;function pH(){if(px)return jn;px=1;var e=jn&&jn.__createBinding||(Object.create?(function(p,m,g,A){A===void 0&&(A=g);var x=Object.getOwnPropertyDescriptor(m,g);(!x||("get"in x?!m.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(p,A,x)}):(function(p,m,g,A){A===void 0&&(A=g),p[A]=m[g]})),t=jn&&jn.__setModuleDefault||(Object.create?(function(p,m){Object.defineProperty(p,"default",{enumerable:!0,value:m})}):function(p,m){p.default=m}),n=jn&&jn.__importStar||(function(){var p=function(m){return p=Object.getOwnPropertyNames||function(g){var A=[];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&(A[A.length]=x);return A},p(m)};return function(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var A=p(m),x=0;x<A.length;x++)A[x]!=="default"&&e(g,m,A[x]);return t(g,m),g}})(),r,i;Object.defineProperty(jn,"__esModule",{value:!0}),jn.FIELDS=void 0,jn.default=h;for(var o=n(cE()),s=(r={},r[o.tab]=!0,r[o.newline]=!0,r[o.cr]=!0,r[o.feed]=!0,r),a=(i={},i[o.space]=!0,i[o.tab]=!0,i[o.newline]=!0,i[o.cr]=!0,i[o.feed]=!0,i[o.ampersand]=!0,i[o.asterisk]=!0,i[o.bang]=!0,i[o.comma]=!0,i[o.colon]=!0,i[o.semicolon]=!0,i[o.openParenthesis]=!0,i[o.closeParenthesis]=!0,i[o.openSquare]=!0,i[o.closeSquare]=!0,i[o.singleQuote]=!0,i[o.doubleQuote]=!0,i[o.plus]=!0,i[o.pipe]=!0,i[o.tilde]=!0,i[o.greaterThan]=!0,i[o.equals]=!0,i[o.dollar]=!0,i[o.caret]=!0,i[o.slash]=!0,i),l={},c="0123456789abcdefABCDEF",u=0;u<c.length;u++)l[c.charCodeAt(u)]=!0;function f(p,m){var g=m,A;do{if(A=p.charCodeAt(g),a[A])return g-1;A===o.backslash?g=d(p,g)+1:g++}while(g<p.length);return g-1}function d(p,m){var g=m,A=p.charCodeAt(g+1);if(!s[A])if(l[A]){var x=0;do g++,x++,A=p.charCodeAt(g+1);while(l[A]&&x<6);x<6&&A===o.space&&g++}else g++;return g}jn.FIELDS={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6};function h(p){var m=[],g=p.css.valueOf(),A=g.length,x=-1,b=1,y=0,C=0,w,v,D,N,T,L,G,X,Y,z,ue,re,le;function Be(R,H){if(p.safe)g+=H,Y=g.length-1;else throw p.error("Unclosed "+R,b,y-x,y)}for(;y<A;){switch(w=g.charCodeAt(y),w===o.newline&&(x=y,b+=1),w){case o.space:case o.tab:case o.newline:case o.cr:case o.feed:Y=y;do Y+=1,w=g.charCodeAt(Y),w===o.newline&&(x=Y,b+=1);while(w===o.space||w===o.newline||w===o.tab||w===o.cr||w===o.feed);le=o.space,N=b,D=Y-x-1,C=Y;break;case o.plus:case o.greaterThan:case o.tilde:case o.pipe:Y=y;do Y+=1,w=g.charCodeAt(Y);while(w===o.plus||w===o.greaterThan||w===o.tilde||w===o.pipe);le=o.combinator,N=b,D=y-x,C=Y;break;case o.asterisk:case o.ampersand:case o.bang:case o.comma:case o.equals:case o.dollar:case o.caret:case o.openSquare:case o.closeSquare:case o.colon:case o.semicolon:case o.openParenthesis:case o.closeParenthesis:Y=y,le=w,N=b,D=y-x,C=Y+1;break;case o.singleQuote:case o.doubleQuote:re=w===o.singleQuote?"'":'"',Y=y;do for(T=!1,Y=g.indexOf(re,Y+1),Y===-1&&Be("quote",re),L=Y;g.charCodeAt(L-1)===o.backslash;)L-=1,T=!T;while(T);le=o.str,N=b,D=y-x,C=Y+1;break;default:w===o.slash&&g.charCodeAt(y+1)===o.asterisk?(Y=g.indexOf("*/",y+2)+1,Y===0&&Be("comment","*/"),v=g.slice(y,Y+1),X=v.split(`
948
+ `),G=X.length-1,G>0?(z=b+G,ue=Y-X[G].length):(z=b,ue=x),le=o.comment,b=z,N=z,D=Y-ue):w===o.slash?(Y=y,le=w,N=b,D=y-x,C=Y+1):(Y=f(g,y),le=o.word,N=b,D=Y-x),C=Y+1;break}m.push([le,b,y-x,N,D,y,C]),ue&&(x=ue,ue=null),y=C}return m}return jn}var mx;function mH(){if(mx)return Mt;mx=1;var e=Mt&&Mt.__assign||function(){return e=Object.assign||function(H){for(var _,k=1,K=arguments.length;k<K;k++){_=arguments[k];for(var M in _)Object.prototype.hasOwnProperty.call(_,M)&&(H[M]=_[M])}return H},e.apply(this,arguments)},t=Mt&&Mt.__createBinding||(Object.create?(function(H,_,k,K){K===void 0&&(K=k);var M=Object.getOwnPropertyDescriptor(_,k);(!M||("get"in M?!_.__esModule:M.writable||M.configurable))&&(M={enumerable:!0,get:function(){return _[k]}}),Object.defineProperty(H,K,M)}):(function(H,_,k,K){K===void 0&&(K=k),H[K]=_[k]})),n=Mt&&Mt.__setModuleDefault||(Object.create?(function(H,_){Object.defineProperty(H,"default",{enumerable:!0,value:_})}):function(H,_){H.default=_}),r=Mt&&Mt.__importStar||(function(){var H=function(_){return H=Object.getOwnPropertyNames||function(k){var K=[];for(var M in k)Object.prototype.hasOwnProperty.call(k,M)&&(K[K.length]=M);return K},H(_)};return function(_){if(_&&_.__esModule)return _;var k={};if(_!=null)for(var K=H(_),M=0;M<K.length;M++)K[M]!=="default"&&t(k,_,K[M]);return n(k,_),k}})(),i=Mt&&Mt.__read||function(H,_){var k=typeof Symbol=="function"&&H[Symbol.iterator];if(!k)return H;var K=k.call(H),M,V=[],me;try{for(;(_===void 0||_-- >0)&&!(M=K.next()).done;)V.push(M.value)}catch(fe){me={error:fe}}finally{try{M&&!M.done&&(k=K.return)&&k.call(K)}finally{if(me)throw me.error}}return V},o=Mt&&Mt.__spreadArray||function(H,_,k){if(k||arguments.length===2)for(var K=0,M=_.length,V;K<M;K++)(V||!(K in _))&&(V||(V=Array.prototype.slice.call(_,0,K)),V[K]=_[K]);return H.concat(V||Array.prototype.slice.call(_))},s=Mt&&Mt.__importDefault||function(H){return H&&H.__esModule?H:{default:H}},a,l;Object.defineProperty(Mt,"__esModule",{value:!0});var c=s($I()),u=s(ZI()),f=s(XI()),d=s(eE()),h=s(tE()),p=s(nE()),m=s(rE()),g=s(iE()),A=r(oE()),x=s(sE()),b=s(aE()),y=s(lE()),C=s(dH()),w=r(pH()),v=r(cE()),D=r(nn()),N=Xl(),T=(a={},a[v.space]=!0,a[v.cr]=!0,a[v.feed]=!0,a[v.newline]=!0,a[v.tab]=!0,a),L=e(e({},T),(l={},l[v.comment]=!0,l));function G(H){return{line:H[w.FIELDS.START_LINE],column:H[w.FIELDS.START_COL]}}function X(H){return{line:H[w.FIELDS.END_LINE],column:H[w.FIELDS.END_COL]}}function Y(H,_,k,K){return{start:{line:H,column:_},end:{line:k,column:K}}}function z(H){return Y(H[w.FIELDS.START_LINE],H[w.FIELDS.START_COL],H[w.FIELDS.END_LINE],H[w.FIELDS.END_COL])}function ue(H,_){if(H)return Y(H[w.FIELDS.START_LINE],H[w.FIELDS.START_COL],_[w.FIELDS.END_LINE],_[w.FIELDS.END_COL])}function re(H,_){var k=H[_];if(typeof k=="string")return k.indexOf("\\")!==-1&&((0,N.ensureObject)(H,"raws"),H[_]=(0,N.unesc)(k),H.raws[_]===void 0&&(H.raws[_]=k)),H}function le(H,_){for(var k=-1,K=[];(k=H.indexOf(_,k+1))!==-1;)K.push(k);return K}function Be(){return Array.from(new Set(Array.prototype.concat.apply([],arguments)))}var R=(function(){function H(_,k){k===void 0&&(k={}),this.rule=_,this.options=Object.assign({lossy:!1,safe:!1},k),this.position=0,this.nestingDepth=0,this.maxNestingDepth=(0,N.resolveMaxNestingDepth)(this.options.maxNestingDepth),this.css=typeof this.rule=="string"?this.rule:this.rule.selector,this.tokens=(0,w.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var K=ue(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new c.default({source:K}),this.root.errorGenerator=this._errorGenerator();var M=new u.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(M),this.current=M,this.loop()}return H.prototype._errorGenerator=function(){var _=this;return function(k,K){return typeof _.rule=="string"?new Error(k):_.rule.error(k,K)}},H.prototype.attribute=function(){var _=[],k=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[w.FIELDS.TYPE]!==v.closeSquare;)_.push(this.currToken),this.position++;if(!this.currToken)return this.expected("closing square bracket",k[w.FIELDS.START_POS]);if(this.currToken[w.FIELDS.TYPE]!==v.closeSquare)return this.expected("closing square bracket",this.currToken[w.FIELDS.START_POS]);var K=_.length,M={source:Y(k[1],k[2],this.currToken[3],this.currToken[4]),sourceIndex:k[w.FIELDS.START_POS]};if(K===1&&!~[v.word].indexOf(_[0][w.FIELDS.TYPE]))return this.expected("attribute",_[0][w.FIELDS.START_POS]);for(var V=0,me="",fe="",ae=null,we=!1;V<K;){var I=_[V],E=this.content(I),B=_[V+1];switch(I[w.FIELDS.TYPE]){case v.space:if(we=!0,this.options.lossy)break;if(ae){(0,N.ensureObject)(M,"spaces",ae);var q=M.spaces[ae].after||"";M.spaces[ae].after=q+E;var U=(0,N.getProp)(M,"raws","spaces",ae,"after")||null;U&&(M.raws.spaces[ae].after=U+E)}else me=me+E,fe=fe+E;break;case v.asterisk:if(B[w.FIELDS.TYPE]===v.equals)M.operator=E,ae="operator";else if((!M.namespace||ae==="namespace"&&!we)&&B){me&&((0,N.ensureObject)(M,"spaces","attribute"),M.spaces.attribute.before=me,me=""),fe&&((0,N.ensureObject)(M,"raws","spaces","attribute"),M.raws.spaces.attribute.before=fe,fe=""),M.namespace=(M.namespace||"")+E;var F=(0,N.getProp)(M,"raws","namespace")||null;F&&(M.raws.namespace+=E),ae="namespace"}we=!1;break;case v.dollar:if(ae==="value"){var ee=(0,N.getProp)(M,"raws","value");M.value+="$",ee&&(M.raws.value=ee+"$");break}case v.caret:B[w.FIELDS.TYPE]===v.equals&&(M.operator=E,ae="operator"),we=!1;break;case v.combinator:if(E==="~"&&B[w.FIELDS.TYPE]===v.equals&&(M.operator=E,ae="operator"),E!=="|"){we=!1;break}B[w.FIELDS.TYPE]===v.equals?(M.operator=E,ae="operator"):!M.namespace&&!M.attribute&&(M.namespace=!0),we=!1;break;case v.word:if(B&&this.content(B)==="|"&&_[V+2]&&_[V+2][w.FIELDS.TYPE]!==v.equals&&!M.operator&&!M.namespace)M.namespace=E,ae="namespace";else if(!M.attribute||ae==="attribute"&&!we){me&&((0,N.ensureObject)(M,"spaces","attribute"),M.spaces.attribute.before=me,me=""),fe&&((0,N.ensureObject)(M,"raws","spaces","attribute"),M.raws.spaces.attribute.before=fe,fe=""),M.attribute=(M.attribute||"")+E;var F=(0,N.getProp)(M,"raws","attribute")||null;F&&(M.raws.attribute+=E),ae="attribute"}else if(!M.value&&M.value!==""||ae==="value"&&!(we||M.quoteMark)){var W=(0,N.unesc)(E),ee=(0,N.getProp)(M,"raws","value")||"",ne=M.value||"";M.value=ne+W,M.quoteMark=null,(W!==E||ee)&&((0,N.ensureObject)(M,"raws"),M.raws.value=(ee||ne)+E),ae="value"}else{var j=E==="i"||E==="I";(M.value||M.value==="")&&(M.quoteMark||we)?(M.insensitive=j,(!j||E==="I")&&((0,N.ensureObject)(M,"raws"),M.raws.insensitiveFlag=E),ae="insensitive",me&&((0,N.ensureObject)(M,"spaces","insensitive"),M.spaces.insensitive.before=me,me=""),fe&&((0,N.ensureObject)(M,"raws","spaces","insensitive"),M.raws.spaces.insensitive.before=fe,fe="")):(M.value||M.value==="")&&(ae="value",M.value+=E,M.raws.value&&(M.raws.value+=E))}we=!1;break;case v.str:if(!M.attribute||!M.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:I[w.FIELDS.START_POS]});var he=(0,A.unescapeValue)(E),se=he.unescaped,de=he.quoteMark;M.value=se,M.quoteMark=de,ae="value",(0,N.ensureObject)(M,"raws"),M.raws.value=E,we=!1;break;case v.equals:if(!M.attribute)return this.expected("attribute",I[w.FIELDS.START_POS],E);if(M.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:I[w.FIELDS.START_POS]});M.operator=M.operator?M.operator+E:E,ae="operator",we=!1;break;case v.comment:if(ae)if(we||B&&B[w.FIELDS.TYPE]===v.space||ae==="insensitive"){var ye=(0,N.getProp)(M,"spaces",ae,"after")||"",De=(0,N.getProp)(M,"raws","spaces",ae,"after")||ye;(0,N.ensureObject)(M,"raws","spaces",ae),M.raws.spaces[ae].after=De+E}else{var ze=M[ae]||"",P=(0,N.getProp)(M,"raws",ae)||ze;(0,N.ensureObject)(M,"raws"),M.raws[ae]=P+E}else fe=fe+E;break;default:return this.error('Unexpected "'.concat(E,'" found.'),{index:I[w.FIELDS.START_POS]})}V++}re(M,"attribute"),re(M,"namespace"),this.newNode(new A.default(M)),this.position++},H.prototype.parseWhitespaceEquivalentTokens=function(_){_<0&&(_=this.tokens.length);var k=this.position,K=[],M="",V=void 0;do if(T[this.currToken[w.FIELDS.TYPE]])this.options.lossy||(M+=this.content());else if(this.currToken[w.FIELDS.TYPE]===v.comment){var me={};M&&(me.before=M,M=""),V=new d.default({value:this.content(),source:z(this.currToken),sourceIndex:this.currToken[w.FIELDS.START_POS],spaces:me}),K.push(V)}while(++this.position<_);if(M){if(V)V.spaces.after=M;else if(!this.options.lossy){var fe=this.tokens[k],ae=this.tokens[this.position-1];K.push(new m.default({value:"",source:Y(fe[w.FIELDS.START_LINE],fe[w.FIELDS.START_COL],ae[w.FIELDS.END_LINE],ae[w.FIELDS.END_COL]),sourceIndex:fe[w.FIELDS.START_POS],spaces:{before:M,after:""}}))}}return K},H.prototype.convertWhitespaceNodesToSpace=function(_,k){var K=this;k===void 0&&(k=!1);var M="",V="";_.forEach(function(fe){var ae=K.lossySpace(fe.spaces.before,k),we=K.lossySpace(fe.rawSpaceBefore,k);M+=ae+K.lossySpace(fe.spaces.after,k&&ae.length===0),V+=ae+fe.value+K.lossySpace(fe.rawSpaceAfter,k&&we.length===0)}),V===M&&(V=void 0);var me={space:M,rawSpace:V};return me},H.prototype.isNamedCombinator=function(_){return _===void 0&&(_=this.position),this.tokens[_+0]&&this.tokens[_+0][w.FIELDS.TYPE]===v.slash&&this.tokens[_+1]&&this.tokens[_+1][w.FIELDS.TYPE]===v.word&&this.tokens[_+2]&&this.tokens[_+2][w.FIELDS.TYPE]===v.slash},H.prototype.namedCombinator=function(){if(this.isNamedCombinator()){var _=this.content(this.tokens[this.position+1]),k=(0,N.unesc)(_).toLowerCase(),K={};k!==_&&(K.value="/".concat(_,"/"));var M=new b.default({value:"/".concat(k,"/"),source:Y(this.currToken[w.FIELDS.START_LINE],this.currToken[w.FIELDS.START_COL],this.tokens[this.position+2][w.FIELDS.END_LINE],this.tokens[this.position+2][w.FIELDS.END_COL]),sourceIndex:this.currToken[w.FIELDS.START_POS],raws:K});return this.position=this.position+3,M}else this.unexpected()},H.prototype.combinator=function(){var _=this;if(this.content()==="|")return this.namespace();var k=this.locateNextMeaningfulToken(this.position);if(k<0||this.tokens[k][w.FIELDS.TYPE]===v.comma||this.tokens[k][w.FIELDS.TYPE]===v.closeParenthesis){var K=this.parseWhitespaceEquivalentTokens(k);if(K.length>0){var M=this.current.last;if(M){var V=this.convertWhitespaceNodesToSpace(K),me=V.space,fe=V.rawSpace;fe!==void 0&&(M.rawSpaceAfter+=fe),M.spaces.after+=me}else K.forEach(function(F){return _.newNode(F)})}return}var ae=this.currToken,we=void 0;k>this.position&&(we=this.parseWhitespaceEquivalentTokens(k));var I;if(this.isNamedCombinator()?I=this.namedCombinator():this.currToken[w.FIELDS.TYPE]===v.combinator?(I=new b.default({value:this.content(),source:z(this.currToken),sourceIndex:this.currToken[w.FIELDS.START_POS]}),this.position++):T[this.currToken[w.FIELDS.TYPE]]||we||this.unexpected(),I){if(we){var E=this.convertWhitespaceNodesToSpace(we),me=E.space,fe=E.rawSpace;I.spaces.before=me,I.rawSpaceBefore=fe}}else{var B=this.convertWhitespaceNodesToSpace(we,!0),me=B.space,fe=B.rawSpace;fe||(fe=me);var q={},U={spaces:{}};me.endsWith(" ")&&fe.endsWith(" ")?(q.before=me.slice(0,me.length-1),U.spaces.before=fe.slice(0,fe.length-1)):me[0]===" "&&fe[0]===" "?(q.after=me.slice(1),U.spaces.after=fe.slice(1)):U.value=fe,I=new b.default({value:" ",source:ue(ae,this.tokens[this.position-1]),sourceIndex:ae[w.FIELDS.START_POS],spaces:q,raws:U})}return this.currToken&&this.currToken[w.FIELDS.TYPE]===v.space&&(I.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(I)},H.prototype.comma=function(){if(this.position===this.tokens.length-1){this.root.trailingComma=!0,this.position++;return}this.current._inferEndPosition();var _=new u.default({source:{start:G(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][w.FIELDS.START_POS]});this.current.parent.append(_),this.current=_,this.position++},H.prototype.comment=function(){var _=this.currToken;this.newNode(new d.default({value:this.content(),source:z(_),sourceIndex:_[w.FIELDS.START_POS]})),this.position++},H.prototype.error=function(_,k){throw this.root.error(_,k)},H.prototype.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[w.FIELDS.START_POS]})},H.prototype.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[w.FIELDS.START_POS])},H.prototype.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[w.FIELDS.START_POS])},H.prototype.unexpected=function(){return this.error("Unexpected '".concat(this.content(),"'. Escaping special characters with \\ may help."),this.currToken[w.FIELDS.START_POS])},H.prototype.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[w.FIELDS.START_POS])},H.prototype.namespace=function(){var _=this.prevToken,k=_&&(_[w.FIELDS.TYPE]===v.word||_[w.FIELDS.TYPE]===v.asterisk||_[w.FIELDS.TYPE]===v.ampersand)?this.content(_):!0;if(!this.nextToken)return this.unexpectedPipe();if(this.nextToken[w.FIELDS.TYPE]===v.word)return this.position++,this.word(k);if(this.nextToken[w.FIELDS.TYPE]===v.asterisk)return this.position++,this.universal(k);this.unexpectedPipe()},H.prototype.nesting=function(){if(this.nextToken){var _=this.content(this.nextToken);if(_==="|"){this.position++;return}}var k=this.currToken;this.newNode(new y.default({value:this.content(),source:z(k),sourceIndex:k[w.FIELDS.START_POS]})),this.position++},H.prototype.parentheses=function(){var _=this.current.last,k=1,K=this.currToken;if(this.position++,_&&_.type===D.PSEUDO){var M=new u.default({source:{start:G(this.tokens[this.position])},sourceIndex:this.tokens[this.position][w.FIELDS.START_POS]}),V=this.current;_.append(M),this.current=M,this.nestingDepth++;try{for(this.nestingDepth>this.maxNestingDepth&&this.error("Cannot parse selector: nesting depth exceeds the maximum of ".concat(this.maxNestingDepth,"."),{index:this.currToken[w.FIELDS.START_POS]});this.position<this.tokens.length&&k;)this.currToken[w.FIELDS.TYPE]===v.openParenthesis&&k++,this.currToken[w.FIELDS.TYPE]===v.closeParenthesis&&k--,k?this.parse():(this.current.source.end=X(this.currToken),this.current.parent.source.end=X(this.currToken),this.position++)}finally{this.nestingDepth--}this.current=V}else{for(var me=this.currToken,fe="(",ae=void 0;this.position<this.tokens.length&&k;)this.currToken[w.FIELDS.TYPE]===v.openParenthesis&&k++,this.currToken[w.FIELDS.TYPE]===v.closeParenthesis&&k--,ae=this.currToken,fe+=this.parseParenthesisToken(this.currToken),this.position++;_?_.appendToPropertyAndEscape("value",fe,fe):this.newNode(new m.default({value:fe,source:Y(me[w.FIELDS.START_LINE],me[w.FIELDS.START_COL],ae[w.FIELDS.END_LINE],ae[w.FIELDS.END_COL]),sourceIndex:me[w.FIELDS.START_POS]}))}if(k)return this.expected("closing parenthesis",(this.currToken||K)[w.FIELDS.START_POS])},H.prototype.pseudo=function(){for(var _=this,k="",K=this.currToken;this.currToken&&this.currToken[w.FIELDS.TYPE]===v.colon;)k+=this.content(),this.position++;if(!this.currToken)return this.expected(["pseudo-class","pseudo-element"],this.position-1);if(this.currToken[w.FIELDS.TYPE]===v.word)this.splitWord(!1,function(M,V){k+=M,_.newNode(new g.default({value:k,source:ue(K,_.currToken),sourceIndex:K[w.FIELDS.START_POS]})),V>1&&_.nextToken&&_.nextToken[w.FIELDS.TYPE]===v.openParenthesis&&_.error("Misplaced parenthesis.",{index:_.nextToken[w.FIELDS.START_POS]})});else return this.expected(["pseudo-class","pseudo-element"],this.currToken[w.FIELDS.START_POS])},H.prototype.space=function(){var _=this.content();this.position===0||this.prevToken[w.FIELDS.TYPE]===v.comma||this.prevToken[w.FIELDS.TYPE]===v.openParenthesis||this.current.nodes.every(function(k){return k.type==="comment"})?(this.spaces=this.optionalSpace(_),this.position++):this.position===this.tokens.length-1||this.nextToken[w.FIELDS.TYPE]===v.comma||this.nextToken[w.FIELDS.TYPE]===v.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(_),this.position++):this.combinator()},H.prototype.string=function(){var _=this.currToken;this.newNode(new m.default({value:this.content(),source:z(_),sourceIndex:_[w.FIELDS.START_POS]})),this.position++},H.prototype.universal=function(_){var k=this.nextToken;if(k&&this.content(k)==="|")return this.position++,this.namespace();var K=this.currToken;this.newNode(new x.default({value:this.content(),source:z(K),sourceIndex:K[w.FIELDS.START_POS]}),_),this.position++},H.prototype.splitWord=function(_,k){for(var K=this,M=this.nextToken,V=this.content();M&&~[v.dollar,v.caret,v.equals,v.word].indexOf(M[w.FIELDS.TYPE]);){this.position++;var me=this.content();if(V+=me,me.lastIndexOf("\\")===me.length-1){var fe=this.nextToken;fe&&fe[w.FIELDS.TYPE]===v.space&&(V+=this.requiredSpace(this.content(fe)),this.position++)}M=this.nextToken}var ae=le(V,".").filter(function(F){var ee=V[F-1]==="\\",W=/^\d+\.\d+%$/.test(V);return!ee&&!W}),we=le(V,"#").filter(function(F){return V[F-1]!=="\\"}),I=le(V,"#{");if(I.length){var E=new Set(I);we=we.filter(function(F){return!E.has(F)})}var B=new Set(ae),q=new Set(we),U=(0,C.default)(Be(o(o([0],i(ae),!1),i(we),!1)));U.forEach(function(F,ee){var W=U[ee+1]||V.length,ne=V.slice(F,W);if(ee===0&&k)return k.call(K,ne,U.length);var j,he=K.currToken,se=he[w.FIELDS.START_POS]+U[ee],de=Y(he[1],he[2]+F,he[3],he[2]+(W-1));if(B.has(F)){var ye={value:ne.slice(1),source:de,sourceIndex:se};j=new f.default(re(ye,"value"))}else if(q.has(F)){var De={value:ne.slice(1),source:de,sourceIndex:se};j=new h.default(re(De,"value"))}else{var ze={value:ne,source:de,sourceIndex:se};re(ze,"value"),j=new p.default(ze)}K.newNode(j,_),_=null}),this.position++},H.prototype.word=function(_){var k=this.nextToken;return k&&this.content(k)==="|"?(this.position++,this.namespace()):this.splitWord(_)},H.prototype.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},H.prototype.parse=function(_){switch(this.currToken[w.FIELDS.TYPE]){case v.space:this.space();break;case v.comment:this.comment();break;case v.openParenthesis:this.parentheses();break;case v.closeParenthesis:_&&this.missingParenthesis();break;case v.openSquare:this.attribute();break;case v.dollar:case v.caret:case v.equals:case v.word:this.word();break;case v.colon:this.pseudo();break;case v.comma:this.comma();break;case v.asterisk:this.universal();break;case v.ampersand:this.nesting();break;case v.slash:case v.combinator:this.combinator();break;case v.str:this.string();break;case v.closeSquare:this.missingSquareBracket();case v.semicolon:this.missingBackslash();default:this.unexpected()}},H.prototype.expected=function(_,k,K){if(Array.isArray(_)){var M=_.pop();_="".concat(_.join(", ")," or ").concat(M)}var V=/^[aeiou]/.test(_[0])?"an":"a";return K?this.error("Expected ".concat(V," ").concat(_,', found "').concat(K,'" instead.'),{index:k}):this.error("Expected ".concat(V," ").concat(_,"."),{index:k})},H.prototype.requiredSpace=function(_){return this.options.lossy?" ":_},H.prototype.optionalSpace=function(_){return this.options.lossy?"":_},H.prototype.lossySpace=function(_,k){return this.options.lossy?k?" ":"":_},H.prototype.parseParenthesisToken=function(_){var k=this.content(_);return _[w.FIELDS.TYPE]===v.space?this.requiredSpace(k):k},H.prototype.newNode=function(_,k){return k&&(/^ +$/.test(k)&&(this.options.lossy||(this.spaces=(this.spaces||"")+k),k=!0),_.namespace=k,re(_,"namespace")),this.spaces&&(_.spaces.before=this.spaces,this.spaces=""),this.current.append(_)},H.prototype.content=function(_){return _===void 0&&(_=this.currToken),this.css.slice(_[w.FIELDS.START_POS],_[w.FIELDS.END_POS])},Object.defineProperty(H.prototype,"currToken",{get:function(){return this.tokens[this.position]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"nextToken",{get:function(){return this.tokens[this.position+1]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"prevToken",{get:function(){return this.tokens[this.position-1]},enumerable:!1,configurable:!0}),H.prototype.locateNextMeaningfulToken=function(_){_===void 0&&(_=this.position+1);for(var k=_;k<this.tokens.length;)if(L[this.tokens[k][w.FIELDS.TYPE]]){k++;continue}else return k;return-1},H})();return Mt.default=R,Mt}var gx;function gH(){if(gx)return cs;gx=1;var e=cs&&cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cs,"__esModule",{value:!0});var t=e(mH()),n=(function(){function r(i,o){this.func=i||function(){},this.funcRes=null,this.options=o}return r.prototype._shouldUpdateSelector=function(i,o){o===void 0&&(o={});var s=Object.assign({},this.options,o);return s.updateSelector===!1?!1:typeof i!="string"},r.prototype._isLossy=function(i){i===void 0&&(i={});var o=Object.assign({},this.options,i);return o.lossless===!1},r.prototype._root=function(i,o){o===void 0&&(o={});var s=new t.default(i,this._parseOptions(o));return s.root},r.prototype._parseOptions=function(i){var o=Object.assign({},this.options,i);return{lossy:this._isLossy(o),maxNestingDepth:o.maxNestingDepth}},r.prototype._stringifyOptions=function(i){var o=Object.assign({},this.options,i);return{maxNestingDepth:o.maxNestingDepth}},r.prototype._run=function(i,o){var s=this;return o===void 0&&(o={}),new Promise(function(a,l){try{var c=s._root(i,o);Promise.resolve(s.func(c)).then(function(u){var f=void 0;return s._shouldUpdateSelector(i,o)&&(f=c.toString(s._stringifyOptions(o)),i.selector=f),{transform:u,root:c,string:f}}).then(a,l)}catch(u){l(u);return}})},r.prototype._runSync=function(i,o){o===void 0&&(o={});var s=this._root(i,o),a=this.func(s);if(a&&typeof a.then=="function")throw new Error("Selector processor returned a promise to a synchronous call.");var l=void 0;return o.updateSelector&&typeof i!="string"&&(l=s.toString(this._stringifyOptions(o)),i.selector=l),{transform:a,root:s,string:l}},r.prototype.ast=function(i,o){return this._run(i,o).then(function(s){return s.root})},r.prototype.astSync=function(i,o){return this._runSync(i,o).root},r.prototype.transform=function(i,o){return this._run(i,o).then(function(s){return s.transform})},r.prototype.transformSync=function(i,o){return this._runSync(i,o).transform},r.prototype.process=function(i,o){var s=this;return this._run(i,o).then(function(a){return a.string||a.root.toString(s._stringifyOptions(o))})},r.prototype.processSync=function(i,o){var s=this._runSync(i,o);return s.string||s.root.toString(this._stringifyOptions(o))},r})();return cs.default=n,cs}var co={},Xe={},Ax;function AH(){if(Ax)return Xe;Ax=1;var e=Xe&&Xe.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.universal=Xe.tag=Xe.string=Xe.selector=Xe.root=Xe.pseudo=Xe.nesting=Xe.id=Xe.comment=Xe.combinator=Xe.className=Xe.attribute=void 0;var t=e(oE()),n=e(XI()),r=e(aE()),i=e(eE()),o=e(tE()),s=e(lE()),a=e(iE()),l=e($I()),c=e(ZI()),u=e(rE()),f=e(nE()),d=e(sE()),h=function(N){return new t.default(N)};Xe.attribute=h;var p=function(N){return new n.default(N)};Xe.className=p;var m=function(N){return new r.default(N)};Xe.combinator=m;var g=function(N){return new i.default(N)};Xe.comment=g;var A=function(N){return new o.default(N)};Xe.id=A;var x=function(N){return new s.default(N)};Xe.nesting=x;var b=function(N){return new a.default(N)};Xe.pseudo=b;var y=function(N){return new l.default(N)};Xe.root=y;var C=function(N){return new c.default(N)};Xe.selector=C;var w=function(N){return new u.default(N)};Xe.string=w;var v=function(N){return new f.default(N)};Xe.tag=v;var D=function(N){return new d.default(N)};return Xe.universal=D,Xe}var Nd={},yx;function yH(){return yx||(yx=1,(function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.isUniversal=e.isTag=e.isString=e.isSelector=e.isRoot=e.isPseudo=e.isNesting=e.isIdentifier=e.isComment=e.isCombinator=e.isClassName=e.isAttribute=void 0,e.isNode=i,e.isPseudoElement=s,e.isPseudoClass=a,e.isContainer=l,e.isNamespace=c;var n=nn(),r=(t={},t[n.ATTRIBUTE]=!0,t[n.CLASS]=!0,t[n.COMBINATOR]=!0,t[n.COMMENT]=!0,t[n.ID]=!0,t[n.NESTING]=!0,t[n.PSEUDO]=!0,t[n.ROOT]=!0,t[n.SELECTOR]=!0,t[n.STRING]=!0,t[n.TAG]=!0,t[n.UNIVERSAL]=!0,t);function i(u){return typeof u=="object"&&r[u.type]}function o(u,f){return i(f)&&f.type===u}e.isAttribute=o.bind(null,n.ATTRIBUTE),e.isClassName=o.bind(null,n.CLASS),e.isCombinator=o.bind(null,n.COMBINATOR),e.isComment=o.bind(null,n.COMMENT),e.isIdentifier=o.bind(null,n.ID),e.isNesting=o.bind(null,n.NESTING),e.isPseudo=o.bind(null,n.PSEUDO),e.isRoot=o.bind(null,n.ROOT),e.isSelector=o.bind(null,n.SELECTOR),e.isString=o.bind(null,n.STRING),e.isTag=o.bind(null,n.TAG),e.isUniversal=o.bind(null,n.UNIVERSAL);function s(u){return(0,e.isPseudo)(u)&&u.value&&(u.value.startsWith("::")||u.value.toLowerCase()===":before"||u.value.toLowerCase()===":after"||u.value.toLowerCase()===":first-letter"||u.value.toLowerCase()===":first-line")}function a(u){return(0,e.isPseudo)(u)&&!s(u)}function l(u){return!!(i(u)&&u.walk)}function c(u){return(0,e.isAttribute)(u)||(0,e.isTag)(u)}})(Nd)),Nd}var bx;function bH(){return bx||(bx=1,(function(e){var t=co&&co.__createBinding||(Object.create?(function(r,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,s,a)}):(function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]})),n=co&&co.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(nn(),e),n(AH(),e),n(yH(),e)})(co)),co}var Zn,wx;function wH(){if(wx)return Zn;wx=1;var e=Zn&&Zn.__createBinding||(Object.create?(function(a,l,c,u){u===void 0&&(u=c);var f=Object.getOwnPropertyDescriptor(l,c);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(a,u,f)}):(function(a,l,c,u){u===void 0&&(u=c),a[u]=l[c]})),t=Zn&&Zn.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),n=Zn&&Zn.__importStar||(function(){var a=function(l){return a=Object.getOwnPropertyNames||function(c){var u=[];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[u.length]=f);return u},a(l)};return function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var u=a(l),f=0;f<u.length;f++)u[f]!=="default"&&e(c,l,u[f]);return t(c,l),c}})(),r=Zn&&Zn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},i=r(gH()),o=n(bH()),s=function(a){return new i.default(a)};return Object.assign(s,o),delete s.__esModule,Zn=s,Zn}var xH=wH();const Ke=_l(xH);function kH(e,t){return e.a===t.a?e.b===t.b?e.c-t.c:e.b-t.b:e.a-t.a}function Du(e,t){if(!e)return{a:0,b:0,c:0};let n=0,r=0,i=0;if(e.type==="universal")return{a:0,b:0,c:0};if(e.type==="id")n+=1;else if(e.type==="tag")i+=1;else if(e.type==="class")r+=1;else if(e.type==="attribute")r+=1;else if(CH(e))switch(e.value.toLowerCase()){case"::slotted":if(i+=1,e.nodes&&e.nodes.length>0){const o=Mc(e.nodes);n+=o.a,r+=o.b,i+=o.c}break;case"::highlight":case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return e.nodes&&e.nodes.length===1&&e.nodes[0].type==="selector"&&vH(e.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:i+=1}else if(Ke.isPseudoClass(e))switch(e.value.toLowerCase()){case":-webkit-any":case":any":default:r+=1;break;case":-moz-any":case":has":case":is":case":matches":case":not":if(e.nodes&&e.nodes.length>0){const o=Mc(e.nodes);n+=o.a,r+=o.b,i+=o.c}break;case":where":break;case":nth-child":case":nth-last-child":if(r+=1,e.nodes&&e.nodes.length>0){const o=e.nodes[0].nodes.findIndex(s=>s.type==="tag"&&s.value.toLowerCase()==="of");if(o>-1){const s=Ke.selector({nodes:[],value:""});e.nodes[0].nodes.slice(o+1).forEach(c=>{s.append(c.clone())});const a=[s];e.nodes.length>1&&a.push(...e.nodes.slice(1));const l=Mc(a);n+=l.a,r+=l.b,i+=l.c}}break;case":local":case":global":e.nodes&&e.nodes.length>0&&e.nodes.forEach(o=>{const s=Du(o);n+=s.a,r+=s.b,i+=s.c});break;case":host":case":host-context":if(r+=1,e.nodes&&e.nodes.length>0){const o=Mc(e.nodes);n+=o.a,r+=o.b,i+=o.c}break;case":active-view-transition":case":active-view-transition-type":return{a:0,b:1,c:0}}else Ke.isContainer(e)&&e.nodes?.length>0&&e.nodes.forEach(o=>{const s=Du(o);n+=s.a,r+=s.b,i+=s.c});return{a:n,b:r,c:i}}function Mc(e,t){let n={a:0,b:0,c:0};return e.forEach(r=>{const i=Du(r);kH(i,n)<0||(n=i)}),n}function CH(e){return Ke.isPseudoElement(e)}function vH(e){if(!e||!e.nodes)return!1;const t=e.nodes.filter(n=>n.type!=="comment");return t.length===0||t.length===1&&t[0].type==="universal"}function wo(e){return{sourceIndex:e.sourceIndex??0,source:e.source}}function SH(e){const t=[];let n=[];e.each(i=>{if(i.type==="combinator")return t.push(n,[i]),void(n=[]);if(Ke.isPseudoElement(i))return t.push(n),void(n=[i]);if(i.type==="universal"&&n.find(o=>o.type==="universal"))i.remove();else{if(i.type==="tag"&&n.find(o=>o.type==="tag")){i.remove();const o=Ke.selector({value:"",...wo(i)});o.append(i);const s=Ke.pseudo({value:":is",...wo(i)});return s.append(o),void n.push(s)}n.push(i)}}),t.push(n);const r=[];for(let i=0;i<t.length;i++){const o=t[i];o.sort((s,a)=>xx(s)-xx(a)),r.push(...o)}e.removeAll();for(let i=r.length-1;i>=0;i--)r[i].remove(),r[i].parent=e,e.nodes.unshift(r[i])}function xx(e){return Ke.isPseudoElement(e)?kx.pseudoElement:kx[e.type]}const kx={universal:0,tag:1,pseudoElement:2,nesting:3,id:4,class:5,attribute:6,pseudo:7,comment:8},IH=1e4;function EH(e,t,n){const r=[],i=TH(t);for(let s=0;s<e.nodes.length;s++){const a=e.nodes[s].clone();{let l=!1;a.walkNesting(()=>(l=!0,!1)),l?a.nodes[0]?.type==="combinator"&&a.prepend(Ke.nesting({...wo(a)})):(a.prepend(Ke.combinator({value:" ",...wo(a)})),a.prepend(Ke.nesting({...wo(a)})))}{const l=new Set;let c=0;a.walkNesting(u=>{const f=u.parent;if(f){if(c++,c*i>IH)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");l.add(f),f.parent?.type==="pseudo"&&f.parent.value?.toLowerCase()===":has"?u.replaceWith(...Cx(t,!0)):u.replaceWith(...Cx(t))}});for(const u of l)SH(u)}a.walk(l=>{l.type==="combinator"&&l.value.trim()!==""?(l.rawSpaceAfter=" ",l.rawSpaceBefore=" "):(l.rawSpaceAfter="",l.rawSpaceBefore="")}),r.push(a)}const o=Ke.root({value:"",...wo(e)});return r.forEach(s=>{o.append(s)}),o}function TH(e){let t=0;return e.walk(()=>{t++}),t}function Cx(e,t=!1){if(t||!RH(e.nodes)){const n=Ke.pseudo({value:":is",...wo(e)});return e.nodes.forEach(r=>{n.append(r.clone())}),[n]}return e.nodes[0].nodes.map(n=>n.clone())}function RH(e){return e.length===1&&!e[0].nodes.some(t=>t.type==="combinator"||Ke.isPseudoElement(t))}const _H=Ke.pseudo({value:":is"});function ho(e){if(!e||!e.nodes)return;const t=[];let n=[];for(let i=0;i<e.nodes.length;i++)if(e.nodes[i].type!=="combinator")if(Ke.isPseudoElement(e.nodes[i]))t.push(n),n=[e.nodes[i]];else{if(e.nodes[i].type==="tag"&&n.find(o=>o.type==="tag")){const o=_H.clone({}),s=e.nodes[i];s.replaceWith(o),o.append(Ke.selector({nodes:[s],value:void 0}))}n.push(e.nodes[i])}else t.push(n),t.push([e.nodes[i]]),n=[];t.push(n);const r=[];for(let i=0;i<t.length;i++){const o=t[i];o.sort((s,a)=>s.type==="selector"&&a.type==="selector"&&s.nodes.length&&a.nodes.length?Ti(s.nodes[0])-Ti(a.nodes[0]):s.type==="selector"&&s.nodes.length?Ti(s.nodes[0])-Ti(a):a.type==="selector"&&a.nodes.length?Ti(s)-Ti(a.nodes[0]):Ti(s)-Ti(a));for(let s=0;s<o.length;s++)r.push(o[s])}e.removeAll();for(let i=r.length-1;i>=0;i--)r[i].remove(),r[i].parent=e,e.nodes.unshift(r[i])}function Ti(e){return Ke.isPseudoElement(e)?vx.pseudoElement:vx[e.type]}const vx={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function Ro(e){return e&&e.type==="atrule"}function Sx(e){return e&&Ro(e)&&e.name==="nest"}function xo(e){return e&&e.type==="rule"}function NH(e,t){let n,r=e.parent;for(;r;){if(r.type==="rule"||Ro(r)&&r.name==="scope")return;r=r.parent}try{n=Ke().astSync(e.selector)}catch(i){return void e.warn(t,`Failed to parse selector : "${e.selector}" with message: "${i instanceof Error?i.message:i}"`)}n&&(n.walkNesting(i=>{const o=i.parent;i.replaceWith(Ke.pseudo({value:":scope"})),o&&ho(o)}),e.selector=n.toString())}function si(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter(n=>n.type==="comment");t.length===e.nodes.length&&e.replaceWith(...t)}function PA(e){const t=[],n=[];e.each(r=>{if(Ix(r,n.length>0))t.push(r);else{if(r.type==="comment"){let i=r.next();for(;i&&i.type==="comment";)i=i.next();if(Ix(i,n.length>0))return void t.push(r)}n.push(r)}}),e.removeAll(),t.forEach(r=>{e.append(r)}),n.forEach(r=>{e.append(r)})}function Ix(e,t){return!!e&&(e.type==="decl"||e.type==="atrule"&&e.name.toLowerCase()==="mixin"&&!t)}function Mu(e){const t=[];let n="",r=!1,i=0,o=!1,s=!1;for(const a of e)s?s=!1:a==="\\"?s=!0:o?a===o&&(o=!1):a==='"'||a==="'"?o=a:a==="("?i+=1:a===")"?i>0&&(i-=1):i===0&&a===","&&(r=!0),r?(n!==""&&t.push(n.trim()),n="",r=!1):n+=a;return t.push(n.trim()),t}function $s(e,t){const n=t.index(e);if(n){const r=t.cloneBefore().removeAll().append(t.nodes.slice(0,n));r.raws.semicolon=!0,si(r)}t.before(e),t.raws.semicolon=!0}var FA=["container","document","media","supports","layer","starting-style"];function OH(e,t){var n,r;PA(t),$s(e,t),e.params=(n=t.params,r=e.params,Mu(n).map(i=>Mu(r).map(o=>`${i} and ${o}`).join(", ")).join(", ")),si(t)}function DH(e,t){return FA.includes(e.name)&&e.name===t.name}function MH(e,t,n,r,i,o=0){if(PA(t),$s(e,t),e.nodes){const s=t.clone().removeAll().append(e.nodes);e.append(s),si(t),r(s,n,i,o)}else si(t)}function BH(e){return FA.includes(e.name)}function PH(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let i=0;i<t;i++)n[i]=0;const r=[];for(;;){const i=[];for(let o=t-1;o>=0;o--){let s=n[o];if(s>=e.length){if(s=0,n[o]=0,o===0)return r;n[o-1]+=1}i[o]=e[s].clone()}r.push(i),n[n.length-1]++}}function FH(e){const t=e.map(r=>Ke().astSync(r)).map(r=>Du(r)),n=t[0];for(let r=1;r<t.length;r++)if(n.a!==t[r].a||n.b!==t[r].b||n.c!==t[r].c)return!1;return!0}function uE(e,t,n){if(e.length>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");let r;r=FH(e)||n.noIsPseudoSelector?e.map(o=>Ke().astSync(o)):[Ke().astSync(`:is(${e.join(",")})`)];const i=[];for(let o=0;o<t.length;o++){let s,a=t[o];{const u=Ke().astSync(a);let f=!1;u.walk(p=>{p.type==="nesting"&&(f=!0)});const d=u.nodes[0];let h=!1;d.each(p=>p.type==="combinator"&&(h=!0,!1)),f?h&&d.insertBefore(d.at(0),Ke.nesting()):(d.insertBefore(d.at(0),Ke.combinator({value:" "})),d.insertBefore(d.at(0),Ke.nesting())),a=u.toString()}let l=[],c=0;if(Ke().astSync(a).walkNesting(()=>{c++}),c>1&&r.length>1)l=PH(r,c),s=l.length;else{s=r.length;for(let u=0;u<r.length;u++){l.push([]);for(let f=0;f<c;f++)l[u].push(r[u])}}if(s*t.length>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");for(let u=0;u<s;u++){let f=0;const d=Ke().astSync(a);d.walk(h=>{if(h.type!=="nesting")return;let p=l[u][f];f++,p.type==="root"&&p.nodes.length===1&&(p=p.nodes[0]);const m=Ke().astSync(`:is(${p.toString()})`),g=Bu(p.nodes[0]),A=em(p.nodes[0]),x=Bu(h),b=em(h);if(g&&x)return void h.replaceWith(p.clone());if((g||A)&&(x||b)){const C=h.parent;return g&&p.type==="selector"?h.replaceWith(p.clone().nodes[0]):h.replaceWith(...p.clone().nodes),void(C&&C.nodes.length>1&&ho(C))}if(g){const C=h.parent;return h.replaceWith(p.clone().nodes[0]),void(C&&ho(C))}if(A){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&ho(C))}if(LH(h)){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&ho(C))}if(zH(h)){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&ho(C))}const y=h.parent;n.noIsPseudoSelector?h.replaceWith(...p.clone().nodes):h.replaceWith(...m.clone({}).nodes),y&&ho(y)}),i.push(d.toString())}}return i}function Bu(e){return e.type!=="combinator"&&!(e.parent&&e.parent.nodes.length>1)}function em(e,t=null){return Bu(e)||!e.parent||e.parent.nodes.find(n=>n.type==="combinator")?!1:!(e.parent.nodes.find(n=>n.type==="nesting")&&t&&!em(t))}function LH(e){if(!e.parent||e.parent.nodes.indexOf(e)!==0)return!1;for(let t=1;t<e.parent.nodes.length;t++)if(e.parent.nodes[t].type==="combinator"&&e.parent.nodes[t].value!==" "&&e.parent.nodes[t].value!==">")return!1;return!0}function zH(e){if(Bu(e))return!0;if(!e.parent)return!1;for(let t=0;t<e.parent.nodes.length;t++)if(e.parent.nodes[t].type!=="nesting"&&(e.parent.nodes[t].prev()||e.parent.nodes[t].next())&&(e.parent.nodes[t].prev()&&e.parent.nodes[t].prev().type!=="combinator"||e.parent.nodes[t].next()&&e.parent.nodes[t].next().type!=="combinator"))return!1;return!0}function WH(e,t,n,r,i,o=0){let s;try{s=uE(t.selectors,Mu(e.params),i)}catch(l){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.params}" with message: "${l instanceof Error?l.message:l}"`)}if(!s.length)return;$s(e,t);const a=t.clone().removeAll().append(e.nodes);a.raws.semicolon=!0,a.selectors=s,e.replaceWith(a),si(t),r(a,n,i,o)}function jH(e){return Mu(e.params).every(t=>t.split("&").length>=2&&t.indexOf("|")===-1)}function UH(e,t,n,r){let i;try{i=uE(t.selectors,e.selectors,r)}catch(o){return void e.warn(n,`Failed to parse selectors : "${t.selector}" / "${e.selector}" with message: "${o instanceof Error?o.message:o}"`)}i.length&&(PA(t),$s(e,t),e.selectors=i,e.type==="rule"&&t.type==="rule"&&e.selector===t.selector&&e.append(...t.nodes),si(t))}function HH(e){return e.selectors.every(t=>t.indexOf("|")===-1)}function eu(e,t,n,r=0){if(r>=512)throw new Error("Maximum nesting depth of 512 exceeded while resolving nested rules.");e.each(i=>{const o=i.parent;Sx(i)&&!n.silenceAtNestWarning&&e.warn(t,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
949
+ Change \`@nest ${i.params} {}\` to \`${i.params} {}\` to migrate to the latest standard.`),xo(i)&&xo(o)&&HH(i)?UH(i,o,t,n):Sx(i)&&xo(o)&&jH(i)?WH(i,o,t,eu,n,r+1):Ro(i)&&xo(o)&&BH(i)?MH(i,o,t,eu,n,r+1):Ro(i)&&Ro(o)&&DH(i,o)&&OH(i,o),"nodes"in i&&i.nodes.length&&eu(i,t,n,r+1)})}const fE=e=>{const t=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},e);return{postcssPlugin:"postcss-nesting",Rule(n,{result:r}){eu(n,r,t),n.selector.includes("&")&&NH(n,r)}}};fE.postcss=!0;const Ex=Ke();function hE(e,t,n,r){let i;try{i=EH(Ex.astSync(t),Ex.astSync(n))}catch(o){return e.warn(r,`Failed to parse selectors : "${n}" / "${t}" with message: "${o instanceof Error?o.message:o}"`),!1}return!!i&&i.toString()}function KH(e,t){{let r=e.parent;for(;r;){if(r.type==="rule"||Ro(r)&&r.name==="scope")return;r=r.parent}try{let i=!1;if(Ke().astSync(e.selector).walkNesting(()=>(i=!0,!1)),!i)return}catch(i){return void e.warn(t,`Failed to parse selector : "${e.selector}" with message: "${i instanceof Error?i.message:i}"`)}}const n=hE(e,e.selector,":scope",t);n&&(e.selector=n)}function JH(e,t,n,r,i=0){if($s(e,t),e.nodes){const o=t.clone().removeAll().append(e.nodes);e.append(o),si(t),r(o,n,i)}else si(t)}function VH(e){return FA.includes(e.name)}function qH(e,t,n){const r=hE(e,e.selector,t.selector,n);r&&($s(e,t),e.selector=r,e.type==="rule"&&t.type==="rule"&&e.selector===t.selector&&e.append(...t.nodes),si(t))}function GH(e){return e.selectors.every(t=>t.indexOf("|")===-1)}function tm(e,t,n=0){if(n>=512)throw new Error("Maximum nesting depth of 512 exceeded while resolving nested rules.");e.each(r=>{const i=r.parent;xo(r)&&xo(i)&&GH(r)?qH(r,i,t):Ro(r)&&xo(i)&&VH(r)&&JH(r,i,t,tm,n+1),"nodes"in r&&r.nodes.length&&tm(r,t,n+1)})}const dE=()=>({postcssPlugin:"postcss-nesting",Rule(e,{result:t}){tm(e,t),e.selector.includes("&")&&KH(e,t)},AtRule:{nest(e){throw e.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
950
+ Change \`@nest ${e.params} {}\` to \`${e.params} {}\` to migrate to the latest standard.`)}}});dE.postcss=!0;const pE=e=>{const t=Object.assign({edition:"2024-02"},e);switch(t.edition){case"2021":return fE(e);case"2024-02":return dE();default:throw new Error(`Invalid edition: ${t.edition}`)}};pE.postcss=!0;const QH=Ke();function Pu(e,t){this.text=e,this.spec=void 0,this.styleAttribute=t||!1}Pu.prototype.parsed=function(){if(this.ast!==void 0)return this.ast;try{this.ast=QH.astSync(this.text)}catch{this.ast=null}return this.ast};Pu.prototype.specificity=function(){if(this.spec)return this.spec;const e=this.parsed(),t=this.styleAttribute;return!e||e.nodes.length===0?(this.spec=[t?1:0,0,0,0],this.spec):(this.spec=mE(e.nodes[0],t),this.spec)};function mE(e,t){const n=[t?1:0,0,0,0];return e.each(r=>{switch(r.type){case"id":n[1]++;break;case"class":case"attribute":n[2]++;break;case"tag":r.value!=="*"&&n[3]++;break;case"pseudo":{const i=r.value.toLowerCase();if(i!==":where")if((i===":is"||i===":has"||i===":not")&&r.nodes&&r.nodes.length){let o=null;for(const s of r.nodes){const a=mE(s,!1);(!o||YH(a,o)>0)&&(o=a)}if(o)for(let s=0;s<4;s++)n[s]+=o[s]}else n[3]++;break}}}),n}function YH(e,t){for(let n=0;n<4;n++)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}function vf(e,t,n,r,i){this.prop=e,this.value=t,this.selector=n,this.priority=r||0,this.additionalPriority=i||[]}vf.prototype.compareFunc=function(e){const t=[];t.push.apply(t,this.selector.specificity()),t.push.apply(t,this.additionalPriority),t[0]+=this.priority;const n=[];return n.push.apply(n,e.selector.specificity()),n.push.apply(n,e.additionalPriority),n[0]+=e.priority,nK(t,n)};vf.prototype.compare=function(e){return this.compareFunc(e)===1?this:e};vf.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"};const $H=ft([pE()]);function LA(e,{strict:t=!1}={}){return $H.process(e,{parser:t?void 0:QI,from:void 0}).root}function ZH(e){const t=e.source&&e.source.start,n=e.source&&e.source.end;return{type:"property",name:e.prop,value:e.value+(e.important?" !important":""),position:{start:{line:t?t.line:1,col:t?t.column:1},end:{line:n?n.line:1,col:n?n.column:1}}}}function Tx(e,{strict:t=!1}={}){let n;try{n=LA(e,{strict:t})}catch(a){if(t)throw a;return[]}const r=[],i=n.nodes;let o=!1,s=!1;if(i.length>0&&i[0].type==="comment"&&i[0].text&&i[0].text.trim()==="juice ignore"&&(s=!0),s)return r;for(let a=0,l=i.length;a<l;a++){const c=i[a];if(c.type==="comment"){if(!c.text)continue;const u=c.text.trim();u==="juice start ignore"?o=!0:u==="juice end ignore"?o=!1:u==="juice ignore next"&&a++;continue}if(!o&&c.type==="rule"){const u=c.selectors,f=[];let d=!1;for(const h of c.nodes){if(h.type==="comment"&&h.text&&h.text.trim()==="juice ignore next"){d=!0;continue}if(d&&h.type==="decl"){d=!1;continue}h.type==="decl"&&h.value&&h.value.trim()&&f.push(ZH(h))}if(f.length>0)for(const h of u)r.push([h,f])}}return r}function Rx(e,t,n){let r;try{r=LA(e)}catch{return!1}const i=r.nodes;if(i.length>0&&i[0].type==="comment"&&i[0].text&&i[0].text.trim()==="juice ignore")return`
951
+ `+e+`
952
+ `;const o=new Set;for(let c=0;c<i.length;c++){const u=i[c];if(u.type==="comment"&&u.text&&u.text.trim()==="juice ignore next"&&c+1<i.length&&o.add(c+1),u.type==="rule"&&u.nodes){for(const f of u.nodes)if(f.type==="comment"&&f.text&&f.text.trim()==="juice ignore next"){o.add(c);break}}}const s=[];let a=!1,l=[];for(let c=i.length-1;c>=0;c--){const u=i[c];if(u.type==="comment"){if(!u.text)continue;const A=u.text.trim();A==="juice end ignore"?(a=!0,l.push(u)):A==="juice start ignore"&&(a=!1,l.push(u),l.length>0&&(s.unshift(tu(l.slice().reverse())),l=[]));continue}if(a){l.push(u);continue}if(o.has(c)){s.unshift(tu([u]));continue}const f=u.type==="atrule"&&u.name==="font-face",d=u.type==="atrule"&&u.name==="media",h=u.type==="atrule"&&/^(-\w+-)?keyframes$/.test(u.name),p=u.type==="atrule"&&u.name==="container",m=u.type==="atrule"&&u.name==="layer",g=u.type==="rule"?u.selectors:null;(t.fontFaces&&f||t.mediaQueries&&d||t.containerQueries&&p||t.layers&&m||t.keyFrames&&h||t.pseudos&&g&&AE(g[0],n)||t.preservedSelectors&&g&&g.some(A=>yE(A,t.preservedSelectors)))&&s.unshift(tu([u]))}return s.length===0?!1:`
953
+ `+s.join(`
954
+ `)+`
955
+ `}function gE(e,t,n){const r=" ".repeat(t);switch(e.raws||(e.raws={}),e.type){case"rule":case"atrule":e.raws.before=n?"":`
956
+ `+r,e.nodes?(e.raws.between=" ",e.raws.after=`
957
+ `+r,e.raws.semicolon=!0,e.nodes.forEach(i=>gE(i,t+1,!1))):e.raws.between="";break;case"decl":e.raws.before=`
958
+ `+r,e.raws.between=": ";break;case"comment":e.raws.before=n?"":`
959
+ `+r;break}}function tu(e){const t=ft.root();return t.raws.semicolon=!0,e.forEach((n,r)=>{const i=n.clone();gE(i,0,r===0),t.append(i)}),t.toString()}function XH(e){if(typeof e=="string")return null;let t=typeof e;e===null?t="null":t==="object"&&(t=e.constructor&&e.constructor.name||"object");const n=e instanceof Uint8Array?" If you read it from a file, pass 'utf8' as the encoding or call .toString() on it.":"";return new TypeError("juice expects an HTML string, got "+t+"."+n)}function eK(e,t){const n=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp("(^|[^:]):("+n.join("|")+")(?![\\w-])","i"),i=QI(e);let o=!1;return i.walkRules(s=>{s.selectors.some(a=>r.test(a))&&s.each(a=>{a.type==="decl"&&!a.important&&(a.important=!0,o=!0)})}),o?i.toString():e}function AE(e,t){return t.find(function(n){return e.indexOf(":"+n)>-1})}function yE(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++){const r=t[n];if(e===r||e.indexOf(r)!==-1)return!0}return!1}function tK(e,t,n,r){let i;try{i=LA(e)}catch{return""}const o=[];for(const s of i.nodes){if(s.type!=="rule"){o.push(s);continue}if(n.preservePseudos&&AE(s.selectors[0],r)){o.push(s);continue}if(n.preservedSelectors&&s.selectors.some(l=>yE(l,n.preservedSelectors))){o.push(s);continue}const a=s.selectors.filter(l=>!t.has(l));if(a.length>0){const l=s.clone();l.selectors=a,o.push(l)}}return o.length===0?"":tu(o)}function nK(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return e.length-t.length}function _x(e){const t=Object.assign({extraCss:"",insertPreservedExtraCss:!0,applyStyleTags:!0,removeStyleTags:!0,removeInlinedSelectors:!1,preserveMediaQueries:!0,preserveContainerQueries:!0,preserveLayers:!0,preserveFontFaces:!0,preserveKeyFrames:!0,preservePseudos:!0,preservedSelectors:[],applyWidthAttributes:!0,applyHeightAttributes:!0,applyAttributesTableElements:!0,resolveCSSVariables:!0,inlineDuplicateProperties:!1,addImportantToPseudoClasses:!1,url:""},e);return t.webResources=t.webResources||{},t}const rK=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,iK=/^JUICE_STYLE_(\d+)_$/,oK=function(e,t){return e.replace(rK,function(n,r,i,o){return i.indexOf("<")===-1||i.indexOf("<![CDATA[")>-1?n:(t.push(i),r+"JUICE_STYLE_"+(t.length-1)+"_"+o)})},sK=function(e,t){e("style").each(function(){const n=this.children[0],r=this.children.length===1&&n.type==="text"&&iK.exec(n.data);r&&(n.data=t[r[1]])})},aK=function(e,t,n){const{xmlMode:r,...i}=t;if(t=Object.assign({xml:{decodeEntities:!1,xmlMode:r}},i),e=n(e),!r)return f0(e,t);const o=[],s=f0(oK(e,o),t);return sK(s,o),s},lK=function(){const e=[];return{encodeEntities:function(r){const i=ec.codeBlocks;return Object.keys(i).forEach(function(o){const s=new RegExp(i[o].start+"([\\S\\s]*?)"+i[o].end,"g");r=r.replace(s,function(a){return e.push(a),"JUICE_CODE_BLOCK_"+(e.length-1)+"_"})}),r},decodeEntities:function(r){for(let i=0;i<e.length;i++){const o=new RegExp("JUICE_CODE_BLOCK_"+i+'_(="")?',"gi");r=r.replace(o,function(){return e[i]})}return r}}};function ec(e,t,n,r){const i=XH(e);if(i)throw i;const o=lK(),s=aK(e,t,o.encodeEntities),a=[s];a.push.apply(a,r);const l=n.apply(void 0,a)||s;return t&&t.xmlMode?o.decodeEntities(l.xml()):o.decodeEntities(l.html())}ec.codeBlocks={EJS:{start:"<%",end:"%>"},HBS:{start:"{{",end:"}}"},FTL:{start:"<#",end:">"},FTL_CLOSE:{start:"</#",end:">"},FTL_MACRO:{start:"<@",end:">"},FTL_MACRO_CLOSE:{start:"</@",end:">"}};const cK=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function bE(e){return e===0||e>=55296&&e<=57343||e>1114111}function uK(e){return bE(e)?65533:e>=128&&e<=159&&cK[e-128]||e}function fK(e){return bE(e)?65533:e}function hK(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(uK(e))}const Xn=(()=>{const e=new Uint8Array(127);let t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function dK(e,t,n,r,i,o){const a=e.length,l=o*90;let c=0;const u=()=>{const N=Xn[e.charCodeAt(c++)];return N<o?N:N*91-l+Xn[e.charCodeAt(c++)]},f=n-r,d=n+i,h=new Int32Array(d);h.fill(-1,r,o),h.fill(-1,o+f,d);const p=new Int32Array(d),m=new Int32Array(d);function g(N,T){let L=0,G=T;const X=T+N;for(;G<X;){const Y=Xn[e.charCodeAt(c++)];if(Y<89)L+=Y,h[G++]=L;else if(Y===89){let z=Xn[e.charCodeAt(c++)]+2;for(;z--;)h[G++]=++L}else{const z=Xn[e.charCodeAt(c++)];L+=89+(z<90?z*91+Xn[e.charCodeAt(c++)]:Xn[e.charCodeAt(c++)]*8281+Xn[e.charCodeAt(c++)]*91+Xn[e.charCodeAt(c++)]),h[G++]=L}}}g(r,0),g(f,o);const A=new Int32Array(i*2);let x=0,b=0;function y(N,T){for(let L=0;L<N;L++){const G=T+L,X=u(),Y=u();A[b*2]=X,A[b*2+1]=Y,b+=1,p[G]=x;const z=(h[X]<0?m[X]:1)+(h[Y]<0?m[Y]:1);m[G]=z,x+=z}}y(i-o+r,o+f),y(o-r,r);const C=new Uint16Array(x);let w=0;for(let N=0;N<b;N++)for(let T=0;T<2;T++){const L=A[N*2+T],G=h[L];if(G<0){let X=p[L];const Y=X+m[L];for(;X<Y;)C[w++]=C[X++]}else C[w++]=G}const v=new Uint16Array(t);let D=0;for(;c<a;){let N=Xn[e.charCodeAt(c++)];N>=o&&(N=N*91-l+Xn[e.charCodeAt(c++)]);const T=h[N];if(T<0){let L=p[N];const G=L+m[N];for(;L<G;)v[D++]=C[L++]}else v[D++]=T}return v}const pK=dK("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var Et;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(Et||(Et={}));var pt;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(pt||(pt={}));const Fu=32,wE=21,xE=2097151,nm=2047;let kE=0;function CE(e){const t=e>>>wE;return t===nm?kE:t}function vE(e){return e-pt.ZERO>>>0<=9}function mK(e){return(e|Fu)-pt.LOWER_A>>>0<=5}function SE(e){return(e|Fu)-pt.LOWER_A>>>0<=25}function gK(e){return e===pt.EQUALS||SE(e)||vE(e)}var Nx;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Nx||(Nx={}));var Fa;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Fa||(Fa={}));function AK(e,t,n,r){const i=(t&Et.BRANCH_LENGTH)>>7,o=t&Et.JUMP_TABLE;if(o){if(i===0)return r===o?n:-1;const l=r-o;if(l>>>0>=i)return-1;const c=e[n+l];return c===0?-1:n+i+c-1&65535}if(i===0)return-1;const s=i+1>>1,a=n+s+i;for(let l=0;l<i;l++){const u=e[n+(l>>1)]>>((l&1)<<3)&255;if(u===r){const f=n+s+l;return a+e[f]&65535}if(u>r)return-1}return-1}function Ox(e,t,n){return n===1?String.fromCharCode(e[t]&Et.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function IE(e,t,n){let r=t+1,i=0,o=r;if(r<n&&(e.charCodeAt(r)|Fu)===pt.LOWER_X)for(r+=1,o=r;r<n;){const a=e.charCodeAt(r);if(vE(a))i=i*16+(a-pt.ZERO);else if(mK(a))i=i*16+((a|Fu)-pt.LOWER_A+10);else break;r+=1}else for(;r<n;){const a=e.charCodeAt(r)-pt.ZERO;if(a>>>0>9)break;i=i*10+a,r+=1}if(r===o)return 0;r<n&&e.charCodeAt(r)===pt.SEMI&&(r+=1),i>1114111&&(i=1114112);let s=r-t;return s>=nm&&(kE=s,s=nm),s<<wE|i}function yK(e,t,n){const r=pK;let i=e.indexOf("&");if(i<0)return e;const o=e.length;let s=0,a="";const l=r[0],c=l&Et.JUMP_TABLE,u=(l&Et.BRANCH_LENGTH)>>7;do{const f=i+1,d=e.charCodeAt(f);let h,p;if(d===pt.NUM){const m=IE(e,f,o);h=CE(m),t&&h>0&&e.charCodeAt(f+h-1)!==pt.SEMI&&(h=0),p=h===0?"":hK(m&xE)}else if(SE(d)){h=0,p="";const m=d-c;let g;if(m>>>0<u){const C=r[1+m];g=C===0?-1:u+C&65535}else g=-1;let A=0,x=0,b=g<0?0:r[g],y=f+1;e:for(;y<o;){for(;(b&(Et.VALUE_LENGTH|Et.FLAG13))===0&&(b&Et.JUMP_TABLE)!==0;){const D=b&Et.JUMP_TABLE,N=(b&Et.BRANCH_LENGTH)>>7;if(N===0){if(e.charCodeAt(y)!==D)break e;g+=1}else{const T=e.charCodeAt(y)-D;if(T>>>0>=N)break e;const L=r[g+1+T];if(L===0)break e;g=g+N+L&65535}if(b=r[g],y+=1,y>=o)break e}if((b&(Et.VALUE_LENGTH|Et.FLAG13))===Et.FLAG13){const D=(b&Et.BRANCH_LENGTH)>>7;if(e.charCodeAt(y)!==(b&Et.JUMP_TABLE))break;y+=1;const N=D-1;let T=g+1,L=0;for(;L+1<N;L+=2){const G=r[T];if(e.charCodeAt(y)!==(G&255)||(y+=1,e.charCodeAt(y)!==(G>>8&255)))break e;y+=1,T+=1}if(L<N){if(e.charCodeAt(y)!==(r[T]&255))break;y+=1}g+=1+(D>>1),b=r[g];continue}const C=b>>>14,w=e.charCodeAt(y);if(C!==0){if(w===pt.SEMI){h=y-f+1,p=C===1?String.fromCharCode(b&Et.VALUE_MASK):Ox(r,g,C);break}if(!t&&(b&Et.FLAG13)===0&&(h=y-f,A=g,x=C),C===1)break}const v=AK(r,b,g+(C||1),w);if(v<0)break;g=v,b=r[g],y+=1}if(p===""){const C=b>>>14;C!==0&&!t&&(b&Et.FLAG13)===0&&(h=y-f,A=g,x=C),h>0&&(p=Ox(r,A,x))}}else h=0,p="";h===0||n&&d!==pt.NUM&&e.charCodeAt(f+h-1)!==pt.SEMI&&f+h<o&&gK(e.charCodeAt(f+h))?i=f:(s<i&&(a+=e.slice(s,i)),a+=p,i=s=f+h),e.charCodeAt(i)!==pt.AMP&&(i=e.indexOf("&",i))}while(i>=0);return a+e.slice(s)}function bK(e,t=Fa.Legacy){return yK(e,t===Fa.Strict,t===Fa.Attribute)}function wK(e){let t=e.indexOf("&");if(t<0)return e;let n=0,r="";do{const i=t+1;let o=0,s="";const a=e.charCodeAt(i);if(a===pt.NUM){const l=IE(e,i,e.length);if(o=CE(l),o===0||e.charCodeAt(i+o-1)!==pt.SEMI)o=0;else{const c=l&xE;s=c-1>>>0<55295?String.fromCharCode(c):String.fromCodePoint(fK(c))}}else switch(a){case 108:case 103:{e.charCodeAt(i+1)===116&&e.charCodeAt(i+2)===pt.SEMI&&(o=3,s=a===108?"<":">");break}case 97:{const l=e.charCodeAt(i+1);l===109&&e.charCodeAt(i+2)===112&&e.charCodeAt(i+3)===pt.SEMI?(o=4,s="&"):l===112&&e.charCodeAt(i+2)===111&&e.charCodeAt(i+3)===115&&e.charCodeAt(i+4)===pt.SEMI&&(o=5,s="'");break}case 113:{e.charCodeAt(i+1)===117&&e.charCodeAt(i+2)===111&&e.charCodeAt(i+3)===116&&e.charCodeAt(i+4)===pt.SEMI&&(o=5,s='"');break}}o>0?(n<t&&(r+=e.slice(n,t)),r+=s,t=n=i+o):t=i,t=e.charCodeAt(t)===pt.AMP?t:e.indexOf("&",t)}while(t>=0);return r+e.slice(n)}var Lu;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(Lu||(Lu={}));var Dx;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(Dx||(Dx={}));function xK(e,t=Lu.XML){if((typeof t=="number"?t:t.level)===Lu.HTML){const r=typeof t=="object"?t.mode:void 0;return bK(e,r)}return wK(e)}function Mx(e){if(isNaN(e))return NaN;const t=String(+e).split(""),n=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];let r="",i=3;for(;i--;)r=(n[+t.pop()+i*10]||"")+r;return Array(+t.join("")+1).join("M")+r}function Bx(e){let t="",n;for(;e>0;)n=(e-1)%26,t=String.fromCharCode(65+n)+t,e=(e-n)/26|0;return t||void 0}const kK=e=>{let t="";do t=(Math.random()+1).toString(36).substring(2);while(e.indexOf(t)!==-1);return t},CK=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r==="("){t.push(n);continue}if(r!==")")continue;const i=t.pop();if(i===void 0)continue;const o=e.slice(i+1,n);if(o.indexOf("(")!==-1||o.indexOf(")")!==-1)continue;let s=i-1;for(;s>=0&&/\s/.test(e[s]);)s--;let a=s;for(;a>=0&&/[a-z-]/i.test(e[a]);)a--;if(a++,a>s)continue;const l=o.indexOf(",");return{match:e.slice(a,n+1),name:e.slice(a,s+1),arg:(l===-1?o:o.slice(0,l)).trim(),fallback:l===-1?void 0:o.slice(l+1).trim()}}return null},vK=(e,t)=>{const n=[],r=kK(t);let i;for(;(i=CK(t))!==null;){const o=`${n.length}`;if(i.name.toLowerCase()=="var"){const a=EE(e,i.arg);if(a){t=t.replace(i.match,a);continue}if(i.fallback){t=t.replace(i.match,i.fallback);continue}}const s=`${r}${o.padStart(5,"-")}`;t=t.replace(i.match,s),n.push({placeholder:s,replace:i.match})}for(let o=n.length-1;o>=0;o--){const s=n[o];t=t.replace(s.placeholder,s.replace)}return t},EE=(e,t)=>{for(;e;){if(e.styleProps&&t in e.styleProps)return e.styleProps[t].value;e=e.pseudoElementParent||e.parent}};function SK(e){e.ignoredPseudos=["hover","active","focus","visited","link","first-letter","first-line","marker","selection","placeholder"],e.widthElements=["TABLE","TD","TH","IMG"],e.heightElements=["TABLE","TD","TH","IMG"],e.tableElements=["TABLE","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],e.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],e.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},e.excludedProperties=[],e.juiceDocument=a,e.inlineDocument=t;function t(p,m,g){g=_x(g);const A=Tx(m),x=[];let b="style",y=!1;const C=g.removeInlinedSelectors?new Set:null;g.styleAttributeName&&(b=g.styleAttributeName);function w(X){let Y=X[0];const z=X[1],ue=new Pu(Y),re=ue.parsed();if(!re||re.nodes.length===0)return;const le=re.nodes[0],Be=o(le);let R=!1;if(le.walkPseudos(k=>{const K=k.value.replace(/^:+/,"");e.ignoredPseudos.indexOf(K)>=0&&(R=!0)}),R)return;if(Be){const k=le.clone();k.walkPseudos(K=>{s(K)&&K.remove()}),Y=k.toString()}let H;try{H=p(Y)}catch{return}let _=!1;H.each(function(){let k=this;if(k.name&&e.nonVisualElements.indexOf(k.name.toUpperCase())>=0)return;_=!0;let K=g.inlineDuplicateProperties;const M=p(k).attr("data-juice-duplicates");M!==void 0&&(K=M!=="false");let V=g.preserveImportant;const me=p(k).attr("data-juice-important");if(me!==void 0&&(V=me!=="false"),Be){const ae="pseudo"+Be;let we=k[ae];we||(we=k[ae]=p("<span />").get(0),we.pseudoElementType=Be,we.pseudoElementParent=k,k[ae]=we),k=we}if(!k.styleProps){if(k.styleProps={},k.preserveImportant=V,p(k).attr(b)){const ae=p(k).attr(b),I="* { "+(g.decodeStyleAttributes?xK(ae):ae)+" } ";let E;try{E=Tx(I,{strict:!0})[0][1]}catch{k.rawStyleAttribute=ae.trim()}E&&fe(E,new Pu("<style>",!0))}x.push(k)}function fe(ae,we){for(let I=0,E=ae.length;I<E;I++)if(ae[I].type=="property"){const B=ae[I].name;let q=ae[I].value;(/^counter-(reset|set|increment)$/.test(B)||B==="content"&&/counter\s*\(/i.test(q))&&(y=!0);const U=q.match(/!important$/)!==null;U&&!V&&(q=n(q));const F=[ae[I].position.start.line,ae[I].position.start.col],ee=new vf(B,q,we,U?2:0,F),W=k.styleProps[B];if(e.excludedProperties.indexOf(B)<0)if(K)if(W)if(W.selector===we)ee.nextProp=W,k.styleProps[B]=ee;else{let ne=W;for(;ne.nextProp;)ne=ne.nextProp;ne.nextProp=ee}else k.styleProps[B]=ee;else(W&&W.compare(ee)===ee||!W)&&(W&&W.selector!==we?delete k.styleProps[B]:W&&(ee.nextProp=W),k.styleProps[B]=ee)}}fe(z,ue)}),_&&C&&C.add(X[0])}function v(X){const Y=[];Object.keys(X.styleProps).forEach(function(ue){let re=X.styleProps[ue];for(;typeof re<"u";)Y.push(re),re=re.nextProp}),Y.sort(function(ue,re){return ue.compareFunc(re)});let z=Y.filter(function(ue){return g.resolveCSSVariables&&ue.prop.indexOf("--")===0?!1:ue.prop!=="content"}).map(function(ue){return g.resolveCSSVariables&&(ue.value=vK(X,ue.value)),ue.prop+": "+ue.value.replace(/["]/g,"'")+";"}).join(" ");z&&X.rawStyleAttribute&&(z+=" "+X.rawStyleAttribute),z&&p(X).attr(b,z)}function D(X){let Y=[];const z=_=>_.pseudoElementParent||_.parent,ue=(_,k)=>{let K=_.styleProps&&_.styleProps[k],M=K;for(;K;)M=K.compare(M),K=K.nextProp;return M?n(M.value):null},re=(_,k)=>{const K=_.trim().split(/\s+/),M=[];for(let V=0;V<K.length;V++){if(K[V]==="none")continue;const me=parseInt(K[V+1],10);M.push([K[V],isNaN(me)?k:me]),isNaN(me)||V++}return M},le=(_,k)=>{for(let K=_.length-1;K>=0;K--)if(_[K].name===k)return _[K];return null},Be=(_,k,K,M)=>{const V=le(k,K);V&&(V.origin===_||z(V.origin)===z(_))&&k.splice(k.lastIndexOf(V),1);const me={name:K,origin:_,value:M};return k.push(me),me},R=(_,k,K)=>{const M=k.map(I=>Object.assign({},I));K.forEach(I=>{M.some(E=>E.name===I.name)||M.push(Object.assign({},I))}),Y.forEach(I=>{const E=M.find(B=>B.name===I.name&&B.origin===I.origin);E&&(E.value=I.value)});const V=ue(_,"counter-reset");V&&re(V,0).forEach(([I,E])=>Be(_,M,I,E));const me=ue(_,"counter-increment");me&&re(me,1).forEach(([I,E])=>{(le(M,I)||Be(_,M,I,0)).value+=E});const fe=ue(_,"counter-set");fe&&re(fe,0).forEach(([I,E])=>{(le(M,I)||Be(_,M,I,0)).value=E}),_.counters=M,Y=M;const ae=[_.pseudobefore].concat((_.children||[]).filter(I=>I.type==="tag"||I.type==="script"||I.type==="style")).concat(_.pseudoafter).filter(Boolean);let we=[];return ae.forEach(I=>{we=R(I,M,we)}),M};let H=[];X.root().get(0).children.filter(_=>_.type==="tag").forEach(_=>{H=R(_,[],H)})}function N(X){if(X.pseudoElementType&&X.styleProps.content){const Y=i(X);Y.img?(X.name="img",p(X).attr("src",Y.img)):p(X).text(Y);const z=X.pseudoElementParent;X.pseudoElementType==="before"?p(z).prepend(X):p(z).append(X)}}function T(X,Y){if(!X.name)return;const z=X.name.toUpperCase();if(e[Y+"Elements"].indexOf(z)>-1){for(const ue in X.styleProps)if(X.styleProps[ue].prop===Y){let re=X.styleProps[ue].value;if(X.preserveImportant&&(re=n(re)),re.match(/(px|auto)/)){const le=re.replace("px","");p(X).attr(Y,le);return}if(e.tableElements.indexOf(z)>-1&&re.match(/\%/)){p(X).attr(Y,re);return}}}}function L(X){return X.indexOf("url(")!==0?X:X.replace(/^url\((["'])?([^"']+)\1\)$/,"$2")}function G(X){if(!X.name)return;const Y=X.name.toUpperCase(),z=Object.keys(e.styleToAttribute);if(e.tableElements.indexOf(Y)>-1){for(const ue in X.styleProps)if(z.indexOf(X.styleProps[ue].prop)>-1){const re=e.styleToAttribute[X.styleProps[ue].prop];let le=X.styleProps[ue].value;if(X.preserveImportant&&(le=n(le)),re==="background"&&(le=L(le)),/(linear|radial)-gradient\(/i.test(le))continue;p(X).attr(re,le)}}}if(A.forEach(w),p("[data-juice-duplicates]").removeAttr("data-juice-duplicates"),p("[data-juice-important]").removeAttr("data-juice-important"),x.forEach(v),g.inlinePseudoElements&&(y&&D(p),x.forEach(N)),g.applyWidthAttributes&&x.forEach(function(X){T(X,"width")}),g.applyHeightAttributes&&x.forEach(function(X){T(X,"height")}),g.applyAttributesTableElements&&x.forEach(G),g.insertPreservedExtraCss&&g.extraCss){const X=Rx(g.extraCss,{mediaQueries:g.preserveMediaQueries,containerQueries:g.preserveContainerQueries,layers:g.preserveLayers,fontFaces:g.preserveFontFaces,keyFrames:g.preserveKeyFrames,preservedSelectors:g.preservedSelectors});if(X){let Y=null;g.insertPreservedExtraCss!==!0?Y=p(g.insertPreservedExtraCss):(Y=p("head"),Y.length||(Y=p("body")),Y.length||(Y=p.root())),Y.first().append("<style>"+X+"</style>")}}return C}function n(p){return p.replace(/\s*!important$/,"")}function r(p,m){switch(m){case"lower-roman":return Mx(p).toLowerCase();case"upper-roman":return Mx(p);case"lower-latin":case"lower-alpha":return Bx(p).toLowerCase();case"upper-latin":case"upper-alpha":return Bx(p);default:return p.toString()}}function i(p){let m=p.styleProps.content.value;if(m==="none"||m==="normal")return"";const g=m.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);if(g)return{img:g[1].replace(/^['"]|['"]$/g,"")};const A=[],x=m.split(/['"]/);for(let b=0;b<x.length;b++){if(x[b]==="")continue;const y=x[b].match(/var\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(y){const v=EE(p,y[1])||y[2];A.push(v.replace(/^['"]|['"]$/g,""));continue}const C=x[b].match(/counter\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(C){const v=(p.counters||[]).filter(D=>D.name===C[1]).pop();A.push(r(v?v.value:0,C[3]));continue}const w=x[b].match(/attr\s*\(\s*(.*?)\s*\)/i);if(w){const v=w[1];A.push(p.pseudoElementParent?p.pseudoElementParent.attribs[v]:p.attribs[v]);continue}A.push(x[b])}return m=A.join(""),m=m.replace(/\\/g,""),m}function o(p){let m;return p.walkPseudos(g=>{!m&&s(g)&&(m=g.value.replace(/^:+/,""))}),m}function s(p){const m=p.value;return m===":before"||m==="::before"||m===":after"||m==="::after"}function a(p,m){m=_x(m);const g=new Set;(m.removeInlinedSelectors&&!m.removeStyleTags||m.addImportantToPseudoClasses)&&p("style[data-embed]").each(function(){g.add(this)});let A=h(p,m);A+=`
960
+ `+m.extraCss;const x=t(p,A,m);return x&&!m.removeStyleTags&&f(p,x,m,g),m.addImportantToPseudoClasses&&c(p,g),p}const l=["before","after","first-letter","first-line","marker","selection","placeholder"];function c(p,m){const g=e.ignoredPseudos.filter(A=>l.indexOf(A)===-1);g.length!==0&&p("style").each(function(){const A=m.has(this)?null:u(this);A&&A.set(eK(A.css,g))})}function u(p){const m=p.childNodes;if(m.length===1&&m[0].type==="text"){const y=m[0];return{css:y.data,set:C=>{y.data=C}}}const g=m.filter(y=>y.type==="cdata"),A=m.every(y=>y.type==="cdata"||y.type==="text"&&/^\s*(\/\*|\*\/)?\s*$/.test(y.data));if(g.length!==1||!A||g[0].childNodes.length!==1)return null;const x=g[0].childNodes[0],b=/^\s*\*\//.test(x.data)&&/\/\*\s*$/.test(x.data);return{css:b?x.data.replace(/^\s*\*\//,"").replace(/\/\*\s*$/,""):x.data,set:y=>{x.data=b?"*/"+y+"/*":y}}}function f(p,m,g,A){p("style").each(function(){const b=this,y=u(b);if(!y||A&&A.has(b))return;const C=tK(y.css,m,g,e.ignoredPseudos);C&&C.trim()?y.set(C):p(b).remove()})}function d(p,m){const g=[];return p("style").each(function(){const x=this,b=u(x);if(!b){m.removeStyleTags&&p(x).remove();return}if(m.applyStyleTags&&p(x).attr("data-embed")===void 0&&g.push(b.css),m.removeStyleTags&&p(x).attr("data-embed")===void 0){const y=Rx(b.css,{mediaQueries:m.preserveMediaQueries,containerQueries:m.preserveContainerQueries,layers:m.preserveLayers,fontFaces:m.preserveFontFaces,keyFrames:m.preserveKeyFrames,pseudos:m.preservePseudos,preservedSelectors:m.preservedSelectors},e.ignoredPseudos);y?b.set(y):p(x).remove()}p(x).removeAttr("data-embed")}),g}function h(p,m){return d(p,m).join(`
961
+ `)}return e}const ul=SK(function(e,t){return ec(e,{xmlMode:t&&t.xmlMode},IK,[t])}),IK=function(e,t){return ul.juiceDocument(e,t)};ul.inlineContent=function(e,t,n){return ec(e,{xmlMode:n&&n.xmlMode},ul.inlineDocument,[t,n])};ul.codeBlocks=ec.codeBlocks;const Px={"--background":"0 0% 100%","--foreground":"240 10% 3.9%","--card":"0 0% 100%","--card-foreground":"240 10% 3.9%","--muted":"240 4.8% 95.9%","--muted-foreground":"240 3.8% 46.1%","--primary-foreground":"0 0% 100%","--border":"240 5.9% 90%"};function Fx(e){return["max-width: 100%","margin: 0","padding: 10px 4px 30px",`background: ${e.background}`,"box-sizing: border-box",`font-family: ${e.fontFamily}`,"font-size: 16px",`color: ${e.color}`,"overflow-wrap: break-word","word-break: break-word",`line-height: ${e.lineHeight??"1.84"}`,`letter-spacing: ${e.letterSpacing??"0.012em"}`,"-webkit-text-size-adjust: 100%"].join("; ")}function Lx(e){return["margin-top: 32px","text-align: center","font-size: 12px","line-height: 1.6","letter-spacing: 0.08em",`color: ${e}`].join("; ")}const zx={default:{name:"sage-journal",account:"default",editorVars:{...Px,"--primary":"220 9% 10%","--ring":"220 9% 10%","--accent":"210 14% 96%","--accent-foreground":"220 9% 10%","--muted":"210 14% 96%","--muted-foreground":"215 8% 42%","--border":"220 10% 86%","--brand":"#ca6093","--brand-soft":"#ca6093","--brand-bg":"rgba(202, 96, 147, 0.08)","--brand-bg-deep":"rgba(202, 96, 147, 0.12)","--text":"#292526","--text-soft":"#6f696b","--text-mid":"#4d484a","--divider":"#e2dcdf","--bg-page":"#ffffff","--bg-warm":"#faf7f8"},exportTheme:{containerStyle:Fx({background:"#ffffff",color:"#292526",fontFamily:"-apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif",lineHeight:"1.84",letterSpacing:"0.012em"}),footerText:"公众号 · 早早集市",footerStyle:Lx("#716a6d"),fontFamily:"-apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif",bodyColor:"#292526",mutedColor:"#6f696b",h2Color:"#1f1b1c",h3Color:"#5c5658",primaryColor:"#a94473",dividerColor:"#e2dcdf",blockquoteBorderColor:"#ca6093",bodyLineHeight:"1.84",bodyLetterSpacing:"0.012em"}},ancientone:{name:"rose-ledger",account:"ancientone",editorVars:{...Px,"--primary":"337 38% 58%","--ring":"337 38% 58%","--accent":"337 30% 96%","--accent-foreground":"337 28% 22%","--muted":"338 25% 97%","--border":"337 20% 88%","--brand":"#b86f86","--brand-soft":"#b86f86","--brand-bg":"rgba(184, 111, 134, 0.08)","--brand-bg-deep":"rgba(184, 111, 134, 0.12)","--text":"#30292b","--text-soft":"#756b6e","--text-mid":"#534a4d","--divider":"#dfd7da","--bg-page":"#fefefe","--bg-warm":"#faf7f8"},exportTheme:{containerStyle:Fx({background:"#fefefe",color:"#30292b",fontFamily:"-apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif",lineHeight:"1.85",letterSpacing:"0.015em"}),footerText:"公众号 · 古一软件",footerStyle:Lx("#756b6e"),fontFamily:"-apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif",bodyColor:"#30292b",mutedColor:"#756b6e",h2Color:"#241f21",h3Color:"#61585b",primaryColor:"#8f4d63",dividerColor:"#dfd7da",blockquoteBorderColor:"#b86f86",bodyLineHeight:"1.85",bodyLetterSpacing:"0.015em"}}};function Wx(e){const t={};for(const n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t}function hG(e,t){const n=zx[e]??zx.default;if(!t)return n;const r=t.editorVars&&Object.keys(t.editorVars).length>0,i=t.exportTheme&&Object.keys(Wx(t.exportTheme)).length>0;return{...n,editorVars:r?{...n.editorVars,...t.editorVars}:n.editorVars,exportTheme:i?{...n.exportTheme,...Wx(t.exportTheme)}:n.exportTheme}}function EK(e,t){return[Object.entries(e).filter(([r])=>/^--[a-z0-9-_]+$/i.test(r)).map(([r,i])=>`${r}: ${i};`).join(`
962
+ `),`--wx-font-family: ${t.fontFamily};`,`--wx-body-color: ${t.bodyColor};`,`--wx-muted-color: ${t.mutedColor};`,`--wx-h2-color: ${t.h2Color};`,`--wx-h3-color: ${t.h3Color};`,`--wx-brand-ink: ${t.primaryColor};`,`--wx-brand-accent: ${e["--brand"]??"#ca6093"};`,`--wx-divider-color: ${t.dividerColor};`,`--wx-blockquote-border: ${t.blockquoteBorderColor};`,`--wx-body-line-height: ${t.bodyLineHeight};`,`--wx-body-letter-spacing: ${t.bodyLetterSpacing};`,`--wx-soft-surface: ${e["--bg-warm"]??"#faf8f9"};`].filter(Boolean).join(`
963
+ `)}function TK(e,t){return`
964
+ .milkdown .editor {
965
+ ${EK(e,t)}
966
+ ${t.containerStyle};
967
+ ${t.bodyFontSize?`font-size: ${t.bodyFontSize};`:""}
968
+ }
969
+ .milkdown .editor [data-wechat-node="footer"] {
970
+ ${t.footerStyle};
971
+ }
972
+ .milkdown .editor p {
973
+ ${t.bodyFontSize?`font-size: ${t.bodyFontSize};`:""}
974
+ ${t.bodyParagraphSpacing?`margin-bottom: ${t.bodyParagraphSpacing};`:""}
975
+ ${t.bodyLineHeight?`line-height: ${t.bodyLineHeight};`:""}
976
+ ${t.bodyLetterSpacing?`letter-spacing: ${t.bodyLetterSpacing};`:""}
977
+ ${t.bodyColor?`color: ${t.bodyColor};`:""}
978
+ }
979
+ `}const RK=new Set(["section","p","blockquote","ul","ol","li","pre","code","span","strong","em","b","i","u","s","del","a","img","br","hr","table","thead","tbody","tr","th","td"]),_K=new Set(["script","style","iframe","object","embed","form","button","input","textarea","select","link","meta","svg","math","canvas","template","noscript","video","audio","source"]),NK=new Set(["font","font-family","font-size","font-weight","font-style","color","text-align","line-height","letter-spacing","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","background","background-image","background-color","border","border-top","border-right","border-bottom","border-left","border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-color","border-width","border-style","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-collapse","padding","padding-top","padding-right","padding-bottom","padding-left","margin","margin-top","margin-right","margin-bottom","margin-left","width","min-width","max-width","height","max-height","display","vertical-align","list-style","list-style-type","list-style-position","white-space","white-space-collapse","text-wrap-mode","text-wrap-style","word-break","word-wrap","overflow-wrap","overflow","overflow-x","overflow-y","box-sizing","table-layout","text-size-adjust","-webkit-text-size-adjust"]),OK=new Set(["block","inline","inline-block","list-item","table","table-row","table-cell","table-row-group","table-header-group","none"]);function Je(e,t){e.dataset.wechatNode=t}function qi(e,t){const n=e.ownerDocument.createElement(t);for(const r of Array.from(e.attributes))n.setAttribute(r.name,r.value);for(;e.firstChild;)n.appendChild(e.firstChild);return e.replaceWith(n),n}function DK(e){return/^(?:https?:)?\/\//i.test(e)}function MK(e,t){return Array.from(e.childNodes).every(n=>n===t?!0:n.nodeType===3&&!(n.nodeValue??"").trim())}const BK={kind:"image",selector:"img",finalizeSelector:"figure, figcaption",async prepare(e,t){Je(e,"image");const n=e.getAttribute("src");n&&e.setAttribute("data-src",n);const r=e.parentElement,i=!!r&&r.tagName.toLowerCase()==="p"&&MK(r,e),o=r===t.root;if(!r||!i&&!o)return;const s=e.getAttribute("ratio"),a=s?Number(s):NaN,l=e.getAttribute("alt")??"",c=Number.isFinite(a)&&a>0?a:/^(?:0|[1-9]\d*)\.\d{2}$/.test(l)?Number(l):0;if(c>0&&Number.isFinite(c)){const d=new Image;let h=n??"";typeof window<"u"&&window.location&&window.location.origin&&window.location.origin.startsWith("http")&&h&&!/^(?:https?:|data:|blob:|\/\/)/i.test(h)&&h.startsWith("/")&&!h.startsWith("/local-file")&&(h=`/local-file?path=${encodeURIComponent(h)}`),d.src=h;try{if(await d.decode(),!d.naturalWidth)throw new Error("图片原始宽度为空");e.style.width=`${Math.min(c,1)*100}%`,e.style.maxWidth=`${d.naturalWidth*c}px`,e.style.height="auto"}catch(p){if(t.strictImageDecode??!0)throw new Error(`无法读取缩放图片的原始尺寸:${e.getAttribute("title")||"无图注"}`,{cause:p});e.style.width=`${Math.min(c,1)*100}%`,e.style.height="auto"}}const u=t.document.createElement("figure");Je(u,"image-block"),i?r.replaceWith(u):e.replaceWith(u),u.appendChild(e);const f=(e.getAttribute("caption")||e.getAttribute("title")||"").trim();if(e.removeAttribute("title"),e.removeAttribute("caption"),f){const d=t.document.createElement("figcaption");Je(d,"image-caption"),d.textContent=f,u.appendChild(d)}},finalize(e){const t=e.tagName.toLowerCase();t==="figure"&&qi(e,"section"),t==="figcaption"&&qi(e,"p")}},PK={kind:"code-block",selector:"pre",prepare(e,t){Je(e,"code-block-body");const n=e.querySelector("code");n&&Je(n,"code-block-code");const r=t.document.createElement("section");Je(r,"code-block"),e.replaceWith(r);const i=e.getAttribute("data-language")?.trim();if(i){const o=t.document.createElement("p");Je(o,"code-language"),o.textContent=i,r.appendChild(o)}r.appendChild(e)}},FK={kind:"inline-code",selector:"code:not(pre code)",prepare(e){Je(e,"inline-code")},finalize(e){qi(e,"span")}},LK={kind:"heading",selector:"h1, h2, h3, h4, h5, h6",prepare(e,t){if(Je(e,`heading-${e.tagName.slice(1)}`),e.tagName.toLowerCase()==="h2"&&t.structure){const n=t.document.createElement("span");for(Je(n,"heading-text");e.firstChild;)n.appendChild(e.firstChild);if(e.appendChild(n),t.structure.numberedHeadings){const r=t.document.createElement("span");Je(r,"heading-number"),r.textContent=String(Array.from(t.root.querySelectorAll("h2")).indexOf(e)+1).padStart(2,"0"),e.prepend(r)}if(t.structure.headingLabel){const r=t.document.createElement("span");Je(r,"heading-label"),r.textContent=t.structure.headingLabel,e.prepend(r)}}},finalize(e){qi(e,"section")}},zK={kind:"paragraph",selector:"p",prepare(e){e.dataset.wechatNode||Je(e,"paragraph")}},WK={kind:"emphasis",selector:"strong, b, em, i, s, del, u, mark",prepare(e){Je(e,e.tagName.toLowerCase())},finalize(e){e.tagName.toLowerCase()==="mark"&&qi(e,"span")}},jK={kind:"blockquote",selector:"blockquote",prepare(e,t){if(Je(e,"blockquote"),t.structure?.quoteLabel){const n=t.document.createElement("p");Je(n,"quote-label"),n.textContent=t.structure.quoteLabel,e.prepend(n)}},finalize(e){qi(e,"section")}};function jx(e){const t=e.trim();if(!t)return"";try{const n=new URL(t);n.hash="",n.hostname=n.hostname.toLowerCase();let r=n.pathname;return r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),n.pathname=r,n.toString()}catch{return t.replace(/\/+$/,"")||t}}function UK(e,t,n){const r=jx(e),i=n.find(s=>jx(s.url)===r);if(i)return i;const o={index:n.length+1,text:t.trim()||e,url:e};return n.push(o),o}const HK={kind:"link",selector:"a",prepare(e,t){const n=e.getAttribute("href")?.trim()??"";if(!DK(n)){Je(e,"internal-link");return}const r=UK(n,e.textContent?.trim()||n,t.references);Je(e,"external-link");const i=t.document.createElement("span");Je(i,"link-marker"),i.textContent=`[${r.index}]`,e.after(i)},finalize(e){(e.dataset.wechatNode==="external-link"||e.getAttribute("href")?.startsWith("#"))&&qi(e,"span")}},KK={kind:"list",selector:"ul, ol, li",prepare(e,t){const n=e.tagName.toLowerCase();if(n==="ul"&&Je(e,"bullet-list"),n==="ol"&&Je(e,"ordered-list"),n!=="li")return;const r=e.getAttribute("data-item-type")==="task";if(Je(e,r?"task-list-item":"list-item"),!r)return;const i=t.document.createElement("span");Je(i,"task-marker"),i.textContent=e.getAttribute("data-checked")==="true"?"☑":"☐",(e.querySelector(":scope > p")??e).prepend(i)}},JK={kind:"table",selector:"table, thead, tbody, tr, th, td",prepare(e){Je(e,e.tagName.toLowerCase())}},VK={kind:"divider",selector:"hr",prepare(e){Je(e,"divider")},finalize(e){qi(e,"section")}},qK={kind:"hard-break",selector:"br",prepare(e){Je(e,"hard-break")}},GK={kind:"article",selector:".zzhub-wechat-article",prepare(e,t){if(t.references.length>0){const n=t.document.createElement("section");Je(n,"references");const r=t.document.createElement("p");Je(r,"references-title"),r.textContent="相关链接",n.appendChild(r);const i=t.document.createElement("ol");Je(i,"references-list");for(const o of t.references){const s=t.document.createElement("li");Je(s,"reference-item"),s.textContent=`[${o.index}] ${o.text}: ${o.url}`,i.appendChild(s)}n.appendChild(i),t.root.appendChild(n)}if(t.theme.footerText){const n=t.document.createElement("section");Je(n,"footer");const r=t.document.createElement("p");Je(r,"footer-text"),r.textContent=t.theme.footerText,n.appendChild(r),t.root.appendChild(n)}}},QK=[BK,PK,FK,LK,zK,WK,jK,HK,KK,JK,VK,qK,GK];function YK(e={}){const t=QK.map(r=>e[r.kind]??r),n=e.extraRenderers??[];return[...t,...n]}async function Ux(e,t,n){for(const r of t){const i=r[e];if(!i)continue;const o=e==="finalize"?r.finalizeSelector??r.selector:r.selector,s=[];n.root.matches(o)&&s.push(n.root),s.push(...Array.from(n.root.querySelectorAll(o)));for(const a of s)(a.isConnected||a===n.root)&&await i(a,n)}}function $K(e){return!e?.numberedHeadings&&!e?.headingLabel&&!e?.quoteLabel?"":`
980
+ .milkdown .editor [data-wechat-node="heading-number"],
981
+ .milkdown .editor [data-wechat-node="heading-label"] {
982
+ margin-right: 0.3em;
983
+ opacity: 0.7;
984
+ font-weight: 600;
985
+ }
986
+ .milkdown .editor [data-wechat-node="quote-label"] {
987
+ margin: 0 0 6px;
988
+ font-size: 11px;
989
+ font-weight: 600;
990
+ letter-spacing: 0.05em;
991
+ color: var(--wx-brand-ink, var(--wx-brand-accent, #ca6093));
992
+ text-transform: uppercase;
993
+ }
994
+ `}function Hx(e){return new DOMParser().parseFromString(`<!doctype html><html><body>${e}</body></html>`,"text/html")}const ZK=["top","right","bottom","left"];function XK(e){const t=e.style,n=ZK.map(s=>({side:s,width:t.getPropertyValue(`border-${s}-width`),style:t.getPropertyValue(`border-${s}-style`),color:t.getPropertyValue(`border-${s}-color`)})),r=s=>s.style==="none"||s.style==="hidden",i=!!t.getPropertyValue("border-style")||!!t.getPropertyValue("border-width")||!!t.getPropertyValue("border-color");if(!i&&!n.some(r))return;if(!i){for(const{side:s,style:a}of n)a!=="none"&&a!=="hidden"||(t.removeProperty(`border-${s}`),t.removeProperty(`border-${s}-width`),t.removeProperty(`border-${s}-style`),t.removeProperty(`border-${s}-color`));return}const o=["border","border-width","border-style","border-color"];for(const{side:s}of n)o.push(`border-${s}`,`border-${s}-width`,`border-${s}-style`,`border-${s}-color`);for(const s of o)t.removeProperty(s);for(const s of n)!s.style||r(s)||(s.width&&s.color?t.setProperty(`border-${s.side}`,`${s.width} ${s.style} ${s.color}`):(s.width&&t.setProperty(`border-${s.side}-width`,s.width),t.setProperty(`border-${s.side}-style`,s.style),s.color&&t.setProperty(`border-${s.side}-color`,s.color)))}function e4(e){const t=[];for(let n=0;n<e.style.length;n+=1){const r=e.style.item(n);r&&t.push(r)}for(const n of t){const r=e.style.getPropertyValue(n).trim(),i=/(?:url\s*\(|expression\s*\(|javascript:|var\s*\()/i.test(r),o=n==="display"&&!OK.has(r.toLowerCase());(!NK.has(n)||i||o)&&e.style.removeProperty(n)}e.style.cssText.trim()||e.removeAttribute("style")}function t4(e){const t=e.tagName.toLowerCase();return t==="img"?new Set(["style","src","data-src","alt","width","height"]):t==="a"?new Set(["style","href","title"]):t==="ol"?new Set(["style","start"]):t==="th"||t==="td"?new Set(["style","colspan","rowspan","align"]):new Set(["style"])}function Kx(e,t){const n=e.getAttribute(t)?.trim()??"";if(!n){e.removeAttribute(t);return}if(/^(?:javascript|vbscript):/i.test(n)){e.removeAttribute(t);return}/^data:/i.test(n)&&!/^data:image\/(?:avif|gif|jpe?g|png|webp);base64,/i.test(n)&&e.removeAttribute(t)}function n4(e){const t=[e,...Array.from(e.querySelectorAll("*"))].reverse();for(const n of t){const r=n.tagName.toLowerCase();if(_K.has(r)){n!==e&&n.remove();continue}if(!RK.has(r)){n!==e&&n.replaceWith(...Array.from(n.childNodes));continue}const i=t4(n);for(const o of Array.from(n.attributes))i.has(o.name)||n.removeAttribute(o.name);if(r==="a"){const o=n.getAttribute("href")??"";/^(?:#|https?:\/\/|mailto:|tel:)/i.test(o)||n.removeAttribute("href")}r==="img"&&(Kx(n,"src"),Kx(n,"data-src")),e4(n),XK(n)}}async function dG(e){const t=Hx(""),n=t.createElement("section");n.className="milkdown";const r=t.createElement("section");if(r.className="editor zzhub-wechat-article",r.lang="zh-CN",Je(r,"article"),r.innerHTML=e.semanticHtml,e.structure?.headerImageUrl){const h=t.createElement("p"),p=t.createElement("img");p.src=e.structure.headerImageUrl,p.alt="",h.appendChild(p),r.prepend(h)}n.appendChild(r),t.body.appendChild(n);const i=[],o=xW(),s=kW(),a={...e.renderers,extraRenderers:[...e.renderers?.extraRenderers??[],...o]},l=YK(a);await Ux("prepare",l,{document:t,root:r,theme:e.theme,references:i,structure:e.structure,strictImageDecode:e.strictImageDecode??!0});const c=[e.baseCss,TK(e.editorVars??{},e.theme),$K(e.structure),s,e.customCss??""].filter(Boolean).join(`
995
+ `),u=ul.inlineContent(n.outerHTML,c,{applyAttributesTableElements:!1,applyHeightAttributes:!1,applyStyleTags:!1,applyWidthAttributes:!1,inlinePseudoElements:!1,preserveFontFaces:!1,preserveImportant:!1,preserveKeyFrames:!1,preserveMediaQueries:!1,preservePseudos:!1,removeStyleTags:!0,resolveCSSVariables:!0,decodeStyleAttributes:!0}),f=Hx(u),d=f.querySelector(".zzhub-wechat-article");if(!d)throw new Error("Wechat article root missing after CSS inlining");return await Ux("finalize",l,{document:f,root:d,theme:e.theme,references:i,structure:e.structure,strictImageDecode:e.strictImageDecode??!0}),n4(d),d.outerHTML}const r4=[{key:"h2",label:"二级标题 (H2)",icon:"📌",defaultPresetId:"pillar",presets:[{id:"pillar",name:"左侧呼吸柱(推荐)",css:`.milkdown .editor h2 {
996
+ margin: 2.8em 0 0.65em;
997
+ padding-left: 9px;
998
+ border-left: 4px solid var(--wx-brand-accent, #ca6093);
999
+ border-bottom: none;
1000
+ background: none;
1001
+ font-size: 20px;
1002
+ font-weight: 700;
1003
+ line-height: 1.36;
1004
+ letter-spacing: 0.01em;
1005
+ color: var(--wx-h2-color, #1f1b1c);
1006
+ }`},{id:"bottom-line",name:"极浅底部分割",css:`.milkdown .editor h2 {
1007
+ margin: 3.0em 0 0.8em;
1008
+ padding-bottom: 0.45em;
1009
+ padding-left: 0;
1010
+ border-left: none;
1011
+ border-bottom: 1px solid var(--wx-divider-color, #ebe6e8);
1012
+ background: none;
1013
+ font-size: 20px;
1014
+ font-weight: 700;
1015
+ line-height: 1.35;
1016
+ letter-spacing: 0.015em;
1017
+ color: var(--wx-h2-color, #1f1b1c);
1018
+ }`},{id:"gradient-pill",name:"渐变微衬底(背景色块)",css:`.milkdown .editor h2 {
1019
+ margin: 2.8em 0 0.7em;
1020
+ padding: 7px 14px;
1021
+ border-left: 3px solid var(--wx-brand-accent, #ca6093);
1022
+ border-bottom: none;
1023
+ background: linear-gradient(90deg, rgba(202, 96, 147, 0.09) 0%, rgba(202, 96, 147, 0.01) 100%);
1024
+ border-radius: 4px;
1025
+ font-size: 19px;
1026
+ font-weight: 700;
1027
+ line-height: 1.38;
1028
+ letter-spacing: 0.01em;
1029
+ color: var(--wx-h2-color, #1f1b1c);
1030
+ }`},{id:"contrast-green",name:"反差色绿底(白字反色块)",css:`.milkdown .editor h2 {
1031
+ margin: 2.8em 0 0.8em;
1032
+ padding: 8px 14px;
1033
+ background-color: #1f7a4d;
1034
+ border-left: none;
1035
+ border-bottom: none;
1036
+ border-radius: 4px;
1037
+ color: #ffffff;
1038
+ font-size: 18px;
1039
+ font-weight: 700;
1040
+ line-height: 1.36;
1041
+ letter-spacing: 0.02em;
1042
+ }
1043
+ .milkdown .editor h2 span {
1044
+ color: #ffffff;
1045
+ }`},{id:"card-tag",name:"温润小卡片",css:`.milkdown .editor h2 {
1046
+ margin: 2.7em 0 0.75em;
1047
+ padding: 6px 12px;
1048
+ border-left: none;
1049
+ border-bottom: none;
1050
+ background-color: var(--wx-soft-surface, #faf8f9);
1051
+ border-radius: 4px;
1052
+ font-size: 18px;
1053
+ font-weight: 700;
1054
+ line-height: 1.4;
1055
+ letter-spacing: 0.01em;
1056
+ color: var(--wx-h2-color, #1f1b1c);
1057
+ }`},{id:"plain",name:"经典纯文字",css:`.milkdown .editor h2 {
1058
+ margin: 2.7em 0 0.7em;
1059
+ padding: 0;
1060
+ border-left: none;
1061
+ border-bottom: none;
1062
+ background: none;
1063
+ font-size: 20px;
1064
+ font-weight: 700;
1065
+ line-height: 1.38;
1066
+ letter-spacing: 0.005em;
1067
+ color: var(--wx-h2-color, #1f1b1c);
1068
+ }`}]},{key:"h3",label:"三级标题 (H3)",icon:"🔹",defaultPresetId:"plain",presets:[{id:"plain",name:"经典纯文字(默认)",css:`.milkdown .editor h3 {
1069
+ margin: 1.55em 0 0.4em;
1070
+ padding-left: 0;
1071
+ border-left: none;
1072
+ background: none;
1073
+ font-size: 16px;
1074
+ font-weight: 700;
1075
+ line-height: 1.48;
1076
+ letter-spacing: 0.02em;
1077
+ color: var(--wx-h3-color, #5c5658);
1078
+ }`},{id:"left-bar",name:"左侧微短线",css:`.milkdown .editor h3 {
1079
+ margin: 1.6em 0 0.45em;
1080
+ padding-left: 7px;
1081
+ border-left: 2px solid var(--wx-brand-accent, #ca6093);
1082
+ background: none;
1083
+ font-size: 16px;
1084
+ font-weight: 700;
1085
+ line-height: 1.45;
1086
+ letter-spacing: 0.015em;
1087
+ color: var(--wx-h3-color, #5c5658);
1088
+ }`},{id:"badge",name:"胶囊小微标",css:`.milkdown .editor h3 {
1089
+ display: inline-block;
1090
+ margin: 1.6em 0 0.45em;
1091
+ padding: 3px 8px;
1092
+ border-left: none;
1093
+ background-color: var(--wx-soft-surface, #faf8f9);
1094
+ border-radius: 3px;
1095
+ font-size: 15px;
1096
+ font-weight: 700;
1097
+ line-height: 1.4;
1098
+ color: var(--wx-brand-ink, #ca6093);
1099
+ }`}]},{key:"blockquote",label:"引用块 (Blockquote)",icon:"💬",defaultPresetId:"left-border",presets:[{id:"left-border",name:"经典左单线(默认)",css:`.milkdown .editor blockquote {
1100
+ margin: 1.6em 0;
1101
+ padding: 10px 16px;
1102
+ border: none;
1103
+ border-left: 3px solid var(--wx-blockquote-border, #ca6093);
1104
+ border-radius: 0 4px 4px 0;
1105
+ background-color: var(--wx-soft-surface, #fbfafb);
1106
+ }`},{id:"tint-card",name:"全包裹微卡片",css:`.milkdown .editor blockquote {
1107
+ margin: 1.6em 0;
1108
+ padding: 12px 18px;
1109
+ border: 1px solid var(--wx-divider-color, #ebe6e8);
1110
+ border-radius: 6px;
1111
+ background-color: var(--wx-soft-surface, #fbfafb);
1112
+ }`},{id:"minimal-indent",name:"极简纯缩进",css:`.milkdown .editor blockquote {
1113
+ margin: 1.5em 0;
1114
+ padding: 6px 0 6px 16px;
1115
+ border: none;
1116
+ border-left: 2px solid rgba(0, 0, 0, 0.15);
1117
+ border-radius: 0;
1118
+ background: none;
1119
+ }`}]},{key:"divider",label:"分割线 (Divider)",icon:"➖",defaultPresetId:"hairline",presets:[{id:"hairline",name:"极细实线(默认)",css:`.milkdown .editor hr,
1120
+ .milkdown .editor [data-wechat-node="divider"] {
1121
+ margin: 2.4em 0;
1122
+ width: 100%;
1123
+ border: none;
1124
+ border-top: 1px solid var(--wx-divider-color, #e2dcdf);
1125
+ }`},{id:"dashed",name:"极简虚线",css:`.milkdown .editor hr,
1126
+ .milkdown .editor [data-wechat-node="divider"] {
1127
+ margin: 2.4em 0;
1128
+ width: 100%;
1129
+ border: none;
1130
+ border-top: 1px dashed var(--wx-divider-color, #d4cecf);
1131
+ }`},{id:"short-center",name:"居中短呼吸线",css:`.milkdown .editor hr,
1132
+ .milkdown .editor [data-wechat-node="divider"] {
1133
+ margin: 2.8em auto;
1134
+ width: 36%;
1135
+ border: none;
1136
+ border-top: 1px solid var(--wx-divider-color, #e2dcdf);
1137
+ }`}]},{key:"article-card",label:"篇章结构卡片 (INTRO / CTA)",icon:"🎴",defaultPresetId:"magazine",presets:[{id:"magazine",name:"杂志编者按(推荐)",css:`.milkdown .editor section[data-wechat-node="article-card"],
1138
+ .milkdown .editor .wechat-article-card {
1139
+ margin: 1.8em 0;
1140
+ padding: 16px 20px;
1141
+ border-radius: 10px;
1142
+ box-sizing: border-box;
1143
+ }
1144
+ .milkdown .editor .wechat-article-card-intro {
1145
+ background-color: var(--wx-soft-surface, #faf8f9);
1146
+ border: 1px solid var(--wx-divider, #eae4e7);
1147
+ }
1148
+ .milkdown .editor .wechat-article-card-cta {
1149
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.04));
1150
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
1151
+ text-align: center;
1152
+ }
1153
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
1154
+ .milkdown .editor .wechat-card-eyebrow-badge {
1155
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.08));
1156
+ }
1157
+ .milkdown .editor .wechat-article-card p {
1158
+ margin: 0.4em 0;
1159
+ font-size: 13px;
1160
+ line-height: 1.72;
1161
+ color: var(--wx-text-soft, #555555);
1162
+ }
1163
+ .milkdown .editor .wechat-intro-meta {
1164
+ margin: 4px 0 10px 0 !important;
1165
+ padding-bottom: 8px;
1166
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1167
+ font-size: 12px !important;
1168
+ color: var(--wx-muted-color, #756b6e) !important;
1169
+ }
1170
+ .milkdown .editor .wechat-intro-meta strong {
1171
+ color: var(--wx-brand-accent, #ca6093);
1172
+ }
1173
+ .milkdown .editor .wechat-intro-guide {
1174
+ margin-top: 10px !important;
1175
+ padding-top: 8px;
1176
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1177
+ font-size: 12px !important;
1178
+ color: var(--wx-brand-accent, #ca6093) !important;
1179
+ }`},{id:"top-line",name:"顶部色彩微线",css:`.milkdown .editor section[data-wechat-node="article-card"],
1180
+ .milkdown .editor .wechat-article-card {
1181
+ margin: 1.8em 0;
1182
+ padding: 16px 20px;
1183
+ border-radius: 8px;
1184
+ box-sizing: border-box;
1185
+ }
1186
+ .milkdown .editor .wechat-article-card-intro {
1187
+ background-color: #ffffff;
1188
+ border: 1px solid var(--wx-divider, #eae4e7);
1189
+ border-top: 3px solid var(--wx-brand-accent, #ca6093);
1190
+ }
1191
+ .milkdown .editor .wechat-article-card-cta {
1192
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.04));
1193
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
1194
+ text-align: center;
1195
+ }
1196
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
1197
+ .milkdown .editor .wechat-card-eyebrow-badge {
1198
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.08));
1199
+ }
1200
+ .milkdown .editor .wechat-article-card p {
1201
+ margin: 0.4em 0;
1202
+ font-size: 13px;
1203
+ line-height: 1.72;
1204
+ color: var(--wx-text-soft, #555555);
1205
+ }
1206
+ .milkdown .editor .wechat-intro-meta {
1207
+ margin: 4px 0 10px 0 !important;
1208
+ padding-bottom: 8px;
1209
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1210
+ font-size: 12px !important;
1211
+ color: var(--wx-muted-color, #756b6e) !important;
1212
+ }
1213
+ .milkdown .editor .wechat-intro-meta strong {
1214
+ color: var(--wx-brand-accent, #ca6093);
1215
+ }
1216
+ .milkdown .editor .wechat-intro-guide {
1217
+ margin-top: 10px !important;
1218
+ padding-top: 8px;
1219
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1220
+ font-size: 12px !important;
1221
+ color: var(--wx-brand-accent, #ca6093) !important;
1222
+ }`},{id:"minimal",name:"极简纯白框",css:`.milkdown .editor section[data-wechat-node="article-card"],
1223
+ .milkdown .editor .wechat-article-card {
1224
+ margin: 1.8em 0;
1225
+ padding: 16px 20px;
1226
+ border-radius: 6px;
1227
+ box-sizing: border-box;
1228
+ }
1229
+ .milkdown .editor .wechat-article-card-intro {
1230
+ background-color: #ffffff;
1231
+ border: 1px solid var(--wx-divider, #eae4e7);
1232
+ }
1233
+ .milkdown .editor .wechat-article-card-cta {
1234
+ background-color: #ffffff;
1235
+ border: 1px dashed var(--wx-divider, #dadce0);
1236
+ text-align: center;
1237
+ }
1238
+ .milkdown .editor .wechat-article-card p {
1239
+ margin: 0.4em 0;
1240
+ font-size: 13px;
1241
+ line-height: 1.72;
1242
+ color: var(--wx-text-soft, #555555);
1243
+ }
1244
+ .milkdown .editor .wechat-intro-meta {
1245
+ margin: 4px 0 10px 0 !important;
1246
+ padding-bottom: 8px;
1247
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1248
+ font-size: 12px !important;
1249
+ color: var(--wx-muted-color, #756b6e) !important;
1250
+ }
1251
+ .milkdown .editor .wechat-intro-meta strong {
1252
+ color: var(--wx-brand-accent, #ca6093);
1253
+ }
1254
+ .milkdown .editor .wechat-intro-guide {
1255
+ margin-top: 10px !important;
1256
+ padding-top: 8px;
1257
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1258
+ font-size: 12px !important;
1259
+ color: var(--wx-brand-accent, #ca6093) !important;
1260
+ }`}]}];function pG(e){const t=[];for(const n of r4){const r=n.presets.find(i=>i.id===(e[n.key]||n.defaultPresetId))||n.presets[0];t.push(`/* [${n.label}] - ${r.name} */
1261
+ ${r.css.trim()}`)}return t.join(`
1262
+
1263
+ `)}function Jx(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 i4(e){if(Array.isArray(e))return e}function o4(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function s4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1264
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a4(e,t){return i4(e)||o4(e,t)||l4(e,t)||s4()}function l4(e,t){if(e){if(typeof e=="string")return Jx(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jx(e,t):void 0}}const TE=Object.entries,Vx=Object.setPrototypeOf,c4=Object.isFrozen,RE=Object.getPrototypeOf,_E=Object.getOwnPropertyDescriptor;let Pt=Object.freeze,Vt=Object.seal,gs=Object.create,NE=typeof Reflect<"u"&&Reflect,rm=NE.apply,im=NE.construct;Pt||(Pt=function(t){return t});Vt||(Vt=function(t){return t});rm||(rm=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(n,i)});im||(im=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Wr=mt(Array.prototype.forEach),u4=mt(Array.prototype.lastIndexOf),qx=mt(Array.prototype.pop),ca=mt(Array.prototype.push),f4=mt(Array.prototype.slice),h4=mt(Array.prototype.splice),vs=Array.isArray,Od=OE(Set),Dd=mt(Set.prototype.add),ua=mt(Set.prototype.has),po=mt(String.prototype.toLowerCase),Md=mt(String.prototype.toString),Gx=mt(String.prototype.match),fa=mt(String.prototype.replace),Qx=mt(String.prototype.indexOf),d4=mt(String.prototype.trim),p4=mt(Number.prototype.toString),m4=mt(Boolean.prototype.toString),Yx=typeof BigInt>"u"?null:mt(BigInt.prototype.toString),$x=typeof Symbol>"u"?null:mt(Symbol.prototype.toString),vn=mt(Object.prototype.hasOwnProperty),ha=mt(Object.prototype.toString),Ft=mt(RegExp.prototype.test),jr=OE(TypeError);function mt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return rm(e,t,r)}}function OE(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return im(e,n)}}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:po;if(Vx&&Vx(e,null),!vs(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(c4(t)||(t[r]=o),i=o)}e[i]=!0}return e}function g4(e){for(let t=0;t<e.length;t++)vn(e,t)||(e[t]=null);return e}function Dn(e){const t=gs(null);for(const r of TE(e)){var n=a4(r,2);const i=n[0],o=n[1];vn(e,i)&&(vs(o)?t[i]=g4(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=Dn(o):t[i]=o)}return t}function A4(e){switch(typeof e){case"string":return e;case"number":return p4(e);case"boolean":return m4(e);case"bigint":return Yx?Yx(e):"0";case"symbol":return $x?$x(e):"Symbol()";case"undefined":return ha(e);case"function":case"object":{if(e===null)return ha(e);const t=e,n=Un(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:ha(r)}return ha(e)}default:return ha(e)}}function Un(e,t){for(;e!==null;){const r=_E(e,t);if(r){if(r.get)return mt(r.get);if(typeof r.value=="function")return mt(r.value)}e=RE(e)}function n(){return null}return n}function y4(e,t){for(;e!==null;){const n=_E(e,t);if(n)return n.get?mt(n.get):null;e=RE(e)}return null}function b4(e){try{return Ft(e,""),!0}catch{return!1}}const Zx=Pt(["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"]),Bd=Pt(["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"]),Pd=Pt(["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"]),w4=Pt(["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"]),Fd=Pt(["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"]),x4=Pt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Xx=Pt(["#text"]),ek=Pt(["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"]),Ld=Pt(["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"]),tk=Pt(["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"]),Bc=Pt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),k4=Vt(/{{[\w\W]*|^[\w\W]*}}/g),C4=Vt(/<%[\w\W]*|^[\w\W]*%>/g),v4=Vt(/\${[\w\W]*/g),S4=Vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),I4=Vt(/^aria-[\-\w]+$/),nk=Vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E4=Vt(/^(?:\w+script|data):/i),T4=Vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),R4=Vt(/^html$/i),_4=Vt(/^[a-z][.\w]*(-[.\w]+)+$/i),zd=Vt(/<[/\w!]/g),rk=Vt(/<[/\w]/g),N4=Vt(/<\/no(script|embed|frames)/i),ik=Vt(/\/>/i),It={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},O4=Pt(He({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),D4=function(){return typeof window>"u"?null:window},M4=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},ok=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ri=function(t,n,r,i){return vn(t,n)&&vs(t[n])?He(i.base?Dn(i.base):{},t[n],i.transform):r},Wd=function(t,n,r){const i=vn(t,n)?t[n]:void 0;return i&&typeof i=="object"?Dn(i):r()};function DE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D4();const t=te=>DE(te);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==It.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,s=e.Node,a=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,u=e.trustedTypes,f=a.prototype,d=Un(f,"cloneNode"),h=Un(f,"remove"),p=Un(f,"removeAttributeNode"),m=Un(f,"nextSibling"),g=Un(f,"childNodes"),A=Un(f,"parentNode"),x=Un(f,"shadowRoot"),b=Un(f,"attributes"),y=s&&s.prototype?Un(s.prototype,"nodeType"):null,C=s&&s.prototype?Un(s.prototype,"nodeName"):null,w=s&&s.prototype?Un(s.prototype,"ownerDocument"):null,v=function(S){return y?y(S):S.nodeType},D=function(S){return C?C(S):S.nodeName},N=y4(f,"namespaceURI"),T=function(S){return N?N(S):S.namespaceURI};if(typeof o=="function"){const te=n.createElement("template");te.content&&te.content.ownerDocument&&(n=te.content.ownerDocument)}let L,G="",X,Y=!1,z=0;const ue=function(){if(z>0)throw jr('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.')},re=function(S){ue(),z++;try{return L.createHTML(S)}finally{z--}},le=function(S){ue(),z++;try{return L.createScriptURL(S)}finally{z--}},Be=function(){return Y||(X=M4(u,i),Y=!0),X},R=n,H=R.implementation,_=R.createNodeIterator,k=R.createDocumentFragment,K=R.getElementsByTagName,M=r.importNode;let V=ok();t.isSupported=typeof TE=="function"&&typeof A=="function"&&H&&H.createHTMLDocument!==void 0;const me=k4,fe=C4,ae=v4,we=S4,I=I4,E=E4,B=T4,q=_4;let U=nk,F=null;const ee=He({},[...Zx,...Bd,...Pd,...Fd,...Xx]);let W=null;const ne=He({},[...ek,...Ld,...tk,...Bc]);let j=Object.seal(gs(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}})),he=null,se=null;const de=Object.seal(gs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ye=!0,De=!0,ze=!1,P=!0,Q=!1,pe=!0,ge=!1,Ze=!1,We=null,bt=null,nt=!1,gt=!1,_n=!1,Nn=!1,Zs=!0,Zo=!1;const Gt="user-content-";let mr=!0,On=!1,io=null,Xo={},oo=null;const uy=He({},["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"]);let fy=null;const hy=He({},["audio","video","img","source","image","track"]);let dy=null;const py=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ac="http://www.w3.org/1998/Math/MathML",lc="http://www.w3.org/2000/svg",gr="http://www.w3.org/1999/xhtml";let es=gr,Bf=!1,Pf=null;const zT=He({},[ac,lc,gr],Md),my=Pt(["mi","mo","mn","ms","mtext"]);let Ff=He({},my);const gy=Pt(["annotation-xml"]);let Lf=He({},gy);const WT=He({},["title","style","font","a","script"]);let Xs=null;const jT=["application/xhtml+xml","text/html"],UT="text/html";let kt=null,ts=null;const HT=n.createElement("form"),Ay=function(S){return S instanceof RegExp||S instanceof Function},zf=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ts&&ts===S)return;(!S||typeof S!="object")&&(S={}),S=Dn(S),Xs=jT.indexOf(S.PARSER_MEDIA_TYPE)===-1?UT:S.PARSER_MEDIA_TYPE,kt=Xs==="application/xhtml+xml"?Md:po,F=Ri(S,"ALLOWED_TAGS",ee,{transform:kt}),W=Ri(S,"ALLOWED_ATTR",ne,{transform:kt}),Pf=Ri(S,"ALLOWED_NAMESPACES",zT,{transform:Md}),dy=Ri(S,"ADD_URI_SAFE_ATTR",py,{transform:kt,base:py}),fy=Ri(S,"ADD_DATA_URI_TAGS",hy,{transform:kt,base:hy}),oo=Ri(S,"FORBID_CONTENTS",uy,{transform:kt}),he=Ri(S,"FORBID_TAGS",Dn({}),{transform:kt}),se=Ri(S,"FORBID_ATTR",Dn({}),{transform:kt}),Xo=vn(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?Dn(S.USE_PROFILES):S.USE_PROFILES:!1,ye=S.ALLOW_ARIA_ATTR!==!1,De=S.ALLOW_DATA_ATTR!==!1,ze=S.ALLOW_UNKNOWN_PROTOCOLS||!1,P=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=S.SAFE_FOR_TEMPLATES||!1,pe=S.SAFE_FOR_XML!==!1,ge=S.WHOLE_DOCUMENT||!1,gt=S.RETURN_DOM||!1,_n=S.RETURN_DOM_FRAGMENT||!1,Nn=S.RETURN_TRUSTED_TYPE||!1,nt=S.FORCE_BODY||!1,Zs=S.SANITIZE_DOM!==!1,Zo=S.SANITIZE_NAMED_PROPS||!1,mr=S.KEEP_CONTENT!==!1,On=S.IN_PLACE||!1,U=b4(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:nk,es=typeof S.NAMESPACE=="string"?S.NAMESPACE:gr,Ff=Wd(S,"MATHML_TEXT_INTEGRATION_POINTS",()=>He({},my)),Lf=Wd(S,"HTML_INTEGRATION_POINTS",()=>He({},gy));const O=Wd(S,"CUSTOM_ELEMENT_HANDLING",()=>gs(null));if(j=gs(null),vn(O,"tagNameCheck")&&Ay(O.tagNameCheck)&&(j.tagNameCheck=O.tagNameCheck),vn(O,"attributeNameCheck")&&Ay(O.attributeNameCheck)&&(j.attributeNameCheck=O.attributeNameCheck),vn(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(j.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),Vt(j),Q&&(De=!1),_n&&(gt=!0),Xo&&(F=He({},Xx),W=gs(null),Xo.html===!0&&(He(F,Zx),He(W,ek)),Xo.svg===!0&&(He(F,Bd),He(W,Ld),He(W,Bc)),Xo.svgFilters===!0&&(He(F,Pd),He(W,Ld),He(W,Bc)),Xo.mathMl===!0&&(He(F,Fd),He(W,tk),He(W,Bc))),de.tagCheck=null,de.attributeCheck=null,vn(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?de.tagCheck=S.ADD_TAGS:vs(S.ADD_TAGS)&&(F===ee&&(F=Dn(F)),He(F,S.ADD_TAGS,kt))),vn(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?de.attributeCheck=S.ADD_ATTR:vs(S.ADD_ATTR)&&(W===ne&&(W=Dn(W)),He(W,S.ADD_ATTR,kt))),vn(S,"ADD_FORBID_CONTENTS")&&vs(S.ADD_FORBID_CONTENTS)&&(oo===uy&&(oo=Dn(oo)),He(oo,S.ADD_FORBID_CONTENTS,kt)),mr&&(F["#text"]=!0),ge&&He(F,["html","head","body"]),F.table&&(He(F,["tbody"]),delete he.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=L;L=S.TRUSTED_TYPES_POLICY;try{G=re("")}catch(Z){throw L=$,Z}}else S.TRUSTED_TYPES_POLICY===null?(L=void 0,G=""):(L===void 0&&(L=Be()),L&&typeof G=="string"&&(G=re("")));Pt&&Pt(S),ts=S},yy=He({},[...Bd,...Pd,...w4]),by=He({},[...Fd,...x4]),KT=function(S,O,$){return O.namespaceURI===gr?S==="svg":O.namespaceURI===ac?S==="svg"&&($==="annotation-xml"||Ff[$]):!!yy[S]},JT=function(S,O,$){return O.namespaceURI===gr?S==="math":O.namespaceURI===lc?S==="math"&&Lf[$]:!!by[S]},VT=function(S,O,$){return O.namespaceURI===lc&&!Lf[$]||O.namespaceURI===ac&&!Ff[$]?!1:!by[S]&&(WT[S]||!yy[S])},qT=function(S){const O=T(S),$=po(D(S)),Z=A(S);let Ae,Se;return Z&&v(Z)===It.element?(Ae={namespaceURI:T(Z)},Se=po(D(Z))):(Ae={namespaceURI:es},Se="template"),Pf[O]?O===lc?KT($,Ae,Se):O===ac?JT($,Ae,Se):O===gr?VT($,Ae,Se):!!(Xs==="application/xhtml+xml"&&Pf[O]):!1},di=function(S){ca(t.removed,{element:S});try{A(S).removeChild(S)}catch{if(h(S),!A(S))throw jr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},wy=function(S,O,$){try{p(S,O)}catch{try{S.removeAttribute($)}catch{}}},Wf=function(S){Uf(S);const O=g(S);O&&Wr(f4(O),Z=>{try{h(Z)}catch{}});const $=v(S)===It.element?b(S):null;if($)for(let Z=$.length-1;Z>=0;--Z){const Ae=$[Z],Se=Ae&&Ae.name;typeof Se=="string"&&wy(S,Ae,Se)}},ns=function(S,O,$){if(!$)try{$=O.getAttributeNode(S)}catch{$=null}ca(t.removed,{attribute:$||null,from:O});try{$?p(O,$):O.removeAttribute(S)}catch{try{O.removeAttribute(S)}catch{}}if(S==="is")if(gt||_n)try{di(O)}catch{}else try{O.setAttribute(S,"")}catch{}},xy=function(S){const O=b(S);if(O)for(let $=O.length-1;$>=0;--$){const Z=O[$],Ae=Z&&Z.name;typeof Ae!="string"||W[kt(Ae)]||wy(S,Z,Ae)}},jf=function(S,O){let $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const Z=[S];for(;Z.length>0;){const Ae=Z.pop();if(O(Ae)===!1)continue;if($&&v(Ae)===It.element){const Fe=x(Ae);pi(Fe)&&Z.push(Fe)}const Se=g(Ae);if(Se)for(let Fe=Se.length-1;Fe>=0;--Fe)Z.push(Se[Fe])}},Uf=function(S){jf(S,O=>{v(O)===It.element&&xy(O)})},Hf=function(S){const O=[];return jf(S,$=>{O.push($)},!0),O},GT=function(S,O){const $=Od();Wr(Hf(S),Z=>{v(Z)===It.element&&Dd($,Z)}),Wr(O,Z=>{v(Z)===It.element&&!ua($,Z)&&xy(Z)})},ky=function(S,O){let $=!1;return Wr(t.removed,Z=>{Z.element&&($=$||Z.element===S,Uf(Z.element))}),GT(S,O),$},QT=8,YT=function(S,O){const $=io;let Z=null;const Ae=()=>(Z||(Z=Od(),Wr(O,Se=>{Dd(Z,Se)})),Z);for(let Se=0;;Se++){const Fe=Hf(S),Nt=[S];let Ar=!1;if(Wr(Fe,rn=>{v(rn)===It.documentFragment?ca(Nt,rn):!Ar&&!ua($,rn)&&(Ar=ua(Ae(),rn))}),!Ar)return;if(Se>=QT)throw jr("the tree kept changing during in-place sanitization; refusing to return it");Wr(Nt,(rn,wn)=>{$T(rn,wn>0,S,Ae())})}},$T=function(S,O,$,Z){const Ae=Kf(S);let Se;for(;Se=Ae.nextNode();)!ua(Z,Se)||ua(io,Se)||(O&&$n(V.uponSanitizeShadowNode,Se,null),Vf(Se,$),qf(Se,$),pi(Se.content)&&ta(Se.content))},ZT=function(S){io&&Dd(io,S)},Cy=function(S,O){return pe?S==="patchsrc"?!0:S==="for"&&O!=="label"&&O!=="output":!1},XT=function(S){pe&&jf(S,O=>{const $=v(O);if($===It.processingInstruction||$===It.comment&&Ft(rk,O.data)){try{h(O)}catch{}return!1}if($===It.element){const Z=O,Ae=kt(D(O));try{Z.hasAttribute&&Z.hasAttribute("patchsrc")&&Z.removeAttribute("patchsrc"),Z.hasAttribute&&Z.hasAttribute("for")&&Cy("for",Ae)&&Z.removeAttribute("for")}catch{}}return!0})},vy=function(S){let O=null,$=null;if(nt)S="<remove></remove>"+S;else{const Se=Gx(S,/^[\r\n\t ]+/);$=Se&&Se[0]}Xs==="application/xhtml+xml"&&es===gr&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const Z=L?re(S):S;if(es===gr)try{O=new c().parseFromString(Z,Xs)}catch{}if(!O||!O.documentElement){O=H.createDocument(es,"template",null);try{O.documentElement.innerHTML=Bf?G:Z}catch{}}const Ae=O.body||O.documentElement;return S&&$&&Ae.insertBefore(n.createTextNode($),Ae.childNodes[0]||null),es===gr?K.call(O,ge?"html":"body")[0]:ge?O.documentElement:Ae},Kf=function(S){const O=w?w(S):S.ownerDocument;return _.call(O||S,S,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},cc=function(S){return S=fa(S,me," "),S=fa(S,fe," "),S=fa(S,ae," "),S},Jf=function(S){var O;Sy(S);const $=(O=S.querySelectorAll)===null||O===void 0?void 0:O.call(S,"template");$&&Wr($,Z=>{pi(Z.content)&&Jf(Z.content)})},Sy=function(S){S.normalize();const O=w?w(S):S.ownerDocument,$=_.call(O||S,S,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Z=$.nextNode();for(;Z;)Z.data=cc(Z.data),Z=$.nextNode()},uc=function(S){const O=C?C(S):null;return typeof O!="string"||kt(O)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==b(S)||typeof S.removeAttribute!="function"||typeof S.removeAttributeNode!="function"||typeof S.getAttributeNode!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==y(S)||S.childNodes!==g(S)},pi=function(S){if(!y||typeof S!="object"||S===null)return!1;try{return y(S)===It.documentFragment}catch{return!1}},ea=function(S){if(!y||typeof S!="object"||S===null)return!1;try{return typeof y(S)=="number"}catch{return!1}};function $n(te,S,O){te.length!==0&&Wr(te,$=>{$.call(t,S,O,ts)})}const eR=function(S,O){return!!(pe&&S.hasChildNodes()&&!ea(S.firstElementChild)&&Ft(zd,S.textContent)&&Ft(zd,S.innerHTML)||pe&&O4[O]&&v(S)===It.element&&T(S)===gr&&(ea(S.firstElementChild)||typeof S.textContent=="string"&&Ft(zd,S.textContent))||S.nodeType===It.processingInstruction||pe&&S.nodeType===It.comment&&Ft(rk,S.data))},fc=function(S,O){if(S instanceof RegExp)return Ft(S,O);if(S instanceof Function){for(var $=arguments.length,Z=new Array($>2?$-2:0),Ae=2;Ae<$;Ae++)Z[Ae-2]=arguments[Ae];return!!S(O,...Z)}return!1},tR=function(S,O,$){if(!he[O]&&Ty(O)&&fc(j.tagNameCheck,O))return!1;if(mr&&!oo[O]&&!oo[po(O)]){const Z=A(S),Ae=g(S);if(Ae&&Z){const Se=Ae.length;for(let Fe=Se-1;Fe>=0;--Fe){const Nt=S===$?d(Ae[Fe],!0):Ae[Fe];Z.insertBefore(Nt,m(S))}}}return di(S),!0},Iy=function(S,O,$,Z){return S.length===0?O:O===$||O===Z?Dn(O):O},rs=function(S,O){return S===O||A(S)!==null?!1:(On&&Uf(S),!0)},Vf=function(S,O){if(ZT(S),$n(V.beforeSanitizeElements,S,null),rs(S,O))return!0;if(uc(S))return di(S),!0;const $=kt(D(S));if(F=Iy(V.uponSanitizeElement,F,ee,We),$n(V.uponSanitizeElement,S,{tagName:$,allowedTags:F}),rs(S,O))return!0;if(eR(S,$))return di(S),!0;if(he[$]||!(de.tagCheck instanceof Function&&de.tagCheck($))&&!F[$]){const Z=tR(S,$,O);return Z===!1&&($n(V.afterSanitizeElements,S,null),rs(S,O))?!0:Z}if(v(S)===It.element&&!qT(S)||($==="noscript"||$==="noembed"||$==="noframes")&&Ft(N4,S.innerHTML))return di(S),!0;if(Q&&S.nodeType===It.text){const Z=cc(S.textContent);S.textContent!==Z&&(ca(t.removed,{element:S.cloneNode()}),S.textContent=Z)}return $n(V.afterSanitizeElements,S,null),rs(S,O)},Ey=function(S,O,$){if(se[O]||Cy(O,S)||Zs&&(O==="id"||O==="name")&&($ in n||$ in HT))return!1;const Z=W[O]||de.attributeCheck instanceof Function&&de.attributeCheck(O,S);return De&&Ft(we,O)||ye&&Ft(I,O)?!0:Z?dy[O]||Ft(U,fa($,B,""))||(O==="src"||O==="xlink:href"||O==="href")&&S!=="script"&&Qx($,"data:")===0&&fy[S]||ze&&!Ft(E,fa($,B,""))?!0:!$:Ty(S)&&fc(j.tagNameCheck,S)&&fc(j.attributeNameCheck,O,S)||O==="is"&&j.allowCustomizedBuiltInElements&&fc(j.tagNameCheck,$)},nR=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ty=function(S){return!nR[po(S)]&&Ft(q,S)},rR=function(S,O,$,Z){if(L&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!$)switch(u.getAttributeType(S,O)){case"TrustedHTML":return re(Z);case"TrustedScriptURL":return le(Z)}return Z},iR=function(S,O,$,Z){try{return $?S.setAttributeNS($,O,Z):S.setAttribute(O,Z),uc(S)?(di(S),!1):!0}catch{return ns(O,S),!1}},Ry=function(S,O){return pe&&Ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,O)?!0:po(S)==="attributename"&&Gx(O,"href")!==null},qf=function(S,O){if($n(V.beforeSanitizeAttributes,S,null),rs(S,O))return;const $=S.attributes;if(!$||uc(S))return;W=Iy(V.uponSanitizeAttribute,W,ne,bt);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let Ae=$.length;const Se=kt(S.nodeName);for(;Ae--;){const Fe=$[Ae],Nt=Fe.name,Ar=Fe.namespaceURI,rn=Fe.value,wn=kt(Nt),is=rn;let xn=Nt==="value"?is:d4(is),_y=!1;if(Z.attrName=wn,Z.attrValue=xn,Z.keepAttr=!0,Z.forceKeepAttr=void 0,$n(V.uponSanitizeAttribute,S,Z),xn=Z.attrValue,Zo&&(wn==="id"||wn==="name")&&Qx(xn,Gt)!==0&&(ns(Nt,S,Fe),xn=Gt+xn,_y=!0),Ry(Nt,xn)){ns(Nt,S,Fe);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){ns(Nt,S,Fe);continue}if(!P&&Ft(ik,xn)){ns(Nt,S,Fe);continue}if(Q&&(xn=cc(xn)),!Ey(Se,wn,xn)){ns(Nt,S,Fe);continue}xn=rR(Se,wn,Ar,xn),xn!==is&&iR(S,Nt,Ar,xn)&&_y&&qx(t.removed)}}$n(V.afterSanitizeAttributes,S,null),rs(S,O)},ta=function(S){let O=null;const $=Kf(S);for($n(V.beforeSanitizeShadowDOM,S,null);O=$.nextNode();)if($n(V.uponSanitizeShadowNode,O,null),Vf(O,S),qf(O,S),pi(O.content)&&ta(O.content),v(O)===It.element){const Z=x(O);pi(Z)&&(Gf(Z),ta(Z))}Q&&Sy(S),$n(V.afterSanitizeShadowDOM,S,null)},Gf=function(S){const O=[{node:S,shadow:null}];for(;O.length>0;){const $=O.pop();if($.shadow){ta($.shadow);continue}const Z=$.node,Ae=v(Z)===It.element,Se=g(Z);if(Se)for(let Fe=Se.length-1;Fe>=0;--Fe)O.push({node:Se[Fe],shadow:null});if(Ae){const Fe=C?C(Z):null;if(typeof Fe=="string"&&kt(Fe)==="template"){const Nt=Z.content;pi(Nt)&&O.push({node:Nt,shadow:null})}}if(Ae){const Fe=x(Z);pi(Fe)&&O.push({node:null,shadow:Fe},{node:Fe,shadow:null})}}};return t.sanitize=function(te){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,$=null,Z=null,Ae=null;if(Bf=!te,Bf&&(te="<!-->"),typeof te!="string"&&!ea(te)&&(te=A4(te),typeof te!="string"))throw jr("dirty is not a string, aborting");if(!t.isSupported)return te;Ze?(F=We,W=bt):zf(S),(V.uponSanitizeElement.length>0||V.uponSanitizeAttribute.length>0)&&(F=Dn(F)),V.uponSanitizeAttribute.length>0&&(W=Dn(W)),t.removed=[];const Se=On&&typeof te!="string"&&ea(te);let Fe=[];const Nt=io;if(Se){XT(te);const wn=D(te);if(typeof wn=="string"){const is=kt(wn);if(!F[is]||he[is])throw Wf(te),jr("root node is forbidden and cannot be sanitized in-place")}if(uc(te))throw Wf(te),jr("root node is clobbered and cannot be sanitized in-place");Fe=Hf(te),io=Od()}else if(ea(te))O=vy("<!---->"),$=O.ownerDocument.importNode(te,!0),$.nodeType===It.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?O=$:O.appendChild($),Gf(O);else{if(!gt&&!Q&&!ge&&te.indexOf("<")===-1)return L&&Nn?re(te):te;if(O=vy(te),!O)return gt?null:Nn?G:""}O&&nt&&di(O.firstChild);const Ar=Se?te:O;try{Se&&Gf(te);const wn=Kf(Ar);for(;Z=wn.nextNode();)Vf(Z,Ar),qf(Z,Ar),pi(Z.content)&&ta(Z.content);Se&&YT(te,Fe)}catch(wn){throw Se&&(Wf(te),ky(te,Fe)),wn}finally{io=Nt}if(Se){if(ky(te,Fe))throw jr("a node selected for removal could not be safely returned; refusing to sanitize in place");return Q&&Jf(te),te}if(gt){if(Q&&Jf(O),_n)for(Ae=k.call(O.ownerDocument);O.firstChild;)Ae.appendChild(O.firstChild);else Ae=O;return(W.shadowroot||W.shadowrootmode)&&(Ae=M.call(r,Ae,!0)),Ae}let rn=ge?O.outerHTML:O.innerHTML;return ge&&F["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Ft(R4,O.ownerDocument.doctype.name)&&(rn="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
1265
+ `+rn),Q&&(rn=cc(rn)),L&&Nn?re(rn):rn},t.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zf(te),Ze=!0,We=F,bt=W},t.clearConfig=function(){ts=null,Ze=!1,We=null,bt=null,L=X,G=""},t.isValidAttribute=function(te,S,O){ts||zf({});const $=kt(te),Z=kt(S);return typeof O=="string"&&(Ry(S,O)||!P&&Ft(ik,O))?!1:Ey($,Z,O)},t.addHook=function(te,S){typeof S=="function"&&vn(V,te)&&ca(V[te],S)},t.removeHook=function(te,S){if(vn(V,te)){if(S!==void 0){const O=u4(V[te],S);return O===-1?void 0:h4(V[te],O,1)[0]}return qx(V[te])}},t.removeHooks=function(te){vn(V,te)&&(V[te]=[])},t.removeAllHooks=function(){V=ok()},t}var ME=DE();function zA(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ct={},bs=[],ar=()=>{},BE=()=>!1,Sf=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),If=e=>e.startsWith("onUpdate:"),qt=Object.assign,WA=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},B4=Object.prototype.hasOwnProperty,Ge=(e,t)=>B4.call(e,t),Ne=Array.isArray,_o=e=>tc(e)==="[object Map]",om=e=>tc(e)==="[object Set]",sk=e=>tc(e)==="[object Date]",Me=e=>typeof e=="function",_t=e=>typeof e=="string",Gi=e=>typeof e=="symbol",ut=e=>e!==null&&typeof e=="object",PE=e=>(ut(e)||Me(e))&&Me(e.then)&&Me(e.catch),P4=Object.prototype.toString,tc=e=>P4.call(e),F4=e=>tc(e).slice(8,-1),L4=e=>tc(e)==="[object Object]",jA=e=>_t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,La=zA(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ef=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},z4=/-\w/g,lr=Ef(e=>e.replace(z4,t=>t.slice(1).toUpperCase())),W4=/\B([A-Z])/g,$o=Ef(e=>e.replace(W4,"-$1").toLowerCase()),FE=Ef(e=>e.charAt(0).toUpperCase()+e.slice(1)),jd=Ef(e=>e?`on${FE(e)}`:""),Sr=(e,t)=>!Object.is(e,t),Ud=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},zu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},j4=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ak;const No=()=>ak||(ak=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function UA(e){if(Ne(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=_t(r)?J4(r):UA(r);if(i)for(const o in i)t[o]=i[o]}return t}else if(_t(e)||ut(e))return e}const U4=/;(?![^(]*\))/g,H4=/:([^]+)/,K4=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function J4(e){const t={};return e.replace(K4,n=>n.startsWith("/*")?"":n).split(U4).forEach(n=>{if(n){const r=n.split(H4);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function HA(e){let t="";if(_t(e))t=e;else if(Ne(e))for(let n=0;n<e.length;n++){const r=HA(e[n]);r&&(t+=r+" ")}else if(ut(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const V4="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",q4=zA(V4);function LE(e){return!!e||e===""}function G4(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Tf(e[i],t[i],n);return r}function lk(e,t,n){if(e.size!==t.size)return!1;const r=Array.from(t),i=new Uint8Array(r.length);for(const o of e){let s=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Tf(o,r[a],n)){s=a;break}if(s<0)return!1;i[s]=1}return!0}function Q4(e,t,n){let r=_o(e),i=_o(t);if(r||i||(r=om(e),i=om(t),r||i))return r&&i?lk(e,t,n):!1;const o=Object.keys(e).length,s=Object.keys(t).length;if(o!==s)return!1;for(const a in e){const l=e.hasOwnProperty(a),c=t.hasOwnProperty(a);if(l&&!c||!l&&c||!Tf(e[a],t[a],n))return!1}return String(e)===String(t)}function ck(e,t,n,r){n||(n=[new Map,new Map]);const[i,o]=n;if(i.has(e)||o.has(t))return i.get(e)===t&&o.get(t)===e;i.set(e,t),o.set(t,e);const s=r(e,t,n);return i.delete(e),o.delete(t),s}function Tf(e,t,n){if(e===t)return!0;let r=sk(e),i=sk(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=Gi(e),i=Gi(t),r||i?e===t:(r=Ne(e),i=Ne(t),r||i?r&&i?ck(e,t,n,G4):!1:(r=ut(e),i=ut(t),r||i?!r||!i?!1:ck(e,t,n,Q4):String(e)===String(t))))}let Lt;class Y4{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Lt&&(Lt.active?(this.parent=Lt,this.index=(Lt.scopes||(Lt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const i=this.scopes.slice();for(t=0,n=i.length;t<n;t++)i[t].resume()}const r=this.effects.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}}run(t){if(this._active){const n=Lt;try{return Lt=this,t()}finally{Lt=n}}}on(){++this._on===1&&(this.prevScope=Lt,Lt=this)}off(){if(this._on>0&&--this._on===0){if(Lt===this)Lt=this.prevScope;else{let t=Lt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const i=this.scopes.slice();for(n=0,r=i.length;n<r;n++)i[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function $4(){return Lt}let lt;const Hd=new WeakSet;class zE{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Lt&&(Lt.active?Lt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hd.has(this)&&(Hd.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||jE(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,uk(this),UE(this);const t=lt,n=cr;lt=this,cr=!0;try{return this.fn()}finally{HE(this),lt=t,cr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)VA(t);this.deps=this.depsTail=void 0,uk(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hd.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){sm(this)&&this.run()}get dirty(){return sm(this)}}let WE=0,za,Wa;function jE(e,t=!1){if(e.flags|=8,t){e.next=Wa,Wa=e;return}e.next=za,za=e}function KA(){WE++}function JA(){if(--WE>0)return;if(Wa){let t=Wa;for(Wa=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;za;){let t=za;for(za=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function UE(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function HE(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),VA(r),Z4(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function sm(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(KE(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function KE(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===fl)||(e.globalVersion=fl,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!sm(e))))return;e.flags|=2;const t=e.dep,n=lt,r=cr;lt=e,cr=!0;try{UE(e);const i=e.fn(e._value);(t.version===0||Sr(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{lt=n,cr=r,HE(e),e.flags&=-3}}function VA(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)VA(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Z4(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let cr=!0;const JE=[];function Nr(){JE.push(cr),cr=!1}function Or(){const e=JE.pop();cr=e===void 0?!0:e}function uk(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=lt;lt=void 0;try{t()}finally{lt=n}}}let fl=0;class X4{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class qA{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!lt||!cr||lt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==lt)n=this.activeLink=new X4(lt,this),lt.deps?(n.prevDep=lt.depsTail,lt.depsTail.nextDep=n,lt.depsTail=n):lt.deps=lt.depsTail=n,VE(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=lt.depsTail,n.nextDep=void 0,lt.depsTail.nextDep=n,lt.depsTail=n,lt.deps===n&&(lt.deps=r)}return n}trigger(t){this.version++,fl++,this.notify(t)}notify(t){KA();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{JA()}}}function VE(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)VE(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const am=new WeakMap,Oo=Symbol(""),lm=Symbol(""),hl=Symbol("");function Yt(e,t,n){if(cr&&lt){let r=am.get(e);r||am.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new qA),i.map=r,i.key=n),i.track()}}function Qr(e,t,n,r,i,o){const s=am.get(e);if(!s){fl++;return}const a=l=>{l&&l.trigger()};if(KA(),t==="clear")s.forEach(a);else{const l=Ne(e),c=l&&jA(n);if(l&&n==="length"){const u=Number(r);s.forEach((f,d)=>{(d==="length"||d===hl||!Gi(d)&&d>=u)&&a(f)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(hl)),t){case"add":l?c&&a(s.get("length")):(a(s.get(Oo)),_o(e)&&a(s.get(lm)));break;case"delete":l||(a(s.get(Oo)),_o(e)&&a(s.get(lm)));break;case"set":_o(e)&&a(s.get(Oo));break}}JA()}function us(e){const t=Ye(e);return t===e||(Yt(t,"iterate",hl),ur(e))?t:ai(e)?Do(e)?t.map(n=>Vo(Dr(n))):t.map(Vo):t.map(Dr)}function GA(e){return Yt(e=Ye(e),"iterate",hl),e}function wr(e,t){return ai(e)?Vo(Do(e)?Dr(t):t):Dr(t)}const eJ={__proto__:null,[Symbol.iterator](){return Kd(this,Symbol.iterator,e=>wr(this,e))},concat(...e){return us(this).concat(...e.map(t=>Ne(t)?us(t):t))},entries(){return Kd(this,"entries",e=>(e[1]=wr(this,e[1]),e))},every(e,t){return Ur(this,"every",e,t,void 0,arguments)},filter(e,t){return Ur(this,"filter",e,t,n=>n.map(r=>wr(this,r)),arguments)},find(e,t){return Ur(this,"find",e,t,n=>wr(this,n),arguments)},findIndex(e,t){return Ur(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ur(this,"findLast",e,t,n=>wr(this,n),arguments)},findLastIndex(e,t){return Ur(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ur(this,"forEach",e,t,void 0,arguments)},includes(...e){return Jd(this,"includes",e)},indexOf(...e){return Jd(this,"indexOf",e)},join(e){return us(this).join(e)},lastIndexOf(...e){return Jd(this,"lastIndexOf",e)},map(e,t){return Ur(this,"map",e,t,void 0,arguments)},pop(){return da(this,"pop")},push(...e){return da(this,"push",e)},reduce(e,...t){return hk(this,"reduce",e,t)},reduceRight(e,...t){return hk(this,"reduceRight",e,t)},shift(){return da(this,"shift")},some(e,t){return Ur(this,"some",e,t,void 0,arguments)},splice(...e){return da(this,"splice",e)},toReversed(){return us(this).toReversed()},toSorted(e){return us(this).toSorted(e)},toSpliced(...e){return us(this).toSpliced(...e)},unshift(...e){return da(this,"unshift",e)},values(){return Kd(this,"values",e=>wr(this,e))}};function Kd(e,t,n){const r=GA(e),i=r[t],o=i.call(r);if(r!==e&&!ur(e)){if(o[Symbol.toStringTag]==="Array Iterator"){const s=Object.create(Object.getPrototypeOf(o));return s.next=()=>fk(o.next(),n),i!==qE[t]&&Object.defineProperties(s,{return:{get(){const a=o.return;return typeof a=="function"?a.bind(o):a}},throw:{get(){const a=o.throw;return typeof a=="function"?a.bind(o):a}}}),s}o._next=o.next,o.next=()=>fk(o._next(),n)}return o}function fk(e,t){return e.done||(e.value=t(e.value)),e}const qE=Array.prototype;function Ur(e,t,n,r,i,o){const s=GA(e),a=s!==e&&!ur(e),l=s[t];if(l!==qE[t]){const f=l.apply(e,o);return a?Dr(f):f}let c=n;s!==e&&(a?c=function(f,d){return n.call(this,wr(e,f),d,e)}:n.length>2&&(c=function(f,d){return n.call(this,f,d,e)}));const u=l.call(s,c,r);return a&&i?i(u):u}function hk(e,t,n,r){const i=GA(e),o=i!==e&&!ur(e);let s=n,a=!1;i!==e&&(o?(a=r.length===0,s=function(c,u,f){return a&&(a=!1,c=wr(e,c)),n.call(this,c,wr(e,u),f,e)}):n.length>3&&(s=function(c,u,f){return n.call(this,c,u,f,e)}));const l=i[t](s,...r);return a?wr(e,l):l}function Jd(e,t,n){const r=Ye(e);Yt(r,"iterate",hl);const i=r[t](...n);return(i===-1||i===!1)&&ZA(n[0])?(n[0]=Ye(n[0]),r[t](...n)):i}function da(e,t,n=[]){Nr(),KA();const r=Ye(e)[t].apply(e,n);return JA(),Or(),r}const tJ=zA("__proto__,__v_isRef,__isVue"),GE=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Gi));function nJ(e){Gi(e)||(e=String(e));const t=Ye(this);return Yt(t,"has",e),t.hasOwnProperty(e)}class QE{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?hJ:XE:o?ZE:$E).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=Ne(t);if(!i){let l;if(s&&(l=eJ[n]))return l;if(n==="hasOwnProperty")return nJ}const a=Reflect.get(t,n,Xt(t)?t:r);if((Gi(n)?GE.has(n):tJ(n))||(i||Yt(t,"get",n),o))return a;if(Xt(a)){const l=s&&jA(n)?a:a.value;return i&&ut(l)?um(l):l}return ut(a)?i?um(a):YA(a):a}}class YE extends QE{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const s=Ne(t)&&jA(n);if(!this._isShallow){const c=ai(o);if(!ur(r)&&!ai(r)&&(o=Ye(o),r=Ye(r)),!s&&Xt(o)&&!Xt(r))return c||(o.value=r),!0}const a=s?Number(n)<t.length:Ge(t,n),l=Reflect.set(t,n,r,Xt(t)?t:i);return t===Ye(i)&&l&&(a?Sr(r,o)&&Qr(t,"set",n,r):Qr(t,"add",n,r)),l}deleteProperty(t,n){const r=Ge(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&Qr(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!Gi(n)||!GE.has(n))&&Yt(t,"has",n),r}ownKeys(t){return Yt(t,"iterate",Ne(t)?"length":Oo),Reflect.ownKeys(t)}}class rJ extends QE{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const iJ=new YE,oJ=new rJ,sJ=new YE(!0);const cm=e=>e,Pc=e=>Reflect.getPrototypeOf(e);function aJ(e,t,n){return function(...r){const i=this.__v_raw,o=Ye(i),s=_o(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...r),u=n?cm:t?Vo:Dr;return!t&&Yt(o,"iterate",l?lm:Oo),qt(Object.create(c),{next(){const{value:f,done:d}=c.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}}})}}function Fc(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function lJ(e,t){const n={get(i){const o=this.__v_raw,s=Ye(o),a=Ye(i);e||(Sr(i,a)&&Yt(s,"get",i),Yt(s,"get",a));const{has:l}=Pc(s),c=t?cm:e?Vo:Dr;if(l.call(s,i))return c(o.get(i));if(l.call(s,a))return c(o.get(a));o!==s&&o.get(i)},get size(){const i=this.__v_raw;return!e&&Yt(Ye(i),"iterate",Oo),i.size},has(i){const o=this.__v_raw,s=Ye(o),a=Ye(i);return e||(Sr(i,a)&&Yt(s,"has",i),Yt(s,"has",a)),i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){const s=this,a=s.__v_raw,l=Ye(a),c=t?cm:e?Vo:Dr;return!e&&Yt(l,"iterate",Oo),a.forEach((u,f)=>i.call(o,c(u),c(f),s))}};return qt(n,e?{add:Fc("add"),set:Fc("set"),delete:Fc("delete"),clear:Fc("clear")}:{add(i){const o=Ye(this),s=Pc(o),a=Ye(i),l=!t&&!ur(i)&&!ai(i)?a:i;return s.has.call(o,l)||Sr(i,l)&&s.has.call(o,i)||Sr(a,l)&&s.has.call(o,a)||(o.add(l),Qr(o,"add",l,l)),this},set(i,o){!t&&!ur(o)&&!ai(o)&&(o=Ye(o));const s=Ye(this),{has:a,get:l}=Pc(s);let c=a.call(s,i);c||(i=Ye(i),c=a.call(s,i));const u=l.call(s,i);return s.set(i,o),c?Sr(o,u)&&Qr(s,"set",i,o):Qr(s,"add",i,o),this},delete(i){const o=Ye(this),{has:s,get:a}=Pc(o);let l=s.call(o,i);l||(i=Ye(i),l=s.call(o,i)),a&&a.call(o,i);const c=o.delete(i);return l&&Qr(o,"delete",i,void 0),c},clear(){const i=Ye(this),o=i.size!==0,s=i.clear();return o&&Qr(i,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=aJ(i,e,t)}),n}function QA(e,t){const n=lJ(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_isShallow"?t:i==="__v_raw"?r:Reflect.get(Ge(n,i)&&i in r?n:r,i,o)}const cJ={get:QA(!1,!1)},uJ={get:QA(!1,!0)},fJ={get:QA(!0,!1)};const $E=new WeakMap,ZE=new WeakMap,XE=new WeakMap,hJ=new WeakMap;function dJ(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function YA(e){return ai(e)?e:$A(e,!1,iJ,cJ,$E)}function pJ(e){return $A(e,!1,sJ,uJ,ZE)}function um(e){return $A(e,!0,oJ,fJ,XE)}function $A(e,t,n,r,i){if(!ut(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=i.get(e);if(o)return o;const s=dJ(F4(e));if(s===0)return e;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Do(e){return ai(e)?Do(e.__v_raw):!!(e&&e.__v_isReactive)}function ai(e){return!!(e&&e.__v_isReadonly)}function ur(e){return!!(e&&e.__v_isShallow)}function ZA(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function mJ(e){return!Ge(e,"__v_skip")&&Object.isExtensible(e)&&zu(e,"__v_skip",!0),e}const Dr=e=>ut(e)?YA(e):e,Vo=e=>ut(e)?um(e):e;function Xt(e){return e?e.__v_isRef===!0:!1}function Pn(e){return eT(e,!1)}function mG(e){return eT(e,!0)}function eT(e,t){return Xt(e)?e:new gJ(e,t)}class gJ{constructor(t,n){this.dep=new qA,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ye(t),this._value=n?t:Dr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||ur(t)||ai(t);t=r?t:Ye(t),Sr(t,n)&&(this._rawValue=t,this._value=r?t:Dr(t),this.dep.trigger())}}function AJ(e){return Xt(e)?e.value:e}const yJ={get:(e,t,n)=>t==="__v_raw"?e:AJ(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Xt(i)&&!Xt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tT(e){return Do(e)?e:new Proxy(e,yJ)}class bJ{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new qA(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=fl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&lt!==this)return jE(this,!0),!0}get value(){const t=this.dep.track();return KE(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function wJ(e,t,n=!1){let r,i;return Me(e)?r=e:(r=e.get,i=e.set),new bJ(r,i,n)}const Lc={},Wu=new WeakMap;let mo;function xJ(e,t=!1,n=mo){if(n){let r=Wu.get(n);r||Wu.set(n,r=[]),r.push(e)}}function kJ(e,t,n=ct){const{immediate:r,deep:i,once:o,scheduler:s,augmentJob:a,call:l}=n,c=y=>i?y:ur(y)||i===!1||i===0?Pi(y,1):Pi(y);let u,f,d,h,p=!1,m=!1;if(Xt(e)?(f=()=>e.value,p=ur(e)):Do(e)?(f=()=>c(e),p=!0):Ne(e)?(m=!0,p=e.some(y=>Do(y)||ur(y)),f=()=>e.map(y=>{if(Xt(y))return y.value;if(Do(y))return c(y);if(Me(y))return l?l(y,2):y()})):Me(e)?t?f=l?()=>l(e,2):e:f=()=>{if(d){Nr();try{d()}finally{Or()}}const y=mo;mo=u;try{return l?l(e,3,[h]):e(h)}finally{mo=y}}:f=ar,t&&i){const y=f,C=i===!0?1/0:i;f=()=>Pi(y(),C)}const g=$4(),A=()=>{u.stop(),g&&g.active&&WA(g.effects,u)};if(o&&t){const y=t;t=(...C)=>{try{return y(...C)}finally{A()}}}let x=m?new Array(e.length).fill(Lc):Lc;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const C=u.run();if(y||i||p||(m?C.some((w,v)=>Sr(w,x[v])):Sr(C,x))){const w=mo;Nr();try{d&&d(),mo=u;const v=[C,x===Lc?void 0:m&&x[0]===Lc?[]:x,h];x=C,l?l(t,3,v):t(...v)}finally{mo=w,Or()}}}else u.run()};return a&&a(b),u=new zE(f),u.scheduler=s?()=>s(b,!1):b,h=y=>xJ(y,!1,u),d=u.onStop=()=>{const y=Wu.get(u);if(y){if(l)l(y,4);else for(const C of y)C();Wu.delete(u)}},t?r?b(!0):x=u.run():s?s(b.bind(null,!0),!0):u.run(),A.pause=u.pause.bind(u),A.resume=u.resume.bind(u),A.stop=A,A}function Pi(e,t=1/0,n){if(t<=0||!ut(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Xt(e))Pi(e.value,t,n);else if(Ne(e))for(let r=0;r<e.length;r++)Pi(e[r],t,n);else if(om(e)||_o(e))e.forEach(r=>{Pi(r,t,n)});else if(L4(e)){for(const r in e)Pi(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Pi(e[r],t,n)}return e}function nc(e,t,n,r){try{return r?e(...r):e()}catch(i){Rf(i,t,n)}}function hr(e,t,n,r){if(Me(e)){const i=nc(e,t,n,r);return i&&PE(i)&&i.catch(o=>{Rf(o,t,n)}),i}if(Ne(e)){const i=[];for(let o=0;o<e.length;o++)i.push(hr(e[o],t,n,r));return i}}function Rf(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||ct;if(t){let a=t.parent;const l=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,l,c)===!1)return}a=a.parent}if(o){Nr(),nc(o,null,10,[e,l,c]),Or();return}}CJ(e,n,i,r,s)}function CJ(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const cn=[];let er=-1;const xr=[];let Di=null,As=0;const nT=Promise.resolve();let ju=null;function vJ(e){const t=ju||nT;return e?t.then(this?e.bind(this):e):t}function SJ(e){let t=er+1,n=cn.length;for(;t<n;){const r=t+n>>>1,i=cn[r],o=dl(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function XA(e){if(!(e.flags&1)){const t=dl(e),n=cn[cn.length-1];!n||!(e.flags&2)&&t>=dl(n)?cn.push(e):cn.splice(SJ(t),0,e),e.flags|=1,rT()}}function rT(){ju||(ju=nT.then(sT))}function IJ(e){if(!Ne(e))Di&&e.id===-1?Di.splice(As+1,0,e):e.flags&1||(xr.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)xr.push(e[t]);rT()}function iT(e,t,n,r=er+1){for(;r<cn.length;r++){const i=cn[r];if(i&&i.flags&2){if(e&&i.id!==e.uid||t!==void 0&&!(i.id>=t))continue;cn.splice(r,1),r=e?r-1:er,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function oT(e,t,n=0){if(xr.length){let r=xr,i=0;if(t){r=[];for(let s=0;s<xr.length;s++){const a=xr[s];(a.i!==void 0?!a.i||a.i.uid<n:t.has(a))?xr[i++]=a:r.push(a)}}const o=[...new Set(r)].sort((s,a)=>dl(s)-dl(a));if(xr.length=i,Di){for(let s=0;s<o.length;s++)Di.push(o[s]);return}for(Di=o,As=0;As<Di.length;As++){const s=Di[As];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}Di=null,As=0}}let Vd=!1;function EJ(e,t){if(Vd){e();return}const n=t===void 0?void 0:new Set(xr);e(),Vd=!0;try{iT(void 0,t),oT(void 0,n,t)}finally{Vd=!1}}const dl=e=>e.id==null?e.flags&2?-1:1/0:e.id;function sT(e){try{for(er=0;er<cn.length;er++){const t=cn[er];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),nc(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;er<cn.length;er++){const t=cn[er];t&&(t.flags&=-2)}er=-1,cn.length=0,oT(),ju=null,(cn.length||xr.length)&&sT()}}let Ir,ba=[],fm=!1;function _f(e,...t){Ir?Ir.emit(e,...t):fm||ba.push({event:e,args:t})}function aT(e,t){var n,r;Ir=e,Ir?(Ir.enabled=!0,ba.forEach(({event:i,args:o})=>Ir.emit(i,...o)),ba=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{aT(o,t)}),setTimeout(()=>{Ir||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,fm=!0,ba=[])},3e3)):(fm=!0,ba=[])}function TJ(e,t){_f("app:init",e,t,{Fragment:Ut,Text:rc,Comment:Mr,Static:ru})}function RJ(e){_f("app:unmount",e)}const _J=ey("component:added"),lT=ey("component:updated"),NJ=ey("component:removed"),OJ=e=>{Ir&&typeof Ir.cleanupBuffer=="function"&&!Ir.cleanupBuffer(e)&&NJ(e)};function ey(e){return t=>{_f(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}function DJ(e,t,n){_f("component:emit",e.appContext.app,e,t,n)}let Tr=null,cT=null;function Uu(e){const t=Tr;return Tr=e,cT=e&&e.type.__scopeId||null,t}function MJ(e,t=Tr,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Vu(-1);const o=Uu(t),s=Is.length;let a;try{a=e(...i)}finally{for(let l=Is.length;l>s;l--)TV();Uu(o),r._d&&Vu(1)}return __VUE_PROD_DEVTOOLS__&&lT(t),a};return r._n=!0,r._c=!0,r._d=!0,r}function uo(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let s=0;s<i.length;s++){const a=i[s];o&&(a.oldValue=o[s].value);let l=a.dir[r];l&&(Nr(),hr(l,n,8,[e.el,a,e,t]),Or())}}function BJ(e,t){if(un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function nu(e,t,n=!1){const r=FV();if(r||Ss){let i=Ss?Ss._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&Me(t)?t.call(r&&r.proxy):t}}const PJ=Symbol.for("v-scx"),FJ=()=>nu(PJ);function LJ(e,t){return ty(e,null,t)}function qd(e,t,n){return ty(e,t,n)}function ty(e,t,n=ct){const{immediate:r,deep:i,flush:o,once:s}=n,a=qt({},n),l=t&&r||!t&&o!=="post";let c;if(gl){if(o==="sync"){const h=FJ();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ar,h.resume=ar,h.pause=ar,h}}const u=un;a.call=(h,p,m)=>hr(h,u,p,m);let f=!1;o==="post"?a.scheduler=h=>{h.i=u,Cn(h,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(h,p)=>{p?h():XA(h)}),a.augmentJob=h=>{t&&(h.flags|=4),f&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const d=kJ(e,t,a);return gl&&(c?c.push(d):l&&d()),d}function zJ(e,t,n){const r=this.proxy,i=_t(e)?e.includes(".")?uT(r,e):()=>r[e]:e.bind(r,r);let o;Me(t)?o=t:(o=t.handler,n=t);const s=ic(this),a=ty(i,o.bind(r),n);return s(),a}function uT(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const WJ=Symbol("_vte"),Nf=e=>e.__isTeleport,Gd=Symbol("_leaveCb");function jJ(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Mr){t=n;break}}return t}function fT(e){if(!ry(e))return Nf(e.type)&&e.children?jJ(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Me(n.default))return n.default()}}function Hu(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;Hu(Nf(n.type)&&fT(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===Ut&&Ne(e.children)){const n=bT(e.children,!1);n&&Hu(n,t)}}function hm(e){if(e.component)return hm(e.component.subTree);if(e.type===Ut){const t=Ne(e.children)&&bT(e.children,!1);return t?hm(t):void 0}if(e.type!==Mr)return e}function ny(e,t){return Me(e)?qt({name:e.name},t,{setup:e}):e}function hT(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function dk(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ku=new WeakMap;function ja(e,t,n,r,i=!1){if(Ne(e)){e.forEach((m,g)=>ja(m,t&&(Ne(t)?t[g]:t),n,r,i));return}if(Ua(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ja(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ay(r.component):r.el,s=i?null:o,{i:a,r:l}=e,c=t&&t.r,u=a.refs===ct?a.refs={}:a.refs,f=a.setupState,d=Ye(f),h=f===ct?BE:m=>dk(u,m)?!1:Ge(d,m),p=(m,g)=>!(g&&dk(u,g));if(c!=null&&c!==l){if(pk(t),_t(c))u[c]=null,h(c)&&(f[c]=null);else if(Xt(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Me(l))nc(l,a,12,[s,u]);else{const m=_t(l),g=Xt(l);if(m||g){const A=()=>{if(e.f){const x=m?h(l)?f[l]:u[l]:p()||!e.k?l.value:u[e.k];if(i)Ne(x)&&WA(x,o);else if(Ne(x))x.includes(o)||x.push(o);else if(m)u[l]=[o],h(l)&&(f[l]=u[l]);else{const b=[o];p(l,e.k)&&(l.value=b),e.k&&(u[e.k]=b)}}else m?(u[l]=s,h(l)&&(f[l]=s)):g&&(p(l,e.k)&&(l.value=s),e.k&&(u[e.k]=s))};if(s){const x=()=>{A(),Ku.delete(e)};x.id=-1,Ku.set(e,x),Cn(x,n)}else pk(e),A()}}}function pk(e){const t=Ku.get(e);t&&(t.flags|=8,Ku.delete(e))}No().requestIdleCallback;No().cancelIdleCallback;const Ua=e=>!!e.type.__asyncLoader,ry=e=>e.type.__isKeepAlive;function UJ(e,t){dT(e,"a",t)}function HJ(e,t){dT(e,"da",t)}function dT(e,t,n=un){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Of(t,r,n),n){let i=n.parent;for(;i&&i.parent;)ry(i.parent.vnode)&&KJ(r,t,n,i),i=i.parent}}function KJ(e,t,n,r){const i=Of(t,e,r,!0);pT(()=>{WA(r[t],i)},n)}function Of(e,t,n=un,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Nr();const a=ic(n),l=hr(t,n,e,s);return a(),Or(),l});return r?i.unshift(o):i.push(o),o}}const hi=e=>(t,n=un)=>{(!gl||e==="sp")&&Of(e,(...r)=>t(...r),n)},JJ=hi("bm"),VJ=hi("m"),qJ=hi("bu"),GJ=hi("u"),QJ=hi("bum"),pT=hi("um"),YJ=hi("sp"),$J=hi("rtg"),ZJ=hi("rtc");function XJ(e,t=un){Of("ec",e,t)}const eV=Symbol.for("v-ndc"),dm=e=>e?MT(e)?ay(e):dm(e.parent):null,Ha=qt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>dm(e.parent),$root:e=>dm(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?gT(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{XA(e.update)}),$nextTick:e=>e.n||(e.n=vJ.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?zJ.bind(e):ar}),Qd=(e,t)=>e!==ct&&!e.__isScriptSetup&&Ge(e,t),tV={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:o,accessCache:s,type:a,appContext:l}=e;if(t[0]!=="$"){const d=s[t];if(d!==void 0)switch(d){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(Qd(r,t))return s[t]=1,r[t];if(__VUE_OPTIONS_API__&&i!==ct&&Ge(i,t))return s[t]=2,i[t];if(Ge(o,t))return s[t]=3,o[t];if(n!==ct&&Ge(n,t))return s[t]=4,n[t];(!__VUE_OPTIONS_API__||pm)&&(s[t]=0)}}const c=Ha[t];let u,f;if(c)return t==="$attrs"&&Yt(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==ct&&Ge(n,t))return s[t]=4,n[t];if(f=l.config.globalProperties,Ge(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return Qd(i,t)?(i[t]=n,!0):__VUE_OPTIONS_API__&&r!==ct&&Ge(r,t)?(r[t]=n,!0):Ge(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:o,type:s}},a){let l;return!!(n[a]||__VUE_OPTIONS_API__&&e!==ct&&a[0]!=="$"&&Ge(e,a)||Qd(t,a)||Ge(o,a)||Ge(r,a)||Ge(Ha,a)||Ge(i.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ge(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function mk(e){return Ne(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let pm=!0;function nV(e){const t=gT(e),n=e.proxy,r=e.ctx;pm=!1,t.beforeCreate&&gk(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:d,beforeUpdate:h,updated:p,activated:m,deactivated:g,beforeDestroy:A,beforeUnmount:x,destroyed:b,unmounted:y,render:C,renderTracked:w,renderTriggered:v,errorCaptured:D,serverPrefetch:N,expose:T,inheritAttrs:L,components:G,directives:X,filters:Y}=t;if(c&&rV(c,r,null),s)for(const re in s){const le=s[re];Me(le)&&(r[re]=le.bind(n))}if(i){const re=i.call(n,n);ut(re)&&(e.data=YA(re))}if(pm=!0,o)for(const re in o){const le=o[re],Be=Me(le)?le.bind(n,n):Me(le.get)?le.get.bind(n,n):ar,R=!Me(le)&&Me(le.set)?le.set.bind(n):ar,H=HV({get:Be,set:R});Object.defineProperty(r,re,{enumerable:!0,configurable:!0,get:()=>H.value,set:_=>H.value=_})}if(a)for(const re in a)mT(a[re],r,n,re);if(l){const re=Me(l)?l.call(n):l;Reflect.ownKeys(re).forEach(le=>{BJ(le,re[le])})}u&&gk(u,e,"c");function ue(re,le){Ne(le)?le.forEach(Be=>re(Be.bind(n))):le&&re(le.bind(n))}if(ue(JJ,f),ue(VJ,d),ue(qJ,h),ue(GJ,p),ue(UJ,m),ue(HJ,g),ue(XJ,D),ue(ZJ,w),ue($J,v),ue(QJ,x),ue(pT,y),ue(YJ,N),Ne(T))if(T.length){const re=e.exposed||(e.exposed={});T.forEach(le=>{Object.defineProperty(re,le,{get:()=>n[le],set:Be=>n[le]=Be,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===ar&&(e.render=C),L!=null&&(e.inheritAttrs=L),G&&(e.components=G),X&&(e.directives=X),N&&hT(e)}function rV(e,t,n=ar){Ne(e)&&(e=mm(e));for(const r in e){const i=e[r];let o;ut(i)?"default"in i?o=nu(i.from||r,i.default,!0):o=nu(i.from||r):o=nu(i),Xt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):t[r]=o}}function gk(e,t,n){hr(Ne(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function mT(e,t,n,r){let i=r.includes(".")?uT(n,r):()=>n[r];if(_t(e)){const o=t[e];Me(o)&&qd(i,o)}else if(Me(e))qd(i,e.bind(n));else if(ut(e))if(Ne(e))e.forEach(o=>mT(o,t,n,r));else{const o=Me(e.handler)?e.handler.bind(n):t[e.handler];Me(o)&&qd(i,o,e)}}function gT(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(c=>Ju(l,c,s,!0)),Ju(l,t,s)),ut(t)&&o.set(t,l),l}function Ju(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Ju(e,o,n,!0),i&&i.forEach(s=>Ju(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const a=iV[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const iV={data:Ak,props:yk,emits:yk,methods:wa,computed:wa,beforeCreate:sn,created:sn,beforeMount:sn,mounted:sn,beforeUpdate:sn,updated:sn,beforeDestroy:sn,beforeUnmount:sn,destroyed:sn,unmounted:sn,activated:sn,deactivated:sn,errorCaptured:sn,serverPrefetch:sn,components:wa,directives:wa,watch:sV,provide:Ak,inject:oV};function Ak(e,t){return t?e?function(){return qt(Me(e)?e.call(this,this):e,Me(t)?t.call(this,this):t)}:t:e}function oV(e,t){return wa(mm(e),mm(t))}function mm(e){if(Ne(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function sn(e,t){return e?[...new Set([].concat(e,t))]:t}function wa(e,t){return e?qt(Object.create(null),e,t):t}function yk(e,t){return e?Ne(e)&&Ne(t)?[...new Set([...e,...t])]:qt(Object.create(null),mk(e),mk(t??{})):t}function sV(e,t){if(!e)return t;if(!t)return e;const n=qt(Object.create(null),e);for(const r in t)n[r]=sn(e[r],t[r]);return n}function AT(){return{app:null,config:{isNativeTag:BE,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let aV=0;function lV(e,t){return function(r,i=null){Me(r)||(r=qt({},r)),i!=null&&!ut(i)&&(i=null);const o=AT(),s=new WeakSet,a=[];let l=!1;const c=o.app={_uid:aV++,_component:r,_props:i,_container:null,_context:o,_instance:null,version:Sk,get config(){return o.config},set config(u){},use(u,...f){return s.has(u)||(u&&Me(u.install)?(s.add(u),u.install(c,...f)):Me(u)&&(s.add(u),u(c,...f))),c},mixin(u){return __VUE_OPTIONS_API__&&(o.mixins.includes(u)||o.mixins.push(u)),c},component(u,f){return f?(o.components[u]=f,c):o.components[u]},directive(u,f){return f?(o.directives[u]=f,c):o.directives[u]},mount(u,f,d){if(!l){const h=c._ceVNode||rr(r,i);return h.appContext=o,d===!0?d="svg":d===!1&&(d=void 0),e(h,u,d),l=!0,c._container=u,u.__vue_app__=c,__VUE_PROD_DEVTOOLS__&&(c._instance=h.component,TJ(c,Sk)),ay(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&(hr(a,c._instance,16),e(null,c._container),__VUE_PROD_DEVTOOLS__&&(c._instance=null,RJ(c)),delete c._container.__vue_app__)},provide(u,f){return o.provides[u]=f,c},runWithContext(u){const f=Ss;Ss=c;try{return u()}finally{Ss=f}}};return c}}let Ss=null;const cV=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${lr(t)}Modifiers`]||e[`${$o(t)}Modifiers`];function uV(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ct;let i=n;const o=t.startsWith("update:"),s=o&&cV(r,t.slice(7));s&&(s.trim&&(i=n.map(u=>_t(u)?u.trim():u)),s.number&&(i=i.map(j4))),__VUE_PROD_DEVTOOLS__&&DJ(e,t,i);let a,l=r[a=jd(t)]||r[a=jd(lr(t))];!l&&o&&(l=r[a=jd($o(t))]),l&&hr(l,e,6,i);const c=r[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,hr(c,e,6,i)}}const fV=new WeakMap;function yT(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?fV:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let s={},a=!1;if(__VUE_OPTIONS_API__&&!Me(e)){const l=c=>{const u=yT(c,t,!0);u&&(a=!0,qt(s,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ut(e)&&r.set(e,null),null):(Ne(o)?o.forEach(l=>s[l]=null):qt(s,o),ut(e)&&r.set(e,s),s)}function Df(e,t){return!e||!Sf(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ge(e,t[0].toLowerCase()+t.slice(1))||Ge(e,$o(t))||Ge(e,t))}function bk(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[o],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:f,data:d,setupState:h,ctx:p,inheritAttrs:m}=e,g=Uu(e);let A,x;try{if(n.shapeFlag&4){const y=i||r,C=y;A=kr(c.call(C,y,u,f,h,d,p)),x=a}else{const y=t;A=kr(y.length>1?y(f,{attrs:a,slots:s,emit:l}):y(f,null)),x=t.props?a:hV(a)}}catch(y){Is.length=0,Rf(y,e,1),A=rr(Mr)}let b=A;if(x&&m!==!1){const y=Object.keys(x),{shapeFlag:C}=b;y.length&&C&7&&(o&&y.some(If)&&(x=dV(x,o)),b=js(b,x,!1,!0))}if(n.dirs&&(b=js(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition){const y=Nf(b.type)&&fT(b)||b;Hu(y,n.transition)}return A=b,Uu(g),A}function bT(e,t=!0){let n;for(let r=0;r<e.length;r++){const i=e[r];if(pl(i)){if(i.type!==Mr||i.children==="v-if"){if(n)return;n=i}}else return}return n}const hV=e=>{let t;for(const n in e)(n==="class"||n==="style"||Sf(n))&&((t||(t={}))[n]=e[n]);return t},dV=(e,t)=>{const n={};for(const r in e)(!If(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function pV(e,t,n){const{props:r,children:i,component:o}=e,{props:s,children:a,patchFlag:l}=t,c=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?wk(r,s,c):!!s;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const d=u[f];if(wT(s,r,d)&&!Df(c,d))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===s?!1:r?s?wk(r,s,c):!0:!!s;return!1}function wk(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(!Ge(e,o)||wT(t,e,o)&&!Df(n,o))return!0}return!1}function wT(e,t,n){const r=e[n],i=t[n];return n==="style"&&ut(r)&&ut(i)?!Tf(r,i):r!==i}function mV({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const xT={},kT=()=>Object.create(xT),CT=e=>Object.getPrototypeOf(e)===xT;function gV(e,t,n,r=!1){const i={},o=kT();e.propsDefaults=Object.create(null),vT(e,t,i,o);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=r?i:pJ(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function AV(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:s}}=e,a=Ye(i),[l]=e.propsOptions;let c=!1;if((r||s>0)&&!(s&16)){if(s&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let d=u[f];if(Df(e.emitsOptions,d))continue;const h=t[d];if(l)if(Ge(o,d))h!==o[d]&&(o[d]=h,c=!0);else{const p=lr(d);i[p]=gm(l,a,p,h,e,!1)}else h!==o[d]&&(o[d]=h,c=!0)}}}else{vT(e,t,i,o)&&(c=!0);let u;for(const f in a)(!t||!Ge(t,f)&&((u=$o(f))===f||!Ge(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(i[f]=gm(l,a,f,void 0,e,!0)):delete i[f]);if(o!==a)for(const f in o)(!t||!Ge(t,f))&&(delete o[f],c=!0)}c&&Qr(e.attrs,"set","")}function vT(e,t,n,r){const[i,o]=e.propsOptions;let s=!1,a;if(t)for(let l in t){if(La(l))continue;const c=t[l];let u;i&&Ge(i,u=lr(l))?!o||!o.includes(u)?n[u]=c:(a||(a={}))[u]=c:Df(e.emitsOptions,l)||(!(l in r)||c!==r[l])&&(r[l]=c,s=!0)}if(o){const l=Ye(n),c=a||ct;for(let u=0;u<o.length;u++){const f=o[u];n[f]=gm(i,l,f,c[f],e,!Ge(c,f))}}return s}function gm(e,t,n,r,i,o){const s=e[n];if(s!=null){const a=Ge(s,"default");if(a&&r===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&Me(l)){const{propsDefaults:c}=i;if(n in c)r=c[n];else{const u=ic(i);r=c[n]=l.call(null,t),u()}}else r=l;i.ce&&i.ce._setProp(n,r)}s[0]&&(o&&!a?r=!1:s[1]&&(r===""||r===$o(n))&&(r=!0))}return r}const yV=new WeakMap;function ST(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?yV:t.propsCache,i=r.get(e);if(i)return i;const o=e.props,s={},a=[];let l=!1;if(__VUE_OPTIONS_API__&&!Me(e)){const u=f=>{l=!0;const[d,h]=ST(f,t,!0);qt(s,d),h&&a.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return ut(e)&&r.set(e,bs),bs;if(Ne(o))for(let u=0;u<o.length;u++){const f=lr(o[u]);xk(f)&&(s[f]=ct)}else if(o)for(const u in o){const f=lr(u);if(xk(f)){const d=o[u],h=s[f]=Ne(d)||Me(d)?{type:d}:qt({},d),p=h.type;let m=!1,g=!0;if(Ne(p))for(let A=0;A<p.length;++A){const x=p[A],b=Me(x)&&x.name;if(b==="Boolean"){m=!0;break}else b==="String"&&(g=!1)}else m=Me(p)&&p.name==="Boolean";h[0]=m,h[1]=g,(m||Ge(h,"default"))&&a.push(f)}}const c=[s,a];return ut(e)&&r.set(e,c),c}function xk(e){return e[0]!=="$"&&!La(e)}const iy=e=>e==="_"||e==="_ctx"||e==="$stable",oy=e=>Ne(e)?e.map(kr):[kr(e)],bV=(e,t,n)=>{if(t._n)return t;const r=MJ((...i)=>oy(t(...i)),n);return r._c=!1,r},IT=(e,t,n)=>{const r=e._ctx;for(const i in e){if(iy(i))continue;const o=e[i];if(Me(o))t[i]=bV(i,o,r);else if(o!=null){const s=oy(o);t[i]=()=>s}}},ET=(e,t)=>{const n=oy(t);e.slots.default=()=>n},TT=(e,t,n)=>{for(const r in t)(n||!iy(r))&&(e[r]=t[r])},wV=(e,t,n)=>{const r=e.slots=kT();if(e.vnode.shapeFlag&32){const i=t._;i?(TT(r,t,n),n&&zu(r,"_",i,!0)):IT(t,r)}else t&&ET(e,t)},xV=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,s=ct;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:TT(i,t,n):(o=!t.$stable,IT(t,i)),s=t}else t&&(ET(e,t),s={default:1});if(o)for(const a in i)!iy(a)&&s[a]==null&&delete i[a]};function kV(){typeof __VUE_OPTIONS_API__!="boolean"&&(No().__VUE_OPTIONS_API__=!0),typeof __VUE_PROD_DEVTOOLS__!="boolean"&&(No().__VUE_PROD_DEVTOOLS__=!1),typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(No().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const Cn=EV;function CV(e){return vV(e)}function vV(e,t){kV();const n=No();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&aT(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:i,patchProp:o,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:d,setScopeId:h=ar,insertStaticContent:p}=e,m=(I,E,B,q=null,U=null,F=null,ee=void 0,W=null,ne=!!E.dynamicChildren)=>{if(I===E)return;I&&!pa(I,E)&&(q=me(I),_(I,U,F,!0),I=null),E.patchFlag===-2&&(ne=!1,E.dynamicChildren=null),E.dynamicChildren&&I&&I.dynamicChildren&&I.dynamicChildren.hasOnce&&(E.dynamicChildren===bs&&(E.dynamicChildren=[]),E.dynamicChildren.hasOnce=!0);const{type:j,ref:he,shapeFlag:se}=E;switch(j){case rc:g(I,E,B,q);break;case Mr:A(I,E,B,q);break;case ru:I==null&&x(E,B,q,ee);break;case Ut:G(I,E,B,q,U,F,ee,W,ne);break;default:se&1?C(I,E,B,q,U,F,ee,W,ne):se&6?X(I,E,B,q,U,F,ee,W,ne):(se&64||se&128)&&j.process(I,E,B,q,U,F,ee,W,ne,ae)}he!=null&&U?ja(he,I&&I.ref,F,E||I,!E):he==null&&I&&I.ref!=null&&ja(I.ref,null,F,I,!0)},g=(I,E,B,q)=>{if(I==null)r(E.el=a(E.children),B,q);else{const U=E.el=I.el;E.children!==I.children&&c(U,E.children)}},A=(I,E,B,q)=>{I==null?r(E.el=l(E.children||""),B,q):E.el=I.el},x=(I,E,B,q)=>{[I.el,I.anchor]=p(I.children,E,B,q,I.el,I.anchor)},b=({el:I,anchor:E},B,q)=>{let U;for(;I&&I!==E;)U=d(I),r(I,B,q),I=U;r(E,B,q)},y=({el:I,anchor:E})=>{let B;for(;I&&I!==E;)B=d(I),i(I),I=B;i(E)},C=(I,E,B,q,U,F,ee,W,ne)=>{if(E.type==="svg"?ee="svg":E.type==="math"&&(ee="mathml"),I==null)w(E,B,q,U,F,ee,W,ne);else{const j=I.el&&I.el._isVueCE?I.el:null;try{j&&j._beginPatch(),N(I,E,U,F,ee,W,ne)}finally{j&&j._endPatch()}}},w=(I,E,B,q,U,F,ee,W)=>{let ne,j;const{props:he,shapeFlag:se,transition:de,dirs:ye}=I;if(ne=I.el=s(I.type,F,he&&he.is,he),se&8?u(ne,I.children):se&16&&D(I.children,ne,null,q,U,Yd(I,F),ee,W),ye&&uo(I,null,q,"created"),v(ne,I,I.scopeId,ee,q),he){for(const ze in he)ze!=="value"&&!La(ze)&&o(ne,ze,null,he[ze],F,q);"value"in he&&o(ne,"value",null,he.value,F),(j=he.onVnodeBeforeMount)&&yr(j,q,I)}__VUE_PROD_DEVTOOLS__&&(zu(ne,"__vnode",I,!0),zu(ne,"__vueParentComponent",q,!0)),ye&&uo(I,null,q,"beforeMount");const De=SV(U,de);De&&de.beforeEnter(ne),r(ne,E,B),((j=he&&he.onVnodeMounted)||De||ye)&&Cn(()=>{j&&yr(j,q,I),De&&de.enter(ne),ye&&uo(I,null,q,"mounted")},U)},v=(I,E,B,q,U)=>{if(B&&h(I,B),q)for(let F=0;F<q.length;F++)h(I,q[F]);if(U){let F=U.subTree;if(E===F||NT(F.type)&&(F.ssContent===E||F.ssFallback===E)){const ee=U.vnode;v(I,ee,ee.scopeId,ee.slotScopeIds,U.parent)}}},D=(I,E,B,q,U,F,ee,W,ne=0)=>{for(let j=ne;j<I.length;j++){const he=I[j]=W?Gr(I[j]):kr(I[j]);m(null,he,E,B,q,U,F,ee,W)}},N=(I,E,B,q,U,F,ee)=>{const W=E.el=I.el;__VUE_PROD_DEVTOOLS__&&(W.__vnode=E);let{patchFlag:ne,dynamicChildren:j,dirs:he}=E;ne|=I.patchFlag&16;const se=I.props||ct,de=E.props||ct;let ye;if(B&&fo(B,!1),(ye=de.onVnodeBeforeUpdate)&&yr(ye,B,E,I),he&&uo(E,I,B,"beforeUpdate"),B&&fo(B,!0),j&&(!I.dynamicChildren||I.dynamicChildren.length!==j.length)&&(ne=0,ee=!1,j=null),(se.innerHTML&&de.innerHTML==null||se.textContent&&de.textContent==null)&&u(W,""),j?T(I.dynamicChildren,j,W,B,q,Yd(E,U),F):ee||le(I,E,W,null,B,q,Yd(E,U),F,!1),ne>0){if(ne&16)L(W,se,de,B,U);else if(ne&2&&se.class!==de.class&&o(W,"class",null,de.class,U),ne&4&&o(W,"style",se.style,de.style,U),ne&8){const De=E.dynamicProps;for(let ze=0;ze<De.length;ze++){const P=De[ze],Q=se[P],pe=de[P];(pe!==Q||P==="value")&&o(W,P,Q,pe,U,B)}}ne&1&&I.children!==E.children&&u(W,E.children)}else!ee&&j==null&&L(W,se,de,B,U);((ye=de.onVnodeUpdated)||he)&&Cn(()=>{ye&&yr(ye,B,E,I),he&&uo(E,I,B,"updated")},q)},T=(I,E,B,q,U,F,ee)=>{for(let W=0;W<E.length;W++){const ne=I[W],j=E[W],he=ne.el||Am(ne),se=he&&(ne.type===Ut||!pa(ne,j)||ne.shapeFlag&198)?f(he):B;m(ne,j,se,null,q,U,F,ee,!0)}},L=(I,E,B,q,U)=>{if(E!==B){if(E!==ct)for(const F in E)!La(F)&&!(F in B)&&o(I,F,E[F],null,U,q);for(const F in B){if(La(F))continue;const ee=B[F],W=E[F];ee!==W&&F!=="value"&&o(I,F,W,ee,U,q)}"value"in B&&o(I,"value",E.value,B.value,U)}},G=(I,E,B,q,U,F,ee,W,ne)=>{const j=E.el=I?I.el:a(""),he=E.anchor=I?I.anchor:a("");let{patchFlag:se,dynamicChildren:de,slotScopeIds:ye}=E;ye&&(W=W?W.concat(ye):ye),I==null?(r(j,B,q),r(he,B,q),D(E.children||[],B,he,U,F,ee,W,ne)):se>0&&se&64&&de&&I.dynamicChildren&&I.dynamicChildren.length===de.length?(T(I.dynamicChildren,de,B,U,F,ee,W),(E.key!=null||U&&E===U.subTree)&&RT(I,E,!0)):le(I,E,B,he,U,F,ee,W,ne)},X=(I,E,B,q,U,F,ee,W,ne)=>{E.slotScopeIds=W,I==null?E.shapeFlag&512?U.ctx.activate(E,B,q,ee,ne):Y(E,B,q,U,F,ee,ne):z(I,E,ne)},Y=(I,E,B,q,U,F,ee)=>{const W=I.component=PV(I,q,U);if(ry(I)&&(W.ctx.renderer=ae),LV(W,!1,ee),W.asyncDep){if(U&&U.registerDep(W,ue,ee,F),!I.el){const ne=W.subTree=rr(Mr);A(null,ne,E,B),I.placeholder=ne.el}}else ue(W,I,E,B,U,F,ee)},z=(I,E,B)=>{const q=E.component=I.component;if(pV(I,E,B))if(q.asyncDep&&!q.asyncResolved){E.el=I.el,E.placeholder=I.placeholder,re(q,E,B);return}else q.next=E,q.update();else E.el=I.el,E.placeholder=I.placeholder,q.vnode=E},ue=(I,E,B,q,U,F,ee)=>{const W=()=>{if(I.isMounted){let{next:se,bu:de,u:ye,parent:De,vnode:ze}=I;{const Ze=_T(I);if(Ze){se&&(se.el=ze.el,re(I,se,ee)),Ze.asyncDep.then(()=>{Cn(()=>{I.isUnmounted||j()},U)});return}}let P=se,Q;fo(I,!1),se?(se.el=ze.el,re(I,se,ee)):se=ze,de&&Ud(de),(Q=se.props&&se.props.onVnodeBeforeUpdate)&&yr(Q,De,se,ze),fo(I,!0);const pe=bk(I),ge=I.subTree;I.subTree=pe,m(ge,pe,f(ge.el),me(ge),I,U,F),se.el=pe.el,P===null&&mV(I,pe.el),ye&&Cn(ye,U),(Q=se.props&&se.props.onVnodeUpdated)&&Cn(()=>yr(Q,De,se,ze),U),__VUE_PROD_DEVTOOLS__&&lT(I)}else{let se;const{el:de,props:ye}=E,{bm:De,m:ze,parent:P,root:Q,type:pe}=I,ge=Ua(E);fo(I,!1),De&&Ud(De),!ge&&(se=ye&&ye.onVnodeBeforeMount)&&yr(se,P,E),fo(I,!0);{Q.ce&&Q.ce._hasShadowRoot()&&Q.ce._injectChildStyle(pe,I.parent?I.parent.type:void 0);const Ze=I.subTree=bk(I);m(null,Ze,B,q,I,U,F),E.el=Ze.el}if(ze&&Cn(ze,U),!ge&&(se=ye&&ye.onVnodeMounted)){const Ze=E;Cn(()=>yr(se,P,Ze),U)}(E.shapeFlag&256||P&&Ua(P.vnode)&&P.vnode.shapeFlag&256)&&I.a&&Cn(I.a,U),I.isMounted=!0,__VUE_PROD_DEVTOOLS__&&_J(I),E=B=q=null}};I.scope.on();const ne=I.effect=new zE(W);I.scope.off();const j=I.update=ne.run.bind(ne),he=I.job=ne.runIfDirty.bind(ne);he.i=I,he.id=I.uid,ne.scheduler=()=>XA(he),fo(I,!0),j()},re=(I,E,B)=>{E.component=I;const q=I.vnode.props;I.vnode=E,I.next=null,AV(I,E.props,q,B),xV(I,E.children,B),Nr(),iT(I),Or()},le=(I,E,B,q,U,F,ee,W,ne=!1)=>{const j=I&&I.children,he=I?I.shapeFlag:0,se=E.children,{patchFlag:de,shapeFlag:ye}=E;if(de>0){if(de&128){R(j,se,B,q,U,F,ee,W,ne);return}else if(de&256){Be(j,se,B,q,U,F,ee,W,ne);return}}ye&8?(he&16&&V(j,U,F),se!==j&&u(B,se)):he&16?ye&16?R(j,se,B,q,U,F,ee,W,ne):V(j,U,F,!0):(he&8&&u(B,""),ye&16&&D(se,B,q,U,F,ee,W,ne))},Be=(I,E,B,q,U,F,ee,W,ne)=>{I=I||bs,E=E||bs;const j=I.length,he=E.length,se=Math.min(j,he);let de;for(de=0;de<se;de++){const ye=E[de]=ne?Gr(E[de]):kr(E[de]);m(I[de],ye,B,null,U,F,ee,W,ne)}j>he?V(I,U,F,!0,!1,se):D(E,B,q,U,F,ee,W,ne,se)},R=(I,E,B,q,U,F,ee,W,ne)=>{let j=0;const he=E.length;let se=I.length-1,de=he-1;for(;j<=se&&j<=de;){const ye=I[j],De=E[j]=ne?Gr(E[j]):kr(E[j]);if(pa(ye,De))m(ye,De,B,null,U,F,ee,W,ne);else break;j++}for(;j<=se&&j<=de;){const ye=I[se],De=E[de]=ne?Gr(E[de]):kr(E[de]);if(pa(ye,De))m(ye,De,B,null,U,F,ee,W,ne);else break;se--,de--}if(j>se){if(j<=de){const ye=de+1,De=ye<he?E[ye].el:q;for(;j<=de;)m(null,E[j]=ne?Gr(E[j]):kr(E[j]),B,De,U,F,ee,W,ne),j++}}else if(j>de)for(;j<=se;)_(I[j],U,F,!0),j++;else{const ye=j,De=j,ze=new Map;for(j=De;j<=de;j++){const nt=E[j]=ne?Gr(E[j]):kr(E[j]);nt.key!=null&&ze.set(nt.key,j)}let P,Q=0;const pe=de-De+1;let ge=!1,Ze=0;const We=new Array(pe);for(j=0;j<pe;j++)We[j]=0;for(j=ye;j<=se;j++){const nt=I[j];if(Q>=pe){_(nt,U,F,!0);continue}let gt;if(nt.key!=null)gt=ze.get(nt.key);else for(P=De;P<=de;P++)if(We[P-De]===0&&pa(nt,E[P])){gt=P;break}gt===void 0?_(nt,U,F,!0):(We[gt-De]=j+1,gt>=Ze?Ze=gt:ge=!0,m(nt,E[gt],B,null,U,F,ee,W,ne),Q++)}const bt=ge?IV(We):bs;for(P=bt.length-1,j=pe-1;j>=0;j--){const nt=De+j,gt=E[nt],_n=E[nt+1],Nn=nt+1<he?_n.el||Am(_n):q;We[j]===0?m(null,gt,B,Nn,U,F,ee,W,ne):ge&&(P<0||j!==bt[P]?H(gt,B,Nn,2):P--)}}},H=(I,E,B,q,U=null)=>{const{el:F,type:ee,transition:W,children:ne,shapeFlag:j}=I;if(j&6){H(I.component.subTree,E,B,q);return}if(j&128){I.suspense.move(E,B,q);return}if(j&64){ee.move(I,E,B,ae);return}if(ee===Ut){r(F,E,B);for(let se=0;se<ne.length;se++)H(ne[se],E,B,q);r(I.anchor,E,B);return}if(ee===ru){b(I,E,B);return}if(q!==2&&j&1&&W)if(q===0)W.persisted&&!F[Gd]?r(F,E,B):(W.beforeEnter(F),r(F,E,B),Cn(()=>W.enter(F),U));else{const{leave:se,delayLeave:de,afterLeave:ye}=W,De=()=>{I.ctx.isUnmounted?i(F):r(F,E,B)},ze=()=>{const P=F._isLeaving||!!F[Gd];F._isLeaving&&F[Gd](!0),W.persisted&&!P?De():se(F,()=>{De(),ye&&ye()})};de?de(F,De,ze):ze()}else r(F,E,B)},_=(I,E,B,q=!1,U=!1)=>{const{type:F,props:ee,ref:W,children:ne,dynamicChildren:j,shapeFlag:he,patchFlag:se,dirs:de,cacheIndex:ye,memo:De}=I;if((se===-2||j&&j.hasOnce)&&(U=!1),W!=null&&(Nr(),ja(W,null,B,I,!0),Or()),ye!=null&&(!I.ctx||I.ctx===E)&&(E.renderCache[ye]=void 0),he&256){E.ctx.deactivate(I);return}const ze=he&1&&de,P=!Ua(I);let Q;if(P&&(Q=ee&&ee.onVnodeBeforeUnmount)&&yr(Q,E,I),he&6)M(I.component,B,q);else{if(he&128){I.suspense.unmount(B,q);return}ze&&uo(I,null,E,"beforeUnmount"),he&64?I.type.remove(I,E,B,ae,q):j&&!j.hasOnce&&(F!==Ut||se>0&&se&64)?V(j,E,B,!1,!0):(F===Ut&&se&384||!U&&he&16)&&V(ne,E,B),q&&k(I)}const pe=De!=null&&ye==null;(P&&(Q=ee&&ee.onVnodeUnmounted)||ze||pe)&&Cn(()=>{Q&&yr(Q,E,I),ze&&uo(I,null,E,"unmounted"),pe&&(I.el=null)},B)},k=I=>{const{type:E,el:B,anchor:q,transition:U}=I,F=E===Ut;if(F&&!U){K(B,q);return}if(E===ru){y(I),U&&!U.persisted&&U.afterLeave&&U.afterLeave();return}const ee=F?hm(I):I,W=()=>{F?f(B)&&K(B,q):i(B),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(ee&&ee.shapeFlag&1&&U&&!U.persisted){const{leave:ne,delayLeave:j}=U,he=ee.el,se=()=>ne(he,W);j?j(he,W,se):se()}else W()},K=(I,E)=>{let B;for(;I!==E;)B=d(I),i(I),I=B;i(E)},M=(I,E,B)=>{const{bum:q,scope:U,job:F,subTree:ee,um:W,m:ne,a:j}=I;kk(ne),kk(j),q&&Ud(q),U.stop(),F?(F.flags|=8,_(ee,I,E,B)):I.vnode.el&&ee&&(ee.transition=I.vnode.transition,_(ee,I,E,B)),W&&Cn(W,E),Cn(()=>{I.isUnmounted=!0},E),__VUE_PROD_DEVTOOLS__&&OJ(I)},V=(I,E,B,q=!1,U=!1,F=0)=>{for(let ee=F;ee<I.length;ee++)_(I[ee],E,B,q,U)},me=I=>{if(I.shapeFlag&6)return me(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const E=d(I.anchor||I.el),B=E&&E[WJ];return B?d(B):E},fe=(I,E,B)=>{const q=I&&E._vnode?void 0:I&&I.component?I.component.uid:BV();EJ(()=>{I==null?E._vnode&&_(E._vnode,null,null,!0):m(E._vnode||null,I,E,null,null,null,B),E._vnode=I},q)},ae={p:m,um:_,m:H,r:k,mt:Y,mc:D,pc:le,pbc:T,n:me,o:e};return{render:fe,hydrate:void 0,createApp:lV(fe)}}function Yd({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function fo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function SV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function RT(e,t,n=!1){const r=e.children,i=t.children;if(Ne(r)&&Ne(i))for(let o=0;o<r.length;o++){const s=r[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=Gr(i[o]),a.el=s.el),!n&&a.patchFlag!==-2&&RT(s,a)),a.type===rc&&(a.patchFlag===-1&&(a=i[o]=Gr(a)),a.el=s.el),a.type===Mr&&!a.el&&(a.el=s.el)}}function IV(e){const t=e.slice(),n=[0];let r,i,o,s,a;const l=e.length;for(r=0;r<l;r++){const c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(o=0,s=n.length-1;o<s;)a=o+s>>1,e[n[a]]<c?o=a+1:s=a;c<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=t[s];return n}function _T(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_T(t)}function kk(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Am(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Am(t.subTree):null}const NT=e=>e.__isSuspense;function EV(e,t){t&&t.pendingBranch?Ne(e)?t.effects.push(...e):t.effects.push(e):IJ(e)}const Ut=Symbol.for("v-fgt"),rc=Symbol.for("v-txt"),Mr=Symbol.for("v-cmt"),ru=Symbol.for("v-stc"),Is=[];let Xr=null;function TV(){Is.pop(),Xr=Is[Is.length-1]||null}let sy=1;function Vu(e,t=!1){sy+=e,e<0&&Xr&&t&&(Xr.hasOnce=!0)}function pl(e){return e?e.__v_isVNode===!0:!1}function pa(e,t){return e.type===t.type&&e.key===t.key}const OT=({key:e})=>e??null,iu=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_t(e)||Xt(e)||Me(e)?{i:Tr,r:e,k:t,f:!!n}:e:null);function RV(e,t=null,n=null,r=0,i=null,o=e===Ut?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&OT(t),ref:t&&iu(t),scopeId:cT,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Tr};return a?(qu(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=_t(n)?8:16),sy>0&&!s&&Xr&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Xr.push(l),l}const rr=_V;function _V(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===eV)&&(e=Mr),pl(e)){const a=js(e,t,!0);return n&&qu(a,n),sy>0&&!o&&Xr&&(a.shapeFlag&6?Xr[Xr.indexOf(e)]=a:Xr.push(a)),a.patchFlag=-2,a}if(UV(e)&&(e=e.__vccOpts),t){t=NV(t);let{class:a,style:l}=t;a&&!_t(a)&&(t.class=HA(a)),ut(l)&&(ZA(l)&&!Ne(l)&&(l=qt({},l)),t.style=UA(l))}const s=_t(e)?1:NT(e)?128:Nf(e)?64:ut(e)?4:Me(e)?2:0;return RV(e,t,n,r,i,s,o,!0)}function NV(e){return e?ZA(e)||CT(e)?qt({},e):e:null}function js(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:s,children:a,transition:l}=e,c=t?DV(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&OT(c),ref:t&&t.ref?n&&o?Ne(o)?o.concat(iu(t)):[o,iu(t)]:iu(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ut?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&js(e.ssContent),ssFallback:e.ssFallback&&js(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return l&&r&&Hu(u,l.clone(u)),u}function OV(e=" ",t=0){return rr(rc,null,e,t)}function kr(e){return e==null||typeof e=="boolean"?rr(Mr):Ne(e)?rr(Ut,null,e.slice()):pl(e)?Gr(e):rr(rc,null,String(e))}function Gr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:js(e)}function qu(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ne(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),qu(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!CT(t)?t._ctx=Tr:i===3&&Tr&&(Tr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Me(t)){if(r&65){qu(e,{default:t});return}t={default:t,_ctx:Tr},n=32}else t=String(t),r&64?(n=16,t=[OV(t)]):n=8;e.children=t,e.shapeFlag|=n}function DV(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=HA([t.class,r.class]));else if(i==="style")t.style=UA([t.style,r.style]);else if(Sf(i)){const o=t[i],s=r[i];s&&o!==s&&!(Ne(o)&&o.includes(s))?t[i]=o?[].concat(o,s):s:s==null&&o==null&&!If(i)&&(t[i]=s)}else i!==""&&(t[i]=r[i])}return t}function yr(e,t,n,r=null){hr(e,t,7,[n,r])}const MV=AT();let DT=0;function BV(){return DT}function PV(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||MV,o={uid:DT++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Y4(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ST(r,i),emitsOptions:yT(r,i),emit:null,emitted:null,propsDefaults:ct,inheritAttrs:r.inheritAttrs,ctx:ct,data:ct,props:ct,attrs:ct,slots:ct,refs:ct,setupState:ct,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=uV.bind(null,o),e.ce&&e.ce(o),o}let un=null;const FV=()=>un||Tr;let Gu,ml;{const e=No(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Gu=t("__VUE_INSTANCE_SETTERS__",n=>un=n),ml=t("__VUE_SSR_SETTERS__",n=>gl=n)}const ic=e=>{const t=un;return Gu(e),e.scope.on(),()=>{e.scope.off(),Gu(t)}},Ck=()=>{un&&un.scope.off(),Gu(null)};function MT(e){return e.vnode.shapeFlag&4}let gl=!1;function LV(e,t=!1,n=!1){t&&ml(t);const{props:r,children:i}=e.vnode,o=MT(e);gV(e,r,o,t),wV(e,i,n||t);const s=o?zV(e,t):void 0;return t&&ml(!1),s}function zV(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,tV);const{setup:r}=n;if(r){Nr();const i=e.setupContext=r.length>1?jV(e):null,o=ic(e),s=nc(r,e,0,[e.props,i]),a=PE(s);if(Or(),o(),(a||e.sp)&&!Ua(e)&&hT(e),a){if(s.then(Ck,Ck),t)return s.then(l=>{ml(!0);try{vk(e,l,t)}finally{ml(!1)}}).catch(l=>{Rf(l,e,0)});e.asyncDep=s}else vk(e,s)}else BT(e)}function vk(e,t,n){Me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ut(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=tT(t)),BT(e)}function BT(e,t,n){const r=e.type;if(e.render||(e.render=r.render||ar),__VUE_OPTIONS_API__){const i=ic(e);Nr();try{nV(e)}finally{Or(),i()}}}const WV={get(e,t){return Yt(e,"get",""),e[t]}};function jV(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,WV),slots:e.slots,emit:e.emit,expose:t}}function ay(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tT(mJ(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ha)return Ha[n](e)},has(t,n){return n in t||n in Ha}})):e.proxy}function UV(e){return Me(e)&&"__vccOpts"in e}const HV=(e,t)=>wJ(e,t,gl);function et(e,t,n){try{Vu(-1);const r=arguments.length;return r===2?ut(t)&&!Ne(t)?pl(t)?rr(e,null,[t]):rr(e,t):rr(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&pl(n)&&(n=[n]),rr(e,t,n))}finally{Vu(1)}}const Sk="3.5.44";let ym;const Ik=typeof window<"u"&&window.trustedTypes;if(Ik)try{ym=Ik.createPolicy("vue",{createHTML:e=>e})}catch{}const PT=ym?e=>ym.createHTML(e):e=>e,KV="http://www.w3.org/2000/svg",JV="http://www.w3.org/1998/Math/MathML",Vr=typeof document<"u"?document:null,Ek=Vr&&Vr.createElement("template"),VV={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?Vr.createElementNS(KV,e):t==="mathml"?Vr.createElementNS(JV,e):n?Vr.createElement(e,{is:n}):Vr.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>Vr.createTextNode(e),createComment:e=>Vr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Vr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,o){const s=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{Ek.innerHTML=PT(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Ek.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},qV=Symbol("_vtc");function GV(e,t,n){const r=e[qV];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Tk=Symbol("_vod"),QV=Symbol("_vsh"),YV=Symbol(""),$V=/(?:^|;)\s*display\s*:/;function ZV(e,t,n){const r=e.style,i=_t(n);let o=!1;if(n&&!i){if(t)if(_t(t))for(const s of t.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&xa(r,a,"")}else for(const s in t)n[s]==null&&xa(r,s,"");for(const s in n){s==="display"&&(o=!0);const a=n[s];a!=null?eq(e,s,!_t(t)&&t?t[s]:void 0,a)||xa(r,s,a):xa(r,s,"")}}else if(i){if(t!==n){const s=r[YV];s&&(n+=";"+s),r.cssText=n,o=$V.test(n)}}else t&&e.removeAttribute("style");Tk in e&&((!i||t!==n)&&(e[Tk]=o?r.display:""),e[QV]&&(r.display="none"))}const zc=/\s*!important$/;function xa(e,t,n){if(Ne(n))n.forEach(r=>xa(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))zc.test(n)?e.setProperty(t,n.replace(zc,""),"important"):e.setProperty(t,n);else{const r=XV(e,t);zc.test(n)?e.setProperty($o(r),n.replace(zc,""),"important"):e[r]=n}}const Rk=["Webkit","Moz","ms"],$d={};function XV(e,t){const n=$d[t];if(n)return n;let r=lr(t);if(r!=="filter"&&r in e)return $d[t]=r;r=FE(r);for(let i=0;i<Rk.length;i++){const o=Rk[i]+r;if(o in e)return $d[t]=o}return t}function eq(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&_t(r)&&n===r}const _k="http://www.w3.org/1999/xlink";function Nk(e,t,n,r,i,o=q4(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_k,t.slice(6,t.length)):e.setAttributeNS(_k,t,n):n==null||o&&!LE(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Gi(n)?String(n):n)}function Ok(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?PT(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=LE(n):n==null&&a==="string"?(n="",s=!0):a==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function tq(e,t,n,r){e.addEventListener(t,n,r)}function nq(e,t,n,r){e.removeEventListener(t,n,r)}const Dk=Symbol("_vei");function rq(e,t,n,r,i=null){const o=e[Dk]||(e[Dk]={}),s=o[t];if(r&&s)s.value=r;else{const[a,l]=sq(t);if(r){const c=o[t]=cq(r,i);tq(e,a,c,l)}else s&&(nq(e,a,s,l),o[t]=void 0)}}const iq=/(Once|Passive|Capture)$/,oq=/^on:?(?:Once|Passive|Capture)$/;function sq(e){let t,n;for(;(n=e.match(iq))&&!oq.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):$o(e.slice(2)),t]}let Zd=0;const aq=Promise.resolve(),lq=()=>Zd||(aq.then(()=>Zd=0),Zd=Date.now());function cq(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const i=n.value;if(Ne(i)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const s=i.slice(),a=[r];for(let l=0;l<s.length&&!r._stopped;l++){const c=s[l];c&&hr(c,t,5,a)}}else hr(i,t,5,[r])};return n.value=e,n.attached=lq(),n}const Mk=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,uq=(e,t,n,r,i,o)=>{const s=i==="svg";t==="class"?GV(e,r,s):t==="style"?ZV(e,n,r):Sf(t)?If(t)||rq(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):fq(e,t,r,s))?(Ok(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Nk(e,t,r,s,o,t!=="value")):e._isVueCE&&(hq(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_t(r)))?Ok(e,lr(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Nk(e,t,r,s))};function fq(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mk(t)&&Me(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Mk(t)&&_t(n)?!1:t in e}function hq(e,t){const n=e._def.props;if(!n)return!1;const r=lr(t);return Array.isArray(n)?n.some(i=>lr(i)===r):Object.keys(n).some(i=>lr(i)===r)}const dq=qt({patchProp:uq},VV);let Bk;function pq(){return Bk||(Bk=CV(dq))}const mq=((...e)=>{const t=pq().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=Aq(r);if(!i)return;const o=t._component;!Me(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,gq(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t});function gq(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Aq(e){return _t(e)?document.querySelector(e):e}function FT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=FT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bm(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=FT(e))&&(r&&(r+=" "),r+=t);return r}let yq=e=>crypto.getRandomValues(new Uint8Array(e)),bq=(e,t,n)=>{let r=256-256%e.length;if(r===256){let i=e.length-1;return(o=t)=>{if(!o)return"";let s="";for(;;){let a=n(o),l=o|=0;for(;l--;)if(s+=e[a[l]&i],s.length>=o)return s}}}return(i=t)=>{if(!i)return"";let o="",s=Math.ceil(1.6*256*i/r);for(;;){let a=n(s),l=s;for(;l--;)if(a[l]<r&&(o+=e[a[l]%e.length],o.length>=i))return o}}},wq=(e,t=21)=>bq(e,t|0,yq);var xq=Object.defineProperty,Pk=Object.getOwnPropertySymbols,kq=Object.prototype.hasOwnProperty,Cq=Object.prototype.propertyIsEnumerable,Fk=(e,t,n)=>t in e?xq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vq=(e,t)=>{for(var n in t||(t={}))kq.call(t,n)&&Fk(e,n,t[n]);if(Pk)for(var n of Pk(t))Cq.call(t,n)&&Fk(e,n,t[n]);return e};function oc(e,t){return Object.assign(e,{meta:vq({package:"@milkdown/components"},t)}),e}const Sq={imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},ly=Pr(Sq,"imageBlockConfigCtx");oc(ly,{displayName:"Config<image-block>",group:"ImageBlock"});function Iq(e){return qo(e,"paragraph",(t,n,r)=>{var i,o;if(((i=t.children)==null?void 0:i.length)!==1)return;const s=(o=t.children)==null?void 0:o[0];if(!s||s.type!=="image")return;const{url:a,alt:l,title:c}=s,u={type:"image-block",url:a,alt:l,title:c};r.children.splice(n,1,u)})}const cy=bn("remark-image-block",()=>()=>Iq);oc(cy.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"});oc(cy.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var Eq=Object.defineProperty,Lk=Object.getOwnPropertySymbols,Tq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?Eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_q=(e,t)=>{for(var n in t||(t={}))Tq.call(t,n)&&zk(e,n,t[n]);if(Lk)for(var n of Lk(t))Rq.call(t,n)&&zk(e,n,t[n]);return e};const wm="image-block",sc=xt("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${wm}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw dr(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number((t=e.getAttribute("ratio"))!=null?t:1)}}}],toDOM:e=>["img",_q({"data-type":wm},e.attrs)],parseMarkdown:{match:({type:e})=>e==="image-block",runner:(e,t,n)=>{var r;const i=t.url,o=(r=t.title)!=null?r:"";let s=Number(t.alt||1);(Number.isNaN(s)||s===0)&&(s=1),e.addNode(n,{src:i,caption:o,ratio:s})}},toMarkdown:{match:e=>e.type.name==="image-block",runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));oc(sc.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"});function Mf(...e){}const Nq=wq("abcdefghijklmnopqrstuvwxyz0123456789",8);function xm(e){return`${e}-${Nq()}`}Mf(et);function Ka({icon:e,class:t,onClick:n}){return et("span",{class:bm("milkdown-icon",t),onPointerdown:n,innerHTML:e?ME.sanitize(e.trim()):void 0})}Ka.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};Mf(et,Ut);const Oq=ny({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:i,uploadButton:o,confirmButton:s,uploadPlaceholderText:a,className:l,onImageLoadError:c}){var u,f;const d=Pn(!1),h=Pn(),p=Pn((u=t.value)!=null?u:""),m=xm("milkdown-image-link"),g=xm("milkdown-image-upload"),A=Pn(((f=t.value)==null?void 0:f.length)!==0),x=w=>{const D=w.target.value;A.value=D.length!==0,p.value=D},b=w=>{var v,D;w.key==="Enter"&&n((D=(v=h.value)==null?void 0:v.value)!=null?D:"")},y=()=>{var w,v;n((v=(w=h.value)==null?void 0:w.value)!=null?v:"")},C=w=>{var v;const D=(v=w.target.files)==null?void 0:v[0];D&&r(D).then(N=>{N&&(n(N),A.value=!0)}).catch(N=>{console.error("An error occurred while uploading image"),console.error(N)})};return()=>et("div",{class:bm("image-edit",l)},et(Ka,{icon:i,class:"image-icon"}),et("div",{class:bm("link-importer",d.value&&"focus")},et("input",{id:m,ref:h,draggable:"true",onDragstart:w=>{w.preventDefault(),w.stopPropagation()},disabled:e.value,class:"link-input-area",value:p.value,onInput:x,onKeydown:b,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!A.value&&et("div",{class:"placeholder"},et("input",{disabled:e.value,class:"hidden",id:g,type:"file",accept:"image/*",onChange:C}),et("label",{class:"uploader",for:g},et(Ka,{icon:o})),et("span",{class:"text",onClick:()=>{var w;return(w=h.value)==null?void 0:w.focus()}},a))),p.value&&et(Ut,null,et("div",{class:"image-preview"},et("img",{src:p.value,alt:"",onError:w=>Promise.resolve(c?.(w)).catch(()=>{})})),et("div",{class:"confirm",onClick:()=>y()},et(Ka,{icon:s}))))}});Mf(et,Ut);const Dq=ny({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:i,config:o}){var s;const a=Pn(),l=Pn(),c=Pn(!!((s=t.value)!=null&&s.length)),u=xm("milkdown-image-caption"),f=Pn(0),d=()=>{var b;const y=a.value;if(!y)return;const C=y.closest(".milkdown-image-block");if(!C)return;let w=C.getBoundingClientRect().width;if(!w)return;o.maxWidth&&o.maxWidth<w&&(w=o.maxWidth);const v=y.naturalHeight,D=y.naturalWidth;let N=D<w?v:w*(v/D);o.maxHeight&&N>o.maxHeight&&(N=o.maxHeight);const T=(N*((b=n.value)!=null?b:1)).toFixed(2);y.dataset.origin=N.toFixed(2),y.dataset.height=T,y.style.height=`${T}px`,o.maxWidth&&(y.style.maxWidth=`${o.maxWidth}px`)},h=b=>{b.preventDefault(),b.stopPropagation(),!r.value&&(c.value=!c.value)},p=b=>{const C=b.target.value;f.value&&window.clearTimeout(f.value),f.value=window.setTimeout(()=>{i("caption",C)},1e3)},m=b=>{const C=b.target.value;f.value&&(window.clearTimeout(f.value),f.value=0),i("caption",C)},g=b=>{b.preventDefault();const y=a.value;if(!y)return;const C=y.getBoundingClientRect().top;let w=b.clientY-C;w<100&&(w=100),o.maxHeight&&w>o.maxHeight&&(w=o.maxHeight);const v=Number(w).toFixed(2);y.dataset.height=v,y.style.height=`${v}px`},A=()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",A);const b=a.value;if(!b)return;const y=Number(b.dataset.origin),C=Number(b.dataset.height),w=Number.parseFloat(Number(C/y).toFixed(2));Number.isNaN(w)||i("ratio",w)},x=b=>{r.value||(b.preventDefault(),b.stopPropagation(),window.addEventListener("pointermove",g),window.addEventListener("pointerup",A))};return()=>et(Ut,null,et("div",{class:"image-wrapper"},et("div",{class:"operation"},et("div",{class:"operation-item",onPointerdown:h},et(Ka,{icon:o.captionIcon}))),et("img",{ref:a,"data-type":wm,onLoad:d,src:e.value,alt:t.value,onError:b=>{var y;return Promise.resolve((y=o.onImageLoadError)==null?void 0:y.call(o,b)).catch(()=>{})}}),et("div",{ref:l,class:"image-resize-handle",onPointerdown:x})),c.value&&et("input",{id:u,draggable:"true",onDragstart:b=>{b.preventDefault(),b.stopPropagation()},class:"caption-input",placeholder:o?.captionPlaceholderText,onInput:p,onBlur:m,value:t.value}))}});var Mq=Object.defineProperty,Wk=Object.getOwnPropertySymbols,Bq=Object.prototype.hasOwnProperty,Pq=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?Mq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fq=(e,t)=>{for(var n in t||(t={}))Bq.call(t,n)&&jk(e,n,t[n]);if(Wk)for(var n of Wk(t))Pq.call(t,n)&&jk(e,n,t[n]);return e};Mf(et,Ut);const Lq=ny({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t}=e;return()=>{var n;return(n=t.value)!=null&&n.length?et(Dq,Fq({},e)):et(Oq,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:r=>e.setAttr("src",r),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),LT=tg(sc.node,e=>(t,n,r)=>{const i=Pn(t.attrs.src),o=Pn(t.attrs.caption),s=Pn(t.attrs.ratio),a=Pn(!1),l=Pn(!n.editable),c=(g,A)=>{if(!n.editable)return;const x=r();x!=null&&n.dispatch(n.state.tr.setNodeAttribute(x,g,g==="src"?ME.sanitize(A):A))},u=e.get(ly.key),f=mq(Lq,{src:i,caption:o,ratio:s,selected:a,readonly:l,setAttr:c,config:u}),d=document.createElement("div");d.className="milkdown-image-block";const h=LJ(()=>{a.value?d.classList.add("selected"):d.classList.remove("selected")}),p=u.proxyDomURL,m=g=>{if(!p)i.value=g.attrs.src;else{const A=p(g.attrs.src);typeof A=="string"?i.value=A:A.then(x=>{i.value=x}).catch(console.error)}s.value=g.attrs.ratio,o.value=g.attrs.caption,l.value=!n.editable};return m(t),f.mount(d),{dom:d,update:g=>g.type!==t.type?!1:(m(g),!0),stopEvent:g=>g.target instanceof HTMLInputElement,selectNode:()=>{a.value=!0},deselectNode:()=>{a.value=!1},destroy:()=>{h(),f.unmount(),d.remove()}}});oc(LT,{displayName:"NodeView<image-block>",group:"ImageBlock"});const gG=[cy,sc,LT,ly].flat();function km(e){return typeof e=="string"&&!!e.length&&Number.isNaN(Number(e))}function zq(e){const t=e.type==="html"?e:e.type==="paragraph"&&e.children?.length===1&&e.children[0]?.type==="html"?e.children[0]:null,n=/^<!-- myno-image-ratio:v1 ((?:0|[1-9]\d*)\.\d{2}) -->$/.exec(t?.value??"");if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0&&r!==1?r:null}function Wq(){return e=>{const t=n=>{(n.type==="image"||n.type==="image-block")&&n.title==null&&(n.title="");const r=n.children;if(r)for(let i=0;i<r.length-1;i+=1){const o=zq(r[i]),s=r[i+1],a=s.type==="image-block"?s:s.type==="paragraph"&&s.children?.length===1&&s.children[0]?.type==="image"?s.children[0]:null;o===null||!a||!km(a.alt)||(r.splice(i,2,{...a,type:"image-block",mynoImageRatio:o}),i-=1)}n.children?.forEach(t)};t(e)}}const jq=sc.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,alt:{default:null,validate:"string|null"}},parseMarkdown:{...n.parseMarkdown,runner:(r,i,o)=>{const s=km(i.alt)?i.alt:null;let a=Number(s===null?i.alt||1:i.mynoImageRatio??1);(Number.isNaN(a)||a===0)&&(a=1),r.addNode(o,{src:i.url,caption:i.title??"",ratio:a,alt:s})}},parseDOM:n.parseDOM?.map(r=>({...r,getAttrs:i=>{const o=r.getAttrs?.(i);return o===!1?!1:{...o,alt:km(i.getAttribute("alt"))?i.getAttribute("alt"):null}}})),toDOM:r=>{const{alt:i,...o}=r.attrs;return i===null?["img",{"data-type":"image-block",...o}]:["img",{"data-type":"image-block",...o,alt:i,title:o.caption,...o.ratio===1?{ratio:void 0}:{}}]},toMarkdown:{...n.toMarkdown,runner:(r,i)=>{if(i.attrs.alt===null)return n.toMarkdown.runner(r,i);const o=Number(i.attrs.ratio);if(!Number.isFinite(o)||o<=0)throw new RangeError("图片缩放比例必须为有限正数");const s=o.toFixed(2);if(!/^(?:0|[1-9]\d*)\.\d{2}$/.test(s)||Number(s)<=0)throw new RangeError("图片缩放比例无法保存为有效两位小数");s!=="1.00"&&r.addNode("html",void 0,`<!-- myno-image-ratio:v1 ${s} -->`),r.openNode("paragraph"),r.addNode("image",void 0,void 0,{title:i.attrs.caption,url:i.attrs.src,alt:i.attrs.alt}),r.closeNode()}}}}),AG=[bn("myno-image-titles",()=>Wq),sc,jq].flat();export{Pr as $,NM as A,Xq as B,tg as C,dt as D,tG as E,oe as F,Wl as G,Pn as H,mq as I,XD as J,LJ as K,ny as L,du as M,Te as N,VJ as O,An as P,qd as Q,Tt as R,ce as S,_e as T,Ut as U,pT as V,HV as W,wq as X,vC as Y,Re as Z,Ve as _,lG as a,xF as a$,Ks as a0,qq as a1,TN as a2,qe as a3,Ce as a4,ks as a5,rF as a6,ui as a7,ri as a8,mG as a9,dR as aA,eG as aB,rG as aC,ly as aD,gG as aE,Kq as aF,bn as aG,xt as aH,Rn as aI,Qq as aJ,dC as aK,MM as aL,Hq as aM,qo as aN,_r as aO,uv as aP,ys as aQ,hD as aR,UM as aS,uw as aT,vJ as aU,yF as aV,bF as aW,Go as aX,zl as aY,wF as aZ,jl as a_,MS as aa,RS as ab,IS as ac,ES as ad,NS as ae,_S as af,DS as ag,OS as ah,ht as ai,SS as aj,vS as ak,Ul as al,sr as am,Dh as an,qc as ao,Zq as ap,Bm as aq,$q as ar,Wn as as,UP as at,Fn as au,Ue as av,xs as aw,Vc as ax,Uo as ay,Nh as az,nG as b,Js as b0,Vs as b1,sc as b2,wS as b3,kF as b4,sg as b5,gF as b6,Ll as b7,ag as b8,rg as b9,Hs as ba,ig as bb,eA as bc,Hl as bd,tA as be,cg as bf,zi as bg,ug as bh,AF as bi,TK as bj,hG as bk,aG as bl,r4 as bm,kW as bn,iG as c,Eh as d,dG as e,pG as f,oG as g,sG as h,AG as i,Vi as j,FM as k,fr as l,zn as m,Oe as n,tt as o,Jc as p,Jt as q,Mh as r,pu as s,Yi as t,Yq as u,et as v,ME as w,bm as x,ni as y,Gq as z};