@akairos/myno 0.2.4 → 0.3.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 (66) hide show
  1. package/README.md +30 -0
  2. package/dist/.vite/manifest.json +74 -37
  3. package/dist/adapter.d.ts +20 -0
  4. package/dist/adapter.d.ts.map +1 -0
  5. package/dist/adapter.js +31 -0
  6. package/dist/adapter.js.map +1 -0
  7. package/dist/assets/index-B3KPjiNQ.js +13 -0
  8. package/dist/assets/index-B4oP0CAo.js +1 -0
  9. package/dist/assets/index-B7wgkGTY.js +1 -0
  10. package/dist/assets/index-BQQ1Mi1e.js +1 -0
  11. package/dist/assets/index-BQaqd7HV.js +1 -0
  12. package/dist/assets/index-BRMGrREe.js +7 -0
  13. package/dist/assets/index-BVejJ9GP.js +1 -0
  14. package/dist/assets/index-BXKhM-dq.js +1 -0
  15. package/dist/assets/index-BY_5QCeN.js +2 -0
  16. package/dist/assets/index-BYo4GXZ3.js +1 -0
  17. package/dist/assets/index-Bf_t_p3-.js +13 -0
  18. package/dist/assets/index-Bgyno-qy.js +1 -0
  19. package/dist/assets/index-BuwkzWC3.js +1 -0
  20. package/dist/assets/index-Bx5kysUB.js +6 -0
  21. package/dist/assets/index-BzdnLbE6.js +1 -0
  22. package/dist/assets/index-C3mqfS11.js +3 -0
  23. package/dist/assets/index-C77pdafO.js +1 -0
  24. package/dist/assets/index-C7nlezox.js +1 -0
  25. package/dist/assets/index-CQLZZT0S.js +1 -0
  26. package/dist/assets/index-CTr58p_e.js +1 -0
  27. package/dist/assets/index-CjIk2aLQ.js +1 -0
  28. package/dist/assets/index-Ct6xQ87_.js +1 -0
  29. package/dist/assets/index-Cvpfia2o.js +1 -0
  30. package/dist/assets/index-D33hrwhL.js +1 -0
  31. package/dist/assets/index-D55fsC0p.js +1 -0
  32. package/dist/assets/index-D5qCW0zl.js +1 -0
  33. package/dist/assets/index-DGkCtD3C.js +1 -0
  34. package/dist/assets/index-DIKlav_o.js +1 -0
  35. package/dist/assets/index-DJiXc9K-.js +1 -0
  36. package/dist/assets/index-DOi0-DWN.js +7 -0
  37. package/dist/assets/index-DkaQHRr_.js +2 -0
  38. package/dist/assets/index-Do3WF47E.js +1 -0
  39. package/dist/assets/index-Dz2Wwzwt.js +1 -0
  40. package/dist/assets/index-RBdLFvWq.js +1 -0
  41. package/dist/assets/index-YY02LYN-.js +6 -0
  42. package/dist/assets/index-dFTt0umM.js +1 -0
  43. package/dist/assets/index-iryVxUmP.js +1 -0
  44. package/dist/assets/index-m1bbMc0Z.js +1 -0
  45. package/dist/assets/index-mcj80rA1.js +3 -0
  46. package/dist/assets/index-qhRFP5Y0.js +1 -0
  47. package/dist/assets/index-z4iU21Ve.js +1 -0
  48. package/dist/assets/index-zXdbmld4.js +1 -0
  49. package/dist/assets/style-B23kjid6.css +1 -0
  50. package/dist/assets/style-C2UIbbzr.css +1 -0
  51. package/dist/assets/syntax-presets-B7ZlwXZx.js +1254 -0
  52. package/dist/assets/syntax-presets-Clw1Pr2j.js +1254 -0
  53. package/dist/editor-export.js +3 -0
  54. package/dist/src/studio/studio.html +8 -7
  55. package/dist/studio/editor-export.d.ts +22 -0
  56. package/dist/studio/editor-export.d.ts.map +1 -0
  57. package/dist/studio/editor-export.js +42 -0
  58. package/dist/studio/editor-export.js.map +1 -0
  59. package/dist/studio/studio-config.d.ts +32 -0
  60. package/dist/studio/studio-config.d.ts.map +1 -0
  61. package/dist/studio/studio-config.js +70 -0
  62. package/dist/studio/studio-config.js.map +1 -0
  63. package/dist/studio/studio.js +55 -35
  64. package/dist/studio/studio.js.map +1 -1
  65. package/dist/studio.js +107 -1353
  66. package/package.json +6 -1
@@ -0,0 +1,1254 @@
1
+ var Dd=t=>{throw TypeError(t)};var Od=(t,e,n)=>e.has(t)||Dd("Cannot "+n);var se=(t,e,n)=>(Od(t,e,"read from private field"),n?n.call(t):e.get(t)),je=(t,e,n)=>e.has(t)?Dd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Te=(t,e,n,r)=>(Od(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var wt=(function(t){return t.docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t.aiProviderError="aiProviderError",t.aiBuildContextError="aiBuildContextError",t})({}),kt=class extends Error{constructor(t,e,n){super(e,n),this.name="MilkdownError",this.code=t,n?.cause!==void 0&&(this.cause=n.cause)}},O1=(t,e)=>typeof e=="function"?"[Function]":e,rs=t=>JSON.stringify(t,O1);function M1(t){return new kt(wt.docTypeError,`Doc type error, unsupported type: ${rs(t)}`)}function B1(t){return new kt(wt.contextNotFound,`Context "${t}" not found, do you forget to inject it?`)}function F1(t){return new kt(wt.timerNotFound,`Timer "${t}" not found, do you forget to record it?`)}function Za(){return new kt(wt.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function _1(t,e,n){const r=`Cannot create node for ${"name"in t?t.name:t}`,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]",e],["[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 kt(wt.createNodeInParserFail,o.join(`
2
+ `))}function HA(){return new kt(wt.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function P1(t){return new kt(wt.parserMatchError,`Cannot match target parser for node: ${rs(t)}.`)}function L1(t){return new kt(wt.serializerMatchError,`Cannot match target serializer for node: ${rs(t)}.`)}function z1(t,e){return new kt(wt.getAtomFromSchemaFail,`Cannot get ${t}: ${e} from schema.`)}function mn(t){return new kt(wt.expectDomTypeError,`Expect to be a dom, but get: ${rs(t)}.`)}function Il(){return new kt(wt.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 W1(t){return new kt(wt.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${t}" in schema.`)}function j1(t){return new kt(wt.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${t}" in schema.`)}function qA(t){try{return rs(t)}catch{return"[Unserializable]"}}function OL(t){const e=t instanceof Error?t.message:qA(t);return new kt(wt.aiProviderError,`AI provider error: ${e}`,{cause:t})}function ML(t){const e=t instanceof Error?t.message:qA(t);return new kt(wt.aiBuildContextError,`AI buildContext failed: ${e}`,{cause:t})}var UA=class{constructor(){this.sliceMap=new Map,this.get=t=>{const e=typeof t=="string"?[...this.sliceMap.values()].find(n=>n.type.name===t):this.sliceMap.get(t.id);if(!e){const n=typeof t=="string"?t:t.name;throw B1(n)}return e},this.remove=t=>{const e=typeof t=="string"?[...this.sliceMap.values()].find(n=>n.type.name===t):this.sliceMap.get(t.id);e&&this.sliceMap.delete(e.type.id)},this.has=t=>typeof t=="string"?[...this.sliceMap.values()].some(e=>e.type.name===t):this.sliceMap.has(t.id)}},K1=class{#t;#e;#r;constructor(e,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,e.set(r.id,this)}on(e){return this.#t.push(e),()=>{this.#t=this.#t.filter(n=>n!==e)}}once(e){const n=this.on(r=>{e(r),n()});return n}off(e){this.#t=this.#t.filter(n=>n!==e)}offAll(){this.#t=[]}},J1=class{constructor(t,e){this.id=Symbol(`Context-${e}`),this.name=e,this._defaultValue=t,this._typeInfo=()=>{throw Za()}}create(t,e=this._defaultValue){return new K1(t,e,this)}},ge=(t,e)=>new J1(t,e),Q1=class{#t;#e;#r;#n;#o;#s;#i;constructor(t,e,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=t,this.#r=e,this.#t=n}#a;#l},H1=class GA{#t;#e;#r;#n;constructor(e,n,r){this.produce=i=>i&&Object.keys(i).length?new GA(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=e,this.#e=n,this.#r=r,r&&(this.#n=new Q1(e,n,r))}get meta(){return this.#r}get inspector(){return this.#n}},q1=class{constructor(){this.store=new Map,this.get=t=>{const e=this.store.get(t.id);if(!e)throw F1(t.name);return e},this.remove=t=>{this.store.delete(t.id)},this.has=t=>this.store.has(t.id)}},U1=class{#t;#e;#r;#n;#o;constructor(t,e){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(e.name),this.type=e,t.set(e.id,this)}get status(){return this.#n}#s;#i},G1=class{constructor(t,e=3e3){this.create=n=>new U1(n,this),this.id=Symbol(`Timer-${t}`),this.name=t,this.timeout=e}},gn=(t,e=3e3)=>new G1(t,e);const Y1={};function pf(t,e){const n=Y1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return YA(t,r,i)}function YA(t,e,n){if(V1(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Md(t.children,e,n)}return Array.isArray(t)?Md(t,e,n):""}function Md(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=YA(t[i],e,n);return r.join("")}function V1(t){return!!(t&&typeof t=="object")}const Bd=document.createElement("i");function mf(t){const e="&"+t+";";Bd.innerHTML=e;const n=Bd.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Nt(t,e,n,r){const i=t.length;let o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Qt(t,e){return t.length>0?(Nt(t,t.length,0,e),t):e}const Fd={}.hasOwnProperty;function VA(t){const e={};let n=-1;for(;++n<t.length;)Z1(e,t[n]);return e}function Z1(t,e){let n;for(n in e){const i=(Fd.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let s;if(o)for(s in o){Fd.call(i,s)||(i[s]=[]);const a=o[s];$1(i[s],Array.isArray(a)?a:a?[a]:[])}}}function $1(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Nt(t,0,0,r)}function ZA(t,e){const n=Number.parseInt(t,e);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 tn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=gr(/[A-Za-z]/),gt=gr(/[\dA-Za-z]/),X1=gr(/[#-'*+\--9=?A-Z^-~]/);function Aa(t){return t!==null&&(t<32||t===127)}const cu=gr(/\d/),ex=gr(/[\dA-Fa-f]/),$A=gr(/[!-/:-@[-`{-~]/);function te(t){return t!==null&&t<-2}function Ne(t){return t!==null&&(t<0||t===32)}function de(t){return t===-2||t===-1||t===32}const $a=gr(new RegExp("\\p{P}|\\p{S}","u")),Yr=gr(/\s/);function gr(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function ke(t,e,n,r){const i=r?r-1:1/0;let o=0;return s;function s(l){return de(l)?(t.enter(n),a(l)):e(l)}function a(l){return de(l)&&o++<i?(t.consume(l),a):(t.exit(n),e(l))}}function XA(t,e,n,r,i,o){let s=0;return a;function a(u){return de(u)?(t.enter(r),l(u)):c(u)}function l(u){return de(u)&&s<o?(t.consume(u),s++,l):(t.exit(r),c(u))}function c(u){return s>=i?e(u):n(u)}}const tx={tokenize:nx};function nx(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ke(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return te(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}let ya=class{constructor(){this.index=new Map,this.map=[]}add(e,n,r){_d(this,e,n,r,!1)}addBefore(e,n,r){_d(this,e,n,r,!0)}consume(e){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(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const o of i)e.push(o);i=r.pop()}this.map.length=0,this.index.clear()}};function _d(t,e,n,r,i){if(n===0&&r.length===0)return;const o=t.index.get(e);if(o){o[1]+=n,i?(r.push(...o[2]),o[2]=r):o[2].push(...r);return}const s=[e,n,r];t.map.push(s),t.index.set(e,s)}const rx={tokenize:ix},Pd={tokenize:ox};function ix(t){const e=this,n=[];let r=0,i,o,s;return a;function a(y){if(r<n.length){const b=n[r];return e.containerState=b[1],t.attempt(b[0].continuation,l,c)(y)}return c(y)}function l(y){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&x();const b=e.events.length;let C=b,w;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){w=e.events[C][1].end;break}A(r);let v=b;for(;v<e.events.length;)e.events[v][1].end={...w},v++;const T=new ya;return T.add(C+1,0,e.events.slice(b)),T.add(b,v-b,[]),T.consume(e.events),c(y)}return a(y)}function c(y){if(r===n.length){if(!i)return d(y);if(i.currentConstruct&&i.currentConstruct.concrete)return p(y);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Pd,u,f)(y)}function u(y){return i&&x(),A(r),d(y)}function f(y){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,p(y)}function d(y){return e.containerState={},t.attempt(Pd,h,p)(y)}function h(y){return r++,n.push([e.currentConstruct,e.containerState]),d(y)}function p(y){if(y===null){i&&x(),A(0),t.consume(y);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(y)}function m(y){if(y===null){g(t.exit("chunkFlow"),!0),A(0),t.consume(y);return}return te(y)?(t.consume(y),g(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(y),m)}function g(y,b){const C=e.sliceStream(y);if(b&&C.push(null),y.previous=o,o&&(o.next=y),o=y,i.defineSkip(y.start),i.write(C),e.parser.lazy[y.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=e.events.length;let T=v,R,S;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(R){S=e.events[T][1].end;break}R=!0}for(A(r),w=v;w<e.events.length;)e.events[w][1].end={...S},w++;const M=new ya;M.add(T+1,0,e.events.slice(v)),M.add(v,w-v,[]),M.consume(e.events)}}function A(y){let b=n.length;for(;b-- >y;){const C=n[b];e.containerState=C[1],C[0].exit.call(e,t)}n.length=y}function x(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function ox(t,e,n){return ke(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ut(t){if(t===null||Ne(t)||Yr(t))return 1;if($a(t))return 2}function is(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const uu={name:"attention",resolveAll:sx,tokenize:ax};function sx(t,e){let n=-1,r;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){let i=n;for(;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;const o=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1,s={...t[i][1].end},a={...t[n][1].start};Ld(s,-o),Ld(a,o);const l={type:o>1?"strongSequence":"emphasisSequence",start:s,end:{...t[i][1].end}},c={type:o>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:a},u={type:o>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},f={type:o>1?"strong":"emphasis",start:{...l.start},end:{...c.end}};t[i][1].end={...l.start},t[n][1].start={...c.end},r=[],t[i][1].end.offset-t[i][1].start.offset&&(r=Qt(r,[["enter",t[i][1],e],["exit",t[i][1],e]])),r=Qt(r,[["enter",f,e],["enter",l,e],["exit",l,e],["enter",u,e]]),r=Qt(r,is(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),r=Qt(r,[["exit",u,e],["enter",c,e],["exit",c,e],["exit",f,e]]);let d=0;t[n][1].end.offset-t[n][1].start.offset&&(d=2,r=Qt(r,[["enter",t[n][1],e],["exit",t[n][1],e]])),Nt(t,i-1,n-i+3,r),n=i+r.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function ax(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ut(r);let o;return s;function s(l){return o=l,t.enter("attentionSequence"),a(l)}function a(l){if(l===o)return t.consume(l),a;const c=t.exit("attentionSequence"),u=Ut(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)),e(l)}}function Ld(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const lx={name:"autolink",tokenize:cx};function cx(t,e,n){let r=0;return i;function i(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(h){return ot(h)?(t.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||gt(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||gt(h))&&r++<32?(t.consume(h),a):(r=0,c(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Aa(h)?n(h):(t.consume(h),l)}function c(h){return h===64?(t.consume(h),u):X1(h)?(t.consume(h),c):n(h)}function u(h){return gt(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,u):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):d(h)}function d(h){if((h===45||gt(h))&&r++<63){const p=h===45?d:f;return t.consume(h),p}return n(h)}}const ss={partial:!0,tokenize:ux};function ux(t,e,n){return r;function r(o){return de(o)?ke(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||te(o)?e(o):n(o)}}const ey={continuation:{tokenize:hx},exit:dx,name:"blockQuote",tokenize:fx};function fx(t,e,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return n(s)}function o(s){return de(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function hx(t,e,n){const r=this;return i;function i(s){return de(s)?ke(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(ey,e,n)(s)}}function dx(t){t.exit("blockQuote")}const ty={name:"characterEscape",tokenize:px};function px(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return $A(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const ny={name:"characterReference",tokenize:mx};function mx(t,e,n){const r=this;let i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),o=31,s=gt,u(f))}function c(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=ex,u):(t.enter("characterReferenceValue"),o=7,s=cu,u(f))}function u(f){if(f===59&&i){const d=t.exit("characterReferenceValue");return s===gt&&!mf(r.sliceSerialize(d))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),u):n(f)}}const fu={partial:!0,tokenize:gx};function gx(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const zd={concrete:!0,name:"codeFenced",tokenize:Ax};function Ax(t,e,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,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===a?(s++,t.consume(w),u):s<3?n(w):(t.exit("codeFencedFenceSequence"),de(w)?ke(t,f,"whitespace")(w):f(w))}function f(w){return w===null||te(w)?(t.exit("codeFencedFence"),r.interrupt?e(w):t.check(fu,m,b)(w)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||te(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(w)):de(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ke(t,h,"whitespace")(w)):w===96&&w===a?n(w):(t.consume(w),d)}function h(w){return w===null||te(w)?f(w):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||te(w)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(w)):w===96&&w===a?n(w):(t.consume(w),p)}function m(w){return t.attempt(i,b,g)(w)}function g(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),A}function A(w){return o>0&&de(w)?ke(t,x,"linePrefix",o+1)(w):x(w)}function x(w){return w===null||te(w)?t.check(fu,m,b)(w):(t.enter("codeFlowValue"),y(w))}function y(w){return w===null||te(w)?(t.exit("codeFlowValue"),x(w)):(t.consume(w),y)}function b(w){return t.exit("codeFenced"),e(w)}function C(w,v,T){let R=0;return S;function S(D){return w.enter("lineEnding"),w.consume(D),w.exit("lineEnding"),M}function M(D){return w.enter("codeFencedFence"),de(D)?ke(w,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):z(D)}function z(D){return D===a?(w.enter("codeFencedFenceSequence"),W(D)):T(D)}function W(D){return D===a?(R++,w.consume(D),W):R>=s?(w.exit("codeFencedFenceSequence"),de(D)?ke(w,L,"whitespace")(D):L(D)):T(D)}function L(D){return D===null||te(D)?(w.exit("codeFencedFence"),v(D)):T(D)}}}const El={name:"codeIndented",tokenize:bx},yx={partial:!0,tokenize:wx};function bx(t,e,n){return r;function r(a){return t.enter("codeIndented"),XA(t,i,n,"linePrefix",4,4)(a)}function i(a){return a===null?s(a):te(a)?t.attempt(yx,i,s)(a):(t.enter("codeFlowValue"),o(a))}function o(a){return a===null||te(a)?(t.exit("codeFlowValue"),i(a)):(t.consume(a),o)}function s(a){return t.exit("codeIndented"),e(a)}}function wx(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):te(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):XA(t,e,o,"linePrefix",4,4)(s)}function o(s){return te(s)?i(s):n(s)}}const kx={name:"codeText",previous:Cx,resolve:xx,tokenize:vx};function xx(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Cx(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vx(t,e,n){let r=0,i,o;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),a(f)}function a(f){return f===96?(t.consume(f),r++,a):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(o=t.enter("codeTextSequence"),i=0,u(f)):te(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||te(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),c)}function u(f){return f===96?(t.consume(f),i++,u):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(o.type="codeTextData",c(f))}}class Sx{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Xi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Xi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Xi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Xi(this.left,n.reverse())}}}function Xi(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function ry(t){const e={};let n=-1,r,i,o,s,a,l,c;const u=new Sx(t);for(;++n<u.length;){for(;n in e;)n=e[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(e,Ix(u,n)),n=e[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 Nt(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Ix(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-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(;t.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]),t.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 Ex={resolve:Nx,tokenize:Tx},Rx={partial:!0,tokenize:Dx};function Nx(t){return ry(t),t}function Tx(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):te(a)?t.check(Rx,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Dx(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ke(t,o,"linePrefix")}function o(s){if(s===null||te(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?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function iy(t,e,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(A){return A===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(A),t.exit(o),d):A===null||A===32||A===41||Aa(A)?n(A):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),m(A))}function d(A){return A===62?(t.enter(o),t.consume(A),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===62?(t.exit("chunkString"),t.exit(a),d(A)):A===null||A===60||te(A)?n(A):(t.consume(A),A===92?p:h)}function p(A){return A===60||A===62||A===92?(t.consume(A),h):h(A)}function m(A){return!u&&(A===null||A===41||Ne(A))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(A)):u<c&&A===40?(t.consume(A),u++,m):A===41?(t.consume(A),u--,m):A===null||A===32||A===40||Aa(A)?n(A):(t.consume(A),A===92?g:m)}function g(A){return A===40||A===41||A===92?(t.consume(A),m):m(A)}}function oy(t,e,n,r,i,o){const s=this;let a=0,l;return c;function c(h){return t.enter(r),t.enter(i),t.consume(h),t.exit(i),t.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?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):te(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||te(h)||a++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!de(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function sy(t,e,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),l(s)):d===null?n(d):te(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),ke(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||te(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(t.consume(d),u):u(d)}}function uo(t,e){let n;return r;function r(i){return te(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):de(i)?ke(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Ox={name:"definition",tokenize:Bx},Mx={partial:!0,tokenize:Fx};function Bx(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),s(h)}function s(h){return oy.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return Ne(h)?uo(t,c)(h):c(h)}function c(h){return iy(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(Mx,f,f)(h)}function f(h){return de(h)?ke(t,d,"whitespace")(h):d(h)}function d(h){return h===null||te(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function Fx(t,e,n){return r;function r(a){return Ne(a)?uo(t,i)(a):n(a)}function i(a){return sy(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return de(a)?ke(t,s,"whitespace")(a):s(a)}function s(a){return a===null||te(a)?e(a):n(a)}}const _x={name:"hardBreakEscape",tokenize:Px};function Px(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return te(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Lx={name:"headingAtx",resolve:zx,tokenize:Wx};function zx(t,e){let n=t.length-2,r=3;if(t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"};Nt(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])}return t}function Wx(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||Ne(u)?(t.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||te(u)?(t.exit("atxHeading"),e(u)):de(u)?ke(t,a,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Ne(u)?(t.exit("atxHeadingText"),a(u)):(t.consume(u),c)}}const ay=["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"],hu=["pre","script","style","textarea"],jx={concrete:!0,name:"htmlFlow",resolveTo:Jx,tokenize:Qx},Kx={partial:!0,tokenize:Hx};function Jx(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Qx(t,e,n){const r=this;let i,o,s,a,l;return c;function c(k){return u(k)}function u(k){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(k),f}function f(k){return k===33?(t.consume(k),d):k===47?(t.consume(k),o=!0,m):k===63?(t.consume(k),i=3,r.interrupt?e:I):ot(k)?(t.consume(k),s=String.fromCharCode(k),g):n(k)}function d(k){return k===45?(t.consume(k),i=2,h):k===91?(t.consume(k),i=5,a=0,p):ot(k)?(t.consume(k),i=4,r.interrupt?e:I):n(k)}function h(k){return k===45?(t.consume(k),r.interrupt?e:I):n(k)}function p(k){const F="CDATA[";return k===F.charCodeAt(a++)?(t.consume(k),a===F.length?r.interrupt?e:z:p):n(k)}function m(k){return ot(k)?(t.consume(k),s=String.fromCharCode(k),g):n(k)}function g(k){if(k===null||k===47||k===62||Ne(k)){const F=k===47,N=s.toLowerCase();return!F&&!o&&hu.includes(N)?(i=1,r.interrupt?e(k):z(k)):ay.includes(s.toLowerCase())?(i=6,F?(t.consume(k),A):r.interrupt?e(k):z(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):o?x(k):y(k))}return k===45||gt(k)?(t.consume(k),s+=String.fromCharCode(k),g):n(k)}function A(k){return k===62?(t.consume(k),r.interrupt?e:z):n(k)}function x(k){return de(k)?(t.consume(k),x):S(k)}function y(k){return k===47?(t.consume(k),S):k===58||k===95||ot(k)?(t.consume(k),b):de(k)?(t.consume(k),y):S(k)}function b(k){return k===45||k===46||k===58||k===95||gt(k)?(t.consume(k),b):C(k)}function C(k){return k===61?(t.consume(k),w):de(k)?(t.consume(k),C):y(k)}function w(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),l=k,v):de(k)?(t.consume(k),w):T(k)}function v(k){return k===l?(t.consume(k),l=null,R):k===null||te(k)?n(k):(t.consume(k),v)}function T(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Ne(k)?C(k):(t.consume(k),T)}function R(k){return k===47||k===62||de(k)?y(k):n(k)}function S(k){return k===62?(t.consume(k),M):n(k)}function M(k){return k===null||te(k)?z(k):de(k)?(t.consume(k),M):n(k)}function z(k){return k===45&&i===2?(t.consume(k),Z):k===60&&i===1?(t.consume(k),q):k===62&&i===4?(t.consume(k),_):k===63&&i===3?(t.consume(k),I):k===93&&i===5?(t.consume(k),Ce):te(k)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Kx,E,W)(k)):k===null||te(k)?(t.exit("htmlFlowData"),W(k)):(t.consume(k),z)}function W(k){return t.check(fu,L,E)(k)}function L(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),D}function D(k){return k===null||te(k)?W(k):(t.enter("htmlFlowData"),z(k))}function Z(k){return k===45?(t.consume(k),I):z(k)}function q(k){return k===47?(t.consume(k),s="",ne):z(k)}function ne(k){if(k===62){const F=s.toLowerCase();return hu.includes(F)?(t.consume(k),_):z(k)}return ot(k)&&s.length<8?(t.consume(k),s+=String.fromCharCode(k),ne):z(k)}function Ce(k){return k===93?(t.consume(k),I):z(k)}function I(k){return k===62?(t.consume(k),_):k===45&&i===2?(t.consume(k),I):z(k)}function _(k){return k===null||te(k)?(t.exit("htmlFlowData"),E(k)):(t.consume(k),_)}function E(k){return t.exit("htmlFlow"),e(k)}}function Hx(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(ss,e,n)}}const qx={name:"htmlText",tokenize:Ux};function Ux(t,e,n){const r=this;let i,o,s;return a;function a(I){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(I),l}function l(I){return I===33?(t.consume(I),c):I===47?(t.consume(I),C):I===63?(t.consume(I),y):ot(I)?(t.consume(I),T):n(I)}function c(I){return I===45?(t.consume(I),u):I===91?(t.consume(I),o=0,p):ot(I)?(t.consume(I),x):n(I)}function u(I){return I===45?(t.consume(I),h):n(I)}function f(I){return I===null?n(I):I===45?(t.consume(I),d):te(I)?(s=f,q(I)):(t.consume(I),f)}function d(I){return I===45?(t.consume(I),h):f(I)}function h(I){return I===62?Z(I):I===45?d(I):f(I)}function p(I){const _="CDATA[";return I===_.charCodeAt(o++)?(t.consume(I),o===_.length?m:p):n(I)}function m(I){return I===null?n(I):I===93?(t.consume(I),g):te(I)?(s=m,q(I)):(t.consume(I),m)}function g(I){return I===93?(t.consume(I),A):m(I)}function A(I){return I===62?Z(I):I===93?(t.consume(I),A):m(I)}function x(I){return I===null||I===62?Z(I):te(I)?(s=x,q(I)):(t.consume(I),x)}function y(I){return I===null?n(I):I===63?(t.consume(I),b):te(I)?(s=y,q(I)):(t.consume(I),y)}function b(I){return I===62?Z(I):y(I)}function C(I){return ot(I)?(t.consume(I),w):n(I)}function w(I){return I===45||gt(I)?(t.consume(I),w):v(I)}function v(I){return te(I)?(s=v,q(I)):de(I)?(t.consume(I),v):Z(I)}function T(I){return I===45||gt(I)?(t.consume(I),T):I===47||I===62||Ne(I)?R(I):n(I)}function R(I){return I===47?(t.consume(I),Z):I===58||I===95||ot(I)?(t.consume(I),S):te(I)?(s=R,q(I)):de(I)?(t.consume(I),R):Z(I)}function S(I){return I===45||I===46||I===58||I===95||gt(I)?(t.consume(I),S):M(I)}function M(I){return I===61?(t.consume(I),z):te(I)?(s=M,q(I)):de(I)?(t.consume(I),M):R(I)}function z(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),i=I,W):te(I)?(s=z,q(I)):de(I)?(t.consume(I),z):(t.consume(I),L)}function W(I){return I===i?(t.consume(I),i=void 0,D):I===null?n(I):te(I)?(s=W,q(I)):(t.consume(I),W)}function L(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ne(I)?R(I):(t.consume(I),L)}function D(I){return I===47||I===62||Ne(I)?R(I):n(I)}function Z(I){return I===62?(t.consume(I),t.exit("htmlTextData"),t.exit("htmlText"),e):n(I)}function q(I){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),ne}function ne(I){return de(I)?ke(t,Ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Ce(I)}function Ce(I){return t.enter("htmlTextData"),s(I)}}const gf={name:"labelEnd",resolveAll:Zx,resolveTo:$x,tokenize:Xx},Gx={tokenize:eC},Yx={tokenize:tC},Vx={tokenize:nC};function Zx(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Nt(t,0,t.length,n),t}function $x(t,e){let n=t.length,r=0,i,o,s;for(;n--;){const u=t[n][1];if(i){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;t[n][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(o){if(t[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:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[i][1].start},end:{...t[o][1].end}},c={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[o-2][1].start}};return s=[["enter",a,e],["enter",l,e]],s=Qt(s,t.slice(i+1,i+r+3)),s=Qt(s,[["enter",c,e]]),s=Qt(s,is(e.parser.constructs.insideSpan.null,t.slice(i+r+4,o-3),e)),s=Qt(s,[["exit",c,e],t[o-2],t[o-1],["exit",l,e]]),s=Qt(s,t.slice(o+1)),s=Qt(s,[["exit",a,e]]),Nt(t,i,t.length,s),t}function Xx(t,e,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(tn(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):n(d)}function l(d){return d===40?t.attempt(Gx,u,s?u:f)(d):d===91?t.attempt(Yx,u,s?c:f)(d):s?u(d):f(d)}function c(d){return t.attempt(Vx,u,f)(d)}function u(d){return i.pop(),e(d)}function f(d){return o._balanced=!0,n(d)}}function eC(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return Ne(f)?uo(t,o)(f):o(f)}function o(f){return f===41?u(f):iy(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Ne(f)?uo(t,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?sy(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Ne(f)?uo(t,u)(f):u(f)}function u(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function tC(t,e,n){const r=this;return i;function i(a){return oy.call(r,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function s(a){return n(a)}}function nC(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const rC={name:"labelStartImage",resolveAll:gf.resolveAll,tokenize:iC};function iC(t,e,n){const r=this;let i;return o;function o(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),s}function s(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),i=t.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),e(l))}}const oC={name:"labelStartLink",resolveAll:gf.resolveAll,tokenize:sC};function sC(t,e,n){const r=this;let i;return o;function o(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),i=t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),e(a))}}const Rl={name:"lineEnding",tokenize:aC};function aC(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),ke(t,e,"linePrefix")}}const ta={name:"thematicBreak",tokenize:lC};function lC(t,e,n){let r=0,i;return o;function o(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(t.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||te(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),de(c)?ke(t,a,"whitespace")(c):a(c))}}const Et={continuation:{tokenize:hC},exit:pC,name:"list",tokenize:fC},cC={partial:!0,tokenize:mC},uC={partial:!0,tokenize:dC};function fC(t,e,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:cu(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(ta,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return cu(h)&&++s<10?(t.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(ss,r.interrupt?n:u,t.attempt(cC,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return de(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function hC(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(ss,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!de(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(uC,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(t,t.attempt(Et,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function dC(t,e,n){const r=this;return ke(t,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?e(o):n(o)}}function pC(t){t.exit(this.containerState.type)}function mC(t,e,n){const r=this;return ke(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!de(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Wd={name:"setextUnderline",resolveTo:gC,tokenize:AC};function gC(t,e){const n=new ya;let r=t.length,i,o,s;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){i=r;break}t[r][1].type==="paragraph"&&(o=r)}else t[r][1].type==="content"&&n.add(r,1,[]),!s&&t[r][1].type==="definition"&&(s=r);const a={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",s?(n.add(o,0,[["enter",a,e]]),n.add(s+1,0,[["exit",t[i][1],e]]),t[i][1].end={...t[s][1].end}):t[i][1]=a,n.add(t.length,0,[["exit",a,e]]),n.consume(t),t}function AC(t,e,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)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),de(c)?ke(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||te(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const yC={tokenize:bC};function bC(t){const e=this,n=t.attempt(ss,r,t.attempt(this.parser.constructs.flowInitial,i,ke(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Ex,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const wC={resolveAll:cy()},kC=ly("string"),xC=ly("text");function ly(t){return{resolveAll:cy(t==="text"?CC:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],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 cy(t){return e;function e(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 t?t(n,r):n}}function CC(t,e){const n=new ya;let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){const i=t[r-1][1],o=e.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(e._contentTypeTextTrailing&&r===t.length&&(l=0),l){const u={type:r===t.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,e],["exit",u,e]])}r++}return n.consume(t),t}const vC={42:Et,43:Et,45:Et,48:Et,49:Et,50:Et,51:Et,52:Et,53:Et,54:Et,55:Et,56:Et,57:Et,62:ey},SC={91:Ox},IC={[-2]:El,[-1]:El,32:El},EC={35:Lx,42:ta,45:[Wd,ta],60:jx,61:Wd,95:ta,96:zd,126:zd},RC={38:ny,92:ty},NC={[-5]:Rl,[-4]:Rl,[-3]:Rl,33:rC,38:ny,42:uu,60:[lx,qx],91:oC,92:[_x,ty],93:gf,95:uu,96:kx},TC={null:[uu,wC]},DC={null:[42,95]},OC={null:[]},MC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:DC,contentInitial:SC,disable:OC,document:vC,flow:EC,flowInitial:IC,insideSpan:TC,string:RC,text:NC},Symbol.toStringTag,{value:"Module"}));function BC(t,e,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:y,exit:b,interrupt:v(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:t,previous:null,sliceSerialize:d,sliceStream:h,write:f};let u=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function f(M){return s=Qt(s,M),g(),s[s.length-1]!==null?[]:(T(e,0),c.events=is(o,c.events,c),c.events)}function d(M,z){return _C(h(M),z)}function h(M){return FC(s,M)}function p(){const{_bufferIndex:M,_index:z,line:W,column:L,offset:D}=r;return{_bufferIndex:M,_index:z,line:W,column:L,offset:D}}function m(M){i[M.line]=M.column,S()}function g(){for(;r._index<s.length;){const M=s[r._index];if(typeof M=="string"){const z=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<M.length;)A(M.charCodeAt(r._bufferIndex))}else A(M)}}function A(M){u=u(M)}function x(M){te(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,S()):M!==-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=M}function y(M,z){const W=z||{};return W.type=M,W.start=p(),c.events.push(["enter",W,c]),a.push(W),W}function b(M){const z=a.pop();return z.end=p(),c.events.push(["exit",z,c]),z}function C(M,z){T(M,z.from)}function w(M,z){z.restore()}function v(M,z){return W;function W(L,D,Z){let q,ne,Ce,I;return Array.isArray(L)?E(L):"tokenize"in L?E([L]):_(L);function _(K){return Y;function Y(U){const H=U!==null&&K[U],re=U!==null&&K.null,V=[...Array.isArray(H)?H:H?[H]:[],...Array.isArray(re)?re:re?[re]:[]];return E(V)(U)}}function E(K){return q=K,ne=0,K.length===0?Z:k(K[ne])}function k(K){return Y;function Y(U){return I=R(),Ce=K,K.partial||(c.currentConstruct=K),K.name&&c.parser.constructs.disable.null.includes(K.name)?N():K.tokenize.call(z?Object.assign(Object.create(c),z):c,l,F,N)(U)}}function F(K){return M(Ce,I),D}function N(K){return I.restore(),++ne<q.length?k(q[ne]):Z}}}function T(M,z){M.resolveAll&&!o.includes(M)&&o.push(M),M.resolve&&Nt(c.events,z,c.events.length-z,M.resolve(c.events.slice(z),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function R(){const M=p(),z=c.previous,W=c.currentConstruct,L=c.events.length,D=Array.from(a);return{from:L,restore:Z};function Z(){r=M,c.previous=z,c.currentConstruct=W,c.events.length=L,a=D,S()}}function S(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function FC(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,o)];else{if(s=t.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function _C(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[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=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function PC(t){const r={constructs:VA([MC,...(t||{}).extensions||[]]),content:i(tx),defined:[],document:i(rx),flow:i(yC),lazy:{},string:i(kC),text:i(xC)};return r;function i(o){return s;function s(a){return BC(r,o,a)}}}function LC(t){for(;!ry(t););return t}const jd=/[\0\t\n\r]/g;function zC(){let t=1,e="",n=!0,r;return i;function i(o,s,a){o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o));const l=[];let c=0;for(e="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){jd.lastIndex=c;const u=jd.exec(o),f=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(f);if(!u){e=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)),t+=f-c),d){case 0:{l.push(65533),t++;break}case 9:{const h=Math.ceil(t/4)*4;for(l.push(-2);t++<h;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}c=f+1}return a&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const WC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uy(t){return t.replace(WC,jC)}function jC(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return ZA(n.slice(o?2:1),o?16:10)}return mf(n)||t}function fo(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Kd(t.position):"start"in t||"end"in t?Kd(t):"line"in t||"column"in t?du(t):""}function du(t){return Jd(t&&t.line)+":"+Jd(t&&t.column)}function Kd(t){return du(t&&t.start)+"-"+du(t&&t.end)}function Jd(t){return t&&typeof t=="number"?t:1}const fy={}.hasOwnProperty;function KC(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),JC(n)(LC(PC(n).document().write(zC()(t,e,!0))))}function JC(t){const e={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(an),autolinkProtocol:S,autolinkEmail:S,atxHeading:s(Ke),blockQuote:s(V),characterEscape:S,characterReference:S,codeFenced:s(G),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(G,a),codeText:s(Ae,a),codeTextData:S,data:S,codeFlowValue:S,definition:s($e),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(tt),hardBreakEscape:s(Pe),hardBreakTrailing:s(Pe),htmlFlow:s(We,a),htmlFlowData:S,htmlText:s(We,a),htmlTextData:S,image:s(vt),label:a,link:s(an),listItem:s(Sr),listItemValue:h,listOrdered:s(Vt,d),listUnordered:s(Vt),paragraph:s(Ir),reference:F,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ke),strong:s(Gi),thematicBreak:s(ai)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:re,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:Y,characterReference:U,codeFenced:c(A),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:M,codeIndented:c(x),codeText:c(Z),codeTextData:M,data:M,definition:c(),definitionDestinationString:C,definitionLabelString:y,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(W),hardBreakTrailing:c(W),htmlFlow:c(L),htmlFlowData:M,htmlText:c(D),htmlTextData:M,image:c(ne),label:I,labelText:Ce,lineEnding:z,link:c(q),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:N,resourceDestinationString:_,resourceTitleString:E,resource:k,setextHeading:c(R),setextHeadingLineSequence:T,setextHeadingText:v,strong:c(),thematicBreak:c()}};hy(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(O){let J={type:"root",children:[],position:void 0};const le={stack:[J],tokenStack:[],config:e,enter:l,exit:u,buffer:a,resume:f,data:n},he=[],St=[];let Me=-1;for(;++Me<O.length;)if(St.push(O[Me]),O[Me][1].type==="listOrdered"||O[Me][1].type==="listUnordered")if(O[Me][0]==="enter")he.push(St.length-1);else{const It=he.pop();o(St,It)}for(O=St,Me=-1;++Me<O.length;){const It=e[O[Me][0]];O[Me][0]==="enter"&&e.beforeEnter.length>0&&i(e.beforeEnter,{...le,sliceSerialize:O[Me][2].sliceSerialize},O[Me][1]),fy.call(It,O[Me][1].type)&&It[O[Me][1].type].call({...le,sliceSerialize:O[Me][2].sliceSerialize},O[Me][1]),O[Me][0]==="exit"&&e.afterExit.length>0&&i(e.afterExit,{...le,sliceSerialize:O[Me][2].sliceSerialize},O[Me][1])}if(le.tokenStack.length>0){const It=le.tokenStack[le.tokenStack.length-1];(It[1]||Qd).call(le,void 0,It[0])}for(J.position={start:Wn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:Wn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<e.transforms.length;)J=e.transforms[Me](J)||J;return J}function i(O,J,le){let he=-1;for(;++he<O.length;)O[he].call(J,le)}function o(O,J){const le=O.length-1;let he=J-1,St=-1,Me=!1,It,ln,Vi,Zi;const $i=[];for(;++he<=le;){const Mt=O[he];switch(Mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mt[0]==="enter"?St++:St--,Zi=void 0;break}case"lineEndingBlank":{Mt[0]==="enter"&&(It&&!Zi&&!St&&!Vi&&(Vi=he),Zi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zi=void 0}if(!St&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||St===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(It){let li=he;for(ln=void 0;li--;){const yn=O[li];if(yn[1].type==="lineEnding"||yn[1].type==="lineEndingBlank"){if(yn[0]==="exit")continue;ln&&(O[ln][1].type="lineEndingBlank",Me=!0),yn[1].type="lineEnding",ln=li}else if(!(yn[1].type==="linePrefix"||yn[1].type==="blockQuotePrefix"||yn[1].type==="blockQuotePrefixWhitespace"||yn[1].type==="blockQuoteMarker"||yn[1].type==="listItemIndent"))break}Vi&&(!ln||Vi<ln)&&(It._spread=!0),It.end=Object.assign({},ln?O[ln][1].start:Mt[1].end),$i.push({at:ln||he,event:["exit",It,Mt[2]]})}if(Mt[1].type==="listItemPrefix"){const li={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0};It=li,$i.push({at:he,event:["enter",li,Mt[2]]}),Vi=void 0,Zi=!0}}}const Td=O.splice(J);let Sl=0;for(he=-1;++he<Td.length;){for(;Sl<$i.length&&$i[Sl].at===J+he;)O.push($i[Sl++].event);O.push(Td[he])}O[J][1]._spread=Me}function s(O,J){return le;function le(he){l.call(this,O(he),he),J&&J.call(this,he)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(O,J,le){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([J,le||void 0]),O.position={start:Wn(J.start),end:void 0}}function c(O){return J;function J(le){O&&O.call(this,le),u.call(this,le)}}function u(O,J){const le=this.stack.pop(),he=this.tokenStack.pop();if(!he)throw new Error("Cannot close `"+O.type+"` ("+fo({start:O.start,end:O.end})+"): it’s not open");he[0].type!==O.type&&(J?J.call(this,O,he[0]):(he[1]||Qd).call(this,O,he[0])),le.position.end=Wn(O.end)}function f(){return pf(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(O){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),J=this.stack[this.stack.length-1];J.lang=O}function m(){const O=this.resume(),J=this.stack[this.stack.length-1];J.meta=O}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const O=this.resume(),J=this.stack[this.stack.length-1];J.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const O=this.resume(),J=this.stack[this.stack.length-1];J.value=O.replace(/(\r?\n|\r)$/g,"")}function y(O){const J=this.resume(),le=this.stack[this.stack.length-1];le.label=J,le.identifier=tn(this.sliceSerialize(O)).toLowerCase()}function b(){const O=this.resume(),J=this.stack[this.stack.length-1];J.title=O}function C(){const O=this.resume(),J=this.stack[this.stack.length-1];J.url=O}function w(O){const J=this.stack[this.stack.length-1];if(!J.depth){const le=this.sliceSerialize(O).length;J.depth=le}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function T(O){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function S(O){const le=this.stack[this.stack.length-1].children;let he=le[le.length-1];(!he||he.type!=="text")&&(he=Yi(),he.position={start:Wn(O.start),end:void 0},le.push(he)),this.stack.push(he)}function M(O){const J=this.stack.pop();J.value+=this.sliceSerialize(O),J.position.end=Wn(O.end)}function z(O){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=J.children[J.children.length-1];le.position.end=Wn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(J.type)&&(S.call(this,O),M.call(this,O))}function W(){this.data.atHardBreak=!0}function L(){const O=this.resume(),J=this.stack[this.stack.length-1];J.value=O}function D(){const O=this.resume(),J=this.stack[this.stack.length-1];J.value=O}function Z(){const O=this.resume(),J=this.stack[this.stack.length-1];J.value=O}function q(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=J,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ne(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=J,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function Ce(O){const J=this.sliceSerialize(O),le=this.stack[this.stack.length-2];le.label=uy(J),le.identifier=tn(J).toLowerCase()}function I(){const O=this.stack[this.stack.length-1],J=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const he=O.children;le.children=he}else le.alt=J}function _(){const O=this.resume(),J=this.stack[this.stack.length-1];J.url=O}function E(){const O=this.resume(),J=this.stack[this.stack.length-1];J.title=O}function k(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function N(O){const J=this.resume(),le=this.stack[this.stack.length-1];le.label=J,le.identifier=tn(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function K(O){this.data.characterReferenceType=O.type}function Y(O){const J=this.sliceSerialize(O),le=this.data.characterReferenceType;let he;le?(he=ZA(J,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=mf(J);const St=this.stack[this.stack.length-1];St.value+=he}function U(O){const J=this.stack.pop();J.position.end=Wn(O.end)}function H(O){M.call(this,O);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(O)}function re(O){M.call(this,O);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(O)}function V(){return{type:"blockquote",children:[],position:void 0}}function G(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ae(){return{type:"inlineCode",value:"",position:void 0}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function tt(){return{type:"emphasis",children:[],position:void 0}}function Ke(){return{type:"heading",depth:0,children:[],position:void 0}}function Pe(){return{type:"break",position:void 0}}function We(){return{type:"html",value:"",position:void 0}}function vt(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function an(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Vt(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[],position:void 0}}function Sr(O){return{type:"listItem",spread:O._spread,checked:null,children:[],position:void 0}}function Ir(){return{type:"paragraph",children:[],position:void 0}}function Gi(){return{type:"strong",children:[],position:void 0}}function Yi(){return{type:"text",value:"",position:void 0}}function ai(){return{type:"thematicBreak",position:void 0}}}function Wn(t){return{line:t.line,column:t.column,offset:t.offset}}function hy(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?hy(t,r):QC(t,r)}}function QC(t,e){let n;for(n in e)if(fy.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=e[n];r&&t[n].push(r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function Qd(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+fo({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+fo({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+fo({start:e.start,end:e.end})+") is still open")}function pu(t){const e=this;e.parser=n;function n(r){return KC(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const Xa=(function(t){if(t==null)return GC;if(typeof t=="function")return el(t);if(typeof t=="object")return Array.isArray(t)?HC(t):qC(t);if(typeof t=="string")return UC(t);throw new Error("Expected function, string, or object as test")});function HC(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Xa(t[n]);return el(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function qC(t){const e=t;return el(n);function n(r){const i=r;let o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function UC(t){return el(e);function e(n){return n&&n.type===t}}function el(t){return e;function e(n,r,i){return!!(YC(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function GC(){return!0}function YC(t){return t!==null&&typeof t=="object"&&"type"in t}const dy=Xa(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]),Hd={}.hasOwnProperty;function VC(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Hd.call(i,t)){const l=String(i[t]);s=Hd.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 ZC={}.hasOwnProperty;function py(t,e){let n=-1,r;if(e.extensions)for(;++n<e.extensions.length;)py(t,e.extensions[n]);for(r in e)if(ZC.call(e,r))switch(r){case"extensions":break;case"unsafe":{qd(t[r],e[r]);break}case"join":{qd(t[r],e[r]);break}case"handlers":{$C(t[r],e[r]);break}default:t.options[r]=e[r]}return t}function qd(t,e){e&&t.push(...e)}function $C(t,e){e&&Object.assign(t,e)}function XC(t,e,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(t,o.current()),ev);return i(),s}function ev(t,e,n){return">"+(n?"":" ")+t}function my(t,e){return Ud(t,e.inConstruct,!0)&&!Ud(t,e.notInConstruct,!1)}function Ud(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Gd(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;){const o=n.unsafe[i];if(o.character===`
5
+ `&&!o.before&&!o.after&&my(n.stack,o))return/[\t ]/.test(r.before)?"":" "}return`\\
6
+ `}function tv(t,e){const n=String(t);let r=n.indexOf(e),i=r,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+e.length,r=n.indexOf(e,i);return s}function mu(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^\n\r ]/.test(t.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(t.value))}function nv(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function rv(t,e,n,r){const i=nv(n),o=t.value||"";if(mu(t,n)){const f=n.enter("codeIndented"),d=n.indentLines(o,iv);return f(),d}const s=n.createTracker(r),a=i.repeat(Math.max(tv(o,i)+1,3)),l=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let u=s.move(a);if(t.lang){const f=n.enter(`codeFencedLang${c}`);u+=s.move(n.safe(t.lang,{before:u,after:" ",encode:["`"],...s.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${c}`);u+=s.move(" "),u+=s.move(n.safe(t.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 iv(t,e,n){return(n?"":" ")+t}function Af(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function ov(t,e,n,r){const i=Af(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(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":`
10
+ `,...l.current()}))),a(),t.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(t.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c}function sv(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}yf.attention=av;yf.peek=lv;function yf(t,e,n,r){const i=n.enter("phrasing"),o=n.containerPhrasing({type:"root",children:[t]},r);return i(),o}function av(t,e){return{construct:"emphasis",markers:sv(e)==="*"?["*","_"]:["_","*"],sizes:[1]}}function lv(t,e,n){return n.options.emphasis||"*"}function bf(t){return"&#x"+t.toString(16).toUpperCase()+";"}const gy=[],cv=!0,gu=!1,ba="skip";function wf(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const o=Xa(i),s=r?-1:1;a(t,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=gy,p,m,g;if((!e||o(l,c,u[u.length-1]||void 0))&&(h=uv(n(l,u)),h[0]===gu))return h;if("children"in l&&l.children){const A=l;if(A.children&&h[0]!==ba)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]===gu)return p;m=typeof p[1]=="number"?p[1]:m+s}}return h}}}function uv(t){return Array.isArray(t)?t:typeof t=="number"?[cv,t]:t==null?gy:[t]}function Pi(t,e,n,r){let i,o,s;typeof e=="function"&&typeof n!="function"?(o=void 0,s=e,i=n):(o=e,s=n,i=r),wf(t,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 Ay(t,e){let n=!1;return Pi(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,gu}),!!((!t.depth||t.depth<3)&&pf(t)&&(e.options.setext||n))}function fv(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),o=n.createTracker(r);if(Ay(t,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(t,{...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(t,{before:"# ",after:`
15
+ `,...o.current()});const u=c.charCodeAt(0);return(u===9||u===32)&&(c=bf(u)+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c}yy.peek=hv;function yy(t){return t.value||""}function hv(){return"<"}by.peek=dv;function by(t,e,n,r){const i=Af(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(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(t.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),s(),c}function dv(){return"!"}wy.peek=pv;function wy(t,e,n,r){const i=t.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(t.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(t),{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 pv(){return"!"}ky.peek=mv;function ky(t,e,n){let r=t.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 mv(){return"`"}function xy(t,e){const n=pf(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][+\-.a-z]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Cy.peek=gv;function Cy(t,e,n,r){const i=Af(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);if(xy(t,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(t,{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(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(t.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function gv(t,e,n){return xy(t,n)?"<":"["}vy.peek=Av;function vy(t,e,n,r){const i=t.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(t,{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(t),{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 Av(){return"["}function kf(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function yv(t){const e=kf(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bv(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Sy(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function wv(t,e,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=t.ordered?bv(n):kf(n);const a=t.ordered?s==="."?")":".":yv(n);let l=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.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),Sy(n)===s&&u){let f=-1;for(;++f<t.children.length;){const d=t.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(t,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function kv(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function xv(t,e,n,r){const i=kv(n);let o=n.bulletCurrent||kf(n);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.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(t,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 Cv(t,e,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(t,r);return o(),i(),s}function vv(t,e,n,r){if(!t.children.some(function(a){return dy(a)}))return n.containerFlow(t,r);const o=n.enter("phrasing"),s=n.containerPhrasing(t,r);return o(),s}function Sv(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}xf.attention=Iv;xf.peek=Ev;function xf(t,e,n,r){const i=n.enter("phrasing"),o=n.containerPhrasing({type:"root",children:[t]},r);return i(),o}function Iv(t,e){return{construct:"strong",markers:Sv(e)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Ev(t,e,n){return n.options.strong||"*"}function Rv(t,e,n,r){const i=e?e.children:[],o=i.indexOf(t);return n.safe(t.value,{...r,afterNode:i[o+1],beforeNode:i[o-1]})}function Nv(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Tv(t,e,n){const r=(Sy(n)+(n.options.ruleSpaces?" ":"")).repeat(Nv(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Cf={blockquote:XC,break:Gd,code:rv,definition:ov,emphasis:yf,hardBreak:Gd,heading:fv,html:yy,image:by,imageReference:wy,inlineCode:ky,link:Cy,linkReference:vy,list:wv,listItem:xv,paragraph:Cv,root:vv,strong:xf,text:Rv,thematicBreak:Tv};function Au(t){if(t.charCodeAt(0)!==60)return;const e=t.charCodeAt(1);if(e===33){const a=t.charCodeAt(2);return a===45?2:a===91?5:ot(a)?4:void 0}if(e===63)return 3;const n=e===47,r=n?2:1;let i=r,o=t.charCodeAt(i);if(!ot(o))return;for(;o===45||gt(o);)o=t.charCodeAt(++i);const s=t.slice(r,i).toLowerCase();return!n&&o!==47&&hu.includes(s)?1:ay.includes(s)?6:7}const Dv=[Ov];function Ov(t,e,n,r){if(e.type==="code"&&mu(e,r)&&(t.type==="list"||t.type===e.type&&mu(t,r)))return!1;if("spread"in n&&typeof n.spread=="boolean"){if(t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&Ay(e,r)))return;if(t.type==="html"){const i=Au(t.value);if(i===void 0||i===6||i===7)return 1}if(t.type==="paragraph"&&e.type==="html"){const i=Au(e.value);if(i===void 0||i===7)return 1}return n.spread?1:0}}const Er=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Iy=[{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:Er},{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:Er},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
20
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Er},{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:Er},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Er},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Er},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Er},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"",inConstruct:"autolink"}];let Yd=-1;for(;++Yd<33;)Iy.push({character:String.fromCharCode(Yd),inConstruct:"autolink"});function Mv(t){return t.label||!t.identifier?t.label||"":uy(t.identifier)}function Bv(t){if(!t._compiled){const e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((t.beforeNode?"^":e?"("+e+")":"")+(/[$()*+.?[\\\]^{|}]/.test(t.character)?"\\":"")+t.character+(t.afterNode?"$":t.after?"(?:"+t.after+")":""),t.unicode?"gu":"g")}return t._compiled}function wa(t){const e=t.codePointAt(0);return e===void 0?"":String.fromCodePoint(e)}function ho(t){const e=t.codePointAt(t.length-2);return e!==void 0&&e>65535?t.slice(-2):t.slice(-1)}function Vd(t,e,n){const r=Ut(t),i=Ut(e);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 Fv=new Map([["*",!1],["_",!0]]);function _v(t,e,n){const r=new Set;for(const o of t){const s=n.get(o);if(s&&o.attention&&e.some(a=>a.attention===o.attention))for(const a of s.tokens)r.add(a.attention)}const i=[];for(const o of t)o.attention&&r.delete(o.attention)&&i.push(o.attention);return i.reverse(),i}function Ey(t,e,n){const r=[],i=new Map,o=new Map;let s=0;for(;s<t.length;){if(!t[s].attention){s++;continue}const a=t[s].value.charAt(0),l=Fv.get(a);let c=s+1;for(;c<t.length&&t[c].attention&&t[c].value.charAt(0)===a;)c++;const u=s?t[s-1].value:e,f=Ut(u.charCodeAt(u.length-1)),d=Ut((c<t.length?t[c].value:n).charCodeAt(0)),h=!d||d===2&&!!f,p=!f||f===2&&!!d,m={tokens:t.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(zv(r,i),s=-1;++s<t.length;){const a=i.get(t[s]);if(a)return{attention:_v(t,a,o),index:s}}}function Pv(t,e,n){return yu(Ry(t,e,n),n.before,n.after)}function Os(t,e){const n=t[e?0:t.length-1];if(!n||n.attention)return;const r=e?wa(n.value):ho(n.value),i=bf(r.codePointAt(0));n.value=e?i+n.value.slice(r.length):n.value.slice(0,n.value.length-r.length)+i}function Lv(t,e,n,r,i){for(const o of n.attention){const s=e.get(o)||o.sequences[0];for(const a of o.sequences){if(a===s)continue;const l=new Map(e);l.set(o,a);const c=vf(t,l,r,i),u=Ey(c,r,i);if(!u||u.index>n.index)return{chosen:l,mistake:u,tokens:c}}}}function zv(t,e){let n=0;for(;n<t.length;){const r=t[n],i=r.tokens[0].value.charAt(0),o=r.end-r.start;let s=r.close&&o?n:0;for(;s--;){const a=t[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)e.delete(d),e.delete(h);else{const p=[...new Set([...u,...f])];for(const m of p){const g=e.get(m);g&&g.push(...p)}}a.end-=c,r.start+=c;break}}(s===-1||r.start===r.end)&&n++}}function Wv(t,e,n){if(e.length===0)throw new Error("Cannot serialize `"+t+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+t+"` 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 `"+t+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of e){if(i.length!==1)throw new Error("Cannot serialize `"+t+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!$A(i.charCodeAt(0)))throw new Error("Cannot serialize `"+t+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const o of n)r.push(i.repeat(o))}return r}function Ry(t,e,n){const r=e.indexStack,i=t.children||[],o=[];let s=-1,a=n.before;r.push(-1);let l=e.createTracker(n);for(;++s<i.length;){const c=i[s];let u;if(r[r.length-1]=s,s+1<i.length){let h=e.handle.handlers[i[s+1].type];h&&h.peek&&(h=h.peek),u=h?wa(h(i[s+1],t,e,{before:"",after:"",...l.current()})):""}else u=n.after;const f=o[o.length-1];typeof f=="string"&&(a==="\r"||a===`
24
+ `)&&c.type==="html"&&Au(c.value)!==7&&(o[o.length-1]=f.replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(n),l.move(yu(o,n.before,n.after)));const d=e.handle.handlers[c.type];if(d&&d.attention){const{construct:h,markers:p,sizes:m}=d.attention(c,e),g=Wv(c.type,p,m),A=g[0],x=e.enter(h);l.move(A);const y=Ry(c,e,{...l.current(),before:A,after:A});l.move(yu(y,A,A)),l.move(A),x(),o.push({children:y,sequences:g}),a=A.charAt(A.length-1)}else{const h=e.handle(c,t,e,{...l.current(),after:u,before:a});if(!h)continue;l.move(h),o.push(h),a=ho(h)}}return r.pop(),o}function vf(t,e,n,r){const i=[];let o,s=ho(n),a=-1;for(;++a<t.length;){const l=t[a];if(typeof l=="string"){const y={value:l,attention:void 0};o&&o===wa(l)&&Os([y],!0),o=void 0,i.push(y),y.value&&(s=ho(y.value));continue}const c=e.get(l)||l.sequences[0],u=c.charAt(0),f=t[a+1],d=s,h=wa(f===void 0?r:typeof f=="string"?f:e.get(f)||f.sequences[0]),p=vf(l.children,e,c,c),m=p.length>0?p[0].value:"",g=Vd(d.charCodeAt(d.length-1),m.charCodeAt(0),u);g.inside&&Os(p,!0);const A=p.length>0?ho(p[p.length-1].value):"",x=Vd(h.charCodeAt(0),A.charCodeAt(A.length-1),u);x.inside&&Os(p,!1),g.outside&&d!==`
25
+ `&&d!=="\r"&&Os(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 yu(t,e,n){let r=new Map;const i=vf(t,r,e,n);let o=i,s=Ey(o,e,n);for(;s;){const l=Lv(t,r,s,e,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 jv(t,e,n){const r=e.indexStack,i=t.children||[],o=e.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(e.handle(l,t,e,{before:`
26
+ `,after:`
27
+ `,...o.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(Kv(l,i[a+1],t,e)))}return r.pop(),s.join("")}function Kv(t,e,n,r){let i=r.join.length;for(;i--;){const o=r.join[i](t,e,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 Jv=/\r?\n|\r/g;function Qv(t,e){const n=[];let r=0,i=0,o;for(;o=Jv.exec(t);)s(t.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(t.slice(r)),n.join("");function s(a){n.push(e(a,i,!a))}}const Nl={}.hasOwnProperty;function Hv(t,e,n){const r=(n.before||"")+(e||"")+(n.after||""),i=[],o=[],s={},a=t.stack.includes("autolink"),l=n.before?n.before.length:0,c=r.length-(n.after?n.after.length:0);let u=-1;for(;++u<t.unsafe.length;){const h=t.unsafe[u];if(!my(t.stack,h)||!Zd(h.beforeNode,n.beforeNode)||!Zd(h.afterNode,n.afterNode))continue;const p=t.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,y="after"in h,b=m+A.index+(x?A[1].length:0);Nl.call(s,b)?(s[b].before&&!x&&(s[b].before=!1),s[b].after&&!y&&(s[b].after=!1)):(i.push(b),s[b]={before:x,after:y})}}i.sort(qv);let f=l;for(u=-1;++u<i.length;){const h=i[u];if(!(h<f||h>=c)){if(r.charAt(h)==="_"&&h>0&&Ut(r.charCodeAt(h-1))===void 0&&!Nl.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&&Ut(r.charCodeAt(p))===void 0&&!Nl.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:$d(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(bf(r.charCodeAt(h))),f++)}}}const d=r.slice(f,c);return o.push(a?d:$d(d,n.after)),o.join("")}function Zd(t,e){return t?e?typeof t=="string"?t===e.type:t.includes(e.type):!1:!0}function qv(t,e){return t-e}function $d(t,e){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=t+e;let s=-1,a=0,l;for(;l=n.exec(o);)r.push(l.index);for(;++s<r.length;)a!==r[s]&&i.push(t.slice(a,r[s])),i.push("\\"),a=r[s];return i.push(t.slice(a)),i.join("")}function Uv(t){const e=t||{},n=e.now||{};let r=e.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 Gv(t,e){const n=e||{},r={associationId:Mv,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:$v,containerFlow:Xv,createTracker:Uv,compilePattern:Bv,enter:o,handlers:{...Cf},handle:void 0,indentLines:Qv,indexStack:[],join:[...Dv],options:{},safe:eS,stack:[],unsafe:[...Iy]};py(r,n),r.options.tightDefinitions&&r.join.push(Zv),r.handle=VC("type",{invalid:Yv,unknown:Vv,handlers:r.handlers});let i=r.handle(dy(t)?{type:"root",children:[t]}:t,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 Yv(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function Vv(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function Zv(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function $v(t,e){return Pv(t,this,e)}function Xv(t,e){return jv(t,this,e)}function eS(t,e){return Hv(this,t,e)}function bu(t){const e=this;e.compiler=n;function n(r){return Gv(r,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function Xd(t){if(t)throw t}var ep=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function as(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function tS(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Tl,tp;function nS(){if(tp)return Tl;tp=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},o=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=t.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var d;for(d in c);return typeof d>"u"||t.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(t.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Tl=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},Tl}var rS=nS();const Dl=as(rS);function _L(){}function wu(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function iS(){const t=[],e={run:n,use:r};return e;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=t[++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?oS(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 t.push(i),e}}function oS(t,e){let n;return r;function r(...s){const a=t.length>s.length;let l;a&&s.push(i);try{l=t.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,e(s,...a))}function o(s){i(null,s)}}class Dt extends Error{constructor(e,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 e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!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=fo(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}}Dt.prototype.file="";Dt.prototype.name="";Dt.prototype.reason="";Dt.prototype.message="";Dt.prototype.stack="";Dt.prototype.column=void 0;Dt.prototype.line=void 0;Dt.prototype.ancestors=void 0;Dt.prototype.cause=void 0;Dt.prototype.fatal=void 0;Dt.prototype.place=void 0;Dt.prototype.ruleId=void 0;Dt.prototype.source=void 0;const cn={basename:sS,dirname:aS,extname:lS,join:cS,sep:"/"};function sS(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ls(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function aS(t){if(ls(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function lS(t){ls(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function cS(...t){let e=-1,n;for(;++e<t.length;)ls(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":uS(n)}function uS(t){ls(t);const e=t.codePointAt(0)===47;let n=fS(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function fS(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s<t.length)a=t.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}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ls(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const hS={cwd:dS};function dS(){return"/"}function ku(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function pS(t){if(typeof t=="string")t=new URL(t);else if(!ku(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return mS(t)}function mS(t){if(t.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 e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.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(e)}const Ol=["history","path","basename","stem","extname","dirname"];class gS{constructor(e){let n;e?ku(e)?n={path:e}:typeof e=="string"||AS(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":hS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ol.length;){const o=Ol[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)Ol.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?cn.basename(this.path):void 0}set basename(e){Bl(e,"basename"),Ml(e,"basename"),this.path=cn.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?cn.dirname(this.path):void 0}set dirname(e){np(this.basename,"dirname"),this.path=cn.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?cn.extname(this.path):void 0}set extname(e){if(Ml(e,"extname"),np(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=cn.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ku(e)&&(e=pS(e)),Bl(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?cn.basename(this.path,this.extname):void 0}set stem(e){Bl(e,"stem"),Ml(e,"stem"),this.path=cn.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Dt(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ml(t,e){if(t&&t.includes(cn.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+cn.sep+"`")}function Bl(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function np(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function AS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const yS=(function(t){const r=this.constructor.prototype,i=r[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),bS={}.hasOwnProperty;class Sf extends yS{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=iS()}copy(){const e=new Sf;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Dl(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Pl("data",this.frozen),this.namespace[e]=n,this):bS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Pl("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=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(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Ms(e),r=this.parser||this.Parser;return Fl("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Fl("process",this.parser||this.Parser),_l("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Ms(e),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);kS(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(e){let n=!1,r;return this.freeze(),Fl("processSync",this.parser||this.Parser),_l("processSync",this.compiler||this.Compiler),this.process(e,i),ip("processSync","process",n),r;function i(o,s){n=!0,Xd(o),r=s}}run(e,n,r){rp(e),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=Ms(n);i.run(e,l,c);function c(u,f,d){const h=f||e;u?a(u):s?s(h):r(void 0,h,d)}}}runSync(e,n){let r=!1,i;return this.run(e,n,o),ip("runSync","run",r),i;function o(s,a){Xd(s),i=a,r=!0}}stringify(e,n){this.freeze();const r=Ms(n),i=this.compiler||this.Compiler;return _l("stringify",i),rp(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Pl("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");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=Dl(!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];wu(m)&&wu(h)&&(h=Dl(!0,m,h)),r[d]=[c,h,...p]}}}}const xu=new Sf().freeze();function Fl(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function _l(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Pl(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rp(t){if(!wu(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function ip(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Ms(t){return wS(t)?t:new gS(t)}function wS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function kS(t){return typeof t=="string"||xS(t)}function xS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function nt(t){this.content=t}nt.prototype={constructor:nt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new nt(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new nt(n)},addToStart:function(t,e){return new nt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new nt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new nt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=nt.from(t),t.size?new nt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=nt.from(t),t.size?new nt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=nt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};nt.from=function(t){if(t instanceof nt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new nt(e)};function Ny(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.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&&Oy(s.charCodeAt(l-1))&&Dy(s.charCodeAt(l))&&n--,n}if(i.content.size||o.content.size){let s=Ny(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ty(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.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&&Oy(c.charCodeAt(f-1))&&Dy(c.charCodeAt(f))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let c=Ty(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function Dy(t){return t>=56320&&t<57344}function Oy(t){return t>=55296&&t<56320}class P{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,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>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,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(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.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<e.content.length;o++)i.push(e.content[o]);return new P(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new P(r,i)}cutByIndex(e,n){return e==n?P.empty:e==0&&n==this.content.length?this:new P(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new P(i,o)}addToStart(e){return new P([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new P(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Ny(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ty(this,e,n,r)}findIndex(e){if(e==0)return Bs(0,e);if(e==this.size)return Bs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?Bs(n+1,o):Bs(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return P.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return P.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return P.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new P(n||e,r)}static from(e){if(!e)return P.empty;if(e instanceof P)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new P([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}P.empty=new P([],0);const Ll={index:0,offset:0};function Bs(t,e){return Ll.index=t,Ll.offset=e,Ll}function ka(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ka(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ka(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class we{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ka(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.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(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return we.none;if(e instanceof we)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}we.none=[];class Eo extends Error{}class Q{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=By(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new Q(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Q(My(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Q.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 Q(P.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Q(e,r,i)}}Q.empty=new Q(P.empty,0,0);function My(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(My(o.content,e-i-1,n-i-1)))}function By(t,e,n,r,i,o){let{index:s,offset:a}=t.findIndex(e),l=t.maybeChild(s);if(a==e||l.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=By(l.content,e-a-1,n,s==0?r-1:0,s==t.childCount-1?i-1:0,l);return c&&t.replaceChild(s,l.copy(c))}function CS(t,e,n){if(n.openStart>t.depth)throw new Eo("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Eo("Inconsistent open depths");return Fy(t,e,n,0)}function Fy(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Fy(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Wr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=vS(n,t);return Wr(o,Py(t,s,a,e,r))}else return Wr(o,xa(t,e,r))}function _y(t,e){if(!e.type.compatibleContent(t.type))throw new Eo("Cannot join "+e.type.name+" onto "+t.type.name)}function Cu(t,e,n){let r=t.node(n);return _y(r,e.node(n)),r}function zr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function po(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(zr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)zr(i.child(a),r);e&&e.depth==n&&e.textOffset&&zr(e.nodeBefore,r)}function Wr(t,e){if(!t.type.validContent(e))throw new Eo("Invalid content for node "+t.type.name);return t.copy(e)}function Py(t,e,n,r,i){let o=t.depth>i&&Cu(t,e,i+1),s=r.depth>i&&Cu(n,r,i+1),a=[];return po(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(_y(o,s),zr(Wr(o,Py(t,e,n,r,i+1)),a)):(o&&zr(Wr(o,xa(t,e,i+1)),a),po(e,n,i,a),s&&zr(Wr(s,xa(n,r,i+1)),a)),po(r,null,i,a),new P(a)}function xa(t,e,n){let r=[];if(po(null,t,n,r),t.depth>n){let i=Cu(t,e,n+1);zr(Wr(i,xa(t,e,n+1)),r)}return po(e,null,n,r),new P(r)}function vS(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(P.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ro{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,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<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return we.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.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(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.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(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ly(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){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 Ro(n,r,o)}static resolveCached(e,n){let r=op.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else op.set(e,r=new SS);let i=r.elts[r.i]=Ro.resolve(e,n);return r.i=(r.i+1)%IS,i}}class SS{constructor(){this.elts=[],this.i=0}}const IS=12,op=new WeakMap;class Ly{constructor(e,n,r){this.$from=e,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 ES=Object.create(null);let Rn=class vu{constructor(e,n,r,i=we.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||P.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ka(this.attrs,n||e.defaultAttrs||ES)&&we.sameSet(this.marks,r||we.none)}copy(e=null){return e==this.content?this:new vu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vu(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Q.empty;let i=this.resolve(e),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 Q(c,i.depth-s,o.depth-s)}replace(e,n,r){return CS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)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(e){return Ro.resolveCached(this,e)}resolveNoCache(e){return Ro.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),zy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=P.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).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(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),sp(this.type.attrs,this.attrs,"node",this.type.name);let e=we.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];sp(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!we.sameSet(e,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 e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,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(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=P.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};Rn.prototype.text=void 0;class Ca extends Rn{constructor(e,n,r,i){if(super(e,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):zy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ca(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ca(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function zy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}function sp(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}class Vr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new RS(e,n);if(r.next==null)return Vr.empty;let i=Wy(r);r.next&&r.err("Unexpected trailing text");let o=FS(BS(i));return _S(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return P.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(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){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(e)){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(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
38
+ `)}}Vr.empty=new Vr(!0);class RS{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Wy(t){let e=[];do e.push(NS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function NS(t){let e=[];do e.push(TS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function TS(t){let e=MS(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=DS(t,e);else break;return e}function ap(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function DS(t,e){let n=ap(t),r=n;return t.eat(",")&&(t.next!="}"?r=ap(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function OS(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function MS(t){if(t.eat("(")){let e=Wy(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=OS(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function BS(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[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 jy(t,e){return e-t}function lp(t,e){let n=[];return r(e),n.sort(jy);function r(i){let o=t[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 FS(t){let e=Object.create(null);return n(lp(t,0));function n(r){let i=[];r.forEach(s=>{t[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]);lp(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new Vr(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(jy);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function _S(t,e){for(let n=0,r=[t];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&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ky(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Jy(t,e){let n=Object.create(null);for(let r in t){let i=t[r],o=e&&e[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 Qy(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new LS(t,r,e[r]);return n}let va=class Hy{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Qy(e,r.attrs),this.defaultAttrs=Ky(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Vr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Jy(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Rn(this,this.computeAttrs(e),P.from(n),we.setFrom(r))}createChecked(e=null,n,r){return n=P.from(n),this.checkContent(n),new Rn(this,this.computeAttrs(e),n,we.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=P.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(P.empty,!0);return o?new Rn(this,e,n.append(o),we.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:we.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Hy(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 PS(t,e,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 ${e} on type ${t}, got ${o}`)}}class LS{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?PS(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class tl{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Qy(e,i.attrs),this.excluded=null;let o=Ky(this.attrs);this.instance=o?new we(this,o):null}create(e=null){return!e&&this.instance?this.instance:new we(this,Jy(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new tl(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class zS{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=nt.from(e.nodes),n.marks=nt.from(e.marks||{}),this.nodes=va.compile(this.spec.nodes,this),this.marks=tl.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]=Vr.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?cp(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==""?[]:cp(this,s.split(" "))}this.nodeFromJSON=i=>Rn.fromJSON(this,i),this.markFromJSON=i=>we.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof va){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Ca(r,r.defaultAttrs,e,we.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function cp(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.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: '"+e[r]+"'")}return n}function WS(t){return t.tag!=null}function jS(t){return t.style!=null}let If=class Su{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(WS(i))this.tags.push(i);else if(jS(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=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new fp(this,n,!1);return r.addAll(e,we.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new fp(this,n,!0);return r.addAll(e,we.none,n.from,n.to),Q.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(QS(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,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(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){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 e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=hp(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=hp(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Su(e,Su.schemaRules(e)))}};const qy={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},KS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uy={ol:!0,ul:!0},No=1,Iu=2,mo=4;function up(t,e,n){return e!=null?(e?No:0)|(e==="full"?Iu:0):t&&t.whitespace=="pre"?No|Iu:n&~mo}class Fs{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=we.none,this.match=o||(s&mo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(P.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&No)){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=P.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class fp{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=up(null,n.preserveWhitespace,0)|(r?mo:0);i?o=new Fs(i.type,i.attrs,we.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Fs(null,null,we.none,!0,null,s):o=new Fs(e.schema.topNodeType,null,we.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&Iu?"full":this.localPreserveWS||(i.options&No)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \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=e.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(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Uy.hasOwnProperty(s)&&this.parser.normalizeLists&&JS(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:KS.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(qy.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(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
40
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.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(e,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,e.nodeName=="BR")||this.leafFallback(e,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(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);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(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=we.none;for(let a of i.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):dp(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=up(e,o,s.options);s.options&mo&&s.content.length==0&&(a|=mo);let l=we.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):dp(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Fs(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!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(e));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(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=No)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.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 e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.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 JS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Uy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function QS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function hp(t){let e={};for(let n in t)e[n]=t[n];return e}function dp(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))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==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Ar{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=_s(n).createDocumentFragment());let i=r,o=[];return e.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(e,n){if(e.isText)return _s(n).createTextNode(e.text);let{dom:r,contentDOM:i}=na(_s(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&na(_s(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:na(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ar(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=pp(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return pp(e.marks)}}function pp(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function _s(t){return t.document||window.document}const mp=new WeakMap;function HS(t){let e=mp.get(t);return e===void 0&&mp.set(t,e=qS(t)),e}function qS(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.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(t),e}function na(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=HS(r))&&o.indexOf(e)>-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?t.createElementNS(n,i):t.createElement(i),c=e[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<e.length;f++){let d=e[f];if(d===0){if(f<e.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(t.createTextNode(d));else{let{dom:h,contentDOM:p}=na(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Gy=65535,Yy=Math.pow(2,16);function US(t,e){return t+e*Yy}function gp(t){return t&Gy}function GS(t){return(t-(t&Gy))/Yy}const Vy=1,Zy=2,ra=4,$y=8;class Eu{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$y)>0}get deletedBefore(){return(this.delInfo&(Vy|ra))>0}get deletedAfter(){return(this.delInfo&(Zy|ra))>0}get deletedAcross(){return(this.delInfo&ra)>0}}class Bt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Bt.empty)return Bt.empty}recover(e){let n=0,r=gp(e);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+GS(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,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>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(e<=f){let d=c?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:u);if(r)return h;let p=e==(n<0?l:f)?null:US(a/3,e-l),m=0;return c&&(m|=e==l?Zy:e==f?Vy:ra,(n<0?e!=l:e!=f)&&(m|=$y)),new Eu(h,m,p)}i+=u-c}return r?e+i:new Eu(e+i,0,null)}touches(e,n){let r=0,i=gp(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>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){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];e(a,a+c,l,l+u),o+=u-c}}invert(){return new Bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Bt.empty:new Bt(e<0?[0,-e,0]:[0,0,e])}}Bt.empty=new Bt([]);class Sa{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Sa(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Sa;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Eu(e,i,null)}}const zl=Object.create(null);class ht{getMap(){return Bt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zl[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in zl)throw new RangeError("Duplicate use of step JSON ID "+e);return zl[e]=n,n.prototype.jsonID=e,n}}class Ye{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ye(e,null)}static fail(e){return new Ye(null,e)}static fromReplace(e,n,r,i){try{return Ye.ok(e.replace(n,r,i))}catch(o){if(o instanceof Eo)return Ye.fail(o.message);throw o}}}function Ef(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Ef(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return P.fromArray(r)}class Sn extends ht{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new Q(Ef(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 Ye.fromReplace(e,this.from,this.to,o)}invert(){return new hn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Sn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Sn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Sn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Sn(n.from,n.to,e.markFromJSON(n.mark))}}ht.jsonID("addMark",Sn);class hn extends ht{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Q(Ef(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ye.fromReplace(e,this.from,this.to,r)}invert(){return new Sn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new hn(n.pos,r.pos,this.mark)}merge(e){return e instanceof hn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hn(n.from,n.to,e.markFromJSON(n.mark))}}ht.jsonID("removeMark",hn);class sr extends ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ye.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new Q(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.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 sr(this.pos,n.marks[i]);return new sr(this.pos,this.mark)}}return new Zr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new sr(n.pos,e.markFromJSON(n.mark))}}ht.jsonID("addNodeMark",sr);class Zr extends ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ye.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new Q(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zr(n.pos,e.markFromJSON(n.mark))}}ht.jsonID("removeNodeMark",Zr);class Ge extends ht{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ru(e,this.from,this.to)?Ye.fail("Structure replace would overwrite content"):Ye.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Bt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ge(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Ge.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Ge(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ge)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Q.empty:new Q(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ge(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Q.empty:new Q(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ge(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ge(n.from,n.to,Q.fromJSON(e,n.slice),!!n.structure)}}Ge.MAP_BIAS=1;ht.jsonID("replace",Ge);class ut extends ht{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ru(e,this.from,this.gapFrom)||Ru(e,this.gapTo,this.to)))return Ye.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ye.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ye.fromReplace(e,this.from,this.to,r):Ye.fail("Content does not fit in gap")}getMap(){return new Bt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new ut(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new ut(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 ut(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(e,n.slice),n.insert,!!n.structure)}}ht.jsonID("replaceAround",ut);function Ru(t,e,n){let r=t.resolve(e),i=n-e,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 YS(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,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,e),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 hn(d,h,f[m])));a&&a.to==d?a.to=h:o.push(a=new Sn(d,h,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function VS(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof tl){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,e),to:c,step:o})}}}),i.forEach(s=>t.step(new hn(s.from,s.to,s.style)))}function Rf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+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 Ge(a,u,Q.empty));else{r=f;for(let d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||t.step(new hn(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 Q(P.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Ge(a+d.index,a+d.index+d[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(P.empty,!0);t.replace(a,a,new Q(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function ZS(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function nl(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,o=0;;--r){let s=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-o;if(r<t.depth&&s.canReplace(a,l,n))return r;if(r==0||s.type.spec.isolating||!ZS(s,a,l))break;a&&(i=1),l<s.childCount&&(o=1)}return null}function $S(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=P.empty,f=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=P.from(r.node(p).copy(u)),f++):l--;let d=P.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=P.from(i.node(p).copy(d)),h++):c++;t.step(new ut(l,c,s,a,new Q(u.append(d),f,h),u.size-f,!0))}function Nf(t,e,n=null,r=t){let i=XS(t,e),o=i&&eI(r,e);return o?i.map(Ap).concat({type:e,attrs:n}).concat(o.map(Ap)):null}function Ap(t){return{type:t,attrs:null}}function XS(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function eI(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function tI(t,e,n){let r=P.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=P.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new ut(i,o,i,o,new Q(r,0,0),n.length,!0))}function nI(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&rI(t.doc,t.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&&eb(t,s,a,o),Rf(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let u=t.mapping.slice(o),f=u.map(a,1),d=u.map(a+s.nodeSize,1);return t.step(new ut(f,d,f+1,d-1,new Q(P.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Xy(t,s,a,o),!1}})}function Xy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function eb(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
41
+ `))}})}function rI(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function iI(t,e,n,r,i){let o=t.doc.nodeAt(e);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 t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ut(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Q(P.from(s),0,0),1,!0))}function go(t,e,n=1,r){let i=t.resolve(e),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 oI(t,e,n=1,r){let i=t.doc.resolve(e),o=P.empty,s=P.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=P.from(i.node(a).copy(o));let u=r&&r[c];s=P.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Ge(e,e,new Q(o.append(s),n,n),!0))}function rl(t,e){let n=t.resolve(e),r=n.index();return aI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function sI(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function aI(t,e){return!!(t&&e&&!t.isLeaf&&sI(t,e))}function lI(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-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=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);eb(t,u.node(),u.before(),a)}s.inlineContent&&Rf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Ge(c,l.map(e+n,-1),Q.empty,!0)),r===!0){let u=t.doc.resolve(c);Xy(t,u.node(),u.before(),t.steps.length)}return t}function cI(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;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 uI(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;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 il(t,e,n=e,r=Q.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return tb(i,o,r)?new Ge(e,n,r):new fI(i,o,r).fit()}function tb(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class fI{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=P.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=P.from(e.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 e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));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 Q(o,s,a);return e>-1?new ut(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ge(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=yp(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(P.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:e,openStart:n,openEnd:r}=this.unplaced;return bp(e,-1)<=n?!1:(this.unplaced.size>1&&bp(e,1)>r&&r++,this.unplaced=new Q(e,n+1,r),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=yp(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Q(so(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Q(so(e,n,1),n,r)}placeNodes({sliceDepth:e,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-e,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+e-(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(nb(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=ao(this.placed,n,P.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?e==0?Q.empty:new Q(so(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new Q(so(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Wl(this.$to,this.$to.depth,e.type,e.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(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Wl(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Wl(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ao(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ao(this.placed,this.depth,P.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(P.empty,!0);n.childCount&&(this.placed=ao(this.placed,this.frontier.length,n))}}function so(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(so(t.firstChild.content,e-1,n)))}function ao(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ao(t.lastChild.content,e-1,n)))}function yp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function nb(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,nb(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(P.empty,!0)))),t.copy(r)}function Wl(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!hI(n,o.content,s)?a:null}function hI(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function dI(t){return t.spec.defining||t.spec.definingForContent}function bp(t,e){for(let n=0;;n++){let r=e<0?t.firstChild:t.lastChild;if(!r||r.isAtom)return n;t=r.content}}function pI(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(tb(i,o,r))return t.step(new Ge(e,n,r));let s=ib(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=dI(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),y=i.index(g-1);if(x.canReplaceWith(y,y,p.type,p.marks))return t.replace(i.before(g),A?o.after(g):n,new Q(rb(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let d=s.length-1;d>=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function rb(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(rb(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(P.empty,!0))}return t}function mI(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=cI(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Q(P.from(r),0,0))}function gI(t,e,n){let r=t.doc.resolve(e),i=t.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&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let o=ib(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 t.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 t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-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 t.delete(r.before(s),n);t.delete(e,n)}function ib(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class bi extends ht{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ye.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 Ye.fromReplace(e,this.pos,this.pos+1,new Q(P.from(i),0,n.isLeaf?0:1))}getMap(){return Bt.empty}invert(e){return new bi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new bi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new bi(n.pos,n.attr,n.value)}}ht.jsonID("attr",bi);class To extends ht{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ye.ok(r)}getMap(){return Bt.empty}invert(e){return new To(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new To(n.attr,n.value)}}ht.jsonID("docAttr",To);let Ti=class extends Error{};Ti=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ti.prototype=Object.create(Error.prototype);Ti.prototype.constructor=Ti;Ti.prototype.name="TransformError";class ob{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Sa}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ti(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((o,s,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Q.empty){let i=il(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Q(P.from(r),0,0))}delete(e,n){return this.replace(e,n,Q.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return pI(this,e,n,r),this}replaceRangeWith(e,n,r){return mI(this,e,n,r),this}deleteRange(e,n){return gI(this,e,n),this}lift(e,n){return $S(this,e,n),this}join(e,n=1){return lI(this,e,n),this}wrap(e,n){return tI(this,e,n),this}setBlockType(e,n=e,r,i=null){return nI(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return iI(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new bi(e,n,r)),this}setDocAttribute(e,n){return this.step(new To(e,n)),this}addNodeMark(e,n){return this.step(new sr(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof we)n.isInSet(r.marks)&&this.step(new Zr(e,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new Zr(e,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,r){return oI(this,e,n,r),this}addMark(e,n,r){return YS(this,e,n,r),this}removeMark(e,n,r){return VS(this,e,n,r),this}clearIncompatible(e,n,r){return Rf(this,e,n,r),this}}const jl=Object.create(null);class ce{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new sb(e.min(n),e.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 e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Q.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),a?Q.empty:n),a==0&&xp(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),xp(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ue(e):di(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?di(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):di(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new _t(e.node(0))}static atStart(e){return di(e,e,0,0,1)||new _t(e)}static atEnd(e){return di(e,e,e.content.size,e.childCount,-1)||new _t(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=jl[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in jl)throw new RangeError("Duplicate use of selection JSON ID "+e);return jl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ue.between(this.$anchor,this.$head).getBookmark()}}ce.prototype.visible=!0;class sb{constructor(e,n){this.$from=e,this.$to=n}}let wp=!1;function kp(t){!wp&&!t.parent.inlineContent&&(wp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ue extends ce{constructor(e,n=e){kp(e),kp(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ce.near(r);let i=e.resolve(n.map(this.anchor));return new ue(i.parent.inlineContent?i:r,r)}replace(e,n=Q.empty){if(super.replace(e,n),n==Q.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ue&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ol(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ue(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ce.findFrom(n,r,!0)||ce.findFrom(n,-r,!0);if(o)n=o.$head;else return ce.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ce.findFrom(e,-r,!0)||ce.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ue(e,n)}}ce.jsonID("text",ue);class ol{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ol(e.map(this.anchor),e.map(this.head))}resolve(e){return ue.between(e.resolve(this.anchor),e.resolve(this.head))}}class ae extends ce{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ce.near(o):new ae(o)}content(){return new Q(P.from(this.node),0,0)}eq(e){return e instanceof ae&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Tf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ae(e.resolve(n.anchor))}static create(e,n){return new ae(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ae.prototype.visible=!1;ce.jsonID("node",ae);class Tf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ol(r,r):new Tf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ae.isSelectable(r)?new ae(n):ce.near(n)}}class _t extends ce{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Q.empty){if(n==Q.empty){e.delete(0,e.doc.content.size);let r=ce.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new _t(e)}map(e){return new _t(e)}eq(e){return e instanceof _t}getBookmark(){return AI}}ce.jsonID("all",_t);const AI={map(){return this},resolve(t){return new _t(t)}};function di(t,e,n,r,i,o=!1){if(e.inlineContent)return ue.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&ae.isSelectable(a))return ae.create(t,n-(i<0?a.nodeSize:0))}else{let l=di(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function xp(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ge||i instanceof ut))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(ce.near(t.doc.resolve(s),n))}const Cp=1,Ps=2,vp=4;class yI extends ob{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.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(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Cp)&~Ps,this.storedMarks=null,this}get selectionSet(){return(this.updated&Cp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ps,this}ensureMarks(e){return we.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ps)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ps,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||we.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)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(e,o)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ce.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=vp,this}get scrolledIntoView(){return(this.updated&vp)>0}}function Sp(t,e){return!e||!t?t:t.bind(e)}class lo{constructor(e,n,r){this.name=e,this.init=Sp(n.init,r),this.apply=Sp(n.apply,r)}}const bI=[new lo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new lo("selection",{init(t,e){return t.selection||ce.atStart(e.doc)},apply(t){return t.selection}}),new lo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new lo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Kl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=bI.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 lo(r.key,r.spec.state,r))})}}class yi{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,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,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),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",e),!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(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new yi(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new yI(this)}static create(e){let n=new Kl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new yi(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Kl(this.schema,e.plugins),r=n.fields,i=new yi(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Kl(e.schema,e.plugins),o=new yi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Rn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ce.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.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,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function ab(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=ab(i,e,{})),n[r]=i}return n}class xt{constructor(e){this.spec=e,this.props={},e.props&&ab(e.props,this,this.props),this.key=e.key?e.key.key:lb("plugin")}getState(e){return e[this.key]}}const Jl=Object.create(null);function lb(t){return t in Jl?t+"$"+ ++Jl[t]:(Jl[t]=0,t+"$")}class Lt{constructor(e="key"){this.key=lb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Df=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cb(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const ub=(t,e,n)=>{let r=cb(t,n);if(!r)return!1;let i=Of(r);if(!i){let s=r.blockRange(),a=s&&nl(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(db(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Di(o,"end")||ae.isSelectable(o)))for(let s=r.depth;;s--){let a=il(t.doc,r.before(s),r.after(s),Q.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Di(o,"end")?ce.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ae.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},wI=(t,e,n)=>{let r=cb(t,n);if(!r)return!1;let i=Of(r);return i?kI(t,i,e):!1};function kI(t,e,n){let r=e.nodeBefore,i=r,o=e.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=e.nodeAfter,a=s,l=e.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=il(t.doc,o,l,Q.empty);if(!c||c.from!=o||c instanceof Ge&&c.slice.size>=l-o)return!1;if(n){let u=t.tr.step(c);u.setSelection(ue.create(u.doc,o)),n(u.scrollIntoView())}return!0}function Di(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const fb=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Of(r)}let s=o&&o.nodeBefore;return!s||!ae.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Of(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function xI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const CI=(t,e,n)=>{let r=xI(t,n);if(!r)return!1;let i=hb(r);if(!i)return!1;let o=i.nodeAfter;if(db(t,i,e,1))return!0;if(r.parent.content.size==0&&(Di(o,"start")||ae.isSelectable(o))){let s=il(t.doc,r.before(),r.after(),Q.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Di(o,"start")?ce.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ae.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},vI=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=hb(r)}let s=o&&o.nodeAfter;return!s||!ae.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,o.pos)).scrollIntoView()),!0)};function hb(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const SI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
42
+ `).scrollIntoView()),!0)};function Mf(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const II=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Mf(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ce.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},EI=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof _t||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Mf(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(ue.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},RI=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(go(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&nl(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function NI(t){return(e,n)=>{if(e.selection instanceof ae&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!go(e.doc,h.pos)?!1:(n&&n(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof ue||e.selection instanceof _t)&&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=Mf(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=go(r.doc,f,s.length,s);if(d||(s[0]=l?{type:l}:null,d=go(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 TI=NI(),DI=(t,e)=>(e&&e(t.tr.setSelection(new _t(t.doc))),!0);function OI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rl(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function db(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&OI(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let h=e.pos+o.nodeSize,p=P.empty;for(let A=s.length-1;A>=0;A--)p=P.from(s[A].create(null,p));p=P.from(i.copy(p));let m=t.tr.step(new ut(e.pos-1,h,e.pos,h,new Q(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&rl(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:ce.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&nl(f);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(f,d).scrollIntoView()),!0;if(c&&Di(o,"start",!0)&&Di(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=P.empty;for(let y=p.length-1;y>=0;y--)A=P.from(p[y].copy(A));let x=t.tr.step(new ut(e.pos-p.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new Q(A,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function pb(t){return function(e,n){let r=e.selection,i=t<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(e.tr.setSelection(ue.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const MI=pb(-1),BI=pb(1);function Bf(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Nf(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Do(t,e=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(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}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,t,e)}r(o.scrollIntoView())}return!0}}function FI(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:o,$to:s}=e[i],a=o.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(o.pos,s.pos,(l,c)=>{if(a)return!1;a=l.inlineContent&&l.type.allowsMarkType(n)}),a)return!0}return!1}function sl(t,e=null,n){return function(r,i){let{empty:o,$cursor:s,ranges:a}=r.selection;if(o&&!s||!FI(r.doc,a,t))return!1;if(i)if(s)t.isInSet(r.storedMarks||s.marks())?i(r.tr.removeStoredMark(t)):i(r.tr.addStoredMark(t.create(e)));else{let l,c=r.tr;l=!a.some(u=>r.doc.rangeHasMark(u.$from.pos,u.$to.pos,t));for(let u=0;u<a.length;u++){let{$from:f,$to:d}=a[u];if(!l)c.removeMark(f.pos,d.pos,t);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,t.create(e))}}i(c.scrollIntoView())}return!0}}function Li(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let Ql=Li(Df,ub,fb),Ip=Li(Df,CI,vI);const vn={Enter:Li(SI,EI,RI,TI),"Mod-Enter":II,Backspace:Ql,"Mod-Backspace":Ql,"Shift-Backspace":Ql,Delete:Ip,"Mod-Delete":Ip,"Mod-a":DI},mb={"Ctrl-h":vn.Backspace,"Alt-Backspace":vn["Mod-Backspace"],"Ctrl-d":vn.Delete,"Ctrl-Alt-Backspace":vn["Mod-Delete"],"Alt-Delete":vn["Mod-Delete"],"Alt-d":vn["Mod-Delete"],"Ctrl-a":MI,"Ctrl-e":BI};for(let t in vn)mb[t]=vn[t];const _I=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,PI=_I?mb:vn;class Ct{constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?LI(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}}function LI(t){return function(e,n,r,i){let o=t;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 e.tr.insertText(o,r,i)}}const zI=500;function WI({rules:t}){let e=new xt({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 Ep(n,r,i,o,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&Ep(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function Ep(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-zI),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=e-(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:e,to:n,text:r}),t.dispatch(h),!0}return!1}const jI=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let s=t.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,t.schema.text(o.text,l))}else s.delete(o.from,o.to);e(s)}return!0}}return!1};new Ct(/--$/,"—",{inCodeMark:!1});new Ct(/\.\.\.$/,"…",{inCodeMark:!1});new Ct(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1});new Ct(/"$/,"”",{inCodeMark:!1});new Ct(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1});new Ct(/'$/,"’",{inCodeMark:!1});function Ff(t,e,n=null,r){return new Ct(t,(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&&Nf(f,e,l);if(!d)return null;c.wrap(f,d);let h=c.doc.resolve(s-1).nodeBefore;return h&&h.type==e&&rl(c.doc,s-1)&&(!r||r(o,h))&&c.join(s-1),c})}function gb(t,e,n=null){return new Ct(t,(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),e)?r.tr.delete(o,s).setBlockType(o,o,e,l):null})}const dr=typeof navigator<"u"?navigator:null,Rp=typeof document<"u"?document:null,yr=dr&&dr.userAgent||"",Nu=/Edge\/(\d+)/.exec(yr),Ab=/MSIE \d/.exec(yr),Tu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yr),al=!!(Ab||Tu||Nu),KI=Ab?document.documentMode:Tu?+Tu[1]:Nu?+Nu[1]:0,yb=!al&&/gecko\/(\d+)/i.test(yr),JI=yb&&+(/Firefox\/(\d+)/.exec(yr)||[0,0])[1],Du=!al&&/Chrome\/(\d+)/.exec(yr),bb=!!Du,QI=Du?+Du[1]:0,wb=!al&&!!dr&&/Apple Computer/.test(dr.vendor),kb=wb&&(/Mobile\/\w+/.test(yr)||!!dr&&dr.maxTouchPoints>2),HI=kb||(dr?/Mac/.test(dr.platform):!1),xb=/Android \d/.test(yr),Cb=!!Rp&&"webkitFontSmoothing"in Rp.documentElement.style,qI=Cb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var PL=Object.freeze({__proto__:null,android:xb,chrome:bb,chrome_version:QI,gecko:yb,gecko_version:JI,ie:al,ie_version:KI,ios:kb,mac:HI,safari:wb,webkit:Cb,webkit_version:qI});function Hl(t,e,n,r,i,o){if(t.composing)return!1;const s=t.state,a=s.doc.resolve(e);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,e-(f[0].length-r.length),n);if(d)return u.undoable!==!1&&d.setMeta(o,{transform:d,from:e,to:n,text:r}),t.dispatch(d),!0}return!1}const UI=new Lt("MILKDOWN_CUSTOM_INPUTRULES");function GI({rules:t}){const e=new xt({key:UI,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 Hl(n,r,i,o,t,e)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{const{$cursor:r}=n.state.selection;r&&Hl(n,r.pos,r.pos,"",t,e)}),!1),keydown:(n,r)=>!(xb&&bb&&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?Hl(n,i.pos,i.pos,`
43
+ `,t,e):!1}}});return e}function vb(t){return t.some(e=>e.type.spec.code)}function Np(t,e,n){if(e>=n)return!1;let r=!1;return t.doc.nodesBetween(e,n,i=>(i.isInline&&vb(i.marks)&&(r=!0),!r)),r}function YI(t,e){var n;return vb((n=t.storedMarks)!=null?n:t.doc.resolve(e).marks())}function cs(t,e,n={}){return new Ct(t,(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 y=p.search(/\S/),b=o+p.indexOf(h),C=b+h.length,w=Np(r,o+y,b),v=C<s&&Np(r,C,s);if(w||v||YI(r,s))return null;m=(l=f.storedMarks)!=null?l:[],C<s&&f.delete(C,s),b>o&&f.delete(o+y,b),g=o+y+h.length;const T=(c=n.getAttr)==null?void 0:c.call(n,i);f.addMark(o,g,e.create(T)),f.setStoredMarks(m),(u=n.beforeDispatch)==null||u.call(n,{match:i,start:o,end:s,tr:f})}return f})}function LL(t,e,n={}){return new Ct(t,(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=e.createAndFill(m);return g&&(u.replaceRangeWith(e.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 VI=Object.defineProperty,ZI=Object.defineProperties,$I=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,XI=Object.prototype.hasOwnProperty,eE=Object.prototype.propertyIsEnumerable,Dp=(t,e,n)=>e in t?VI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tE=(t,e)=>{for(var n in e||(e={}))XI.call(e,n)&&Dp(t,n,e[n]);if(Tp)for(var n of Tp(e))eE.call(e,n)&&Dp(t,n,e[n]);return t},nE=(t,e)=>ZI(t,$I(e));function Op(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function zL(t,e,n){const i=t.state.doc.content.size,o=Op(e,0,i),s=Op(n,0,i),a=t.coordsAtPos(o),l=t.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 nE(tE({},A),{toJSON:()=>A})}function Sb(t){return Object.assign(Object.create(t),t).setTime(Date.now())}function rE(t,e){return Array.isArray(t)&&t.includes(e.type)||e.type===t}function WL(t){if(t.content.childCount===1){const e=t.content.firstChild;if(e?.type.name==="text"&&e.marks.length===0)return e;if(e?.type.name==="paragraph"&&e.childCount===1){const n=e.firstChild;if(n?.type.name==="text"&&n.marks.length===0)return n}}return!1}function iE(t){return e=>{for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r)){const i=e.before(n),o=e.after(n);return{from:i,to:o,node:r}}}}}function oE(t,e){return iE(n=>n.type===e)(t)}function jL(t,e){const n=e.nodes[t];if(!n)throw z1("node",t);return n}function Ib(t){return e=>{for(let n=e.depth;n>0;n--){const r=e.node(n);if(t(r))return{pos:e.before(n),start:e.start(n),depth:n,node:r}}}}function KL(t){return e=>Ib(t)(e.$from)}function sE(t,e){if(!(t instanceof ae))return;const{node:n,$from:r}=t;if(rE(e,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}const aE=(t,e)=>{const{selection:n,doc:r}=t;if(n instanceof ae)return{hasNode:n.node.type===e,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===e?(s=!0,a=u,l=c,!1):!0),{hasNode:s,pos:a,target:l}};var pr={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:"'"},Ia={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lE=typeof navigator<"u"&&/Mac/.test(navigator.platform),cE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)pr[48+rt]=pr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)pr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)pr[rt]=String.fromCharCode(rt+32),Ia[rt]=String.fromCharCode(rt);for(var ql in pr)Ia.hasOwnProperty(ql)||(Ia[ql]=pr[ql]);function uE(t){var e=lE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||cE&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ia:pr)[t.keyCode]||t.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 fE=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),hE=typeof navigator<"u"&&/Win/.test(navigator.platform);function dE(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[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))fE?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 pE(t){let e=Object.create(null);for(let n in t)e[dE(n)]=t[n];return e}function Ul(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function mE(t){return new xt({props:{handleKeyDown:Eb(t)}})}function Eb(t){let e=pE(t);return function(n,r){let i=uE(r),o,s=e[Ul(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Ul(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(hE&&r.ctrlKey&&r.altKey)&&(o=pr[r.keyCode])&&o!=i){let a=e[Ul(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var Rb=class{},Nb=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=t=>{this.top()?.push(t)},this.open=t=>{this.elements.push(t)},this.close=()=>{const t=this.elements.pop();if(!t)throw HA();return t}}},gE=class Tb extends Rb{constructor(e,n,r){super(),this.type=e,this.content=n,this.attrs=r}push(e,...n){this.content.push(e,...n)}pop(){return this.content.pop()}static create(e,n,r){return new Tb(e,n,r)}},Xt,Ci,Uo,Go,Yo,vi,Si,qr,AE=(qr=class extends Nb{constructor(n){super();je(this,Xt);je(this,Ci);je(this,Uo);je(this,Go);je(this,Yo);je(this,vi);je(this,Si);Te(this,Xt,we.none),Te(this,Ci,r=>r.isText),Te(this,Uo,(r,i)=>{if(se(this,Ci).call(this,r)&&se(this,Ci).call(this,i)&&we.sameSet(r.marks,i.marks))return this.schema.text(r.text+i.text,r.marks)}),Te(this,Go,r=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.parseMarkdown.match(r));if(!i)throw P1(r);return i}),Te(this,Yo,r=>{const i=se(this,Go).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(gE.create(r,[],i)),this),Te(this,vi,()=>{Te(this,Xt,we.none);const r=this.close();return se(this,Si).call(this,r.type,r.attrs,r.content)}),this.closeNode=()=>{try{se(this,vi).call(this)}catch(r){console.error(r)}return this},Te(this,Si,(r,i,o)=>{const s=r.createAndFill(i,o,se(this,Xt));if(!s)throw _1(r,i,o);return this.push(s),s}),this.addNode=(r,i,o)=>{try{se(this,Si).call(this,r,i,o)}catch(s){console.error(s)}return this},this.openMark=(r,i)=>{const o=r.create(i);return Te(this,Xt,o.addToSet(se(this,Xt))),this},this.closeMark=r=>(Te(this,Xt,r.removeFromSet(se(this,Xt))),this),this.addText=r=>{try{const i=this.top();if(!i)throw HA();const o=i.pop(),s=this.schema.text(r,se(this,Xt));if(!o)return i.push(s),this;const a=se(this,Uo).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=se(this,vi).call(this);while(this.size());return r},this.next=(r=[])=>([r].flat().forEach(i=>se(this,Yo).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}},Xt=new WeakMap,Ci=new WeakMap,Uo=new WeakMap,Go=new WeakMap,Yo=new WeakMap,vi=new WeakMap,Si=new WeakMap,qr.create=(n,r)=>{const i=new qr(n);return o=>(i.run(r,o),i.toDoc())},qr),Ur,Mp=(Ur=class extends Rb{constructor(e,n,r,i={}){super(),this.type=e,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()}},Ur.create=(e,n,r,i={})=>new Ur(e,n,r,i),Ur),yE=t=>Object.prototype.hasOwnProperty.call(t,"size"),pt,Ii,Vo,Zo,$o,Xo,Ei,Ri,es,ts,Lr,or,ns,Ni,Gr,bE=(Gr=class extends Nb{constructor(n){super();je(this,pt);je(this,Ii);je(this,Vo);je(this,Zo);je(this,$o);je(this,Xo);je(this,Ei);je(this,Ri);je(this,es);je(this,ts);je(this,Lr);je(this,or);je(this,ns);je(this,Ni);Te(this,pt,[]),Te(this,Ii,r=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.toMarkdown.match(r));if(!i)throw L1(r.type);return i}),Te(this,Vo,r=>se(this,Ii).call(this,r).spec.toMarkdown.runner(this,r)),Te(this,Zo,(r,i)=>se(this,Ii).call(this,r).spec.toMarkdown.runner(this,r,i)),Te(this,$o,r=>{const i=a=>a.type.spec.priority??50,o=[...r].sort((a,l)=>i(a)-i(l)),s=[];return se(this,pt).forEach(({mark:a})=>{const l=o.findIndex(c=>c.eq(a));l>=0&&s.push(...o.splice(l,1))}),s.concat(o)}),Te(this,Xo,r=>{const i=r?.marks;let o=0;for(;o<se(this,pt).length;){const{mark:s,spanning:a}=se(this,pt)[o];if(a&&i?.some(l=>l.eq(s)))o++;else break}for(let s=se(this,pt).length-1;s>=o;s--)se(this,Ni).call(this,se(this,pt)[s].mark)}),Te(this,Ei,(r,i)=>{se(this,$o).call(this,r.marks).every(o=>!se(this,Zo).call(this,o,r))&&se(this,Vo).call(this,r),se(this,Xo).call(this,i)}),Te(this,Ri,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(se(this,Ri).call(this,h))}}return o.concat(s)},[])),r}),Te(this,es,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(Mp.create(r,void 0,i,o)),this),Te(this,ts,(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&&se(this,or).call(this,"text",void 0,o);const l=i();return s.length&&se(this,or).call(this,"text",void 0,s),l}),Te(this,Lr,(r=!1)=>{const i=this.close(),o=()=>se(this,or).call(this,i.type,i.children,i.value,i.props);return r?se(this,ts).call(this,i,o):o()}),this.closeNode=()=>(se(this,Lr).call(this),this),Te(this,or,(r,i,o,s)=>{const a=Mp.create(r,i,o,s),l=se(this,Ri).call(this,se(this,es).call(this,a));return this.push(l),l}),this.addNode=(r,i,o,s)=>(se(this,or).call(this,r,i,o,s),this),Te(this,ns,(r,i,o,s)=>se(this,pt).some(a=>a.mark.eq(r))?this:(se(this,pt).push({mark:r,spanning:o==null}),this.openNode(i,o,{...s,isMark:!0}))),Te(this,Ni,r=>{let i=-1;for(let o=se(this,pt).length-1;o>=0;o--)if(se(this,pt)[o].mark.eq(r)){i=o;break}i<0||(se(this,pt).splice(i,1),se(this,Lr).call(this,!0))}),this.withMark=(r,i,o,s)=>(se(this,ns).call(this,r,i,o,s),this),this.closeMark=r=>(se(this,Ni).call(this,r),this),this.build=()=>{let r=null;do r=se(this,Lr).call(this);while(this.size());return r.children||(r.children=[]),r},this.next=r=>yE(r)?(r.forEach((i,o,s)=>{se(this,Ei).call(this,i,r.maybeChild(s+1)??void 0)}),this):(se(this,Ei).call(this,r),this),this.toString=r=>r.stringify(this.build()),this.run=r=>(Te(this,pt,[]),this.next(r),this),this.schema=n}},pt=new WeakMap,Ii=new WeakMap,Vo=new WeakMap,Zo=new WeakMap,$o=new WeakMap,Xo=new WeakMap,Ei=new WeakMap,Ri=new WeakMap,es=new WeakMap,ts=new WeakMap,Lr=new WeakMap,or=new WeakMap,ns=new WeakMap,Ni=new WeakMap,Gr.create=(n,r)=>{const i=new Gr(n);return o=>(i.run(o),i.toString(r))},Gr);const it=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Oi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Ou=null;const Cn=function(t,e,n){let r=Ou||(Ou=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},wE=function(){Ou=null},$r=function(t,e,n,r){return n&&(Bp(t,e,n,r,-1)||Bp(t,e,n,r,1))},kE=/^(img|br|input|textarea|hr)$/i;function Bp(t,e,n,r,i){for(var o;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ct(t))){let s=t.parentNode;if(!s||!$(s)||us(t)||kE.test(t.nodeName)||t.contentEditable=="false")return!1;e=it(t)+(i<0?0:1),t=s}else if($(t)){let s=t.childNodes[e+(i<0?-1:0)];if($(s)&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?ct(t):0}else return!1}}function ct(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $(t){return t.nodeType==1}function Ze(t){return t.nodeType==3}function Xr(t,e){return e?t.contains($(e)?e:e.parentNode):!1}function xE(t,e){for(;;){if(Ze(t)&&e)return t;if($(t)&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=ct(t)}else if(t.parentNode&&!us(t))e=it(t),t=t.parentNode;else return null}}function CE(t,e){for(;;){if(Ze(t)&&e<t.nodeValue.length)return t;if($(t)&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!us(t))e=it(t)+1,t=t.parentNode;else return null}}function vE(t,e,n){for(let r=e==0,i=e==ct(t);r||i;){if(t==n)return!0;let o=it(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==ct(t)}}function us(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ll=function(t){return t.focusNode&&$r(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Or(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function SE(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function IE(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ct(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ct(r.startContainer),r.startOffset)}}}const dn=typeof navigator<"u"?navigator:null,Fp=typeof document<"u"?document:null,br=dn&&dn.userAgent||"",Mu=/Edge\/(\d+)/.exec(br),Db=/MSIE \d/.exec(br),Bu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(br),Tt=!!(Db||Bu||Mu),cr=Db?document.documentMode:Bu?+Bu[1]:Mu?+Mu[1]:0,Pt=!Tt&&/gecko\/(\d+)/i.test(br);Pt&&+(/Firefox\/(\d+)/.exec(br)||[0,0])[1];const Fu=!Tt&&/Chrome\/(\d+)/.exec(br),st=!!Fu,Ob=Fu?+Fu[1]:0,ft=!Tt&&!!dn&&/Apple Computer/.test(dn.vendor),Mi=ft&&(/Mobile\/\w+/.test(br)||!!dn&&dn.maxTouchPoints>2),Kt=Mi||(dn?/Mac/.test(dn.platform):!1),Mb=dn?/Win/.test(dn.platform):!1,In=/Android \d/.test(br),cl=!!Fp&&"webkitFontSmoothing"in Fp.documentElement.style,EE=cl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function RE(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function bn(t,e){return typeof t=="number"?t:t[e]}function NE(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function _p(t,e,n){if(!_u(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(!$(s)){s=Oi(s);continue}let a=s==o.body,l=a?RE(o):NE(s),c=0,u=0;if(e.top<l.top+bn(r,"top")?u=-(l.top-e.top+bn(i,"top")):e.bottom>l.bottom-bn(r,"bottom")&&(u=e.bottom-e.top>l.bottom-l.top?e.top+bn(i,"top")-l.top:e.bottom-l.bottom+bn(i,"bottom")),e.left<l.left+bn(r,"left")?c=-(l.left-e.left+bn(i,"left")):e.right>l.right-bn(r,"right")&&(c=e.right-l.right+bn(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;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}let f=a?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:Oi(s)}}function TE(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.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:Bb(t.dom)}}function Bb(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Oi(r));return e}function DE({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Fb(n,r==0?0:r-e)}function Fb(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ci=null;function OE(t){if(t.setActive)return t.setActive();if(ci)return t.focus(ci);let e=Bb(t);t.focus(ci==null?{get preventScroll(){return ci={preventScroll:!0},!0}}:void 0),ci||(ci=!1,Fb(e,0))}function _b(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let d;if($(u))d=u.getClientRects();else if(Ze(u))d=Cn(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>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<r){n=u,r=m,i=m&&Ze(n)?{left:p.right<e.left?p.right:p.left,top:e.top}:e,$(u)&&m&&(o=f+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&Ze(n)?ME(n,i):!n||r?{node:t,offset:o}:_b(n,i)}function ME(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=er(r,1);if(s.top!=s.bottom&&_f(e,s)){i={node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function _f(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function BE(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function FE(t,e,n){let{node:r,offset:i}=_b(e,n),o=-1;if($(r)&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function _E(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if($(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:t.docView.posFromDOM(e,n,-1)}function Pb(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if($(s)){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(_f(e,c))return Pb(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function PE(t,e){let n=t.dom.ownerDocument,r,i=0,o=IE(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s)){let c=t.dom.getBoundingClientRect();if(!_f(e,c)||(s=Pb(t.dom,e,c),!s))return null}if(ft)for(let c=s;r&&c;c=Oi(c))c.draggable&&(r=void 0);if(s=BE(s,e),r){if(Pt&&$(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<=e.left&&f.bottom>e.top&&i++}let c;cl&&i&&$(r)&&$(c=r.childNodes[i-1])&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&$(r.lastChild)&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||!$(r)||r.childNodes[i-1].nodeName!="BR")&&(a=_E(t,r,i,e))}a==null&&(a=FE(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function _u(t){return t.top<t.bottom||t.left<t.right}function er(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(_u(r))return r}return Array.prototype.find.call(n,_u)||t.getBoundingClientRect()}const LE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Lb(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=cl||Pt;if(Ze(r))if(s&&(LE.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=er(Cn(r,i,i),n);if(Pt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=er(Cn(r,i-1,i-1),-1);if(c.top==l.top){let u=er(Cn(r,i,i+1),-1);if(u.top!=l.top)return eo(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++,eo(er(Cn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ct(r))){let l=r.childNodes[i-1];if($(l))return Gl(l.getBoundingClientRect(),!1)}if(o==null&&i<ct(r)){let l=r.childNodes[i];if($(l))return Gl(l.getBoundingClientRect(),!0)}return Gl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ct(r))){let l=r.childNodes[i-1],c=Ze(l)?Cn(l,ct(l)-(s?0:1)):$(l)&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return eo(er(c,1),!1)}if(o==null&&i<ct(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?Ze(l)?Cn(l,0,s?0:1):$(l)?l:null:null;if(c)return eo(er(c,-1),!0)}return eo(er(Ze(r)?Cn(r):r,-n),n>=0)}function eo(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Gl(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function zb(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function zE(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return zb(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=Lb(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if($(a))l=a.getClientRects();else if(Ze(a))l=Cn(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 WE=/[\u0590-\u08ac]/;function jE(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!WE.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:zb(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!Xr(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 Pp=null,Lp=null,zp=!1;function KE(t,e,n){return Pp==e&&Lp==n?zp:(Pp=e,Lp=n,zp=n=="up"||n=="down"?zE(t,e,n):jE(t,e,n))}const Ht=0,Wp=1,Br=2,nn=3;class fs{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ht,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)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(e,n,r){if(this.contentDOM&&Xr(this.contentDOM,e))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.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(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>it(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!($(s)?Xr(s,e):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&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(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+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>e){i=e-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 jb||o instanceof Wb&&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?it(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?it(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,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&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=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=it(d.dom)+1;break}e-=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=it(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(!$(n)||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,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(e-p-m.border,n-p-m.border,r,i);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((Pt||ft)&&e==n){let{node:h,offset:p}=a;if(Ze(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:it(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(Pt&&u.focusNode&&u.focusNode!=l.node&&$(u.focusNode)){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&ft)&&$r(a.node,a.offset,u.anchorNode,u.anchorOffset)&&$r(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((c.extend||e==n)&&!(f&&Pt)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>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(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Br:Wp,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=nn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Br:nn}r=s}this.dirty=Br}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Br:Wp;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Wb extends fs{constructor(e,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=$(s)?s:document.createElement("span");a!=s&&a.appendChild(s),a.hasAttribute("contenteditable")||(a.contentEditable="false"),a.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ht&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.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 JE extends fs{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ur extends fs{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ar.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ur(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&nn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=nn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ht){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ht}}slice(e,n,r){let i=ur.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Lu(o,n,s,r)),e>0&&(o=Lu(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class fr extends fs{constructor(e,n,r,i,o,s,a){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,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(!Ze(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Ar.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=Qb(u,r,n),c?l=new QE(e,n,r,i,u,f||null,d,c):n.isText?new ul(e,n,r,i,u,d):new fr(e,n,r,i,u,f||null,d)}parseRule(e){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=e&&e.find(i=>$(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?n.contentElement=r:n.getContent=()=>P.empty}}return n}matchesNode(e,n,r){return this.dirty==Ht&&e.eq(this.node)&&Ea(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new qE(this,s&&s.node,e),c=this.node.inlineContent,u=c&&this.node.isBlock;YE(this.node,this.innerDeco,(f,d,h)=>{f.spec.marks?l.syncToMarks(f.spec.marks,r,e,d):f.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?we.none:this.node.child(d).marks,r,e,d),l.placeWidget(f,e,i)},(f,d,h,p)=>{l.syncToMarks(f.marks,r,e,p),u&&f.isAtom&&!f.isText&&l.addHackNode("IMG",l.top);let m;l.findNodeMatch(f,d,h,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+f.nodeSize&&(m=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(f,d,h,m,e)||l.updateNextNode(f,d,h,e,p,i)||l.addNode(f,d,h,e,i),i+=f.nodeSize,c&&(u=f.isAtom&&!f.isText)}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Br)&&(s&&this.protectLocalComposition(e,s),Kb(this.contentDOM,this.children,e),Mi&&VE(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ue)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=ZE(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(e,{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 JE(this,o,n,i);e.input.compositionNodes.push(s),this.children=Lu(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==nn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ht}updateOuterDeco(e){if(Ea(e,this.outerDeco))return;let n=!$(this.nodeDOM),r=this.dom;this.dom=Jb(this.dom,this.nodeDOM,Pu(this.outerDeco,this.node,n),Pu(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){$(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){$(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 jp(t,e,n,r,i){Qb(r,e,t);let o=new fr(void 0,t,e,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o}class ul extends fr{constructor(e,n,r,i,o,s){super(e,n,r,i,o,null,s)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==nn||this.dirty!=Ht&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ht||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ht,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ul(this.parent,i,this.outerDeco,this.innerDeco,o,o)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=nn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class jb extends fs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ht&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class QE extends fr{constructor(e,n,r,i,o,s,a,l){super(e,n,r,i,o,s,a),this.spec=l}update(e,n,r,i){if(this.dirty==nn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Kb(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Kp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof ur){let l=r?r.previousSibling:t.lastChild;Kb(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Kp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ao=function(t){t&&(this.nodeName=t)};Ao.prototype=Object.create(null);const Fr=[new Ao];function Pu(t,e,n){if(t.length==0)return Fr;let r=n?Fr[0]:new Ao,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Ao(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Ao(e.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 Jb(t,e,n,r){if(n==Fr&&r==Fr)return e;let i=e;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!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Fr[0]),i=l}HE(i,a||Fr[0],s)}return i}function HE(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.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&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Qb(t,e,n){return Jb(t,t,Fr,Pu(e,n,!$(t)))}function Ea(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Kp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qE{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=UE(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let o=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=Ht,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.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(e[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 ur&&u.dirty!=nn&&u.mark.type==e[s].type&&u.spec.update&&!this.isLocked(u.dom)&&u.spec.update(e[s])&&(u.mark=e[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=ur.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,s++}}findNodeMatch(e,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(e,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(e,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==nn&&s.dom==s.contentDOM&&(s.dirty=Br),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,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 fr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=nn&&Ea(n,l.outerDeco));if(!d&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Br,f.updateChildren(i,s+1),f.dirty=Ht),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ea(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=fr.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=fr.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Wb(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ur;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ul)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ft||st)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new jb(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||$(e)&&e.contains(this.lock.parentNode))}}function UE(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ur)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function GE(t,e){return t.type.side-e.type.side}function YE(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,i,e.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(GE);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<t.childCount)h=c,d=t.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,e.forChild(o,d),h),o=p}}function VE(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function ZE(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Lu(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Pf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(ll(n)){for(l=s;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&ae.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&vE(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new ae(s==f?a:r.resolve(f))}else if(Pt&&e=="key"&&s>t.state.selection.to&&$(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>t.state.selection.to)for(let f=n.focusNode;;f=f.parentNode){if(getComputedStyle(f).overflow!="visible"){c=ce.findFrom(r.resolve(i.posAtStart),1);break}if(f==i.dom||f.nextSibling||!f.parentNode||!$(f.parentNode))break}}else{if(n instanceof t.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,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(f<0)return null;[l,s]=d==t.state.selection.anchor?[d,f]:[f,d],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=Lf(t,u,a,f)}return c}function Hb(t){return t.editable?t.hasFocus():Ub(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Nn(t,e=!1){let n=t.state.selection;if(qb(t,n),!Hb(t))return;let r=t.input.mouseDown;if(!e&&st&&r){let i=t.domSelectionRange(),o=t.domObserver.currentSelection;if(i.anchorNode&&o.anchorNode&&$r(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)XE(t);else{let{anchor:i,head:o}=n,s,a;Jp&&!(n instanceof ue)&&(n.$from.parent.inlineContent||(s=Qp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=Qp(t,n.to))),t.docView.setSelection(i,o,t,e),Jp&&(s&&Hp(s),a&&Hp(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&$E(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const Jp=ft||st&&Ob<63;function Qp(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(ft&&i&&i.contentEditable=="false")return Yl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Yl(i);if(o)return Yl(o)}}function Yl(t){return t.contentEditable="true",ft&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Hp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function $E(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Hb(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function XE(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,it(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Tt&&cr<=11&&(n.disabled=!0,n.disabled=!1)}function qb(t,e){if(e instanceof ae){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(qp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else qp(t)}function qp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Lf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ue.between(e,n,r)}function Up(t){return t.editable&&!t.hasFocus()?!1:Ub(t)}function Ub(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return Xr(t.dom,e.anchorNode)&&(t.editable||Xr(t.dom,e.focusNode))}catch{return!1}}function eR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return $r(e.node,e.offset,n.anchorNode,n.anchorOffset)}function zu(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ce.findFrom(o,e)}function tr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Gp(t,e,n){let r=t.state.selection;if(r instanceof ue)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return tr(t,new ue(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=zu(t.state,e);return i&&i instanceof ae?tr(t,i):!1}else if(!(Kt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?ae.isSelectable(o)?tr(t,new ae(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):tr(t,new ue(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1}}else return!1;else{if(r instanceof ae&&r.node.isInline)return tr(t,new ue(e>0?r.$to:r.$from));{let i=zu(t.state,e);return i?tr(t,i):!1}}}function yo(t,e){let n=t.pmViewDesc;return n?n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR"):$(t)&&t.contentEditable=="false"}function ui(t,e){return e<0?tR(t):nR(t)}function tR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Pt&&$(n)&&r<ct(n)&&yo(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(!$(n))break;let a=n.childNodes[r-1];if(yo(a,-1))i=n,o=--r;else if(Ze(a))n=a,r=n.nodeValue.length;else break}else{if(Gb(n))break;{let a=n.previousSibling;for(;a&&yo(a,-1);)i=n.parentNode,o=it(a),a=a.previousSibling;if(a)n=a,r=ct(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Wu(t,n,r):i&&Wu(t,i,o)}function nR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ct(n),o,s;for(;;)if(r<i){if(!$(n))break;let a=n.childNodes[r];if(yo(a,1))o=n,s=++r;else break}else{if(Gb(n))break;{let a=n.nextSibling;for(;a&&yo(a,1);)o=a.parentNode,s=it(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=ct(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Wu(t,o,s)}function Gb(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function rR(t,e){for(;t&&e==t.childNodes.length&&!us(t);)e=it(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(Ze(n))return n;if($(n)&&n.contentEditable=="false")break;t=n,e=0}}function iR(t,e){for(;t&&!e&&!us(t);)e=it(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(Ze(n))return n;if($(n)&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Wu(t,e,n){if(!Ze(e)){let o,s;(s=rR(e,n))?(e=s,n=0):(o=iR(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ll(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Nn(t)},50)}function Yp(t,e){let n=t.state.doc.resolve(e);if(!(st||Mb)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-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(e<n.end()){let o=t.coordsAtPos(e+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(t.dom).direction=="rtl"?"rtl":"ltr"}function Vp(t,e,n){let r=t.state.selection;if(r instanceof ue&&!r.empty||n.indexOf("s")>-1||Kt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=zu(t.state,e);if(s&&s instanceof ae)return tr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof _t?ce.near(s,e):ce.findFrom(s,e);return a?tr(t,a):!1}return!1}function Zp(t,e){if(!(t.state.selection instanceof ue))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function $p(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function oR(t){if(!ft||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&$(e)&&n==0&&e.firstChild&&$(e.firstChild)&&e.firstChild.contentEditable=="false"){let r=e.firstChild;$p(t,r,"true"),setTimeout(()=>$p(t,r,"false"),20)}return!1}function sR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function aR(t,e){let n=e.keyCode,r=sR(e);if(n==8||Kt&&n==72&&r=="c")return Zp(t,-1)||ui(t,-1);if(n==46&&!e.shiftKey||Kt&&n==68&&r=="c")return Zp(t,1)||ui(t,1);if(n==13||n==27)return!0;if(n==37||Kt&&n==66&&r=="c"){let i=n==37?Yp(t,t.state.selection.from)=="ltr"?-1:1:-1;return Gp(t,i,r)||ui(t,i)}else if(n==39||Kt&&n==70&&r=="c"){let i=n==39?Yp(t,t.state.selection.from)=="ltr"?1:-1:1;return Gp(t,i,r)||ui(t,i)}else{if(n==38||Kt&&n==80&&r=="c")return Vp(t,-1,r)||ui(t,-1);if(n==40||Kt&&n==78&&r=="c")return oR(t)||Vp(t,1,r)||ui(t,1);if(r==(Kt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function zf(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;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=t.someProp("clipboardSerializer")||Ar.fromSchema(t.state.schema),a=ew(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&$(c)&&(u=Xb[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&&$(c)&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
45
+
46
+ `);return{dom:l,text:d,slice:e}}function Yb(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=!!e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return a=new Q(P.from(t.state.schema.text(e.replace(/\r\n?/g,`
47
+ `))),0,0),t.someProp("transformPasted",d=>{a=d(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=Ar.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=fR(n),cl&&hR(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&&!$(d);)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||If.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!lR.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=dR(Xp(a,+u[1],+u[2]),u[4]);else if(a=Q.maxOpen(cR(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=Xp(a,f,d)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const lR=/^(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 cR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&Zb(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=$b(s[s.length-1],o.length));let u=Vb(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return P.from(s)}return t}function Vb(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,P.from(t));return t}function Zb(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Zb(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(P.from(Vb(n,t,i+1))))}}function $b(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,$b(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(P.empty,!0);return t.copy(n.append(r))}function ju(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=ju(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(P.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Xp(t,e,n){return e<t.openStart&&(t=new Q(ju(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Q(ju(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Xb={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 ew(){return document.implementation.createHTMLDocument("title")}let to=null;function uR(t){let e=window.trustedTypes;if(!e)return t;if(!to){if(to=e.defaultPolicy)try{return to.createHTML(t)}catch{}to=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return to.createHTML(t)}function fR(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ew(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Xb[i[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=uR(t),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 hR(t){let e=t.querySelectorAll(st?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function dR(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{i=P.from(l.create(r[a+1],i))}catch{break}o++,s++}return new Q(i,o,s)}const yt={},bt={},pR={touchstart:!0,touchmove:!0};class mR{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 gR(t){for(let e in yt){let n=yt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{yR(t,r)&&!Wf(t,r)&&(t.editable||!(r.type in bt))&&n(t,r)},pR[e]?{passive:!0}:void 0)}ft&&t.dom.addEventListener("input",()=>null),Ku(t)}function En(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function AR(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ku(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Wf(t,r))})}function Wf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function yR(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function bR(t,e){!Wf(t,e)&&yt[e.type]&&(t.editable||!(e.type in bt))&&yt[e.type](t,e)}bt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!iw(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(In&&st&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Mi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Or(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||aR(t,n)?n.preventDefault():En(t,"key")};bt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};bt.keypress=(t,e)=>{let n=e;if(iw(t)||!n.charCode||n.ctrlKey&&!n.altKey||Kt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ue)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault()}};function hs(t){return{left:t.clientX,top:t.clientY}}function wR(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function jf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ds(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function kR(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ae.isSelectable(r)?(ds(t,new ae(n)),!0):!1}function xR(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ae&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ae.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?(ds(t,ae.create(t.state.doc,i)),!0):!1}function CR(t,e,n,r,i){return jf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?xR(t,n):kR(t,n))}function vR(t,e,n,r){return jf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function SR(t,e,n,r){return jf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||IR(t,n,r)}function IR(t,e,n){if(n.button!=0)return!1;let r=tw(t,e,!0),i=t.state.doc;return r?(ds(t,r),r instanceof ue&&i.eq(t.state.doc)&&(t.input.mouseDown=new RR(t,r)),!0):!1}function tw(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?ue.create(r,0,r.content.size):null;let i=r.resolve(e);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 ue.create(r,a+1,a+1+s.content.size);if(n&&ae.isSelectable(s))return ae.create(r,a)}return null}function Kf(t){return Ra(t)}const nw=Kt?"metaKey":"ctrlKey";yt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Kf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&wR(n,t.input.lastClick)&&!n[nw]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(hs(n));s&&(o=="singleClick"?t.input.mouseDown=new ER(t,s,n,!!r):(o=="doubleClick"?vR:SR)(t,s.pos,s.inside,n)?n.preventDefault():En(t,"pointer"))};class rw{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.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 ER extends rw{constructor(e,n,r,i){super(e),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[nw],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&$(l.nodeDOM)?l.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ae&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pt&&!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()),En(e,"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||Nn(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(hs(e))),this.updateAllowDefault(e),this.allowDefault||!n?En(this.view,"pointer"):CR(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ft&&this.mightDrag&&!this.mightDrag.node.isAtom||st&&!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)?(ds(this.view,ce.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):En(this.view,"pointer")}move(e){this.updateAllowDefault(e),En(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class RR extends rw{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),En(this.view,"pointer");let n=this.view.posAtCoords(hs(e)),r=n&&tw(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];ds(this.view,ue.create(i,s,a))}}yt.touchstart=t=>{t.input.lastTouch=Date.now(),Kf(t),En(t,"pointer")};yt.touchmove=t=>{t.input.lastTouch=Date.now(),En(t,"pointer")};yt.contextmenu=t=>Kf(t);function iw(t,e){return t.composing?!0:ft&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const NR=In?5e3:-1;bt.compositionstart=bt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ue&&e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||st&&Mb&&TR(t)))t.markCursor=t.state.storedMarks||n.marks(),Ra(t,!0),t.markCursor=null;else if(Ra(t,!e.selection.empty),Pt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&$(i)&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(Ze(s)){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}ow(t,NR)};function TR(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||!$(e)||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return $(r)&&r.contentEditable=="false"}bt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,ow(t,20))};function ow(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ra(t),e))}function sw(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function DR(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=xE(e.focusNode,e.focusOffset),r=CE(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function Ra(t,e=!1){if(!(In&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),sw(t),e||t.docView&&t.docView.dirty){let n=Pf(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function OR(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Oo=Tt&&cr<15||Mi&&EE<604;yt.copy=bt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Oo?null:n.clipboardData,s=r.content(),{dom:a,text:l}=zf(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):OR(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function MR(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function BR(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.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=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Mo(t,r.value,null,i,e):Mo(t,r.textContent,r.innerHTML,i,e)},50)}function Mo(t,e,n,r,i){let o=Yb(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||Q.empty)))return!0;if(!o)return!1;let s=MR(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function aw(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}bt.paste=(t,e)=>{let n=e;if(t.composing&&!In)return;let r=Oo?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Mo(t,aw(r),r.getData("text/html"),i,n)?n.preventDefault():BR(t,n)};class lw{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const FR=Kt?"altKey":"ctrlKey";function cw(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[FR]}yt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(hs(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ae?i.to-1:i.to))){if(r&&r.mightDrag)s=ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&$(n.target)){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=ae.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=zf(t,a);(!n.dataTransfer.files.length||!st||Ob>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Oo?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Oo||n.dataTransfer.setData("text/plain",c),t.dragging=new lw(u,cw(t,n),s)};yt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};bt.dragover=bt.dragenter=(t,e)=>e.preventDefault();bt.drop=(t,e)=>{try{_R(t,e,t.dragging)}finally{t.dragging=null}};function _R(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(hs(e));if(!r)return;let i=t.state.doc.resolve(r.pos),o=n&&n.slice;o?t.someProp("transformPasted",h=>{o=h(o,t,!1)}):o=Yb(t,aw(e.dataTransfer),Oo?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&cw(t,e));if(t.someProp("handleDrop",h=>h(t,e,o||Q.empty,s))){e.preventDefault();return}if(!o)return;e.preventDefault();let a=o?uI(t.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let l=t.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&&ae.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new ae(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(Lf(t,d,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}yt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Nn(t)},20))};yt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};yt.beforeinput=(t,e)=>{if(In&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Or(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in bt)yt[t]=bt[t];function Bo(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Na{constructor(e,n){this.toDOM=e,this.spec=n||jr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new at(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Na&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Bo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class hr{constructor(e,n){this.attrs=e,this.spec=n||jr}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new at(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof hr&&Bo(this.attrs,e.attrs)&&Bo(this.spec,e.spec)}static is(e){return e.type instanceof hr}destroy(){}}class Jf{constructor(e,n){this.attrs=e,this.spec=n||jr}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new at(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Jf&&Bo(this.attrs,e.attrs)&&Bo(this.spec,e.spec)}destroy(){}}class at{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new at(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new at(e,e,new Na(n,r))}static inline(e,n,r,i){return new at(e,n,new hr(r,i))}static node(e,n,r,i){return new at(e,n,new Jf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof hr}get widget(){return this.type instanceof Na}}const pi=[],jr={};class Fe{constructor(e,n){this.local=e.length?e:pi,this.children=n.length?n:pi}static create(e,n){return n.length?Ta(n,e,0,jr):lt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!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]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==lt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||jr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?PR(this.children,s||[],e,n,r,i,o):s?new Fe(s.sort(Kr),pi):lt}add(e,n){return n.length?this==lt?Fe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,u;if(u=fw(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,Ta(u,a,c+1,jr)),o+=3}});let s=uw(o?hw(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Fe(s.length?this.local.concat(s).sort(Kr):this.local,i||this.children)}remove(e){return e.length==0||this==lt?this:this.removeInner(e,0)}removeInner(e,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<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[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!=lt?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[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 Fe(i,r):lt}forChild(e,n){if(this==lt)return this;if(n.isLeaf)return Fe.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+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 hr){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 Fe(i.sort(Kr),pi);return r?new rr([a,r]):a}return r||lt}eq(e){if(this==e)return!0;if(!(e instanceof Fe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Qf(this.localsInner(e))}localsInner(e){if(this==lt)return pi;if(e.inlineContent||!this.local.some(hr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof hr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Fe.empty=new Fe([],[]);Fe.removeOverlap=Qf;const lt=Fe.empty;class rr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,jr));return rr.from(r)}forChild(e,n){if(n.isLeaf)return Fe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=lt&&(o instanceof rr?r=r.concat(o.members):r.push(o))}return rr.from(r)}eq(e){if(!(e instanceof rr)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);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?Qf(r?n:n.sort(Kr)):pi}static from(e){switch(e.length){case 0:return lt;case 1:return e[0];default:return new rr(e.every(n=>n instanceof Fe)?e:e.reduce((n,r)=>n.concat(r instanceof Fe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function PR(t,e,n,r,i,o,s){let a=t.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 y=a[A]+u-f;h>=y?a[A+1]=d<=y?-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(t[c]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(t[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,t[c]+o+1,s);A!=lt?(a[c]=f,a[c+1]=h,a[c+2]=A):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=LR(a,t,e,n,i,o,s),u=Ta(c,r,0,s);e=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 Fe(e.sort(Kr),a)}function uw(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new at(i.from+e,i.to+e,i.type))}return n}function LR(t,e,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<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function fw(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function hw(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ta(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=fw(t,a,l+n);if(c){o=!0;let u=Ta(c,a,n+l+1,r);u!=lt&&i.push(l,l+a.nodeSize,u)}});let s=uw(o?hw(t):t,-n).sort(Kr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Fe(s,i):lt}function Kr(t,e){return t.from-e.from||t.to-e.to}function Qf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),em(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),em(e,i,r.copy(o.from,r.to)));break}}}return e}function em(t,e,n){for(;e<t.length&&Kr(n,t[e])>0;)e++;t.splice(e,0,n)}function Vl(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=lt&&e.push(r)}),t.cursorWrapper&&e.push(Fe.create(t.state.doc,[t.cursorWrapper.deco])),rr.from(e)}const zR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},WR=Tt&&cr<=11;class jR{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class KR{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jR,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]);Tt&&cr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ft&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),WR&&(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,zR)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[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(Up(this.view)){if(this.suppressingSelectionUpdates)return Nn(this.view);if(Tt&&cr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&$r(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Oi(o))n.add(o);for(let o=e.anchorNode;o;o=Oi(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:Ze(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Up(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.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")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||st&&(e.composing||e.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&&$(f);){if(f.contentEditable=="false"){u.parentNode.removeChild(u);break}f=f.firstChild}}}else if(Pt&&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||HR(e,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ll(r)&&(c=Pf(e))&&c.eq(ce.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Nn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),JR(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,qR(e,l)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Nn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),Ze(f)&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Tt&&cr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?it(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?it(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tm=new WeakMap,nm=!1;function JR(t){if(!tm.has(t)&&(tm.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Pt,nm)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."),nm=!0}}function rm(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return $r(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function QR(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return rm(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?rm(t,n):null}function HR(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function qR(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let o of e)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||!$(l)||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(o,a.firstChild),r==o&&t.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function UR(t,e,n,r){let{node:i,fromOffset:o,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),u,f=c.anchorNode;if(f&&Xr(t.dom,f)&&(u=[{node:f,offset:c.anchorOffset}],ll(c)||u.push({node:c.focusNode,offset:c.focusOffset})),st&&t.input.lastKeyCode===8)for(let A=s;A>o;A--){let x=i.childNodes[A-1],y=x.pmViewDesc;if(x.nodeName=="BR"&&!y){s=A;break}if(!y||y.size)break}let d=t.state.doc,h=t.someProp("domParser")||If.fromSchema(t.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:GR(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 GR=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(ft&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||ft&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},YR=/^(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 VR(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let v=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,T=Pf(t,v);if(T&&!t.state.selection.eq(T)){if(st&&In&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",S=>S(t,Or(13,"Enter"))))return;let R=t.state.tr.setSelection(T);v=="pointer"?R.setMeta("pointer",!0):v=="key"&&R.scrollIntoView(),o&&R.setMeta("composition",o),t.dispatch(R)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=UR(t,e,n,i),u=t.state.doc,f=u.slice(c.from,c.to),d,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,h="end"):(d=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=eN(f.content,c.doc.content,c.from,d,h);if(p&&t.input.domChangeCount++,(Mi&&t.input.lastIOSEnter>Date.now()-225||In)&&i.some(v=>$(v)&&!YR.test(v.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",v=>v(t,Or(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof ue&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.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=im(t,t.state.doc,c.sel);if(v&&!v.eq(t.state.selection)){let T=t.state.tr.setSelection(v);o&&T.setMeta("composition",o),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof ue&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Tt&&cr<=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((Mi&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(v=>v.nodeName=="DIV"||v.nodeName=="P"))||!x&&XR(c.doc,m.pos,g.pos))&&t.someProp("handleKeyDown",v=>v(t,Or(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&$R(u,p.start,p.endA,m,g)&&t.someProp("handleKeyDown",v=>v(t,Or(8,"Backspace")))){In&&st&&t.domObserver.suppressSelectionUpdates();return}st&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),In&&!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(()=>{t.someProp("handleKeyDown",function(v){return v(t,Or(13,"Enter"))})},20));let y=p.start,b=p.endA,C=v=>{let T=v||t.state.tr.replace(y,b,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let R=im(t,T.doc,c.sel);R&&!(st&&t.composing&&R.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(R.head==y||R.head==T.mapping.map(b)-1)||Tt&&R.empty&&R.head==y)&&T.setSelection(R)}return o&&T.setMeta("composition",o),T.scrollIntoView()},w;if(x)if(m.pos==g.pos){Tt&&cr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Nn(t),20));let v=C(t.state.tr.delete(y,b)),T=u.resolve(p.start).marksAcross(u.resolve(p.endA));T&&v.ensureMarks(T),t.dispatch(v)}else if(p.endA==p.endB&&(w=ZR(m.parent.content.cut(m.parentOffset,g.parentOffset),A.parent.content.cut(A.parentOffset,p.endA-A.start())))){let v=C(t.state.tr);w.type=="add"?v.addMark(y,b,w.mark):v.removeMark(y,b,w.mark),t.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),T=()=>C(t.state.tr.insertText(v,y,b));t.someProp("handleTextInput",R=>R(t,y,b,v,T))||t.dispatch(T())}else t.dispatch(C());else t.dispatch(C())}function im(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Lf(t,e.resolve(n.anchor),e.resolve(n.head))}function ZR(t,e){let n=t.firstChild.marks,r=e.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<e.childCount;u++)c.push(l(e.child(u)));if(P.from(c).eq(t))return{mark:a,type:s}}function $R(t,e,n,r,i){if(n-e<=i.pos-r.pos||Zl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Zl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Zl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function XR(t,e,n){let r=0,i=0;return t.nodesBetween(e,n,(o,s)=>{o.isTextblock&&s>=e&&s<n?r++:(o.isText?/\S/.test(o.text.slice(Math.max(0,e-s),Math.min(o.nodeSize,n-s))):o.isLeaf)&&i++}),i==0&&r==1}function Zl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function eN(t,e,n,r,i){let o=t.findDiffStart(e,n),s=n+t.size,a=n+e.size;if(o==null)return null;let{a:l,b:c}=t.findDiffEnd(e,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 dw{constructor(e,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 mR,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(cm),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=am(this),sm(this),this.nodeViews=lm(this),this.docView=jp(this.state.doc,om(this),Vl(this),this.dom,this),this.domObserver=new KR(this,(r,i,o,s)=>VR(this,r,i,o,s)),this.domObserver.start(),gR(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ku(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(cm),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(sw(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=lm(this);nN(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ku(this),this.editable=am(this),sm(this);let l=Vl(this),c=om(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&TE(this);if(s){this.domObserver.stop();let h=f&&(Tt||st)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&tN(i.selection,e.selection);if(f){let m=st?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=DR(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=jp(e.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())&&eR(this)&&p.delaySelUpdate())?Nn(this,h):(qb(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&DE(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!Xr(this.dom,e))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ae){let n=this.docView.domAfterPos(this.state.selection.from);$(n)&&_p(this,n.getBoundingClientRect(),e)}else _p(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.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,e)}}updateDraggedNode(e,n){let r=e.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 lw(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],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[e];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[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Tt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&OE(this.dom),Nn(this),this.domObserver.start()}get root(){let e=this._root;if(e==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 e||document}updateRoot(){this._root=null}posAtCoords(e){return PE(this,e)}coordsAtPos(e,n=1){return Lb(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return KE(this,n||this.state,e)}pasteHTML(e,n){return Mo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Mo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return zf(this,e)}destroy(){this.docView&&(AR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vl(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,wE())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return bR(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?ft&&this.root.nodeType===11&&SE(this.dom.ownerDocument)==this.dom&&QR(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}dw.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function om(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[at.node(0,t.state.doc.content.size,e)]}function sm(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:at.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function am(t){return!t.someProp("editable",e=>e(t.state)===!1)}function tN(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function lm(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function nN(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function cm(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function Fn(t,e){return t.meta={package:"@milkdown/core",group:"System",...e},t}var pw={text:(t,e,n,r)=>{const i=t.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(t,e,n,r)=>{const i=t.marker||n.options.strong||"*",o=n.enter("strong"),s=n.createTracker(r);let a=s.move(i+i);return a+=s.move(n.containerPhrasing(t,{before:a,after:i,...s.current()})),a+=s.move(i+i),o(),a},emphasis:(t,e,n,r)=>{const i=t.marker||n.options.emphasis||"*",o=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(i);return a+=s.move(n.containerPhrasing(t,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}},Tn=ge({},"editorView"),co=ge({},"editorState"),$l=ge([],"initTimer"),um=ge({},"editor"),Fo=ge([],"inputRules"),ei=ge([],"prosePlugins"),_o=ge([],"remarkPlugins"),Po=ge([],"nodeView"),Lo=ge([],"markView"),Jr=ge(xu().use(pu).use(bu),"remark"),bo=ge({handlers:pw,encode:[]},"remarkStringifyOptions"),ia=gn("ConfigReady");function rN(t){const e=n=>(n.record(ia),async()=>(await t(n),n.done(ia),()=>{n.clearTimer(ia)}));return Fn(e,{displayName:"Config"}),e}var wi=gn("InitReady");function iN(t){const e=n=>(n.inject(um,t).inject(ei,[]).inject(_o,[]).inject(Fo,[]).inject(Po,[]).inject(Lo,[]).inject(bo,{handlers:pw,encode:[]}).inject(Jr,xu().use(pu).use(bu)).inject($l,[ia]).record(wi),async()=>{await n.waitTimers($l);const r=n.get(bo);return n.set(Jr,xu().use(pu).use(bu,r)),n.done(wi),()=>{n.remove(um).remove(ei).remove(_o).remove(Fo).remove(Po).remove(Lo).remove(bo).remove(Jr).remove($l).clearTimer(wi)}});return Fn(e,{displayName:"Init"}),e}var At=gn("SchemaReady"),Xl=ge([],"schemaTimer"),rn=ge({},"schema"),wo=ge([],"nodes"),ko=ge([],"marks");function fm(t){return{...t,parseDOM:t.parseDOM?.map(e=>({priority:t.priority,...e}))}}var mw=t=>(t.inject(rn,{}).inject(wo,[]).inject(ko,[]).inject(Xl,[wi]).record(At),async()=>{await t.waitTimers(Xl);const e=t.get(Jr),n=t.get(_o).reduce((s,a)=>s.use(a.plugin,a.options),e);t.set(Jr,n);const r=Object.fromEntries(t.get(wo).map(([s,a])=>[s,fm(a)])),i=Object.fromEntries(t.get(ko).map(([s,a])=>[s,fm(a)])),o=new zS({nodes:r,marks:i});return t.set(rn,o),t.done(At),()=>{t.remove(rn).remove(wo).remove(ko).remove(Xl).clearTimer(At)}});Fn(mw,{displayName:"Schema"});var gw=class{constructor(){this.#t=new UA,this.#e=null,this.setCtx=t=>{this.#e=t},this.chain=()=>{if(this.#e==null)throw Il();const t=this.#e,e=[],n=this.get.bind(this),r={run:()=>{const o=Li(...e),s=t.get(Tn);return o(s.state,s.dispatch,s)},inline:o=>(e.push(o),r),pipe:i.bind(this)};function i(o,s){const a=n(o);return e.push(a(s)),r}return r}}#t;#e;get ctx(){return this.#e}create(t,e){const n=t.create(this.#t.sliceMap);return n.set(e),n}get(t){return this.#t.get(t).get()}remove(t){return this.#t.remove(t)}call(t,e){if(this.#e==null)throw Il();const n=this.get(t)(e),r=this.#e.get(Tn);return n(r.state,r.dispatch,r)}inline(t){if(this.#e==null)throw Il();const e=this.#e.get(Tn);return t(e.state,e.dispatch,e)}};function oN(t="cmdKey"){return ge((()=>()=>!1),t)}var Ie=ge(new gw,"commands"),ec=ge([At],"commandsTimer"),xo=gn("CommandsReady"),Aw=t=>{const e=new gw;return e.setCtx(t),t.inject(Ie,e).inject(ec,[At]).record(xo),async()=>(await t.waitTimers(ec),t.done(xo),()=>{t.remove(Ie).remove(ec).clearTimer(xo)})};Fn(Aw,{displayName:"Commands"});function sN(t){return t.Backspace=Li(jI,Df,wI,fb),t}var yw=class{constructor(){this.#t=null,this.#e=[],this.setCtx=t=>{this.#t=t},this.add=t=>(this.#e.push(t),()=>{this.#e=this.#e.filter(e=>e!==t)}),this.addObjectKeymap=t=>{const e=[];return Object.entries(t).forEach(([n,r])=>{if(typeof r=="function"){const i={key:n,onRun:()=>r};this.#e.push(i),e.push(()=>{this.#e=this.#e.filter(o=>o!==i)})}else this.#e.push(r),e.push(()=>{this.#e=this.#e.filter(i=>i!==r)})}),()=>{e.forEach(n=>n())}},this.addBaseKeymap=()=>{const t=sN(PI);return this.addObjectKeymap(t)},this.build=()=>{const t={};return this.#e.forEach(e=>{t[e.key]=[...t[e.key]||[],e]}),Object.fromEntries(Object.entries(t).map(([e,n])=>{const r=n.sort((o,s)=>(s.priority??50)-(o.priority??50));return[e,(o,s,a)=>{const l=this.#t;if(l==null)throw Za();const c=r.map(u=>u.onRun(l));return Li(...c)(o,s,a)}]}))}}#t;#e;get ctx(){return this.#t}},Da=ge(new yw,"keymap"),tc=ge([At],"keymapTimer"),Co=gn("KeymapReady"),aN=t=>{const e=new yw;return e.setCtx(t),t.inject(Da,e).inject(tc,[At]).record(Co),async()=>(await t.waitTimers(tc),t.done(Co),()=>{t.remove(Da).remove(tc).clearTimer(Co)})},oa=gn("ParserReady"),bw=(()=>{throw Za()}),sa=ge(bw,"parser"),nc=ge([],"parserTimer"),ww=t=>(t.inject(sa,bw).inject(nc,[At]).record(oa),async()=>{await t.waitTimers(nc);const e=t.get(Jr),n=t.get(rn);return t.set(sa,AE.create(n,e)),t.done(oa),()=>{t.remove(sa).remove(nc).clearTimer(oa)}});Fn(ww,{displayName:"Parser"});var aa=gn("SerializerReady"),rc=ge([],"serializerTimer"),kw=(()=>{throw Za()}),la=ge(kw,"serializer"),xw=t=>(t.inject(la,kw).inject(rc,[At]).record(aa),async()=>{await t.waitTimers(rc);const e=t.get(Jr),n=t.get(rn);return t.set(la,bE.create(n,e)),t.done(aa),()=>{t.remove(la).remove(rc).clearTimer(aa)}});Fn(xw,{displayName:"Serializer"});var ic=ge("","defaultValue"),oc=ge(t=>t,"stateOptions"),sc=ge([],"editorStateTimer"),ca=gn("EditorStateReady");function lN(t,e,n){if(typeof t=="string")return e(t);if(t.type==="html")return If.fromSchema(n).parse(t.dom);if(t.type==="json")return Rn.fromJSON(n,t.value);throw M1(t)}var cN=new Lt("MILKDOWN_STATE_TRACKER"),Cw=t=>(t.inject(ic,"").inject(co,{}).inject(oc,e=>e).inject(sc,[oa,aa,xo,Co]).record(ca),async()=>{await t.waitTimers(sc);const e=t.get(rn),n=t.get(sa),r=t.get(Fo),i=t.get(oc),o=t.get(ei),s=lN(t.get(ic),n,e),a=t.get(Da),l=a.addBaseKeymap(),c=[...o,new xt({key:cN,state:{init:()=>{},apply:(d,h,p,m)=>{t.set(co,m)}}}),GI({rules:r}),mE(a.build())];t.set(ei,c);const u=i({schema:e,doc:s,plugins:c}),f=yi.create(u);return t.set(co,f),t.done(ca),()=>{l(),t.remove(ic).remove(co).remove(oc).remove(sc).clearTimer(ca)}});Fn(Cw,{displayName:"EditorState"});var zo=ge([],"pasteRule"),ac=ge([At],"pasteRuleTimer"),ua=gn("PasteRuleReady"),vw=t=>(t.inject(zo,[]).inject(ac,[At]).record(ua),async()=>(await t.waitTimers(ac),t.done(ua),()=>{t.remove(zo).remove(ac).clearTimer(ua)}));Fn(vw,{displayName:"PasteRule"});var lc=gn("EditorViewReady"),cc=ge([],"editorViewTimer"),uc=ge({},"editorViewOptions"),fc=ge(null,"root"),Ju=ge(null,"rootDOM"),Qu=ge({},"rootAttrs");function uN(t,e){const n=document.createElement("div");n.className="milkdown",t.appendChild(n),e.set(Ju,n);const r=e.get(Qu);return Object.entries(r).forEach(([i,o])=>n.setAttribute(i,o)),n}function fN(t){t.classList.add("editor"),t.setAttribute("role","textbox")}var hN=new Lt("MILKDOWN_VIEW_CLEAR"),Sw=t=>(t.inject(fc,document.body).inject(Tn,{}).inject(uc,{}).inject(Ju,null).inject(Qu,{}).inject(cc,[ca,ua]).record(lc),async()=>{await t.wait(wi);const e=t.get(fc)||document.body,n=typeof e=="string"?document.querySelector(e):e;t.update(ei,l=>[new xt({key:hN,view:c=>{const u=n?uN(n,t):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 t.waitTimers(cc);const r=t.get(co),i=t.get(uc),o=Object.fromEntries(t.get(Po)),s=Object.fromEntries(t.get(Lo)),a=new dw(n,{state:r,nodeViews:o,markViews:s,transformPasted:(l,c,u)=>(t.get(zo).sort((f,d)=>(d.priority??50)-(f.priority??50)).map(f=>f.run).forEach(f=>{l=f(l,c,u)}),l),...i});return fN(a.dom),t.set(Tn,a),t.done(lc),()=>{a?.destroy(),t.remove(fc).remove(Tn).remove(uc).remove(Ju).remove(Qu).remove(cc).clearTimer(lc)}});Fn(Sw,{displayName:"EditorView"});var JL=(function(t){return t.Idle="Idle",t.OnCreate="OnCreate",t.Created="Created",t.OnDestroy="OnDestroy",t.Destroyed="Destroyed",t})({}),QL=class Iw{constructor(){this.#t=!1,this.#e="Idle",this.#r=[],this.#n=()=>{},this.#o=new UA,this.#s=new q1,this.#i=new Map,this.#a=new Map,this.#l=new H1(this.#o,this.#s),this.#d=()=>{const e=rN(async r=>{await Promise.all(this.#r.map(i=>Promise.resolve(i(r))))}),n=[mw,ww,xw,Aw,aN,vw,Cw,Sw,iN(this),e];this.#u(n,this.#a)},this.#u=(e,n)=>{e.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=(e,n=!1)=>Promise.all([e].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([e,{cleanup:n}])=>typeof n=="function"?n():n)),this.#a.clear()},this.#c=e=>{this.#e=e,this.#n(e)},this.#h=e=>[...e.entries()].map(async([n,r])=>{const{ctx:i,handler:o}=r;if(!o)return;const s=await o();e.set(n,{ctx:i,handler:o,cleanup:s})}),this.enableInspector=(e=!0)=>(this.#t=e,this),this.onStatusChange=e=>(this.#n=e,this),this.config=e=>(this.#r.push(e),this),this.removeConfig=e=>(this.#r=this.#r.filter(n=>n!==e),this),this.use=e=>{const n=[e].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 e=>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(e))},50)})):(await this.#f([e].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(e=!1)=>this.#e==="Destroyed"||this.#e==="OnDestroy"?this:this.#e==="OnCreate"?new Promise(n=>{setTimeout(()=>{n(this.destroy(e))},50)}):(e&&(this.#r=[]),this.#c("OnDestroy"),await this.#f([...this.#i.keys()],e),await this.#p(),this.#c("Destroyed"),this),this.action=e=>e(this.#l),this.inspect=()=>this.#t?[...this.#a.values(),...this.#i.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new Iw}#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 Ew(t,e,n){const r=t.findIndex(([o])=>o===e);if(r===-1)return[...t,n];const i=t.slice();return i[r]=n,i}function fe(t,e){const n=oN(t),r=i=>async()=>{r.key=n,await i.wait(xo);const o=e(i);return i.get(Ie).create(n,o),r.run=s=>i.get(Ie).call(t,s),()=>{i.get(Ie).remove(n)}};return r}function Ot(t){const e=n=>async()=>{await n.wait(At);const r=t(n);return n.update(Fo,i=>[...i,r]),e.inputRule=r,()=>{n.update(Fo,i=>i.filter(o=>o!==r))}};return e}function dN(t){const e=n=>async()=>{await n.wait(At);const r=t(n);return n.update(zo,i=>[...i,r]),e.pasteRule=r,()=>{n.update(zo,i=>i.filter(o=>o!==r))}};return e}function pN(t,e){const n=r=>async()=>{const i=e(r);return r.update(ko,o=>Ew(o,t,[t,i])),n.id=t,n.schema=i,()=>{r.update(ko,o=>o.filter(([s])=>s!==t))}};return n.type=r=>{const i=r.get(rn).marks[t];if(!i)throw j1(t);return i},n}function Hf(t,e){const n=r=>async()=>{const i=e(r);return r.update(wo,o=>Ew(o,t,[t,i])),n.id=t,n.schema=i,()=>{r.update(wo,o=>o.filter(([s])=>s!==t))}};return n.type=r=>{const i=r.get(rn).nodes[t];if(!i)throw W1(t);return i},n}function on(t){let e;const n=r=>async()=>(await r.wait(At),e=t(r),r.update(ei,i=>[...i,e]),()=>{r.update(ei,i=>i.filter(o=>o!==e))});return n.plugin=()=>e,n.key=()=>e.spec.key,n}function mN(t){const e=n=>async()=>{await n.wait(Co);const r=n.get(Da),i=t(n),o=r.addObjectKeymap(i);return e.keymap=i,()=>{o()}};return e}function Rw(t,e){const n=r=>async()=>{await r.wait(At);const i=e(r);return t.type(r)instanceof va?r.update(Po,o=>[...o,[t.id,i]]):r.update(Lo,o=>[...o,[t.id,i]]),n.view=i,n.type=t,()=>{t.type(r)instanceof va?r.update(Po,o=>o.filter(s=>s[0]!==t.id)):r.update(Lo,o=>o.filter(s=>s[0]!==t.id))}};return n}function _n(t,e){const n=ge(t,e),r=i=>(i.inject(n),()=>()=>{i.remove(n)});return r.key=n,r}function Qe(t,e){const n=_n(e,t),r=Hf(t,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=>Qe(t,o(e)),i}function Pn(t,e){const n=_n(e,t),r=pN(t,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=>Pn(t,o(e)),i}function zt(t,e){const n=_n(Object.fromEntries(Object.entries(e).map(([o,{shortcuts:s,priority:a}])=>[o,{shortcuts:s,priority:a}])),`${t}Keymap`),r=mN(o=>{const s=o.get(n.key),a=Object.entries(e).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 sn=(t,e=()=>({}))=>_n(e,`${t}Attr`),ps=(t,e=()=>({}))=>_n(e,`${t}Attr`);function Wt(t,e,n){const r=_n({},t),i=s=>async()=>{await s.wait(wi);const a={plugin:e(s),options:s.get(r.key)};return s.update(_o,l=>[...l,a]),()=>{s.update(_o,l=>l.filter(c=>c!==a))}},o=[r,i];return o.id=t,o.plugin=i,o.options=r,o}function HL(){return t=>{const e=document.createElement("div"),n=t.get(rn),r=t.get(Tn),i=Ar.fromSchema(n).serializeFragment(r.state.doc.content);return e.appendChild(i),e.innerHTML}}function qL(t){return e=>{const n=e.get(Tn);return e.get(rn),e.get(la)(n.state.doc)}}function gN(t,e){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!=t)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let f=P.empty,d=i.index(-1)?1:i.index(-2)?2:3;for(let A=i.depth-d;A>=i.depth-3;A--)f=P.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(P.from(t.createAndFill()));let p=i.before(i.depth-(d-1)),m=n.tr.replace(p,i.after(-h),new Q(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(ce.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 go(c.doc,i.pos,2,u)?(r&&r(c.split(i.pos,2,u).scrollIntoView()),!0):!1}}function AN(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?yN(e,n,t,o):bN(e,n,o):!0:!1}}function yN(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new ut(o-1,s,o,s,new Q(P.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ly(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=nl(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return rl(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function bN(t,e,n){let r=t.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?P.empty:P.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new ut(f-(a?1:0),d+(l?1:0),f+1,d-1,new Q((a?P.empty:P.from(i.copy(P.empty))).append(l?P.empty:P.from(i.copy(P.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function wN(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);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!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=P.from(c?t.create():null),f=new Q(P.from(t.create(null,P.from(a.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;n(e.tr.step(new ut(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function kN(t){const e=new Map;if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return Pi(t,"definition",function(r){const i=hm(r.identifier);i&&!e.get(i)&&e.set(i,r)}),n;function n(r){const i=hm(r);return e.get(i)}}function hm(t){return String(t||"").toUpperCase()}function xN(){return function(t){const e=kN(t);Pi(t,function(n,r,i){if(n.type==="definition"&&i!==void 0&&typeof r=="number")return i.children.splice(r,1),[ba,r];if(n.type==="imageReference"||n.type==="linkReference"){const o=e(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},[ba,r]}})}}function CN(t){const e={...t};return e.position&&(e.position={start:{...e.position.start},end:{...e.position.end}}),delete e.children,e}var vN="<br />",SN=/^<br\s*\/?\s*>$/i,IN=t=>typeof t=="string"&&SN.test(t.trim());function Nw(t,e){if(!(e.childCount>=1&&e.lastChild?.type.name==="hardbreak")){t.next(e.content);return}const n=[];e.content.forEach((r,i,o)=>{o!==e.childCount-1&&n.push(r)}),t.next(P.fromArray(n))}function B(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-commonmark",...e}}),t}var qf=ps("emphasis");B(qf,{displayName:"Attr<emphasis>",group:"Emphasis"});var zi=Pn("emphasis",t=>({attrs:{marker:{default:t.get(bo).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",t.get(qf.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,n,r)=>{e.openMark(r,{marker:n.marker}),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,n)=>{e.withMark(n,"emphasis",void 0,{marker:n.attrs.marker})}}}));B(zi.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});B(zi.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var Uf=fe("ToggleEmphasis",t=>()=>sl(zi.type(t)));B(Uf,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var Tw=Ot(t=>cs(/(?:^|[^*])\*([^*]+)\*$/,zi.type(t),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:n})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:n+1}}));B(Tw,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var Dw=Ot(t=>cs(/\b_(?![_\s])(.*?[^_\s])_$/,zi.type(t),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:n})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:n+1}}));B(Dw,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var Gf=zt("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:t=>{const e=t.get(Ie);return()=>e.call(Uf.key)}}});B(Gf.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});B(Gf.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var Yf=ps("strong");B(Yf,{displayName:"Attr<strong>",group:"Strong"});var ms=Pn("strong",t=>({attrs:{marker:{default:t.get(bo).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",t.get(Yf.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,n,r)=>{e.openMark(r,{marker:n.marker}),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,n)=>{e.withMark(n,"strong",void 0,{marker:n.attrs.marker})}}}));B(ms.mark,{displayName:"MarkSchema<strong>",group:"Strong"});B(ms.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var Vf=fe("ToggleStrong",t=>()=>sl(ms.type(t)));B(Vf,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var Ow=Ot(t=>cs(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),ms.type(t),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));B(Ow,{displayName:"InputRule<strong>",group:"Strong"});var Zf=zt("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:t=>{const e=t.get(Ie);return()=>e.call(Vf.key)}}});B(Zf.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});B(Zf.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var $f=ps("inlineCode");B($f,{displayName:"Attr<inlineCode>",group:"InlineCode"});var ar=Pn("inlineCode",t=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:e=>["code",t.get($f.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,n,r)=>{e.openMark(r),e.addText(n.value),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,n,r)=>(e.withMark(n,"inlineCode",r.text||""),!0)}}));B(ar.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});B(ar.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var Xf=fe("ToggleInlineCode",t=>()=>(e,n)=>{const{selection:r,tr:i}=e;if(r.empty)return!1;const{from:o,to:s}=r;return e.doc.rangeHasMark(o,s,ar.type(t))?(n?.(i.removeMark(o,s,ar.type(t))),!0):(Object.keys(e.schema.marks).filter(a=>a!==ar.type.name).map(a=>e.schema.marks[a]).forEach(a=>{i.removeMark(o,s,a)}),n?.(i.addMark(o,s,ar.type(t).create())),!0)});B(Xf,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var Mw=Ot(t=>cs(/(?:`)([^`]+)(?:`)$/,ar.type(t)));B(Mw,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var eh=zt("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:t=>{const e=t.get(Ie);return()=>e.call(Xf.key)}}});B(eh.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});B(eh.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var EN=new Set(["http:","https:","mailto:","tel:","ftp:"]);function RN(t){return t<=32||t>=127&&t<=160||t>=8203&&t<=8205||t===8232||t===8233||t===65279}function NN(t){let e="";for(const n of t)RN(n.codePointAt(0)??0)||(e+=n);return e}function TN(t){if(typeof t!="string")return"";const e=t.trim();if(!e)return"";const n=NN(e),r=/^([a-z][a-z0-9+.-]*):/i.exec(n)?.[1];return!r||EN.has(`${r.toLowerCase()}:`)?e:""}var th=ps("link");B(th,{displayName:"Attr<link>",group:"Link"});var ki=Pn("link",t=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...t.get(th.key)(e),...e.attrs,href:TN(e.attrs.href)}],parseMarkdown:{match:e=>e.type==="link",runner:(e,n,r)=>{const i=n.url,o=n.title;e.openMark(r,{href:i,title:o}),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,n)=>{e.withMark(n,"link",void 0,{title:n.attrs.title,url:n.attrs.href})}}}));B(ki.mark,{displayName:"MarkSchema<link>",group:"Link"});var Bw=fe("ToggleLink",t=>(e={})=>sl(ki.type(t),e));B(Bw,{displayName:"Command<toggleLinkCommand>",group:"Link"});var Fw=fe("UpdateLink",t=>(e={})=>(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(ki.type(t).isInSet(p.marks))return i=p,o=m,!1}),!i)return!1;const c=i.marks.find(({type:p})=>p===ki.type(t));if(!c)return!1;const u=o,f=o+i.nodeSize,{tr:d}=n,h=ki.type(t).create({...c.attrs,...e});return h?(r(d.removeMark(u,f,c).addMark(u,f,h).setSelection(new ue(d.selection.$anchor)).scrollIntoView()),!0):!1});B(Fw,{displayName:"Command<updateLinkCommand>",group:"Link"});var _w=Hf("doc",()=>({content:"block+",parseMarkdown:{match:({type:t})=>t==="root",runner:(t,e,n)=>{t.injectRoot(e,n)}},toMarkdown:{match:t=>t.type.name==="doc",runner:(t,e)=>{t.openNode("root");const n=e.childCount>0?e.child(e.childCount-1):null,r=n?.type.name==="paragraph"&&n.content.size===0?e.content.cut(0,e.content.size-n.nodeSize):e.content;t.next(r)}}}));B(_w,{displayName:"NodeSchema<doc>",group:"Doc"});var Pw=Object.freeze(["root","blockquote","listItem","footnoteDefinition"]),DN=new Set(["paragraph","heading","tableCell","link","linkReference","emphasis","strong","delete","footnote"]),Oa=_n(Pw,"blockContainerTypes");B(Oa,{displayName:"Ctx<blockContainerTypes>",group:"Remark"});var dm=new Set;function Lw(t){const e=t.isInjected(Oa.key)?t.get(Oa.key):Pw,n=new Set;for(const r of e){if(DN.has(r)){dm.has(r)||(dm.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 ON=new Set(["paragraph","tableCell"]);function MN(t,e){return wf(t,n=>n.type==="html"&&IN(n.value),(n,r)=>{const i=r[r.length-1];if(i){if(ON.has(i.type)){i.children.length===1&&(i.children=[]);return}if(e.has(i.type)){const o=n;return o.children=[],delete o.value,o.type="paragraph",ba}}})}var fl=Wt("remark-preserve-empty-line",t=>()=>e=>MN(e,Lw(t)));B(fl.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});B(fl.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var nh=sn("paragraph");B(nh,{displayName:"Attr<paragraph>",group:"Paragraph"});var pn=Qe("paragraph",t=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",t.get(nh.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,n,r)=>{e.openNode(r),n.children?e.next(n.children):e.addText(n.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,n)=>{e.openNode("paragraph"),(!n.content||n.content.size===0)&&BN(t)?e.addNode("html",void 0,vN):Nw(e,n),e.closeNode()}}}));function BN(t){return t.isInjected(fl.options.key)}B(pn.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});B(pn.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var rh=fe("TurnIntoText",t=>()=>Do(pn.type(t)));B(rh,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var ih=zt("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:t=>{const e=t.get(Ie);return()=>e.call(rh.key)}}});B(ih.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});B(ih.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var FN=Array(6).fill(0).map((t,e)=>e+1);function _N(t){return t.textContent.toLowerCase().trim().replace(/\s+/g,"-")}var hl=_n(_N,"headingIdGenerator");B(hl,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var oh=sn("heading");B(oh,{displayName:"Attr<heading>",group:"Heading"});var ii=Qe("heading",t=>{const e=t.get(hl.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:FN.map(n=>({tag:`h${n}`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw mn(r);return{level:n,id:r.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...t.get(oh.key)(n),id:n.attrs.id||e(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}),Nw(n,r),n.closeNode()}}}});B(ii.node,{displayName:"NodeSchema<heading>",group:"Heading"});B(ii.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var zw=Ot(t=>gb(/^(?<hashes>#+)\s$/,ii.type(t),e=>{const n=e.groups?.hashes?.length||0,{$from:r}=t.get(Tn).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}}));B(zw,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var nr=fe("WrapInHeading",t=>e=>(e??=1,e<1?Do(pn.type(t)):Do(ii.type(t),{level:e})));B(nr,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var sh=fe("DowngradeHeading",t=>()=>(e,n,r)=>{const{$from:i}=e.selection,o=i.node();if(o.type!==ii.type(t)||!e.selection.empty||i.parentOffset!==0)return!1;const s=o.attrs.level-1;return s?(n?.(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...o.attrs,level:s})),!0):Do(pn.type(t))(e,n)});B(sh,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var ah=zt("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:t=>{const e=t.get(Ie);return()=>e.call(nr.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:t=>{const e=t.get(Ie);return()=>e.call(sh.key)}}});B(ah.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});B(ah.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var lh=sn("blockquote");B(lh,{displayName:"Attr<blockquote>",group:"Blockquote"});var gs=Qe("blockquote",t=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",t.get(lh.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,n,r)=>{e.openNode(r).next(n.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,n)=>{e.openNode("blockquote").next(n.content).closeNode()}}}));B(gs.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});B(gs.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var Ww=Ot(t=>Ff(/^\s*>\s$/,gs.type(t)));B(Ww,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var ch=fe("WrapInBlockquote",t=>()=>Bf(gs.type(t)));B(ch,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var uh=zt("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:t=>{const e=t.get(Ie);return()=>e.call(ch.key)}}});B(uh.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});B(uh.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var fh=sn("codeBlock",()=>({pre:{},code:{}}));B(fh,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var As=Qe("code_block",t=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{language:e.dataset.language}}}],toDOM:e=>{const n=t.get(fh.key)(e),r=e.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return["pre",{...n.pre,...i},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,n,r)=>{const i=n.lang??"",o=n.value;e.openNode(r,{language:i}),o&&e.addText(o),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,n)=>{e.addNode("code",void 0,n.content.firstChild?.text||"",{lang:n.attrs.language})}}}));B(As.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});B(As.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var jw=Ot(t=>gb(/^```(?<language>[a-z]*)?[\s\n]$/,As.type(t),e=>({language:e.groups?.language??""})));B(jw,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var hh=fe("CreateCodeBlock",t=>(e="")=>Do(As.type(t),{language:e}));B(hh,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var PN=fe("UpdateCodeBlockLanguage",()=>({pos:t,language:e}={pos:-1,language:""})=>(n,r)=>t>=0?(r?.(n.tr.setNodeAttribute(t,"language",e)),!0):!1);B(PN,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var dh=zt("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:t=>{const e=t.get(Ie);return()=>e.call(hh.key)}}});B(dh.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});B(dh.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var ph=sn("image");B(ph,{displayName:"Attr<image>",group:"Image"});var Wi=Qe("image",t=>({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:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...t.get(ph.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,n,r)=>{const i=n.url,o=n.alt??"",s=n.title??"";e.addNode(r,{src:i,alt:o,title:s})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,n)=>{e.addNode("image",void 0,void 0,{title:n.attrs.title,url:n.attrs.src,alt:n.attrs.alt})}}}));B(Wi.node,{displayName:"NodeSchema<image>",group:"Image"});B(Wi.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var Kw=fe("InsertImage",t=>(e={})=>(n,r)=>{if(!r)return!0;const{src:i="",alt:o="",title:s=""}=e,a=Wi.type(t).create({src:i,alt:o,title:s});return a&&r(n.tr.replaceSelectionWith(a).scrollIntoView()),!0});B(Kw,{displayName:"Command<insertImageCommand>",group:"Image"});var Jw=fe("UpdateImage",t=>(e={})=>(n,r)=>{const i=sE(n.selection,Wi.type(t));if(!i)return!1;const{node:o,pos:s}=i,a={...o.attrs},{src:l,alt:c,title:u}=e;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});B(Jw,{displayName:"Command<updateImageCommand>",group:"Image"});var LN=Ot(t=>new Ct(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,n,r,i)=>{const[o,s,a="",l]=n;return o?e.tr.replaceWith(r,i,Wi.type(t).create({src:a,alt:s,title:l})):null}));B(LN,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var Ma=sn("hardbreak",t=>({"data-type":"hardbreak","data-is-inline":t.attrs.isInline}));B(Ma,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var Qr=Qe("hardbreak",t=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",t.get(Ma.key)(e)," "]:["br",t.get(Ma.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,n,r)=>{e.addNode(r,{isInline:!!n.data?.isInline})}},leafText:()=>`
48
+ `,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,n)=>{n.attrs.isInline?e.addNode("text",void 0,`
49
+ `):e.addNode("break")}}}));B(Qr.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});B(Qr.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var mh=fe("InsertHardbreak",t=>()=>(e,n)=>{const{selection:r,tr:i}=e;if(!(r instanceof ue))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,e.schema.node("paragraph")).setSelection(ce.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta("hardbreak",!0).replaceSelectionWith(Qr.type(t).create()).scrollIntoView()),!0});B(mh,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var gh=zt("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:t=>{const e=t.get(Ie);return()=>e.call(mh.key)}}});B(gh.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});B(gh.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var Ah=sn("hr");B(Ah,{displayName:"Attr<hr>",group:"Hr"});var ys=Qe("hr",t=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",t.get(Ah.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,n,r)=>{e.addNode(r)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));B(ys.node,{displayName:"NodeSchema<hr>",group:"Hr"});B(ys.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var Qw=Ot(t=>new Ct(/^(?:---|___\s|\*\*\*\s)$/,(e,n,r,i)=>{const{tr:o}=e;return n[0]&&o.replaceWith(r-1,i,ys.type(t).create()),o}));B(Qw,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var Hw=fe("InsertHr",t=>()=>(e,n)=>{if(!n)return!0;const r=pn.node.type(t).create(),{tr:i,selection:o}=e,{from:s}=o,a=ys.type(t).create();if(!a)return!0;const l=i.replaceSelectionWith(a).insert(s,r),c=ce.findFrom(l.doc.resolve(s),1,!0);return c&&n(l.setSelection(c).scrollIntoView()),!0});B(Hw,{displayName:"Command<insertHrCommand>",group:"Hr"});var yh=sn("bulletList");B(yh,{displayName:"Attr<bulletList>",group:"BulletList"});var ji=Qe("bullet_list",t=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...t.get(yh.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:n})=>e==="list"&&!n,runner:(e,n,r)=>{const i=n.spread??!1;e.openNode(r,{spread:i}).next(n.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,n)=>{e.openNode("list",void 0,{ordered:!1,spread:n.attrs.spread}).next(n.content).closeNode()}}}));B(ji.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});B(ji.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var qw=Ot(t=>Ff(/^\s*([-+*])\s$/,ji.type(t)));B(qw,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var bh=fe("WrapInBulletList",t=>()=>Bf(ji.type(t)));B(bh,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var wh=zt("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:t=>{const e=t.get(Ie);return()=>e.call(bh.key)}}});B(wh.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});B(wh.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var kh=sn("orderedList");B(kh,{displayName:"Attr<orderedList>",group:"OrderedList"});var Ki=Qe("ordered_list",t=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{spread:e.dataset.spread==="true",order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...t.get(kh.key)(e),...e.attrs.order===1?{}:{start:e.attrs.order},"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:n})=>e==="list"&&!!n,runner:(e,n,r)=>{const i=n.spread??!0;e.openNode(r,{spread:i,order:n.start??1}).next(n.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,n)=>{e.openNode("list",void 0,{ordered:!0,start:n.attrs.order??1,spread:n.attrs.spread}),e.next(n.content),e.closeNode()}}}));B(Ki.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});B(Ki.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var Uw=Ot(t=>Ff(/^\s*(\d+)\.\s$/,Ki.type(t),e=>({order:Number(e[1])}),(e,n)=>n.childCount+n.attrs.order===Number(e[1])));B(Uw,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var xh=fe("WrapInOrderedList",t=>()=>Bf(Ki.type(t)));B(xh,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var Ch=zt("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:t=>{const e=t.get(Ie);return()=>e.call(xh.key)}}});B(Ch.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});B(Ch.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var vh=sn("listItem");B(vh,{displayName:"Attr<listItem>",group:"ListItem"});var Ln=Qe("list_item",t=>({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:e=>{if(!(e instanceof HTMLElement))throw mn(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...t.get(vh.key)(e),"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e})=>e==="listItem",runner:(e,n,r)=>{const i=n.label!=null?`${n.label}.`:"•",o=n.label!=null?"ordered":"bullet",s=n.spread??!0;e.openNode(r,{label:i,listType:o,spread:s}),e.next(n.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="list_item",runner:(e,n)=>{e.openNode("listItem",void 0,{spread:n.attrs.spread}),e.next(n.content),e.closeNode()}}}));B(Ln.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});B(Ln.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var Sh=fe("SinkListItem",t=>()=>wN(Ln.type(t)));B(Sh,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var Ih=fe("LiftListItem",t=>()=>AN(Ln.type(t)));B(Ih,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var Eh=fe("SplitListItem",t=>()=>gN(Ln.type(t)));B(Eh,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function zN(t){return(e,n,r)=>{const{selection:i}=e;if(!(i instanceof ue))return!1;const{empty:o,$from:s}=i;return!o||s.parentOffset!==0||s.node(-1).type!==Ln.type(t)?!1:ub(e,n,r)}}var Rh=fe("LiftFirstListItem",t=>()=>zN(t));B(Rh,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var Nh=zt("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:t=>{const e=t.get(Ie);return()=>e.call(Eh.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:t=>{const e=t.get(Ie);return()=>e.call(Sh.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:t=>{const e=t.get(Ie);return()=>e.call(Ih.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:t=>{const e=t.get(Ie);return()=>e.call(Rh.key)}}});B(Nh.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});B(Nh.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var Gw=Hf("text",()=>({group:"inline",parseMarkdown:{match:({type:t})=>t==="text",runner:(t,e)=>{t.addText(e.value)}},toMarkdown:{match:t=>t.type.name==="text",runner:(t,e)=>{t.addNode("text",void 0,e.text)}}}));B(Gw,{displayName:"NodeSchema<text>",group:"Text"});var Th=sn("html");B(Th,{displayName:"Attr<html>",group:"Html"});var Dh=Qe("html",t=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{const n=document.createElement("span"),r={...t.get(Th.key)(e),"data-value":e.attrs.value,"data-type":"html"};return n.textContent=e.attrs.value,["span",r,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,n,r)=>{e.addNode(r,{value:n.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,n)=>{e.addNode("html",void 0,n.attrs.value)}}}));B(Dh.node,{displayName:"NodeSchema<html>",group:"Html"});B(Dh.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var WN=[_w,nh,pn,hl,oh,ii,Ma,Qr,lh,gs,fh,As,Ah,ys,ph,Wi,yh,ji,kh,Ki,vh,Ln,qf,zi,Yf,ms,$f,ar,th,ki,Th,Dh,Gw].flat(),jN=[Ww,qw,Uw,jw,Qw,zw].flat(),KN=[Tw,Dw,Mw,Ow],JN=fe("IsMarkSelected",()=>t=>e=>{if(!t)return!1;const{doc:n,selection:r}=e;return n.rangeHasMark(r.from,r.to,t)}),QN=fe("IsNoteSelected",()=>t=>e=>t?aE(e,t).hasNode:!1),HN=fe("ClearTextInCurrentBlock",()=>()=>(t,e)=>{let n=t.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),e?.(n),!0)}),qN=fe("SetBlockType",()=>t=>(e,n)=>{const{nodeType:r,attrs:i=null}=t??{};if(!r)return!1;const o=e.tr,{from:s,to:a}=o.selection;try{o.setBlockType(s,a,r,i)}catch{return!1}return n?.(o),!0}),UN=fe("WrapInBlockType",()=>t=>(e,n)=>{const{nodeType:r,attrs:i=null}=t??{};if(!r)return!1;let o=e.tr;try{const{$from:s,$to:a}=o.selection,l=s.blockRange(a),c=l&&Nf(l,r,i);if(!c)return!1;o=o.wrap(l,c)}catch{return!1}return n?.(o),!0}),GN=fe("AddBlockType",()=>t=>(e,n)=>{const{nodeType:r,attrs:i=null}=t??{};if(!r)return!1;const o=e.tr;try{const s=r instanceof Rn?r:r.createAndFill(i);if(!s)return!1;o.replaceSelectionWith(s)}catch{return!1}return n?.(o),!0}),YN=fe("SelectTextNearPos",()=>t=>(e,n)=>{const{pos:r}=t??{};if(r==null)return!1;const i=(s,a,l)=>Math.min(Math.max(s,a),l),o=e.tr;try{const s=e.doc.resolve(i(r,0,e.doc.content.size));o.setSelection(ue.near(s))}catch{return!1}return n?.(o.scrollIntoView()),!0}),VN=[rh,ch,nr,sh,hh,mh,Hw,Kw,Jw,xh,bh,Sh,Eh,Ih,Rh,Uf,Xf,Vf,Bw,Fw,JN,QN,HN,qN,UN,GN,YN],ZN=[uh,dh,gh,ah,Nh,Ch,wh,ih,Gf,eh,Zf].flat(),Oh=Wt("remarkAddOrderInList",()=>()=>t=>{Pi(t,"list",e=>{if(e.ordered){const n=e.start??1;e.children.forEach((r,i)=>{r.label=i+n})}})});B(Oh.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});B(Oh.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var Mh=Wt("remarkLineBreak",()=>()=>t=>{const e=/[\t ]*(?:\r?\n|\r)/g;Pi(t,"text",(n,r,i)=>{if(!n.value||typeof n.value!="string")return;const o=[];let s=0;e.lastIndex=0;let a=e.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=e.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})});B(Mh.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});B(Mh.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var Bh=Wt("remarkInlineLink",()=>xN);B(Bh.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});B(Bh.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var $N=t=>!!t.children,XN=t=>t.type==="html";function eT(t,e){return n(t,0,null)[0];function n(r,i,o){if($N(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 e(r,i,o)}}var Fh=Wt("remarkHTMLTransformer",t=>()=>e=>{const n=Lw(t);eT(e,(r,i,o)=>XN(r)?(o&&n.has(o.type)&&(r.children=[CN(r)],delete r.value,r.type="paragraph"),[r]):[r])});B(Fh.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});B(Fh.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var _h=Wt("remarkMarker",()=>()=>(t,e)=>{const n=r=>e.value.charAt(r.position.start.offset);Pi(t,r=>["strong","emphasis"].includes(r.type),r=>{r.marker=n(r)})});B(_h.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});B(_h.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var Yw=on(()=>{let t=!1;const e=new Lt("MILKDOWN_INLINE_NODES_CURSOR"),n=new xt({key:e,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)=>t?(t=!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)&&(t=!0),!1),beforeinput:(r,i)=>{if(n.getState(r.state)&&i instanceof InputEvent&&i.data&&!t){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=at.widget(i,o,{side:-1}),a=document.createElement("span"),l=at.widget(i,a);return setTimeout(()=>{o.contentEditable="true",a.contentEditable="true"}),Fe.create(r.doc,[s,l])}return Fe.empty}}});return n});B(Yw,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var Vw=on(t=>new xt({key:new Lt("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,n,r)=>{if(!e.length)return;const[i]=e;if(!i)return;const[o]=i.steps;if(i.getMeta("hardbreak")){if(!(o instanceof Ge))return;const{from:s}=o;return r.tr.setNodeMarkup(s,Qr.type(t),void 0,[])}if(o instanceof Sn){let s=r.tr;const{from:a,to:l}=o;return r.doc.nodesBetween(a,l,(c,u)=>{c.type===Qr.type(t)&&(s=s.setNodeMarkup(u,Qr.type(t),void 0,[]))}),s}}}));B(Vw,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var Ph=_n(["table","code_block"],"hardbreakFilterNodes");B(Ph,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var Zw=on(t=>{const e=t.get(Ph.key);return new xt({key:new Lt("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;)e.includes(a.node(l).type.name)&&(c=!1),l--;return c}return!0}})});B(Zw,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var $w=on(t=>{const e=new Lt("MILKDOWN_HEADING_ID"),n=r=>{if(r.composing)return;const i=t.get(hl.key),o=r.state.tr.setMeta("addToHistory",!1);let s=!1;const a={};r.state.doc.descendants((l,c)=>{if(l.type===ii.type(t)){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(e,!0).setNodeMarkup(c,void 0,{...u,id:f}))}}),s&&r.dispatch(o)};return new xt({key:e,view:r=>(n(r),{update:(i,o)=>{i.state.doc.eq(o.doc)||n(i)}})})});B($w,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var Xw=on(t=>{const e=(n,r,i)=>{if(!i.selection||n.some(f=>f.getMeta("addToHistory")===!1||!f.isGeneric))return null;const o=Ki.type(t),s=ji.type(t),a=Ln.type(t),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,y)=>{if(g.type===a){const b={...g.attrs};l(b,y)&&(c=c.setNodeMarkup(A,void 0,b))}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 xt({key:new Lt("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});B(Xw,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var tT=[Vw,Ph,Zw,Yw,Oa,Oh,Bh,Mh,Fh,_h,fl,$w,Xw].flat(),UL=[WN,jN,KN,VN,ZN,tT].flat();let Hu,qu;if(typeof WeakMap<"u"){let t=new WeakMap;Hu=e=>t.get(e),qu=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Hu=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},qu=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var ve=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="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(t,e){const{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(t){return Hu(t)||qu(t,nT(t))}};function nT(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=rT(t),n=t.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=t.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 y=0;y<A;y++){if(y+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:A-y});break}const b=i+y*e;for(let C=0;C<g;C++){r[b+C]==0?r[b+C]=u:(o||(o=[])).push({type:"collision",row:c,pos:u,n:g-C});const w=x&&x[C];if(w){const v=(b+C)%e*2,T=s[v];T==null||T!=w&&s[v+1]==1?(s[v]=w,s[v+1]=1):T==w&&s[v+1]++}}}i+=g,u+=m.nodeSize}const d=(c+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),u++}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const a=new ve(e,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&&iT(a,s,t),a}function rT(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let s=0;s<r;s++){const a=t.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)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function iT(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.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=e[(i+c)%t.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=oT(l)))[c]=u)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function oT(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function pm(t,e){if(typeof t=="string")return{};const n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(s=>Number(s)):null,i=Number(t.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(const s in e){const a=e[s].getFromDOM,l=a&&a(t);l!=null&&(o[s]=l)}return o}function mm(t,e){const n={};t.attrs.colspan!=1&&(n.colspan=t.attrs.colspan),t.attrs.rowspan!=1&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(","));for(const r in e){const i=e[r].setDOMAttr;i&&i(t.attrs[r],n)}return n}function sT(t){if(t!==null){if(!Array.isArray(t))throw new TypeError("colwidth must be null or an array");for(const e of t)if(typeof e!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function aT(t){const e=t.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:sT}};for(const r in e)n[r]={default:e[r].default,validate:e[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.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:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>pm(r,e)}],toDOM(r){return["td",mm(r,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>pm(r,e)}],toDOM(r){return["th",mm(r,e),0]}}}}function Gt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const ir=new Lt("selectingCells");function Bi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Yt(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function dl(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Bi(e.$head)||lT(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function lT(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Uu(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function cT(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Lh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function e0(t,e,n){const r=t.node(-1),i=ve.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function ti(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function uT(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function fT(t,e,n){const r=Gt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Be=class kn extends ce{constructor(e,n=e){const r=e.node(-1),i=ve.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),a=e.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 sb(a.resolve(d),a.resolve(d+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Uu(r)&&Uu(i)&&Lh(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?kn.rowSelection(r,i):o&&this.isColSelection()?kn.colSelection(r,i):new kn(r,i)}return ue.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=ve.get(e),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=e.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=ti(A,0,m)),g>0&&(A=ti(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(e.child(l).copy(P.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new Q(P.from(a),1,1)}replace(e,n=Q.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?Q.empty:n)}const o=ce.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new Q(P.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=ve.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++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=ve.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=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&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new kn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=ve.get(e),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(e){return e instanceof kn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=ve.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=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&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new kn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new kn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new kn(e.resolve(n),e.resolve(r))}getBookmark(){return new hT(this.$anchorCell.pos,this.$headCell.pos)}};Be.prototype.visible=!1;ce.jsonID("cell",Be);var hT=class t0{constructor(e,n){this.anchor=e,this.head=n}map(e){return new t0(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.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&&Lh(n,r)?new Be(n,r):ce.near(r,1)}};function dT(t){if(!(t.selection instanceof Be))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(at.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Fe.create(t.doc,e)}function pT({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function mT({$from:t,$to:e}){let n,r;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"){n=o;break}}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"){r=o;break}}return n!==r&&e.parentOffset===0}function gT(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,s;if(r instanceof ae&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Be.create(i,r.from);else if(s=="row"){const a=i.resolve(r.from+1);o=Be.rowSelection(a,a)}else if(!n){const a=ve.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=Be.create(i,l+1,c)}}else r instanceof ue&&pT(r)?o=ue.create(i,r.from):r instanceof ue&&mT(r)&&(o=ue.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}const AT=new Lt("fix-tables");function n0(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s<o;s++){const l=e.child(s);for(let c=a,u=Math.min(i,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?n0(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function yT(t,e){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=bT(t,i,o,n))};return e?e.doc!=t.doc&&n0(e.doc,t.doc,0,r):t.doc.descendants(r),n}function bT(t,e,n,r){const i=ve.get(e);if(!i.problems)return r;r||(r=t.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=e.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,ti(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=e.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=e.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+e.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=e.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=Gt(t.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(AT,{fixTables:!0})}function r0(t){const e=ve.get(t),n=[],r=e.height,i=e.width;for(let o=0;o<r;o++){const s=[];for(let a=0;a<i;a++){const l=o*i+a,c=e.map[l];if(o>0){const u=l-i;if(c===e.map[u]){s.push(null);continue}}if(a>0){const u=l-1;if(c===e.map[u]){s.push(null);continue}}s.push(t.nodeAt(c))}n.push(s)}return n}function i0(t,e){const n=[],r=ve.get(t),i=r.height,o=r.width;for(let s=0;s<i;s++){const a=t.child(s),l=[];for(let u=0;u<o;u++){const f=e[s][u];if(!f)continue;const d=r.map[s*r.width+u],h=t.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 t.type.createChecked(t.attrs,n,t.marks)}function o0(t,e,n,r){const i=e[0]>n[0]?-1:1,o=t.splice(e[0],e.length),s=o.length%2===0?1:0;let a;return a=i===-1?n[0]:n[n.length-1]-s,t.splice(a,0,...o),t}function bs(t){return wT(e=>e.type.spec.tableRole==="table",t)}function wT(t,e){for(let n=e.depth;n>=0;n-=1){const r=e.node(n);if(t(r))return{node:r,pos:n===0?0:e.before(n),start:e.start(n),depth:n}}return null}function mi(t,e){const n=bs(e.$from);if(!n)return;const r=ve.get(n.node);if(!(t<0||t>r.width-1))return r.cellsInRect({left:t,right:t+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 gi(t,e){const n=bs(e.$from);if(!n)return;const r=ve.get(n.node);if(!(t<0||t>r.height-1))return r.cellsInRect({left:0,right:r.width,top:t,bottom:t+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 gm(t,e,n=e){let r=e,i=n;for(let u=e;u>=0;u--){const f=mi(u,t.selection);f&&f.forEach(d=>{const h=d.node.attrs.colspan+u-1;h>=r&&(r=u),h>i&&(i=h)})}for(let u=e;u<=i;u++){const f=mi(u,t.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=mi(u,t.selection);f&&f.length>0&&o.push(u)}r=o[0],i=o[o.length-1];const s=mi(r,t.selection),a=gi(0,t.selection);if(!s||!a)return;const l=t.doc.resolve(s[s.length-1].pos);let c;for(let u=i;u>=r;u--){const f=mi(u,t.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:t.doc.resolve(c.pos),indexes:o}}function Am(t,e,n=e){let r=e,i=n;for(let u=e;u>=0;u--){const f=gi(u,t.selection);f&&f.forEach(d=>{const h=d.node.attrs.rowspan+u-1;h>=r&&(r=u),h>i&&(i=h)})}for(let u=e;u<=i;u++){const f=gi(u,t.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=gi(u,t.selection);f&&f.length>0&&o.push(u)}r=o[0],i=o[o.length-1];const s=gi(r,t.selection),a=mi(0,t.selection);if(!s||!a)return;const l=t.doc.resolve(s[s.length-1].pos);let c;for(let u=i;u>=r;u--){const f=gi(u,t.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:t.doc.resolve(c.pos),indexes:o}}function ym(t){return t[0].map((e,n)=>t.map(r=>r[n]))}function kT(t){var e,n;const{tr:r,originIndex:i,targetIndex:o,select:s,pos:a}=t,l=bs(r.doc.resolve(a));if(!l)return!1;const c=(e=gm(r,i))===null||e===void 0?void 0:e.indexes,u=(n=gm(r,o))===null||n===void 0?void 0:n.indexes;if(!c||!u||c.includes(o))return!1;const f=xT(l.node,c,u);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!s)return!0;const d=ve.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(Be.colSelection(g,x)),!0}function xT(t,e,n,r){let i=ym(r0(t));return i=o0(i,e,n),i=ym(i),i0(t,i)}function CT(t){var e,n;const{tr:r,originIndex:i,targetIndex:o,select:s,pos:a}=t,l=bs(r.doc.resolve(a));if(!l)return!1;const c=(e=Am(r,i))===null||e===void 0?void 0:e.indexes,u=(n=Am(r,o))===null||n===void 0?void 0:n.indexes;if(!c||!u||c.includes(o))return!1;const f=vT(l.node,c,u);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!s)return!0;const d=ve.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(Be.rowSelection(g,x)),!0}function vT(t,e,n,r){let i=r0(t);return i=o0(i,e,n),i0(t,i)}function wr(t){const e=t.selection,n=dl(t),r=n.node(-1),i=n.start(-1),o=ve.get(r);return{...e instanceof Be?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function s0(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;fT(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,uT(c.attrs,i-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?Gt(r.type.schema).cell:r.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function ST(t,e){if(!Yt(t))return!1;if(e){const n=wr(t);e(s0(t.tr,n,n.left))}return!0}function IT(t,e){if(!Yt(t))return!1;if(e){const n=wr(t);e(s0(t.tr,n,n.right))}return!0}function ET(t,{map:e,table:n,tableStart:r},i){const o=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+i,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(r+l),null,ti(u,i-e.colCount(l)));else{const f=t.mapping.slice(o).map(r+l);t.delete(f,f+c.nodeSize)}s+=u.rowspan}}function RT(t,e){if(!Yt(t))return!1;if(e){const n=wr(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ET(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=ve.get(o)}e(r)}return!0}function NT(t,{map:e,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=t.mapping.maps.length;t.delete(o+r,s+r);const l=new Set;for(let c=0,u=i*e.width;c<e.width;c++,u++){const f=e.map[u];if(!l.has(f)){if(l.add(f),i>0&&f==e.map[u-e.width]){const d=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i<e.height&&f==e.map[u+e.width]){const d=n.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),m=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(a).map(r+m),p),c+=h.colspan-1}}}}function TT(t,e){if(!Yt(t))return!1;if(e){const n=wr(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;NT(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=ve.get(n.table)}e(r)}return!0}function DT(t,e){return function(n,r){if(!Yt(n))return!1;const i=dl(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const o=n.tr;n.selection instanceof Be?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function OT(t){return function(e,n){if(!Yt(e))return!1;if(n){const r=Gt(e.schema),i=wr(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="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 bm(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function zh(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?OT(t):function(n,r){if(!Yt(n))return!1;if(r){const i=Gt(n.schema),o=wr(n),s=n.tr,a=bm("row",o,i),l=bm("column",o,i),c=(t==="column"?a:t==="row"&&l)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:o.map.height}:t=="row"?{left:c,top:0,right:o.map.width,bottom:1}:o,f=t=="column"?l?i.cell:i.header_cell:t=="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}}zh("row",{useDeprecatedLogic:!0});zh("column",{useDeprecatedLogic:!0});zh("cell",{useDeprecatedLogic:!0});function MT(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function a0(t){return function(e,n){if(!Yt(e))return!1;const r=MT(dl(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(ue.between(i,cT(i))).scrollIntoView())}return!0}}function BT(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Ls(t,e){const n=t.selection;if(!(n instanceof Be))return!1;if(e){const r=t.tr,i=Gt(t.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 Q(i,0,0))}),r.docChanged&&e(r)}return!0}function FT(t){return(e,n)=>{const{from:r,to:i,select:o=!0,pos:s=e.selection.from}=t,a=e.tr;return CT({tr:a,originIndex:r,targetIndex:i,select:o,pos:s})?(n?.(a),!0):!1}}function _T(t){return(e,n)=>{const{from:r,to:i,select:o=!0,pos:s=e.selection.from}=t,a=e.tr;return kT({tr:a,originIndex:r,targetIndex:i,select:o,pos:s})?(n?.(a),!0):!1}}function PT(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=Gu(Gt(s).row,new Q(c,u,f)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?Gu(Gt(s).row,new Q(e,n,r)).content:e);else return null;return LT(s,a)}function LT(t,e){const n=[];for(let i=0;i<e.length;i++){const o=e[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>=e.length&&e.push(P.empty),n[i]<r){const o=Gt(t).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);e[i]=e[i].append(P.from(s))}return{height:e.length,width:r,rows:e}}function Gu(t,e){const n=t.createAndFill();return new ob(n).replace(0,n.content.size,e).doc}function zT({width:t,height:e,rows:n},r,i){if(t!=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(ti(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(P.from(c))}n=s,t=r}if(e!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=n[a%e];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(P.from(l))}n=o,e=i}return{width:t,height:e,rows:n}}function WT(t,e,n,r,i,o,s){const a=t.doc.type.schema,l=Gt(a);let c,u;if(i>e.width)for(let f=0,d=0;f<e.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=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(s).map(d-1+r),p)}if(o>e.height){const f=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:n.nodeAt(e.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,P.from(f)),h=[];for(let p=e.height;p<o;p++)h.push(d);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!!(c||u)}function wm(t,e,n,r,i,o,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){const u=s*e.width+c,f=e.map[u];if(e.map[u-e.width]==f){l=!0;const d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...d.attrs,rowspan:s-h}),t.insert(t.mapping.slice(a).map(e.positionAt(s,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-s})),c+=d.attrs.colspan-1}}return l}function km(t,e,n,r,i,o,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){const u=c*e.width+s,f=e.map[u];if(e.map[u-1]==f){l=!0;const d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(a).map(f+r);t.setNodeMarkup(p,null,ti(d.attrs,s-h,d.attrs.colspan-(s-h))),t.insert(p+d.nodeSize,d.type.createAndFill(ti(d.attrs,0,s-h))),c+=d.attrs.rowspan-1}}return l}function xm(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let s=ve.get(o);const{top:a,left:l}=r,c=l+i.width,u=a+i.height,f=t.tr;let d=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");s=ve.get(o),d=f.mapping.maps.length}WT(f,s,o,n,c,u,d)&&h(),wm(f,s,o,n,l,c,a,d)&&h(),wm(f,s,o,n,l,c,u,d)&&h(),km(f,s,o,n,a,u,l,d)&&h(),km(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 Q(i.rows[p-a],0,0))}h(),f.setSelection(new Be(f.doc.resolve(n+s.positionAt(a,l,o)),f.doc.resolve(n+s.positionAt(u-1,c-1,o)))),e(f)}const jT=Eb({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1),"Shift-ArrowLeft":Ws("horiz",-1),"Shift-ArrowRight":Ws("horiz",1),"Shift-ArrowUp":Ws("vert",-1),"Shift-ArrowDown":Ws("vert",1),Backspace:Ls,"Mod-Backspace":Ls,Delete:Ls,"Mod-Delete":Ls});function fa(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function zs(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof Be)return fa(n,r,ce.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=l0(i,t,e);if(s==null)return!1;if(t=="horiz")return fa(n,r,ce.near(n.doc.resolve(o.head+e),e));{const a=n.doc.resolve(s),l=e0(a,t,e);let c;return l?c=ce.near(l,1):e<0?c=ce.near(n.doc.resolve(a.before(-1)),-1):c=ce.near(n.doc.resolve(a.after(-1)),1),fa(n,r,c)}}}function Ws(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Be)s=o;else{const l=l0(i,t,e);if(l==null)return!1;s=new Be(n.doc.resolve(l))}const a=e0(s.$headCell,t,e);return a?fa(n,r,new Be(s.$anchorCell,a)):!1}}function KT(t,e){const n=t.state.doc,r=Bi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Be(r))),!0):!1}function JT(t,e,n){if(!Yt(t.state))return!1;let r=PT(n);const i=t.state.selection;if(i instanceof Be){r||(r={width:1,height:1,rows:[P.from(Gu(Gt(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=ve.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=zT(r,a.right-a.left,a.bottom-a.top),xm(t.state,t.dispatch,s,a,r),!0}else if(r){const o=dl(t.state),s=o.start(-1);return xm(t.state,t.dispatch,s,ve.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function QT(t,e){var n;if(e.button!=0||e.ctrlKey||e.metaKey)return;const r=Cm(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Be)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Bi(t.state.selection.$anchor))!=null&&((n=hc(t,e))===null||n===void 0?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(l,c){let u=hc(t,c);const f=ir.getState(t.state)==null;if(!u||!Lh(l,u))if(f)u=l;else return;const d=new Be(l,u);if(f||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);f&&h.setMeta(ir,l.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),ir.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ir,-1))}function a(l){const c=l,u=ir.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(Cm(t,c.target)!=r&&(f=hc(t,e),!f))return s();f&&o(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function l0(t,e,n){if(!(t.state.selection instanceof ue))return null;const{$head:r}=t.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=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function Cm(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function hc(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Bi(t.state.doc.resolve(r))||Bi(t.state.doc.resolve(i))}var HT=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,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",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Yu(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Yu(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Yu(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild;const c=t.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,e.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 Ft=new Lt("tableColumnResizing");function qT({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=HT,lastColumnResizable:i=!0}={}){const o=new xt({key:Ft,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=Gt(a.schema).table.name;return r&&c&&(c[u]=(f,d)=>new r(f,n,d)),new UT(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=Ft.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{GT(s,a,t,i)},mouseleave:s=>{YT(s)},mousedown:(s,a)=>{VT(s,a,e,n)}},decorations:s=>{const a=Ft.getState(s);if(a&&a.activeHandle>-1)return tD(s,a.activeHandle)},nodeViews:{}}});return o}var UT=class ha{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Ft);if(r&&r.setHandle!=null)return new ha(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ha(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Uu(e.doc.resolve(i))||(i=-1),new ha(i,n.dragging)}return n}};function GT(t,e,n,r){if(!t.editable)return;const i=Ft.getState(t.state);if(i&&!i.dragging){const o=$T(e.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();e.clientX-a<=n?s=vm(t,e,"left",n):l-e.clientX<=n&&(s=vm(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=ve.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}c0(t,s)}}}function YT(t){if(!t.editable)return;const e=Ft.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&c0(t,-1)}function VT(t,e,n,r){var i;if(!t.editable)return!1;const o=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,s=Ft.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=ZT(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Ft,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);const d=Ft.getState(t.state);d?.dragging&&(XT(t,d.activeHandle,Sm(d.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Ft,{setDragging:null})))}function u(f){if(!f.which)return c(f);const d=Ft.getState(t.state);if(d&&d.dragging){const h=Sm(d.dragging,f,n);Im(t,d.activeHandle,h,r)}}return Im(t,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),e.preventDefault(),!0}function ZT(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);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 $T(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function vm(t,e,n,r){const i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,a=Bi(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=ve.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 Sm(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function c0(t,e){t.dispatch(t.state.tr.setMeta(Ft,{setHandle:e}))}function XT(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),o=ve.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.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():eD(d.colspan);p[h]=n,l.setNodeMarkup(s+f,null,{...d,colwidth:p})}l.docChanged&&t.dispatch(l)}function Im(t,e,n,r){const i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=ve.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Yu(o,l.firstChild,l,r,a,n)}function eD(t){return Array(t).fill(0)}function tD(t,e){const n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return Fe.empty;const o=ve.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=Ft.getState(t))===null||l===void 0)&&l.dragging&&n.push(at.node(s+f,s+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),n.push(at.widget(d,h))}}return Fe.create(t.doc,n)}function nD({allowTableNodeSelection:t=!1}={}){return new xt({key:ir,state:{init(){return null},apply(e,n){const r=e.getMeta(ir);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:dT,handleDOMEvents:{mousedown:QT},createSelectionBetween(e){return ir.getState(e.state)!=null?e.state.selection:null},handleTripleClick:KT,handleKeyDown:jT,handlePaste:JT},appendTransaction(e,n,r){return gT(r,yT(r,n),t)}})}var Ba=typeof navigator<"u"?navigator:null,Wh=Ba&&Ba.userAgent||"",rD=/Edge\/(\d+)/.exec(Wh),iD=/MSIE \d/.exec(Wh),oD=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wh),sD=!!(iD||oD||rD),aD=!sD&&!!Ba&&/Apple Computer/.test(Ba.vendor),u0=new Lt("safari-ime-span"),Vu=!1,lD={key:u0,props:{decorations:cD,handleDOMEvents:{compositionstart:()=>{Vu=!0},compositionend:()=>{Vu=!1}}}};function cD(t){const{$from:e,$to:n,to:r}=t.selection;if(Vu&&e.sameParent(n)){const i=at.widget(r,uD,{ignoreSelection:!0,key:"safari-ime-span"});return Fe.create(t.doc,[i])}}function uD(t){const e=t.dom.ownerDocument.createElement("span");return e.className="ProseMirror-safari-ime-span",e}var fD=new xt(aD?lD:{key:u0});function Em(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function hD(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function dD(t,e,n){const i=Xa((n||{}).ignore||[]),o=pD(e);let s=-1;for(;++s<o.length;)wf(t,"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 y=d.exec(c.value);for(;y;){const C=y.index,w={index:y.index,input:y.input,stack:[...u,c]};let v=h(...y,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&&b({type:"text",value:c.value.slice(p,C)}),Array.isArray(v))for(const T of v)b(T);else v&&b(v);p=C+y[0].length,A=!0}if(!d.global)break;y=d.exec(c.value)}return A?(p<c.value.length&&b({type:"text",value:c.value.slice(p)}),f.children.splice(g,1,...x)):x=[c],g+x.length;function b(C){const w=x[x.length-1];w&&w.type==="text"&&C.type==="text"?w.value+=C.value:x.push(C)}}}function pD(t){if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const e=[],n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([mD(i[0]),gD(i[1])])}return e}function mD(t){return typeof t=="string"?new RegExp(hD(t),"g"):t}function gD(t){return typeof t=="function"?t:function(){return t}}const dc="phrasing",pc=["autolink","link","image","label"];function AD(){return{transforms:[vD],enter:{literalAutolink:bD,literalAutolinkEmail:mc,literalAutolinkHttp:mc,literalAutolinkWww:mc},exit:{literalAutolink:CD,literalAutolinkEmail:xD,literalAutolinkHttp:wD,literalAutolinkWww:kD}}}function yD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:pc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dc,notInConstruct:pc},{character:":",before:"[ps]",after:"\\/",inConstruct:dc,notInConstruct:pc}]}}function bD(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function mc(t){this.config.enter.autolinkProtocol.call(this,t)}function wD(t){this.config.exit.autolinkProtocol.call(this,t)}function kD(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function xD(t){this.config.exit.autolinkEmail.call(this,t)}function CD(t){this.exit(t)}function vD(t){dD(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ID]],{ignore:["link","linkReference"]})}function SD(t,e,n,r,i){let o="";if(!f0(i)||(/^w/i.test(e)&&(n=e+n,e="",o="http://"),!ED(n)))return!1;const s=RD(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ID(t,e,n,r){return!f0(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function ED(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function RD(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Em(t,"(");let o=Em(t,")");for(;r!==-1&&i>o;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[t,n]}function f0(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Yr(n)||$a(n))&&(!e||n!==47)}h0.peek=PD;function ND(){this.buffer()}function TD(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function DD(){this.buffer()}function OD(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function MD(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tn(this.sliceSerialize(t)).toLowerCase(),n.label=e}function BD(t){this.exit(t)}function FD(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=tn(this.sliceSerialize(t)).toLowerCase(),n.label=e}function _D(t){this.exit(t)}function PD(){return"["}function h0(t,e,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(t),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function LD(){return{enter:{gfmFootnoteCallString:ND,gfmFootnoteCall:TD,gfmFootnoteDefinitionLabelString:DD,gfmFootnoteDefinition:OD},exit:{gfmFootnoteCallString:MD,gfmFootnoteCall:BD,gfmFootnoteDefinitionLabelString:FD,gfmFootnoteDefinition:_D}}}function zD(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:h0},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((e?`
50
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),e?d0:WD))),c(),l}}function WD(t,e,n){return e===0?t:d0(t,e,n)}function d0(t,e,n){return(n?"":" ")+t}const jD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];jh.attention=qD;jh.peek=UD;function KD(){return{canContainEols:["delete"],enter:{strikethrough:QD},exit:{strikethrough:HD}}}function JD(){return{handlers:{delete:jh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jD}]}}function QD(t){this.enter({type:"delete",children:[],position:void 0},t)}function HD(t){this.exit(t)}function jh(t,e,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(t,{...i.current(),before:a,after:"~"}),a+=i.move(o),s(),a}function qD(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function UD(){return"~"}function GD(t){return t.length}function YD(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||GD,o=[],s=[],a=[],l=[];let c=0,u=-1;for(;++u<t.length;){const m=[],g=[];let A=-1;for(t[u].length>c&&(c=t[u].length);++A<t[u].length;){const x=VD(t[u][A]);if(n.alignDelimiters!==!1){const y=i(x);g[A]=y,(l[A]===void 0||y>l[A])&&(l[A]=y)}m.push(x)}s[u]=m,a[u]=g}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)o[f]=Rm(r[f]);else{const m=Rm(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 y=g+"-".repeat(x)+A;n.alignDelimiters!==!1&&(x=g.length+x+A.length,x>l[f]&&(l[f]=x),h[f]=x),d[f]=y}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 y="",b="";if(n.alignDelimiters!==!1){const C=l[f]-(g[f]||0),w=o[f];w===114?y=" ".repeat(C):w===99?C%2?(y=" ".repeat(C/2+.5),b=" ".repeat(C/2-.5)):(y=" ".repeat(C/2),b=y):b=" ".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(y),A.push(x),n.alignDelimiters!==!1&&A.push(b),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 VD(t){return t==null?"":String(t)}function Rm(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function ZD(){return{enter:{table:$D,tableData:Nm,tableHeader:Nm,tableRow:eO},exit:{codeText:tO,table:XD,tableData:gc,tableHeader:gc,tableRow:gc}}}function $D(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function XD(t){this.exit(t),this.data.inTable=void 0}function eO(t){this.enter({type:"tableRow",children:[]},t)}function gc(t){this.exit(t)}function Nm(t){this.enter({type:"tableCell",children:[]},t)}function tO(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,nO));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function nO(t,e){return e==="|"?e:t}function rO(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.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"),y=m.containerPhrasing(h,{...g,before:o,after:o});return x(),A(),y}function c(h,p){return YD(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(h,p,m){const g=h.children;let A=-1;const x=[],y=p.enter("table");for(;++A<g.length;)x[A]=f(g[A],p,m);return y(),x}function f(h,p,m){const g=h.children;let A=-1;const x=[],y=p.enter("tableRow");for(;++A<g.length;)x[A]=l(g[A],h,p,m);return y(),x}function d(h,p,m){let g=Cf.inlineCode(h,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function iO(){return{exit:{taskListCheckValueChecked:Tm,taskListCheckValueUnchecked:Tm,paragraph:sO}}}function oO(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:aO}}}function Tm(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function sO(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.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(t)}function aO(t,e,n,r){const i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Cf.listItem(t,e,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function lO(){return[AD(),LD(),KD(),ZD(),iO()]}function cO(t){return{extensions:[yD(),zD(t),JD(),rO(t),oO()]}}const uO={tokenize:gO,partial:!0},p0={tokenize:AO,partial:!0},m0={tokenize:yO,partial:!0},g0={tokenize:bO,partial:!0},fO={tokenize:wO,partial:!0},A0={name:"wwwAutolink",tokenize:pO,previous:b0},y0={name:"protocolAutolink",tokenize:mO,previous:w0},zn={name:"emailAutolink",tokenize:dO,previous:k0},An={};function hO(){return{text:An}}let Rr=48;for(;Rr<123;)An[Rr]=zn,Rr++,Rr===58?Rr=65:Rr===91&&(Rr=97);An[43]=zn;An[45]=zn;An[46]=zn;An[95]=zn;An[72]=[zn,y0];An[104]=[zn,y0];An[87]=[zn,A0];An[119]=[zn,A0];function dO(t,e,n){const r=this;let i,o;return s;function s(f){return!Zu(f)||!k0.call(r,r.previous)||Kh(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return Zu(f)?(t.consume(f),a):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check(fO,u,c)(f):f===45||f===95||gt(f)?(o=!0,t.consume(f),l):u(f)}function c(f){return t.consume(f),i=!0,l}function u(f){return o&&i&&ot(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function pO(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!b0.call(r,r.previous)||Kh(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(uO,t.attempt(p0,t.attempt(m0,o),n),n)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function mO(t,e,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&w0.call(r,r.previous)&&!Kh(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):n(f)}function a(f){if(ot(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),o?c:(o=!0,l)):n(f)}function c(f){return f===null||Aa(f)||Ne(f)||Yr(f)||$a(f)?n(f):t.attempt(p0,t.attempt(m0,u),n)(f)}function u(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function gO(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),o):n(s)}function o(s){return s===null?n(s):e(s)}}function AO(t,e,n){let r,i,o;return s;function s(c){return c===46||c===95?t.check(g0,l,a)(c):c===null||Ne(c)||Yr(c)||c!==45&&$a(c)?l(c):(o=!0,t.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),t.consume(c),s}function l(c){return i||r||!o?n(c):e(c)}}function yO(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.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?t.check(g0,e,o)(s):s===null||Ne(s)||Yr(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&r++,t.consume(s),i}}function bO(t,e,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?(t.consume(a),r):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||Ne(a)||Yr(a)?e(a):n(a)}function i(a){return a===null||a===40||a===91||Ne(a)||Yr(a)?e(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(t.consume(a),r):ot(a)?(t.consume(a),s):n(a)}}function wO(t,e,n){return r;function r(o){return t.consume(o),i}function i(o){return gt(o)?n(o):e(o)}}function b0(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ne(t)}function w0(t){return!ot(t)}function k0(t){return!(t===47||Zu(t))}function Zu(t){return t===43||t===45||t===46||t===95||gt(t)}function Kh(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kO={tokenize:NO,partial:!0};function xO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IO,continuation:{tokenize:EO},exit:RO}},text:{91:{name:"gfmFootnoteCall",tokenize:SO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CO,resolveTo:vO}}}}function CO(t,e,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=tn(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function vO(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[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({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",o,e],["enter",s,e],["exit",s,e],["exit",o,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function SO(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(f){if(o>999||f===93&&!s||f===null||f===91||Ne(f))return n(f);if(f===93){t.exit("chunkString");const d=t.exit("gfmFootnoteCallString");return i.includes(tn(r.sliceSerialize(d)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Ne(f)||(s=!0),o++,t.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(t.consume(f),o++,c):c(f)}}function IO(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(p){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):n(p)}function u(p){if(s>999||p===93&&!a||p===null||p===91||Ne(p))return n(p);if(p===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return o=tn(r.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),d}return Ne(p)||(a=!0),s++,t.consume(p),p===92?f:u}function f(p){return p===91||p===92||p===93?(t.consume(p),s++,u):u(p)}function d(p){return p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),i.includes(o)||i.push(o),ke(t,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return e(p)}}function EO(t,e,n){return t.check(ss,e,t.attempt(kO,e,n))}function RO(t){t.exit("gfmFootnoteDefinition")}function NO(t,e,n){const r=this;return ke(t,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?e(o):n(o)}}function TO(t){let n=(t||{}).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&&Nt(d,d.length,0,is(h,s.slice(c+1,l),a)),Nt(d,d.length,0,[["exit",f,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",u,a]]),Nt(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=Ut(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=Ut(p);return g._open=!A||A===2&&!!m,g._close=!m||m===2&&!!A,a(p)}}}class DO{constructor(){this.map=[],this.index=new Map}add(e,n,r){OO(this,e,n,r)}consume(e){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(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const o of i)e.push(o);i=r.pop()}this.map.length=0,this.index.clear()}}function OO(t,e,n,r){if(n===0&&r.length===0)return;const i=t.index.get(e);if(i){i[1]+=n,i[2].push(...r);return}const o=[e,n,r];t.map.push(o),t.index.set(e,o)}function MO(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-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);e+=1}return r}function BO(){return{flow:{null:{name:"table",tokenize:FO,resolveAll:_O}}}}function FO(t,e,n){const r=this;let i=0,o=0,s;return a;function a(S){let M=r.events.length-1;for(;M>-1;){const{type:L}=r.events[M][1];if(L==="lineEnding"||L==="linePrefix")M--;else break}const z=M>-1?r.events[M][1].type:null,W=z==="tableHead"||z==="tableRow"?w:l;return W===w&&r.parser.lazy[r.now().line]?n(S):W(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),c(S)}function c(S){return S===124||(s=!0,o+=1),u(S)}function u(S){return S===null?n(S):te(S)?o>1?(o=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):de(S)?ke(t,u,"whitespace")(S):(o+=1,s&&(s=!1,i+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),s=!0,u):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||Ne(S)?(t.exit("data"),u(S)):(t.consume(S),S===92?d:f)}function d(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),s=!1,de(S)?ke(t,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):p(S))}function p(S){return S===45||S===58?g(S):S===124?(s=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),m):C(S)}function m(S){return de(S)?ke(t,g,"whitespace")(S):g(S)}function g(S){return S===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),A):S===45?(o+=1,A(S)):S===null||te(S)?b(S):C(S)}function A(S){return S===45?(t.enter("tableDelimiterFiller"),x(S)):C(S)}function x(S){return S===45?(t.consume(S),x):S===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(S))}function y(S){return de(S)?ke(t,b,"whitespace")(S):b(S)}function b(S){return S===124?p(S):S===null||te(S)?!s||i!==o?C(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):C(S)}function C(S){return n(S)}function w(S){return t.enter("tableRow"),v(S)}function v(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),v):S===null||te(S)?(t.exit("tableRow"),e(S)):de(S)?ke(t,v,"whitespace")(S):(t.enter("data"),T(S))}function T(S){return S===null||S===124||Ne(S)?(t.exit("data"),v(S)):(t.consume(S),S===92?R:T)}function R(S){return S===92||S===124?(t.consume(S),T):T(S)}}function _O(t,e){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 DO;for(;++n<t.length;){const h=t[n],p=h[1];h[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(Dm(d,e,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,e]])):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,e]])),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=js(d,e,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=js(d,e,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=js(d,e,o,i,n,f)):s[1]!==0&&(f=js(d,e,s,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Dm(d,e,l,c,u),d.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=MO(e.events,n))}return t}function js(t,e,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Ai(e.events,n[0])),t.add(n[0],0,[["exit",o,e]]));const l=Ai(e.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",o,e]]),n[2]!==0){const c=Ai(e.events,n[2]),u=Ai(e.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const d=e.events[n[2]],h=e.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;t.add(p,m,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},Ai(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function Dm(t,e,n,r,i){const o=[],s=Ai(e.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),r.end=Object.assign({},s),o.push(["exit",r,e]),t.add(n+1,0,o)}function Ai(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const PO={name:"tasklistCheck",tokenize:zO};function LO(){return{text:{91:PO}}}function zO(t,e,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),o)}function o(l){return Ne(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(l)}function a(l){return te(l)?e(l):de(l)?t.check({tokenize:WO},e,n)(l):n(l)}}function WO(t,e,n){return ke(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function jO(t){return VA([hO(),xO(),TO(t),BO(),LO()])}const KO={};function JO(t){const e=this,n=t||KO,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(jO(n)),o.push(lO()),s.push(cO(n))}function ie(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-gfm",...e}}),t}var Jh=ps("strike_through");ie(Jh,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var ws=Pn("strike_through",t=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>e==="line-through"}],toDOM:e=>["del",t.get(Jh.key)(e)],parseMarkdown:{match:e=>e.type==="delete",runner:(e,n,r)=>{e.openMark(r),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="strike_through",runner:(e,n)=>{e.withMark(n,"delete")}}}));ie(ws.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});ie(ws.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var Qh=fe("ToggleStrikeThrough",t=>()=>sl(ws.type(t)));ie(Qh,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var x0=Ot(t=>cs(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)$"),ws.type(t)));ie(x0,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var Hh=zt("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:t=>{const e=t.get(Ie);return()=>e.call(Qh.key)}}});ie(Hh.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});ie(Hh.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});function C0(t,e){const n=e.content.firstChild;if(e.childCount!==1||n?.type.name!=="paragraph"){t.next(e.content);return}const r=n.lastChild,i=r?.type.name==="hardbreak"?n.content.cut(0,n.content.size-r.nodeSize):n.content;t.next(i)}var ks=aT({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:t=>t.style.textAlign||"left",setDOMAttr:(t,e)=>{e.style=`text-align: ${t||"left"}`}}}}),Dn=Qe("table",()=>({...ks.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="table",runner:(t,e,n)=>{const r=e.align,i=e.children.map((o,s)=>({...o,align:r,isHeader:s===0}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table",runner:(t,e)=>{const n=e.content.firstChild?.content;if(!n)return;const r=[];n.forEach(i=>{r.push(i.attrs.alignment)}),t.openNode("table",void 0,{align:r}),t.next(e.content),t.closeNode()}}}));ie(Dn.node,{displayName:"NodeSchema<table>",group:"Table"});ie(Dn.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var xs=Qe("table_header_row",()=>({...ks.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:t=>t instanceof HTMLElement&&t.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:t=>!!(t.type==="tableRow"&&t.isHeader),runner:(t,e,n)=>{const r=e.align,i=e.children.map((o,s)=>({...o,align:r[s],isHeader:e.isHeader}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow",void 0,{isHeader:!0}),t.next(e.content),t.closeNode())}}}));ie(xs.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});ie(xs.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var Ji=Qe("table_row",()=>({...ks.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:t=>t.type==="tableRow",runner:(t,e,n)=>{const r=e.align,i=e.children.map((o,s)=>({...o,align:r[s]}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow"),t.next(e.content),t.closeNode())}}}));ie(Ji.node,{displayName:"NodeSchema<tableRow>",group:"Table"});ie(Ji.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var Cs=Qe("table_cell",()=>({...ks.table_cell,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}).openNode(t.schema.nodes.paragraph).next(e.children).closeNode().closeNode()}},toMarkdown:{match:t=>t.type.name==="table_cell",runner:(t,e)=>{t.openNode("tableCell"),C0(t,e),t.closeNode()}}}));ie(Cs.node,{displayName:"NodeSchema<tableCell>",group:"Table"});ie(Cs.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Fi=Qe("table_header",()=>({...ks.table_header,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}),t.openNode(t.schema.nodes.paragraph),t.next(e.children),t.closeNode(),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header",runner:(t,e)=>{t.openNode("tableCell"),C0(t,e),t.closeNode()}}}));ie(Fi.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});ie(Fi.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function v0(t,e=3,n=3){const r=Array(n).fill(0).map(()=>Cs.type(t).createAndFill()),i=Array(n).fill(0).map(()=>Fi.type(t).createAndFill()),o=Array(e).fill(0).map((s,a)=>a===0?xs.type(t).create(null,i):Ji.type(t).create(null,r));return Dn.type(t).create(null,o)}function S0(t){return(e,n)=>r=>{n=n??r.selection.from;const i=r.doc.resolve(n),o=Ib(l=>l.type.name==="table")(i),s=o?{node:o.node,from:o.start}:void 0,a=t==="row";if(s){const l=ve.get(s.node);if(e>=0&&e<(a?l.height:l.width)){const c=l.positionAt(a?e:l.height-1,a?l.width-1:e,s.node),u=r.doc.resolve(s.from+c),f=a?Be.rowSelection:Be.colSelection,d=l.positionAt(a?e:0,a?0:e,s.node),h=r.doc.resolve(s.from+d);return Sb(r.setSelection(f(u,h)))}}return r}}var QO=S0("row"),HO=S0("col");function I0(t,e,{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 Cs.type(t).createAndFill({alignment:u?.attrs.alignment})});return e.insert(s,Ji.type(t).create(null,a)),e}function qO(t){const e=bs(t.$from);if(!e)return;const n=ve.get(e.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(r=>{const i=e.node.nodeAt(r),o=r+e.start;return{pos:o,start:o+1,node:i}})}function UO(t){const e=qO(t.selection);if(e&&e[0]){const n=t.doc.resolve(e[0].pos),r=e[e.length-1];if(r){const i=t.doc.resolve(r.pos);return Sb(t.setSelection(new Be(i,n)))}}return t}var qh=fe("GoToPrevTableCell",()=>()=>a0(-1));ie(qh,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var Uh=fe("GoToNextTableCell",()=>()=>a0(1));ie(Uh,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var Gh=fe("ExitTable",t=>()=>(e,n)=>{if(!Yt(e))return!1;const{$head:r}=e.selection,i=oE(r,Dn.type(t));if(!i)return!1;const{to:o}=i,s=e.tr.replaceWith(o,o,pn.type(t).createAndFill());return s.setSelection(ce.near(s.doc.resolve(o),1)).scrollIntoView(),n?.(s),!0});ie(Gh,{displayName:"Command<breakTableCommand>",group:"Table"});var E0=fe("InsertTable",t=>({row:e,col:n}={})=>(r,i)=>{const{selection:o,tr:s}=r,{from:a}=o,l=v0(t,e,n),c=s.replaceSelectionWith(l),u=ce.findFrom(c.doc.resolve(a),1,!0);return u&&c.setSelection(u),i?.(c),!0});ie(E0,{displayName:"Command<insertTableCommand>",group:"Table"});var R0=fe("MoveRow",()=>({from:t,to:e,pos:n}={})=>FT({from:t??0,to:e??0,pos:n}));ie(R0,{displayName:"Command<moveRowCommand>",group:"Table"});var N0=fe("MoveCol",()=>({from:t,to:e,pos:n}={})=>_T({from:t??0,to:e??0,pos:n}));ie(N0,{displayName:"Command<moveColCommand>",group:"Table"});var T0=fe("SelectRow",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(QO(t.index,t.pos)(r))});ie(T0,{displayName:"Command<selectRowCommand>",group:"Table"});var D0=fe("SelectCol",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(HO(t.index,t.pos)(r))});ie(D0,{displayName:"Command<selectColCommand>",group:"Table"});var O0=fe("SelectTable",()=>()=>(t,e)=>{const{tr:n}=t;return!!e?.(UO(n))});ie(O0,{displayName:"Command<selectTableCommand>",group:"Table"});var M0=fe("DeleteSelectedCells",()=>()=>(t,e)=>{const{selection:n}=t;if(!(n instanceof Be))return!1;const r=n.isRowSelection(),i=n.isColSelection();return r&&i?BT(t,e):i?RT(t,e):TT(t,e)});ie(M0,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var B0=fe("AddColBefore",()=>()=>ST);ie(B0,{displayName:"Command<addColBeforeCommand>",group:"Table"});var F0=fe("AddColAfter",()=>()=>IT);ie(F0,{displayName:"Command<addColAfterCommand>",group:"Table"});var _0=fe("AddRowBefore",t=>()=>(e,n)=>{if(!Yt(e))return!1;if(n){const r=wr(e);n(I0(t,e.tr,r,r.top))}return!0});ie(_0,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var P0=fe("AddRowAfter",t=>()=>(e,n)=>{if(!Yt(e))return!1;if(n){const r=wr(e);n(I0(t,e.tr,r,r.bottom))}return!0});ie(P0,{displayName:"Command<addRowAfterCommand>",group:"Table"});var L0=fe("SetAlign",()=>(t="left")=>DT("alignment",t));ie(L0,{displayName:"Command<setAlignCommand>",group:"Table"});var z0=Ot(t=>new Ct(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(e,n,r,i)=>{const o=e.doc.resolve(r);if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),Dn.type(t)))return null;const s=v0(t,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),a=e.tr.replaceRangeWith(r,i,s);return a.setSelection(ue.create(a.doc,r+3)).scrollIntoView()}));ie(z0,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var W0=dN(t=>({run:(e,n,r)=>{if(r)return e;function i(c){const u=c.childCount,f=c.lastChild?.childCount??0;if(u===0||f===0)return pn.type(t).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 b=0;b<g.childCount;b++){const C=g.child(b);A.push(Fi.type(t).create(C.attrs,C.content,C.marks))}const x=d.type.create(d.attrs,A),y=[];for(let b=2;b<u;b++)y.push(c.child(b));return c.type.create(c.attrs,[x,...y])}const h=Array(f).fill(0).map(()=>Fi.type(t).createAndFill()),p=new Q(P.from(h),0,0),m=d.replace(0,0,p);return c.replace(0,d.nodeSize,new Q(P.from(m),0,0))}function o(c){const u=Ji.type(t),f=[];let d=[],h=!1;function p(){if(d.length===0)return;const m=xs.type(t).createAndFill(),g=Dn.type(t).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?P.from(f):c}function s(c){let u=o(c),f=u!==c;const d=[];return u.forEach(h=>{if(h.type===Dn.type(t)){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?P.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===pn.type(t)&&h.content.size===0&&p&&p.type===Dn.type(t)||u.push(h)}return u.length<f.length?P.from(u):c}let l=s(e.content);return l=a(l),new Q(P.from(l),e.openStart,e.openEnd)}}));ie(W0,{displayName:"PasteRule<table>",group:"Table"});var Yh=zt("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:t=>{const e=t.get(Ie);return()=>e.call(Uh.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:t=>{const e=t.get(Ie);return()=>e.call(qh.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:t=>{const e=t.get(Ie);return()=>e.call(Gh.key)}}});ie(Yh.ctx,{displayName:"KeymapCtx<table>",group:"Table"});ie(Yh.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Ac="footnote_definition",Om="footnoteDefinition",Vh=Qe("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Ac}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw mn(t);return{label:t.dataset.label}},contentElement:"dd"}],toDOM:t=>{const e=t.attrs.label;return["dl",{"data-label":e,"data-type":Ac},["dt",e],["dd",0]]},parseMarkdown:{match:({type:t})=>t===Om,runner:(t,e,n)=>{t.openNode(n,{label:e.label}).next(e.children).closeNode()}},toMarkdown:{match:t=>t.type.name===Ac,runner:(t,e)=>{t.openNode(Om,void 0,{label:e.attrs.label,identifier:e.attrs.label}).next(e.content).closeNode()}}}));ie(Vh.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});ie(Vh.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var yc="footnote_reference",Zh=Qe("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${yc}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw mn(t);return{label:t.dataset.label}}}],toDOM:t=>{const e=t.attrs.label;return["sup",{"data-label":e,"data-type":yc},e]},parseMarkdown:{match:({type:t})=>t==="footnoteReference",runner:(t,e,n)=>{t.addNode(n,{label:e.label})}},toMarkdown:{match:t=>t.type.name===yc,runner:(t,e)=>{t.addNode("footnoteReference",void 0,void 0,{label:e.attrs.label,identifier:e.attrs.label})}}}));ie(Zh.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});ie(Zh.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var $h=Ln.extendSchema(t=>e=>{const n=t(e);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 mn(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()}}}});ie($h.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});ie($h.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var j0=Ot(()=>new Ct(/^\[(?<checked>\s|x)\]\s$/,(t,e,n,r)=>{const i=t.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=e.groups?.checked==="x",l=i.before(o),c=t.tr;return c.deleteRange(n,r).setNodeMarkup(l,void 0,{...s.attrs,checked:a}),c}));ie(j0,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var GO=[Hh,Yh].flat(),YO=[z0,j0],VO=[x0],ZO=[W0],K0=on(()=>fD);ie(K0,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var $O=on(()=>qT({}));ie($O,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var J0=on(()=>nD({allowTableNodeSelection:!0}));ie(J0,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Xh=Wt("remarkGFM",()=>JO);ie(Xh.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});ie(Xh.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var XO=new Lt("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function eM(t,e){let n=0;return e.forEach((r,i,o)=>{r===t&&(n=o)}),n}function tM(t,e){const n=t.content.findDiffStart(e.content);if(n==null)return null;const r=t.content.findDiffEnd(e.content);return r?{from:n,to:Math.max(r.b,n)}:null}var Q0=on(()=>new xt({key:XO,appendTransaction:(t,e,n)=>{if(e.doc===n.doc)return;const r=tM(e.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=eM(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}}));ie(Q0,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var nM=[Q0,K0,Xh,J0].flat(),rM=[$h,Dn,xs,Ji,Fi,Cs,Vh,Zh,Jh,ws].flat(),iM=[Uh,qh,Gh,E0,R0,N0,T0,D0,O0,M0,_0,P0,B0,F0,L0,Qh],GL=[rM,YO,ZO,VO,GO,iM,nM].flat();const YL=`/*
54
+ * @akairos/milkdown-article-style — article typography
55
+ *
56
+ * Consumers:
57
+ * - zzhub-pipeline wechat-export (Juice inlines these rules)
58
+ * - Nezus Milkdown writing surface (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: table;
382
+ width: 100%;
383
+ max-width: 100%;
384
+ margin: 1.5em 0;
385
+ border-collapse: collapse;
386
+ table-layout: fixed;
387
+ box-sizing: border-box;
388
+ color: var(--wx-body-color);
389
+ font-size: 14px;
390
+ line-height: 1.62;
391
+ }
392
+
393
+ .milkdown .editor th,
394
+ .milkdown .editor td {
395
+ padding: 8px 9px;
396
+ border: 1px solid var(--wx-divider-color);
397
+ color: var(--wx-body-color);
398
+ text-align: left;
399
+ vertical-align: top;
400
+ overflow-wrap: break-word;
401
+ word-break: break-word;
402
+ }
403
+
404
+ .milkdown .editor th {
405
+ background-color: var(--wx-soft-surface);
406
+ color: var(--wx-brand-ink);
407
+ font-weight: 700;
408
+ }
409
+
410
+ .milkdown .editor th p,
411
+ .milkdown .editor td p {
412
+ margin: 0;
413
+ font-size: 14px;
414
+ line-height: 1.62;
415
+ text-align: left;
416
+ }
417
+
418
+ .milkdown .editor th p {
419
+ color: var(--wx-brand-ink);
420
+ }
421
+
422
+ .milkdown .editor td p {
423
+ color: var(--wx-body-color);
424
+ }
425
+
426
+ .milkdown .editor hr {
427
+ display: block;
428
+ height: 0;
429
+ margin: 2.15em 0;
430
+ padding: 0;
431
+ border: 0;
432
+ border-top: 1px solid var(--wx-divider-color);
433
+ background: transparent;
434
+ }
435
+
436
+ .milkdown .editor [data-wechat-node="references"] {
437
+ margin-top: 2.6em;
438
+ padding-top: 1.05em;
439
+ border-top: 1px solid var(--wx-divider-color);
440
+ }
441
+
442
+ .milkdown .editor [data-wechat-node="references-title"] {
443
+ margin: 0 0 0.65em;
444
+ color: var(--wx-body-color);
445
+ font-size: 15px;
446
+ font-weight: 700;
447
+ line-height: 1.55;
448
+ text-align: left;
449
+ }
450
+
451
+ .milkdown .editor [data-wechat-node="references-list"] {
452
+ margin: 0;
453
+ padding-left: 1.5em;
454
+ }
455
+
456
+ .milkdown .editor [data-wechat-node="reference-item"] {
457
+ margin: 0.42em 0;
458
+ color: var(--wx-muted-color);
459
+ font-size: 12px;
460
+ line-height: 1.62;
461
+ overflow-wrap: break-word;
462
+ word-break: break-word;
463
+ }
464
+
465
+ .milkdown .editor [data-wechat-node="footer"] {
466
+ margin-top: 2.5em;
467
+ padding-top: 0.9em;
468
+ border-top: 1px solid var(--wx-divider-color);
469
+ text-align: center;
470
+ }
471
+
472
+ .milkdown .editor [data-wechat-node="footer-text"] {
473
+ margin: 0;
474
+ color: var(--wx-muted-color);
475
+ font-size: 12px;
476
+ line-height: 1.6;
477
+ letter-spacing: 0.08em;
478
+ text-align: center;
479
+ }
480
+
481
+ /*
482
+ * ==========================================================================
483
+ * Kairos Extended Article Components (Editorial Standard)
484
+ *
485
+ * 注:以下为作者 Kairos 个人公众号与 Milkdown 写作的标准组件排版样式。
486
+ * 宿主应用或用户可按需通过自定义 CSS 变量或选择器进行重写与覆盖。
487
+ * ==========================================================================
488
+ */
489
+
490
+ /* 1. 高亮标记 (Highlight Mark) */
491
+ .milkdown .editor mark {
492
+ background-color: #fef08a;
493
+ color: inherit;
494
+ padding: 0.1em 0.3em;
495
+ border-radius: 2px;
496
+ box-decoration-break: clone;
497
+ -webkit-box-decoration-break: clone;
498
+ }
499
+
500
+ /* 2. 提示卡片 (Callout GFM Alerts) */
501
+ .milkdown .editor section[data-wechat-node="callout"],
502
+ .milkdown .editor .wechat-callout {
503
+ margin: 1.6em 0;
504
+ padding: 14px 16px;
505
+ border-radius: 6px;
506
+ border-left-width: 4px;
507
+ border-left-style: solid;
508
+ border-left-color: #3b82f6;
509
+ background-color: rgba(59, 130, 246, 0.08);
510
+ box-sizing: border-box;
511
+ }
512
+ .milkdown .editor .wechat-callout-note,
513
+ .milkdown .editor section[data-callout-type="note"] {
514
+ border-left-color: #3b82f6 !important;
515
+ background-color: rgba(59, 130, 246, 0.08) !important;
516
+ }
517
+ .milkdown .editor .wechat-callout-tip,
518
+ .milkdown .editor section[data-callout-type="tip"] {
519
+ border-left-color: #10b981 !important;
520
+ background-color: rgba(16, 185, 129, 0.08) !important;
521
+ }
522
+ .milkdown .editor .wechat-callout-important,
523
+ .milkdown .editor section[data-callout-type="important"] {
524
+ border-left-color: #8b5cf6 !important;
525
+ background-color: rgba(139, 92, 246, 0.08) !important;
526
+ }
527
+ .milkdown .editor .wechat-callout-warning,
528
+ .milkdown .editor section[data-callout-type="warning"] {
529
+ border-left-color: #f59e0b !important;
530
+ background-color: rgba(245, 158, 11, 0.08) !important;
531
+ }
532
+ .milkdown .editor .wechat-callout-caution,
533
+ .milkdown .editor section[data-callout-type="caution"] {
534
+ border-left-color: #ef4444 !important;
535
+ background-color: rgba(239, 68, 68, 0.08) !important;
536
+ }
537
+ .milkdown .editor section[data-wechat-node="callout-header"],
538
+ .milkdown .editor .wechat-callout-header {
539
+ margin-bottom: 6px;
540
+ font-size: 14px;
541
+ font-weight: 700;
542
+ color: var(--wx-h2-color, #1f1b1c);
543
+ }
544
+ .milkdown .editor .wechat-callout-icon {
545
+ margin-right: 6px;
546
+ font-size: 15px;
547
+ display: inline-block;
548
+ vertical-align: middle;
549
+ }
550
+ .milkdown .editor .wechat-callout-title {
551
+ display: inline-block;
552
+ vertical-align: middle;
553
+ }
554
+ .milkdown .editor .wechat-callout p {
555
+ margin: 0.3em 0;
556
+ font-size: 14.5px;
557
+ line-height: 1.68;
558
+ }
559
+
560
+ /* 3. 键盘按键 (Keyboard Key) */
561
+ .milkdown .editor span[data-wechat-node="kbd"],
562
+ .milkdown .editor .wechat-kbd {
563
+ display: inline-block;
564
+ padding: 1.5px 5.5px;
565
+ font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
566
+ font-size: 0.82em;
567
+ font-weight: 500;
568
+ line-height: 1.35;
569
+ color: var(--wx-text-mid, #3c4043);
570
+ background-color: #f3f4f6;
571
+ border: 1px solid #d1d5db;
572
+ border-bottom-width: 2px;
573
+ border-radius: 4px;
574
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
575
+ margin: 0 2px;
576
+ vertical-align: baseline;
577
+ }
578
+
579
+ /* 4. 状态徽章 (Status Badge) */
580
+ .milkdown .editor span[data-wechat-node="badge"],
581
+ .milkdown .editor .wechat-badge {
582
+ display: inline-block;
583
+ padding: 1.5px 7px;
584
+ font-size: 11px;
585
+ font-weight: 600;
586
+ line-height: 1.3;
587
+ border-radius: 9999px;
588
+ margin: 0 3px;
589
+ vertical-align: middle;
590
+ }
591
+ .milkdown .editor .wechat-badge-brand {
592
+ background-color: rgba(202, 96, 147, 0.12);
593
+ color: var(--wx-brand-accent, #ca6093);
594
+ }
595
+ .milkdown .editor .wechat-badge-success {
596
+ background-color: #dcfce7;
597
+ color: #15803d;
598
+ }
599
+ .milkdown .editor .wechat-badge-warning {
600
+ background-color: #fef3c7;
601
+ color: #b45309;
602
+ }
603
+ .milkdown .editor .wechat-badge-danger {
604
+ background-color: #fee2e2;
605
+ color: #b91c1c;
606
+ }
607
+ .milkdown .editor .wechat-badge-info {
608
+ background-color: #e0f2fe;
609
+ color: #0369a1;
610
+ }
611
+
612
+ /* 5. 篇章结构卡片 (Article Cards: Intro & CTA) */
613
+ .milkdown .editor section[data-wechat-node="article-card"],
614
+ .milkdown .editor .wechat-article-card {
615
+ margin: 1.8em 0;
616
+ padding: 16px 20px;
617
+ border-radius: 10px;
618
+ box-sizing: border-box;
619
+ overflow: hidden;
620
+ }
621
+ .milkdown .editor .wechat-article-card-intro {
622
+ background-color: var(--wx-soft-surface, #faf8f9);
623
+ border: 1px solid var(--wx-divider, #eae4e7);
624
+ }
625
+ .milkdown .editor .wechat-article-card-cta {
626
+ background-color: rgba(202, 96, 147, 0.04);
627
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
628
+ text-align: center;
629
+ }
630
+ .milkdown .editor section[data-wechat-node="card-eyebrow"],
631
+ .milkdown .editor .wechat-card-eyebrow {
632
+ margin-bottom: 10px;
633
+ }
634
+ .milkdown .editor .wechat-article-card-cta section[data-wechat-node="card-eyebrow"],
635
+ .milkdown .editor .wechat-article-card-cta .wechat-card-eyebrow {
636
+ text-align: center;
637
+ }
638
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
639
+ .milkdown .editor .wechat-card-eyebrow-badge {
640
+ display: inline-block;
641
+ padding: 2px 8px;
642
+ border-radius: 4px;
643
+ background-color: rgba(202, 96, 147, 0.08);
644
+ color: var(--wx-brand-accent, #ca6093);
645
+ font-size: 11px;
646
+ font-weight: 700;
647
+ letter-spacing: 0.06em;
648
+ line-height: 1.5;
649
+ }
650
+ .milkdown .editor .wechat-card-eyebrow-icon {
651
+ margin-right: 4px;
652
+ font-size: 12px;
653
+ display: inline-block;
654
+ vertical-align: middle;
655
+ }
656
+ .milkdown .editor .wechat-card-eyebrow-label {
657
+ display: inline-block;
658
+ vertical-align: middle;
659
+ }
660
+ .milkdown .editor .wechat-article-card p {
661
+ margin: 0.4em 0;
662
+ font-size: 13px;
663
+ line-height: 1.72;
664
+ color: var(--wx-text-soft, #555555);
665
+ letter-spacing: 0.02em;
666
+ }
667
+ .milkdown .editor p[data-wechat-node="intro-meta"],
668
+ .milkdown .editor .wechat-intro-meta {
669
+ margin: 4px 0 10px 0 !important;
670
+ padding-bottom: 8px;
671
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
672
+ font-size: 12px !important;
673
+ color: var(--wx-muted-color, #756b6e) !important;
674
+ line-height: 1.5 !important;
675
+ }
676
+ .milkdown .editor p[data-wechat-node="intro-meta"] strong,
677
+ .milkdown .editor .wechat-intro-meta strong {
678
+ color: var(--wx-brand-accent, #ca6093);
679
+ font-weight: 600;
680
+ }
681
+ .milkdown .editor p[data-wechat-node="intro-guide"],
682
+ .milkdown .editor .wechat-intro-guide {
683
+ margin-top: 10px !important;
684
+ padding-top: 8px;
685
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
686
+ font-size: 12px !important;
687
+ color: var(--wx-brand-accent, #ca6093) !important;
688
+ line-height: 1.6 !important;
689
+ }
690
+ `;var Mm=Object.prototype.hasOwnProperty;function Bm(t,e,n){for(n of t.keys())if(vo(n,e))return n}function vo(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&vo(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=Bm(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=Bm(e,i),!i)||!vo(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(Mm.call(t,n)&&++r&&!Mm.call(e,n)||!(n in e)||!vo(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var oM={};let $u,H0,q0,U0,G0=!0;typeof process<"u"&&({FORCE_COLOR:$u,NODE_DISABLE_COLORS:H0,NO_COLOR:q0,TERM:U0}=oM||{},G0=process.stdout&&process.stdout.isTTY);const me={enabled:!H0&&q0==null&&U0!=="dumb"&&($u!=null&&$u!=="0"||G0),reset:De(0,0),bold:De(1,22),dim:De(2,22),italic:De(3,23),underline:De(4,24),inverse:De(7,27),hidden:De(8,28),strikethrough:De(9,29),black:De(30,39),red:De(31,39),green:De(32,39),yellow:De(33,39),blue:De(34,39),magenta:De(35,39),cyan:De(36,39),white:De(37,39),gray:De(90,39),grey:De(90,39),bgBlack:De(40,49),bgRed:De(41,49),bgGreen:De(42,49),bgYellow:De(43,49),bgBlue:De(44,49),bgMagenta:De(45,49),bgCyan:De(46,49),bgWhite:De(47,49)};function Fm(t,e){let n=0,r,i="",o="";for(;n<t.length;n++)r=t[n],i+=r.open,o+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return i+e+o}function sM(t,e){let n={has:t,keys:e};return n.reset=me.reset.bind(n),n.bold=me.bold.bind(n),n.dim=me.dim.bind(n),n.italic=me.italic.bind(n),n.underline=me.underline.bind(n),n.inverse=me.inverse.bind(n),n.hidden=me.hidden.bind(n),n.strikethrough=me.strikethrough.bind(n),n.black=me.black.bind(n),n.red=me.red.bind(n),n.green=me.green.bind(n),n.yellow=me.yellow.bind(n),n.blue=me.blue.bind(n),n.magenta=me.magenta.bind(n),n.cyan=me.cyan.bind(n),n.white=me.white.bind(n),n.gray=me.gray.bind(n),n.grey=me.grey.bind(n),n.bgBlack=me.bgBlack.bind(n),n.bgRed=me.bgRed.bind(n),n.bgGreen=me.bgGreen.bind(n),n.bgYellow=me.bgYellow.bind(n),n.bgBlue=me.bgBlue.bind(n),n.bgMagenta=me.bgMagenta.bind(n),n.bgCyan=me.bgCyan.bind(n),n.bgWhite=me.bgWhite.bind(n),n}function De(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:me.enabled?Fm(this.keys,r+""):r+""):r===void 0?sM([t],[n]):me.enabled?Fm([n],r+""):r+""}}function kr(){}kr.prototype={diff:function(e,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(b){return o?(setTimeout(function(){o(void 0,b)},0),!0):b}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var l=n.length,c=e.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,e,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 b=Math.max(g,-u);b<=Math.min(A,u);b+=2){var C=void 0,w=p[b-1],v=p[b+1];w&&(p[b-1]=void 0);var T=!1;if(v){var R=v.oldPos-b;T=v&&0<=R&&R<l}var S=w&&w.oldPos+1<c;if(!T&&!S){p[b]=void 0;continue}if(!S||T&&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,e,b),C.oldPos+1>=c&&m+1>=l)return a(aM(s,C.lastComponent,n,e,s.useLongestToken));p[b]=C,C.oldPos+1>=c&&(A=Math.min(A,b-1)),m+1>=l&&(g=Math.max(g,b+1))}u++}if(o)(function b(){setTimeout(function(){if(u>f||Date.now()>h)return o();x()||b()},0)})();else for(;u<=f&&Date.now()<=h;){var y=x();if(y)return y}},addToPath:function(e,n,r,i){var o=e.lastComponent;return o&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}},extractCommon:function(e,n,r,i){for(var o=n.length,s=r.length,a=e.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&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=a,l},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function aM(t,e,n,r,i){for(var o=[],s;e;)o.push(e),s=e.previousComponent,delete e.previousComponent,e=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=t.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=t.join(d)}else f.value=t.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)&&t.equals("",p.value)&&(o[l-2].value+=p.value,o.pop()),o}var _m=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Pm=/\S/,Y0=new kr;Y0.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!Pm.test(t)&&!Pm.test(e)};Y0.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&_m.test(e[n])&&_m.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var V0=new kr;V0.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
691
+ `));var e=[],n=t.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?e[e.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),e.push(i))}return e};var lM=new kr;lM.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var cM=new kr;cM.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function da(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?da=function(e){return typeof e}:da=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(t)}var uM=Object.prototype.toString,Wo=new kr;Wo.useLongestToken=!0;Wo.tokenize=V0.tokenize;Wo.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,i=r===void 0?function(o,s){return typeof s>"u"?n:s}:r;return typeof t=="string"?t:JSON.stringify(Xu(t,null,null,i),i," ")};Wo.equals=function(t,e){return kr.prototype.equals.call(Wo,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function Xu(t,e,n,r,i){e=e||[],n=n||[],r&&(t=r(i,t));var o;for(o=0;o<e.length;o+=1)if(e[o]===t)return n[o];var s;if(uM.call(t)==="[object Array]"){for(e.push(t),s=new Array(t.length),n.push(s),o=0;o<t.length;o+=1)s[o]=Xu(t[o],e,n,r,i);return e.pop(),n.pop(),s}if(t&&t.toJSON&&(t=t.toJSON()),da(t)==="object"&&t!==null){e.push(t),s={},n.push(s);var a=[],l;for(l in t)t.hasOwnProperty(l)&&a.push(l);for(a.sort(),o=0;o<a.length;o+=1)l=a[o],s[l]=Xu(t[l],e,n,r,l);e.pop(),n.pop()}else s=t;return s}var ef=new kr;ef.tokenize=function(t){return t.slice()};ef.join=ef.removeEmpty=function(t){return t};me.red,me.grey,me.green;me.dim().italic;me.dim("→");me.dim("·");me.dim("↵");function Fa(t){t=t.replace(/\r?\n/g,`
692
+ `);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(e||[]).length;for(;n<i;n++)r=Math.min(r,e[n].length);return i&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class fM extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function qt(t,e,n,r,i,o,s){if(t)return;let a=s||o;if(s instanceof Error)throw s;let l=i;throw new fM({actual:e,expects:n,operator:r,message:a,details:l,generated:!s})}function hM(t,e){qt(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function Mn(t,e){qt(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}Mn.ok=Mn;Mn.equal=function(t,e,n){qt(!vo(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};Mn.type=function(t,e,n){let r=typeof t;qt(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};Mn.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";qt(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};Mn.snapshot=function(t,e,n){t=Fa(t),e=Fa(e),qt(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};Mn.fixture=function(t,e,n){t=Fa(t),e=Fa(e),qt(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};Mn.match=function(t,e,n){typeof e=="string"?qt(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):qt(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};Mn.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?qt(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?qt(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||qt(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const no={equalsTo:61},Lm={attentionSideAfter:2},zm={data:"data",characterEscape:"characterEscape"};var ro="highlightSequenceTemporary",Wm="highlightSequence",dM="highlight",pM="highlightText";function mM(){const t={name:"highlight",tokenize:n,resolveAll:e};return{text:{[no.equalsTo]:t},insideSpan:{null:[t]},attentionMarkers:{null:[no.equalsTo]}};function e(r,i){let o=-1;for(;++o<r.length;)if(r[o][0]==="enter"&&r[o][1].type===ro&&r[o][1]._close){let s=o;for(;s--;)if(r[s][0]==="exit"&&r[s][1].type===ro&&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=Wm,r[s][1].type=Wm;const a={type:dM,start:Object.assign({},r[s][1].start),end:Object.assign({},r[o][1].end)},l={type:pM,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&&Nt(c,c.length,0,is(u,r.slice(s+1,o),i)),Nt(c,c.length,0,[["exit",l,i],["enter",r[o][1],i],["exit",r[o][1],i],["exit",a,i]]),Nt(r,s-1,o-s+3,c),o=s+c.length-2;break}}for(o=-1;++o<r.length;)r[o][1].type===ro&&(r[o][1].type=zm.data);return r}function n(r,i,o){const s=this.previous,a=this.events;let l=0;return c;function c(f){return hM(f===no.equalsTo,"expected `=`"),s===no.equalsTo&&a[a.length-1][1].type!==zm.characterEscape?o(f):(r.enter(ro),u(f))}function u(f){const d=Ut(s);if(f===no.equalsTo)return l>1?o(f):(r.consume(f),l++,u);if(l<2)return o(f);const h=r.exit(ro),p=Ut(f);return h._open=!p||p===Lm.attentionSideAfter&&!!d,h._close=!d||d===Lm.attentionSideAfter&&!!p,i(f)}}}Z0.peek=kM;var gM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],AM={canContainEols:["highlight"],enter:{highlight:yM},exit:{highlight:bM}};function yM(t){this.enter({type:"highlight",children:[]},t)}function bM(t){this.exit(t)}var wM={unsafe:[{character:"=",inConstruct:"phrasing",notInConstruct:gM}],handlers:{highlight:Z0}};function Z0(t,e,n,r){const o=n.createTracker(r),s=n.enter("highlight");let a=o.move("==");return a+=o.move(n.containerPhrasing(t,{before:a,after:"=",...o.current()})),a+=o.move("=="),s(),a}function kM(){return"="}function bc(t,e,n){var r;if(Array.isArray(n)){(r=t.fromMarkdownExtensions)!=null||(t.fromMarkdownExtensions=[]),t.fromMarkdownExtensions.push(n);return}t[e]?t[e].push(n):t[e]=[n]}const xM=function(){const e=this.data();bc(e,"micromarkExtensions",mM()),bc(e,"fromMarkdownExtensions",AM),bc(e,"toMarkdownExtensions",wM)},CM=[Wt("remarkHighlightMark",()=>xM),Pn("highlight",()=>({parseDOM:[{tag:"mark"}],toDOM:()=>["mark",0],parseMarkdown:{match:t=>t.type==="highlight",runner:(t,e,n)=>{t.openMark(n,{}),t.next(e.children),t.closeMark(n)}},toMarkdown:{match:t=>t.type.name==="highlight",runner:(t,e)=>{t.withMark(e,"highlight")}}}))].flat(),vM={doc:{id:"highlight",name:"高亮标记 (Highlight)",category:"inline",description:"使用 ==文本== 添加荧光笔黄色高亮背景",sampleMarkdown:"这里支持 ==重要结论== 与 ==关键观点== 的高亮展示。",syntaxGuide:"==高亮文本==",cssSelectors:["mark",".milkdown .editor mark"]},milkdownPlugins:CM,defaultCss:`
693
+ .milkdown .editor mark {
694
+ background-color: #fff0a8;
695
+ color: inherit;
696
+ padding: 1px 3px;
697
+ border-radius: 2px;
698
+ }
699
+ `.trim()};function $0(t){return e=>{const n=e.type.spec.toDOM(e),{dom:r,contentDOM:i}=Ar.renderSpec(document,[n[0],n[1],["section",{"data-article-content":""},0]]),o=r;return t.prepare?.(o,{document}),o.firstElementChild?.setAttribute("contenteditable","false"),{dom:o,contentDOM:i,update:s=>s.type===e.type&&s.attrs.type===e.attrs.type&&s.attrs.title===e.attrs.title,ignoreMutation:s=>s.type!=="selection"&&!i.contains(s.target)}}}const Ks={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 SM(){return t=>{function e(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)e(r)}}e(t)}}const jm=Qe("callout",()=>({content:"block+",group:"block",defining:!0,attrs:{type:{default:"note"},title:{default:""}},parseDOM:[{tag:"section[data-wechat-node='callout']",contentElement:t=>t.querySelector("[data-article-content]")||t,getAttrs:t=>({type:t.getAttribute("data-callout-type")||"note",title:t.getAttribute("data-callout-title")||""})}],toDOM:t=>["section",{class:`wechat-callout wechat-callout-${t.attrs.type}`,"data-wechat-node":"callout","data-callout-type":t.attrs.type,...t.attrs.title?{"data-callout-title":t.attrs.title}:{}},0],parseMarkdown:{match:t=>t.type==="callout",runner:(t,e,n)=>{t.openNode(n,{type:e.calloutType||"note",title:e.customTitle||""}),t.next(e.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="callout",runner:(t,e)=>{t.openNode("callout",void 0,{calloutType:e.attrs.type,customTitle:e.attrs.title}),t.next(e.content),t.closeNode()}}})),IM=[Wt("remarkCallout",()=>SM),jm,Rw(jm.node,()=>$0(X0))].flat(),X0={kind:"callout",selector:'section[data-wechat-node="callout"]',prepare(t,e){const n=t.getAttribute("data-callout-type")||"note",r=t.getAttribute("data-callout-title"),i=e.structure?.calloutPresets?.[n],s={...Ks[n]||Ks.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=e.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=e.document.createElement("span");u.className="wechat-callout-icon",u.textContent=a,c.appendChild(u);const f=e.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),t.prepend(c)},finalize(t){const e=t.getAttribute("data-callout-type")||"note",n=Ks[e]||Ks.note;t.style&&(t.style.borderLeftColor=n.borderColor,t.style.backgroundColor=n.bgColor)}},EM={doc:{id:"callout",name:"提示卡片 (Callout)",category:"block",description:"使用 GFM 规范语法 (> [!NOTE]) 生成带左侧边框与图标的微信高亮卡片",sampleMarkdown:`> [!NOTE]
700
+ > 这里是一条标准提示,适用于操作备忘。
701
+
702
+ > [!TIP] 实用技巧
703
+ > 这是带自定义标题的建议卡片。
704
+
705
+ > [!WARNING] ⚠️ 重点防护
706
+ > 这是带自定义 Emoji 与标题的警告卡片。`,syntaxGuide:`> [!NOTE] 自定义标题 (可选,可包含 Emoji)
707
+ > 提示内容...`,cssSelectors:['section[data-wechat-node="callout"]',".wechat-callout",".wechat-callout-note",".wechat-callout-tip",".wechat-callout-warning"]},milkdownPlugins:IM,wechatRenderer:X0,defaultCss:`
708
+ .milkdown .editor section[data-wechat-node="callout"],
709
+ .milkdown .editor .wechat-callout {
710
+ margin: 1.2em 0;
711
+ padding: 12px 16px;
712
+ border-radius: 6px;
713
+ border-left-width: 4px;
714
+ border-left-style: solid;
715
+ box-sizing: border-box;
716
+ }
717
+ .milkdown .editor .wechat-callout-note {
718
+ border-left-color: #3b82f6;
719
+ background-color: rgba(59, 130, 246, 0.08);
720
+ }
721
+ .milkdown .editor .wechat-callout-tip {
722
+ border-left-color: #10b981;
723
+ background-color: rgba(16, 185, 129, 0.08);
724
+ }
725
+ .milkdown .editor .wechat-callout-important {
726
+ border-left-color: #8b5cf6;
727
+ background-color: rgba(139, 92, 246, 0.08);
728
+ }
729
+ .milkdown .editor .wechat-callout-warning {
730
+ border-left-color: #f59e0b;
731
+ background-color: rgba(245, 158, 11, 0.08);
732
+ }
733
+ .milkdown .editor .wechat-callout-caution {
734
+ border-left-color: #ef4444;
735
+ background-color: rgba(239, 68, 68, 0.08);
736
+ }
737
+ .milkdown .editor section[data-wechat-node="callout-header"] {
738
+ font-size: 14px;
739
+ font-weight: bold;
740
+ margin-bottom: 6px;
741
+ line-height: 1.4;
742
+ }
743
+ .milkdown .editor .wechat-callout-icon {
744
+ font-family: -apple-system, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
745
+ font-size: 16px;
746
+ line-height: 1;
747
+ margin-right: 6px;
748
+ display: inline-block;
749
+ vertical-align: middle;
750
+ }
751
+ .milkdown .editor .wechat-callout p {
752
+ margin: 0.4em 0;
753
+ font-size: 15px;
754
+ line-height: 1.7;
755
+ }
756
+ `.trim()};function RM(){return t=>{function e(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)e(r)}}e(t)}}const NM=[Wt("remarkKbd",()=>RM),Pn("kbd",()=>({inclusive:!1,parseDOM:[{tag:"kbd"},{tag:"span[data-wechat-node='kbd']"}],toDOM:()=>["span",{class:"wechat-kbd","data-wechat-node":"kbd"},0],parseMarkdown:{match:t=>t.type==="kbd",runner:(t,e,n)=>{t.openMark(n,{}),t.next(e.children),t.closeMark(n)}},toMarkdown:{match:t=>t.type.name==="kbd",runner:(t,e)=>{t.withMark(e,"kbd")}}}))].flat(),TM={kind:"kbd",selector:'span[data-wechat-node="kbd"], kbd',finalize(t){if(t.tagName.toLowerCase()==="kbd"){const e=t.ownerDocument.createElement("span");for(const n of Array.from(t.attributes))e.setAttribute(n.name,n.value);for(;t.firstChild;)e.appendChild(t.firstChild);t.replaceWith(e)}}},DM={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:NM,wechatRenderer:TM,defaultCss:`
757
+ .milkdown .editor .wechat-kbd,
758
+ .milkdown .editor span[data-wechat-node="kbd"] {
759
+ display: inline-block;
760
+ padding: 2px 6px;
761
+ font-family: -apple-system, SFMono-Regular, Consolas, Menlo, monospace;
762
+ font-size: 0.85em;
763
+ line-height: 1.2;
764
+ color: #374151;
765
+ background-color: #f3f4f6;
766
+ border: 1px solid #d1d5db;
767
+ border-bottom-width: 2px;
768
+ border-radius: 4px;
769
+ margin: 0 2px;
770
+ box-sizing: border-box;
771
+ }
772
+ `.trim()};function OM(){return t=>{function e(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)e(r)}}e(t)}}const MM=[Wt("remarkBadge",()=>OM),Pn("badge",()=>({inclusive:!1,attrs:{type:{default:"brand"}},parseDOM:[{tag:"span[data-wechat-node='badge']",getAttrs:t=>({type:t.getAttribute("data-badge-type")||"brand"})}],toDOM:t=>["span",{class:`wechat-badge wechat-badge-${t.attrs.type}`,"data-wechat-node":"badge","data-badge-type":t.attrs.type},0],parseMarkdown:{match:t=>t.type==="badge",runner:(t,e,n)=>{t.openMark(n,{type:e.badgeType||"brand"}),t.next(e.children),t.closeMark(n)}},toMarkdown:{match:t=>t.type.name==="badge",runner:(t,e)=>{t.withMark(e,"badge",void 0,{badgeType:e.attrs.type})}}}))].flat(),BM={kind:"badge",selector:'span[data-wechat-node="badge"]'},FM={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:MM,wechatRenderer:BM,defaultCss:`
773
+ .milkdown .editor .wechat-badge,
774
+ .milkdown .editor span[data-wechat-node="badge"] {
775
+ display: inline-block;
776
+ padding: 1px 7px;
777
+ font-size: 0.78em;
778
+ font-weight: 600;
779
+ line-height: 1.4;
780
+ border-radius: 999px;
781
+ margin: 0 3px;
782
+ vertical-align: baseline;
783
+ box-sizing: border-box;
784
+ }
785
+ .milkdown .editor .wechat-badge-brand {
786
+ background-color: rgba(202, 96, 147, 0.12);
787
+ color: #a94473;
788
+ }
789
+ .milkdown .editor .wechat-badge-success {
790
+ background-color: #e8f6ec;
791
+ color: #2f7d4a;
792
+ }
793
+ .milkdown .editor .wechat-badge-warning {
794
+ background-color: #fef3c7;
795
+ color: #b45309;
796
+ }
797
+ .milkdown .editor .wechat-badge-danger {
798
+ background-color: #fee2e2;
799
+ color: #b91c1c;
800
+ }
801
+ .milkdown .editor .wechat-badge-info {
802
+ background-color: #eff6ff;
803
+ color: #1d4ed8;
804
+ }
805
+ `.trim()};function _M(t){const e=t.trim();return/^(?:\*{0,2}(?:文\s*[/::]|作者[::]|By\s+|执笔[::]|策划[::]|编辑[::])|预计阅读|阅读需|字数[::]|共\s*\d+\s*字)/i.test(e)}function PM(t){const e=t.trim();return/(?:欢迎关注|关注公众号|星标|不错过|点击右下角|扫码关注|关注我们|回复「)/i.test(e)}function LM(){return t=>{function e(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)e(r)}}e(t)}}const Km=Qe("articleCard",()=>({content:"block+",group:"block",defining:!0,attrs:{type:{default:"intro"},title:{default:""}},parseDOM:[{tag:"section[data-wechat-node='article-card']",contentElement:t=>t.querySelector("[data-article-content]")||t,getAttrs:t=>({type:t.getAttribute("data-card-type")||"intro",title:t.getAttribute("data-card-title")||""})}],toDOM:t=>["section",{class:`wechat-article-card wechat-article-card-${t.attrs.type}`,"data-wechat-node":"article-card","data-card-type":t.attrs.type,...t.attrs.title?{"data-card-title":t.attrs.title}:{}},0],parseMarkdown:{match:t=>t.type==="articleCard",runner:(t,e,n)=>{t.openNode(n,{type:e.cardType||"intro",title:e.customTitle||""}),t.next(e.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="articleCard",runner:(t,e)=>{t.openNode("articleCard",void 0,{cardType:e.attrs.type,customTitle:e.attrs.title}),t.next(e.content),t.closeNode()}}})),zM=[Wt("remarkArticleCards",()=>LM),Km,Rw(Km.node,()=>$0(ek))].flat(),ek={kind:"article-card",selector:'section[data-wechat-node="article-card"]',prepare(t,e){const n=t.getAttribute("data-card-type")||"intro",r=t.getAttribute("data-card-title")||"";if(n==="intro"){const i=e.document.createElement("section");i.className="wechat-card-eyebrow",i.setAttribute("data-wechat-node","card-eyebrow");const o=e.document.createElement("span");o.className="wechat-card-eyebrow-badge",o.setAttribute("data-wechat-node","card-eyebrow-badge");const s=e.document.createElement("span");s.className="wechat-card-eyebrow-icon",s.textContent="📖",o.appendChild(s);const a=e.document.createElement("span");a.className="wechat-card-eyebrow-label",a.textContent=r.trim()||"导读 · READING GUIDE",o.appendChild(a),i.appendChild(o),t.prepend(i);const l=Array.from(t.querySelectorAll("p"));for(const c of l){const u=c.textContent?.trim()||"";_M(u)?(c.className=(c.className?c.className+" ":"")+"wechat-intro-meta",c.setAttribute("data-wechat-node","intro-meta")):PM(u)&&(c.className=(c.className?c.className+" ":"")+"wechat-intro-guide",c.setAttribute("data-wechat-node","intro-guide"))}return}if(n==="cta"){const i=e.document.createElement("section");i.className="wechat-card-eyebrow",i.setAttribute("data-wechat-node","card-eyebrow");const o=e.document.createElement("span");o.className="wechat-card-eyebrow-badge",o.setAttribute("data-wechat-node","card-eyebrow-badge");const s=e.document.createElement("span");s.className="wechat-card-eyebrow-icon",s.textContent="✨",o.appendChild(s);const a=e.document.createElement("span");a.className="wechat-card-eyebrow-label",a.textContent=r.trim()||"互动交流 · CONNECT",o.appendChild(a),i.appendChild(o),t.prepend(i)}}},WM={doc:{id:"article-card",name:"篇章结构卡片 (Article Card)",category:"block",description:"专为文章开头的精修导读卡 (> [!INTRO]) 和结尾互动号召 (> [!CTA]) 设计的高级结构化卡片,去引用化设计,支持悬挂作者与元信息条、引导关注及精致小字排版",sampleMarkdown:`> [!INTRO] 导读
806
+ > **文 / Aatrox** · 预计阅读 5 分钟
807
+ >
808
+ > 本文系统解析工作流核心状态机与排版架构。从 AST 转换到微信安全内联,带你掌握定制化排版全流程。
809
+ >
810
+ > 💡 欢迎关注公众号「早早集市」,星标不错过每次更新。
811
+
812
+ > [!CTA] 欢迎交流与关注
813
+ > 如果这篇文章对你有所启发,欢迎点击右下角 **「点赞」** 和 **「在看」** 支持!`,syntaxGuide:`> [!INTRO] 自定义标题 (可选)
814
+ > **文 / 作者** · 预计阅读 5 分钟 (可选悬挂元信息)
815
+ > 导读正文...
816
+ > 💡 欢迎关注... (可选引导关注)
817
+
818
+ > [!CTA] 互动标题 (可选)
819
+ > 互动号召正文...`,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:zM,wechatRenderer:ek,defaultCss:`
820
+ .milkdown .editor section[data-wechat-node="article-card"],
821
+ .milkdown .editor .wechat-article-card {
822
+ margin: 1.8em 0;
823
+ padding: 16px 20px;
824
+ border-radius: 10px;
825
+ box-sizing: border-box;
826
+ overflow: hidden;
827
+ }
828
+ .milkdown .editor .wechat-article-card-intro {
829
+ background-color: var(--wx-soft-surface, #faf8f9);
830
+ border: 1px solid var(--wx-divider, #eae4e7);
831
+ }
832
+ .milkdown .editor .wechat-article-card-cta {
833
+ background-color: rgba(202, 96, 147, 0.04);
834
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
835
+ text-align: center;
836
+ }
837
+ .milkdown .editor section[data-wechat-node="card-eyebrow"],
838
+ .milkdown .editor .wechat-card-eyebrow {
839
+ margin-bottom: 10px;
840
+ }
841
+ .milkdown .editor .wechat-article-card-cta section[data-wechat-node="card-eyebrow"],
842
+ .milkdown .editor .wechat-article-card-cta .wechat-card-eyebrow {
843
+ text-align: center;
844
+ }
845
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
846
+ .milkdown .editor .wechat-card-eyebrow-badge {
847
+ display: inline-block;
848
+ padding: 2px 8px;
849
+ border-radius: 4px;
850
+ background-color: rgba(202, 96, 147, 0.08);
851
+ color: var(--wx-brand-accent, #ca6093);
852
+ font-size: 11px;
853
+ font-weight: 700;
854
+ letter-spacing: 0.06em;
855
+ line-height: 1.5;
856
+ }
857
+ .milkdown .editor .wechat-card-eyebrow-icon {
858
+ margin-right: 4px;
859
+ font-size: 12px;
860
+ display: inline-block;
861
+ vertical-align: middle;
862
+ }
863
+ .milkdown .editor .wechat-card-eyebrow-label {
864
+ display: inline-block;
865
+ vertical-align: middle;
866
+ }
867
+ .milkdown .editor .wechat-article-card p {
868
+ margin: 0.4em 0;
869
+ font-size: 13px;
870
+ line-height: 1.72;
871
+ color: var(--wx-text-soft, #555555);
872
+ letter-spacing: 0.02em;
873
+ }
874
+ .milkdown .editor p[data-wechat-node="intro-meta"],
875
+ .milkdown .editor .wechat-intro-meta {
876
+ margin: 4px 0 10px 0 !important;
877
+ padding-bottom: 8px;
878
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
879
+ font-size: 12px !important;
880
+ color: var(--wx-muted-color, #756b6e) !important;
881
+ line-height: 1.5 !important;
882
+ }
883
+ .milkdown .editor p[data-wechat-node="intro-meta"] strong,
884
+ .milkdown .editor .wechat-intro-meta strong {
885
+ color: var(--wx-brand-accent, #ca6093);
886
+ font-weight: 600;
887
+ }
888
+ .milkdown .editor p[data-wechat-node="intro-guide"],
889
+ .milkdown .editor .wechat-intro-guide {
890
+ margin-top: 10px !important;
891
+ padding-top: 8px;
892
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
893
+ font-size: 12px !important;
894
+ color: var(--wx-brand-accent, #ca6093) !important;
895
+ line-height: 1.6 !important;
896
+ }
897
+ `.trim()};function jM(){const t=this.data(),e=(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}
898
+ >
899
+ ${l.split(`
900
+ `).map(c=>c?`> ${c}`:">").join(`
901
+ `)}`};(t.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:${e(r,o,s)}]]`,badge:(r,i,o,s)=>`[badge:${r.badgeType}|${e(r,o,s)}]`}})}const KM=Wt("remarkArticleSerialization",()=>jM);function JM(t){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:e,name:n,text:r})=>new Ct(e,(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=t.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 QM(){return new xt({props:{handleKeyDown(t,e){if(e.key!=="Enter"||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.isComposing)return!1;const{state:n}=t,{$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(ue.near(d.doc.resolve(f+2))),t.dispatch(d.scrollIntoView()),!0}}})}const HM=[on(t=>WI({rules:JM(t.get(rn))})),on(()=>QM())],qM=[vM,EM,DM,FM,WM],UM=[];function ed(){return[...qM,...UM]}function VL(){const t=[...KM,...HM];for(const e of ed())t.push(...e.milkdownPlugins);return t}function GM(){const t=[];for(const e of ed())e.wechatRenderer&&t.push(e.wechatRenderer);return t}function YM(){const t=[];for(const e of ed())e.defaultCss&&t.push(e.defaultCss);return t.join(`
902
+
903
+ `)}const VM={_useHtmlParser2:!1};function tf(t,e){if(!t)return e??VM;const n={_useHtmlParser2:!!t.xmlMode,...e,...t};return t.xml?(n._useHtmlParser2=!0,n.xmlMode=!0,t.xml!==!0&&Object.assign(n,t.xml)):t.xmlMode&&(n._useHtmlParser2=!0),n}var xe;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(xe||(xe={}));function ZM(t){return t.type===xe.Tag||t.type===xe.Script||t.type===xe.Style}const td=xe.Root,tk=xe.Text,$M=xe.Directive,nk=xe.Comment,XM=xe.Script,eB=xe.Style,nf=xe.Tag,tB=xe.CDATA,nB=xe.Doctype;class rk{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return Ko(this,e)}}class nd extends rk{constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}}class _a extends nd{constructor(){super(...arguments),this.type=xe.Text}get nodeType(){return 3}}class ik extends nd{constructor(){super(...arguments),this.type=xe.Comment}get nodeType(){return 8}}class ok extends nd{constructor(e,n){super(n),this.name=e,this.type=xe.Directive}get nodeType(){return 1}}class rd extends rk{constructor(e){super(),this.children=e}get firstChild(){var e;return(e=this.children[0])!==null&&e!==void 0?e:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class sk extends rd{constructor(){super(...arguments),this.type=xe.CDATA}get nodeType(){return 4}}class jo extends rd{constructor(){super(...arguments),this.type=xe.Root}get nodeType(){return 9}}class ak extends rd{constructor(e,n,r=[],i=e==="script"?xe.Script:e==="style"?xe.Style:xe.Tag){super(r),this.name=e,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>{var n,r;return{name:e,value:this.attribs[e],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[e],prefix:(r=this["x-attribsPrefix"])===null||r===void 0?void 0:r[e]}})}}function oe(t){return ZM(t)}function pl(t){return t.type===xe.CDATA}function ni(t){return t.type===xe.Text}function id(t){return t.type===xe.Comment}function rB(t){return t.type===xe.Directive}function oi(t){return t.type===xe.Root}function Je(t){return Object.prototype.hasOwnProperty.call(t,"children")}function Ko(t,e=!1){let n;if(ni(t))n=new _a(t.data);else if(id(t))n=new ik(t.data);else if(oe(t)){const r=e?wc(t.children):[],i=new ak(t.name,{...t.attribs},r);r.forEach(o=>o.parent=i),t.namespace!=null&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...t["x-attribsPrefix"]}),n=i}else if(pl(t)){const r=e?wc(t.children):[],i=new sk(r);r.forEach(o=>o.parent=i),n=i}else if(oi(t)){const r=e?wc(t.children):[],i=new jo(r);r.forEach(o=>o.parent=i),t["x-mode"]&&(i["x-mode"]=t["x-mode"]),n=i}else if(rB(t)){const r=new ok(t.name,t.data);t["x-name"]!=null&&(r["x-name"]=t["x-name"],r["x-publicId"]=t["x-publicId"],r["x-systemId"]=t["x-systemId"]),n=r}else throw new Error(`Not implemented yet: ${t.type}`);return n.startIndex=t.startIndex,n.endIndex=t.endIndex,t.sourceCodeLocation!=null&&(n.sourceCodeLocation=t.sourceCodeLocation),n}function wc(t){const e=t.map(n=>Ko(n,!0));for(let n=1;n<e.length;n++)e[n].prev=e[n-1],e[n-1].next=e[n];return e}const Jm={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class iB{constructor(e,n,r){this.dom=[],this.root=new jo(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(r=n,n=Jm),typeof e=="object"&&(n=e,e=void 0),this.callback=e??null,this.options=n??Jm,this.elementCB=r??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new jo(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(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,n){const r=this.options.xmlMode?xe.Tag:void 0,i=new ak(e,n,void 0,r);this.addNode(i),this.tagStack.push(i)}ontext(e){const{lastNode:n}=this;if(n&&n.type===xe.Text)n.data+=e,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{const r=new _a(e);this.addNode(r),this.lastNode=r}}oncomment(e){if(this.lastNode&&this.lastNode.type===xe.Comment){this.lastNode.data+=e;return}const n=new ik(e);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){const e=new _a(""),n=new sk([e]);this.addNode(n),e.parent=n,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,n){const r=new ok(e,n);this.addNode(r)}handleCallback(e){if(typeof this.callback=="function")this.callback(e,this.dom);else if(e)throw e}addNode(e){const n=this.tagStack[this.tagStack.length-1],r=n.children[n.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),n.children.push(e),r&&(e.prev=r,r.next=e),e.parent=n,this.lastNode=null}}const Qm=/["&'<>$\x80-\uFFFF]/g,oB=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),sB=String.prototype.codePointAt!=null?(t,e)=>t.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function lk(t){let e="",n=0,r;for(;(r=Qm.exec(t))!==null;){const i=r.index,o=t.charCodeAt(i),s=oB.get(o);s!==void 0?(e+=t.substring(n,i)+s,n=i+1):(e+=`${t.substring(n,i)}&#x${sB(t,i).toString(16)};`,n=Qm.lastIndex+=+((o&64512)===55296))}return e+t.substr(n)}function ck(t,e){return function(r){let i,o=0,s="";for(;i=t.exec(r);)o!==i.index&&(s+=r.substring(o,i.index)),s+=e.get(i[0].charCodeAt(0)),o=i.index+1;return s+r.substring(o)}}const aB=ck(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),lB=ck(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),cB=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(t=>[t.toLowerCase(),t])),uB=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(t=>[t.toLowerCase(),t])),fB=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function hB(t){return t.replace(/"/g,"&quot;")}function dB(t,e){var n;if(!t)return;const r=((n=e.encodeEntities)!==null&&n!==void 0?n:e.decodeEntities)===!1?hB:e.xmlMode||e.encodeEntities!=="utf8"?lk:aB;return Object.keys(t).map(i=>{var o,s;const a=(o=t[i])!==null&&o!==void 0?o:"";return e.xmlMode==="foreign"&&(i=(s=uB.get(i))!==null&&s!==void 0?s:i),!e.emptyAttrs&&!e.xmlMode&&a===""?i:`${i}="${r(a)}"`}).join(" ")}const Hm=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function ml(t,e={}){const n="length"in t?t:[t];let r="";for(let i=0;i<n.length;i++)r+=pB(n[i],e);return r}function pB(t,e){switch(t.type){case td:return ml(t.children,e);case nB:case $M:return yB(t);case nk:return kB(t);case tB:return wB(t);case XM:case eB:case nf:return AB(t,e);case tk:return bB(t,e)}}const mB=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),gB=new Set(["svg","math"]);function AB(t,e){var n;e.xmlMode==="foreign"&&(t.name=(n=cB.get(t.name))!==null&&n!==void 0?n:t.name,t.parent&&mB.has(t.parent.name)&&(e={...e,xmlMode:!1})),!e.xmlMode&&gB.has(t.name)&&(e={...e,xmlMode:"foreign"});let r=`<${t.name}`;const i=dB(t.attribs,e);return i&&(r+=` ${i}`),t.children.length===0&&(e.xmlMode?e.selfClosingTags!==!1:e.selfClosingTags&&Hm.has(t.name))?(e.xmlMode||(r+=" "),r+="/>"):(r+=">",t.children.length>0&&(r+=ml(t.children,e)),(e.xmlMode||!Hm.has(t.name))&&(r+=`</${t.name}>`)),r}function yB(t){return`<${t.data}>`}function bB(t,e){var n;let r=t.data||"";return((n=e.encodeEntities)!==null&&n!==void 0?n:e.decodeEntities)!==!1&&!(!e.xmlMode&&t.parent&&fB.has(t.parent.name))&&(r=e.xmlMode||e.encodeEntities!=="utf8"?lk(r):lB(r)),r}function wB(t){return`<![CDATA[${t.children[0].data}]]>`}function kB(t){return`<!--${t.data}-->`}function uk(t,e){return ml(t,e)}function xB(t,e){return Je(t)?t.children.map(n=>uk(n,e)).join(""):""}function pa(t){return Array.isArray(t)?t.map(pa).join(""):oe(t)?t.name==="br"?`
904
+ `:pa(t.children):pl(t)?pa(t.children):ni(t)?t.data:""}function _i(t){return Array.isArray(t)?t.map(_i).join(""):Je(t)&&!id(t)?_i(t.children):ni(t)?t.data:""}function Pa(t){return Array.isArray(t)?t.map(Pa).join(""):Je(t)&&(t.type===xe.Tag||pl(t))?Pa(t.children):ni(t)?t.data:""}function gl(t){return Je(t)?t.children:[]}function fk(t){return t.parent||null}function hk(t){const e=fk(t);if(e!=null)return gl(e);const n=[t];let{prev:r,next:i}=t;for(;r!=null;)n.unshift(r),{prev:r}=r;for(;i!=null;)n.push(i),{next:i}=i;return n}function CB(t,e){var n;return(n=t.attribs)===null||n===void 0?void 0:n[e]}function vB(t,e){return t.attribs!=null&&Object.prototype.hasOwnProperty.call(t.attribs,e)&&t.attribs[e]!=null}function SB(t){return t.name}function od(t){let{next:e}=t;for(;e!==null&&!oe(e);)({next:e}=e);return e}function sd(t){let{prev:e}=t;for(;e!==null&&!oe(e);)({prev:e}=e);return e}function si(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){const e=t.parent.children,n=e.lastIndexOf(t);n>=0&&e.splice(n,1)}t.next=null,t.prev=null,t.parent=null}function IB(t,e){const n=e.prev=t.prev;n&&(n.next=e);const r=e.next=t.next;r&&(r.prev=e);const i=e.parent=t.parent;if(i){const o=i.children;o[o.lastIndexOf(t)]=e,t.parent=null}}function EB(t,e){if(si(e),e.next=null,e.parent=t,t.children.push(e)>1){const n=t.children[t.children.length-2];n.next=e,e.prev=n}else e.prev=null}function RB(t,e){si(e);const{parent:n}=t,r=t.next;if(e.next=r,e.prev=t,t.next=e,e.parent=n,r){if(r.prev=e,n){const i=n.children;i.splice(i.lastIndexOf(r),0,e)}}else n&&n.children.push(e)}function NB(t,e){if(si(e),e.parent=t,e.prev=null,t.children.unshift(e)!==1){const n=t.children[1];n.prev=e,e.next=n}else e.next=null}function TB(t,e){si(e);const{parent:n}=t;if(n){const r=n.children;r.splice(r.indexOf(t),0,e)}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e}function vs(t,e,n=!0,r=1/0){return ad(t,Array.isArray(e)?e:[e],n,r)}function ad(t,e,n,r){const i=[],o=[Array.isArray(e)?e:[e]],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(t(a)&&(i.push(a),--r<=0))return i;n&&Je(a)&&a.children.length>0&&(s.unshift(0),o.unshift(a.children))}}function DB(t,e){return e.find(t)}function ld(t,e,n=!0){const r=Array.isArray(e)?e:[e];for(let i=0;i<r.length;i++){const o=r[i];if(oe(o)&&t(o))return o;if(n&&Je(o)&&o.children.length>0){const s=ld(t,o.children,!0);if(s)return s}}return null}function dk(t,e){return(Array.isArray(e)?e:[e]).some(n=>oe(n)&&t(n)||Je(n)&&dk(t,n.children))}function OB(t,e){const n=[],r=[Array.isArray(e)?e:[e]],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]++];oe(o)&&t(o)&&n.push(o),Je(o)&&o.children.length>0&&(i.unshift(0),r.unshift(o.children))}}const La={tag_name(t){return typeof t=="function"?e=>oe(e)&&t(e.name):t==="*"?oe:e=>oe(e)&&e.name===t},tag_type(t){return typeof t=="function"?e=>t(e.type):e=>e.type===t},tag_contains(t){return typeof t=="function"?e=>ni(e)&&t(e.data):e=>ni(e)&&e.data===t}};function cd(t,e){return typeof e=="function"?n=>oe(n)&&e(n.attribs[t]):n=>oe(n)&&n.attribs[t]===e}function MB(t,e){return n=>t(n)||e(n)}function pk(t){const e=Object.keys(t).map(n=>{const r=t[n];return Object.prototype.hasOwnProperty.call(La,n)?La[n](r):cd(n,r)});return e.length===0?null:e.reduce(MB)}function BB(t,e){const n=pk(t);return n?n(e):!0}function FB(t,e,n,r=1/0){const i=pk(t);return i?vs(i,e,n,r):[]}function _B(t,e,n=!0){return Array.isArray(e)||(e=[e]),ld(cd("id",t),e,n)}function Qi(t,e,n=!0,r=1/0){return vs(La.tag_name(t),e,n,r)}function PB(t,e,n=!0,r=1/0){return vs(cd("class",t),e,n,r)}function LB(t,e,n=!0,r=1/0){return vs(La.tag_type(t),e,n,r)}function zB(t){let e=t.length;for(;--e>=0;){const n=t[e];if(e>0&&t.lastIndexOf(n,e-1)>=0){t.splice(e,1);continue}for(let r=n.parent;r;r=r.parent)if(t.includes(r)){t.splice(e,1);break}}return t}var Jt;(function(t){t[t.DISCONNECTED=1]="DISCONNECTED",t[t.PRECEDING=2]="PRECEDING",t[t.FOLLOWING=4]="FOLLOWING",t[t.CONTAINS=8]="CONTAINS",t[t.CONTAINED_BY=16]="CONTAINED_BY"})(Jt||(Jt={}));function mk(t,e){const n=[],r=[];if(t===e)return 0;let i=Je(t)?t:t.parent;for(;i;)n.unshift(i),i=i.parent;for(i=Je(e)?e:e.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 Jt.DISCONNECTED;const a=n[s-1],l=a.children,c=n[s],u=r[s];return l.indexOf(c)>l.indexOf(u)?a===e?Jt.FOLLOWING|Jt.CONTAINED_BY:Jt.FOLLOWING:a===t?Jt.PRECEDING|Jt.CONTAINS:Jt.PRECEDING}function Hi(t){return t=t.filter((e,n,r)=>!r.includes(e,n+1)),t.sort((e,n)=>{const r=mk(e,n);return r&Jt.PRECEDING?-1:r&Jt.FOLLOWING?1:0}),t}function WB(t){const e=za(HB,t);return e?e.name==="feed"?jB(e):KB(e):null}function jB(t){var e;const n=t.children,r={type:"atom",items:Qi("entry",n).map(s=>{var a;const{children:l}=s,c={media:gk(l)};Rt(c,"id","id",l),Rt(c,"title","title",l);const u=(a=za("link",l))===null||a===void 0?void 0:a.attribs.href;u&&(c.link=u);const f=lr("summary",l)||lr("content",l);f&&(c.description=f);const d=lr("updated",l);return d&&(c.pubDate=new Date(d)),c})};Rt(r,"id","id",n),Rt(r,"title","title",n);const i=(e=za("link",n))===null||e===void 0?void 0:e.attribs.href;i&&(r.link=i),Rt(r,"description","subtitle",n);const o=lr("updated",n);return o&&(r.updated=new Date(o)),Rt(r,"author","email",n,!0),r}function KB(t){var e,n;const r=(n=(e=za("channel",t.children))===null||e===void 0?void 0:e.children)!==null&&n!==void 0?n:[],i={type:t.name.substr(0,3),id:"",items:Qi("item",t.children).map(s=>{const{children:a}=s,l={media:gk(a)};Rt(l,"id","guid",a),Rt(l,"title","title",a),Rt(l,"link","link",a),Rt(l,"description","description",a);const c=lr("pubDate",a)||lr("dc:date",a);return c&&(l.pubDate=new Date(c)),l})};Rt(i,"title","title",r),Rt(i,"link","link",r),Rt(i,"description","description",r);const o=lr("lastBuildDate",r);return o&&(i.updated=new Date(o)),Rt(i,"author","managingEditor",r,!0),i}const JB=["url","type","lang"],QB=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function gk(t){return Qi("media:content",t).map(e=>{const{attribs:n}=e,r={medium:n.medium,isDefault:!!n.isDefault};for(const i of JB)n[i]&&(r[i]=n[i]);for(const i of QB)n[i]&&(r[i]=parseInt(n[i],10));return n.expression&&(r.expression=n.expression),r})}function za(t,e){return Qi(t,e,!0,1)[0]}function lr(t,e,n=!1){return _i(Qi(t,e,n,1)).trim()}function Rt(t,e,n,r,i=!1){const o=lr(n,r,i);o&&(t[e]=o)}function HB(t){return t==="rss"||t==="feed"||t==="rdf:RDF"}const Al=Object.freeze(Object.defineProperty({__proto__:null,get DocumentPosition(){return Jt},append:RB,appendChild:EB,compareDocumentPosition:mk,existsOne:dk,filter:vs,find:ad,findAll:OB,findOne:ld,findOneChild:DB,getAttributeValue:CB,getChildren:gl,getElementById:_B,getElements:FB,getElementsByClassName:PB,getElementsByTagName:Qi,getElementsByTagType:LB,getFeed:WB,getInnerHTML:xB,getName:SB,getOuterHTML:uk,getParent:fk,getSiblings:hk,getText:pa,hasAttrib:vB,hasChildren:Je,innerText:Pa,isCDATA:pl,isComment:id,isDocument:oi,isTag:oe,isText:ni,nextElementSibling:od,prepend:TB,prependChild:NB,prevElementSibling:sd,removeElement:si,removeSubsets:zB,replaceElement:IB,testElement:BB,textContent:_i,uniqueSort:Hi},Symbol.toStringTag,{value:"Module"}));function Ak(t,e,n){return t?t(e??t._root.children,null,void 0,n).toString():""}function qB(t,e){return typeof t=="object"&&t!=null&&!("length"in t)&&!("type"in t)}function UB(t,e){const n=qB(t)?(e=t,void 0):t,r={...this===null||this===void 0?void 0:this._options,...tf(e)};return Ak(this,n,r)}function GB(t){const e={...this._options,xmlMode:!0};return Ak(this,t,e)}function Jo(t){const e=t??(this?this.root():[]);let n="";for(let r=0;r<e.length;r++)n+=_i(e[r]);return n}function YB(t,e,n=typeof e=="boolean"?e:!1){if(!t||typeof t!="string")return null;typeof e=="boolean"&&(n=e);const r=this.load(t,this._options,!1);return n||r("script").remove(),[...r.root()[0].children]}function VB(){return this(this._root)}function yk(t,e){if(e===t)return!1;let n=e;for(;n&&n!==n.parent;)if(n=n.parent,n===t)return!0;return!1}function ZB(t){return this.root().extract(t)}function $B(t,e){if(!qm(t)||!qm(e))return;let n=t.length;const r=+e.length;for(let i=0;i<r;i++)t[n++]=e[i];return t.length=n,t}function qm(t){if(Array.isArray(t))return!0;if(typeof t!="object"||t===null||!("length"in t)||typeof t.length!="number"||t.length<0)return!1;for(let e=0;e<t.length;e++)if(!(e in t))return!1;return!0}const XB=Object.freeze(Object.defineProperty({__proto__:null,contains:yk,extract:ZB,html:UB,merge:$B,parseHTML:YB,root:VB,text:Jo,xml:GB},Symbol.toStringTag,{value:"Module"}));function On(t){return t.cheerio!=null}function eF(t){return t.replace(/[._-](\w|$)/g,(e,n)=>n.toUpperCase())}function tF(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}function ze(t,e){const n=t.length;for(let r=0;r<n;r++)e(t[r],r);return t}var Mr;(function(t){t[t.LowerA=97]="LowerA",t[t.LowerZ=122]="LowerZ",t[t.UpperA=65]="UpperA",t[t.UpperZ=90]="UpperZ",t[t.Exclamation=33]="Exclamation"})(Mr||(Mr={}));function rf(t){if(typeof t!="string")return!1;const e=t.indexOf("<");if(e===-1||e>t.length-3)return!1;const n=t.charCodeAt(e+1);return(n>=Mr.LowerA&&n<=Mr.LowerZ||n>=Mr.UpperA&&n<=Mr.UpperZ||n===Mr.Exclamation)&&t.includes(">",e+2)}var kc;const nF=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]]),Um=(kc=String.fromCodePoint)!==null&&kc!==void 0?kc:(t=>{let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e});function rF(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=nF.get(t))!==null&&e!==void 0?e:t}function bk(t){const e=typeof atob=="function"?atob(t):typeof Buffer.from=="function"?Buffer.from(t,"base64").toString("binary"):new Buffer(t,"base64").toString("binary"),n=e.length&-2,r=new Uint16Array(n/2);for(let i=0,o=0;i<n;i+=2){const s=e.charCodeAt(i),a=e.charCodeAt(i+1);r[o++]=s|a<<8}return r}const iF=bk("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"),oF=bk("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var mt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.FLAG13=8192]="FLAG13",t[t.BRANCH_LENGTH=8064]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(mt||(mt={}));var Le;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Le||(Le={}));const Gm=32;function of(t){return t>=Le.ZERO&&t<=Le.NINE}function sF(t){return t>=Le.UPPER_A&&t<=Le.UPPER_F||t>=Le.LOWER_A&&t<=Le.LOWER_F}function aF(t){return t>=Le.UPPER_A&&t<=Le.UPPER_Z||t>=Le.LOWER_A&&t<=Le.LOWER_Z||of(t)}function lF(t){return t===Le.EQUALS||aF(t)}var et;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(et||(et={}));var un;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(un||(un={}));class cF{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=et.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=un.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=et.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,n){switch(this.state){case et.EntityStart:return e.charCodeAt(n)===Le.NUM?(this.state=et.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=et.NamedEntity,this.stateNamedEntity(e,n));case et.NumericStart:return this.stateNumericStart(e,n);case et.NumericDecimal:return this.stateNumericDecimal(e,n);case et.NumericHex:return this.stateNumericHex(e,n);case et.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Gm)===Le.LOWER_X?(this.state=et.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=et.NumericDecimal,this.stateNumericDecimal(e,n))}stateNumericHex(e,n){for(;n<e.length;){const r=e.charCodeAt(n);if(of(r)||sF(r)){const i=r<=Le.NINE?r-Le.ZERO:(r|Gm)-Le.LOWER_A+10;this.result=this.result*16+i,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(e,n){for(;n<e.length;){const r=e.charCodeAt(n);if(of(r))this.result=this.result*10+(r-Le.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Le.SEMI)this.consumed+=1;else if(this.decodeMode===un.Strict)return 0;return this.emitCodePoint(rF(this.result),this.consumed),this.errors&&(e!==Le.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&mt.VALUE_LENGTH)>>14;for(;n<e.length;){if(o===0&&(i&mt.FLAG13)!==0){const a=(i&mt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const l=i&mt.JUMP_TABLE;if(e.charCodeAt(n)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=e.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(e.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&mt.VALUE_LENGTH)>>14}if(n>=e.length)break;const s=e.charCodeAt(n);if(s===Le.SEMI&&o!==0&&(i&mt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=uF(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===un.Attribute&&(o===0||lF(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&mt.VALUE_LENGTH)>>14,o!==0){if(s===Le.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==un.Strict&&(i&mt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&mt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~(mt.VALUE_LENGTH|mt.FLAG13):i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case et.NamedEntity:return this.result!==0&&(this.decodeMode!==un.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case et.NumericDecimal:return this.emitNumericEntity(0,2);case et.NumericHex:return this.emitNumericEntity(0,3);case et.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case et.EntityStart:return 0}}}function uF(t,e,n,r){const i=(e&mt.BRANCH_LENGTH)>>7,o=e&mt.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const c=r-o;return c<0||c>=i?-1:t[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=t[n+u]>>(c&1)*8&255;if(d<r)a=c+1;else if(d>r)l=c-1;else return t[n+s+c]}return-1}var X;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(X||(X={}));var j;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"})(j||(j={}));function xn(t){return t===X.Space||t===X.NewLine||t===X.Tab||t===X.FormFeed||t===X.CarriageReturn}function Js(t){return t===X.Slash||t===X.Gt||xn(t)}function fF(t){return t>=X.LowerA&&t<=X.LowerZ||t>=X.UpperA&&t<=X.UpperZ}var fn;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(fn||(fn={}));const He={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 hF{constructor({xmlMode:e=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=j.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=j.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new cF(e?oF:iF,(i,o)=>this.emitCodePoint(i,o))}reset(){this.state=j.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=j.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,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(e){e===X.Lt||!this.decodeEntities&&this.fastForwardTo(X.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=j.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===X.Amp&&this.startEntity()}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Js(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=j.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===X.Gt||xn(e)){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(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===He.TitleEnd?this.decodeEntities&&e===X.Amp&&this.startEntity():this.fastForwardTo(X.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===X.Lt)}stateCDATASequence(e){e===He.Cdata[this.sequenceIndex]?++this.sequenceIndex===He.Cdata.length&&(this.state=j.InCommentLike,this.currentSequence=He.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=j.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===He.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=j.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Js(e):fF(e)}startSpecial(e,n){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=n,this.state=j.SpecialStartSequence}stateBeforeTagName(e){if(e===X.ExclamationMark)this.state=j.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===X.Questionmark)this.state=j.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const n=e|32;this.sectionStart=this.index,this.xmlMode?this.state=j.InTagName:n===He.ScriptEnd[2]?this.state=j.BeforeSpecialS:n===He.TitleEnd[2]||n===He.XmpEnd[2]?this.state=j.BeforeSpecialT:this.state=j.InTagName}else e===X.Slash?this.state=j.BeforeClosingTagName:(this.state=j.Text,this.stateText(e))}stateInTagName(e){Js(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=j.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){xn(e)||(e===X.Gt?this.state=j.Text:(this.state=this.isTagStartChar(e)?j.InClosingTagName:j.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===X.Gt||xn(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=j.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===X.Gt||this.fastForwardTo(X.Gt))&&(this.state=j.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===X.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=j.InSpecialTag,this.sequenceIndex=0):this.state=j.Text,this.sectionStart=this.index+1):e===X.Slash?this.state=j.InSelfClosingTag:xn(e)||(this.state=j.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===X.Gt?(this.cbs.onselfclosingtag(this.index),this.state=j.Text,this.sectionStart=this.index+1,this.isSpecial=!1):xn(e)||(this.state=j.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===X.Eq||Js(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=j.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===X.Eq?this.state=j.BeforeAttributeValue:e===X.Slash||e===X.Gt?(this.cbs.onattribend(fn.NoValue,this.sectionStart),this.sectionStart=-1,this.state=j.BeforeAttributeName,this.stateBeforeAttributeName(e)):xn(e)||(this.cbs.onattribend(fn.NoValue,this.sectionStart),this.state=j.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===X.DoubleQuote?(this.state=j.InAttributeValueDq,this.sectionStart=this.index+1):e===X.SingleQuote?(this.state=j.InAttributeValueSq,this.sectionStart=this.index+1):xn(e)||(this.sectionStart=this.index,this.state=j.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===X.DoubleQuote?fn.Double:fn.Single,this.index+1),this.state=j.BeforeAttributeName):this.decodeEntities&&e===X.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,X.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,X.SingleQuote)}stateInAttributeValueNoQuotes(e){xn(e)||e===X.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(fn.Unquoted,this.index),this.state=j.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===X.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===X.OpeningSquareBracket?(this.state=j.CDATASequence,this.sequenceIndex=0):this.state=e===X.Dash?j.BeforeComment:j.InDeclaration}stateInDeclaration(e){(e===X.Gt||this.fastForwardTo(X.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=j.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===X.Gt||this.fastForwardTo(X.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=j.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===X.Dash?(this.state=j.InCommentLike,this.currentSequence=He.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=j.InDeclaration}stateInSpecialComment(e){(e===X.Gt||this.fastForwardTo(X.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=j.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const n=e|32;n===He.ScriptEnd[3]?this.startSpecial(He.ScriptEnd,4):n===He.StyleEnd[3]?this.startSpecial(He.StyleEnd,4):(this.state=j.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){switch(e|32){case He.TitleEnd[3]:{this.startSpecial(He.TitleEnd,4);break}case He.TextareaEnd[3]:{this.startSpecial(He.TextareaEnd,4);break}case He.XmpEnd[3]:{this.startSpecial(He.XmpEnd,4);break}default:this.state=j.InTagName,this.stateInTagName(e)}}startEntity(){this.baseState=this.state,this.state=j.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?un.Strict:this.baseState===j.Text||this.baseState===j.InSpecialTag?un.Legacy:un.Attribute)}stateInEntity(){const e=this.index-this.offset,n=this.entityDecoder.write(this.buffer,e);if(n>=0)this.state=this.baseState,n===0&&(this.index-=1);else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===X.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===j.Text||this.state===j.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===j.InAttributeValueDq||this.state===j.InAttributeValueSq||this.state===j.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 e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case j.Text:{this.stateText(e);break}case j.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case j.InSpecialTag:{this.stateInSpecialTag(e);break}case j.CDATASequence:{this.stateCDATASequence(e);break}case j.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case j.InAttributeName:{this.stateInAttributeName(e);break}case j.InCommentLike:{this.stateInCommentLike(e);break}case j.InSpecialComment:{this.stateInSpecialComment(e);break}case j.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case j.InTagName:{this.stateInTagName(e);break}case j.InClosingTagName:{this.stateInClosingTagName(e);break}case j.BeforeTagName:{this.stateBeforeTagName(e);break}case j.AfterAttributeName:{this.stateAfterAttributeName(e);break}case j.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case j.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case j.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case j.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case j.BeforeSpecialS:{this.stateBeforeSpecialS(e);break}case j.BeforeSpecialT:{this.stateBeforeSpecialT(e);break}case j.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case j.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case j.InDeclaration:{this.stateInDeclaration(e);break}case j.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case j.BeforeComment:{this.stateBeforeComment(e);break}case j.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case j.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===j.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===j.InCommentLike?this.currentSequence===He.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===j.InTagName||this.state===j.BeforeAttributeName||this.state===j.BeforeAttributeValue||this.state===j.AfterAttributeName||this.state===j.InAttributeName||this.state===j.InAttributeValueSq||this.state===j.InAttributeValueDq||this.state===j.InAttributeValueNq||this.state===j.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){this.baseState!==j.Text&&this.baseState!==j.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(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const fi=new Set(["input","option","optgroup","select","button","datalist","textarea"]),Ee=new Set(["p"]),Ym=new Set(["thead","tbody"]),Vm=new Set(["dd","dt"]),Zm=new Set(["rt","rp"]),dF=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",Ee],["h1",Ee],["h2",Ee],["h3",Ee],["h4",Ee],["h5",Ee],["h6",Ee],["select",fi],["input",fi],["output",fi],["button",fi],["datalist",fi],["textarea",fi],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Vm],["dt",Vm],["address",Ee],["article",Ee],["aside",Ee],["blockquote",Ee],["details",Ee],["div",Ee],["dl",Ee],["fieldset",Ee],["figcaption",Ee],["figure",Ee],["footer",Ee],["form",Ee],["header",Ee],["hr",Ee],["main",Ee],["nav",Ee],["ol",Ee],["pre",Ee],["section",Ee],["table",Ee],["ul",Ee],["rt",Zm],["rp",Zm],["tbody",Ym],["tfoot",Ym]]),pF=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),$m=new Set(["math","svg"]),Xm=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),mF=/\s|\//;class gF{constructor(e,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=e??{},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:hF)(this.options,this),this.foreignContext=[!this.htmlMode],(l=(a=this.cbs).onparserinit)===null||l===void 0||l.call(a,this)}ontext(e,n){var r,i;const o=this.getSlice(e,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,o),this.startIndex=n}ontextentity(e,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,Um(e)),this.startIndex=n}isVoidElement(e){return this.htmlMode&&pF.has(e)}onopentagname(e,n){this.endIndex=n;let r=this.getSlice(e,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(e){var n,r,i,o;this.openTagStart=this.startIndex,this.tagname=e;const s=this.htmlMode&&dF.get(e);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(e)||(this.stack.unshift(e),this.htmlMode&&($m.has(e)?this.foreignContext.unshift(!0):Xm.has(e)&&this.foreignContext.unshift(!1))),(o=(i=this.cbs).onopentagname)===null||o===void 0||o.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){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,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,i,o,s,a,l,c,u;this.endIndex=n;let f=this.getSlice(e,n);if(this.lowerCaseTagNames&&(f=f.toLowerCase()),this.htmlMode&&($m.has(f)||Xm.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(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var n,r;const i=this.tagname;this.endOpenTag(e),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!e),this.stack.shift())}onattribname(e,n){this.startIndex=e;const r=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=Um(e)}onattribend(e,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,e===fn.Double?'"':e===fn.Single?"'":e===fn.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(mF);let r=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(e,n,r){var i,o,s,a;this.endIndex=n,(o=(i=this.cbs).oncomment)===null||o===void 0||o.call(i,this.getSlice(e,n-r)),(a=(s=this.cbs).oncommentend)===null||a===void 0||a.call(s),this.startIndex=n+1}oncdata(e,n,r){var i,o,s,a,l,c,u,f,d,h;this.endIndex=n;const p=this.getSlice(e,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 e,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=(e=this.cbs).onend)===null||n===void 0||n.call(e)}reset(){var e,n,r,i;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),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(e){this.reset(),this.end(e)}getSlice(e,n){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-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(e){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(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}e&&this.write(e),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(e){this.write(e)}done(e){this.end(e)}}function AF(t,e){const n=new iB(void 0,e);return new gF(n,e).end(t),n.root}var xc;const Qo=(xc=Object.hasOwn)!==null&&xc!==void 0?xc:((t,e)=>Object.prototype.hasOwnProperty.call(t,e)),Ho=/\s+/,sf="data-",ud=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,yF=/^{[^]*}$|^\[[^]*]$/;function Wa(t,e,n){var r;if(!(!t||!oe(t))){if((r=t.attribs)!==null&&r!==void 0||(t.attribs={}),!e)return t.attribs;if(Qo(t.attribs,e))return!n&&ud.test(e)?e:t.attribs[e];if(t.name==="option"&&e==="value")return Jo(t.children);if(t.name==="input"&&(t.attribs.type==="radio"||t.attribs.type==="checkbox")&&e==="value")return"on"}}function xi(t,e,n){n===null?kk(t,e):t.attribs[e]=`${n}`}function bF(t,e){if(typeof t=="object"||e!==void 0){if(typeof e=="function"){if(typeof t!="string")throw new Error("Bad combination of arguments.");return ze(this,(n,r)=>{oe(n)&&xi(n,t,e.call(n,r,n.attribs[t]))})}return ze(this,n=>{if(oe(n))if(typeof t=="object")for(const r of Object.keys(t)){const i=t[r];xi(n,r,i)}else xi(n,t,e)})}return arguments.length>1?this:Wa(this[0],t,this.options.xmlMode)}function eg(t,e,n){return e in t?t[e]:!n&&ud.test(e)?Wa(t,e,!1)!==void 0:Wa(t,e,n)}function Cc(t,e,n,r){e in t?t[e]=n:xi(t,e,!r&&ud.test(e)?n?"":null:`${n}`)}function wF(t,e){var n;if(typeof t=="string"&&e===void 0){const r=this[0];if(!r)return;switch(t){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 oe(r)?r.name.toUpperCase():void 0;case"href":case"src":{if(!oe(r))return;const i=(n=r.attribs)===null||n===void 0?void 0:n[t];return typeof URL<"u"&&(t==="href"&&(r.tagName==="a"||r.tagName==="link")||t==="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 Pa(r);case"textContent":return _i(r);case"outerHTML":return r.type===td?this.html():this.clone().wrap("<container />").parent().html();case"innerHTML":return this.html();default:return oe(r)?eg(r,t,this.options.xmlMode):void 0}}if(typeof t=="object"||e!==void 0){if(typeof e=="function"){if(typeof t=="object")throw new TypeError("Bad combination of arguments.");return ze(this,(r,i)=>{oe(r)&&Cc(r,t,e.call(r,i,eg(r,t,this.options.xmlMode)),this.options.xmlMode)})}return ze(this,r=>{if(oe(r))if(typeof t=="object")for(const i of Object.keys(t)){const o=t[i];Cc(r,i,o,this.options.xmlMode)}else Cc(r,t,e,this.options.xmlMode)})}}function tg(t,e,n){var r;(r=t.data)!==null&&r!==void 0||(t.data={}),typeof e=="object"?Object.assign(t.data,e):typeof e=="string"&&n!==void 0&&(t.data[e]=n)}function kF(t){for(const e of Object.keys(t.attribs)){if(!e.startsWith(sf))continue;const n=eF(e.slice(sf.length));Qo(t.data,n)||(t.data[n]=wk(t.attribs[e]))}return t.data}function xF(t,e){const n=sf+tF(e),r=t.data;if(Qo(r,e))return r[e];if(Qo(t.attribs,n))return r[e]=wk(t.attribs[n])}function wk(t){if(t==="null")return null;if(t==="true")return!0;if(t==="false")return!1;const e=Number(t);if(t===String(e))return e;if(yF.test(t))try{return JSON.parse(t)}catch{}return t}function CF(t,e){var n;const r=this[0];if(!r||!oe(r))return;const i=r;return(n=i.data)!==null&&n!==void 0||(i.data={}),t==null?kF(i):typeof t=="object"||e!==void 0?(ze(this,o=>{oe(o)&&(typeof t=="object"?tg(o,t):tg(o,t,e))}),this):xF(i,t)}function vF(t){const e=arguments.length===0,n=this[0];if(!n||!oe(n))return e?void 0:this;switch(n.name){case"textarea":return this.text(t);case"select":{const r=this.find("option:selected");if(!e){if(this.attr("multiple")==null&&typeof t=="object")return this;this.find("option").removeAttr("selected");const i=typeof t=="object"?t:[t];for(const o of i)this.find(`option[value="${o}"]`).attr("selected","");return this}return this.attr("multiple")?r.toArray().map(i=>Jo(i.children)):r.attr("value")}case"button":case"input":case"option":return e?this.attr("value"):this.attr("value",t)}}function kk(t,e){!t.attribs||!Qo(t.attribs,e)||delete t.attribs[e]}function ja(t){return t?t.trim().split(Ho):[]}function SF(t){const e=ja(t);for(const n of e)ze(this,r=>{oe(r)&&kk(r,n)});return this}function IF(t){return this.toArray().some(e=>{const n=oe(e)&&e.attribs.class;let r=-1;if(n&&t.length>0)for(;(r=n.indexOf(t,r+1))>-1;){const i=r+t.length;if((r===0||Ho.test(n[r-1]))&&(i===n.length||Ho.test(n[i])))return!0}return!1})}function xk(t){if(typeof t=="function")return ze(this,(r,i)=>{if(oe(r)){const o=r.attribs.class||"";xk.call([r],t.call(r,i,o))}});if(!t||typeof t!="string")return this;const e=t.split(Ho),n=this.length;for(let r=0;r<n;r++){const i=this[r];if(!oe(i))continue;const o=Wa(i,"class",!1);if(o){let s=` ${o} `;for(const a of e){const l=`${a} `;s.includes(` ${l}`)||(s+=l)}xi(i,"class",s.trim())}else xi(i,"class",e.join(" ").trim())}return this}function Ck(t){if(typeof t=="function")return ze(this,(i,o)=>{oe(i)&&Ck.call([i],t.call(i,o,i.attribs.class||""))});const e=ja(t),n=e.length,r=arguments.length===0;return ze(this,i=>{if(oe(i))if(r)i.attribs.class="";else{const o=ja(i.attribs.class);let s=!1;for(let a=0;a<n;a++){const l=o.indexOf(e[a]);l!==-1&&(o.splice(l,1),s=!0,a--)}s&&(i.attribs.class=o.join(" "))}})}function vk(t,e){if(typeof t=="function")return ze(this,(s,a)=>{oe(s)&&vk.call([s],t.call(s,a,s.attribs.class||"",e),e)});if(!t||typeof t!="string")return this;const n=t.split(Ho),r=n.length,i=typeof e=="boolean"?e?1:-1:0,o=this.length;for(let s=0;s<o;s++){const a=this[s];if(!oe(a))continue;const l=ja(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 EF=Object.freeze(Object.defineProperty({__proto__:null,addClass:xk,attr:bF,data:CF,hasClass:IF,prop:wF,removeAttr:SF,removeClass:Ck,toggleClass:vk,val:vF},Symbol.toStringTag,{value:"Module"}));var ee;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(ee||(ee={}));var Ve;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Ve||(Ve={}));const ng=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,RF=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,NF=new Map([[126,Ve.Element],[94,Ve.Start],[36,Ve.End],[42,Ve.Any],[33,Ve.Not],[124,Ve.Hyphen]]),TF=new Set(["has","not","matches","is","where","host","host-context"]);function So(t){switch(t.type){case ee.Adjacent:case ee.Child:case ee.Descendant:case ee.Parent:case ee.Sibling:case ee.ColumnCombinator:return!0;default:return!1}}const DF=new Set(["contains","icontains"]);function OF(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function io(t){return t.replace(RF,OF)}function vc(t){return t===39||t===34}function rg(t){return t===32||t===9||t===10||t===12||t===13}function yl(t){const e=[],n=Sk(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function Sk(t,e,n){let r=[];function i(d){const h=e.slice(n+d).match(ng);if(!h)throw new Error(`Expected name, found ${e.slice(n)}`);const[p]=h;return n+=d+p.length,io(p)}function o(d){for(n+=d;n<e.length&&rg(e.charCodeAt(n));)n++}function s(){n+=1;const d=n;let h=1;for(;h>0&&n<e.length;n++)e.charCodeAt(n)===40&&!a(n)?h++:e.charCodeAt(n)===41&&!a(n)&&h--;if(h)throw new Error("Parenthesis not matched");return io(e.slice(d,n-1))}function a(d){let h=0;for(;e.charCodeAt(--d)===92;)h++;return(h&1)===1}function l(){if(r.length>0&&So(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(d){if(r.length>0&&r[r.length-1].type===ee.Descendant){r[r.length-1].type=d;return}l(),r.push({type:d})}function u(d,h){r.push({type:ee.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(r.length&&r[r.length-1].type===ee.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(o(0),e.length===n)return n;e:for(;n<e.length;){const d=e.charCodeAt(n);switch(d){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==ee.Descendant)&&(l(),r.push({type:ee.Descendant})),o(1);break}case 62:{c(ee.Child),o(1);break}case 60:{c(ee.Parent),o(1);break}case 126:{c(ee.Sibling),o(1);break}case 43:{c(ee.Adjacent),o(1);break}case 46:{u("class",Ve.Element);break}case 35:{u("id",Ve.Equals);break}case 91:{o(1);let h,p=null;e.charCodeAt(n)===124?h=i(1):e.startsWith("*|",n)?(p="*",h=i(2)):(h=i(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(p=h,h=i(1))),o(0);let m=Ve.Exists;const g=NF.get(e.charCodeAt(n));if(g){if(m=g,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");o(2)}else e.charCodeAt(n)===61&&(m=Ve.Equals,o(1));let A="",x=null;if(m!=="exists"){if(vc(e.charCodeAt(n))){const C=e.charCodeAt(n);let w=n+1;for(;w<e.length&&(e.charCodeAt(w)!==C||a(w));)w+=1;if(e.charCodeAt(w)!==C)throw new Error("Attribute value didn't end");A=io(e.slice(n+1,w)),n=w+1}else{const C=n;for(;n<e.length&&(!rg(e.charCodeAt(n))&&e.charCodeAt(n)!==93||a(n));)n+=1;A=io(e.slice(C,n))}o(0);const b=e.charCodeAt(n)|32;b===115?(x=!1,o(1)):b===105&&(x=!0,o(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const y={type:ee.Attribute,name:h,action:m,value:A,namespace:p,ignoreCase:x};r.push(y);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:ee.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(n)===40?s():null});continue}const h=i(1).toLowerCase();let p=null;if(e.charCodeAt(n)===40)if(TF.has(h)){if(vc(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${h} cannot be quoted`);if(p=[],n=Sk(p,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${h} (${e})`);n+=1}else{if(p=s(),DF.has(h)){const m=p.charCodeAt(0);m===p.charCodeAt(p.length-1)&&vc(m)&&(p=p.slice(1,-1))}p=io(p)}r.push({type:ee.Pseudo,name:h,data:p});break}case 44:{f(),r=[],o(1);break}default:{if(e.startsWith("/*",n)){const m=e.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="",e.charCodeAt(n+1)===124){c(ee.ColumnCombinator),o(2);break}}else if(ng.test(e.slice(n)))p=i(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(h=p,e.charCodeAt(n+1)===42?(p="*",n+=2):p=i(1)),r.push(p==="*"?{type:ee.Universal,namespace:h}:{type:ee.Tag,name:p,namespace:h})}}}return f(),n}var Sc,ig;function MF(){return ig||(ig=1,Sc={trueFunc:function(){return!0},falseFunc:function(){return!1}}),Sc}var Ka=MF();const pe=as(Ka),Ik=new Map([[ee.Universal,50],[ee.Tag,30],[ee.Attribute,1],[ee.Pseudo,0]]);function fd(t){return!Ik.has(t.type)}const BF=new Map([[Ve.Exists,10],[Ve.Equals,8],[Ve.Not,7],[Ve.Start,6],[Ve.End,6],[Ve.Any,5]]);function FF(t){const e=t.map(Ek);for(let n=1;n<t.length;n++){const r=e[n];if(!(r<0))for(let i=n-1;i>=0&&r<e[i];i--){const o=t[i+1];t[i+1]=t[i],t[i]=o,e[i+1]=e[i],e[i]=r}}}function Ek(t){var e,n;let r=(e=Ik.get(t.type))!==null&&e!==void 0?e:-1;return t.type===ee.Attribute?(r=(n=BF.get(t.action))!==null&&n!==void 0?n:4,t.action===Ve.Equals&&t.name==="id"&&(r=9),t.ignoreCase&&(r>>=1)):t.type===ee.Pseudo&&(t.data?t.name==="has"||t.name==="contains"?r=0:Array.isArray(t.data)?(r=Math.min(...t.data.map(i=>Math.min(...i.map(Ek)))),r<0&&(r=0)):r=2:r=3),r}const _F=/[-[\]{}()*+?.,\\^$|#\s]/g;function og(t){return t.replace(_F,"\\$&")}const PF=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 Nr(t,e){return typeof t.ignoreCase=="boolean"?t.ignoreCase:t.ignoreCase==="quirks"?!!e.quirksMode:!e.xmlMode&&PF.has(t.name)}const LF={equals(t,e,n){const{adapter:r}=n,{name:i}=e;let{value:o}=e;return Nr(e,n)?(o=o.toLowerCase(),s=>{const a=r.getAttributeValue(s,i);return a!=null&&a.length===o.length&&a.toLowerCase()===o&&t(s)}):s=>r.getAttributeValue(s,i)===o&&t(s)},hyphen(t,e,n){const{adapter:r}=n,{name:i}=e;let{value:o}=e;const s=o.length;return Nr(e,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&&t(l)}):function(l){const c=r.getAttributeValue(l,i);return c!=null&&(c.length===s||c.charAt(s)==="-")&&c.substr(0,s)===o&&t(l)}},element(t,e,n){const{adapter:r}=n,{name:i,value:o}=e;if(/\s/.test(o))return pe.falseFunc;const s=new RegExp(`(?:^|\\s)${og(o)}(?:$|\\s)`,Nr(e,n)?"i":"");return function(l){const c=r.getAttributeValue(l,i);return c!=null&&c.length>=o.length&&s.test(c)&&t(l)}},exists(t,{name:e},{adapter:n}){return r=>n.hasAttrib(r,e)&&t(r)},start(t,e,n){const{adapter:r}=n,{name:i}=e;let{value:o}=e;const s=o.length;return s===0?pe.falseFunc:Nr(e,n)?(o=o.toLowerCase(),a=>{const l=r.getAttributeValue(a,i);return l!=null&&l.length>=s&&l.substr(0,s).toLowerCase()===o&&t(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.startsWith(o))&&t(a)}},end(t,e,n){const{adapter:r}=n,{name:i}=e;let{value:o}=e;const s=-o.length;return s===0?pe.falseFunc:Nr(e,n)?(o=o.toLowerCase(),a=>{var l;return((l=r.getAttributeValue(a,i))===null||l===void 0?void 0:l.substr(s).toLowerCase())===o&&t(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.endsWith(o))&&t(a)}},any(t,e,n){const{adapter:r}=n,{name:i,value:o}=e;if(o==="")return pe.falseFunc;if(Nr(e,n)){const s=new RegExp(og(o),"i");return function(l){const c=r.getAttributeValue(l,i);return c!=null&&c.length>=o.length&&s.test(c)&&t(l)}}return s=>{var a;return!!(!((a=r.getAttributeValue(s,i))===null||a===void 0)&&a.includes(o))&&t(s)}},not(t,e,n){const{adapter:r}=n,{name:i}=e;let{value:o}=e;return o===""?s=>!!r.getAttributeValue(s,i)&&t(s):Nr(e,n)?(o=o.toLowerCase(),s=>{const a=r.getAttributeValue(s,i);return(a==null||a.length!==o.length||a.toLowerCase()!==o)&&t(s)}):s=>r.getAttributeValue(s,i)!==o&&t(s)}},zF=new Set([9,10,12,13,32]),sg=48,WF=57;function jF(t){if(t=t.trim().toLowerCase(),t==="even")return[2,0];if(t==="odd")return[2,1];let e=0,n=0,r=o(),i=s();if(e<t.length&&t.charAt(e)==="n"&&(e++,n=r*(i??1),a(),e<t.length?(r=o(),a(),i=s()):r=i=0),i===null||e<t.length)throw new Error(`n-th rule couldn't be parsed ('${t}')`);return[n,r*i];function o(){return t.charAt(e)==="-"?(e++,-1):(t.charAt(e)==="+"&&e++,1)}function s(){const l=e;let c=0;for(;e<t.length&&t.charCodeAt(e)>=sg&&t.charCodeAt(e)<=WF;)c=c*10+(t.charCodeAt(e)-sg),e++;return e===l?null:c}function a(){for(;e<t.length&&zF.has(t.charCodeAt(e));)e++}}function KF(t){const e=t[0],n=t[1]-1;if(n<0&&e<=0)return pe.falseFunc;if(e===-1)return o=>o<=n;if(e===0)return o=>o===n;if(e===1)return n<0?pe.trueFunc:o=>o>=n;const r=Math.abs(e),i=(n%r+r)%r;return e>1?o=>o>=n&&o%r===i:o=>o<=n&&o%r===i}function Qs(t){return KF(jF(t))}function Hs(t,e){return n=>{const r=e.getParent(n);return r!=null&&e.isTag(r)&&t(n)}}const af={contains(t,e,{adapter:n}){return function(i){return t(i)&&n.getText(i).includes(e)}},icontains(t,e,{adapter:n}){const r=e.toLowerCase();return function(o){return t(o)&&n.getText(o).toLowerCase().includes(r)}},"nth-child"(t,e,{adapter:n,equals:r}){const i=Qs(e);return i===pe.falseFunc?pe.falseFunc:i===pe.trueFunc?Hs(t,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)&&t(s)}},"nth-last-child"(t,e,{adapter:n,equals:r}){const i=Qs(e);return i===pe.falseFunc?pe.falseFunc:i===pe.trueFunc?Hs(t,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)&&t(s)}},"nth-of-type"(t,e,{adapter:n,equals:r}){const i=Qs(e);return i===pe.falseFunc?pe.falseFunc:i===pe.trueFunc?Hs(t,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)&&t(s)}},"nth-last-of-type"(t,e,{adapter:n,equals:r}){const i=Qs(e);return i===pe.falseFunc?pe.falseFunc:i===pe.trueFunc?Hs(t,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)&&t(s)}},root(t,e,{adapter:n}){return r=>{const i=n.getParent(r);return(i==null||!n.isTag(i))&&t(r)}},scope(t,e,n,r){const{equals:i}=n;return!r||r.length===0?af.root(t,e,n):r.length===1?o=>i(r[0],o)&&t(o):o=>r.includes(o)&&t(o)},hover:Ic("isHovered"),visited:Ic("isVisited"),active:Ic("isActive")};function Ic(t){return function(n,r,{adapter:i}){const o=i[t];return typeof o!="function"?pe.falseFunc:function(a){return o(a)&&n(a)}}}const ag={empty(t,{adapter:e}){return!e.getChildren(t).some(n=>e.isTag(n)||e.getText(n)!=="")},"first-child"(t,{adapter:e,equals:n}){if(e.prevElementSibling)return e.prevElementSibling(t)==null;const r=e.getSiblings(t).find(i=>e.isTag(i));return r!=null&&n(t,r)},"last-child"(t,{adapter:e,equals:n}){const r=e.getSiblings(t);for(let i=r.length-1;i>=0;i--){if(n(t,r[i]))return!0;if(e.isTag(r[i]))break}return!1},"first-of-type"(t,{adapter:e,equals:n}){const r=e.getSiblings(t),i=e.getName(t);for(let o=0;o<r.length;o++){const s=r[o];if(n(t,s))return!0;if(e.isTag(s)&&e.getName(s)===i)break}return!1},"last-of-type"(t,{adapter:e,equals:n}){const r=e.getSiblings(t),i=e.getName(t);for(let o=r.length-1;o>=0;o--){const s=r[o];if(n(t,s))return!0;if(e.isTag(s)&&e.getName(s)===i)break}return!1},"only-of-type"(t,{adapter:e,equals:n}){const r=e.getName(t);return e.getSiblings(t).every(i=>n(t,i)||!e.isTag(i)||e.getName(i)!==r)},"only-child"(t,{adapter:e,equals:n}){return e.getSiblings(t).every(r=>n(t,r)||!e.isTag(r))}};function lg(t,e,n,r){if(n===null){if(t.length>r)throw new Error(`Pseudo-class :${e} requires an argument`)}else if(t.length===r)throw new Error(`Pseudo-class :${e} doesn't have any arguments`)}const JF={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
905
+ :is(button, input, select, textarea, optgroup, option)[disabled],
906
+ optgroup[disabled] > option,
907
+ fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
908
+ )`,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])"},Rk={};function QF(t,e){return t===pe.falseFunc?pe.falseFunc:n=>e.isTag(n)&&t(n)}function Nk(t,e){const n=e.getSiblings(t);if(n.length<=1)return[];const r=n.indexOf(t);return r<0||r===n.length-1?[]:n.slice(r+1).filter(e.isTag)}function lf(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}const Ec=(t,e,n,r,i)=>{const o=i(e,lf(n),r);return o===pe.trueFunc?t:o===pe.falseFunc?pe.falseFunc:s=>o(s)&&t(s)},Rc={is:Ec,matches:Ec,where:Ec,not(t,e,n,r,i){const o=i(e,lf(n),r);return o===pe.falseFunc?t:o===pe.trueFunc?pe.falseFunc:s=>!o(s)&&t(s)},has(t,e,n,r,i){const{adapter:o}=n,s=lf(n);s.relativeSelector=!0;const a=e.some(u=>u.some(fd))?[Rk]:void 0,l=i(e,s,a);if(l===pe.falseFunc)return pe.falseFunc;const c=QF(l,o);if(a&&l!==pe.trueFunc){const{shouldTestNextSiblings:u=!1}=l;return f=>{if(!t(f))return!1;a[0]=f;const d=o.getChildren(f),h=u?[...d,...Nk(f,o)]:d;return o.existsOne(c,h)}}return u=>t(u)&&o.existsOne(c,o.getChildren(u))}};function HF(t,e,n,r,i){var o;const{name:s,data:a}=e;if(Array.isArray(a)){if(!(s in Rc))throw new Error(`Unknown pseudo-class :${s}(${a})`);return Rc[s](t,a,n,r,i)}const l=(o=n.pseudos)===null||o===void 0?void 0:o[s],c=typeof l=="string"?l:JF[s];if(typeof c=="string"){if(a!=null)throw new Error(`Pseudo ${s} doesn't have any arguments`);const u=yl(c);return Rc.is(t,u,n,r,i)}if(typeof l=="function")return lg(l,s,a,1),u=>l(u,a)&&t(u);if(s in af)return af[s](t,a,n,r);if(s in ag){const u=ag[s];return lg(u,s,a,2),f=>u(f,n,a)&&t(f)}throw new Error(`Unknown pseudo-class :${s}`)}function Nc(t,e){const n=e.getParent(t);return n&&e.isTag(n)?n:null}function qF(t,e,n,r,i){const{adapter:o,equals:s}=n;switch(e.type){case ee.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case ee.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case ee.Attribute:{if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(e.name=e.name.toLowerCase()),LF[e.action](t,e,n)}case ee.Pseudo:return HF(t,e,n,r,i);case ee.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:a}=e;return(!n.xmlMode||n.lowerCaseTags)&&(a=a.toLowerCase()),function(c){return o.getName(c)===a&&t(c)}}case ee.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(c){let u=c;for(;u=Nc(u,o);)if(t(u))return!0;return!1};const a=new WeakSet;return function(c){let u=c;for(;u=Nc(u,o);)if(!a.has(u)){if(o.isTag(u)&&t(u))return!0;a.add(u)}return!1}}case"_flexibleDescendant":return function(l){let c=l;do if(t(c))return!0;while(c=Nc(c,o));return!1};case ee.Parent:return function(l){return o.getChildren(l).some(c=>o.isTag(c)&&t(c))};case ee.Child:return function(l){const c=o.getParent(l);return c!=null&&o.isTag(c)&&t(c)};case ee.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)&&t(f))return!0}return!1};case ee.Adjacent:return o.prevElementSibling?function(l){const c=o.prevElementSibling(l);return c!=null&&t(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&&t(u)};case ee.Universal:{if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return t}}}function Tk(t){return t.type===ee.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some(e=>e.some(Tk)))}const UF={type:ee.Descendant},GF={type:"_flexibleDescendant"},YF={type:ee.Pseudo,name:"scope",data:null};function VF(t,{adapter:e},n){const r=!!n?.every(i=>{const o=e.isTag(i)&&e.getParent(i);return i===Rk||o&&e.isTag(o)});for(const i of t){if(!(i.length>0&&fd(i[0])&&i[0].type!==ee.Descendant))if(r&&!i.some(Tk))i.unshift(UF);else continue;i.unshift(YF)}}function Dk(t,e,n){var r;t.forEach(FF),n=(r=e.context)!==null&&r!==void 0?r:n;const i=Array.isArray(n),o=n&&(Array.isArray(n)?n:[n]);if(e.relativeSelector!==!1)VF(t,e,o);else if(t.some(l=>l.length>0&&fd(l[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let s=!1;const a=t.map(l=>{if(l.length>=2){const[c,u]=l;c.type!==ee.Pseudo||c.name!=="scope"||(i&&u.type===ee.Descendant?l[1]=GF:(u.type===ee.Adjacent||u.type===ee.Sibling)&&(s=!0))}return ZF(l,e,o)}).reduce($F,pe.falseFunc);return a.shouldTestNextSiblings=s,a}function ZF(t,e,n){var r;return t.reduce((i,o)=>i===pe.falseFunc?pe.falseFunc:qF(i,o,e,n,Dk),(r=e.rootFunc)!==null&&r!==void 0?r:pe.trueFunc)}function $F(t,e){return e===pe.falseFunc||t===pe.trueFunc?t:t===pe.falseFunc||e===pe.trueFunc?e:function(r){return t(r)||e(r)}}const Ok=(t,e)=>t===e,XF={adapter:Al,equals:Ok};function e_(t){var e,n,r,i;const o=t??XF;return(e=o.adapter)!==null&&e!==void 0||(o.adapter=Al),(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:Ok),o}function t_(t){return function(n,r,i){const o=e_(r);return t(n,o,i)}}const hd=t_(Dk);function Mk(t,e,n=!1){return n&&(t=n_(t,e)),Array.isArray(t)?e.removeSubsets(t):e.getChildren(t)}function n_(t,e){const n=Array.isArray(t)?t.slice(0):[t],r=n.length;for(let i=0;i<r;i++){const o=Nk(n[i],e);n.push(...o)}return n}const r_=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function Ja(t){return t.type!=="pseudo"?!1:r_.has(t.name)?!0:t.name==="not"&&Array.isArray(t.data)?t.data.some(e=>e.some(Ja)):!1}function i_(t,e,n){const r=e!=null?parseInt(e,10):NaN;switch(t){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 o_(t){for(;t.parent;)t=t.parent;return t}function dd(t){const e=[],n=[];for(const r of t)r.some(Ja)?e.push(r):n.push(r);return[n,e]}const s_={type:ee.Universal,namespace:null},a_={type:ee.Pseudo,name:"scope",data:null};function Bk(t,e,n={}){return Fk([t],e,n)}function Fk(t,e,n={}){if(typeof e=="function")return t.some(e);const[r,i]=dd(yl(e));return r.length>0&&t.some(hd(r,n))||i.some(o=>Lk(o,t,n).length>0)}function l_(t,e,n,r){const i=typeof n=="string"?parseInt(n,10):NaN;switch(t){case"first":case"lt":return e;case"last":return e.length>0?[e[e.length-1]]:e;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<e.length?[i<0?e[e.length+i]:e[i]]:[];case"gt":return isFinite(i)?e.slice(i+1):[];case"even":return e.filter((o,s)=>s%2===0);case"odd":return e.filter((o,s)=>s%2===1);case"not":{const o=new Set(Pk(n,e,r));return e.filter(s=>!o.has(s))}}}function _k(t,e,n={}){return Pk(yl(t),e,n)}function Pk(t,e,n){if(e.length===0)return[];const[r,i]=dd(t);let o;if(r.length){const s=uf(e,r,n);if(i.length===0)return s;s.length&&(o=new Set(s))}for(let s=0;s<i.length&&o?.size!==e.length;s++){const a=i[s];if((o?e.filter(u=>oe(u)&&!o.has(u)):e).length===0)break;const c=Lk(a,e,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===e.length?e:e.filter(s=>o.has(s)):[]}function Lk(t,e,n){var r;if(t.some(So)){const i=(r=n.root)!==null&&r!==void 0?r:o_(e[0]),o={...n,context:e,relativeSelector:!1};return t.push(a_),Qa(i,t,o,!0,e.length)}return Qa(e,t,n,!1,e.length)}function c_(t,e,n={},r=1/0){if(typeof t=="function")return zk(e,t);const[i,o]=dd(yl(t)),s=o.map(a=>Qa(e,a,n,!0,r));return i.length&&s.push(cf(e,i,n,r)),s.length===0?[]:s.length===1?s[0]:Hi(s.reduce((a,l)=>[...a,...l]))}function Qa(t,e,n,r,i){const o=e.findIndex(Ja),s=e.slice(0,o),a=e[o],l=e.length-1===o?i:1/0,c=i_(a.name,a.data,l);if(c===0)return[];const f=(s.length===0&&!Array.isArray(t)?gl(t).filter(oe):s.length===0?(Array.isArray(t)?t:[t]).filter(oe):r||s.some(So)?cf(t,[s],n,c):uf(t,[s],n)).slice(0,c);let d=l_(a.name,f,a.data,n);if(d.length===0||e.length===o+1)return d;const h=e.slice(o+1),p=h.some(So);if(p){if(So(h[0])){const{type:m}=h[0];(m===ee.Sibling||m===ee.Adjacent)&&(d=Mk(d,Al,!0)),h.unshift(s_)}n={...n,relativeSelector:!1,rootFunc:m=>d.includes(m)}}else n.rootFunc&&n.rootFunc!==Ka.trueFunc&&(n={...n,rootFunc:Ka.trueFunc});return h.some(Ja)?Qa(d,h,n,!1,i):p?cf(d,[h],n,i):uf(d,[h],n)}function cf(t,e,n,r){const i=hd(e,n,t);return zk(t,i,r)}function zk(t,e,n=1/0){const r=Mk(t,Al,e.shouldTestNextSiblings);return ad(i=>oe(i)&&e(i),r,!0,n)}function uf(t,e,n){const r=(Array.isArray(t)?t:[t]).filter(oe);if(r.length===0)return r;const i=hd(e,n);return i===Ka.trueFunc?r:r.filter(i)}const u_=/^\s*(?:[+~]|:scope\b)/;function f_(t){if(!t)return this._make([]);if(typeof t!="string"){const e=On(t)?t.toArray():[t],n=this.toArray();return this._make(e.filter(r=>n.some(i=>yk(i,r))))}return this._findBySelector(t,Number.POSITIVE_INFINITY)}function h_(t,e){var n;const r=this.toArray(),i=u_.test(t)?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(c_(t,i,o,e))}function pd(t){return function(e,...n){return function(r){var i;let o=t(e,this);return r&&(o=Ad(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 Ss=pd((t,e)=>{let n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i.length>0&&(n=n.concat(i))}return n}),md=pd((t,e)=>{const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i!==null&&n.push(i)}return n});function gd(t,...e){let n=null;const r=pd((i,o)=>{const s=[];return ze(o,a=>{for(let l;(l=i(a))&&!n?.(l,s.length);a=l)s.push(l)}),s})(t,...e);return function(i,o){n=typeof i=="string"?a=>Bk(a,i,this.options):i?Is(i):null;const s=r.call(this,o);return n=null,s}}function qi(t){return t.length>1?Array.from(new Set(t)):t}const d_=md(({parent:t})=>t&&!oi(t)?t:null,qi),p_=Ss(t=>{const e=[];for(;t.parent&&!oi(t.parent);)e.push(t.parent),t=t.parent;return e},Hi,t=>t.reverse()),m_=gd(({parent:t})=>t&&!oi(t)?t:null,Hi,t=>t.reverse());function g_(t){var e;const n=[];if(!t)return this._make(n);const r={xmlMode:this.options.xmlMode,root:(e=this._root)===null||e===void 0?void 0:e[0]},i=typeof t=="string"?o=>Bk(o,t,r):Is(t);return ze(this,o=>{for(o&&!oi(o)&&!oe(o)&&(o=o.parent);o&&oe(o);){if(i(o,0)){n.includes(o)||n.push(o);break}o=o.parent}}),this._make(n)}const A_=md(t=>od(t)),y_=Ss(t=>{const e=[];for(;t.next;)t=t.next,oe(t)&&e.push(t);return e},qi),b_=gd(t=>od(t),qi),w_=md(t=>sd(t)),k_=Ss(t=>{const e=[];for(;t.prev;)t=t.prev,oe(t)&&e.push(t);return e},qi),x_=gd(t=>sd(t),qi),C_=Ss(t=>hk(t).filter(e=>oe(e)&&e!==t),Hi),v_=Ss(t=>gl(t).filter(oe),qi);function S_(){const t=this.toArray().reduce((e,n)=>Je(n)?e.concat(n.children):e,[]);return this._make(t)}function I_(t){let e=0;const n=this.length;for(;e<n&&t.call(this[e],e,this[e])!==!1;)++e;return this}function E_(t){let e=[];for(let n=0;n<this.length;n++){const r=this[n],i=t.call(r,n,r);i!=null&&(e=e.concat(i))}return this._make(e)}function Is(t){return typeof t=="function"?(e,n)=>t.call(e,n,e):On(t)?e=>Array.prototype.includes.call(t,e):function(e){return t===e}}function R_(t){var e;return this._make(Ad(this.toArray(),t,this.options.xmlMode,(e=this._root)===null||e===void 0?void 0:e[0]))}function Ad(t,e,n,r){return typeof e=="string"?_k(e,t,{xmlMode:n,root:r}):t.filter(Is(e))}function N_(t){const e=this.toArray();return typeof t=="string"?Fk(e.filter(oe),t,this.options):t?e.some(Is(t)):!1}function T_(t){let e=this.toArray();if(typeof t=="string"){const n=new Set(_k(t,e,this.options));e=e.filter(r=>!n.has(r))}else{const n=Is(t);e=e.filter((r,i)=>!n(r,i))}return this._make(e)}function D_(t){return this.filter(typeof t=="string"?`:has(${t})`:(e,n)=>this._make(n).find(t).length>0)}function O_(){return this.length>1?this._make(this[0]):this}function M_(){return this.length>0?this._make(this[this.length-1]):this}function B_(t){var e;return t=+t,t===0&&this.length<=1?this:(t<0&&(t=this.length+t),this._make((e=this[t])!==null&&e!==void 0?e:[]))}function F_(t){return t==null?this.toArray():this[t<0?this.length+t:t]}function __(){return Array.prototype.slice.call(this)}function P_(t){let e,n;return t==null?(e=this.parent().children(),n=this[0]):typeof t=="string"?(e=this._make(t),n=this[0]):(e=this,n=On(t)?t[0]:t),Array.prototype.indexOf.call(e,n)}function L_(t,e){return this._make(Array.prototype.slice.call(this,t,e))}function z_(){var t;return(t=this.prevObject)!==null&&t!==void 0?t:this._make([])}function W_(t,e){const n=this._make(t,e),r=Hi([...this.get(),...n.get()]);return this._make(r)}function j_(t){return this.prevObject?this.add(t?this.prevObject.filter(t):this.prevObject):this}const K_=Object.freeze(Object.defineProperty({__proto__:null,_findBySelector:h_,add:W_,addBack:j_,children:v_,closest:g_,contents:S_,each:I_,end:z_,eq:B_,filter:R_,filterArray:Ad,find:f_,first:O_,get:F_,has:D_,index:P_,is:N_,last:M_,map:E_,next:A_,nextAll:y_,nextUntil:b_,not:T_,parent:d_,parents:p_,parentsUntil:m_,prev:w_,prevAll:k_,prevUntil:x_,siblings:C_,slice:L_,toArray:__},Symbol.toStringTag,{value:"Module"}));function J_(t){return function(n,r,i,o){if(typeof Buffer<"u"&&Buffer.isBuffer(n)&&(n=n.toString()),typeof n=="string")return t(n,r,i,o);const s=n;if(!Array.isArray(s)&&oi(s))return s;const a=new jo([]);return ri(s,a),a}}function ri(t,e){const n=Array.isArray(t)?t:[t];e?e.children=n:e=null;for(let r=0;r<n.length;r++){const i=n[r];i.parent&&i.parent.children!==n&&si(i),e?(i.prev=n[r-1]||null,i.next=n[r+1]||null):i.prev=i.next=null,i.parent=e}return e}function Q_(t,e){if(t==null)return[];if(typeof t=="string")return this._parse(t,this.options,!1,null).children.slice(0);if("length"in t){if(t.length===1)return this._makeDomArray(t[0],e);const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(typeof i=="object"){if(i==null)continue;if(!("length"in i)){n.push(e?Ko(i,!0):i);continue}}n.push(...this._makeDomArray(i,e))}return n}return[e?Ko(t,!0):t]}function Wk(t){return function(...e){const n=this.length-1;return ze(this,(r,i)=>{if(!Je(r))return;const o=typeof e[0]=="function"?e[0].call(r,i,this._render(r.children)):e,s=this._makeDomArray(o,i<n);t(s,r.children,r)})}}function xr(t,e,n,r,i){var o,s;const a=[e,n,...r],l=e===0?null:t[e-1],c=e+n>=t.length?null:t[e+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&&e>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]),t.splice(...a)}function H_(t){return(On(t)?t:this._make(t)).append(this),this}function q_(t){return(On(t)?t:this._make(t)).prepend(this),this}const U_=Wk((t,e,n)=>{xr(e,e.length,0,t,n)}),G_=Wk((t,e,n)=>{xr(e,0,0,t,n)});function jk(t){return function(e){const n=this.length-1,r=this.parents().last();for(let i=0;i<this.length;i++){const o=this[i],s=typeof e=="function"?e.call(o,i,o):typeof e=="string"&&!rf(e)?r.find(e).clone():e,[a]=this._makeDomArray(s,i<n);if(!a||!Je(a))continue;let l=a,c=0;for(;c<l.children.length;){const u=l.children[c];oe(u)?(l=u,c=0):c++}t(o,l,[a])}return this}}const Y_=jk((t,e,n)=>{const{parent:r}=t;if(!r)return;const i=r.children,o=i.indexOf(t);ri([t],e),xr(i,o,0,n,r)}),V_=jk((t,e,n)=>{Je(t)&&(ri(t.children,e),ri(n,t))});function Z_(t){return this.parent(t).not("body").each((e,n)=>{this._make(n).replaceWith(n.children)}),this}function $_(t){const e=this[0];if(e){const n=this._make(typeof t=="function"?t.call(e,0,e):t).insertBefore(e);let r;for(let o=0;o<n.length;o++)n[o].type===nf&&(r=n[o]);let i=0;for(;r&&i<r.children.length;){const o=r.children[i];o.type===nf?(r=o,i=0):i++}r&&this._make(r).append(this)}return this}function X_(...t){const e=this.length-1;return ze(this,(n,r)=>{if(!Je(n)||!n.parent)return;const i=n.parent.children,o=i.indexOf(n);if(o===-1)return;const s=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,a=this._makeDomArray(s,r<e);xr(i,o+1,0,a,n.parent)})}function eP(t){typeof t=="string"&&(t=this._make(t)),this.remove();const e=[];for(const n of this._makeDomArray(t)){const r=this.clone().toArray(),{parent:i}=n;if(!i)continue;const o=i.children,s=o.indexOf(n);s!==-1&&(xr(o,s+1,0,r,i),e.push(...r))}return this._make(e)}function tP(...t){const e=this.length-1;return ze(this,(n,r)=>{if(!Je(n)||!n.parent)return;const i=n.parent.children,o=i.indexOf(n);if(o===-1)return;const s=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,a=this._makeDomArray(s,r<e);xr(i,o,0,a,n.parent)})}function nP(t){const e=this._make(t);this.remove();const n=[];return ze(e,r=>{const i=this.clone().toArray(),{parent:o}=r;if(!o)return;const s=o.children,a=s.indexOf(r);a!==-1&&(xr(s,a,0,i,o),n.push(...i))}),this._make(n)}function rP(t){const e=t?this.filter(t):this;return ze(e,n=>{si(n),n.prev=n.next=n.parent=null}),this}function iP(t){return ze(this,(e,n)=>{const{parent:r}=e;if(!r)return;const i=r.children,o=typeof t=="function"?t.call(e,n,e):t,s=this._makeDomArray(o);ri(s,null);const a=i.indexOf(e);xr(i,a,1,s,r),s.includes(e)||(e.parent=e.prev=e.next=null)})}function oP(){return ze(this,t=>{if(Je(t)){for(const e of t.children)e.next=e.prev=e.parent=null;t.children.length=0}})}function sP(t){if(t===void 0){const e=this[0];return!e||!Je(e)?null:this._render(e.children)}return ze(this,e=>{if(!Je(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=On(t)?t.toArray():this._parse(`${t}`,this.options,!1,e).children;ri(n,e)})}function aP(){return this._render(this)}function lP(t){return t===void 0?Jo(this):typeof t=="function"?ze(this,(e,n)=>this._make(e).text(t.call(e,n,Jo([e])))):ze(this,e=>{if(!Je(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=new _a(`${t}`);ri(n,e)})}function cP(){const t=Array.prototype.map.call(this.get(),n=>Ko(n,!0)),e=new jo(t);for(const n of t)n.parent=e;return this._make(t)}const uP=Object.freeze(Object.defineProperty({__proto__:null,_makeDomArray:Q_,after:X_,append:U_,appendTo:H_,before:tP,clone:cP,empty:oP,html:sP,insertAfter:eP,insertBefore:nP,prepend:G_,prependTo:q_,remove:rP,replaceWith:iP,text:lP,toString:aP,unwrap:Z_,wrap:Y_,wrapAll:$_,wrapInner:V_},Symbol.toStringTag,{value:"Module"}));function fP(t,e){if(t!=null&&e!=null||typeof t=="object"&&!Array.isArray(t))return ze(this,(n,r)=>{oe(n)&&Kk(n,t,e,r)});if(this.length!==0)return Jk(this[0],t)}function Kk(t,e,n,r){if(typeof e=="string"){const i=Jk(t),o=typeof n=="function"?n.call(t,r,i[e]):n;o===""?delete i[e]:o!=null&&(i[e]=o),t.attribs.style=hP(i)}else if(typeof e=="object"){const i=Object.keys(e);for(let o=0;o<i.length;o++){const s=i[o];Kk(t,s,e[s],o)}}}function Jk(t,e){if(!t||!oe(t))return;const n=dP(t.attribs.style);if(typeof e=="string")return n[e];if(Array.isArray(e)){const r={};for(const i of e)n[i]!=null&&(r[i]=n[i]);return r}return n}function hP(t){return Object.keys(t).reduce((e,n)=>`${e}${e?" ":""}${n}: ${t[n]};`,"")}function dP(t){if(t=(t||"").trim(),!t)return{};const e={};let n;for(const r of t.split(";")){const i=r.indexOf(":");if(i<1||i===r.length-1){const o=r.trimEnd();o.length>0&&n!==void 0&&(e[n]+=`;${o}`)}else n=r.slice(0,i).trim(),e[n]=r.slice(i+1).trim()}return e}const pP=Object.freeze(Object.defineProperty({__proto__:null,css:fP},Symbol.toStringTag,{value:"Module"})),cg="input,select,textarea,keygen",mP=/%20/g,ug=/\r?\n/g;function gP(){return this.serializeArray().map(n=>`${encodeURIComponent(n.name)}=${encodeURIComponent(n.value)}`).join("&").replace(mP,"+")}function AP(){return this.map((t,e)=>{const n=this._make(e);return oe(e)&&e.name==="form"?n.find(cg).toArray():n.filter(cg).toArray()}).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((t,e)=>{var n;const r=this._make(e),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(ug,`\r
909
+ `)})):{name:i,value:o.replace(ug,`\r
910
+ `)}}).toArray()}const yP=Object.freeze(Object.defineProperty({__proto__:null,serialize:gP,serializeArray:AP},Symbol.toStringTag,{value:"Module"}));function bP(t){var e;return typeof t=="string"?{selector:t,value:"textContent"}:{selector:t.selector,value:(e=t.value)!==null&&e!==void 0?e:"textContent"}}function wP(t){const e={};for(const n in t){const r=t[n],i=Array.isArray(r),{selector:o,value:s}=bP(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)e[n]=this._findBySelector(o,Number.POSITIVE_INFINITY).map((l,c)=>a(c,n,e)).get();else{const l=this._findBySelector(o,1);e[n]=l.length>0?a(l[0],n,e):void 0}}return e}const kP=Object.freeze(Object.defineProperty({__proto__:null,extract:wP},Symbol.toStringTag,{value:"Module"}));class Es{constructor(e,n,r){if(this.length=0,this.options=r,this._root=n,e){for(let i=0;i<e.length;i++)this[i]=e[i];this.length=e.length}}}Es.prototype.cheerio="[cheerio object]";Es.prototype.splice=Array.prototype.splice;Es.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(Es.prototype,EF,K_,uP,pP,yP,kP);function xP(t,e){return function n(r,i,o=!0){if(r==null)throw new Error("cheerio.load() expects a string");const s=tf(i),a=t(r,s,o,null);class l extends Es{_make(f,d){const h=c(f,d);return h.prevObject=this,h}_parse(f,d,h,p){return t(f,d,h,p)}_render(f){return e(f,this.options)}}function c(u,f,d=a,h){if(u&&On(u))return u;const p=tf(h,s),m=typeof d=="string"?[t(d,p,!1,null)]:"length"in d?d:[d],g=On(m)?m:new l(m,null,p);if(g._root=g,!u)return new l(void 0,g,p);const A=typeof u=="string"&&rf(u)?t(u,p,!1,null).children:CP(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 y=u;const b=f?typeof f=="string"?rf(f)?new l([t(f,p,!1,null)],g,p):(y=`${f} ${y}`,g):On(f)?f:new l(Array.isArray(f)?f:[f],g,p):g;return b?b.find(y):x}return Object.assign(c,XB,{load:n,_root:a,_options:s,fn:l.prototype,prototype:l.prototype}),c}}function CP(t){return!!t.name||t.type===td||t.type===tk||t.type===nk}const fg=xP(J_(AF),ml);var qs={exports:{}},hg;function vP(){if(hg)return qs.exports;hg=1;var t=String,e=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return qs.exports=e(),qs.exports.createColors=e,qs.exports}const SP={},IP=Object.freeze(Object.defineProperty({__proto__:null,default:SP},Symbol.toStringTag,{value:"Module"})),en=tS(IP);var Tc,dg;function yd(){if(dg)return Tc;dg=1;let t=vP(),e=en;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=t.isColorSupported);let s=h=>h,a=h=>h,l=h=>h;if(i){let{bold:h,gray:p,red:m}=t.createColors(!0);a=g=>h(m(g)),s=g=>p(g),e&&(l=g=>e(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,y=Math.max(0,this.column-x),b=Math.max(this.column+x,this.endColumn+x),C=h.slice(y,b),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)+`
911
+ `+w+a("^")}let A=s(g.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+s(g)+l(h)+`
912
+ `+A+a("^")}return" "+s(g)+l(h)}).join(`
913
+ `)}toString(){let i=this.showSourceCode();return i&&(i=`
914
+
915
+ `+i+`
916
+ `),this.name+": "+this.message+i}}return Tc=n,n.default=n,Tc}var Dc,pg;function Qk(){if(pg)return Dc;pg=1;const t=/[\t\n\f\r "#'()/;[\\\]{}]/,e={after:`
917
+ `,beforeClose:`
918
+ `,beforeComment:`
919
+ `,beforeDecl:`
920
+ `,beforeOpen:" ",beforeRule:`
921
+ `,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&&!t.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(`
922
+ `)){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 e[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=e[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(`
923
+ `)&&(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(`
924
+ `)&&(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(`
925
+ `)&&(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(`
926
+ `)&&(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(`
927
+ `);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 Dc=a,a.default=a,Dc}var Oc,mg;function bl(){if(mg)return Oc;mg=1;let t=Qk();const e=/(<)(\/?style\b)/gi,n=/(<)(!--)/g;function r(s){return s.includes("<")?s.replace(e,"\\3c $2").replace(n,"\\3c $2"):s}class i extends t{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 Oc=o,o.default=o,Oc}var Us={},gg;function wl(){return gg||(gg=1,Us.isClean=Symbol("isClean"),Us.my=Symbol("my")),Us}var Mc,Ag;function kl(){if(Ag)return Mc;Ag=1;let t=yd(),e=Qk(),n=bl(),{isClean:r,my:i}=wl();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 y of g){let b=new y.constructor;x.push(b),f.push([y,b,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]===`
928
+ `?(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 t(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]===`
929
+ `?(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 e().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],y={};A[x]=y;for(let b in g){if(!Object.prototype.hasOwnProperty.call(g,b)||b==="parent"||b==="proxyCache")continue;let C=g[b];if(Array.isArray(C)){let w=[];y[b]=w;for(let v=0;v<C.length;v++){let T=C[v];typeof T=="object"&&T.toJSON?T.toJSON===a.prototype.toJSON?h.push([T,w,v]):w[v]=T.toJSON(null,u):w[v]=T}}else if(typeof C=="object"&&C.toJSON)C.toJSON===a.prototype.toJSON?h.push([C,y,b]):y[b]=C.toJSON(null,u);else if(b==="source"){if(C==null)continue;let w=u.get(C.input);w==null&&(w=u.size,u.set(C.input,w)),y[b]={end:C.end,inputId:w,start:C.start}}else y[b]=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 Mc=a,a.default=a,Mc}var Bc,yg;function Rs(){if(yg)return Bc;yg=1;let t=kl();class e extends t{constructor(r){super(r),this.type="comment"}}return Bc=e,e.default=e,Bc}var Fc,bg;function xl(){if(bg)return Fc;bg=1;let t=kl();class e extends t{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 Fc=e,e.default=e,Fc}var _c,wg;function Cr(){if(wg)return _c;wg=1;let t=Rs(),e=xl(),n=kl(),{isClean:r,my:i}=wl(),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 y of A)this.proxyOf.nodes.splice(m,0,y);let x;for(let y in this.indexes)x=this.indexes[y],m<=x&&(this.indexes[y]=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 e(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 t(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 b=p[p.length-1];b&&(b.node.indexes[b.iterator]+=1);continue}let x=g.proxyOf.nodes[A],y;try{y=h(x,A)}catch(b){throw x.addToError(b)}if(y===!1){for(let b of p)delete b.node.indexes[b.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},_c=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,e.prototype):p.type==="comment"?Object.setPrototypeOf(p,t.prototype):p.type==="root"&&Object.setPrototypeOf(p,a.prototype),p[i]=!0,p.nodes)for(let m of p.nodes)h.push(m)}},_c}var Pc,kg;function bd(){if(kg)return Pc;kg=1;let t=Cr();class e extends t{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 Pc=e,e.default=e,t.registerAtRule(e),Pc}var Lc,xg;function wd(){if(xg)return Lc;xg=1;let t=Cr(),e,n;class r extends t{constructor(o){super({type:"document",...o}),this.nodes||(this.nodes=[])}toResult(o={}){return new e(new n,this,o).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},Lc=r,r.default=r,Lc}var zc,Cg;function EP(){if(Cg)return zc;Cg=1;let t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return zc={nanoid:(r=21)=>{let i="",o=r|0;for(;o-- >0;)i+=t[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}},zc}var Wc,vg;function Hk(){if(vg)return Wc;vg=1;let{existsSync:t,readFileSync:e,realpathSync:n}=en,{dirname:r,isAbsolute:i,join:o,relative:s,sep:a}=en,{SourceMapConsumer:l,SourceMapGenerator:c}=en;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,/,y=p.match(A)||p.match(x);if(y)return decodeURIComponent(p.substr(y[0].length));let b=p.match(m)||p.match(g);if(b)return f(p.substr(b[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),t(p))return this.mapFile=p,e(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 Wc=d,d.default=d,Wc}var jc,Sg;function Cl(){if(Sg)return jc;Sg=1;let{nanoid:t}=EP(),{isAbsolute:e,resolve:n}=en,{SourceMapConsumer:r,SourceMapGenerator:i}=en,{fileURLToPath:o,pathToFileURL:s}=en,a=yd(),l=Hk(),c=en,u=Symbol("lineToIndexCache"),f=!!(r&&i),d=!!(n&&e);function h(m){if(m[u])return m[u];let g=m.css.split(`
930
+ `),A=new Array(g.length),x=0;for(let y=0,b=g.length;y<b;y++)A[y]=x,x+=g[y].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)||e(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 y=x.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(g,A,x,y={}){let b,C,w,v,T;if(A&&typeof A=="object"){let S=A,M=x;if(typeof S.offset=="number"){v=S.offset;let z=this.fromOffset(v);A=z.line,x=z.col}else A=S.line,x=S.column,v=this.fromLineAndColumn(A,x);if(typeof M.offset=="number"){w=M.offset;let z=this.fromOffset(w);C=z.line,b=z.col}else C=M.line,b=M.column,w=this.fromLineAndColumn(M.line,M.column)}else if(x)v=this.fromLineAndColumn(A,x);else{v=A;let S=this.fromOffset(v);A=S.line,x=S.col}let R=this.origin(A,x,C,b);return R?T=new a(g,R.endLine===void 0?R.line:{column:R.column,line:R.line},R.endLine===void 0?R.column:{column:R.endColumn,line:R.endLine},R.source,R.file,y.plugin):T=new a(g,C===void 0?A:{column:x,line:A},C===void 0?x:{column:b,line:C},this.css,this.file,y.plugin),T.input={column:x,endColumn:b,endLine:C,endOffset:w,line:A,offset:v,source:this.css},this.file&&(s&&(T.input.url=s(this.file).toString()),T.input.file=this.file),T}fromLineAndColumn(g,A){return h(this)[g-1]+A-1}fromOffset(g){let A=h(this),x=A[A.length-1],y=0;if(g>=x)y=A.length-1;else{let b=A.length-2,C;for(;y<b;)if(C=y+(b-y>>1),g<A[C])b=C-1;else if(g>=A[C+1])y=C+1;else{y=C;break}}return{col:g-A[y]+1,line:y+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:n(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,A,x,y){if(!this.map)return!1;let b=this.map.consumer(),C=b.originalPositionFor({column:A-1,line:g});if(!C.source)return!1;let w;if(typeof x=="number"){let S=b.originalPositionFor({column:y-1,line:x});S.source&&(w=S)}let v;e(C.source)?v=s(C.source):v=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let T={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)T.file=o(v);else throw new Error("file: protocol is not available in this PostCSS build");let R=b.sourceContentFor(C.source);return R&&(T.source=R),T}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 jc=p,p.default=p,c&&c.registerInput&&c.registerInput(p),jc}var Kc,Ig;function Ns(){if(Ig)return Kc;Ig=1;let t=Cr(),e,n;class r extends t{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 e(new n,this,o).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},Kc=r,r.default=r,t.registerRoot(r),Kc}var Jc,Eg;function qk(){if(Eg)return Jc;Eg=1;let t={comma(e){return t.split(e,[","],!0)},space(e){let n=[" ",`
931
+ `," "];return t.split(e,n)},split(e,n,r){if(typeof e!="string")return[];let i=[],o="",s=!1,a=0,l=!1,c="",u=!1,f=!1;for(let h=0;h<e.length;h++){let p=e[h];if(f){o+=p,p==="*"&&e[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==="/"&&e[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 Jc=t,t.default=t,Jc}var Qc,Rg;function kd(){if(Rg)return Qc;Rg=1;let t=Cr(),e=qk();class n extends t{get selectors(){return e.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 Qc=n,n.default=n,t.registerRule(n),Qc}var Hc,Ng;function RP(){if(Ng)return Hc;Ng=1;let t=bd(),e=Rs(),n=xl(),r=Cl(),i=Hk(),o=Ns(),s=kd();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 e(h);else if(h.type==="atrule")p=new t(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 Hc=c,c.default=c,Hc}var qc,Tg;function Uk(){if(Tg)return qc;Tg=1;let{dirname:t,relative:e,resolve:n,sep:r}=en,{SourceMapConsumer:i,SourceMapGenerator:o}=en,{pathToFileURL:s}=en,a=Cl(),l=!!(i&&o),c=!!(t&&n&&e&&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=`
932
+ `;this.css.includes(`\r
933
+ `)&&(h=`\r
934
+ `),this.css+=h+"/*# sourceMappingURL="+d+" */"}applyPrevMaps(){for(let d of this.previous()){let h=this.toUrl(this.path(d.file)),p=d.root||t(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]===`
935
+ `;)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,y,b)=>{if(this.css+=x,y&&b!=="end"&&(m.generated.line=d,m.generated.column=h-1,y.source&&y.source.start?(m.source=this.sourcePath(y),m.original.line=y.source.start.line,m.original.column=y.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(`
936
+ `),h=x.length-g):h+=x.length,y&&b!=="start"){let C=y.parent||{raws:{}};(!(y.type==="decl"||y.type==="atrule"&&!y.nodes)||y!==C.last||C.raws.semicolon)&&(y.source&&y.source.end?(m.source=this.sourcePath(y),m.original.line=y.source.end.line,m.original.column=y.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?t(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=t(n(p,this.mapOpts.annotation)));let m=e(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 qc=u,qc}var Uc,Dg;function Gk(){if(Dg)return Uc;Dg=1;const t=39,e=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,y=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,C=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return Uc=function(T,R={}){let S=T.css.valueOf(),M=R.ignoreErrors,z,W,L,D,Z,q,ne,Ce,I,_,E=S.length,k=0,F=[],N=[],K=-1;function Y(){return k}function U(G){throw T.error("Unclosed "+G,k)}function H(){return N.length===0&&k>=E}function re(G){if(N.length)return N.pop();if(k>=E)return;let Ae=G?G.ignoreUnclosed:!1;switch(z=S.charCodeAt(k),z){case i:case o:case a:case l:case s:{D=k;do D+=1,z=S.charCodeAt(D);while(z===o||z===i||z===a||z===l||z===s);q=["space",S.slice(k,D)],k=D-1;break}case c:case u:case h:case p:case A:case m:case d:{let $e=String.fromCharCode(z);q=[$e,$e,k];break}case f:{if(_=F.length?F.pop()[1]:"",I=S.charCodeAt(k+1),_==="url"&&I!==t&&I!==e&&I!==o&&I!==i&&I!==a&&I!==s&&I!==l){D=k;do{if(ne=!1,D=S.indexOf(")",D+1),D===-1)if(M||Ae){D=k;break}else U("bracket");for(Ce=D;S.charCodeAt(Ce-1)===n;)Ce-=1,ne=!ne}while(ne);q=["brackets",S.slice(k,D+1),k,D],k=D}else k<=K?q=["(","(",k]:(D=S.indexOf(")",k+1),W=S.slice(k,D+1),D===-1||C.test(W)?(K=D===-1?E:D,q=["(","(",k]):(q=["brackets",W,k,D],k=D));break}case t:case e:{Z=z===t?"'":'"',D=k;do{if(ne=!1,D=S.indexOf(Z,D+1),D===-1)if(M||Ae){D=k+1;break}else U("string");for(Ce=D;S.charCodeAt(Ce-1)===n;)Ce-=1,ne=!ne}while(ne);q=["string",S.slice(k,D+1),k,D],k=D;break}case x:{y.lastIndex=k+1,y.test(S),y.lastIndex===0?D=S.length-1:D=y.lastIndex-2,q=["at-word",S.slice(k,D+1),k,D],k=D;break}case n:{for(D=k,L=!0;S.charCodeAt(D+1)===n;)D+=1,L=!L;if(z=S.charCodeAt(D+1),L&&z!==r&&z!==o&&z!==i&&z!==a&&z!==l&&z!==s&&(D+=1,w.test(S.charAt(D)))){for(;w.test(S.charAt(D+1));)D+=1;S.charCodeAt(D+1)===o&&(D+=1)}q=["word",S.slice(k,D+1),k,D],k=D;break}default:{z===r&&S.charCodeAt(k+1)===g?(D=S.indexOf("*/",k+2)+1,D===0&&(M||Ae?D=S.length:U("comment")),q=["comment",S.slice(k,D+1),k,D],k=D):(b.lastIndex=k+1,b.test(S),b.lastIndex===0?D=S.length-1:D=b.lastIndex-2,q=["word",S.slice(k,D+1),k,D],F.push(q),k=D);break}}return k++,q}function V(G){N.push(G)}return{back:V,endOfFile:H,nextToken:re,position:Y}},Uc}var Gc,Og;function Yk(){if(Og)return Gc;Og=1;let t=bd(),e=Rs(),n=xl(),r=Ns(),i=kd(),o=Gk();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 t;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=[],y=[];for(;!this.tokenizer.endOfFile();){if(f=this.tokenizer.nextToken(),h=f[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.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 e;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 y=m;for(;m<f.length;){let w=f[m][0];if(w!=="space"&&w!=="comment")break;m++}let b=f.slice(y,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),T="";for(let R=w;R>0;R--){let S=v[R][0];if(T.trim().startsWith("!")&&S!=="space")break;T=v.pop()[1]+T}T.trim().startsWith("!")&&(h.important=!0,h.raws.important=T,f=v)}if(x[0]!=="space"&&x[0]!=="comment")break}f.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(h.raws.between+=b.map(w=>w[1]).join(""),b=[]),this.raw(h,"value",b.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=[],y=f;for(;y;){if(h=y[0],x.push(y),h==="("||h==="[")m||(m=y),g.push(h==="("?")":"]");else if(A&&p&&h==="{")m||(m=y),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));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),g.length>0&&this.unclosedBracket(m),d&&p){if(!A)for(;x.length&&(y=x[x.length-1][0],!(y!=="space"&&y!=="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="",y="",b=!0,C,w;for(let v=0;v<A;v+=1)m=h[v],g=m[0],g==="space"&&v===A-1&&!p?b=!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]?y===","?b=!1:(x+=m[1],y=m[1].slice(-1)):b=!1):(x+=m[1],y=m[1].slice(-1));if(!b){let v=h.reduce((T,R)=>T+R[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 Gc=c,Gc}var Yc,Mg;function xd(){if(Mg)return Yc;Mg=1;let t=Cr(),e=Cl(),n=Yk();function r(i,o){let s=new e(i,o),a=new n(s);try{a.parse()}catch(l){throw l}return a.root}return Yc=r,r.default=r,t.registerParse(r),Yc}var Vc,Bg;function Vk(){if(Bg)return Vc;Bg=1;let t=Cr(),{my:e}=wl();class n{constructor(i,o={}){if(this.type="warning",this.text=i,o.node&&o.node.source){o.node[e]||t.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 Vc=n,n.default=n,Vc}var Zc,Fg;function Cd(){if(Fg)return Zc;Fg=1;let t=Vk();class e{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 t(r,i);return this.messages.push(o),o}warnings(){return this.messages.filter(r=>r.type==="warning")}}return Zc=e,e.default=e,Zc}var $c,_g;function Zk(){if(_g)return $c;_g=1;let t=Cr(),e=wd(),n=Uk(),r=xd(),i=Cd(),o=Ns(),s=bl(),{isClean:a,my:l}=wl();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(y){return typeof y=="object"&&typeof y.then=="function"}function p(y){let b=!1,C=c[y.type];return y.type==="decl"?b=y.prop.toLowerCase():y.type==="atrule"&&(b=y.name.toLowerCase()),b&&y.append?[C,C+"-"+b,d,C+"Exit",C+"Exit-"+b]:b?[C,C+"-"+b,C+"Exit",C+"Exit-"+b]:y.append?[C,d,C+"Exit"]:[C,C+"Exit"]}function m(y){let b;return y.type==="document"?b=["Document",d,"DocumentExit"]:y.type==="root"?b=["Root",d,"RootExit"]:b=p(y),{eventIndex:0,events:b,iterator:0,node:y,visitorIndex:0,visitors:[]}}function g(y){let b=[y];for(;b.length>0;){let C=b.pop();if(C[a]=!1,C.nodes)for(let w of C.nodes)b.push(w)}return y}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(b,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 T=r;w.syntax&&(T=w.syntax.parse),w.parser&&(T=w.parser),T.parse&&(T=T.parse);try{v=T(C,w)}catch(R){this.processed=!0,this.error=R}v&&!v[l]&&t.rebuild(v)}this.result=new i(b,v,w),this.helpers={...A,postcss:A,result:this.result},this.plugins=this.processor.plugins.map(T=>typeof T=="object"&&T.prepare?{...T,...T.prepare(this.result)}:T)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(b){return this.async().catch(b)}finally(b){return this.async().then(b,b)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(b,C){let w=this.result.lastPlugin;try{C&&C.addToError(b),this.error=b,b.name==="CssSyntaxError"&&!b.plugin?(b.plugin=w.postcssPlugin,b.setMessage()):w.postcssVersion}catch(v){console&&console.error&&console.error(v)}return b}prepareVisitors(){this.listeners={};let b=(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==="*"?b(C,w,C[w][v]):b(C,w+"-"+v.toLowerCase(),C[w][v]);else typeof C[w]=="function"&&b(C,w,C[w])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let b=0;b<this.plugins.length;b++){let C=this.plugins[b],w=this.runOnRoot(C);if(h(w))try{await w}catch(v){throw this.handleError(v)}}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[a];){b[a]=!0;let C=[m(b)];for(;C.length>0;){let w=this.visitTick(C);if(h(w))try{await w}catch(v){let T=C[C.length-1].node;throw this.handleError(v,T)}}}if(this.listeners.OnceExit)for(let[C,w]of this.listeners.OnceExit){this.result.lastPlugin=C;try{if(b.type==="document"){let v=b.nodes.map(T=>w(T,this.helpers));await Promise.all(v)}else await w(b,this.helpers)}catch(v){throw this.handleError(v)}}}return this.processed=!0,this.stringify()}runOnRoot(b){this.result.lastPlugin=b;try{if(typeof b=="object"&&b.Once){if(this.result.root.type==="document"){let C=this.result.root.nodes.map(w=>b.Once(w,this.helpers));return h(C[0])?Promise.all(C):C}return b.Once(this.result.root,this.helpers)}else if(typeof b=="function")return b(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 b=this.result.opts,C=s;b.syntax&&(C=b.syntax.stringify),b.stringifier&&(C=b.stringifier),C.stringify&&(C=C.stringify);let w=this.result.root.source;if(b.map===void 0&&!(w&&w.input&&w.input.map)){let R="";return C(this.result.root,S=>{R+=S}),this.result.css=R,this.result}let T=new n(C,this.result.root,this.result.opts).generate();return this.result.css=T[0],this.result.map=T[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 b of this.plugins){let C=this.runOnRoot(b);if(h(C))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[a];)b[a]=!0,this.walkSync(b);if(this.listeners.OnceExit)if(b.type==="document")for(let C of b.nodes)this.visitSync(this.listeners.OnceExit,C);else this.visitSync(this.listeners.OnceExit,b)}return this.result}then(b,C){return this.async().then(b,C)}toString(){return this.css}visitSync(b,C){for(let[w,v]of b){this.result.lastPlugin=w;let T;try{T=v(C,this.helpers)}catch(R){throw this.handleError(R,C.proxyOf)}if(C.type!=="root"&&C.type!=="document"&&!C.parent)return!0;if(h(T))throw this.getAsyncError()}}visitTick(b){let C=b[b.length-1],{node:w,visitors:v}=C;if(w.type!=="root"&&w.type!=="document"&&!w.parent){b.pop();return}if(v.length>0&&C.visitorIndex<v.length){let[R,S]=v[C.visitorIndex];C.visitorIndex+=1,C.visitorIndex===v.length&&(C.visitors=[],C.visitorIndex=0),this.result.lastPlugin=R;try{return S(w.toProxy(),this.helpers)}catch(M){throw this.handleError(M,w)}}if(C.iterator!==0){let R=C.iterator;C.descending&&(C.descending=!1,w.indexes[R]+=1);let S;for(;S=w.nodes[w.indexes[R]];){if(!S[a]){S[a]=!0,C.descending=!0,b.push(m(S));return}w.indexes[R]+=1}C.iterator=0,delete w.indexes[R]}let T=C.events;for(;C.eventIndex<T.length;){let R=T[C.eventIndex];if(C.eventIndex+=1,R===d){w.nodes&&w.nodes.length&&(w[a]=!0,C.iterator=w.getIterator());return}else if(this.listeners[R]){C.visitors=this.listeners[R];return}}b.pop()}walkSync(b){b[a]=!0;let C=[{eventIndex:0,events:p(b),iterator:0,node:b}];for(;C.length>0;){let w=C[C.length-1],v=w.node;if(w.iterator!==0){let T=w.iterator;w.descending&&(w.descending=!1,v.indexes[T]+=1);let R,S=!1;for(;R=v.nodes[v.indexes[T]];){if(!R[a]){R[a]=!0,w.descending=!0,C.push({eventIndex:0,events:p(R),iterator:0,node:R}),S=!0;break}v.indexes[T]+=1}if(S)continue;w.iterator=0,delete v.indexes[T]}if(w.eventIndex<w.events.length){let T=w.events[w.eventIndex];if(w.eventIndex+=1,T===d)v.nodes&&v.nodes.length&&(w.iterator=v.getIterator());else{let R=this.listeners[T];R&&this.visitSync(R,v.toProxy())&&C.pop()}continue}C.pop()}}warnings(){return this.sync().warnings()}}return x.registerPostcss=y=>{A=y},$c=x,x.default=x,o.registerLazyResult(x),e.registerLazyResult(x),$c}var Xc,Pg;function NP(){if(Pg)return Xc;Pg=1;let t=Uk(),e=xd(),n=Cd(),r=bl();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=e;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 t(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 Xc=i,i.default=i,Xc}var eu,Lg;function TP(){if(Lg)return eu;Lg=1;let t=wd(),e=Zk(),n=NP(),r=Ns();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 e(this,s,a)}use(s){return this.plugins=this.plugins.concat(this.normalize([s])),this}}return eu=i,i.default=i,r.registerProcessor(i),t.registerProcessor(i),eu}var tu,zg;function $k(){if(zg)return tu;zg=1;var t={};let e=bd(),n=Rs(),r=Cr(),i=yd(),o=xl(),s=wd(),a=RP(),l=Cl(),c=Zk(),u=qk(),f=kl(),d=xd(),h=TP(),p=Cd(),m=Ns(),g=kd(),A=bl(),x=Vk();function y(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new h(b)}return y.plugin=function(C,w){let v=!1;function T(...S){console&&console.warn&&!v&&(v=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
937
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),t.LANG&&t.LANG.startsWith("zh")&&console.warn(C+`: 里面 postcss.plugin 被弃用. 迁移指南:
938
+ https://www.w3ctech.com/topic/2226`));let M=w(...S);return M.postcssPlugin=C,M.postcssVersion=new h().version,M}let R;return Object.defineProperty(T,"postcss",{get(){return R||(R=T()),R}}),T.process=function(S,M,z){return y([T(z)]).process(S,M)},T},y.stringify=A,y.parse=d,y.fromJSON=a,y.list=u,y.comment=b=>new n(b),y.atRule=b=>new e(b),y.decl=b=>new o(b),y.rule=b=>new g(b),y.root=b=>new m(b),y.document=b=>new s(b),y.CssSyntaxError=i,y.Declaration=o,y.Container=r,y.Processor=h,y.Document=s,y.Comment=n,y.Warning=x,y.AtRule=e,y.Result=p,y.Input=l,y.Rule=g,y.Root=m,y.Node=f,c.registerPostcss(y),tu=y,y.default=y,tu}var DP=$k();const Oe=as(DP);Oe.stringify;Oe.fromJSON;Oe.plugin;Oe.parse;Oe.list;Oe.document;Oe.comment;Oe.atRule;Oe.rule;Oe.decl;Oe.root;Oe.CssSyntaxError;Oe.Declaration;Oe.Container;Oe.Processor;Oe.Document;Oe.Comment;Oe.Warning;Oe.AtRule;Oe.Result;Oe.Input;Oe.Rule;Oe.Root;Oe.Node;var nu,Wg;function OP(){if(Wg)return nu;Wg=1;let t=Rs(),e=Yk(),n=Gk();class r extends e{checkMissedSemicolon(){}comment(o){let s=new t;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 nu=r,nu}var ru,jg;function MP(){if(jg)return ru;jg=1;let{Input:t}=$k(),e=OP();return ru=function(r,i){let o=new t(r,i),s=new e(o);return s.parse(),s.root},ru}var BP=MP();const Xk=as(BP);var hi={},Xe={},jn={},qe={},oo={},Gs={},Kg;function e1(){if(Kg)return Gs;Kg=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.default=n;function t(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 e=/\\/;function n(r){var i=e.test(r);if(!i)return r;for(var o="",s=0;s<r.length;s++){if(r[s]==="\\"){var a=t(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 Gs}var Ys={},Jg;function FP(){if(Jg)return Ys;Jg=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=t;function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(;n.length>0;){var i=n.shift();if(!e[i])return;e=e[i]}return e}return Ys}var Vs={},Qg;function _P(){if(Qg)return Vs;Qg=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.default=t;function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(;n.length>0;){var i=n.shift();e[i]||(e[i]={}),e=e[i]}}return Vs}var Zs={},Hg;function PP(){if(Hg)return Zs;Hg=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.default=t;function t(e){for(var n="",r=e.indexOf("/*"),i=0;r>=0;){n=n+e.slice(i,r);var o=e.indexOf("*/",r+2);if(o<0)return n;i=o+2,r=e.indexOf("/*",i)}return n=n+e.slice(i),n}return Zs}var iu={},qg;function LP(){return qg||(qg=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_NESTING_DEPTH=void 0,t.default=e,t.MAX_NESTING_DEPTH=256;function e(n){return Number.isSafeInteger(n)&&n>=0?n:t.MAX_NESTING_DEPTH}})(iu)),iu}var Ug;function Ts(){return Ug||(Ug=1,(function(t){var e=oo&&oo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_NESTING_DEPTH=t.resolveMaxNestingDepth=t.stripComments=t.ensureObject=t.getProp=t.unesc=void 0;var n=e1();Object.defineProperty(t,"unesc",{enumerable:!0,get:function(){return e(n).default}});var r=FP();Object.defineProperty(t,"getProp",{enumerable:!0,get:function(){return e(r).default}});var i=_P();Object.defineProperty(t,"ensureObject",{enumerable:!0,get:function(){return e(i).default}});var o=PP();Object.defineProperty(t,"stripComments",{enumerable:!0,get:function(){return e(o).default}});var s=LP();Object.defineProperty(t,"resolveMaxNestingDepth",{enumerable:!0,get:function(){return e(s).default}}),Object.defineProperty(t,"MAX_NESTING_DEPTH",{enumerable:!0,get:function(){return s.MAX_NESTING_DEPTH}})})(oo)),oo}var $s={},Gg;function vr(){if(Gg)return $s;Gg=1,Object.defineProperty($s,"__esModule",{value:!0});var t=Ts(),e=function(r,i,o){if(o===void 0&&(o=0),o>t.MAX_NESTING_DEPTH)throw new Error("Cannot clone selector: nesting depth exceeds the maximum of ".concat(t.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 e(u,s,o+1)}):s[a]=e(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=e(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,t.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,t.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 $s.default=n,$s}var Re={},Yg;function dt(){return Yg||(Yg=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.UNIVERSAL=Re.ATTRIBUTE=Re.CLASS=Re.COMBINATOR=Re.COMMENT=Re.ID=Re.NESTING=Re.PSEUDO=Re.ROOT=Re.SELECTOR=Re.STRING=Re.TAG=void 0,Re.TAG="tag",Re.STRING="string",Re.SELECTOR="selector",Re.ROOT="root",Re.PSEUDO="pseudo",Re.NESTING="nesting",Re.ID="id",Re.COMMENT="comment",Re.COMBINATOR="combinator",Re.CLASS="class",Re.ATTRIBUTE="attribute",Re.UNIVERSAL="universal"),Re}var Vg;function vd(){if(Vg)return qe;Vg=1;var t=qe&&qe.__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)}})(),e=qe&&qe.__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=qe&&qe.__setModuleDefault||(Object.create?(function(d,h){Object.defineProperty(d,"default",{enumerable:!0,value:h})}):function(d,h){d.default=h}),r=qe&&qe.__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"&&e(p,h,m[g]);return n(p,h),p}})(),i=qe&&qe.__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=qe&&qe.__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(y){x={error:y}}finally{try{g&&!g.done&&(p=m.return)&&p.call(m)}finally{if(x)throw x.error}}return A},s=qe&&qe.__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=qe&&qe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(qe,"__esModule",{value:!0});var l=Ts(),c=a(vr()),u=r(dt()),f=(function(d){t(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(y){p={error:y}}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=[],y=2;y<arguments.length;y++)x.push(arguments[y]);(g=this.nodes).splice.apply(g,s([A+1,0,m],o(x),!1)),m.parent=this;var b;for(var C in this.indexes)b=this.indexes[C],A<b&&(this.indexes[C]=b+arguments.length-1);return this},h.prototype.insertBefore=function(p,m){var g;m.parent=this;for(var A=this.index(p),x=[],y=2;y<arguments.length;y++)x.push(arguments[y]);(g=this.nodes).splice.apply(g,s([A,0,m],o(x),!1)),m.parent=this;var b;for(var C in this.indexes)b=this.indexes[C],b>=A&&(this.indexes[C]=b+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,y){var b=p.call(m,x);return g.push(x),b?(A.push(g),g=[]):y===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 qe.default=f,qe}var Zg;function t1(){if(Zg)return jn;Zg=1;var t=jn&&jn.__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)}})(),e=jn&&jn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(jn,"__esModule",{value:!0});var n=e(vd()),r=dt(),i=(function(o){t(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 jn.default=i,jn}var Kn={},$g;function n1(){if($g)return Kn;$g=1;var t=Kn&&Kn.__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)}})(),e=Kn&&Kn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Kn,"__esModule",{value:!0});var n=e(vd()),r=dt(),i=(function(o){t(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.SELECTOR,l}return s})(n.default);return Kn.default=i,Kn}var Jn={};var ou,Xg;function Sd(){if(Xg)return ou;Xg=1;var t={},e=t.hasOwnProperty,n=function(l,c){if(!l)return c;var u={};for(var f in c)u[f]=e.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 y=l.charCodeAt(p++);(y&64512)==56320?A=((A&1023)<<10)+(y&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(b,C,w){return C&&C.length%2?b:(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",ou=s,ou}var eA;function r1(){if(eA)return Jn;eA=1;var t=Jn&&Jn.__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)}})(),e=Jn&&Jn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Jn,"__esModule",{value:!0});var n=e(Sd()),r=Ts(),i=e(vr()),o=dt(),s=(function(a){t(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 Jn.default=s,Jn}var Qn={},tA;function i1(){if(tA)return Qn;tA=1;var t=Qn&&Qn.__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)}})(),e=Qn&&Qn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Qn,"__esModule",{value:!0});var n=e(vr()),r=dt(),i=(function(o){t(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.COMMENT,l}return s})(n.default);return Qn.default=i,Qn}var Hn={},nA;function o1(){if(nA)return Hn;nA=1;var t=Hn&&Hn.__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)}})(),e=Hn&&Hn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Hn,"__esModule",{value:!0});var n=e(vr()),r=dt(),i=(function(o){t(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 Hn.default=i,Hn}var qn={},Un={},rA;function Id(){if(rA)return Un;rA=1;var t=Un&&Un.__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)}})(),e=Un&&Un.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Un,"__esModule",{value:!0});var n=e(Sd()),r=Ts(),i=e(vr()),o=(function(s){t(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 Un.default=o,Un}var iA;function s1(){if(iA)return qn;iA=1;var t=qn&&qn.__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)}})(),e=qn&&qn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(qn,"__esModule",{value:!0});var n=e(Id()),r=dt(),i=(function(o){t(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.TAG,l}return s})(n.default);return qn.default=i,qn}var Gn={},oA;function a1(){if(oA)return Gn;oA=1;var t=Gn&&Gn.__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)}})(),e=Gn&&Gn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Gn,"__esModule",{value:!0});var n=e(vr()),r=dt(),i=(function(o){t(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.STRING,l}return s})(n.default);return Gn.default=i,Gn}var Yn={},sA;function l1(){if(sA)return Yn;sA=1;var t=Yn&&Yn.__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)}})(),e=Yn&&Yn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Yn,"__esModule",{value:!0});var n=e(vd()),r=dt(),i=(function(o){t(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 Yn.default=i,Yn}var wn={},su,aA;function zP(){if(aA)return su;aA=1,su=t;function t(n,r){if(e("noDeprecation"))return n;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return o}function e(n){try{if(!ep.localStorage)return!1}catch{return!1}var r=ep.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return su}var lA;function c1(){if(lA)return wn;lA=1;var t=wn&&wn.__extends||(function(){var A=function(x,y){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,C){b.__proto__=C}||function(b,C){for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&(b[w]=C[w])},A(x,y)};return function(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");A(x,y);function b(){this.constructor=x}x.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),e=wn&&wn.__importDefault||function(A){return A&&A.__esModule?A:{default:A}},n;Object.defineProperty(wn,"__esModule",{value:!0}),wn.unescapeValue=d;var r=e(Sd()),i=e(e1()),o=e(Id()),s=dt(),a=zP(),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,y=null,b=A,C=b.match(l);return C&&(y=C[1],b=C[2]),b=(0,i.default)(b),b!==A&&(x=!0),{deprecatedUsage:x,unescaped:b,quoteMark:y}}function h(A){if(A.quoteMark!==void 0||A.value===void 0)return A;f();var x=d(A.value),y=x.quoteMark,b=x.unescaped;return A.raws||(A.raws={}),A.raws.value===void 0&&(A.raws.value=A.value),A.value=b,A.quoteMark=y,A}var p=(function(A){t(x,A);function x(y){y===void 0&&(y={});var b=A.call(this,h(y))||this;return b.type=s.ATTRIBUTE,b.raws=b.raws||{},Object.defineProperty(b.raws,"unquoted",{get:a(function(){return b.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:a(function(){return b.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),b._constructed=!0,b}return x.prototype.getQuotedValue=function(y){y===void 0&&(y={});var b=this._determineQuoteMark(y),C=m[b],w=(0,r.default)(this._value,C);return w},x.prototype._determineQuoteMark=function(y){return y.smart?this.smartQuoteMark(y):this.preferredQuoteMark(y)},x.prototype.setValue=function(y,b){b===void 0&&(b={}),this._value=y,this._quoteMark=this._determineQuoteMark(b),this._syncRawValue()},x.prototype.smartQuoteMark=function(y){var b=this.value,C=b.replace(/[^']/g,"").length,w=b.replace(/[^"]/g,"").length;if(C+w===0){var v=(0,r.default)(b,{isIdentifier:!0});if(v===b)return x.NO_QUOTE;var T=this.preferredQuoteMark(y);if(T===x.NO_QUOTE){var R=this.quoteMark||y.quoteMark||x.DOUBLE_QUOTE,S=m[R],M=(0,r.default)(b,S);if(M.length<v.length)return R}return T}else return w===C?this.preferredQuoteMark(y):w<C?x.DOUBLE_QUOTE:x.SINGLE_QUOTE},x.prototype.preferredQuoteMark=function(y){var b=y.preferCurrentQuoteMark?this.quoteMark:y.quoteMark;return b===void 0&&(b=y.preferCurrentQuoteMark?y.quoteMark:this.quoteMark),b===void 0&&(b=x.DOUBLE_QUOTE),b},Object.defineProperty(x.prototype,"quoted",{get:function(){var y=this.quoteMark;return y==="'"||y==='"'},set:function(y){u()},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"quoteMark",{get:function(){return this._quoteMark},set:function(y){if(!this._constructed){this._quoteMark=y;return}this._quoteMark!==y&&(this._quoteMark=y,this._syncRawValue())},enumerable:!1,configurable:!0}),x.prototype._syncRawValue=function(){var y=(0,r.default)(this._value,m[this.quoteMark]);y===this._value?this.raws&&delete this.raws.value:this.raws.value=y},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(y){if(this._constructed){var b=d(y),C=b.deprecatedUsage,w=b.unescaped,v=b.quoteMark;if(C&&c(),w===this._value&&v===this._quoteMark)return;this._value=w,this._quoteMark=v,this._syncRawValue()}else this._value=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"insensitive",{get:function(){return this._insensitive},set:function(y){y||(this._insensitive=!1,this.raws&&(this.raws.insensitiveFlag==="I"||this.raws.insensitiveFlag==="i")&&(this.raws.insensitiveFlag=void 0)),this._insensitive=y},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"attribute",{get:function(){return this._attribute},set:function(y){this._handleEscapes("attribute",y),this._attribute=y},enumerable:!1,configurable:!0}),x.prototype._handleEscapes=function(y,b){if(this._constructed){var C=(0,r.default)(b,{isIdentifier:!0});C!==b?this.raws[y]=C:delete this.raws[y]}},x.prototype._spacesFor=function(y){var b={before:"",after:""},C=this.spaces[y]||{},w=this.raws.spaces&&this.raws.spaces[y]||{};return Object.assign(b,C,w)},x.prototype._stringFor=function(y,b,C){b===void 0&&(b=y),C===void 0&&(C=g);var w=this._spacesFor(b);return C(this.stringifyProperty(y),w)},x.prototype.offsetOf=function(y){var b=1,C=this._spacesFor("attribute");if(b+=C.before.length,y==="namespace"||y==="ns")return this.namespace?b:-1;if(y==="attributeNS"||(b+=this.namespaceString.length,this.namespace&&(b+=1),y==="attribute"))return b;b+=this.stringifyProperty("attribute").length,b+=C.after.length;var w=this._spacesFor("operator");b+=w.before.length;var v=this.stringifyProperty("operator");if(y==="operator")return v?b:-1;b+=v.length,b+=w.after.length;var T=this._spacesFor("value");b+=T.before.length;var R=this.stringifyProperty("value");if(y==="value")return R?b:-1;b+=R.length,b+=T.after.length;var S=this._spacesFor("insensitive");return b+=S.before.length,y==="insensitive"&&this.insensitive?b:-1},x.prototype.toString=function(){var y=this,b=[this.rawSpaceBefore,"["];return b.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||this.value==="")&&(b.push(this._stringFor("operator")),b.push(this._stringFor("value")),b.push(this._stringFor("insensitiveFlag","insensitive",function(C,w){return C.length>0&&!y.quoted&&w.before.length===0&&!(y.spaces.value&&y.spaces.value.after)&&(w.before=" "),g(C,w)}))),b.push("]"),b.push(this.rawSpaceAfter),b.join("")},x.NO_QUOTE=null,x.SINGLE_QUOTE="'",x.DOUBLE_QUOTE='"',x})(o.default);wn.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 wn}var Vn={},cA;function u1(){if(cA)return Vn;cA=1;var t=Vn&&Vn.__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)}})(),e=Vn&&Vn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Vn,"__esModule",{value:!0});var n=e(Id()),r=dt(),i=(function(o){t(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 Vn.default=i,Vn}var Zn={},uA;function f1(){if(uA)return Zn;uA=1;var t=Zn&&Zn.__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)}})(),e=Zn&&Zn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Zn,"__esModule",{value:!0});var n=e(vr()),r=dt(),i=(function(o){t(s,o);function s(a){var l=o.call(this,a)||this;return l.type=r.COMBINATOR,l}return s})(n.default);return Zn.default=i,Zn}var $n={},fA;function h1(){if(fA)return $n;fA=1;var t=$n&&$n.__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)}})(),e=$n&&$n.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty($n,"__esModule",{value:!0});var n=e(vr()),r=dt(),i=(function(o){t(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 $n.default=i,$n}var Xs={},hA;function WP(){if(hA)return Xs;hA=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=t;function t(e){return e.sort(function(n,r){return n-r})}return Xs}var jt={},au={},dA;function d1(){return dA||(dA=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.combinator=t.word=t.comment=t.str=t.tab=t.newline=t.feed=t.cr=t.backslash=t.bang=t.slash=t.doubleQuote=t.singleQuote=t.space=t.greaterThan=t.pipe=t.equals=t.plus=t.caret=t.tilde=t.dollar=t.closeSquare=t.openSquare=t.closeParenthesis=t.openParenthesis=t.semicolon=t.colon=t.comma=t.at=t.asterisk=t.ampersand=void 0,t.ampersand=38,t.asterisk=42,t.at=64,t.comma=44,t.colon=58,t.semicolon=59,t.openParenthesis=40,t.closeParenthesis=41,t.openSquare=91,t.closeSquare=93,t.dollar=36,t.tilde=126,t.caret=94,t.plus=43,t.equals=61,t.pipe=124,t.greaterThan=62,t.space=32,t.singleQuote=39,t.doubleQuote=34,t.slash=47,t.bang=33,t.backslash=92,t.cr=13,t.feed=12,t.newline=10,t.tab=9,t.str=t.singleQuote,t.comment=-1,t.word=-2,t.combinator=-3})(au)),au}var pA;function jP(){if(pA)return jt;pA=1;var t=jt&&jt.__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]})),e=jt&&jt.__setModuleDefault||(Object.create?(function(p,m){Object.defineProperty(p,"default",{enumerable:!0,value:m})}):function(p,m){p.default=m}),n=jt&&jt.__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"&&t(g,m,A[x]);return e(g,m),g}})(),r,i;Object.defineProperty(jt,"__esModule",{value:!0}),jt.FIELDS=void 0,jt.default=h;for(var o=n(d1()),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}jt.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,y=1,b=0,C=0,w,v,T,R,S,M,z,W,L,D,Z,q,ne;function Ce(I,_){if(p.safe)g+=_,L=g.length-1;else throw p.error("Unclosed "+I,y,b-x,b)}for(;b<A;){switch(w=g.charCodeAt(b),w===o.newline&&(x=b,y+=1),w){case o.space:case o.tab:case o.newline:case o.cr:case o.feed:L=b;do L+=1,w=g.charCodeAt(L),w===o.newline&&(x=L,y+=1);while(w===o.space||w===o.newline||w===o.tab||w===o.cr||w===o.feed);ne=o.space,R=y,T=L-x-1,C=L;break;case o.plus:case o.greaterThan:case o.tilde:case o.pipe:L=b;do L+=1,w=g.charCodeAt(L);while(w===o.plus||w===o.greaterThan||w===o.tilde||w===o.pipe);ne=o.combinator,R=y,T=b-x,C=L;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:L=b,ne=w,R=y,T=b-x,C=L+1;break;case o.singleQuote:case o.doubleQuote:q=w===o.singleQuote?"'":'"',L=b;do for(S=!1,L=g.indexOf(q,L+1),L===-1&&Ce("quote",q),M=L;g.charCodeAt(M-1)===o.backslash;)M-=1,S=!S;while(S);ne=o.str,R=y,T=b-x,C=L+1;break;default:w===o.slash&&g.charCodeAt(b+1)===o.asterisk?(L=g.indexOf("*/",b+2)+1,L===0&&Ce("comment","*/"),v=g.slice(b,L+1),W=v.split(`
939
+ `),z=W.length-1,z>0?(D=y+z,Z=L-W[z].length):(D=y,Z=x),ne=o.comment,y=D,R=D,T=L-Z):w===o.slash?(L=b,ne=w,R=y,T=b-x,C=L+1):(L=f(g,b),ne=o.word,R=y,T=L-x),C=L+1;break}m.push([ne,y,b-x,R,T,b,C]),Z&&(x=Z,Z=null),b=C}return m}return jt}var mA;function KP(){if(mA)return Xe;mA=1;var t=Xe&&Xe.__assign||function(){return t=Object.assign||function(_){for(var E,k=1,F=arguments.length;k<F;k++){E=arguments[k];for(var N in E)Object.prototype.hasOwnProperty.call(E,N)&&(_[N]=E[N])}return _},t.apply(this,arguments)},e=Xe&&Xe.__createBinding||(Object.create?(function(_,E,k,F){F===void 0&&(F=k);var N=Object.getOwnPropertyDescriptor(E,k);(!N||("get"in N?!E.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return E[k]}}),Object.defineProperty(_,F,N)}):(function(_,E,k,F){F===void 0&&(F=k),_[F]=E[k]})),n=Xe&&Xe.__setModuleDefault||(Object.create?(function(_,E){Object.defineProperty(_,"default",{enumerable:!0,value:E})}):function(_,E){_.default=E}),r=Xe&&Xe.__importStar||(function(){var _=function(E){return _=Object.getOwnPropertyNames||function(k){var F=[];for(var N in k)Object.prototype.hasOwnProperty.call(k,N)&&(F[F.length]=N);return F},_(E)};return function(E){if(E&&E.__esModule)return E;var k={};if(E!=null)for(var F=_(E),N=0;N<F.length;N++)F[N]!=="default"&&e(k,E,F[N]);return n(k,E),k}})(),i=Xe&&Xe.__read||function(_,E){var k=typeof Symbol=="function"&&_[Symbol.iterator];if(!k)return _;var F=k.call(_),N,K=[],Y;try{for(;(E===void 0||E-- >0)&&!(N=F.next()).done;)K.push(N.value)}catch(U){Y={error:U}}finally{try{N&&!N.done&&(k=F.return)&&k.call(F)}finally{if(Y)throw Y.error}}return K},o=Xe&&Xe.__spreadArray||function(_,E,k){if(k||arguments.length===2)for(var F=0,N=E.length,K;F<N;F++)(K||!(F in E))&&(K||(K=Array.prototype.slice.call(E,0,F)),K[F]=E[F]);return _.concat(K||Array.prototype.slice.call(E))},s=Xe&&Xe.__importDefault||function(_){return _&&_.__esModule?_:{default:_}},a,l;Object.defineProperty(Xe,"__esModule",{value:!0});var c=s(t1()),u=s(n1()),f=s(r1()),d=s(i1()),h=s(o1()),p=s(s1()),m=s(a1()),g=s(l1()),A=r(c1()),x=s(u1()),y=s(f1()),b=s(h1()),C=s(WP()),w=r(jP()),v=r(d1()),T=r(dt()),R=Ts(),S=(a={},a[v.space]=!0,a[v.cr]=!0,a[v.feed]=!0,a[v.newline]=!0,a[v.tab]=!0,a),M=t(t({},S),(l={},l[v.comment]=!0,l));function z(_){return{line:_[w.FIELDS.START_LINE],column:_[w.FIELDS.START_COL]}}function W(_){return{line:_[w.FIELDS.END_LINE],column:_[w.FIELDS.END_COL]}}function L(_,E,k,F){return{start:{line:_,column:E},end:{line:k,column:F}}}function D(_){return L(_[w.FIELDS.START_LINE],_[w.FIELDS.START_COL],_[w.FIELDS.END_LINE],_[w.FIELDS.END_COL])}function Z(_,E){if(_)return L(_[w.FIELDS.START_LINE],_[w.FIELDS.START_COL],E[w.FIELDS.END_LINE],E[w.FIELDS.END_COL])}function q(_,E){var k=_[E];if(typeof k=="string")return k.indexOf("\\")!==-1&&((0,R.ensureObject)(_,"raws"),_[E]=(0,R.unesc)(k),_.raws[E]===void 0&&(_.raws[E]=k)),_}function ne(_,E){for(var k=-1,F=[];(k=_.indexOf(E,k+1))!==-1;)F.push(k);return F}function Ce(){return Array.from(new Set(Array.prototype.concat.apply([],arguments)))}var I=(function(){function _(E,k){k===void 0&&(k={}),this.rule=E,this.options=Object.assign({lossy:!1,safe:!1},k),this.position=0,this.nestingDepth=0,this.maxNestingDepth=(0,R.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 F=Z(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new c.default({source:F}),this.root.errorGenerator=this._errorGenerator();var N=new u.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(N),this.current=N,this.loop()}return _.prototype._errorGenerator=function(){var E=this;return function(k,F){return typeof E.rule=="string"?new Error(k):E.rule.error(k,F)}},_.prototype.attribute=function(){var E=[],k=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[w.FIELDS.TYPE]!==v.closeSquare;)E.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 F=E.length,N={source:L(k[1],k[2],this.currToken[3],this.currToken[4]),sourceIndex:k[w.FIELDS.START_POS]};if(F===1&&!~[v.word].indexOf(E[0][w.FIELDS.TYPE]))return this.expected("attribute",E[0][w.FIELDS.START_POS]);for(var K=0,Y="",U="",H=null,re=!1;K<F;){var V=E[K],G=this.content(V),Ae=E[K+1];switch(V[w.FIELDS.TYPE]){case v.space:if(re=!0,this.options.lossy)break;if(H){(0,R.ensureObject)(N,"spaces",H);var $e=N.spaces[H].after||"";N.spaces[H].after=$e+G;var tt=(0,R.getProp)(N,"raws","spaces",H,"after")||null;tt&&(N.raws.spaces[H].after=tt+G)}else Y=Y+G,U=U+G;break;case v.asterisk:if(Ae[w.FIELDS.TYPE]===v.equals)N.operator=G,H="operator";else if((!N.namespace||H==="namespace"&&!re)&&Ae){Y&&((0,R.ensureObject)(N,"spaces","attribute"),N.spaces.attribute.before=Y,Y=""),U&&((0,R.ensureObject)(N,"raws","spaces","attribute"),N.raws.spaces.attribute.before=U,U=""),N.namespace=(N.namespace||"")+G;var Ke=(0,R.getProp)(N,"raws","namespace")||null;Ke&&(N.raws.namespace+=G),H="namespace"}re=!1;break;case v.dollar:if(H==="value"){var Pe=(0,R.getProp)(N,"raws","value");N.value+="$",Pe&&(N.raws.value=Pe+"$");break}case v.caret:Ae[w.FIELDS.TYPE]===v.equals&&(N.operator=G,H="operator"),re=!1;break;case v.combinator:if(G==="~"&&Ae[w.FIELDS.TYPE]===v.equals&&(N.operator=G,H="operator"),G!=="|"){re=!1;break}Ae[w.FIELDS.TYPE]===v.equals?(N.operator=G,H="operator"):!N.namespace&&!N.attribute&&(N.namespace=!0),re=!1;break;case v.word:if(Ae&&this.content(Ae)==="|"&&E[K+2]&&E[K+2][w.FIELDS.TYPE]!==v.equals&&!N.operator&&!N.namespace)N.namespace=G,H="namespace";else if(!N.attribute||H==="attribute"&&!re){Y&&((0,R.ensureObject)(N,"spaces","attribute"),N.spaces.attribute.before=Y,Y=""),U&&((0,R.ensureObject)(N,"raws","spaces","attribute"),N.raws.spaces.attribute.before=U,U=""),N.attribute=(N.attribute||"")+G;var Ke=(0,R.getProp)(N,"raws","attribute")||null;Ke&&(N.raws.attribute+=G),H="attribute"}else if(!N.value&&N.value!==""||H==="value"&&!(re||N.quoteMark)){var We=(0,R.unesc)(G),Pe=(0,R.getProp)(N,"raws","value")||"",vt=N.value||"";N.value=vt+We,N.quoteMark=null,(We!==G||Pe)&&((0,R.ensureObject)(N,"raws"),N.raws.value=(Pe||vt)+G),H="value"}else{var an=G==="i"||G==="I";(N.value||N.value==="")&&(N.quoteMark||re)?(N.insensitive=an,(!an||G==="I")&&((0,R.ensureObject)(N,"raws"),N.raws.insensitiveFlag=G),H="insensitive",Y&&((0,R.ensureObject)(N,"spaces","insensitive"),N.spaces.insensitive.before=Y,Y=""),U&&((0,R.ensureObject)(N,"raws","spaces","insensitive"),N.raws.spaces.insensitive.before=U,U="")):(N.value||N.value==="")&&(H="value",N.value+=G,N.raws.value&&(N.raws.value+=G))}re=!1;break;case v.str:if(!N.attribute||!N.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:V[w.FIELDS.START_POS]});var Vt=(0,A.unescapeValue)(G),Sr=Vt.unescaped,Ir=Vt.quoteMark;N.value=Sr,N.quoteMark=Ir,H="value",(0,R.ensureObject)(N,"raws"),N.raws.value=G,re=!1;break;case v.equals:if(!N.attribute)return this.expected("attribute",V[w.FIELDS.START_POS],G);if(N.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:V[w.FIELDS.START_POS]});N.operator=N.operator?N.operator+G:G,H="operator",re=!1;break;case v.comment:if(H)if(re||Ae&&Ae[w.FIELDS.TYPE]===v.space||H==="insensitive"){var Gi=(0,R.getProp)(N,"spaces",H,"after")||"",Yi=(0,R.getProp)(N,"raws","spaces",H,"after")||Gi;(0,R.ensureObject)(N,"raws","spaces",H),N.raws.spaces[H].after=Yi+G}else{var ai=N[H]||"",O=(0,R.getProp)(N,"raws",H)||ai;(0,R.ensureObject)(N,"raws"),N.raws[H]=O+G}else U=U+G;break;default:return this.error('Unexpected "'.concat(G,'" found.'),{index:V[w.FIELDS.START_POS]})}K++}q(N,"attribute"),q(N,"namespace"),this.newNode(new A.default(N)),this.position++},_.prototype.parseWhitespaceEquivalentTokens=function(E){E<0&&(E=this.tokens.length);var k=this.position,F=[],N="",K=void 0;do if(S[this.currToken[w.FIELDS.TYPE]])this.options.lossy||(N+=this.content());else if(this.currToken[w.FIELDS.TYPE]===v.comment){var Y={};N&&(Y.before=N,N=""),K=new d.default({value:this.content(),source:D(this.currToken),sourceIndex:this.currToken[w.FIELDS.START_POS],spaces:Y}),F.push(K)}while(++this.position<E);if(N){if(K)K.spaces.after=N;else if(!this.options.lossy){var U=this.tokens[k],H=this.tokens[this.position-1];F.push(new m.default({value:"",source:L(U[w.FIELDS.START_LINE],U[w.FIELDS.START_COL],H[w.FIELDS.END_LINE],H[w.FIELDS.END_COL]),sourceIndex:U[w.FIELDS.START_POS],spaces:{before:N,after:""}}))}}return F},_.prototype.convertWhitespaceNodesToSpace=function(E,k){var F=this;k===void 0&&(k=!1);var N="",K="";E.forEach(function(U){var H=F.lossySpace(U.spaces.before,k),re=F.lossySpace(U.rawSpaceBefore,k);N+=H+F.lossySpace(U.spaces.after,k&&H.length===0),K+=H+U.value+F.lossySpace(U.rawSpaceAfter,k&&re.length===0)}),K===N&&(K=void 0);var Y={space:N,rawSpace:K};return Y},_.prototype.isNamedCombinator=function(E){return E===void 0&&(E=this.position),this.tokens[E+0]&&this.tokens[E+0][w.FIELDS.TYPE]===v.slash&&this.tokens[E+1]&&this.tokens[E+1][w.FIELDS.TYPE]===v.word&&this.tokens[E+2]&&this.tokens[E+2][w.FIELDS.TYPE]===v.slash},_.prototype.namedCombinator=function(){if(this.isNamedCombinator()){var E=this.content(this.tokens[this.position+1]),k=(0,R.unesc)(E).toLowerCase(),F={};k!==E&&(F.value="/".concat(E,"/"));var N=new y.default({value:"/".concat(k,"/"),source:L(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:F});return this.position=this.position+3,N}else this.unexpected()},_.prototype.combinator=function(){var E=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 F=this.parseWhitespaceEquivalentTokens(k);if(F.length>0){var N=this.current.last;if(N){var K=this.convertWhitespaceNodesToSpace(F),Y=K.space,U=K.rawSpace;U!==void 0&&(N.rawSpaceAfter+=U),N.spaces.after+=Y}else F.forEach(function(Ke){return E.newNode(Ke)})}return}var H=this.currToken,re=void 0;k>this.position&&(re=this.parseWhitespaceEquivalentTokens(k));var V;if(this.isNamedCombinator()?V=this.namedCombinator():this.currToken[w.FIELDS.TYPE]===v.combinator?(V=new y.default({value:this.content(),source:D(this.currToken),sourceIndex:this.currToken[w.FIELDS.START_POS]}),this.position++):S[this.currToken[w.FIELDS.TYPE]]||re||this.unexpected(),V){if(re){var G=this.convertWhitespaceNodesToSpace(re),Y=G.space,U=G.rawSpace;V.spaces.before=Y,V.rawSpaceBefore=U}}else{var Ae=this.convertWhitespaceNodesToSpace(re,!0),Y=Ae.space,U=Ae.rawSpace;U||(U=Y);var $e={},tt={spaces:{}};Y.endsWith(" ")&&U.endsWith(" ")?($e.before=Y.slice(0,Y.length-1),tt.spaces.before=U.slice(0,U.length-1)):Y[0]===" "&&U[0]===" "?($e.after=Y.slice(1),tt.spaces.after=U.slice(1)):tt.value=U,V=new y.default({value:" ",source:Z(H,this.tokens[this.position-1]),sourceIndex:H[w.FIELDS.START_POS],spaces:$e,raws:tt})}return this.currToken&&this.currToken[w.FIELDS.TYPE]===v.space&&(V.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(V)},_.prototype.comma=function(){if(this.position===this.tokens.length-1){this.root.trailingComma=!0,this.position++;return}this.current._inferEndPosition();var E=new u.default({source:{start:z(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][w.FIELDS.START_POS]});this.current.parent.append(E),this.current=E,this.position++},_.prototype.comment=function(){var E=this.currToken;this.newNode(new d.default({value:this.content(),source:D(E),sourceIndex:E[w.FIELDS.START_POS]})),this.position++},_.prototype.error=function(E,k){throw this.root.error(E,k)},_.prototype.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[w.FIELDS.START_POS]})},_.prototype.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[w.FIELDS.START_POS])},_.prototype.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[w.FIELDS.START_POS])},_.prototype.unexpected=function(){return this.error("Unexpected '".concat(this.content(),"'. Escaping special characters with \\ may help."),this.currToken[w.FIELDS.START_POS])},_.prototype.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[w.FIELDS.START_POS])},_.prototype.namespace=function(){var E=this.prevToken,k=E&&(E[w.FIELDS.TYPE]===v.word||E[w.FIELDS.TYPE]===v.asterisk||E[w.FIELDS.TYPE]===v.ampersand)?this.content(E):!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()},_.prototype.nesting=function(){if(this.nextToken){var E=this.content(this.nextToken);if(E==="|"){this.position++;return}}var k=this.currToken;this.newNode(new b.default({value:this.content(),source:D(k),sourceIndex:k[w.FIELDS.START_POS]})),this.position++},_.prototype.parentheses=function(){var E=this.current.last,k=1,F=this.currToken;if(this.position++,E&&E.type===T.PSEUDO){var N=new u.default({source:{start:z(this.tokens[this.position])},sourceIndex:this.tokens[this.position][w.FIELDS.START_POS]}),K=this.current;E.append(N),this.current=N,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=W(this.currToken),this.current.parent.source.end=W(this.currToken),this.position++)}finally{this.nestingDepth--}this.current=K}else{for(var Y=this.currToken,U="(",H=void 0;this.position<this.tokens.length&&k;)this.currToken[w.FIELDS.TYPE]===v.openParenthesis&&k++,this.currToken[w.FIELDS.TYPE]===v.closeParenthesis&&k--,H=this.currToken,U+=this.parseParenthesisToken(this.currToken),this.position++;E?E.appendToPropertyAndEscape("value",U,U):this.newNode(new m.default({value:U,source:L(Y[w.FIELDS.START_LINE],Y[w.FIELDS.START_COL],H[w.FIELDS.END_LINE],H[w.FIELDS.END_COL]),sourceIndex:Y[w.FIELDS.START_POS]}))}if(k)return this.expected("closing parenthesis",(this.currToken||F)[w.FIELDS.START_POS])},_.prototype.pseudo=function(){for(var E=this,k="",F=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(N,K){k+=N,E.newNode(new g.default({value:k,source:Z(F,E.currToken),sourceIndex:F[w.FIELDS.START_POS]})),K>1&&E.nextToken&&E.nextToken[w.FIELDS.TYPE]===v.openParenthesis&&E.error("Misplaced parenthesis.",{index:E.nextToken[w.FIELDS.START_POS]})});else return this.expected(["pseudo-class","pseudo-element"],this.currToken[w.FIELDS.START_POS])},_.prototype.space=function(){var E=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(E),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(E),this.position++):this.combinator()},_.prototype.string=function(){var E=this.currToken;this.newNode(new m.default({value:this.content(),source:D(E),sourceIndex:E[w.FIELDS.START_POS]})),this.position++},_.prototype.universal=function(E){var k=this.nextToken;if(k&&this.content(k)==="|")return this.position++,this.namespace();var F=this.currToken;this.newNode(new x.default({value:this.content(),source:D(F),sourceIndex:F[w.FIELDS.START_POS]}),E),this.position++},_.prototype.splitWord=function(E,k){for(var F=this,N=this.nextToken,K=this.content();N&&~[v.dollar,v.caret,v.equals,v.word].indexOf(N[w.FIELDS.TYPE]);){this.position++;var Y=this.content();if(K+=Y,Y.lastIndexOf("\\")===Y.length-1){var U=this.nextToken;U&&U[w.FIELDS.TYPE]===v.space&&(K+=this.requiredSpace(this.content(U)),this.position++)}N=this.nextToken}var H=ne(K,".").filter(function(Ke){var Pe=K[Ke-1]==="\\",We=/^\d+\.\d+%$/.test(K);return!Pe&&!We}),re=ne(K,"#").filter(function(Ke){return K[Ke-1]!=="\\"}),V=ne(K,"#{");if(V.length){var G=new Set(V);re=re.filter(function(Ke){return!G.has(Ke)})}var Ae=new Set(H),$e=new Set(re),tt=(0,C.default)(Ce(o(o([0],i(H),!1),i(re),!1)));tt.forEach(function(Ke,Pe){var We=tt[Pe+1]||K.length,vt=K.slice(Ke,We);if(Pe===0&&k)return k.call(F,vt,tt.length);var an,Vt=F.currToken,Sr=Vt[w.FIELDS.START_POS]+tt[Pe],Ir=L(Vt[1],Vt[2]+Ke,Vt[3],Vt[2]+(We-1));if(Ae.has(Ke)){var Gi={value:vt.slice(1),source:Ir,sourceIndex:Sr};an=new f.default(q(Gi,"value"))}else if($e.has(Ke)){var Yi={value:vt.slice(1),source:Ir,sourceIndex:Sr};an=new h.default(q(Yi,"value"))}else{var ai={value:vt,source:Ir,sourceIndex:Sr};q(ai,"value"),an=new p.default(ai)}F.newNode(an,E),E=null}),this.position++},_.prototype.word=function(E){var k=this.nextToken;return k&&this.content(k)==="|"?(this.position++,this.namespace()):this.splitWord(E)},_.prototype.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},_.prototype.parse=function(E){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:E&&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()}},_.prototype.expected=function(E,k,F){if(Array.isArray(E)){var N=E.pop();E="".concat(E.join(", ")," or ").concat(N)}var K=/^[aeiou]/.test(E[0])?"an":"a";return F?this.error("Expected ".concat(K," ").concat(E,', found "').concat(F,'" instead.'),{index:k}):this.error("Expected ".concat(K," ").concat(E,"."),{index:k})},_.prototype.requiredSpace=function(E){return this.options.lossy?" ":E},_.prototype.optionalSpace=function(E){return this.options.lossy?"":E},_.prototype.lossySpace=function(E,k){return this.options.lossy?k?" ":"":E},_.prototype.parseParenthesisToken=function(E){var k=this.content(E);return E[w.FIELDS.TYPE]===v.space?this.requiredSpace(k):k},_.prototype.newNode=function(E,k){return k&&(/^ +$/.test(k)&&(this.options.lossy||(this.spaces=(this.spaces||"")+k),k=!0),E.namespace=k,q(E,"namespace")),this.spaces&&(E.spaces.before=this.spaces,this.spaces=""),this.current.append(E)},_.prototype.content=function(E){return E===void 0&&(E=this.currToken),this.css.slice(E[w.FIELDS.START_POS],E[w.FIELDS.END_POS])},Object.defineProperty(_.prototype,"currToken",{get:function(){return this.tokens[this.position]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"nextToken",{get:function(){return this.tokens[this.position+1]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"prevToken",{get:function(){return this.tokens[this.position-1]},enumerable:!1,configurable:!0}),_.prototype.locateNextMeaningfulToken=function(E){E===void 0&&(E=this.position+1);for(var k=E;k<this.tokens.length;)if(M[this.tokens[k][w.FIELDS.TYPE]]){k++;continue}else return k;return-1},_})();return Xe.default=I,Xe}var gA;function JP(){if(gA)return hi;gA=1;var t=hi&&hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hi,"__esModule",{value:!0});var e=t(KP()),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 e.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 hi.default=n,hi}var Tr={},Se={},AA;function QP(){if(AA)return Se;AA=1;var t=Se&&Se.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.universal=Se.tag=Se.string=Se.selector=Se.root=Se.pseudo=Se.nesting=Se.id=Se.comment=Se.combinator=Se.className=Se.attribute=void 0;var e=t(c1()),n=t(r1()),r=t(f1()),i=t(i1()),o=t(o1()),s=t(h1()),a=t(l1()),l=t(t1()),c=t(n1()),u=t(a1()),f=t(s1()),d=t(u1()),h=function(R){return new e.default(R)};Se.attribute=h;var p=function(R){return new n.default(R)};Se.className=p;var m=function(R){return new r.default(R)};Se.combinator=m;var g=function(R){return new i.default(R)};Se.comment=g;var A=function(R){return new o.default(R)};Se.id=A;var x=function(R){return new s.default(R)};Se.nesting=x;var y=function(R){return new a.default(R)};Se.pseudo=y;var b=function(R){return new l.default(R)};Se.root=b;var C=function(R){return new c.default(R)};Se.selector=C;var w=function(R){return new u.default(R)};Se.string=w;var v=function(R){return new f.default(R)};Se.tag=v;var T=function(R){return new d.default(R)};return Se.universal=T,Se}var lu={},yA;function HP(){return yA||(yA=1,(function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.isUniversal=t.isTag=t.isString=t.isSelector=t.isRoot=t.isPseudo=t.isNesting=t.isIdentifier=t.isComment=t.isCombinator=t.isClassName=t.isAttribute=void 0,t.isNode=i,t.isPseudoElement=s,t.isPseudoClass=a,t.isContainer=l,t.isNamespace=c;var n=dt(),r=(e={},e[n.ATTRIBUTE]=!0,e[n.CLASS]=!0,e[n.COMBINATOR]=!0,e[n.COMMENT]=!0,e[n.ID]=!0,e[n.NESTING]=!0,e[n.PSEUDO]=!0,e[n.ROOT]=!0,e[n.SELECTOR]=!0,e[n.STRING]=!0,e[n.TAG]=!0,e[n.UNIVERSAL]=!0,e);function i(u){return typeof u=="object"&&r[u.type]}function o(u,f){return i(f)&&f.type===u}t.isAttribute=o.bind(null,n.ATTRIBUTE),t.isClassName=o.bind(null,n.CLASS),t.isCombinator=o.bind(null,n.COMBINATOR),t.isComment=o.bind(null,n.COMMENT),t.isIdentifier=o.bind(null,n.ID),t.isNesting=o.bind(null,n.NESTING),t.isPseudo=o.bind(null,n.PSEUDO),t.isRoot=o.bind(null,n.ROOT),t.isSelector=o.bind(null,n.SELECTOR),t.isString=o.bind(null,n.STRING),t.isTag=o.bind(null,n.TAG),t.isUniversal=o.bind(null,n.UNIVERSAL);function s(u){return(0,t.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,t.isPseudo)(u)&&!s(u)}function l(u){return!!(i(u)&&u.walk)}function c(u){return(0,t.isAttribute)(u)||(0,t.isTag)(u)}})(lu)),lu}var bA;function qP(){return bA||(bA=1,(function(t){var e=Tr&&Tr.__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=Tr&&Tr.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&e(i,r,o)};Object.defineProperty(t,"__esModule",{value:!0}),n(dt(),t),n(QP(),t),n(HP(),t)})(Tr)),Tr}var Zt,wA;function UP(){if(wA)return Zt;wA=1;var t=Zt&&Zt.__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]})),e=Zt&&Zt.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),n=Zt&&Zt.__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"&&t(c,l,u[f]);return e(c,l),c}})(),r=Zt&&Zt.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},i=r(JP()),o=n(qP()),s=function(a){return new i.default(a)};return Object.assign(s,o),delete s.__esModule,Zt=s,Zt}var GP=UP();const ye=as(GP);function YP(t,e){return t.a===e.a?t.b===e.b?t.c-e.c:t.b-e.b:t.a-e.a}function Ha(t,e){if(!t)return{a:0,b:0,c:0};let n=0,r=0,i=0;if(t.type==="universal")return{a:0,b:0,c:0};if(t.type==="id")n+=1;else if(t.type==="tag")i+=1;else if(t.type==="class")r+=1;else if(t.type==="attribute")r+=1;else if(VP(t))switch(t.value.toLowerCase()){case"::slotted":if(i+=1,t.nodes&&t.nodes.length>0){const o=ea(t.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 t.nodes&&t.nodes.length===1&&t.nodes[0].type==="selector"&&ZP(t.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:i+=1}else if(ye.isPseudoClass(t))switch(t.value.toLowerCase()){case":-webkit-any":case":any":default:r+=1;break;case":-moz-any":case":has":case":is":case":matches":case":not":if(t.nodes&&t.nodes.length>0){const o=ea(t.nodes);n+=o.a,r+=o.b,i+=o.c}break;case":where":break;case":nth-child":case":nth-last-child":if(r+=1,t.nodes&&t.nodes.length>0){const o=t.nodes[0].nodes.findIndex(s=>s.type==="tag"&&s.value.toLowerCase()==="of");if(o>-1){const s=ye.selector({nodes:[],value:""});t.nodes[0].nodes.slice(o+1).forEach(c=>{s.append(c.clone())});const a=[s];t.nodes.length>1&&a.push(...t.nodes.slice(1));const l=ea(a);n+=l.a,r+=l.b,i+=l.c}}break;case":local":case":global":t.nodes&&t.nodes.length>0&&t.nodes.forEach(o=>{const s=Ha(o);n+=s.a,r+=s.b,i+=s.c});break;case":host":case":host-context":if(r+=1,t.nodes&&t.nodes.length>0){const o=ea(t.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 ye.isContainer(t)&&t.nodes?.length>0&&t.nodes.forEach(o=>{const s=Ha(o);n+=s.a,r+=s.b,i+=s.c});return{a:n,b:r,c:i}}function ea(t,e){let n={a:0,b:0,c:0};return t.forEach(r=>{const i=Ha(r);YP(i,n)<0||(n=i)}),n}function VP(t){return ye.isPseudoElement(t)}function ZP(t){if(!t||!t.nodes)return!1;const e=t.nodes.filter(n=>n.type!=="comment");return e.length===0||e.length===1&&e[0].type==="universal"}function _r(t){return{sourceIndex:t.sourceIndex??0,source:t.source}}function $P(t){const e=[];let n=[];t.each(i=>{if(i.type==="combinator")return e.push(n,[i]),void(n=[]);if(ye.isPseudoElement(i))return e.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=ye.selector({value:"",..._r(i)});o.append(i);const s=ye.pseudo({value:":is",..._r(i)});return s.append(o),void n.push(s)}n.push(i)}}),e.push(n);const r=[];for(let i=0;i<e.length;i++){const o=e[i];o.sort((s,a)=>kA(s)-kA(a)),r.push(...o)}t.removeAll();for(let i=r.length-1;i>=0;i--)r[i].remove(),r[i].parent=t,t.nodes.unshift(r[i])}function kA(t){return ye.isPseudoElement(t)?xA.pseudoElement:xA[t.type]}const xA={universal:0,tag:1,pseudoElement:2,nesting:3,id:4,class:5,attribute:6,pseudo:7,comment:8},XP=1e4;function e2(t,e,n){const r=[],i=t2(e);for(let s=0;s<t.nodes.length;s++){const a=t.nodes[s].clone();{let l=!1;a.walkNesting(()=>(l=!0,!1)),l?a.nodes[0]?.type==="combinator"&&a.prepend(ye.nesting({..._r(a)})):(a.prepend(ye.combinator({value:" ",..._r(a)})),a.prepend(ye.nesting({..._r(a)})))}{const l=new Set;let c=0;a.walkNesting(u=>{const f=u.parent;if(f){if(c++,c*i>XP)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(...CA(e,!0)):u.replaceWith(...CA(e))}});for(const u of l)$P(u)}a.walk(l=>{l.type==="combinator"&&l.value.trim()!==""?(l.rawSpaceAfter=" ",l.rawSpaceBefore=" "):(l.rawSpaceAfter="",l.rawSpaceBefore="")}),r.push(a)}const o=ye.root({value:"",..._r(t)});return r.forEach(s=>{o.append(s)}),o}function t2(t){let e=0;return t.walk(()=>{e++}),e}function CA(t,e=!1){if(e||!n2(t.nodes)){const n=ye.pseudo({value:":is",..._r(t)});return t.nodes.forEach(r=>{n.append(r.clone())}),[n]}return t.nodes[0].nodes.map(n=>n.clone())}function n2(t){return t.length===1&&!t[0].nodes.some(e=>e.type==="combinator"||ye.isPseudoElement(e))}const r2=ye.pseudo({value:":is"});function Dr(t){if(!t||!t.nodes)return;const e=[];let n=[];for(let i=0;i<t.nodes.length;i++)if(t.nodes[i].type!=="combinator")if(ye.isPseudoElement(t.nodes[i]))e.push(n),n=[t.nodes[i]];else{if(t.nodes[i].type==="tag"&&n.find(o=>o.type==="tag")){const o=r2.clone({}),s=t.nodes[i];s.replaceWith(o),o.append(ye.selector({nodes:[s],value:void 0}))}n.push(t.nodes[i])}else e.push(n),e.push([t.nodes[i]]),n=[];e.push(n);const r=[];for(let i=0;i<e.length;i++){const o=e[i];o.sort((s,a)=>s.type==="selector"&&a.type==="selector"&&s.nodes.length&&a.nodes.length?Xn(s.nodes[0])-Xn(a.nodes[0]):s.type==="selector"&&s.nodes.length?Xn(s.nodes[0])-Xn(a):a.type==="selector"&&a.nodes.length?Xn(s)-Xn(a.nodes[0]):Xn(s)-Xn(a));for(let s=0;s<o.length;s++)r.push(o[s])}t.removeAll();for(let i=r.length-1;i>=0;i--)r[i].remove(),r[i].parent=t,t.nodes.unshift(r[i])}function Xn(t){return ye.isPseudoElement(t)?vA.pseudoElement:vA[t.type]}const vA={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function Hr(t){return t&&t.type==="atrule"}function SA(t){return t&&Hr(t)&&t.name==="nest"}function Pr(t){return t&&t.type==="rule"}function i2(t,e){let n,r=t.parent;for(;r;){if(r.type==="rule"||Hr(r)&&r.name==="scope")return;r=r.parent}try{n=ye().astSync(t.selector)}catch(i){return void t.warn(e,`Failed to parse selector : "${t.selector}" with message: "${i instanceof Error?i.message:i}"`)}n&&(n.walkNesting(i=>{const o=i.parent;i.replaceWith(ye.pseudo({value:":scope"})),o&&Dr(o)}),t.selector=n.toString())}function Bn(t){if(!t.nodes.length)return void t.remove();const e=t.nodes.filter(n=>n.type==="comment");e.length===t.nodes.length&&t.replaceWith(...e)}function Ed(t){const e=[],n=[];t.each(r=>{if(IA(r,n.length>0))e.push(r);else{if(r.type==="comment"){let i=r.next();for(;i&&i.type==="comment";)i=i.next();if(IA(i,n.length>0))return void e.push(r)}n.push(r)}}),t.removeAll(),e.forEach(r=>{t.append(r)}),n.forEach(r=>{t.append(r)})}function IA(t,e){return!!t&&(t.type==="decl"||t.type==="atrule"&&t.name.toLowerCase()==="mixin"&&!e)}function qa(t){const e=[];let n="",r=!1,i=0,o=!1,s=!1;for(const a of t)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!==""&&e.push(n.trim()),n="",r=!1):n+=a;return e.push(n.trim()),e}function Ui(t,e){const n=e.index(t);if(n){const r=e.cloneBefore().removeAll().append(e.nodes.slice(0,n));r.raws.semicolon=!0,Bn(r)}e.before(t),e.raws.semicolon=!0}var Rd=["container","document","media","supports","layer","starting-style"];function o2(t,e){var n,r;Ed(e),Ui(t,e),t.params=(n=e.params,r=t.params,qa(n).map(i=>qa(r).map(o=>`${i} and ${o}`).join(", ")).join(", ")),Bn(e)}function s2(t,e){return Rd.includes(t.name)&&t.name===e.name}function a2(t,e,n,r,i,o=0){if(Ed(e),Ui(t,e),t.nodes){const s=e.clone().removeAll().append(t.nodes);t.append(s),Bn(e),r(s,n,i,o)}else Bn(e)}function l2(t){return Rd.includes(t.name)}function c2(t,e){if(e<2)throw new Error("n must be greater than 1");if(t.length<2)throw new Error("s must be greater than 1");if(Math.pow(t.length,e)>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<e;i++)n[i]=0;const r=[];for(;;){const i=[];for(let o=e-1;o>=0;o--){let s=n[o];if(s>=t.length){if(s=0,n[o]=0,o===0)return r;n[o-1]+=1}i[o]=t[s].clone()}r.push(i),n[n.length-1]++}}function u2(t){const e=t.map(r=>ye().astSync(r)).map(r=>Ha(r)),n=e[0];for(let r=1;r<e.length;r++)if(n.a!==e[r].a||n.b!==e[r].b||n.c!==e[r].c)return!1;return!0}function p1(t,e,n){if(t.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=u2(t)||n.noIsPseudoSelector?t.map(o=>ye().astSync(o)):[ye().astSync(`:is(${t.join(",")})`)];const i=[];for(let o=0;o<e.length;o++){let s,a=e[o];{const u=ye().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),ye.nesting()):(d.insertBefore(d.at(0),ye.combinator({value:" "})),d.insertBefore(d.at(0),ye.nesting())),a=u.toString()}let l=[],c=0;if(ye().astSync(a).walkNesting(()=>{c++}),c>1&&r.length>1)l=c2(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*e.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=ye().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=ye().astSync(`:is(${p.toString()})`),g=Ua(p.nodes[0]),A=ff(p.nodes[0]),x=Ua(h),y=ff(h);if(g&&x)return void h.replaceWith(p.clone());if((g||A)&&(x||y)){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&&Dr(C))}if(g){const C=h.parent;return h.replaceWith(p.clone().nodes[0]),void(C&&Dr(C))}if(A){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&Dr(C))}if(f2(h)){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&Dr(C))}if(h2(h)){const C=h.parent;return h.replaceWith(...p.clone().nodes),void(C&&Dr(C))}const b=h.parent;n.noIsPseudoSelector?h.replaceWith(...p.clone().nodes):h.replaceWith(...m.clone({}).nodes),b&&Dr(b)}),i.push(d.toString())}}return i}function Ua(t){return t.type!=="combinator"&&!(t.parent&&t.parent.nodes.length>1)}function ff(t,e=null){return Ua(t)||!t.parent||t.parent.nodes.find(n=>n.type==="combinator")?!1:!(t.parent.nodes.find(n=>n.type==="nesting")&&e&&!ff(e))}function f2(t){if(!t.parent||t.parent.nodes.indexOf(t)!==0)return!1;for(let e=1;e<t.parent.nodes.length;e++)if(t.parent.nodes[e].type==="combinator"&&t.parent.nodes[e].value!==" "&&t.parent.nodes[e].value!==">")return!1;return!0}function h2(t){if(Ua(t))return!0;if(!t.parent)return!1;for(let e=0;e<t.parent.nodes.length;e++)if(t.parent.nodes[e].type!=="nesting"&&(t.parent.nodes[e].prev()||t.parent.nodes[e].next())&&(t.parent.nodes[e].prev()&&t.parent.nodes[e].prev().type!=="combinator"||t.parent.nodes[e].next()&&t.parent.nodes[e].next().type!=="combinator"))return!1;return!0}function d2(t,e,n,r,i,o=0){let s;try{s=p1(e.selectors,qa(t.params),i)}catch(l){return void t.warn(n,`Failed to parse selectors : "${e.selector}" / "${t.params}" with message: "${l instanceof Error?l.message:l}"`)}if(!s.length)return;Ui(t,e);const a=e.clone().removeAll().append(t.nodes);a.raws.semicolon=!0,a.selectors=s,t.replaceWith(a),Bn(e),r(a,n,i,o)}function p2(t){return qa(t.params).every(e=>e.split("&").length>=2&&e.indexOf("|")===-1)}function m2(t,e,n,r){let i;try{i=p1(e.selectors,t.selectors,r)}catch(o){return void t.warn(n,`Failed to parse selectors : "${e.selector}" / "${t.selector}" with message: "${o instanceof Error?o.message:o}"`)}i.length&&(Ed(e),Ui(t,e),t.selectors=i,t.type==="rule"&&e.type==="rule"&&t.selector===e.selector&&t.append(...e.nodes),Bn(e))}function g2(t){return t.selectors.every(e=>e.indexOf("|")===-1)}function ma(t,e,n,r=0){if(r>=512)throw new Error("Maximum nesting depth of 512 exceeded while resolving nested rules.");t.each(i=>{const o=i.parent;SA(i)&&!n.silenceAtNestWarning&&t.warn(e,`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
940
+ Change \`@nest ${i.params} {}\` to \`${i.params} {}\` to migrate to the latest standard.`),Pr(i)&&Pr(o)&&g2(i)?m2(i,o,e,n):SA(i)&&Pr(o)&&p2(i)?d2(i,o,e,ma,n,r+1):Hr(i)&&Pr(o)&&l2(i)?a2(i,o,e,ma,n,r+1):Hr(i)&&Hr(o)&&s2(i,o)&&o2(i,o),"nodes"in i&&i.nodes.length&&ma(i,e,n,r+1)})}const m1=t=>{const e=Object.assign({noIsPseudoSelector:!1,silenceAtNestWarning:!1},t);return{postcssPlugin:"postcss-nesting",Rule(n,{result:r}){ma(n,r,e),n.selector.includes("&")&&i2(n,r)}}};m1.postcss=!0;const EA=ye();function g1(t,e,n,r){let i;try{i=e2(EA.astSync(e),EA.astSync(n))}catch(o){return t.warn(r,`Failed to parse selectors : "${n}" / "${e}" with message: "${o instanceof Error?o.message:o}"`),!1}return!!i&&i.toString()}function A2(t,e){{let r=t.parent;for(;r;){if(r.type==="rule"||Hr(r)&&r.name==="scope")return;r=r.parent}try{let i=!1;if(ye().astSync(t.selector).walkNesting(()=>(i=!0,!1)),!i)return}catch(i){return void t.warn(e,`Failed to parse selector : "${t.selector}" with message: "${i instanceof Error?i.message:i}"`)}}const n=g1(t,t.selector,":scope",e);n&&(t.selector=n)}function y2(t,e,n,r,i=0){if(Ui(t,e),t.nodes){const o=e.clone().removeAll().append(t.nodes);t.append(o),Bn(e),r(o,n,i)}else Bn(e)}function b2(t){return Rd.includes(t.name)}function w2(t,e,n){const r=g1(t,t.selector,e.selector,n);r&&(Ui(t,e),t.selector=r,t.type==="rule"&&e.type==="rule"&&t.selector===e.selector&&t.append(...e.nodes),Bn(e))}function k2(t){return t.selectors.every(e=>e.indexOf("|")===-1)}function hf(t,e,n=0){if(n>=512)throw new Error("Maximum nesting depth of 512 exceeded while resolving nested rules.");t.each(r=>{const i=r.parent;Pr(r)&&Pr(i)&&k2(r)?w2(r,i,e):Hr(r)&&Pr(i)&&b2(r)&&y2(r,i,e,hf,n+1),"nodes"in r&&r.nodes.length&&hf(r,e,n+1)})}const A1=()=>({postcssPlugin:"postcss-nesting",Rule(t,{result:e}){hf(t,e),t.selector.includes("&")&&A2(t,e)},AtRule:{nest(t){throw t.error(`\`@nest\` was removed from the CSS Nesting specification and will be removed from PostCSS Nesting in the next major version.
941
+ Change \`@nest ${t.params} {}\` to \`${t.params} {}\` to migrate to the latest standard.`)}}});A1.postcss=!0;const y1=t=>{const e=Object.assign({edition:"2024-02"},t);switch(e.edition){case"2021":return m1(t);case"2024-02":return A1();default:throw new Error(`Invalid edition: ${e.edition}`)}};y1.postcss=!0;const x2=ye();function Ga(t,e){this.text=t,this.spec=void 0,this.styleAttribute=e||!1}Ga.prototype.parsed=function(){if(this.ast!==void 0)return this.ast;try{this.ast=x2.astSync(this.text)}catch{this.ast=null}return this.ast};Ga.prototype.specificity=function(){if(this.spec)return this.spec;const t=this.parsed(),e=this.styleAttribute;return!t||t.nodes.length===0?(this.spec=[e?1:0,0,0,0],this.spec):(this.spec=b1(t.nodes[0],e),this.spec)};function b1(t,e){const n=[e?1:0,0,0,0];return t.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=b1(s,!1);(!o||C2(a,o)>0)&&(o=a)}if(o)for(let s=0;s<4;s++)n[s]+=o[s]}else n[3]++;break}}}),n}function C2(t,e){for(let n=0;n<4;n++)if(t[n]!==e[n])return t[n]>e[n]?1:-1;return 0}function vl(t,e,n,r,i){this.prop=t,this.value=e,this.selector=n,this.priority=r||0,this.additionalPriority=i||[]}vl.prototype.compareFunc=function(t){const e=[];e.push.apply(e,this.selector.specificity()),e.push.apply(e,this.additionalPriority),e[0]+=this.priority;const n=[];return n.push.apply(n,t.selector.specificity()),n.push.apply(n,t.additionalPriority),n[0]+=t.priority,N2(e,n)};vl.prototype.compare=function(t){return this.compareFunc(t)===1?this:t};vl.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"};const v2=Oe([y1()]);function Nd(t,{strict:e=!1}={}){return v2.process(t,{parser:e?void 0:Xk,from:void 0}).root}function S2(t){const e=t.source&&t.source.start,n=t.source&&t.source.end;return{type:"property",name:t.prop,value:t.value+(t.important?" !important":""),position:{start:{line:e?e.line:1,col:e?e.column:1},end:{line:n?n.line:1,col:n?n.column:1}}}}function RA(t,{strict:e=!1}={}){let n;try{n=Nd(t,{strict:e})}catch(a){if(e)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(S2(h))}if(f.length>0)for(const h of u)r.push([h,f])}}return r}function NA(t,e,n){let r;try{r=Nd(t)}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`
942
+ `+t+`
943
+ `;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(ga(l.slice().reverse())),l=[]));continue}if(a){l.push(u);continue}if(o.has(c)){s.unshift(ga([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;(e.fontFaces&&f||e.mediaQueries&&d||e.containerQueries&&p||e.layers&&m||e.keyFrames&&h||e.pseudos&&g&&k1(g[0],n)||e.preservedSelectors&&g&&g.some(A=>x1(A,e.preservedSelectors)))&&s.unshift(ga([u]))}return s.length===0?!1:`
944
+ `+s.join(`
945
+ `)+`
946
+ `}function w1(t,e,n){const r=" ".repeat(e);switch(t.raws||(t.raws={}),t.type){case"rule":case"atrule":t.raws.before=n?"":`
947
+ `+r,t.nodes?(t.raws.between=" ",t.raws.after=`
948
+ `+r,t.raws.semicolon=!0,t.nodes.forEach(i=>w1(i,e+1,!1))):t.raws.between="";break;case"decl":t.raws.before=`
949
+ `+r,t.raws.between=": ";break;case"comment":t.raws.before=n?"":`
950
+ `+r;break}}function ga(t){const e=Oe.root();return e.raws.semicolon=!0,t.forEach((n,r)=>{const i=n.clone();w1(i,0,r===0),e.append(i)}),e.toString()}function I2(t){if(typeof t=="string")return null;let e=typeof t;t===null?e="null":e==="object"&&(e=t.constructor&&t.constructor.name||"object");const n=t 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 "+e+"."+n)}function E2(t,e){const n=e.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp("(^|[^:]):("+n.join("|")+")(?![\\w-])","i"),i=Xk(t);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():t}function k1(t,e){return e.find(function(n){return t.indexOf(":"+n)>-1})}function x1(t,e){if(!e||e.length===0)return!1;for(let n=0;n<e.length;n++){const r=e[n];if(t===r||t.indexOf(r)!==-1)return!0}return!1}function R2(t,e,n,r){let i;try{i=Nd(t)}catch{return""}const o=[];for(const s of i.nodes){if(s.type!=="rule"){o.push(s);continue}if(n.preservePseudos&&k1(s.selectors[0],r)){o.push(s);continue}if(n.preservedSelectors&&s.selectors.some(l=>x1(l,n.preservedSelectors))){o.push(s);continue}const a=s.selectors.filter(l=>!e.has(l));if(a.length>0){const l=s.clone();l.selectors=a,o.push(l)}}return o.length===0?"":ga(o)}function N2(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return t.length-e.length}function TA(t){const e=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:""},t);return e.webResources=e.webResources||{},e}const T2=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,D2=/^JUICE_STYLE_(\d+)_$/,O2=function(t,e){return t.replace(T2,function(n,r,i,o){return i.indexOf("<")===-1||i.indexOf("<![CDATA[")>-1?n:(e.push(i),r+"JUICE_STYLE_"+(e.length-1)+"_"+o)})},M2=function(t,e){t("style").each(function(){const n=this.children[0],r=this.children.length===1&&n.type==="text"&&D2.exec(n.data);r&&(n.data=e[r[1]])})},B2=function(t,e,n){const{xmlMode:r,...i}=e;if(e=Object.assign({xml:{decodeEntities:!1,xmlMode:r}},i),t=n(t),!r)return fg(t,e);const o=[],s=fg(O2(t,o),e);return M2(s,o),s},F2=function(){const t=[];return{encodeEntities:function(r){const i=Ds.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 t.push(a),"JUICE_CODE_BLOCK_"+(t.length-1)+"_"})}),r},decodeEntities:function(r){for(let i=0;i<t.length;i++){const o=new RegExp("JUICE_CODE_BLOCK_"+i+'_(="")?',"gi");r=r.replace(o,function(){return t[i]})}return r}}};function Ds(t,e,n,r){const i=I2(t);if(i)throw i;const o=F2(),s=B2(t,e,o.encodeEntities),a=[s];a.push.apply(a,r);const l=n.apply(void 0,a)||s;return e&&e.xmlMode?o.decodeEntities(l.xml()):o.decodeEntities(l.html())}Ds.codeBlocks={EJS:{start:"<%",end:"%>"},HBS:{start:"{{",end:"}}"},FTL:{start:"<#",end:">"},FTL_CLOSE:{start:"</#",end:">"},FTL_MACRO:{start:"<@",end:">"},FTL_MACRO_CLOSE:{start:"</@",end:">"}};const _2=[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 C1(t){return t===0||t>=55296&&t<=57343||t>1114111}function P2(t){return C1(t)?65533:t>=128&&t<=159&&_2[t-128]||t}function L2(t){return C1(t)?65533:t}function z2(t){return t-1>>>0<127||t-160>>>0<55136?String.fromCharCode(t):String.fromCodePoint(P2(t))}const $t=(()=>{const t=new Uint8Array(127);let e=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(t[n]=e++);return t})();function W2(t,e,n,r,i,o){const a=t.length,l=o*90;let c=0;const u=()=>{const R=$t[t.charCodeAt(c++)];return R<o?R:R*91-l+$t[t.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(R,S){let M=0,z=S;const W=S+R;for(;z<W;){const L=$t[t.charCodeAt(c++)];if(L<89)M+=L,h[z++]=M;else if(L===89){let D=$t[t.charCodeAt(c++)]+2;for(;D--;)h[z++]=++M}else{const D=$t[t.charCodeAt(c++)];M+=89+(D<90?D*91+$t[t.charCodeAt(c++)]:$t[t.charCodeAt(c++)]*8281+$t[t.charCodeAt(c++)]*91+$t[t.charCodeAt(c++)]),h[z++]=M}}}g(r,0),g(f,o);const A=new Int32Array(i*2);let x=0,y=0;function b(R,S){for(let M=0;M<R;M++){const z=S+M,W=u(),L=u();A[y*2]=W,A[y*2+1]=L,y+=1,p[z]=x;const D=(h[W]<0?m[W]:1)+(h[L]<0?m[L]:1);m[z]=D,x+=D}}b(i-o+r,o+f),b(o-r,r);const C=new Uint16Array(x);let w=0;for(let R=0;R<y;R++)for(let S=0;S<2;S++){const M=A[R*2+S],z=h[M];if(z<0){let W=p[M];const L=W+m[M];for(;W<L;)C[w++]=C[W++]}else C[w++]=z}const v=new Uint16Array(e);let T=0;for(;c<a;){let R=$t[t.charCodeAt(c++)];R>=o&&(R=R*91-l+$t[t.charCodeAt(c++)]);const S=h[R];if(S<0){let M=p[R];const z=M+m[R];for(;M<z;)v[T++]=C[M++]}else v[T++]=S}return v}const j2=W2("!}.&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 Ue;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.FLAG13=8192]="FLAG13",t[t.BRANCH_LENGTH=8064]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE",t[t.VALUE_MASK=8191]="VALUE_MASK"})(Ue||(Ue={}));var _e;(function(t){t[t.AMP=38]="AMP",t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_X=120]="LOWER_X"})(_e||(_e={}));const Ya=32,v1=21,S1=2097151,df=2047;let I1=0;function E1(t){const e=t>>>v1;return e===df?I1:e}function R1(t){return t-_e.ZERO>>>0<=9}function K2(t){return(t|Ya)-_e.LOWER_A>>>0<=5}function N1(t){return(t|Ya)-_e.LOWER_A>>>0<=25}function J2(t){return t===_e.EQUALS||N1(t)||R1(t)}var DA;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(DA||(DA={}));var Io;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Io||(Io={}));function Q2(t,e,n,r){const i=(e&Ue.BRANCH_LENGTH)>>7,o=e&Ue.JUMP_TABLE;if(o){if(i===0)return r===o?n:-1;const l=r-o;if(l>>>0>=i)return-1;const c=t[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=t[n+(l>>1)]>>((l&1)<<3)&255;if(u===r){const f=n+s+l;return a+t[f]&65535}if(u>r)return-1}return-1}function OA(t,e,n){return n===1?String.fromCharCode(t[e]&Ue.VALUE_MASK):n===2?String.fromCharCode(t[e+1]):String.fromCharCode(t[e+1],t[e+2])}function T1(t,e,n){let r=e+1,i=0,o=r;if(r<n&&(t.charCodeAt(r)|Ya)===_e.LOWER_X)for(r+=1,o=r;r<n;){const a=t.charCodeAt(r);if(R1(a))i=i*16+(a-_e.ZERO);else if(K2(a))i=i*16+((a|Ya)-_e.LOWER_A+10);else break;r+=1}else for(;r<n;){const a=t.charCodeAt(r)-_e.ZERO;if(a>>>0>9)break;i=i*10+a,r+=1}if(r===o)return 0;r<n&&t.charCodeAt(r)===_e.SEMI&&(r+=1),i>1114111&&(i=1114112);let s=r-e;return s>=df&&(I1=s,s=df),s<<v1|i}function H2(t,e,n){const r=j2;let i=t.indexOf("&");if(i<0)return t;const o=t.length;let s=0,a="";const l=r[0],c=l&Ue.JUMP_TABLE,u=(l&Ue.BRANCH_LENGTH)>>7;do{const f=i+1,d=t.charCodeAt(f);let h,p;if(d===_e.NUM){const m=T1(t,f,o);h=E1(m),e&&h>0&&t.charCodeAt(f+h-1)!==_e.SEMI&&(h=0),p=h===0?"":z2(m&S1)}else if(N1(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,y=g<0?0:r[g],b=f+1;e:for(;b<o;){for(;(y&(Ue.VALUE_LENGTH|Ue.FLAG13))===0&&(y&Ue.JUMP_TABLE)!==0;){const T=y&Ue.JUMP_TABLE,R=(y&Ue.BRANCH_LENGTH)>>7;if(R===0){if(t.charCodeAt(b)!==T)break e;g+=1}else{const S=t.charCodeAt(b)-T;if(S>>>0>=R)break e;const M=r[g+1+S];if(M===0)break e;g=g+R+M&65535}if(y=r[g],b+=1,b>=o)break e}if((y&(Ue.VALUE_LENGTH|Ue.FLAG13))===Ue.FLAG13){const T=(y&Ue.BRANCH_LENGTH)>>7;if(t.charCodeAt(b)!==(y&Ue.JUMP_TABLE))break;b+=1;const R=T-1;let S=g+1,M=0;for(;M+1<R;M+=2){const z=r[S];if(t.charCodeAt(b)!==(z&255)||(b+=1,t.charCodeAt(b)!==(z>>8&255)))break e;b+=1,S+=1}if(M<R){if(t.charCodeAt(b)!==(r[S]&255))break;b+=1}g+=1+(T>>1),y=r[g];continue}const C=y>>>14,w=t.charCodeAt(b);if(C!==0){if(w===_e.SEMI){h=b-f+1,p=C===1?String.fromCharCode(y&Ue.VALUE_MASK):OA(r,g,C);break}if(!e&&(y&Ue.FLAG13)===0&&(h=b-f,A=g,x=C),C===1)break}const v=Q2(r,y,g+(C||1),w);if(v<0)break;g=v,y=r[g],b+=1}if(p===""){const C=y>>>14;C!==0&&!e&&(y&Ue.FLAG13)===0&&(h=b-f,A=g,x=C),h>0&&(p=OA(r,A,x))}}else h=0,p="";h===0||n&&d!==_e.NUM&&t.charCodeAt(f+h-1)!==_e.SEMI&&f+h<o&&J2(t.charCodeAt(f+h))?i=f:(s<i&&(a+=t.slice(s,i)),a+=p,i=s=f+h),t.charCodeAt(i)!==_e.AMP&&(i=t.indexOf("&",i))}while(i>=0);return a+t.slice(s)}function q2(t,e=Io.Legacy){return H2(t,e===Io.Strict,e===Io.Attribute)}function U2(t){let e=t.indexOf("&");if(e<0)return t;let n=0,r="";do{const i=e+1;let o=0,s="";const a=t.charCodeAt(i);if(a===_e.NUM){const l=T1(t,i,t.length);if(o=E1(l),o===0||t.charCodeAt(i+o-1)!==_e.SEMI)o=0;else{const c=l&S1;s=c-1>>>0<55295?String.fromCharCode(c):String.fromCodePoint(L2(c))}}else switch(a){case 108:case 103:{t.charCodeAt(i+1)===116&&t.charCodeAt(i+2)===_e.SEMI&&(o=3,s=a===108?"<":">");break}case 97:{const l=t.charCodeAt(i+1);l===109&&t.charCodeAt(i+2)===112&&t.charCodeAt(i+3)===_e.SEMI?(o=4,s="&"):l===112&&t.charCodeAt(i+2)===111&&t.charCodeAt(i+3)===115&&t.charCodeAt(i+4)===_e.SEMI&&(o=5,s="'");break}case 113:{t.charCodeAt(i+1)===117&&t.charCodeAt(i+2)===111&&t.charCodeAt(i+3)===116&&t.charCodeAt(i+4)===_e.SEMI&&(o=5,s='"');break}}o>0?(n<e&&(r+=t.slice(n,e)),r+=s,e=n=i+o):e=i,e=t.charCodeAt(e)===_e.AMP?e:t.indexOf("&",e)}while(e>=0);return r+t.slice(n)}var Va;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Va||(Va={}));var MA;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(MA||(MA={}));function G2(t,e=Va.XML){if((typeof e=="number"?e:e.level)===Va.HTML){const r=typeof e=="object"?e.mode:void 0;return q2(t,r)}return U2(t)}function BA(t){if(isNaN(t))return NaN;const e=String(+t).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[+e.pop()+i*10]||"")+r;return Array(+e.join("")+1).join("M")+r}function FA(t){let e="",n;for(;t>0;)n=(t-1)%26,e=String.fromCharCode(65+n)+e,t=(t-n)/26|0;return e||void 0}const Y2=t=>{let e="";do e=(Math.random()+1).toString(36).substring(2);while(t.indexOf(e)!==-1);return e},V2=t=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(r==="("){e.push(n);continue}if(r!==")")continue;const i=e.pop();if(i===void 0)continue;const o=t.slice(i+1,n);if(o.indexOf("(")!==-1||o.indexOf(")")!==-1)continue;let s=i-1;for(;s>=0&&/\s/.test(t[s]);)s--;let a=s;for(;a>=0&&/[a-z-]/i.test(t[a]);)a--;if(a++,a>s)continue;const l=o.indexOf(",");return{match:t.slice(a,n+1),name:t.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},Z2=(t,e)=>{const n=[],r=Y2(e);let i;for(;(i=V2(e))!==null;){const o=`${n.length}`;if(i.name.toLowerCase()=="var"){const a=D1(t,i.arg);if(a){e=e.replace(i.match,a);continue}if(i.fallback){e=e.replace(i.match,i.fallback);continue}}const s=`${r}${o.padStart(5,"-")}`;e=e.replace(i.match,s),n.push({placeholder:s,replace:i.match})}for(let o=n.length-1;o>=0;o--){const s=n[o];e=e.replace(s.placeholder,s.replace)}return e},D1=(t,e)=>{for(;t;){if(t.styleProps&&e in t.styleProps)return t.styleProps[e].value;t=t.pseudoElementParent||t.parent}};function $2(t){t.ignoredPseudos=["hover","active","focus","visited","link","first-letter","first-line","marker","selection","placeholder"],t.widthElements=["TABLE","TD","TH","IMG"],t.heightElements=["TABLE","TD","TH","IMG"],t.tableElements=["TABLE","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],t.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],t.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},t.excludedProperties=[],t.juiceDocument=a,t.inlineDocument=e;function e(p,m,g){g=TA(g);const A=RA(m),x=[];let y="style",b=!1;const C=g.removeInlinedSelectors?new Set:null;g.styleAttributeName&&(y=g.styleAttributeName);function w(W){let L=W[0];const D=W[1],Z=new Ga(L),q=Z.parsed();if(!q||q.nodes.length===0)return;const ne=q.nodes[0],Ce=o(ne);let I=!1;if(ne.walkPseudos(k=>{const F=k.value.replace(/^:+/,"");t.ignoredPseudos.indexOf(F)>=0&&(I=!0)}),I)return;if(Ce){const k=ne.clone();k.walkPseudos(F=>{s(F)&&F.remove()}),L=k.toString()}let _;try{_=p(L)}catch{return}let E=!1;_.each(function(){let k=this;if(k.name&&t.nonVisualElements.indexOf(k.name.toUpperCase())>=0)return;E=!0;let F=g.inlineDuplicateProperties;const N=p(k).attr("data-juice-duplicates");N!==void 0&&(F=N!=="false");let K=g.preserveImportant;const Y=p(k).attr("data-juice-important");if(Y!==void 0&&(K=Y!=="false"),Ce){const H="pseudo"+Ce;let re=k[H];re||(re=k[H]=p("<span />").get(0),re.pseudoElementType=Ce,re.pseudoElementParent=k,k[H]=re),k=re}if(!k.styleProps){if(k.styleProps={},k.preserveImportant=K,p(k).attr(y)){const H=p(k).attr(y),V="* { "+(g.decodeStyleAttributes?G2(H):H)+" } ";let G;try{G=RA(V,{strict:!0})[0][1]}catch{k.rawStyleAttribute=H.trim()}G&&U(G,new Ga("<style>",!0))}x.push(k)}function U(H,re){for(let V=0,G=H.length;V<G;V++)if(H[V].type=="property"){const Ae=H[V].name;let $e=H[V].value;(/^counter-(reset|set|increment)$/.test(Ae)||Ae==="content"&&/counter\s*\(/i.test($e))&&(b=!0);const tt=$e.match(/!important$/)!==null;tt&&!K&&($e=n($e));const Ke=[H[V].position.start.line,H[V].position.start.col],Pe=new vl(Ae,$e,re,tt?2:0,Ke),We=k.styleProps[Ae];if(t.excludedProperties.indexOf(Ae)<0)if(F)if(We)if(We.selector===re)Pe.nextProp=We,k.styleProps[Ae]=Pe;else{let vt=We;for(;vt.nextProp;)vt=vt.nextProp;vt.nextProp=Pe}else k.styleProps[Ae]=Pe;else(We&&We.compare(Pe)===Pe||!We)&&(We&&We.selector!==re?delete k.styleProps[Ae]:We&&(Pe.nextProp=We),k.styleProps[Ae]=Pe)}}U(D,Z)}),E&&C&&C.add(W[0])}function v(W){const L=[];Object.keys(W.styleProps).forEach(function(Z){let q=W.styleProps[Z];for(;typeof q<"u";)L.push(q),q=q.nextProp}),L.sort(function(Z,q){return Z.compareFunc(q)});let D=L.filter(function(Z){return g.resolveCSSVariables&&Z.prop.indexOf("--")===0?!1:Z.prop!=="content"}).map(function(Z){return g.resolveCSSVariables&&(Z.value=Z2(W,Z.value)),Z.prop+": "+Z.value.replace(/["]/g,"'")+";"}).join(" ");D&&W.rawStyleAttribute&&(D+=" "+W.rawStyleAttribute),D&&p(W).attr(y,D)}function T(W){let L=[];const D=E=>E.pseudoElementParent||E.parent,Z=(E,k)=>{let F=E.styleProps&&E.styleProps[k],N=F;for(;F;)N=F.compare(N),F=F.nextProp;return N?n(N.value):null},q=(E,k)=>{const F=E.trim().split(/\s+/),N=[];for(let K=0;K<F.length;K++){if(F[K]==="none")continue;const Y=parseInt(F[K+1],10);N.push([F[K],isNaN(Y)?k:Y]),isNaN(Y)||K++}return N},ne=(E,k)=>{for(let F=E.length-1;F>=0;F--)if(E[F].name===k)return E[F];return null},Ce=(E,k,F,N)=>{const K=ne(k,F);K&&(K.origin===E||D(K.origin)===D(E))&&k.splice(k.lastIndexOf(K),1);const Y={name:F,origin:E,value:N};return k.push(Y),Y},I=(E,k,F)=>{const N=k.map(V=>Object.assign({},V));F.forEach(V=>{N.some(G=>G.name===V.name)||N.push(Object.assign({},V))}),L.forEach(V=>{const G=N.find(Ae=>Ae.name===V.name&&Ae.origin===V.origin);G&&(G.value=V.value)});const K=Z(E,"counter-reset");K&&q(K,0).forEach(([V,G])=>Ce(E,N,V,G));const Y=Z(E,"counter-increment");Y&&q(Y,1).forEach(([V,G])=>{(ne(N,V)||Ce(E,N,V,0)).value+=G});const U=Z(E,"counter-set");U&&q(U,0).forEach(([V,G])=>{(ne(N,V)||Ce(E,N,V,0)).value=G}),E.counters=N,L=N;const H=[E.pseudobefore].concat((E.children||[]).filter(V=>V.type==="tag"||V.type==="script"||V.type==="style")).concat(E.pseudoafter).filter(Boolean);let re=[];return H.forEach(V=>{re=I(V,N,re)}),N};let _=[];W.root().get(0).children.filter(E=>E.type==="tag").forEach(E=>{_=I(E,[],_)})}function R(W){if(W.pseudoElementType&&W.styleProps.content){const L=i(W);L.img?(W.name="img",p(W).attr("src",L.img)):p(W).text(L);const D=W.pseudoElementParent;W.pseudoElementType==="before"?p(D).prepend(W):p(D).append(W)}}function S(W,L){if(!W.name)return;const D=W.name.toUpperCase();if(t[L+"Elements"].indexOf(D)>-1){for(const Z in W.styleProps)if(W.styleProps[Z].prop===L){let q=W.styleProps[Z].value;if(W.preserveImportant&&(q=n(q)),q.match(/(px|auto)/)){const ne=q.replace("px","");p(W).attr(L,ne);return}if(t.tableElements.indexOf(D)>-1&&q.match(/\%/)){p(W).attr(L,q);return}}}}function M(W){return W.indexOf("url(")!==0?W:W.replace(/^url\((["'])?([^"']+)\1\)$/,"$2")}function z(W){if(!W.name)return;const L=W.name.toUpperCase(),D=Object.keys(t.styleToAttribute);if(t.tableElements.indexOf(L)>-1){for(const Z in W.styleProps)if(D.indexOf(W.styleProps[Z].prop)>-1){const q=t.styleToAttribute[W.styleProps[Z].prop];let ne=W.styleProps[Z].value;if(W.preserveImportant&&(ne=n(ne)),q==="background"&&(ne=M(ne)),/(linear|radial)-gradient\(/i.test(ne))continue;p(W).attr(q,ne)}}}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&&(b&&T(p),x.forEach(R)),g.applyWidthAttributes&&x.forEach(function(W){S(W,"width")}),g.applyHeightAttributes&&x.forEach(function(W){S(W,"height")}),g.applyAttributesTableElements&&x.forEach(z),g.insertPreservedExtraCss&&g.extraCss){const W=NA(g.extraCss,{mediaQueries:g.preserveMediaQueries,containerQueries:g.preserveContainerQueries,layers:g.preserveLayers,fontFaces:g.preserveFontFaces,keyFrames:g.preserveKeyFrames,preservedSelectors:g.preservedSelectors});if(W){let L=null;g.insertPreservedExtraCss!==!0?L=p(g.insertPreservedExtraCss):(L=p("head"),L.length||(L=p("body")),L.length||(L=p.root())),L.first().append("<style>"+W+"</style>")}}return C}function n(p){return p.replace(/\s*!important$/,"")}function r(p,m){switch(m){case"lower-roman":return BA(p).toLowerCase();case"upper-roman":return BA(p);case"lower-latin":case"lower-alpha":return FA(p).toLowerCase();case"upper-latin":case"upper-alpha":return FA(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 y=0;y<x.length;y++){if(x[y]==="")continue;const b=x[y].match(/var\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(b){const v=D1(p,b[1])||b[2];A.push(v.replace(/^['"]|['"]$/g,""));continue}const C=x[y].match(/counter\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(C){const v=(p.counters||[]).filter(T=>T.name===C[1]).pop();A.push(r(v?v.value:0,C[3]));continue}const w=x[y].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[y])}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=TA(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+=`
951
+ `+m.extraCss;const x=e(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=t.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(E2(A.css,g))})}function u(p){const m=p.childNodes;if(m.length===1&&m[0].type==="text"){const b=m[0];return{css:b.data,set:C=>{b.data=C}}}const g=m.filter(b=>b.type==="cdata"),A=m.every(b=>b.type==="cdata"||b.type==="text"&&/^\s*(\/\*|\*\/)?\s*$/.test(b.data));if(g.length!==1||!A||g[0].childNodes.length!==1)return null;const x=g[0].childNodes[0],y=/^\s*\*\//.test(x.data)&&/\/\*\s*$/.test(x.data);return{css:y?x.data.replace(/^\s*\*\//,"").replace(/\/\*\s*$/,""):x.data,set:b=>{x.data=y?"*/"+b+"/*":b}}}function f(p,m,g,A){p("style").each(function(){const y=this,b=u(y);if(!b||A&&A.has(y))return;const C=R2(b.css,m,g,t.ignoredPseudos);C&&C.trim()?b.set(C):p(y).remove()})}function d(p,m){const g=[];return p("style").each(function(){const x=this,y=u(x);if(!y){m.removeStyleTags&&p(x).remove();return}if(m.applyStyleTags&&p(x).attr("data-embed")===void 0&&g.push(y.css),m.removeStyleTags&&p(x).attr("data-embed")===void 0){const b=NA(y.css,{mediaQueries:m.preserveMediaQueries,containerQueries:m.preserveContainerQueries,layers:m.preserveLayers,fontFaces:m.preserveFontFaces,keyFrames:m.preserveKeyFrames,pseudos:m.preservePseudos,preservedSelectors:m.preservedSelectors},t.ignoredPseudos);b?y.set(b):p(x).remove()}p(x).removeAttr("data-embed")}),g}function h(p,m){return d(p,m).join(`
952
+ `)}return t}const qo=$2(function(t,e){return Ds(t,{xmlMode:e&&e.xmlMode},X2,[e])}),X2=function(t,e){return qo.juiceDocument(t,e)};qo.inlineContent=function(t,e,n){return Ds(t,{xmlMode:n&&n.xmlMode},qo.inlineDocument,[e,n])};qo.codeBlocks=Ds.codeBlocks;const _A={"--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 PA(t){return["max-width: 100%","margin: 0","padding: 10px 4px 30px",`background: ${t.background}`,"box-sizing: border-box",`font-family: ${t.fontFamily}`,"font-size: 16px",`color: ${t.color}`,"overflow-wrap: break-word","word-break: break-word",`line-height: ${t.lineHeight??"1.84"}`,`letter-spacing: ${t.letterSpacing??"0.012em"}`,"-webkit-text-size-adjust: 100%"].join("; ")}function LA(t){return["margin-top: 32px","text-align: center","font-size: 12px","line-height: 1.6","letter-spacing: 0.08em",`color: ${t}`].join("; ")}const zA={default:{name:"sage-journal",account:"default",editorVars:{..._A,"--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:PA({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:LA("#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:{..._A,"--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:PA({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:LA("#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 WA(t){const e={};for(const n of Object.keys(t))t[n]!==void 0&&(e[n]=t[n]);return e}function ZL(t,e){const n=zA[t]??zA.default;if(!e)return n;const r=e.editorVars&&Object.keys(e.editorVars).length>0,i=e.exportTheme&&Object.keys(WA(e.exportTheme)).length>0;return{...n,editorVars:r?{...n.editorVars,...e.editorVars}:n.editorVars,exportTheme:i?{...n.exportTheme,...WA(e.exportTheme)}:n.exportTheme}}function eL(t,e){return[Object.entries(t).filter(([r])=>/^--[a-z0-9-_]+$/i.test(r)).map(([r,i])=>`${r}: ${i};`).join(`
953
+ `),`--wx-font-family: ${e.fontFamily};`,`--wx-body-color: ${e.bodyColor};`,`--wx-muted-color: ${e.mutedColor};`,`--wx-h2-color: ${e.h2Color};`,`--wx-h3-color: ${e.h3Color};`,`--wx-brand-ink: ${e.primaryColor};`,`--wx-brand-accent: ${t["--brand"]??"#ca6093"};`,`--wx-divider-color: ${e.dividerColor};`,`--wx-blockquote-border: ${e.blockquoteBorderColor};`,`--wx-body-line-height: ${e.bodyLineHeight};`,`--wx-body-letter-spacing: ${e.bodyLetterSpacing};`,`--wx-soft-surface: ${t["--bg-warm"]??"#faf8f9"};`].filter(Boolean).join(`
954
+ `)}function tL(t,e){return`
955
+ .milkdown .editor {
956
+ ${eL(t,e)}
957
+ ${e.containerStyle};
958
+ ${e.bodyFontSize?`font-size: ${e.bodyFontSize};`:""}
959
+ }
960
+ .milkdown .editor [data-wechat-node="footer"] {
961
+ ${e.footerStyle};
962
+ }
963
+ .milkdown .editor p {
964
+ ${e.bodyFontSize?`font-size: ${e.bodyFontSize};`:""}
965
+ ${e.bodyParagraphSpacing?`margin-bottom: ${e.bodyParagraphSpacing};`:""}
966
+ ${e.bodyLineHeight?`line-height: ${e.bodyLineHeight};`:""}
967
+ ${e.bodyLetterSpacing?`letter-spacing: ${e.bodyLetterSpacing};`:""}
968
+ ${e.bodyColor?`color: ${e.bodyColor};`:""}
969
+ }
970
+ `}const nL=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"]),rL=new Set(["script","style","iframe","object","embed","form","button","input","textarea","select","link","meta","svg","math","canvas","template","noscript","video","audio","source"]),iL=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"]),oL=new Set(["block","inline","inline-block","list-item","table","table-row","table-cell","table-row-group","table-header-group","none"]);function be(t,e){t.dataset.wechatNode=e}function mr(t,e){const n=t.ownerDocument.createElement(e);for(const r of Array.from(t.attributes))n.setAttribute(r.name,r.value);for(;t.firstChild;)n.appendChild(t.firstChild);return t.replaceWith(n),n}function sL(t){return/^(?:https?:)?\/\//i.test(t)}function aL(t,e){return Array.from(t.childNodes).every(n=>n===e?!0:n.nodeType===3&&!(n.nodeValue??"").trim())}const lL={kind:"image",selector:"img",finalizeSelector:"figure, figcaption",async prepare(t,e){be(t,"image");const n=t.getAttribute("src");n&&t.setAttribute("data-src",n);const r=t.parentElement,i=!!r&&r.tagName.toLowerCase()==="p"&&aL(r,t),o=r===e.root;if(!r||!i&&!o)return;const s=t.getAttribute("ratio"),a=s?Number(s):NaN,l=t.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("图片原始宽度为空");t.style.width=`${Math.min(c,1)*100}%`,t.style.maxWidth=`${d.naturalWidth*c}px`,t.style.height="auto"}catch(p){if(e.strictImageDecode??!0)throw new Error(`无法读取缩放图片的原始尺寸:${t.getAttribute("title")||"无图注"}`,{cause:p});t.style.width=`${Math.min(c,1)*100}%`,t.style.height="auto"}}const u=e.document.createElement("figure");be(u,"image-block"),i?r.replaceWith(u):t.replaceWith(u),u.appendChild(t);const f=(t.getAttribute("caption")||t.getAttribute("title")||"").trim();if(t.removeAttribute("title"),t.removeAttribute("caption"),f){const d=e.document.createElement("figcaption");be(d,"image-caption"),d.textContent=f,u.appendChild(d)}},finalize(t){const e=t.tagName.toLowerCase();e==="figure"&&mr(t,"section"),e==="figcaption"&&mr(t,"p")}},cL={kind:"code-block",selector:"pre",prepare(t,e){be(t,"code-block-body");const n=t.querySelector("code");n&&be(n,"code-block-code");const r=e.document.createElement("section");be(r,"code-block"),t.replaceWith(r);const i=t.getAttribute("data-language")?.trim();if(i){const o=e.document.createElement("p");be(o,"code-language"),o.textContent=i,r.appendChild(o)}r.appendChild(t)}},uL={kind:"inline-code",selector:"code:not(pre code)",prepare(t){be(t,"inline-code")},finalize(t){mr(t,"span")}},fL={kind:"heading",selector:"h1, h2, h3, h4, h5, h6",prepare(t,e){if(be(t,`heading-${t.tagName.slice(1)}`),t.tagName.toLowerCase()==="h2"&&e.structure){const n=e.document.createElement("span");for(be(n,"heading-text");t.firstChild;)n.appendChild(t.firstChild);if(t.appendChild(n),e.structure.numberedHeadings){const r=e.document.createElement("span");be(r,"heading-number"),r.textContent=String(Array.from(e.root.querySelectorAll("h2")).indexOf(t)+1).padStart(2,"0"),t.prepend(r)}if(e.structure.headingLabel){const r=e.document.createElement("span");be(r,"heading-label"),r.textContent=e.structure.headingLabel,t.prepend(r)}}},finalize(t){mr(t,"section")}},hL={kind:"paragraph",selector:"p",prepare(t){t.dataset.wechatNode||be(t,"paragraph")}},dL={kind:"emphasis",selector:"strong, b, em, i, s, del, u, mark",prepare(t){be(t,t.tagName.toLowerCase())},finalize(t){t.tagName.toLowerCase()==="mark"&&mr(t,"span")}},pL={kind:"blockquote",selector:"blockquote",prepare(t,e){if(be(t,"blockquote"),e.structure?.quoteLabel){const n=e.document.createElement("p");be(n,"quote-label"),n.textContent=e.structure.quoteLabel,t.prepend(n)}},finalize(t){mr(t,"section")}};function jA(t){const e=t.trim();if(!e)return"";try{const n=new URL(e);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 e.replace(/\/+$/,"")||e}}function mL(t,e,n){const r=jA(t),i=n.find(s=>jA(s.url)===r);if(i)return i;const o={index:n.length+1,text:e.trim()||t,url:t};return n.push(o),o}const gL={kind:"link",selector:"a",prepare(t,e){const n=t.getAttribute("href")?.trim()??"";if(!sL(n)){be(t,"internal-link");return}const r=mL(n,t.textContent?.trim()||n,e.references);be(t,"external-link");const i=e.document.createElement("span");be(i,"link-marker"),i.textContent=`[${r.index}]`,t.after(i)},finalize(t){(t.dataset.wechatNode==="external-link"||t.getAttribute("href")?.startsWith("#"))&&mr(t,"span")}},AL={kind:"list",selector:"ul, ol, li",prepare(t,e){const n=t.tagName.toLowerCase();if(n==="ul"&&be(t,"bullet-list"),n==="ol"&&be(t,"ordered-list"),n!=="li")return;const r=t.getAttribute("data-item-type")==="task";if(be(t,r?"task-list-item":"list-item"),!r)return;const i=e.document.createElement("span");be(i,"task-marker"),i.textContent=t.getAttribute("data-checked")==="true"?"☑":"☐",(t.querySelector(":scope > p")??t).prepend(i)}},yL={kind:"table",selector:"table, thead, tbody, tr, th, td",prepare(t){be(t,t.tagName.toLowerCase())}},bL={kind:"divider",selector:"hr",prepare(t){be(t,"divider")},finalize(t){mr(t,"section")}},wL={kind:"hard-break",selector:"br",prepare(t){be(t,"hard-break")}},kL={kind:"article",selector:".zzhub-wechat-article",prepare(t,e){if(e.references.length>0){const n=e.document.createElement("section");be(n,"references");const r=e.document.createElement("p");be(r,"references-title"),r.textContent="相关链接",n.appendChild(r);const i=e.document.createElement("ol");be(i,"references-list");for(const o of e.references){const s=e.document.createElement("li");be(s,"reference-item"),s.textContent=`[${o.index}] ${o.text}: ${o.url}`,i.appendChild(s)}n.appendChild(i),e.root.appendChild(n)}if(e.theme.footerText){const n=e.document.createElement("section");be(n,"footer");const r=e.document.createElement("p");be(r,"footer-text"),r.textContent=e.theme.footerText,n.appendChild(r),e.root.appendChild(n)}}},xL=[lL,cL,uL,fL,hL,dL,pL,gL,AL,yL,bL,wL,kL];function CL(t={}){const e=xL.map(r=>t[r.kind]??r),n=t.extraRenderers??[];return[...e,...n]}async function KA(t,e,n){for(const r of e){const i=r[t];if(!i)continue;const o=t==="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 vL(t){return!t?.numberedHeadings&&!t?.headingLabel&&!t?.quoteLabel?"":`
971
+ .milkdown .editor [data-wechat-node="heading-number"],
972
+ .milkdown .editor [data-wechat-node="heading-label"] {
973
+ margin-right: 0.3em;
974
+ opacity: 0.7;
975
+ font-weight: 600;
976
+ }
977
+ .milkdown .editor [data-wechat-node="quote-label"] {
978
+ margin: 0 0 6px;
979
+ font-size: 11px;
980
+ font-weight: 600;
981
+ letter-spacing: 0.05em;
982
+ color: var(--wx-brand-ink, var(--wx-brand-accent, #ca6093));
983
+ text-transform: uppercase;
984
+ }
985
+ `}function JA(t){return new DOMParser().parseFromString(`<!doctype html><html><body>${t}</body></html>`,"text/html")}const SL=["top","right","bottom","left"];function IL(t){const e=t.style,n=SL.map(s=>({side:s,width:e.getPropertyValue(`border-${s}-width`),style:e.getPropertyValue(`border-${s}-style`),color:e.getPropertyValue(`border-${s}-color`)})),r=s=>s.style==="none"||s.style==="hidden",i=!!e.getPropertyValue("border-style")||!!e.getPropertyValue("border-width")||!!e.getPropertyValue("border-color");if(!i&&!n.some(r))return;if(!i){for(const{side:s,style:a}of n)a!=="none"&&a!=="hidden"||(e.removeProperty(`border-${s}`),e.removeProperty(`border-${s}-width`),e.removeProperty(`border-${s}-style`),e.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)e.removeProperty(s);for(const s of n)!s.style||r(s)||(s.width&&s.color?e.setProperty(`border-${s.side}`,`${s.width} ${s.style} ${s.color}`):(s.width&&e.setProperty(`border-${s.side}-width`,s.width),e.setProperty(`border-${s.side}-style`,s.style),s.color&&e.setProperty(`border-${s.side}-color`,s.color)))}function EL(t){const e=[];for(let n=0;n<t.style.length;n+=1){const r=t.style.item(n);r&&e.push(r)}for(const n of e){const r=t.style.getPropertyValue(n).trim(),i=/(?:url\s*\(|expression\s*\(|javascript:|var\s*\()/i.test(r),o=n==="display"&&!oL.has(r.toLowerCase());(!iL.has(n)||i||o)&&t.style.removeProperty(n)}t.style.cssText.trim()||t.removeAttribute("style")}function RL(t){const e=t.tagName.toLowerCase();return e==="img"?new Set(["style","src","data-src","alt","width","height"]):e==="a"?new Set(["style","href","title"]):e==="ol"?new Set(["style","start"]):e==="th"||e==="td"?new Set(["style","colspan","rowspan","align"]):new Set(["style"])}function QA(t,e){const n=t.getAttribute(e)?.trim()??"";if(!n){t.removeAttribute(e);return}if(/^(?:javascript|vbscript):/i.test(n)){t.removeAttribute(e);return}/^data:/i.test(n)&&!/^data:image\/(?:avif|gif|jpe?g|png|webp);base64,/i.test(n)&&t.removeAttribute(e)}function NL(t){const e=[t,...Array.from(t.querySelectorAll("*"))].reverse();for(const n of e){const r=n.tagName.toLowerCase();if(rL.has(r)){n!==t&&n.remove();continue}if(!nL.has(r)){n!==t&&n.replaceWith(...Array.from(n.childNodes));continue}const i=RL(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"&&(QA(n,"src"),QA(n,"data-src")),EL(n),IL(n)}}async function $L(t){const e=JA(""),n=e.createElement("section");n.className="milkdown";const r=e.createElement("section");if(r.className="editor zzhub-wechat-article",r.lang="zh-CN",be(r,"article"),r.innerHTML=t.semanticHtml,t.structure?.headerImageUrl){const h=e.createElement("p"),p=e.createElement("img");p.src=t.structure.headerImageUrl,p.alt="",h.appendChild(p),r.prepend(h)}n.appendChild(r),e.body.appendChild(n);const i=[],o=GM(),s=YM(),a={...t.renderers,extraRenderers:[...t.renderers?.extraRenderers??[],...o]},l=CL(a);await KA("prepare",l,{document:e,root:r,theme:t.theme,references:i,structure:t.structure,strictImageDecode:t.strictImageDecode??!0});const c=[t.baseCss,tL(t.editorVars??{},t.theme),vL(t.structure),s,t.customCss??""].filter(Boolean).join(`
986
+ `),u=qo.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=JA(u),d=f.querySelector(".zzhub-wechat-article");if(!d)throw new Error("Wechat article root missing after CSS inlining");return await KA("finalize",l,{document:f,root:d,theme:t.theme,references:i,structure:t.structure,strictImageDecode:t.strictImageDecode??!0}),NL(d),d.outerHTML}const TL=[{key:"h2",label:"二级标题 (H2)",icon:"📌",defaultPresetId:"pillar",presets:[{id:"pillar",name:"左侧呼吸柱(推荐)",css:`.milkdown .editor h2 {
987
+ margin: 2.8em 0 0.65em;
988
+ padding-left: 9px;
989
+ border-left: 4px solid var(--wx-brand-accent, #ca6093);
990
+ border-bottom: none;
991
+ background: none;
992
+ font-size: 20px;
993
+ font-weight: 700;
994
+ line-height: 1.36;
995
+ letter-spacing: 0.01em;
996
+ color: var(--wx-h2-color, #1f1b1c);
997
+ }`},{id:"bottom-line",name:"极浅底部分割",css:`.milkdown .editor h2 {
998
+ margin: 3.0em 0 0.8em;
999
+ padding-bottom: 0.45em;
1000
+ padding-left: 0;
1001
+ border-left: none;
1002
+ border-bottom: 1px solid var(--wx-divider-color, #ebe6e8);
1003
+ background: none;
1004
+ font-size: 20px;
1005
+ font-weight: 700;
1006
+ line-height: 1.35;
1007
+ letter-spacing: 0.015em;
1008
+ color: var(--wx-h2-color, #1f1b1c);
1009
+ }`},{id:"gradient-pill",name:"渐变微衬底(背景色块)",css:`.milkdown .editor h2 {
1010
+ margin: 2.8em 0 0.7em;
1011
+ padding: 7px 14px;
1012
+ border-left: 3px solid var(--wx-brand-accent, #ca6093);
1013
+ border-bottom: none;
1014
+ background: linear-gradient(90deg, rgba(202, 96, 147, 0.09) 0%, rgba(202, 96, 147, 0.01) 100%);
1015
+ border-radius: 4px;
1016
+ font-size: 19px;
1017
+ font-weight: 700;
1018
+ line-height: 1.38;
1019
+ letter-spacing: 0.01em;
1020
+ color: var(--wx-h2-color, #1f1b1c);
1021
+ }`},{id:"contrast-green",name:"反差色绿底(白字反色块)",css:`.milkdown .editor h2 {
1022
+ margin: 2.8em 0 0.8em;
1023
+ padding: 8px 14px;
1024
+ background-color: #1f7a4d;
1025
+ border-left: none;
1026
+ border-bottom: none;
1027
+ border-radius: 4px;
1028
+ color: #ffffff;
1029
+ font-size: 18px;
1030
+ font-weight: 700;
1031
+ line-height: 1.36;
1032
+ letter-spacing: 0.02em;
1033
+ }
1034
+ .milkdown .editor h2 span {
1035
+ color: #ffffff;
1036
+ }`},{id:"card-tag",name:"温润小卡片",css:`.milkdown .editor h2 {
1037
+ margin: 2.7em 0 0.75em;
1038
+ padding: 6px 12px;
1039
+ border-left: none;
1040
+ border-bottom: none;
1041
+ background-color: var(--wx-soft-surface, #faf8f9);
1042
+ border-radius: 4px;
1043
+ font-size: 18px;
1044
+ font-weight: 700;
1045
+ line-height: 1.4;
1046
+ letter-spacing: 0.01em;
1047
+ color: var(--wx-h2-color, #1f1b1c);
1048
+ }`},{id:"plain",name:"经典纯文字",css:`.milkdown .editor h2 {
1049
+ margin: 2.7em 0 0.7em;
1050
+ padding: 0;
1051
+ border-left: none;
1052
+ border-bottom: none;
1053
+ background: none;
1054
+ font-size: 20px;
1055
+ font-weight: 700;
1056
+ line-height: 1.38;
1057
+ letter-spacing: 0.005em;
1058
+ color: var(--wx-h2-color, #1f1b1c);
1059
+ }`}]},{key:"h3",label:"三级标题 (H3)",icon:"🔹",defaultPresetId:"plain",presets:[{id:"plain",name:"经典纯文字(默认)",css:`.milkdown .editor h3 {
1060
+ margin: 1.55em 0 0.4em;
1061
+ padding-left: 0;
1062
+ border-left: none;
1063
+ background: none;
1064
+ font-size: 16px;
1065
+ font-weight: 700;
1066
+ line-height: 1.48;
1067
+ letter-spacing: 0.02em;
1068
+ color: var(--wx-h3-color, #5c5658);
1069
+ }`},{id:"left-bar",name:"左侧微短线",css:`.milkdown .editor h3 {
1070
+ margin: 1.6em 0 0.45em;
1071
+ padding-left: 7px;
1072
+ border-left: 2px solid var(--wx-brand-accent, #ca6093);
1073
+ background: none;
1074
+ font-size: 16px;
1075
+ font-weight: 700;
1076
+ line-height: 1.45;
1077
+ letter-spacing: 0.015em;
1078
+ color: var(--wx-h3-color, #5c5658);
1079
+ }`},{id:"badge",name:"胶囊小微标",css:`.milkdown .editor h3 {
1080
+ display: inline-block;
1081
+ margin: 1.6em 0 0.45em;
1082
+ padding: 3px 8px;
1083
+ border-left: none;
1084
+ background-color: var(--wx-soft-surface, #faf8f9);
1085
+ border-radius: 3px;
1086
+ font-size: 15px;
1087
+ font-weight: 700;
1088
+ line-height: 1.4;
1089
+ color: var(--wx-brand-ink, #ca6093);
1090
+ }`}]},{key:"blockquote",label:"引用块 (Blockquote)",icon:"💬",defaultPresetId:"left-border",presets:[{id:"left-border",name:"经典左单线(默认)",css:`.milkdown .editor blockquote {
1091
+ margin: 1.6em 0;
1092
+ padding: 10px 16px;
1093
+ border: none;
1094
+ border-left: 3px solid var(--wx-blockquote-border, #ca6093);
1095
+ border-radius: 0 4px 4px 0;
1096
+ background-color: var(--wx-soft-surface, #fbfafb);
1097
+ }`},{id:"tint-card",name:"全包裹微卡片",css:`.milkdown .editor blockquote {
1098
+ margin: 1.6em 0;
1099
+ padding: 12px 18px;
1100
+ border: 1px solid var(--wx-divider-color, #ebe6e8);
1101
+ border-radius: 6px;
1102
+ background-color: var(--wx-soft-surface, #fbfafb);
1103
+ }`},{id:"minimal-indent",name:"极简纯缩进",css:`.milkdown .editor blockquote {
1104
+ margin: 1.5em 0;
1105
+ padding: 6px 0 6px 16px;
1106
+ border: none;
1107
+ border-left: 2px solid rgba(0, 0, 0, 0.15);
1108
+ border-radius: 0;
1109
+ background: none;
1110
+ }`}]},{key:"divider",label:"分割线 (Divider)",icon:"➖",defaultPresetId:"hairline",presets:[{id:"hairline",name:"极细实线(默认)",css:`.milkdown .editor hr,
1111
+ .milkdown .editor [data-wechat-node="divider"] {
1112
+ margin: 2.4em 0;
1113
+ width: 100%;
1114
+ border: none;
1115
+ border-top: 1px solid var(--wx-divider-color, #e2dcdf);
1116
+ }`},{id:"dashed",name:"极简虚线",css:`.milkdown .editor hr,
1117
+ .milkdown .editor [data-wechat-node="divider"] {
1118
+ margin: 2.4em 0;
1119
+ width: 100%;
1120
+ border: none;
1121
+ border-top: 1px dashed var(--wx-divider-color, #d4cecf);
1122
+ }`},{id:"short-center",name:"居中短呼吸线",css:`.milkdown .editor hr,
1123
+ .milkdown .editor [data-wechat-node="divider"] {
1124
+ margin: 2.8em auto;
1125
+ width: 36%;
1126
+ border: none;
1127
+ border-top: 1px solid var(--wx-divider-color, #e2dcdf);
1128
+ }`}]},{key:"article-card",label:"篇章结构卡片 (INTRO / CTA)",icon:"🎴",defaultPresetId:"magazine",presets:[{id:"magazine",name:"杂志编者按(推荐)",css:`.milkdown .editor section[data-wechat-node="article-card"],
1129
+ .milkdown .editor .wechat-article-card {
1130
+ margin: 1.8em 0;
1131
+ padding: 16px 20px;
1132
+ border-radius: 10px;
1133
+ box-sizing: border-box;
1134
+ }
1135
+ .milkdown .editor .wechat-article-card-intro {
1136
+ background-color: var(--wx-soft-surface, #faf8f9);
1137
+ border: 1px solid var(--wx-divider, #eae4e7);
1138
+ }
1139
+ .milkdown .editor .wechat-article-card-cta {
1140
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.04));
1141
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
1142
+ text-align: center;
1143
+ }
1144
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
1145
+ .milkdown .editor .wechat-card-eyebrow-badge {
1146
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.08));
1147
+ }
1148
+ .milkdown .editor .wechat-article-card p {
1149
+ margin: 0.4em 0;
1150
+ font-size: 13px;
1151
+ line-height: 1.72;
1152
+ color: var(--wx-text-soft, #555555);
1153
+ }
1154
+ .milkdown .editor .wechat-intro-meta {
1155
+ margin: 4px 0 10px 0 !important;
1156
+ padding-bottom: 8px;
1157
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1158
+ font-size: 12px !important;
1159
+ color: var(--wx-muted-color, #756b6e) !important;
1160
+ }
1161
+ .milkdown .editor .wechat-intro-meta strong {
1162
+ color: var(--wx-brand-accent, #ca6093);
1163
+ }
1164
+ .milkdown .editor .wechat-intro-guide {
1165
+ margin-top: 10px !important;
1166
+ padding-top: 8px;
1167
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1168
+ font-size: 12px !important;
1169
+ color: var(--wx-brand-accent, #ca6093) !important;
1170
+ }`},{id:"top-line",name:"顶部色彩微线",css:`.milkdown .editor section[data-wechat-node="article-card"],
1171
+ .milkdown .editor .wechat-article-card {
1172
+ margin: 1.8em 0;
1173
+ padding: 16px 20px;
1174
+ border-radius: 8px;
1175
+ box-sizing: border-box;
1176
+ }
1177
+ .milkdown .editor .wechat-article-card-intro {
1178
+ background-color: #ffffff;
1179
+ border: 1px solid var(--wx-divider, #eae4e7);
1180
+ border-top: 3px solid var(--wx-brand-accent, #ca6093);
1181
+ }
1182
+ .milkdown .editor .wechat-article-card-cta {
1183
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.04));
1184
+ border: 1px dashed var(--wx-brand-accent, #ca6093);
1185
+ text-align: center;
1186
+ }
1187
+ .milkdown .editor span[data-wechat-node="card-eyebrow-badge"],
1188
+ .milkdown .editor .wechat-card-eyebrow-badge {
1189
+ background-color: var(--brand-bg, rgba(202, 96, 147, 0.08));
1190
+ }
1191
+ .milkdown .editor .wechat-article-card p {
1192
+ margin: 0.4em 0;
1193
+ font-size: 13px;
1194
+ line-height: 1.72;
1195
+ color: var(--wx-text-soft, #555555);
1196
+ }
1197
+ .milkdown .editor .wechat-intro-meta {
1198
+ margin: 4px 0 10px 0 !important;
1199
+ padding-bottom: 8px;
1200
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1201
+ font-size: 12px !important;
1202
+ color: var(--wx-muted-color, #756b6e) !important;
1203
+ }
1204
+ .milkdown .editor .wechat-intro-meta strong {
1205
+ color: var(--wx-brand-accent, #ca6093);
1206
+ }
1207
+ .milkdown .editor .wechat-intro-guide {
1208
+ margin-top: 10px !important;
1209
+ padding-top: 8px;
1210
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1211
+ font-size: 12px !important;
1212
+ color: var(--wx-brand-accent, #ca6093) !important;
1213
+ }`},{id:"minimal",name:"极简纯白框",css:`.milkdown .editor section[data-wechat-node="article-card"],
1214
+ .milkdown .editor .wechat-article-card {
1215
+ margin: 1.8em 0;
1216
+ padding: 16px 20px;
1217
+ border-radius: 6px;
1218
+ box-sizing: border-box;
1219
+ }
1220
+ .milkdown .editor .wechat-article-card-intro {
1221
+ background-color: #ffffff;
1222
+ border: 1px solid var(--wx-divider, #eae4e7);
1223
+ }
1224
+ .milkdown .editor .wechat-article-card-cta {
1225
+ background-color: #ffffff;
1226
+ border: 1px dashed var(--wx-divider, #dadce0);
1227
+ text-align: center;
1228
+ }
1229
+ .milkdown .editor .wechat-article-card p {
1230
+ margin: 0.4em 0;
1231
+ font-size: 13px;
1232
+ line-height: 1.72;
1233
+ color: var(--wx-text-soft, #555555);
1234
+ }
1235
+ .milkdown .editor .wechat-intro-meta {
1236
+ margin: 4px 0 10px 0 !important;
1237
+ padding-bottom: 8px;
1238
+ border-bottom: 1px solid var(--wx-divider, #f0ebed);
1239
+ font-size: 12px !important;
1240
+ color: var(--wx-muted-color, #756b6e) !important;
1241
+ }
1242
+ .milkdown .editor .wechat-intro-meta strong {
1243
+ color: var(--wx-brand-accent, #ca6093);
1244
+ }
1245
+ .milkdown .editor .wechat-intro-guide {
1246
+ margin-top: 10px !important;
1247
+ padding-top: 8px;
1248
+ border-top: 1px dashed rgba(202, 96, 147, 0.25);
1249
+ font-size: 12px !important;
1250
+ color: var(--wx-brand-accent, #ca6093) !important;
1251
+ }`}]}];function XL(t){const e=[];for(const n of TL){const r=n.presets.find(i=>i.id===(t[n.key]||n.defaultPresetId))||n.presets[0];e.push(`/* [${n.label}] - ${r.name} */
1252
+ ${r.css.trim()}`)}return e.join(`
1253
+
1254
+ `)}export{_n as $,mn as A,Rw as B,Pi as C,Fe as D,QL as E,P as F,As as G,II as H,Eb as I,ce as J,we as K,Wi as L,Sa as M,ae as N,_L as O,xt as P,tv as Q,Ge as R,Q as S,ue as T,ke as U,te as V,ki as W,TN as X,Ln as Y,Dn as Z,L0 as _,VL as a,eh as a$,M0 as a0,T0 as a1,D0 as a2,F0 as a3,B0 as a4,P0 as a5,_0 as a6,Be as a7,N0 as a8,R0 as a9,yi as aA,zS as aB,mE as aC,um as aD,HN as aE,qN as aF,ii as aG,gs as aH,UN as aI,ys as aJ,GN as aK,ji as aL,Ki as aM,v0 as aN,YN as aO,Vf as aP,JN as aQ,ms as aR,Zf as aS,Uf as aT,zi as aU,Gf as aV,Qh as aW,ws as aX,Hh as aY,Xf as aZ,ar as a_,bs as aa,rn as ab,uc as ac,la as ad,jL as ae,If as af,WL as ag,zt as ah,mN as ai,_t as aj,ge as ak,wi as al,aa as am,ei as an,lc as ao,W1 as ap,JL as aq,qL as ar,ML as as,Ot as at,LL as au,gb as av,aE as aw,OL as ax,pn as ay,dw as az,HL as b,QN as b0,tL as b1,ZL as b2,TL as b3,YM as b4,UL as c,ic as d,$L as e,XL as f,GL as g,YL as h,pr as i,on as j,uE as k,Lt as l,fe as m,Ie as n,at as o,sa as p,Ar as q,fc as r,Ia as s,zL as t,Tn as u,PL as v,iE as w,KL as x,Wt as y,Qe as z};