@inkeep/open-knowledge 0.0.0-dev-20260422103101 → 0.0.0-dev-20260422170822

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 (39) hide show
  1. package/dist/cli.mjs +4 -4
  2. package/dist/constants-QGsi0aki.mjs +2 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/init-BJwzXGcN.mjs +1 -0
  5. package/dist/{init-BwRnDaUa.mjs → init-BgeEWrPp.mjs} +2 -2
  6. package/dist/{init-d9wf2ATC.mjs → init-C8s_H_Jn.mjs} +3 -3
  7. package/dist/{init-CXKU8pCL.mjs → init-CQS2vHfN.mjs} +1 -1
  8. package/dist/loader-BN_JgcQQ.mjs +1 -0
  9. package/dist/{loader-X2UYTNqe.mjs → loader-CXtBFptF.mjs} +2 -2
  10. package/dist/{paths-DYcYIqx2.mjs → paths-BKRpw-ZW.mjs} +2 -2
  11. package/dist/paths-DJDfLPHe.mjs +1 -0
  12. package/dist/preview-CLZwbbTr.mjs +1 -0
  13. package/dist/{preview-CG6UE3J0.mjs → preview-DN07vRaX.mjs} +2 -2
  14. package/dist/public/assets/SourceEditor-BC0JRP-J.js +3 -0
  15. package/dist/public/assets/clipboard-DFzn1L1E.js +319 -0
  16. package/dist/public/assets/{dist-4KUZ8qw_.js → dist-BDx1Uw8h.js} +1 -1
  17. package/dist/public/assets/{dist-Bvlmbwcy.js → dist-BeYy-qqT.js} +1 -1
  18. package/dist/public/assets/{dist-DcQNS1eS.js → dist-CFGINClQ.js} +1 -1
  19. package/dist/public/assets/{dist-csWIvcml.js → dist-CHq8nQz4.js} +1 -1
  20. package/dist/public/assets/{dist-DvCIPVI0.js → dist-D7-FnRC2.js} +1 -1
  21. package/dist/public/assets/{dist-saWP7AQm.js → dist-DhpMli6k.js} +1 -1
  22. package/dist/public/assets/{dist-D5yBWykF.js → dist-qs1kHQVK.js} +1 -1
  23. package/dist/public/assets/index-DnuxZjIi.js +62 -0
  24. package/dist/public/index.html +5 -4
  25. package/dist/src-BEMXUtiB.mjs +1 -0
  26. package/dist/{start-DHi9coRg.mjs → start-BrwFvIYz.mjs} +2 -2
  27. package/dist/start-CU3TpA63.mjs +1 -0
  28. package/package.json +1 -1
  29. package/dist/constants-BVlXdKF2.mjs +0 -2
  30. package/dist/init-BEXFKO6K.mjs +0 -1
  31. package/dist/loader-Ck0aVV42.mjs +0 -1
  32. package/dist/paths-BIn1dA04.mjs +0 -1
  33. package/dist/preview-CWlYVyE-.mjs +0 -1
  34. package/dist/public/assets/index-Baf8TpjF.js +0 -381
  35. package/dist/src-2kqr_sLQ.mjs +0 -1
  36. package/dist/start-BqWssZGZ.mjs +0 -1
  37. /package/dist/public/assets/{dist-CWsgPYc6.js → dist-DV5qRphm.js} +0 -0
  38. /package/dist/public/assets/{go-B8kgVkyB.js → go-3sjGQ41x.js} +0 -0
  39. /package/dist/public/assets/{shell-BsPlf5L6.js → shell-rWub3t0s.js} +0 -0
@@ -0,0 +1,319 @@
1
+ import{At as e,Ct as t,D as n,Dt as r,E as i,Et as a,F as o,Ft as s,G as c,H as l,Ht as u,It as d,Jt as f,K as p,Kt as m,L as h,Lt as g,O as _,Ot as v,P as y,Pt as b,Qt as x,R as S,St as C,T as w,Ut as T,V as E,Vt as D,W as O,Wt as k,Xt as A,Y as j,_ as M,a as N,an as P,bt as F,c as I,cn as ee,ct as te,dn as ne,dt as re,en as L,ft as ie,g as ae,gt as oe,ht as se,i as ce,in as le,it as R,jt as ue,k as de,kt as fe,ln as pe,lt as me,m as he,mt as ge,n as _e,nn as ve,o as ye,on as be,ot as xe,p as Se,pt as Ce,q as we,qt as Te,r as Ee,rn as De,rt as Oe,s as ke,sn as Ae,st as je,tn as Me,tt as eee,un as tee,ut as Ne,v as Pe,vt as Fe,x as nee,xt as Ie,y as ree,yt as iee,zt as Le}from"./dist-DV5qRphm.js";import{a as aee,c as Re,i as oee,n as ze,o as Be,r as Ve,s as He,t as see}from"./dist-BDx1Uw8h.js";import{i as Ue,n as We,r as Ge,t as Ke}from"./dist-DhpMli6k.js";var cee=Object.create,qe=Object.defineProperty,lee=Object.getOwnPropertyDescriptor,uee=Object.getOwnPropertyNames,dee=Object.getPrototypeOf,fee=Object.prototype.hasOwnProperty,Je=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{let n={};for(var r in e)qe(n,r,{get:e[r],enumerable:!0});return t||qe(n,Symbol.toStringTag,{value:`Module`}),n},Xe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=uee(t),a=0,o=i.length,s;a<o;a++)s=i[a],!fee.call(e,s)&&s!==n&&qe(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=lee(t,s))||r.enumerable});return e},Ze=(e,t,n)=>(n=e==null?{}:cee(dee(e)),Xe(t||!e||!e.__esModule?qe(n,`default`,{value:e,enumerable:!0}):n,e)),Qe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$e=new class extends Qe{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},et={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},tt=new class{#e=et;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function nt(e){setTimeout(e,0)}var pee=typeof window>`u`||`Deno`in globalThis;function rt(){}function mee(e,t){return typeof e==`function`?e(t):e}function it(e){return typeof e==`number`&&e>=0&&e!==1/0}function at(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ot(e,t){return typeof e==`function`?e(t):e}function st(e,t){return typeof e==`function`?e(t):e}function hee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ct(o,t.options))return!1}else if(!ut(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function gee(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lt(t.options.mutationKey)!==lt(a))return!1}else if(!ut(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ct(e,t){return(t?.queryKeyHashFn||lt)(e)}function lt(e){return JSON.stringify(e,(e,t)=>mt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ut(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ut(e[n],t[n])):!1}var _ee=Object.prototype.hasOwnProperty;function dt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=pt(e)&&pt(t);if(!r&&!(mt(e)&&mt(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:_ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=dt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ft(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function pt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mt(e){if(!ht(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ht(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ht(e){return Object.prototype.toString.call(e)===`[object Object]`}function vee(e){return new Promise(t=>{tt.setTimeout(t,e)})}function gt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:dt(e,t)}function _t(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function vt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yt=Symbol();function bt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===yt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xt(e,t){return typeof e==`function`?e(...t):!!e}function St(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ct=(()=>{let e=()=>pee;return{isServer(){return e()},setIsServer(t){e=t}}})();function wt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Tt=nt;function Et(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Tt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Dt=Et(),Ot=new class extends Qe{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function yee(e){return Math.min(1e3*2**e,3e4)}function kt(e){return(e??`online`)===`online`?Ot.isOnline():!0}var At=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function jt(e){let t=!1,n=0,r,i=wt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new At(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>$e.isFocused()&&(e.networkMode===`always`||Ot.isOnline())&&e.canRun(),u=()=>kt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ct.isServer()?0:3),o=e.retryDelay??yee,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),vee(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Mt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),it(this.gcTime)&&(this.#e=tt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ct.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(tt.clearTimeout(this.#e),this.#e=void 0)}},bee=class extends Mt{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ft(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ft(this.options);e.data!==void 0&&(this.setState(Pt(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=gt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(rt).catch(rt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>st(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ot(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!at(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=bt(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=jt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof At&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof At){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Nt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Dt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Nt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ft(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var xee=class extends Qe{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=wt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),It(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof st(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ft(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||st(this.options.enabled,this.#t)!==st(t.enabled,this.#t)||ot(this.options.staleTime,this.#t)!==ot(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||st(this.options.enabled,this.#t)!==st(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Cee(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(rt)),t}#g(){this.#b();let e=ot(this.options.staleTime,this.#t);if(Ct.isServer()||this.#r.isStale||!it(e))return;let t=at(this.#r.dataUpdatedAt,e)+1;this.#d=tt.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Ct.isServer()||st(this.options.enabled,this.#t)===!1||!it(this.#p)||this.#p===0)&&(this.#f=tt.setInterval(()=>{(this.options.refetchIntervalInBackground||$e.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(tt.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(tt.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&It(e,t),o=i&&Rt(e,n,t,r);(a||o)&&(l={...l,...Nt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=gt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=gt(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:st(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=wt())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!ft(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Dt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function See(e,t){return st(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function It(e,t){return See(e,t)||e.state.data!==void 0&&Lt(e,t,t.refetchOnMount)}function Lt(e,t,n){if(st(t.enabled,e)!==!1&&ot(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zt(e,t)}return!1}function Rt(e,t,n,r){return(e!==t||st(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zt(e,n)}function zt(e,t){return st(t.enabled,e)!==!1&&e.isStaleByTime(ot(t.staleTime,e))}function Cee(e,t){return!ft(e.getCurrentResult(),t)}var wee=Je((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ee={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),Bt=Je(((e,t)=>{t.exports=wee()})),Tee=Je((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Vt=Je(((e,t)=>{t.exports=Tee()})),z=Ze(Bt(),1),B=Vt(),Ht=z.createContext(void 0),Ut=e=>{let t=z.useContext(Ht);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Eee=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(Ht.Provider,{value:e,children:t})),Wt=z.createContext(!1),Dee=()=>z.useContext(Wt);Wt.Provider;function Oee(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kee=z.createContext(Oee()),Aee=()=>z.useContext(kee),jee=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?xt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Mee=e=>{z.useEffect(()=>{e.clearReset()},[e])},Nee=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||xt(n,[e.error,r])),Gt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Kt=(e,t)=>e.isLoading&&e.isFetching&&!t,qt=(e,t)=>e?.suspense&&t.isPending,Jt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Yt(e,t,n){let r=Dee(),i=Aee(),a=Ut(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Gt(o),jee(o,i,s),Mee(i);let c=!a.getQueryCache().get(o.queryHash),[l]=z.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(z.useSyncExternalStore(z.useCallback(e=>{let t=d?l.subscribe(Dt.batchCalls(e)):rt;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),z.useEffect(()=>{l.setOptions(o)},[o,l]),qt(o,u))throw Jt(o,l,i);if(Nee({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Ct.isServer()&&Kt(u,r)&&(c?Jt(o,l,i):s?.promise)?.catch(rt).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Xt(e,t){return Yt(e,xee,t)}var Zt=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Qt=[`light`,`dark`],$t=`(prefers-color-scheme: dark)`,en=typeof window>`u`,tn=z.createContext(void 0),nn={setTheme:e=>{},themes:[]},rn=()=>z.useContext(tn)??nn,an=e=>z.useContext(tn)?z.createElement(z.Fragment,null,e.children):z.createElement(sn,{...e}),on=[`light`,`dark`],sn=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=on,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=z.useState(()=>ln(i,o)),[m,h]=z.useState(()=>f===`system`?dn():f),g=c?Object.values(c):a,_=z.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=dn());let a=c?c[i]:i,l=t?un(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=Qt.includes(o)?o:null,t=Qt.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=z.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=z.useCallback(t=>{h(dn(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);z.useEffect(()=>{let e=window.matchMedia($t);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),z.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),z.useEffect(()=>{_(e??f)},[e,f]);let b=z.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return z.createElement(tn.Provider,{value:b},z.createElement(cn,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},cn=z.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return z.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Zt.toString()})(${u})`}})}),ln=(e,t)=>{if(en)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},un=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},dn=e=>(e||=window.matchMedia($t),e.matches?`dark`:`light`),fn=Je((e=>{var t=Bt();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),pn=Je(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=fn()})),mn=Je((e=>{var t=Bt().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),hn=Je(((e,t)=>{t.exports=mn()})),gn=hn(),_n=Ze(pn(),1);function vn(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var yn=e=>{switch(e){case`success`:return Sn;case`info`:return wn;case`warning`:return Cn;case`error`:return Tn;default:return null}},bn=Array(12).fill(0),xn=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},bn.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Sn=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Cn=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),wn=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Tn=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),En=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Dn=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},On=1,kn=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:On++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(jn(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||On++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},An=(e,t)=>{let n=t?.id||On++;return kn.addToast({title:e,...t,id:n}),n},jn=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Mn=Object.assign(An,{success:kn.success,info:kn.info,warning:kn.warning,error:kn.error,custom:kn.custom,message:kn.message,promise:kn.promise,dismiss:kn.dismiss,loading:kn.loading},{getHistory:()=>kn.toasts,getToasts:()=>kn.getActiveToasts()});vn(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Nn(e){return e.label!==void 0}var Pee=3,Fee=`24px`,Iee=`16px`,Pn=4e3,Lee=356,Ree=14,zee=45,Bee=200;function Fn(...e){return e.filter(Boolean).join(` `)}function Vee(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Hee=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=z.useState(null),[O,k]=z.useState(null),[A,j]=z.useState(!1),[M,N]=z.useState(!1),[P,F]=z.useState(!1),[I,ee]=z.useState(!1),[te,ne]=z.useState(!1),[re,L]=z.useState(0),[ie,ae]=z.useState(0),oe=z.useRef(n.duration||y||Pn),se=z.useRef(null),ce=z.useRef(null),le=c===0,R=c+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=z.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=z.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=z.useMemo(()=>n.duration||y||Pn,[n.duration,y]),_e=z.useRef(0),ve=z.useRef(0),ye=z.useRef(0),be=z.useRef(null),[xe,Se]=b.split(`-`),Ce=z.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=Dn(),Te=n.invert||t,Ee=ue===`loading`;ve.current=z.useMemo(()=>me*x+Ce,[me,Ce]),z.useEffect(()=>{oe.current=ge},[ge]),z.useEffect(()=>{j(!0)},[]),z.useEffect(()=>{let e=ce.current;if(e){let t=e.getBoundingClientRect().height;return ae(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),z.useLayoutEffect(()=>{if(!A)return;let e=ce.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ae(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=z.useCallback(()=>{N(!0),L(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Bee)},[n,d,a,ve]);z.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;oe.current-=e}ye.current=new Date().getTime()})():oe.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},oe.current)),()=>clearTimeout(e)},[u,i,n,ue,we,De]),z.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?z.createElement(`div`,{className:Fn(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},w.loading):z.createElement(xn,{className:Fn(C?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||w?.[ue]||yn(ue);return z.createElement(`li`,{tabIndex:0,ref:ce,className:Fn(_,fe,C?.toast,n?.classNames?.toast,C?.default,C?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":te,"data-removed":M,"data-visible":R,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":le,"data-swiping":P,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:ve.current}px`,"--initial-height":S?`auto`:`${ie}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(se.current=new Date,L(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!de)return;be.current=null;let e=Number(ce.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ce.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-se.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=zee||a>.11){L(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ee(!0);return}else{var o,s;(o=ce.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ce.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ne(!1),F(!1),D(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Vee(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ne(!0),(n=ce.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ce.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?z.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Fn(C?.closeButton,n?.classNames?.closeButton)},w?.close??En):null,(ue||n.icon||n.promise)&&n.icon!==null&&(w?.[ue]!==null||n.icon)?z.createElement(`div`,{"data-icon":``,className:Fn(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,z.createElement(`div`,{"data-content":``,className:Fn(C?.content,n?.classNames?.content)},z.createElement(`div`,{"data-title":``,className:Fn(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?z.createElement(`div`,{"data-description":``,className:Fn(v,pe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),z.isValidElement(n.cancel)?n.cancel:n.cancel&&Nn(n.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nn(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:Fn(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,z.isValidElement(n.action)?n.action:n.action&&Nn(n.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:Fn(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function In(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Uee(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Iee:Fee;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Wee=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Pee,toastOptions:g,dir:_=In(),gap:v=Ree,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[k,A]=z.useState(!1),[j,M]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=z.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=z.useRef(null),I=z.useRef(!1),ee=z.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||kn.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return z.useEffect(()=>kn.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{_n.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(N.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[N.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?In():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Lee}px`,"--gap":`${v}px`,...m,...Uee(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>z.createElement(Hee,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ee,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Ln=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Gee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Kee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Rn=e=>{let t=Kee(e);return t.charAt(0).toUpperCase()+t.slice(1)},zn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},qee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Jee=(0,z.createContext)({}),Yee=()=>(0,z.useContext)(Jee),Xee=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Yee()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...zn,width:t??l??zn.width,height:t??l??zn.height,stroke:e??f,strokeWidth:m,className:Ln(`lucide`,p,i),...!a&&!qee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Bn=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(Xee,{ref:i,iconNode:t,className:Ln(`lucide-${Gee(Rn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Rn(e),n},Vn=Bn(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Zee=Bn(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Hn=Bn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Un=Bn(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Wn=Bn(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Gn=Bn(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Kn=Bn(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),qn=Bn(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Jn=Bn(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Qee=Bn(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Yn=Bn(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Xn=Bn(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Zn=Bn(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Qn=Bn(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),$ee=Bn(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),$n=Bn(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),er=Bn(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),ete=Bn(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),tr=Bn(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),nr=Bn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function rr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ir(...e){return t=>{let n=!1,r=e.map(e=>{let r=rr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rr(e[t],null)}}}}function ar(...e){return z.useCallback(ir(...e),e)}function or(e){let t=tte(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e,a=z.Children.toArray(r),o=a.find(rte);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var sr=or(`Slot`);function tte(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(z.isValidElement(n)){let e=ate(n),i=ite(r,n.props);return n.type!==z.Fragment&&(i.ref=t?ir(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cr=Symbol(`radix.slottable`);function nte(e){let t=({children:e})=>(0,B.jsx)(B.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=cr,t}function rte(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cr}function ite(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ate(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=or(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ur(e,t){e&&_n.flushSync(()=>e.dispatchEvent(t))}function ote(e,t){let n=z.createContext(t),r=e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=z.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function dr(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,fr(i,...t)]}function fr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function pr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var mr=globalThis?.document?z.useLayoutEffect:()=>{},hr=z.useInsertionEffect||mr;function gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=_r({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=vr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function _r({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return hr(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function vr(e){return typeof e==`function`}function yr(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var br=e=>{let{present:t,children:n}=e,r=xr(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=ar(r.ref,Cr(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};br.displayName=`Presence`;function xr(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=yr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=Sr(r.current);a.current=o===`mounted`?e:`none`},[o]),mr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Sr(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),mr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Sr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Sr(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Sr(e){return e?.animationName||`none`}function Cr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wr=z.useId||(()=>void 0),Tr=0;function Er(e){let[t,n]=z.useState(wr());return mr(()=>{e||n(e=>e??String(Tr++))},[e]),e||(t?`radix-${t}`:``)}function Dr(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...e)=>t.current?.(...e),[])}function Or(e,t=globalThis?.document){let n=Dr(e);z.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var kr=`DismissableLayer`,Ar=`dismissableLayer.update`,jr=`dismissableLayer.pointerDownOutside`,Mr=`dismissableLayer.focusOutside`,Nr,Pr=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fr=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(Pr),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=ar(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Rr(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=zr(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Or(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Nr=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Br(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Nr)}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Br())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ar,e),()=>document.removeEventListener(Ar,e)},[]),(0,B.jsx)(lr.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:pr(e.onFocusCapture,S.onFocusCapture),onBlurCapture:pr(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:pr(e.onPointerDownCapture,x.onPointerDownCapture)})});Fr.displayName=kr;var Ir=`DismissableLayerBranch`,Lr=z.forwardRef((e,t)=>{let n=z.useContext(Pr),r=z.useRef(null),i=ar(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(lr.div,{...e,ref:i})});Lr.displayName=Ir;function Rr(e,t=globalThis?.document){let n=Dr(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Vr(jr,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zr(e,t=globalThis?.document){let n=Dr(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&Vr(Mr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Br(){let e=new CustomEvent(Ar);document.dispatchEvent(e)}function Vr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ur(i,a):i.dispatchEvent(a)}var Hr=`focusScope.autoFocusOnMount`,Ur=`focusScope.autoFocusOnUnmount`,Wr={bubbles:!1,cancelable:!0},Gr=`FocusScope`,Kr=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Dr(i),u=Dr(a),d=z.useRef(null),f=ar(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:$r(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||$r(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$r(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),z.useEffect(()=>{if(s){ei.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Hr,Wr);s.addEventListener(Hr,l),s.dispatchEvent(t),t.defaultPrevented||(qr(ri(Yr(s)),{select:!0}),document.activeElement===e&&$r(s))}return()=>{s.removeEventListener(Hr,l),setTimeout(()=>{let t=new CustomEvent(Ur,Wr);s.addEventListener(Ur,u),s.dispatchEvent(t),t.defaultPrevented||$r(e??document.body,{select:!0}),s.removeEventListener(Ur,u),ei.remove(p)},0)}}},[s,l,u,p]);let m=z.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Jr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$r(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$r(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,B.jsx)(lr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Kr.displayName=Gr;function qr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($r(r,{select:t}),document.activeElement!==n)return}function Jr(e){let t=Yr(e);return[Xr(t,e),Xr(t.reverse(),e)]}function Yr(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xr(e,t){for(let n of e)if(!Zr(n,{upTo:t}))return n}function Zr(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Qr(e){return e instanceof HTMLInputElement&&`select`in e}function $r(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qr(e)&&t&&e.select()}}var ei=ti();function ti(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ni(e,t),e.unshift(t)},remove(t){e=ni(e,t),e[0]?.resume()}}}function ni(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ri(e){return e.filter(e=>e.tagName!==`A`)}var ii=`Portal`,ai=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);mr(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_n.createPortal((0,B.jsx)(lr.div,{...r,ref:t}),o):null});ai.displayName=ii;var oi=0;function si(){z.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ci()),document.body.insertAdjacentElement(`beforeend`,e[1]??ci()),oi++,()=>{oi===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),oi--}},[])}function ci(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var li=function(){return li=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},li.apply(this,arguments)};function ui(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function di(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var fi=`right-scroll-bar-position`,pi=`width-before-scroll-bar`,mi=`with-scroll-bars-hidden`,hi=`--removed-body-scroll-bar-size`;function gi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _i(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var vi=typeof window<`u`?z.useLayoutEffect:z.useEffect,yi=new WeakMap;function bi(e,t){var n=_i(t||null,function(t){return e.forEach(function(e){return gi(e,t)})});return vi(function(){var t=yi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||gi(e,null)}),i.forEach(function(e){r.has(e)||gi(e,a)})}yi.set(n,e)},[e]),n}function xi(e){return e}function Si(e,t){t===void 0&&(t=xi);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ci(e){e===void 0&&(e={});var t=Si(null);return t.options=li({async:!0,ssr:!1},e),t}var wi=function(e){var t=e.sideCar,n=ui(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,li({},n))};wi.isSideCarExport=!0;function Ti(e,t){return e.useMedium(t),wi}var Ei=Ci(),Di=function(){},Oi=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Di,onWheelCapture:Di,onTouchMoveCapture:Di}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=ui(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=bi([n,t]),C=li(li({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Ei,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),li(li({},C),{ref:S})):z.createElement(v,li({},C,{className:c,ref:S}),s))});Oi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oi.classNames={fullWidth:pi,zeroRight:fi};var ki,Ai=function(){if(ki)return ki;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ji(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ai();return t&&e.setAttribute(`nonce`,t),e}function Mi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ni(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Pi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ji())&&(Mi(t,n),Ni(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fi=function(){var e=Pi();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ii=function(){var e=Fi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Li={left:0,top:0,right:0,gap:0},Ri=function(e){return parseInt(e||``,10)||0},zi=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ri(n),Ri(r),Ri(i)]},Bi=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Li;var t=zi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vi=Ii(),Hi=`data-scroll-locked`,Ui=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${mi} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${Hi}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${fi} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${pi} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${fi} .${fi} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${pi} .${pi} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${Hi}] {
36
+ ${hi}: ${s}px;
37
+ }
38
+ `},Wi=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ste=function(){z.useEffect(function(){return document.body.setAttribute(Hi,(Wi()+1).toString()),function(){var e=Wi()-1;e<=0?document.body.removeAttribute(Hi):document.body.setAttribute(Hi,e.toString())}},[])},cte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ste();var a=z.useMemo(function(){return Bi(i)},[i]);return z.createElement(Vi,{styles:Ui(a,!t,i,n?``:`!important`)})},Gi=!1;if(typeof window<`u`)try{var Ki=Object.defineProperty({},`passive`,{get:function(){return Gi=!0,!0}});window.addEventListener(`test`,Ki,Ki),window.removeEventListener(`test`,Ki,Ki)}catch{Gi=!1}var qi=Gi?{passive:!1}:!1,lte=function(e){return e.tagName===`TEXTAREA`},Ji=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!lte(e)&&n[t]===`visible`)},ute=function(e){return Ji(e,`overflowY`)},dte=function(e){return Ji(e,`overflowX`)},Yi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Xi(e,r)){var i=Zi(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fte=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pte=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Xi=function(e,t){return e===`v`?ute(t):dte(t)},Zi=function(e,t){return e===`v`?fte(t):pte(t)},mte=function(e,t){return e===`h`&&t===`rtl`?-1:1},hte=function(e,t,n,r,i){var a=mte(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Zi(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Xi(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Qi=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$i=function(e){return[e.deltaX,e.deltaY]},ea=function(e){return e&&`current`in e?e.current:e},gte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_te=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},vte=0,ta=[];function yte(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(vte++)[0],a=z.useState(Ii)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=di([e.lockRef.current],(e.shards||[]).map(ea),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Qi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Yi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Yi(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return hte(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!ta.length||ta[ta.length-1]!==a)){var r=`deltaY`in n?$i(n):Qi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&gte(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ea).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:bte(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Qi(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,$i(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Qi(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return ta.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,qi),document.addEventListener(`touchmove`,c,qi),document.addEventListener(`touchstart`,u,qi),function(){ta=ta.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,qi),document.removeEventListener(`touchmove`,c,qi),document.removeEventListener(`touchstart`,u,qi)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:_te(i)}):null,p?z.createElement(cte,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xte=Ti(Ei,yte),na=z.forwardRef(function(e,t){return z.createElement(Oi,li({},e,{ref:t,sideCar:xte}))});na.classNames=Oi.classNames;var Ste=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ra=new WeakMap,ia=new WeakMap,aa={},oa=0,sa=function(e){return e&&(e.host||sa(e.parentNode))},Cte=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=sa(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},wte=function(e,t,n,r){var i=Cte(t,Array.isArray(e)?e:[e]);aa[n]||(aa[n]=new WeakMap);var a=aa[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ra.get(e)||0)+1,l=(a.get(e)||0)+1;ra.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ia.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),oa++,function(){o.forEach(function(e){var t=ra.get(e)-1,i=a.get(e)-1;ra.set(e,t),a.set(e,i),t||(ia.has(e)||e.removeAttribute(r),ia.delete(e)),i||e.removeAttribute(n)}),oa--,oa||(ra=new WeakMap,ra=new WeakMap,ia=new WeakMap,aa={})}},ca=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ste(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),wte(r,i,n,`aria-hidden`)):function(){return null}},la=`Dialog`,[ua,Tte]=dr(la),[Ete,da]=ua(la),fa=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:la});return(0,B.jsx)(Ete,{scope:t,triggerRef:s,contentRef:c,contentId:Er(),titleId:Er(),descriptionId:Er(),open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};fa.displayName=la;var pa=`DialogTrigger`,Dte=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=da(pa,n),a=ar(t,i.triggerRef);return(0,B.jsx)(lr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Oa(i.open),...r,ref:a,onClick:pr(e.onClick,i.onOpenToggle)})});Dte.displayName=pa;var ma=`DialogPortal`,[Ote,ha]=ua(ma,{forceMount:void 0}),ga=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=da(ma,t);return(0,B.jsx)(Ote,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,B.jsx)(br,{present:n||a.open,children:(0,B.jsx)(ai,{asChild:!0,container:i,children:e})}))})};ga.displayName=ma;var _a=`DialogOverlay`,va=z.forwardRef((e,t)=>{let n=ha(_a,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=da(_a,e.__scopeDialog);return a.modal?(0,B.jsx)(br,{present:r||a.open,children:(0,B.jsx)(Ate,{...i,ref:t})}):null});va.displayName=_a;var kte=or(`DialogOverlay.RemoveScroll`),Ate=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=da(_a,n);return(0,B.jsx)(na,{as:kte,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(lr.div,{"data-state":Oa(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),ya=`DialogContent`,ba=z.forwardRef((e,t)=>{let n=ha(ya,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=da(ya,e.__scopeDialog);return(0,B.jsx)(br,{present:r||a.open,children:a.modal?(0,B.jsx)(jte,{...i,ref:t}):(0,B.jsx)(Mte,{...i,ref:t})})});ba.displayName=ya;var jte=z.forwardRef((e,t)=>{let n=da(ya,e.__scopeDialog),r=z.useRef(null),i=ar(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return ca(e)},[]),(0,B.jsx)(xa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:pr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:pr(e.onFocusOutside,e=>e.preventDefault())})}),Mte=z.forwardRef((e,t)=>{let n=da(ya,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,B.jsx)(xa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),xa=z.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=da(ya,n),c=z.useRef(null),l=ar(t,c);return si(),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Kr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Fr,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Oa(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Pte,{titleId:s.titleId}),(0,B.jsx)(Ite,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Sa=`DialogTitle`,Ca=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=da(Sa,n);return(0,B.jsx)(lr.h2,{id:i.titleId,...r,ref:t})});Ca.displayName=Sa;var wa=`DialogDescription`,Ta=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=da(wa,n);return(0,B.jsx)(lr.p,{id:i.descriptionId,...r,ref:t})});Ta.displayName=wa;var Ea=`DialogClose`,Da=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=da(Ea,n);return(0,B.jsx)(lr.button,{type:`button`,...r,ref:t,onClick:pr(e.onClick,()=>i.onOpenChange(!1))})});Da.displayName=Ea;function Oa(e){return e?`open`:`closed`}var ka=`DialogTitleWarning`,[Nte,Aa]=ote(ka,{contentName:ya,titleName:Sa,docsSlug:`dialog`}),Pte=({titleId:e})=>{let t=Aa(ka),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return z.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fte=`DialogDescriptionWarning`,Ite=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Aa(Fte).contentName}}.`;return z.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ja=fa,Ma=ga,Na=va,Pa=ba,Fa=Ca,Ia=Ta,La=Da,Lte=Je((e=>{var t=Bt();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ra=Je(((e,t)=>{t.exports=Lte()})),za=[`top`,`right`,`bottom`,`left`],Ba=[`start`,`end`],Va=za.reduce((e,t)=>e.concat(t,t+`-`+Ba[0],t+`-`+Ba[1]),[]),Ha=Math.min,Ua=Math.max,Wa=Math.round,Ga=Math.floor,Ka=e=>({x:e,y:e}),Rte={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function qa(e,t,n){return Ua(e,Ha(t,n))}function Ja(e,t){return typeof e==`function`?e(t):e}function Ya(e){return e.split(`-`)[0]}function Xa(e){return e.split(`-`)[1]}function Za(e){return e===`x`?`y`:`x`}function Qa(e){return e===`y`?`height`:`width`}function $a(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function eo(e){return Za($a(e))}function to(e,t,n){n===void 0&&(n=!1);let r=Xa(e),i=eo(e),a=Qa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=uo(o)),[o,uo(o)]}function no(e){let t=uo(e);return[ro(e),t,ro(t)]}function ro(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var io=[`left`,`right`],ao=[`right`,`left`],oo=[`top`,`bottom`],so=[`bottom`,`top`];function co(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ao:io:t?io:ao;case`left`:case`right`:return t?oo:so;default:return[]}}function lo(e,t,n,r){let i=Xa(e),a=co(Ya(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ro)))),a}function uo(e){let t=Ya(e);return Rte[t]+e.slice(t.length)}function fo(e){return{top:0,right:0,bottom:0,left:0,...e}}function po(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:fo(e)}function mo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ho(e,t,n){let{reference:r,floating:i}=e,a=$a(t),o=eo(t),s=Qa(o),c=Ya(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Xa(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function go(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ja(t,e),p=po(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=mo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=mo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var _o=50,vo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:go},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ho(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<_o&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ho(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},yo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ja(e,t)||{};if(l==null)return{};let d=po(u),f={x:n,y:r},p=eo(i),m=Qa(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ha(d[_],T),D=Ha(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=qa(O,A,k),M=!c.arrow&&Xa(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function bo(e,t,n){return(e?[...n.filter(t=>Xa(t)===e),...n.filter(t=>Xa(t)!==e)]:n.filter(e=>Ya(e)===e)).filter(n=>e?Xa(n)===e||(t?ro(n)!==n:!1):!0)}var xo=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=Va,autoAlignment:u=!0,...d}=Ja(e,t),f=c!==void 0||l===Va?bo(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=to(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[Ya(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=Xa(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,Xa(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},So=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ja(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ya(r),_=$a(o),v=Ya(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[uo(o)]:no(o)),x=p!==`none`;!d&&x&&b.push(...lo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=to(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==$a(t))||T.every(e=>$a(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$a(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Co(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wo(e){return za.some(t=>e[t]>=0)}var To=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ja(e,t);switch(i){case`referenceHidden`:{let e=Co(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wo(e)}}}case`escaped`:{let e=Co(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wo(e)}}}default:return{}}}}};function Eo(e){let t=Ha(...e.map(e=>e.left)),n=Ha(...e.map(e=>e.top)),r=Ua(...e.map(e=>e.right)),i=Ua(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Do(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>mo(Eo(e)))}var Oo=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Ja(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Do(u),f=mo(Eo(u)),p=po(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if($a(n)===`y`){let e=d[0],t=d[d.length-1],r=Ya(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=Ya(n)===`left`,t=Ua(...d.map(e=>e.right)),r=Ha(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},ko=new Set([`left`,`top`]);async function Ao(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ya(n),s=Xa(n),c=$a(n)===`y`,l=ko.has(o)?-1:1,u=a&&c?-1:1,d=Ja(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var jo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ao(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Mo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ja(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$a(Ya(i)),p=Za(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=qa(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=qa(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},No=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ja(e,t),u={x:n,y:r},d=$a(i),f=Za(d),p=u[f],m=u[d],h=Ja(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ko.has(Ya(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Po=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ja(e,t),u=await o.detectOverflow(t,l),d=Ya(i),f=Xa(i),p=$a(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ha(h-u[g],v),x=Ha(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ua(u.left,0),t=Ua(u.right,0),n=Ua(u.top,0),r=Ua(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ua(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ua(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<`u`}function Io(e){return zo(e)?(e.nodeName||``).toLowerCase():`#document`}function Lo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){return((zo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function zo(e){return Fo()?e instanceof Node||e instanceof Lo(e).Node:!1}function Bo(e){return Fo()?e instanceof Element||e instanceof Lo(e).Element:!1}function Vo(e){return Fo()?e instanceof HTMLElement||e instanceof Lo(e).HTMLElement:!1}function Ho(e){return!Fo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Lo(e).ShadowRoot}function Uo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Wo(e){return/^(table|td|th)$/.test(Io(e))}function Go(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ko=/transform|translate|scale|rotate|perspective|filter/,qo=/paint|layout|strict|content/,Jo=e=>!!e&&e!==`none`,Yo;function Xo(e){let t=Bo(e)?es(e):e;return Jo(t.transform)||Jo(t.translate)||Jo(t.scale)||Jo(t.rotate)||Jo(t.perspective)||!Qo()&&(Jo(t.backdropFilter)||Jo(t.filter))||Ko.test(t.willChange||``)||qo.test(t.contain||``)}function Zo(e){let t=ns(e);for(;Vo(t)&&!$o(t);){if(Xo(t))return t;if(Go(t))return null;t=ns(t)}return null}function Qo(){return Yo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Yo}function $o(e){return/^(html|body|#document)$/.test(Io(e))}function es(e){return Lo(e).getComputedStyle(e)}function ts(e){return Bo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ns(e){if(Io(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||Ro(e);return Ho(t)?t.host:t}function rs(e){let t=ns(e);return $o(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vo(t)&&Uo(t)?t:rs(t)}function is(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rs(e),i=r===e.ownerDocument?.body,a=Lo(r);if(i){let e=as(a);return t.concat(a,a.visualViewport||[],Uo(r)?r:[],e&&n?is(e):[])}else return t.concat(r,is(r,[],n))}function as(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ss(e){let t=es(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Vo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wa(n)!==a||Wa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cs(e){return Bo(e)?e:e.contextElement}function ls(e){let t=cs(e);if(!Vo(t))return Ka(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ss(t),o=(a?Wa(n.width):n.width)/r,s=(a?Wa(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var us=Ka(0);function ds(e){let t=Lo(e);return!Qo()||!t.visualViewport?us:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Lo(e)?!1:t}function ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cs(e),o=Ka(1);t&&(r?Bo(r)&&(o=ls(r)):o=ls(e));let s=fs(a,n,r)?ds(a):Ka(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Lo(a),t=r&&Bo(r)?Lo(r):r,n=e,i=as(n);for(;i&&r&&t!==n;){let e=ls(i),t=i.getBoundingClientRect(),r=es(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Lo(i),i=as(n)}}return mo({width:u,height:d,x:c,y:l})}function ms(e,t){let n=ts(e).scrollLeft;return t?t.left+n:ps(Ro(e)).left+n}function hs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ms(e,n),y:n.top+t.scrollTop}}function gs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ro(r),s=t?Go(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ka(1),u=Ka(0),d=Vo(r);if((d||!d&&!a)&&((Io(r)!==`body`||Uo(o))&&(c=ts(r)),d)){let e=ps(r);l=ls(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hs(o,c):Ka(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _s(e){return Array.from(e.getClientRects())}function vs(e){let t=Ro(e),n=ts(e),r=e.ownerDocument.body,i=Ua(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ua(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ms(e),s=-n.scrollTop;return es(r).direction===`rtl`&&(o+=Ua(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ys=25;function bs(e,t){let n=Lo(e),r=Ro(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Qo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ms(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ys&&(a-=o)}else l<=ys&&(a+=l);return{width:a,height:o,x:s,y:c}}function xs(e,t){let n=ps(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vo(e)?ls(e):Ka(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ss(e,t,n){let r;if(t===`viewport`)r=bs(e,n);else if(t===`document`)r=vs(Ro(e));else if(Bo(t))r=xs(t,n);else{let n=ds(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return mo(r)}function Cs(e,t){let n=ns(e);return n===t||!Bo(n)||$o(n)?!1:es(n).position===`fixed`||Cs(n,t)}function ws(e,t){let n=t.get(e);if(n)return n;let r=is(e,[],!1).filter(e=>Bo(e)&&Io(e)!==`body`),i=null,a=es(e).position===`fixed`,o=a?ns(e):e;for(;Bo(o)&&!$o(o);){let t=es(o),n=Xo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Uo(o)&&!n&&Cs(e,o))?r=r.filter(e=>e!==o):i=t,o=ns(o)}return t.set(e,r),r}function Ts(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Go(t)?[]:ws(t,this._c):[].concat(n),r],o=Ss(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ss(t,a[e],i);s=Ua(n.top,s),c=Ha(n.right,c),l=Ha(n.bottom,l),u=Ua(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Es(e){let{width:t,height:n}=ss(e);return{width:t,height:n}}function Ds(e,t,n){let r=Vo(t),i=Ro(t),a=n===`fixed`,o=ps(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ka(0);function l(){c.x=ms(i)}if(r||!r&&!a)if((Io(t)!==`body`||Uo(i))&&(s=ts(t)),r){let e=ps(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?hs(i,s):Ka(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Os(e){return es(e).position===`static`}function ks(e,t){if(!Vo(e)||es(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ro(e)===n&&(n=n.ownerDocument.body),n}function As(e,t){let n=Lo(e);if(Go(e))return n;if(!Vo(e)){let t=ns(e);for(;t&&!$o(t);){if(Bo(t)&&!Os(t))return t;t=ns(t)}return n}let r=ks(e,t);for(;r&&Wo(r)&&Os(r);)r=ks(r,t);return r&&$o(r)&&Os(r)&&!Xo(r)?n:r||Zo(e)||n}var js=async function(e){let t=this.getOffsetParent||As,n=this.getDimensions,r=await n(e.floating);return{reference:Ds(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ms(e){return es(e).direction===`rtl`}var Ns={convertOffsetParentRelativeRectToViewportRelativeRect:gs,getDocumentElement:Ro,getClippingRect:Ts,getOffsetParent:As,getElementRects:js,getClientRects:_s,getDimensions:Es,getScale:ls,isElement:Bo,isRTL:Ms};function Ps(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fs(e,t){let n=null,r,i=Ro(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Ga(d),h=Ga(i.clientWidth-(u+f)),g=Ga(i.clientHeight-(d+p)),_=Ga(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ua(0,Ha(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ps(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Is(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cs(e),u=i||a?[...l?is(l):[],...t?is(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fs(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ps(e):null;c&&g();function g(){let t=ps(e);h&&!Ps(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ls=jo,Rs=xo,zs=Mo,Bs=So,Vs=Po,Hs=To,Us=yo,Ws=Oo,Gs=No,Ks=(e,t,n)=>{let r=new Map,i={platform:Ns,...n},a={...i.platform,_c:r};return vo(e,t,{...i,platform:a})};function qs(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=qs(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Js(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qs(e))&&(r&&(r+=` `),r+=t);return r}var Ys=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Xs=(e,t)=>({classGroupId:e,validator:t}),Zs=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Qs=`-`,$s=[],ec=`arbitrary..`,tc=e=>{let t=ic(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return rc(e);let n=e.split(Qs);return nc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ys(i,t):t:i||$s}return n[e]||$s}}},nc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=nc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Qs):e.slice(t).join(Qs),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},rc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ec+r:void 0})(),ic=e=>{let{theme:t,classGroups:n}=e;return ac(n,t)},ac=(e,t)=>{let n=Zs();for(let r in e){let i=e[r];oc(i,n,r,t)}return n},oc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];sc(i,t,n,r)}},sc=(e,t,n,r)=>{if(typeof e==`string`){cc(e,t,n);return}if(typeof e==`function`){lc(e,t,n,r);return}uc(e,t,n,r)},cc=(e,t,n)=>{let r=e===``?t:dc(t,e);r.classGroupId=n},lc=(e,t,n,r)=>{if(fc(e)){oc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xs(n,e))},uc=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];oc(o,dc(t,a),n,r)}},dc=(e,t)=>{let n=e,r=t.split(Qs),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Zs(),n.nextPart.set(t,i)),n=i}return n},fc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,pc=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},mc=`!`,hc=`:`,gc=[],_c=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vc=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===hc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(mc)?(c=s.slice(0,-1),l=!0):s.startsWith(mc)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return _c(t,l,c,u)};if(t){let e=t+hc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_c(gc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},yc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},bc=e=>({cache:pc(e.cacheSize),parseClassName:vc(e),sortModifiers:yc(e),...tc(e)}),xc=/\s+/,Sc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(xc),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+mc:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Cc=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=wc(n))&&(i&&(i+=` `),i+=r);return i},wc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=wc(e[r]))&&(n&&(n+=` `),n+=t);return n},Tc=(e,...t)=>{let n,r,i,a,o=o=>(n=bc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Sc(e,n);return i(e,a),a};return a=o,(...e)=>a(Cc(...e))},Ec=[],Dc=e=>{let t=t=>t[e]||Ec;return t.isThemeGetter=!0,t},Oc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ac=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Nc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>Ac.test(e),Lc=e=>!!e&&!Number.isNaN(Number(e)),Rc=e=>!!e&&Number.isInteger(Number(e)),zc=e=>e.endsWith(`%`)&&Lc(e.slice(0,-1)),Bc=e=>jc.test(e),Vc=()=>!0,Hc=e=>Mc.test(e)&&!Nc.test(e),Uc=()=>!1,Wc=e=>Pc.test(e),Gc=e=>Fc.test(e),Kc=e=>!Jc(e)&&!nl(e),qc=e=>cl(e,fl,Uc),Jc=e=>Oc.test(e),Yc=e=>cl(e,pl,Hc),Xc=e=>cl(e,Vte,Lc),Zc=e=>cl(e,hl,Vc),Qc=e=>cl(e,ml,Uc),$c=e=>cl(e,ul,Uc),el=e=>cl(e,dl,Gc),tl=e=>cl(e,gl,Wc),nl=e=>kc.test(e),rl=e=>ll(e,pl),il=e=>ll(e,ml),al=e=>ll(e,ul),ol=e=>ll(e,fl),zte=e=>ll(e,dl),sl=e=>ll(e,gl,!0),Bte=e=>ll(e,hl,!0),cl=(e,t,n)=>{let r=Oc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ll=(e,t,n=!1)=>{let r=kc.exec(e);return r?r[1]?t(r[1]):n:!1},ul=e=>e===`position`||e===`percentage`,dl=e=>e===`image`||e===`url`,fl=e=>e===`length`||e===`size`||e===`bg-size`,pl=e=>e===`length`,Vte=e=>e===`number`,ml=e=>e===`family-name`,hl=e=>e===`number`||e===`weight`,gl=e=>e===`shadow`,Hte=Tc(()=>{let e=Dc(`color`),t=Dc(`font`),n=Dc(`text`),r=Dc(`font-weight`),i=Dc(`tracking`),a=Dc(`leading`),o=Dc(`breakpoint`),s=Dc(`container`),c=Dc(`spacing`),l=Dc(`radius`),u=Dc(`shadow`),d=Dc(`inset-shadow`),f=Dc(`text-shadow`),p=Dc(`drop-shadow`),m=Dc(`blur`),h=Dc(`perspective`),g=Dc(`aspect`),_=Dc(`ease`),v=Dc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),nl,Jc],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[nl,Jc,c],T=()=>[Ic,`full`,`auto`,...w()],E=()=>[Rc,`none`,`subgrid`,nl,Jc],D=()=>[`auto`,{span:[`full`,Rc,nl,Jc]},Rc,nl,Jc],O=()=>[Rc,`auto`,nl,Jc],k=()=>[`auto`,`min`,`max`,`fr`,nl,Jc],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ic,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Ic,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Ic,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,nl,Jc],ee=()=>[...b(),al,$c,{position:[nl,Jc]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,ol,qc,{size:[nl,Jc]}],re=()=>[zc,rl,Yc],L=()=>[``,`none`,`full`,l,nl,Jc],ie=()=>[``,Lc,rl,Yc],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[Lc,zc,al,$c],ce=()=>[``,`none`,m,nl,Jc],le=()=>[`none`,Lc,nl,Jc],R=()=>[`none`,Lc,nl,Jc],ue=()=>[Lc,nl,Jc],de=()=>[Ic,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Bc],breakpoint:[Bc],color:[Vc],container:[Bc],"drop-shadow":[Bc],ease:[`in`,`out`,`in-out`],font:[Kc],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Bc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Bc],shadow:[Bc],spacing:[`px`,Lc],text:[Bc],"text-shadow":[Bc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ic,Jc,nl,g]}],container:[`container`],columns:[{columns:[Lc,Jc,nl,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Rc,`auto`,nl,Jc]}],basis:[{basis:[Ic,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Lc,Ic,`auto`,`initial`,`none`,Jc]}],grow:[{grow:[``,Lc,nl,Jc]}],shrink:[{shrink:[``,Lc,nl,Jc]}],order:[{order:[Rc,`first`,`last`,`none`,nl,Jc]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,rl,Yc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Bte,Zc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,zc,Jc]}],"font-family":[{font:[il,Qc,t]}],"font-features":[{"font-features":[Jc]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,nl,Jc]}],"line-clamp":[{"line-clamp":[Lc,`none`,nl,Xc]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,nl,Jc]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,nl,Jc]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[Lc,`from-font`,`auto`,nl,Yc]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Lc,`auto`,nl,Jc]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,nl,Jc]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,nl,Jc]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Rc,nl,Jc],radial:[``,nl,Jc],conic:[Rc,nl,Jc]},zte,el]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Lc,nl,Jc]}],"outline-w":[{outline:[``,Lc,rl,Yc]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,sl,tl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,sl,tl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Lc,Yc]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,sl,tl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Lc,nl,Jc]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Lc]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[nl,Jc]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Lc]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,nl,Jc]}],filter:[{filter:[``,`none`,nl,Jc]}],blur:[{blur:ce()}],brightness:[{brightness:[Lc,nl,Jc]}],contrast:[{contrast:[Lc,nl,Jc]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,sl,tl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Lc,nl,Jc]}],"hue-rotate":[{"hue-rotate":[Lc,nl,Jc]}],invert:[{invert:[``,Lc,nl,Jc]}],saturate:[{saturate:[Lc,nl,Jc]}],sepia:[{sepia:[``,Lc,nl,Jc]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,nl,Jc]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Lc,nl,Jc]}],"backdrop-contrast":[{"backdrop-contrast":[Lc,nl,Jc]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Lc,nl,Jc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lc,nl,Jc]}],"backdrop-invert":[{"backdrop-invert":[``,Lc,nl,Jc]}],"backdrop-opacity":[{"backdrop-opacity":[Lc,nl,Jc]}],"backdrop-saturate":[{"backdrop-saturate":[Lc,nl,Jc]}],"backdrop-sepia":[{"backdrop-sepia":[``,Lc,nl,Jc]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,nl,Jc]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Lc,`initial`,nl,Jc]}],ease:[{ease:[`linear`,`initial`,_,nl,Jc]}],delay:[{delay:[Lc,nl,Jc]}],animate:[{animate:[`none`,v,nl,Jc]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,nl,Jc]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:R()}],"scale-x":[{"scale-x":R()}],"scale-y":[{"scale-y":R()}],"scale-z":[{"scale-z":R()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[nl,Jc,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,nl,Jc]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,nl,Jc]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Lc,rl,Yc,Xc]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function _l(...e){return Hte(Js(e))}function Ute(e){let t=e.split(`/`);return t.length<2?`ok`:`${t[0]}/${t[1]}`}function Wte(e){if(!e)return;let t=Object.entries(e);if(t.length!==0)return t.map(([e,t])=>{if(t==null)return[e,String(t)];if(typeof t==`string`)return[e,t];if(typeof t==`number`||typeof t==`boolean`)return[e,String(t)];try{return[e,JSON.stringify(t)]}catch{return[e,`[unserializable]`]}})}function vl(e,t,n){if(typeof performance>`u`||!performance.measure)return;let r=Ute(e),i=Wte(t),a={devtools:{dataType:`track-entry`,track:r,...i?{properties:i}:{},...n?.tooltipText?{tooltipText:n.tooltipText}:{}}},o=performance.now(),s=n?.startTime??o,c=n?.duration??Math.max(0,o-s);try{performance.measure(e,{start:s,duration:c,detail:a})}catch{}({...t?{properties:t}:{}})}function yl(e){let t=(0,gn.c)(3),{name:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,B.jsx)(z.Profiler,{id:n,onRender:Gte,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var Gte=(e,t,n,r,i,a)=>{vl(`ok/render/${e}`,{phase:t,actualDuration:Math.round(n*1e3)/1e3,baseDuration:Math.round(r*1e3)/1e3},{startTime:i,duration:Math.max(0,a-i)})},Kte=`modulepreload`,qte=function(e){return`/`+e},bl={},Jte=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=qte(t,n),t in bl)return;bl[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Kte,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function xl(e){this.content=e}xl.prototype={constructor:xl,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new xl(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new xl(n)},addToStart:function(e,t){return new xl([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new xl(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new xl(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=xl.from(e),e.size?new xl(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=xl.from(e),e.size?new xl(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=xl.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},xl.from=function(e){if(e instanceof xl)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new xl(t)};function Sl(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Sl(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Cl(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Cl(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var V=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Sl(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Cl(this,e,t,n)}findIndex(e){if(e==0)return Tl(0,e);if(e==this.size)return Tl(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Tl(t+1,i):Tl(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};V.empty=new V([],0);var wl={index:0,offset:0};function Tl(e,t){return wl.index=e,wl.offset=t,wl}function El(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!El(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!El(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Dl=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&El(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Dl.none=[];var Ol=class extends Error{},H=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Al(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(kl(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(V.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};H.empty=new H(V.empty,0,0);function kl(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(kl(a.content,t-i-1,n-i-1)))}function Al(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Al(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Yte(e,t,n){if(n.openStart>e.depth)throw new Ol(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ol(`Inconsistent open depths`);return jl(e,t,n,0)}function jl(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=jl(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return Il(a,Rl(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Il(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Xte(n,e);return Il(a,Ll(e,i,o,t,r))}}function Ml(e,t){if(!t.type.compatibleContent(e.type))throw new Ol(`Cannot join `+t.type.name+` onto `+e.type.name)}function Nl(e,t,n){let r=e.node(n);return Ml(r,t.node(n)),r}function Pl(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Fl(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Pl(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Pl(i.child(e),r);t&&t.depth==n&&t.textOffset&&Pl(t.nodeBefore,r)}function Il(e,t){return e.type.checkContent(t),e.copy(t)}function Ll(e,t,n,r,i){let a=e.depth>i&&Nl(e,t,i+1),o=r.depth>i&&Nl(n,r,i+1),s=[];return Fl(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ml(a,o),Pl(Il(a,Ll(e,t,n,r,i+1)),s)):(a&&Pl(Il(a,Rl(e,t,i+1)),s),Fl(t,n,i,s),o&&Pl(Il(o,Rl(n,r,i+1)),s)),Fl(r,null,i,s),new V(s)}function Rl(e,t,n){let r=[];return Fl(null,e,n,r),e.depth>n&&Pl(Il(Nl(e,t,n+1),Rl(e,t,n+1)),r),Fl(t,null,n,r),new V(r)}function Xte(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(V.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var zl=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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 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 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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Dl.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Vl(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Bl.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Bl.set(t,r=new Zte);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Qte,i}},Zte=class{constructor(){this.elts=[],this.i=0}},Qte=12,Bl=new WeakMap,Vl=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},$te=Object.create(null),Hl=class e{constructor(e,t,n,r=Dl.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||V.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,t,n,r=0){this.content.nodesBetween(e,t,n,r,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,t,n,r){return this.content.textBetween(e,t,n,r)}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,t,n){return this.type==e&&El(this.attrs,t||e.defaultAttrs||$te)&&Dl.sameSet(this.marks,n||Dl.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return H.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new H(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Yte(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return zl.resolveCached(this,e)}resolveNoCache(e){return zl.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),Ul(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=V.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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),this.type.checkAttrs(this.attrs);let e=Dl.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Dl.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t 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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=V.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Hl.prototype.text=void 0;var ene=class e extends Hl{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ul(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ul(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Wl=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new tne(t,n);if(r.next==null)return e.empty;let i=Gl(r);r.next&&r.err(`Unexpected trailing text`);let a=cne(sne(i));return lne(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return V.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
46
+ `)}};Wl.empty=new Wl(!0);var tne=class{constructor(e,t){this.string=e,this.nodeTypes=t,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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Gl(e){let t=[];do t.push(nne(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function nne(e){let t=[];do t.push(rne(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function rne(e){let t=one(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=ine(e,t);else break;return t}function Kl(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function ine(e,t){let n=Kl(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Kl(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function ane(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function one(e){if(e.eat(`(`)){let t=Gl(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=ane(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function sne(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function ql(e,t){return t-e}function Jl(e,t){let n=[];return r(t),n.sort(ql);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function cne(e){let t=Object.create(null);return n(Jl(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Jl(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Wl(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(ql);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function lne(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Yl(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Xl(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Zl(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Ql(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new dne(e,r,t[r]);return n}var $l=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Ql(e,n.attrs),this.defaultAttrs=Yl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wl.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:Xl(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Hl(this,this.computeAttrs(e),V.from(t),Dl.setFrom(n))}createChecked(e=null,t,n){return t=V.from(t),this.checkContent(t),new Hl(this,this.computeAttrs(e),t,Dl.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=V.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(V.empty,!0);return i?new Hl(this,e,t.append(i),Dl.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Zl(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Dl.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function une(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var dne=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?une(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},eu=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ql(e,r.attrs),this.excluded=null;let i=Yl(this.attrs);this.instance=i?new Dl(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Dl(this,Xl(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Zl(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},tu=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=xl.from(e.nodes),t.marks=xl.from(e.marks||{}),this.nodes=$l.compile(this.spec.nodes,this),this.marks=eu.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Wl.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?nu(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:nu(this,n.split(` `))}this.nodeFromJSON=e=>Hl.fromJSON(this,e),this.markFromJSON=e=>Dl.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof $l))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ene(n,n.defaultAttrs,e,Dl.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function nu(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function fne(e){return e.tag!=null}function pne(e){return e.style!=null}var ru=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(fne(e))this.tags.push(e);else if(pne(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new du(this,t,!1);return n.addAll(e,Dl.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new du(this,t,!0);return n.addAll(e,Dl.none,t.from,t.to),H.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(gne(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=fu(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=fu(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},iu={address:!0,article:!0,aside:!0,blockquote:!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},mne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},au={ol:!0,ul:!0},ou=1,su=2,cu=4;function lu(e,t,n){return t==null?e&&e.whitespace==`pre`?ou|su:n&~cu:(t?ou:0)|(t===`full`?su:0)}var uu=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Dl.none,this.match=i||(a&cu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ou)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!iu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},du=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=lu(null,t.preserveWhitespace,0)|(n?cu:0);i=r?new uu(r.type,r.attrs,Dl.none,!0,t.topMatch||r.type.contentMatch,a):n?new uu(null,null,Dl.none,!0,null,a):new uu(e.schema.topNodeType,null,Dl.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&su?`full`:this.localPreserveWS||(r.options&ou)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
47
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;au.hasOwnProperty(a)&&this.parser.normalizeLists&&hne(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:mne.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(iu.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
48
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Dl.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):pu(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=lu(e,i,a.options);a.options&cu&&a.content.length==0&&(o|=cu);let s=Dl.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):pu(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new uu(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ou);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function hne(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&au.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function gne(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function fu(e){let t={};for(let n in e)t[n]=e[n];return t}function pu(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var mu=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=gu(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=vu(gu(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&vu(gu(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return vu(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=hu(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return hu(e.marks)}};function hu(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function gu(e){return e.document||window.document}var _u=new WeakMap;function _ne(e){let t=_u.get(e);return t===void 0&&_u.set(e,t=vne(e)),t}function vne(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function vu(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=_ne(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=vu(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var yu=65535,bu=2**16;function yne(e,t){return e+t*bu}function xu(e){return e&yu}function bne(e){return(e-(e&yu))/bu}var Su=1,Cu=2,wu=4,Tu=8,Eu=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Tu)>0}get deletedBefore(){return(this.delInfo&(Su|wu))>0}get deletedAfter(){return(this.delInfo&(Cu|wu))>0}get deletedAcross(){return(this.delInfo&wu)>0}},Du=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=xu(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+bne(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:yne(o/3,e-s),f=e==s?Cu:e==u?Su:wu;return(t<0?e!=s:e!=u)&&(f|=Tu),new Eu(a,f,d)}r+=l-c}return n?e+r:new Eu(e+r,0,null)}touches(e,t){let n=0,r=xu(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Du.empty=new Du([]);var Ou=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Eu(e,r,null)}},ku=Object.create(null),Au=class{getMap(){return Du.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=ku[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ku)throw RangeError(`Duplicate use of step JSON ID `+e);return ku[e]=t,t.prototype.jsonID=e,t}},ju=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Ol)return e.fail(t.message);throw t}}};function Mu(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Mu(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return V.fromArray(r)}var Nu=class e extends Au{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new H(Mu(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return ju.fromReplace(e,this.from,this.to,i)}invert(){return new Pu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Au.jsonID(`addMark`,Nu);var Pu=class e extends Au{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new H(Mu(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ju.fromReplace(e,this.from,this.to,n)}invert(){return new Nu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Au.jsonID(`removeMark`,Pu);var Fu=class e extends Au{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ju.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ju.fromReplace(e,this.pos,this.pos+1,new H(V.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Iu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Au.jsonID(`addNodeMark`,Fu);var Iu=class e extends Au{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ju.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ju.fromReplace(e,this.pos,this.pos+1,new H(V.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Fu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Au.jsonID(`removeNodeMark`,Iu);var Lu=class e extends Au{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&zu(e,this.from,this.to)?ju.fail(`Structure replace would overwrite content`):ju.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Du([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?H.empty:new H(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?H.empty:new H(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,H.fromJSON(t,n.slice),!!n.structure)}};Lu.MAP_BIAS=1,Au.jsonID(`replace`,Lu);var Ru=class e extends Au{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(zu(e,this.from,this.gapFrom)||zu(e,this.gapTo,this.to)))return ju.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ju.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?ju.fromReplace(e,this.from,this.to,n):ju.fail(`Content does not fit in gap`)}getMap(){return new Du([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(t,n.slice),n.insert,!!n.structure)}};Au.jsonID(`replaceAround`,Ru);function zu(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function xne(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Pu(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Nu(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Sne(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof eu){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Pu(t.from,t.to,t.style)))}function Bu(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Lu(s,l,H.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Pu(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new H(V.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Lu(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(V.empty,!0);e.replace(s,s,new H(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Cne(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Vu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Cne(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function wne(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=V.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=V.from(r.node(e).copy(u)),d++):c--;let f=V.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=V.from(i.node(e).copy(f)),p++):l++;e.step(new Ru(c,l,o,s,new H(u.append(f),d,p),u.size-d,!0))}function Hu(e,t,n=null,r=e){let i=Tne(e,t),a=i&&Ene(r,t);return a?i.map(Uu).concat({type:t,attrs:n}).concat(a.map(Uu)):null}function Uu(e){return{type:e,attrs:null}}function Tne(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Ene(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Wu(e,t,n){let r=V.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=V.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Ru(i,a,i,a,new H(r,0,0),n.length,!0))}function Gu(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Ju(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&qu(e,t,n,a),Bu(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Ru(c,l,c+1,l-1,new H(V.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Ku(e,t,n,a),!1}})}function Ku(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function qu(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
49
+ `))}})}function Ju(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Yu(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Ru(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new H(V.from(o),0,0),1,!0))}function Xu(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Zu(e,t,n=1,r){let i=e.doc.resolve(t),a=V.empty,o=V.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=V.from(i.node(e).copy(a));let t=r&&r[s];o=V.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Lu(t,t,new H(a.append(o),n,n),!0))}function Qu(e,t){let n=e.resolve(t),r=n.index();return ed(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $u(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function ed(e,t){return!!(e&&t&&!e.isLeaf&&$u(e,t))}function td(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&ed(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function nd(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);qu(e,r.node(),r.before(),s)}o.inlineContent&&Bu(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Lu(l,c.map(t+n,-1),H.empty,!0)),r===!0){let t=e.doc.resolve(l);Ku(e,t.node(),t.before(),e.steps.length)}return e}function rd(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function id(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ad(e,t,n=t,r=H.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return od(i,a,r)?new Lu(t,n,r):new sd(i,a,r).fit()}function od(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var sd=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=V.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new H(i,a,o);return e>-1?new Ru(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Lu(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ud(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(V.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ud(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new H(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ud(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new H(cd(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new H(cd(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(dd(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=ld(this.placed,t,V.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?H.empty:new H(cd(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new H(cd(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!fd(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=fd(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=fd(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ld(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ld(this.placed,this.depth,V.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(V.empty,!0);e.childCount&&(this.placed=ld(this.placed,this.frontier.length,e))}};function cd(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(cd(e.firstChild.content,t-1,n)))}function ld(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ld(e.lastChild.content,t-1,n)))}function ud(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function dd(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,dd(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),e.copy(r)}function fd(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!pd(n,a.content,o)?s:null}function pd(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function md(e){return e.spec.defining||e.spec.definingForContent}function hd(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(od(i,a,r))return e.step(new Lu(t,n,r));let o=yd(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=md(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new H(gd(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function gd(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(gd(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(V.empty,!0))}return e}function _d(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=rd(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new H(V.from(r),0,0))}function vd(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=yd(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function yd(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var bd=class e extends Au{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return ju.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return ju.fromReplace(e,this.pos,this.pos+1,new H(V.from(r),0,+!t.isLeaf))}getMap(){return Du.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Au.jsonID(`attr`,bd);var xd=class e extends Au{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ju.ok(n)}getMap(){return Du.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Au.jsonID(`docAttr`,xd);var Sd=class extends Error{};Sd=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Sd.prototype=Object.create(Error.prototype),Sd.prototype.constructor=Sd,Sd.prototype.name=`TransformError`;var Cd=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ou}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Sd(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=H.empty){let r=ad(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new H(V.from(n),0,0))}delete(e,t){return this.replace(e,t,H.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return hd(this,e,t,n),this}replaceRangeWith(e,t,n){return _d(this,e,t,n),this}deleteRange(e,t){return vd(this,e,t),this}lift(e,t){return wne(this,e,t),this}join(e,t=1){return nd(this,e,t),this}wrap(e,t){return Wu(this,e,t),this}setBlockType(e,t=e,n,r=null){return Gu(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Yu(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new bd(e,t,n)),this}setDocAttribute(e,t){return this.step(new xd(e,t)),this}addNodeMark(e,t){return this.step(new Fu(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Dl)t.isInSet(n.marks)&&this.step(new Iu(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Iu(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Zu(this,e,t,n),this}addMark(e,t,n){return xne(this,e,t,n),this}removeMark(e,t,n){return Sne(this,e,t,n),this}clearIncompatible(e,t,n){return Bu(this,e,t,n),this}},wd=Object.create(null),Td=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ed(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=H.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?H.empty:t),o==0&&Id(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Id(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new kd(e):Fd(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Fd(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Fd(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Nd(e.node(0))}static atStart(e){return Fd(e,e,0,0,1)||new Nd(e)}static atEnd(e){return Fd(e,e,e.content.size,e.childCount,-1)||new Nd(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=wd[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in wd)throw RangeError(`Duplicate use of selection JSON ID `+e);return wd[e]=t,t.prototype.jsonID=e,t}getBookmark(){return kd.between(this.$anchor,this.$head).getBookmark()}};Td.prototype.visible=!0;var Ed=class{constructor(e,t){this.$from=e,this.$to=t}},Dd=!1;function Od(e){!Dd&&!e.parent.inlineContent&&(Dd=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var kd=class e extends Td{constructor(e,t=e){Od(e),Od(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Td.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=H.empty){if(super.replace(e,t),t==H.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ad(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Td.findFrom(n,r,!0)||Td.findFrom(n,-r,!0);if(e)n=e.$head;else return Td.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Td.findFrom(t,-r,!0)||Td.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Td.jsonID(`text`,kd);var Ad=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return kd.between(e.resolve(this.anchor),e.resolve(this.head))}},jd=class e extends Td{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Td.near(a):new e(a)}content(){return new H(V.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Md(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};jd.prototype.visible=!1,Td.jsonID(`node`,jd);var Md=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ad(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&jd.isSelectable(n)?new jd(t):Td.near(t)}},Nd=class e extends Td{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=H.empty){if(t==H.empty){e.delete(0,e.doc.content.size);let t=Td.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Pd}};Td.jsonID(`all`,Nd);var Pd={map(){return this},resolve(e){return new Nd(e)}};function Fd(e,t,n,r,i,a=!1){if(t.inlineContent)return kd.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Fd(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&jd.isSelectable(r))return jd.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Id(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Lu||i instanceof Ru))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Td.near(e.doc.resolve(o),n))}var Ld=1,Rd=2,zd=4,Bd=class extends Cd{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 RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ld)&~Rd,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ld)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Rd,this}ensureMarks(e){return Dl.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&Rd)>0}addStep(e,t){super.addStep(e,t),this.updated&=~Rd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Dl.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Td.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,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|=zd,this}get scrolledIntoView(){return(this.updated&zd)>0}};function Vd(e,t){return!t||!e?e:e.bind(t)}var Hd=class{constructor(e,t,n){this.name=e,this.init=Vd(t.init,n),this.apply=Vd(t.apply,n)}},Ud=[new Hd(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Hd(`selection`,{init(e,t){return e.selection||Td.atStart(t.doc)},apply(e){return e.selection}}),new Hd(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Hd(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Wd=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ud.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Hd(e.key,e.spec.state,e))})}},Gd=class e{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,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Bd(this)}static create(t){let n=new Wd(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Wd(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Wd(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Hl.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Td.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Kd(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Kd(i,t,{})),n[r]=i}return n}var qd=class{constructor(e){this.spec=e,this.props={},e.props&&Kd(e.props,this,this.props),this.key=e.key?e.key.key:Yd(`plugin`)}getState(e){return e[this.key]}},Jd=Object.create(null);function Yd(e){return e in Jd?e+`$`+ ++Jd[e]:(Jd[e]=0,e+`$`)}var Xd=class{constructor(e=`key`){this.key=Yd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Zd=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Qd(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var $d=(e,t,n)=>{let r=Qd(e,n);if(!r)return!1;let i=of(r);if(!i){let n=r.blockRange(),i=n&&Vu(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(wf(e,i,t,-1))return!0;if(r.parent.content.size==0&&(rf(a,`end`)||jd.isSelectable(a)))for(let n=r.depth;;n--){let o=ad(e.doc,r.before(n),r.after(n),H.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(rf(a,`end`)?Td.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):jd.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},ef=(e,t,n)=>{let r=Qd(e,n);if(!r)return!1;let i=of(r);return i?nf(e,i,t):!1},tf=(e,t,n)=>{let r=sf(e,n);if(!r)return!1;let i=uf(r);return i?nf(e,i,t):!1};function nf(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ad(e.doc,i,o,H.empty);if(!s||s.from!=i||s instanceof Lu&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(kd.create(t.doc,i)),n(t.scrollIntoView())}return!0}function rf(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var af=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=of(r)}let o=a&&a.nodeBefore;return!o||!jd.isSelectable(o)?!1:(t&&t(e.tr.setSelection(jd.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function of(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function sf(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var cf=(e,t,n)=>{let r=sf(e,n);if(!r)return!1;let i=uf(r);if(!i)return!1;let a=i.nodeAfter;if(wf(e,i,t,1))return!0;if(r.parent.content.size==0&&(rf(a,`start`)||jd.isSelectable(a))){let n=ad(e.doc,r.before(),r.after(),H.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(rf(a,`start`)?Td.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):jd.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},lf=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=uf(r)}let o=a&&a.nodeAfter;return!o||!jd.isSelectable(o)?!1:(t&&t(e.tr.setSelection(jd.create(e.doc,a.pos)).scrollIntoView()),!0)};function uf(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var df=(e,t)=>{let n=e.selection,r=n instanceof jd,i;if(r){if(n.node.isTextblock||!Qu(e.doc,n.from))return!1;i=n.from}else if(i=td(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(jd.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},ff=(e,t)=>{let n=e.selection,r;if(n instanceof jd){if(n.node.isTextblock||!Qu(e.doc,n.to))return!1;r=n.to}else if(r=td(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},pf=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Vu(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},mf=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
50
+ `).scrollIntoView()),!0)};function hf(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var gf=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=hf(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Td.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},_f=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Nd||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=hf(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(kd.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},vf=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Xu(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Vu(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function yf(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof jd&&t.selection.node.isBlock)return!r.parentOffset||!Xu(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=hf(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof kd||t.selection instanceof Nd)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Xu(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,Xu(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var bf=yf(),xf=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(jd.create(e.doc,i))),!0)},Sf=(e,t)=>(t&&t(e.tr.setSelection(new Nd(e.doc))),!0);function Cf(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Qu(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function wf(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Cf(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=V.empty;for(let e=o.length-1;e>=0;e--)s=V.from(o[e].create(null,s));s=V.from(i.copy(s));let c=e.tr.step(new Ru(t.pos-1,r,t.pos,r,new H(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Qu(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Td.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Vu(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&rf(a,`start`,!0)&&rf(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=V.empty;for(let e=o.length-1;e>=0;e--)r=V.from(o[e].copy(r));n(e.tr.step(new Ru(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new H(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Tf(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(kd.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Ef=Tf(-1),Df=Tf(1);function Of(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Hu(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function kf(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Af(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var jf=Af(Zd,$d,af),Mf=Af(Zd,cf,lf),Nf={Enter:Af(mf,_f,vf,bf),"Mod-Enter":gf,Backspace:jf,"Mod-Backspace":jf,"Shift-Backspace":jf,Delete:Mf,"Mod-Delete":Mf,"Mod-a":Sf},Pf={"Ctrl-h":Nf.Backspace,"Alt-Backspace":Nf[`Mod-Backspace`],"Ctrl-d":Nf.Delete,"Ctrl-Alt-Backspace":Nf[`Mod-Delete`],"Alt-Delete":Nf[`Mod-Delete`],"Alt-d":Nf[`Mod-Delete`],"Ctrl-a":Ef,"Ctrl-e":Df};for(let e in Nf)Pf[e]=Nf[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Ff(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return If(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function If(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Vl(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Vl(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Hu(a,n,r,t);return s?(e&&Lf(e,t,s,i,n),!0):!1}function Lf(e,t,n,r,i){let a=V.empty;for(let e=n.length-1;e>=0;e--)a=V.from(n[e].type.create(n[e].attrs,a));e.step(new Ru(t.start-(r?2:0),t.end,t.start,t.end,new H(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Xu(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Rf(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?zf(t,n,e,a):Bf(t,n,a):!0:!1}}function zf(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Ru(a-1,o,a,o,new H(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Vl(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Vu(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Qu(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Bf(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?V.empty:V.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Ru(d-+!!s,f+ +!!c,d+1,f-1,new H((s?V.empty:V.from(i.copy(V.empty))).append(c?V.empty:V.from(i.copy(V.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Vf(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=V.from(r?e.create():null),o=new H(V.from(e.create(null,V.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Ru(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Hf=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Uf=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Wf=null,Gf=function(e,t,n){let r=Wf||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Kf=function(){Wf=null},qf=function(e,t,n,r){return n&&(Yf(e,t,n,r,-1)||Yf(e,t,n,r,1))},Jf=/^(img|br|input|textarea|hr)$/i;function Yf(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Xf(e))){let n=e.parentNode;if(!n||n.nodeType!=1||ep(e)||Jf.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Hf(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Xf(e):0}else return!1}}function Xf(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Zf(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Xf(e)}else if(e.parentNode&&!ep(e))t=Hf(e),e=e.parentNode;else return null}}function Qf(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!ep(e))t=Hf(e)+1,e=e.parentNode;else return null}}function $f(e,t,n){for(let r=t==0,i=t==Xf(e);r||i;){if(e==n)return!0;let t=Hf(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Xf(e)}}function ep(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var tp=function(e){return e.focusNode&&qf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function np(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function rp(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ip(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Xf(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Xf(r.startContainer),r.startOffset)}}}var ap=typeof navigator<`u`?navigator:null,op=typeof document<`u`?document:null,sp=ap&&ap.userAgent||``,cp=/Edge\/(\d+)/.exec(sp),lp=/MSIE \d/.exec(sp),up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sp),dp=!!(lp||up||cp),fp=lp?document.documentMode:up?+up[1]:cp?+cp[1]:0,pp=!dp&&/gecko\/(\d+)/i.test(sp);pp&&+(/Firefox\/(\d+)/.exec(sp)||[0,0])[1];var mp=!dp&&/Chrome\/(\d+)/.exec(sp),hp=!!mp,gp=mp?+mp[1]:0,_p=!dp&&!!ap&&/Apple Computer/.test(ap.vendor),vp=_p&&(/Mobile\/\w+/.test(sp)||!!ap&&ap.maxTouchPoints>2),yp=vp||(ap?/Mac/.test(ap.platform):!1),bp=ap?/Win/.test(ap.platform):!1,xp=/Android \d/.test(sp),Sp=!!op&&`webkitFontSmoothing`in op.documentElement.style,Cp=Sp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wp(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Tp(e,t){return typeof e==`number`?e:e[t]}function Ep(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Dp(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Uf(o);continue}let e=o,n=e==a.body,s=n?wp(a):Ep(e),c=0,l=0;if(t.top<s.top+Tp(r,`top`)?l=-(s.top-t.top+Tp(i,`top`)):t.bottom>s.bottom-Tp(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Tp(i,`top`)-s.top:t.bottom-s.bottom+Tp(i,`bottom`)),t.left<s.left+Tp(r,`left`)?c=-(s.left-t.left+Tp(i,`left`)):t.right>s.right-Tp(r,`right`)&&(c=t.right-s.right+Tp(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Uf(o)}}function Op(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:kp(e.dom)}}function kp(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Uf(r));return t}function Ap({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;jp(n,r==0?0:r-t)}function jp(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Mp=null;function Np(e){if(e.setActive)return e.setActive();if(Mp)return e.focus(Mp);let t=kp(e);e.focus(Mp==null?{get preventScroll(){return Mp={preventScroll:!0},!0}}:void 0),Mp||(Mp=!1,jp(t,0))}function Pp(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Gf(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Fp(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Pp(n,i)}function Fp(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Up(r,1);if(n.top!=n.bottom&&Ip(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Ip(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Lp(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Rp(e,t,n){let{node:r,offset:i}=Pp(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function zp(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Bp(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Ip(t,i))return Bp(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Vp(e,t){let n=e.dom.ownerDocument,r,i=0,a=ip(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Ip(t,n)||(o=Bp(e.dom,t,n),!o))return null}if(_p)for(let e=o;r&&e;e=Uf(e))e.draggable&&(r=void 0);if(o=Lp(o,t),r){if(pp&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Sp&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=zp(e,r,i,t))}s??=Rp(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Hp(e){return e.top<e.bottom||e.left<e.right}function Up(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Hp(e))return e}return Array.prototype.find.call(n,Hp)||e.getBoundingClientRect()}var Wp=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Gp(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Sp||pp;if(r.nodeType==3)if(o&&(Wp.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Up(Gf(r,i,i),n);if(pp&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Up(Gf(r,i-1,i-1),-1);if(t.top==e.top){let n=Up(Gf(r,i,i+1),-1);if(n.top!=e.top)return Kp(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Kp(Up(Gf(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Xf(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return qp(e.getBoundingClientRect(),!1)}if(a==null&&i<Xf(r)){let e=r.childNodes[i];if(e.nodeType==1)return qp(e.getBoundingClientRect(),!0)}return qp(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Xf(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Gf(e,Xf(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Kp(Up(t,1),!1)}if(a==null&&i<Xf(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Gf(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Kp(Up(t,-1),!0)}return Kp(Up(r.nodeType==3?Gf(r):r,-n),n>=0)}function Kp(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function qp(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Jp(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Yp(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Jp(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Gp(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Gf(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Xp=/[\u0590-\u08ac]/;function Zp(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Xp.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Jp(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Qp=null,$p=null,em=!1;function tm(e,t,n){return Qp==t&&$p==n?em:(Qp=t,$p=n,em=n==`up`||n==`down`?Yp(e,t,n):Zp(e,t,n))}var nm=0,rm=1,im=2,am=3,om=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=nm,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].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 t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.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,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>Hf(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof pm){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof sm&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Hf(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Hf(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Hf(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Hf(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((pp||_p)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
51
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Hf(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(pp&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&_p)&&qf(o.node,o.offset,l.anchorNode,l.anchorOffset)&&qf(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&pp)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?im:rm,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=am:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?im:am}n=a}this.dirty=im}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?im:rm;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},sm=class extends om{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==nm&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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}},cm=class extends om{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},lm=class e extends om{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=mu.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&am||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=am&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=nm){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=nm}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Am(a,n,o,r)),t>0&&(a=Am(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},um=class e extends om{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=mu.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=xm(u,r,n),l?c=new mm(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new fm(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>V.empty)}return e}matchesNode(e,t,n){return this.dirty==nm&&e.eq(this.node)&&Sm(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new wm(this,a&&a.node,e);Dm(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Dl.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==im)&&(a&&this.protectLocalComposition(e,a),hm(this.contentDOM,this.children,e),vp&&Om(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof kd)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=km(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new cm(this,i,t,r);e.input.compositionNodes.push(a),this.children=Am(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==am||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=nm}updateOuterDeco(e){if(Sm(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=ym(this.dom,this.nodeDOM,vm(this.outerDeco,this.node,t),vm(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function dm(e,t,n,r,i){xm(r,t,e);let a=new um(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var fm=class e extends um{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==am||this.dirty!=nm&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=nm||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=nm,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=am)}get domAtom(){return!1}isText(e){return this.node.text==e}},pm=class extends om{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==nm&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},mm=class extends um{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==am)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}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 hm(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Cm(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof lm){let t=r?r.previousSibling:e.lastChild;hm(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Cm(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var gm=function(e){e&&(this.nodeName=e)};gm.prototype=Object.create(null);var _m=[new gm];function vm(e,t,n){if(e.length==0)return _m;let r=n?_m[0]:new gm,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new gm(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new gm(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function ym(e,t,n,r){if(n==_m&&r==_m)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=_m[0],i=t)}bm(i,o||_m[0],a)}return i}function bm(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function xm(e,t,n){return ym(e,e,_m,vm(t,n,e.nodeType!=1))}function Sm(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Cm(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var wm=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Tm(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=nm,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=lm.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==am&&a.dom==a.contentDOM&&(a.dirty=im),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof um){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=am&&Sm(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=im,u.updateChildren(r,a+1),u.dirty=nm),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Sm(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=um.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=um.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new sm(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof lm;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof fm)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((_p||hp)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new pm(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Tm(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof lm)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Em(e,t){return e.type.side-t.type.side}function Dm(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Em);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Om(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function km(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Am(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function jm(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(tp(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&jd.isSelectable(e)&&i.parent&&!(e.isInline&&$f(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new jd(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Hm(e,u,s,n)}return l}function Mm(e){return e.editable?e.hasFocus():Wm(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Nm(e,t=!1){let n=e.state.selection;if(Bm(e,n),Mm(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&hp){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&qf(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)zm(e);else{let{anchor:r,head:i}=n,a,o;Pm&&!(n instanceof kd)&&(n.$from.parent.inlineContent||(a=Fm(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Fm(e,n.to))),e.docView.setSelection(r,i,e,t),Pm&&(a&&Lm(a),o&&Lm(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Rm(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Pm=_p||hp&&gp<63;function Fm(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(_p&&i&&i.contentEditable==`false`)return Im(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Im(i);if(a)return Im(a)}}function Im(e){return e.contentEditable=`true`,_p&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Lm(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Rm(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Mm(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function zm(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Hf(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&dp&&fp<=11&&(n.disabled=!0,n.disabled=!1)}function Bm(e,t){if(t instanceof jd){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vm(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vm(e)}function Vm(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Hm(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||kd.between(t,n,r)}function Um(e){return e.editable&&!e.hasFocus()?!1:Wm(e)}function Wm(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Gm(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qf(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Km(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Td.findFrom(a,t)}function qm(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Jm(e,t,n){let r=e.state.selection;if(r instanceof kd){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return qm(e,new kd(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Km(e.state,t);return n&&n instanceof jd?qm(e,n):!1}else if(!(yp&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?jd.isSelectable(i)?qm(e,new jd(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Sp?qm(e,new kd(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof jd&&r.node.isInline)return qm(e,new kd(t>0?r.$to:r.$from));else{let n=Km(e.state,t);return n?qm(e,n):!1}}function Ym(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Xm(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Zm(e,t){return t<0?Qm(e):$m(e)}function Qm(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(pp&&n.nodeType==1&&r<Ym(n)&&Xm(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Xm(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(eh(n))break;else{let t=n.previousSibling;for(;t&&Xm(t,-1);)i=n.parentNode,a=Hf(t),t=t.previousSibling;if(t)n=t,r=Ym(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?rh(e,n,r):i&&rh(e,i,a)}function $m(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Ym(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Xm(e,1))a=n,o=++r;else break}else if(eh(n))break;else{let t=n.nextSibling;for(;t&&Xm(t,1);)a=t.parentNode,o=Hf(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Ym(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&rh(e,a,o)}function eh(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function th(e,t){for(;e&&t==e.childNodes.length&&!ep(e);)t=Hf(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function nh(e,t){for(;e&&!t&&!ep(e);)t=Hf(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function rh(e,t,n){if(t.nodeType!=3){let e,r;(r=th(t,n))?(t=r,n=0):(e=nh(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(tp(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Nm(e)},50)}function ih(e,t){let n=e.state.doc.resolve(t);if(!(hp||bp)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function ah(e,t,n){let r=e.state.selection;if(r instanceof kd&&!r.empty||n.indexOf(`s`)>-1||yp&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Km(e.state,t);if(n&&n instanceof jd)return qm(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Nd?Td.near(n,t):Td.findFrom(n,t);return o?qm(e,o):!1}return!1}function oh(e,t){if(!(e.state.selection instanceof kd))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function sh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ch(e){if(!_p||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;sh(e,n,`true`),setTimeout(()=>sh(e,n,`false`),20)}return!1}function lh(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function uh(e,t){let n=t.keyCode,r=lh(t);if(n==8||yp&&n==72&&r==`c`)return oh(e,-1)||Zm(e,-1);if(n==46&&!t.shiftKey||yp&&n==68&&r==`c`)return oh(e,1)||Zm(e,1);if(n==13||n==27)return!0;if(n==37||yp&&n==66&&r==`c`){let t=n==37?ih(e,e.state.selection.from)==`ltr`?-1:1:-1;return Jm(e,t,r)||Zm(e,t)}else if(n==39||yp&&n==70&&r==`c`){let t=n==39?ih(e,e.state.selection.from)==`ltr`?1:-1:1;return Jm(e,t,r)||Zm(e,t)}else if(n==38||yp&&n==80&&r==`c`)return ah(e,-1,r)||Zm(e,-1);else if(n==40||yp&&n==78&&r==`c`)return ch(e)||ah(e,1,r)||Zm(e,1);else if(r==(yp?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function dh(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||mu.fromSchema(e.state.schema),s=Sh(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=bh[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
52
+
53
+ `),slice:t}}function fh(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new H(V.from(e.state.schema.text(t.replace(/\r\n?/g,`
54
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=mu.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Th(n),Sp&&Eh(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||ru.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!ph.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Dh(yh(s,+u[1],+u[2]),u[4]);else if(s=H.maxOpen(mh(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=yh(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var ph=/^(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 mh(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&gh(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=_h(a[a.length-1],i.length));let n=hh(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return V.from(a)}return e}function hh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V.from(e));return e}function gh(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=gh(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(V.from(hh(n,e,i+1))))}}function _h(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,_h(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(r))}function vh(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=vh(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function yh(e,t,n){return t<e.openStart&&(e=new H(vh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new H(vh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var bh={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},xh=null;function Sh(){return xh||=document.implementation.createHTMLDocument(`title`)}var Ch=null;function wh(e){let t=window.trustedTypes;return t?(Ch||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Ch.createHTML(e)):e}function Th(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Sh().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&bh[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=wh(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Eh(e){let t=e.querySelectorAll(hp?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Dh(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=V.from(t.create(r[e+1],i)),a++,o++}return new H(i,a,o)}var Oh={},kh={},Ah={touchstart:!0,touchmove:!0},jh=class{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 Mh(e){for(let t in Oh){let n=Oh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{One(e,t)&&!Fh(e,t)&&(e.editable||!(t.type in kh))&&n(e,t)},Ah[t]?{passive:!0}:void 0)}_p&&e.dom.addEventListener(`input`,()=>null),Ph(e)}function Nh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Dne(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Ph(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Fh(e,t))})}function Fh(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function One(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function kne(e,t){!Fh(e,t)&&Oh[t.type]&&(e.editable||!(t.type in kh))&&Oh[t.type](e,t)}kh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Vh(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(xp&&hp&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),vp&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,np(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||uh(e,n)?n.preventDefault():Nh(e,`key`)},kh.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},kh.keypress=(e,t)=>{let n=t;if(Vh(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||yp&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof kd)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Ih(e){return{left:e.clientX,top:e.clientY}}function Ane(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Lh(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Rh(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function jne(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&jd.isSelectable(r)?(Rh(e,new jd(n),`pointer`),!0):!1}function Mne(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof jd&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(jd.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Rh(e,jd.create(e.state.doc,i),`pointer`),!0)}function Nne(e,t,n,r,i){return Lh(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Mne(e,n):jne(e,n))}function Pne(e,t,n,r){return Lh(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Fne(e,t,n,r){return Lh(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Ine(e,n,r)}function Ine(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Rh(e,kd.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Rh(e,kd.create(r,a+1,a+1+n.content.size),`pointer`);else if(jd.isSelectable(n))Rh(e,jd.create(r,a),`pointer`);else continue;return!0}}function zh(e){return Wh(e)}var Bh=yp?`metaKey`:`ctrlKey`;Oh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=zh(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Ane(n,e.input.lastClick)&&!n[Bh]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Ih(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Lne(e,o,n,!!r)):(a==`doubleClick`?Pne:Fne)(e,o.pos,o.inside,n)?n.preventDefault():Nh(e,`pointer`))};var Lne=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Bh],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof jd&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&pp&&!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()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Nh(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),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(()=>Nm(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ih(e))),this.updateAllowDefault(e),this.allowDefault||!t?Nh(this.view,`pointer`):Nne(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||_p&&this.mightDrag&&!this.mightDrag.node.isAtom||hp&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Rh(this.view,Td.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Nh(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Nh(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};Oh.touchstart=e=>{e.input.lastTouch=Date.now(),zh(e),Nh(e,`pointer`)},Oh.touchmove=e=>{e.input.lastTouch=Date.now(),Nh(e,`pointer`)},Oh.contextmenu=e=>zh(e);function Vh(e,t){return e.composing?!0:_p&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Rne=xp?5e3:-1;kh.compositionstart=kh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof kd&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||hp&&bp&&zne(e)))e.markCursor=e.state.storedMarks||n.marks(),Wh(e,!0),e.markCursor=null;else if(Wh(e,!t.selection.empty),pp&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Hh(e,Rne)};function zne(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}kh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Hh(e,20))};function Hh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Wh(e),t))}function Uh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Vne());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Bne(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Zf(t.focusNode,t.focusOffset),r=Qf(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Vne(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Wh(e,t=!1){if(!(xp&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Uh(e),t||e.docView&&e.docView.dirty){let n=jm(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Hne(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Gh=dp&&fp<15||vp&&Cp<604;Oh.copy=kh.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Gh?null:n.clipboardData,{dom:o,text:s}=dh(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Hne(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Une(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Wne(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Kh(e,r.value,null,i,t):Kh(e,r.textContent,r.innerHTML,i,t)},50)}function Kh(e,t,n,r,i){let a=fh(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||H.empty)))return!0;if(!a)return!1;let o=Une(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function qh(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}kh.paste=(e,t)=>{let n=t;if(e.composing&&!xp)return;let r=Gh?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Kh(e,qh(r),r.getData(`text/html`),i,n)?n.preventDefault():Wne(e,n)};var Jh=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Gne=yp?`altKey`:`ctrlKey`;function Yh(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Gne]:!n}Oh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Ih(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof jd?i.to-1:i.to))){if(r&&r.mightDrag)o=jd.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=jd.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=dh(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!hp||gp>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Gh?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Gh||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Jh(l,Yh(e,n),o)},Oh.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},kh.dragover=kh.dragenter=(e,t)=>t.preventDefault(),kh.drop=(e,t)=>{try{Kne(e,t,e.dragging)}finally{e.dragging=null}};function Kne(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Ih(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=fh(e,qh(t.dataTransfer),Gh?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Yh(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||H.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?id(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&jd.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new jd(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Hm(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Oh.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Nm(e)},20))},Oh.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Oh.beforeinput=(e,t)=>{if(hp&&xp&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,np(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in kh)Oh[e]=kh[e];function Xh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Zh=class e{constructor(e,t){this.toDOM=e,this.spec=t||tg,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new $h(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Xh(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Qh=class e{constructor(e,t){this.attrs=e,this.spec=t||tg}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new $h(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Xh(this.attrs,t.attrs)&&Xh(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},qne=class e{constructor(e,t){this.attrs=e,this.spec=t||tg}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new $h(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Xh(this.attrs,t.attrs)&&Xh(this.spec,t.spec)}destroy(){}},$h=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Zh(n,r))}static inline(t,n,r,i){return new e(t,n,new Qh(r,i))}static node(t,n,r,i){return new e(t,n,new qne(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Qh}get widget(){return this.type instanceof Zh}},eg=[],tg={},ng=class e{constructor(e,t){this.local=e.length?e:eg,this.children=t.length?t:eg}static create(e,t){return t.length?cg(t,e,0,tg):rg}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==rg||e.maps.length==0?this:this.mapInner(e,t,0,0,n||tg)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Jne(this.children,o||[],t,n,r,i,a):o?new e(o.sort(lg),eg):rg}add(t,n){return n.length?this==rg?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=og(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,cg(s,e,o+1,tg)),a+=3}});let o=ag(a?sg(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(lg):this.local,i||this.children)}remove(e){return e.length==0||this==rg?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==rg?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):rg}forChild(t,n){if(this==rg)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Qh){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(lg),eg);return r?new ig([t,r]):t}return r||rg}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return ug(this.localsInner(e))}localsInner(e){if(this==rg)return eg;if(e.inlineContent||!this.local.some(Qh.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Qh||t.push(this.local[e]);return t}forEachSet(e){e(this)}};ng.empty=new ng([],[]),ng.removeOverlap=ug;var rg=ng.empty,ig=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,tg));return e.from(r)}forChild(t,n){if(n.isLeaf)return ng.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=rg&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?ug(n?t:t.sort(lg)):eg}static from(t){switch(t.length){case 0:return rg;case 1:return t[0];default:return new e(t.every(e=>e instanceof ng)?t:t.reduce((e,t)=>e.concat(t instanceof ng?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Jne(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==rg?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=cg(Yne(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new ng(t.sort(lg),s)}function ag(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new $h(i.from+t,i.to+t,i.type))}return n}function Yne(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function og(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function sg(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function cg(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=og(e,t,o+n);if(s){a=!0;let e=cg(s,t,n+o+1,r);e!=rg&&i.push(o,o+t.nodeSize,e)}});let o=ag(a?sg(e):e,-n).sort(lg);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new ng(o,i):rg}function lg(e,t){return e.from-t.from||e.to-t.to}function ug(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),dg(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),dg(t,i,r.copy(a.from,r.to)));break}}}return t}function dg(e,t,n){for(;t<e.length&&lg(n,e[t])>0;)t++;e.splice(t,0,n)}function fg(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=rg&&t.push(r)}),e.cursorWrapper&&t.push(ng.create(e.state.doc,[e.cursorWrapper.deco])),ig.from(t)}var Xne={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Zne=dp&&fp<=11,Qne=class{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}},$ne=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Qne,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);dp&&fp<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():_p&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Zne&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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,Xne)),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 t=0;t<e.length;t++)this.queue.push(e[t]);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(Um(this.view)){if(this.suppressingSelectionUpdates)return Nm(this.view);if(dp&&fp<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&qf(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 t=new Set,n;for(let n=e.focusNode;n;n=Uf(n))t.add(n);for(let r=e.anchorNode;r;r=Uf(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Um(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(pp&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||nre(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&tp(n)&&(c=jm(e))&&c.eq(Td.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Nm(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),ere(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,rre(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Nm(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(dp&&fp<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Hf(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Hf(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},pg=new WeakMap,mg=!1;function ere(e){if(!pg.has(e)&&(pg.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=pp,mg)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.`),mg=!0}}function hg(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return qf(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function tre(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return hg(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?hg(e,n):null}function nre(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function rre(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function ire(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],tp(c)||l.push({node:c.focusNode,offset:c.focusOffset})),hp&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||ru.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:are,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function are(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(_p&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||_p&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var ore=/^(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 sre(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=jm(e,t);if(n&&!e.state.selection.eq(n)){if(hp&&xp&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,np(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=ire(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=ure(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(vp&&e.input.lastIOSEnter>Date.now()-225||xp)&&i.some(e=>e.nodeType==1&&!ore.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,np(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof kd&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=gg(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof kd&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),dp&&fp<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((vp&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,np(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&lre(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,np(8,`Backspace`)))){xp&&hp&&e.domObserver.suppressSelectionUpdates();return}hp&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),xp&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,np(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=gg(e,n.doc,l.sel);t&&!(hp&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||dp&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){dp&&fp<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Nm(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=cre(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function gg(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Hm(e,t.resolve(n.anchor),t.resolve(n.head))}function cre(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(V.from(l).eq(e))return{mark:s,type:o}}function lre(e,t,n,r,i){if(n-t<=i.pos-r.pos||_g(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(_g(a,!0,!0));return!o.parent.isTextblock||o.pos>n||_g(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function _g(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function ure(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&vg(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&vg(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function vg(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var yg=class{constructor(e,t){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 jh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(wg),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=Sg(this),xg(this),this.nodeViews=Cg(this),this.docView=dm(this.state.doc,bg(this),fg(this),this.dom,this),this.domObserver=new $ne(this,(e,t,n,r)=>sre(this,e,t,n,r)),this.domObserver.start(),Mh(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ph(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(wg),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Uh(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Cg(this);fre(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ph(this),this.editable=Sg(this),xg(this);let o=fg(this),s=bg(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Op(this);if(i){this.domObserver.stop();let t=l&&(dp||hp)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&dre(n.selection,e.selection);if(l){let n=hp?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Bne(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=dm(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Gm(this))?Nm(this,t):(Bm(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Ap(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof jd){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Dp(this,t.getBoundingClientRect(),e)}else Dp(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 e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Jh(e.slice,e.move,r<0?void 0:jd.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(dp){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&&Np(this.dom),Nm(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Vp(this,e)}coordsAtPos(e,t=1){return Gp(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return tm(this,t||this.state,e)}pasteHTML(e,t){return Kh(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Kh(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return dh(this,e)}destroy(){this.docView&&(Dne(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fg(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Kf())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return kne(this,e)}domSelectionRange(){let e=this.domSelection();return e?_p&&this.root.nodeType===11&&rp(this.dom.ownerDocument)==this.dom&&tre(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};yg.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function bg(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[$h.node(0,e.state.doc.content.size,t)]}function xg(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:$h.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Sg(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function dre(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Cg(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function fre(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function wg(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var pre=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),mre=typeof navigator<`u`&&/Win/.test(navigator.platform);function hre(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))pre?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function gre(e){let t=Object.create(null);for(let n in e)t[hre(n)]=e[n];return t}function Tg(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function _re(e){return new qd({props:{handleKeyDown:Eg(e)}})}function Eg(e){let t=gre(e);return function(e,n){let r=ne(n),i,a=t[Tg(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Tg(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(mre&&n.ctrlKey&&n.altKey)&&(i=tee[n.keyCode])&&i!=r){let r=t[Tg(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var vre=Object.defineProperty,Dg=(e,t)=>{for(var n in t)vre(e,n,{get:t[n],enumerable:!0})};function Og(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var kg=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Og({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Ag={};Dg(Ag,{blur:()=>yre,clearContent:()=>bre,clearNodes:()=>xre,command:()=>Sre,createParagraphNear:()=>Cre,cut:()=>wre,deleteCurrentNode:()=>Tre,deleteNode:()=>Ere,deleteRange:()=>Dre,deleteSelection:()=>Ore,enter:()=>kre,exitCode:()=>Are,extendMarkRange:()=>jre,first:()=>Mre,focus:()=>Pre,forEach:()=>Fre,insertContent:()=>Ire,insertContentAt:()=>zre,joinBackward:()=>Hre,joinDown:()=>Vre,joinForward:()=>Ure,joinItemBackward:()=>Wre,joinItemForward:()=>Gre,joinTextblockBackward:()=>Kre,joinTextblockForward:()=>qre,joinUp:()=>Bre,keyboardShortcut:()=>Yre,lift:()=>Xre,liftEmptyBlock:()=>Zre,liftListItem:()=>Qre,newlineInCode:()=>$re,resetAttributes:()=>eie,scrollIntoView:()=>tie,selectAll:()=>nie,selectNodeBackward:()=>rie,selectNodeForward:()=>iie,selectParentNode:()=>aie,selectTextblockEnd:()=>oie,selectTextblockStart:()=>sie,setContent:()=>cie,setMark:()=>Eie,setMeta:()=>Die,setNode:()=>Oie,setNodeSelection:()=>kie,setTextDirection:()=>Aie,setTextSelection:()=>jie,sinkListItem:()=>Mie,splitBlock:()=>Nie,splitListItem:()=>Pie,toggleList:()=>Iie,toggleMark:()=>Lie,toggleNode:()=>Rie,toggleWrap:()=>zie,undoInputRule:()=>Bie,unsetAllMarks:()=>Vie,unsetMark:()=>Hie,unsetTextDirection:()=>Uie,updateAttributes:()=>Wie,wrapIn:()=>Gie,wrapInList:()=>Kie});var yre=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),bre=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),xre=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Vu(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Sre=e=>t=>e(t),Cre=()=>({state:e,dispatch:t})=>_f(e,t),wre=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new kd(r.doc.resolve(Math.max(o-1,0)))),!0},Tre=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function jg(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Ere=e=>({tr:t,state:n,dispatch:r})=>{let i=jg(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Dre=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Ore=()=>({state:e,dispatch:t})=>Zd(e,t),kre=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Are=()=>({state:e,dispatch:t})=>gf(e,t);function Mg(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Ng(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:Mg(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Pg(e,t,n={}){return e.find(e=>e.type===t&&Ng(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Fg(e,t,n={}){return!!Pg(e,t,n)}function Ig(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Pg([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Fg([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Fg([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function Lg(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var jre=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=Lg(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Ig(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=kd.create(o,e.from,e.to);n.setSelection(t)}}return!0},Mre=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Rg(e){return e instanceof kd}function zg(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Bg(e,t=null){if(!t)return null;let n=Td.atStart(e),r=Td.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?kd.create(e,zg(0,i,a),zg(e.content.size,i,a)):kd.create(e,zg(t,i,a),zg(t,i,a))}function Vg(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Hg(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Nre(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Pre=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Hg()||Vg())&&r.dom.focus(),Nre()&&!Hg()&&!Vg()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!Rg(n.state.selection))return o(),!0;let s=Bg(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Fre=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Ire=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ug=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ug(r)}return e};function Wg(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Ug(n)}function Gg(e,t,n){if(e instanceof Hl||e instanceof V)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return V.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Gg(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new tu({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?ru.fromSchema(a).parseSlice(Wg(e),n.parseOptions):ru.fromSchema(a).parse(Wg(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=ru.fromSchema(t);return n.slice?r.parseSlice(Wg(e),n.parseOptions).content:r.parse(Wg(e),n.parseOptions)}return Gg(``,t,n)}function Lre(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Lu||i instanceof Ru))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(Td.near(e.doc.resolve(o),n))}var Rre=e=>!(`type`in e),zre=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Gg(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Gg(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Rre(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof V){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Lre(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Bre=()=>({state:e,dispatch:t})=>df(e,t),Vre=()=>({state:e,dispatch:t})=>ff(e,t),Hre=()=>({state:e,dispatch:t})=>$d(e,t),Ure=()=>({state:e,dispatch:t})=>cf(e,t),Wre=()=>({state:e,dispatch:t,tr:n})=>{try{let r=td(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Gre=()=>({state:e,dispatch:t,tr:n})=>{try{let r=td(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Kre=()=>({state:e,dispatch:t})=>ef(e,t),qre=()=>({state:e,dispatch:t})=>tf(e,t);function Kg(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Jre(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Hg()||Kg()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Yre=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Jre(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function qg(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?jg(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Ng(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Xre=(e,t={})=>({state:n,dispatch:r})=>qg(n,jg(e,n.schema),t)?pf(n,r):!1,Zre=()=>({state:e,dispatch:t})=>vf(e,t),Qre=e=>({state:t,dispatch:n})=>Rf(jg(e,t.schema))(t,n),$re=()=>({state:e,dispatch:t})=>mf(e,t);function Jg(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Yg(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var eie=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Jg(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=jg(e,r.schema)),s===`mark`&&(o=Lg(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Yg(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Yg(a.attrs,t))))})})}),c},tie=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),nie=()=>({tr:e,dispatch:t})=>{if(t){let t=new Nd(e.doc);e.setSelection(t)}return!0},rie=()=>({state:e,dispatch:t})=>af(e,t),iie=()=>({state:e,dispatch:t})=>lf(e,t),aie=()=>({state:e,dispatch:t})=>xf(e,t),oie=()=>({state:e,dispatch:t})=>Df(e,t),sie=()=>({state:e,dispatch:t})=>Ef(e,t);function Xg(e,t,n={},r={}){return Gg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var cie=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Xg(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Zg(e,t){let n=Lg(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function Qg(e,t){let n=new Cd(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function lie(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function uie(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function $g(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function e_(e){return t=>$g(t.$from,e)}function t_(e,t,n){return e.config[t]===void 0&&e.parent?t_(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?t_(e.parent,t,n):null}):e.config[t]}function n_(e){return e.map(e=>{let t=t_(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...n_(t())]:e}).flat(10)}function r_(e,t){let n=mu.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function i_(e){return typeof e==`function`}function a_(e,t=void 0,...n){return i_(e)?t?e.bind(t)(...n):e(...n):e}function die(e={}){return Object.keys(e).length===0&&e.constructor===Object}function o_(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function s_(e){let t=[],{nodeExtensions:n,markExtensions:r}=o_(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=t_(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=t_(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function fie(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function c_(e){let t=[],n=fie(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function l_(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...c_(n[e]),...c_(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function u_(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>l_(e,t),{})}function pie(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function d_(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):pie(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function f_(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&die(t)?!1:t!=null))}function p_(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function m_(e,t){let n=s_(e),{nodeExtensions:r,markExtensions:i}=o_(e);return new tu({topNode:r.find(e=>t_(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=f_({...e.reduce((e,t)=>{let n=t_(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:a_(t_(r,`content`,a)),marks:a_(t_(r,`marks`,a)),group:a_(t_(r,`group`,a)),inline:a_(t_(r,`inline`,a)),atom:a_(t_(r,`atom`,a)),selectable:a_(t_(r,`selectable`,a)),draggable:a_(t_(r,`draggable`,a)),code:a_(t_(r,`code`,a)),whitespace:a_(t_(r,`whitespace`,a)),linebreakReplacement:a_(t_(r,`linebreakReplacement`,a)),defining:a_(t_(r,`defining`,a)),isolating:a_(t_(r,`isolating`,a)),attrs:Object.fromEntries(i.map(p_))}),s=a_(t_(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>d_(e,i)));let c=t_(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:u_(e,i)}));let l=t_(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=f_({...e.reduce((e,t)=>{let n=t_(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:a_(t_(r,`inclusive`,a)),excludes:a_(t_(r,`excludes`,a)),group:a_(t_(r,`group`,a)),spanning:a_(t_(r,`spanning`,a)),code:a_(t_(r,`code`,a)),attrs:Object.fromEntries(i.map(p_))}),s=a_(t_(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>d_(e,i)));let c=t_(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:u_(e,i)})),[r.name,o]}))})}function mie(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function h_(e){return e.sort((e,t)=>{let n=t_(e,`priority`)||100,r=t_(t,`priority`)||100;return n>r?-1:+(n<r)})}function g_(e){let t=h_(n_(e)),n=mie(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function __(e,t){return m_(g_(e),t)}function v_(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
55
+
56
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function y_(e,t){return v_(e,{from:0,to:e.content.size},t)}function b_(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function hie(e,t){let n=jg(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function x_(e,t){let n=Jg(typeof t==`string`?t:t.name,e.schema);return n===`node`?hie(e,t):n===`mark`?Zg(e,t):{}}function gie(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function _ie(e){let t=gie(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function S_(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),_ie(r)}function C_(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Ig(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var vie=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function w_(e,t){return t.nodes[e]||t.marks[e]||null}function T_(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var yie=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function E_(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Lg(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Ng(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Ng(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function bie(e,t,n={}){if(!t)return qg(e,null,n)||E_(e,null,n);let r=Jg(t,e.schema);return r===`node`?qg(e,t,n):r===`mark`?E_(e,t,n):!1}var xie=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=e_(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Sie=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function D_(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function O_(e,t){let{nodeExtensions:n}=o_(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=a_(t_(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function k_(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(k_(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function A_(e){return e instanceof jd}var j_=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function M_(e,t){let n=t.mapping.mapResult(e.position);return{position:new j_(n.pos),mapResult:n}}function Cie(e){return new j_(e)}function wie(e,t,n){let r=e.state.doc.content.size,i=zg(t,0,r),a=zg(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function Tie(e,t,n){let{selection:r}=t,i=null;if(Rg(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Eie=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Lg(e,r.schema);if(i)if(o){let e=Zg(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Tie(r,n,c)},Die=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Oie=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=jg(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>kf(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>kf(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},kie=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=zg(e,0,n.content.size),i=jd.create(n,r);t.setSelection(i)}return!0},Aie=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},jie=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=kd.atStart(n).from,o=kd.atEnd(n).to,s=zg(r,a,o),c=zg(i,a,o),l=kd.create(n,s,c);t.setSelection(l)}return!0},Mie=e=>({state:t,dispatch:n})=>Vf(jg(e,t.schema))(t,n);function N_(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Nie=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=T_(l,s.node().type.name,s.node().attrs);if(a instanceof jd&&a.node.isBlock)return!s.parentOffset||!Xu(o,s.pos)?!1:(r&&(e&&N_(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:lie(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Xu(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Xu(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof kd&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&N_(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},Pie=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=jg(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=V.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=V.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...T_(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(V.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new H(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(kd.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...T_(d,u.type.name,u.attrs),...t},m={...T_(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Xu(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},P_=(e,t)=>{let n=e_(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Qu(e.doc,n.pos)&&e.join(n.pos),!0},F_=(e,t)=>{let n=e_(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Qu(e.doc,r)&&e.join(r),!0};function Fie(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return kd.create(t,1,r)}var Iie=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=jg(e,o.schema),m=jg(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=e_(e=>O_(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&O_(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=Fie(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(O_(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>P_(a,p)).command(()=>F_(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>P_(a,p)).command(()=>F_(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>P_(a,p)).command(()=>F_(a,p)).run()},Lie=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Lg(e,r.schema);return E_(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Rie=(e,t,n={})=>({state:r,commands:i})=>{let a=jg(e,r.schema),o=jg(t,r.schema),s=qg(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},zie=(e,t={})=>({state:n,commands:r})=>{let i=jg(e,n.schema);return qg(n,i,t)?r.lift(i):r.wrapIn(i,t)},Bie=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Vie=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Hie=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Lg(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Ig(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Uie=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Wie=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Jg(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=jg(e,r.schema)),s===`mark`&&(o=Lg(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Gie=(e,t={})=>({state:n,dispatch:r})=>Of(jg(e,n.schema),t)(n,r),Kie=(e,t={})=>({state:n,dispatch:r})=>Ff(jg(e,n.schema),t)(n,r),qie=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},I_=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Jie=(e,t)=>{if(Mg(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function L_(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=yie(c)+i;return a.forEach(e=>{if(l)return;let a=Jie(u,e.find);if(!a)return;let c=s.state.tr,d=Og({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new kg({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Yie(e){let{editor:t,rules:n}=e,r=new qd({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:r_(V.from(e),a.schema);let{from:i}=s;L_({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return L_({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&L_({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?L_({editor:t,from:a.pos,to:a.pos,text:`
57
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Xie(e){return Object.prototype.toString.call(e).slice(8,-1)}function R_(e){return Xie(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function z_(e,t){let n={...e};return R_(e)&&R_(t)&&Object.keys(t).forEach(r=>{R_(t[r])&&R_(e[r])?n[r]=z_(e[r],t[r]):n[r]=t[r]}),n}var B_=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...a_(t_(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...a_(t_(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>z_(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},V_=class e extends B_{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Zie(e){return typeof e==`number`}var Qie=class{constructor(e){this.find=e.find,this.handler=e.handler}},$ie=(e,t,n)=>{if(Mg(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function eae(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new kg({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||$ie(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var H_=null,tae=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function nae(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!eae({editor:t,state:Og({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new qd({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(H_=t)},i=()=>{H_&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=H_;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:r_(V.from(t),r.schema);let{from:n}=d,i=n+t.length,a=tae(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Zie(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var U_=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=g_(e),this.schema=m_(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=t_(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:w_(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return h_([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:w_(t.name,this.schema)},r=[],i=t_(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&t_(t,`exitable`,n)&&(a.ArrowRight=()=>V_.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=_re(a);r.push(o);let s=t_(t,`addInputRules`,n);if(D_(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Yie({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=t_(t,`addPasteRules`,n);if(D_(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=nae({editor:e,rules:t});r.push(...n)}}let l=t_(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return s_(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=o_(this.extensions);return Object.fromEntries(t.filter(e=>!!t_(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=t_(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:jg(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:u_(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return h_([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:w_(n.name,this.schema)},i=t_(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return h_([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:w_(n.name,this.schema)},i=t_(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=o_(this.extensions);return Object.fromEntries(t.filter(e=>!!t_(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=t_(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Lg(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=u_(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Cv(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:w_(e.name,this.schema)};e.type===`mark`&&(a_(t_(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=t_(e,`onBeforeCreate`,t),r=t_(e,`onCreate`,t),i=t_(e,`onUpdate`,t),a=t_(e,`onSelectionUpdate`,t),o=t_(e,`onTransaction`,t),s=t_(e,`onFocus`,t),c=t_(e,`onBlur`,t),l=t_(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};U_.resolve=g_,U_.sort=h_,U_.flatten=n_,Dg({},{ClipboardTextSerializer:()=>G_,Commands:()=>K_,Delete:()=>q_,Drop:()=>J_,Editable:()=>Y_,FocusEvents:()=>Z_,Keymap:()=>Q_,Paste:()=>$_,Tabindex:()=>ev,TextDirection:()=>tv,focusEventsPluginKey:()=>X_});var W_=class e extends B_{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},G_=W_.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new qd({key:new Xd(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=b_(n);return v_(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),K_=W_.create({name:`commands`,addCommands(){return{...Ag}}}),q_=W_.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=Qg(e.before,[e,...t]);S_(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Pu){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),J_=W_.create({name:`drop`,addProseMirrorPlugins(){return[new qd({key:new Xd(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Y_=W_.create({name:`editable`,addProseMirrorPlugins(){return[new qd({key:new Xd(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),X_=new Xd(`focusEvents`),Z_=W_.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new qd({key:X_,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Q_=W_.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:Td.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hg()||Kg()?i:r},addProseMirrorPlugins(){return[new qd({key:new Xd(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=Td.atStart(t.doc).from,l=Td.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!k_(n.doc))return;let u=n.tr,d=Og({state:n,transaction:u}),{commands:f}=new kg({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),$_=W_.create({name:`paste`,addProseMirrorPlugins(){return[new qd({key:new Xd(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),ev=W_.create({name:`tabindex`,addProseMirrorPlugins(){return[new qd({key:new Xd(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),tv=W_.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=o_(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new qd({key:new Xd(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),rae=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},iae=`.ProseMirror {
58
+ position: relative;
59
+ }
60
+
61
+ .ProseMirror {
62
+ word-wrap: break-word;
63
+ white-space: pre-wrap;
64
+ white-space: break-spaces;
65
+ -webkit-font-variant-ligatures: none;
66
+ font-variant-ligatures: none;
67
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
68
+ }
69
+
70
+ .ProseMirror [contenteditable="false"] {
71
+ white-space: normal;
72
+ }
73
+
74
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
75
+ white-space: pre-wrap;
76
+ }
77
+
78
+ .ProseMirror pre {
79
+ white-space: pre-wrap;
80
+ }
81
+
82
+ img.ProseMirror-separator {
83
+ display: inline !important;
84
+ border: none !important;
85
+ margin: 0 !important;
86
+ width: 0 !important;
87
+ height: 0 !important;
88
+ }
89
+
90
+ .ProseMirror-gapcursor {
91
+ display: none;
92
+ pointer-events: none;
93
+ position: absolute;
94
+ margin: 0;
95
+ }
96
+
97
+ .ProseMirror-gapcursor:after {
98
+ content: "";
99
+ display: block;
100
+ position: absolute;
101
+ top: -2px;
102
+ width: 20px;
103
+ border-top: 1px solid black;
104
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
105
+ }
106
+
107
+ @keyframes ProseMirror-cursor-blink {
108
+ to {
109
+ visibility: hidden;
110
+ }
111
+ }
112
+
113
+ .ProseMirror-hideselection *::selection {
114
+ background: transparent;
115
+ }
116
+
117
+ .ProseMirror-hideselection *::-moz-selection {
118
+ background: transparent;
119
+ }
120
+
121
+ .ProseMirror-hideselection * {
122
+ caret-color: transparent;
123
+ }
124
+
125
+ .ProseMirror-focused .ProseMirror-gapcursor {
126
+ display: block;
127
+ }`;function aae(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var oae=class extends qie{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:M_,createMappablePosition:Cie},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=Bg(t,this.options.autofocus);this.editorState=Gd.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=aae(iae,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=i_(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new U_([...this.options.enableCoreExtensions?[Y_,G_.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),K_,Z_,Q_,ev,J_,$_,q_,tv.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new kg({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Xg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=Xg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new yg(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return x_(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return bie(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return r_(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
128
+
129
+ `,textSerializers:n={}}=e||{};return y_(this.state.doc,{blockSeparator:t,textSerializers:{...b_(this.schema),...n}})}get isEmpty(){return k_(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new rae(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function nv(e){return new I_({find:e.find,handler:({state:t,range:n,match:r})=>{let i=a_(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(C_(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function rv(e){return new I_({find:e.find,handler:({state:t,range:n,match:r})=>{let i=a_(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function iv(e){return new I_({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=a_(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function av(e){return new I_({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=a_(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Hu(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Qu(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var ov=e=>`touches`in e,sv=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,ov(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function cv(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof jd){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function lv(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function uv(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}Dg({},{createAtomBlockMarkdownSpec:()=>pv,createBlockMarkdownSpec:()=>mv,createInlineMarkdownSpec:()=>_v,parseAttributes:()=>dv,parseIndentedBlocks:()=>vv,renderNestedMarkdownContent:()=>yv,serializeAttributes:()=>fv});function dv(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function fv(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function pv(e){let{nodeName:t,name:n,parseAttributes:r=dv,serializeAttributes:i=fv,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function mv(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=dv,serializeAttributes:a=fv,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
130
+
131
+ ${t.renderChildren(e.content||[],`
132
+
133
+ `)}
134
+
135
+ :::`}}}function hv(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function gv(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function _v(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=hv,serializeAttributes:a=gv,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function vv(e,t,n){let r=e.split(`
136
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
137
+ `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
138
+ `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
139
+ `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
140
+ `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
141
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function yv(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
142
+ `).map(e=>e?t.indent(e):t.indent(``)).join(`
143
+ `);s+=e.type===`paragraph`?`
144
+
145
+ ${n}`:`
146
+ ${n}`}}),s}var bv=new WeakMap;function xv(e,t){let n=bv.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};bv.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function Sv(e,t){let n=bv.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),bv.delete(e)))}function Cv(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var wv=class e extends B_{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Tv=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=jd.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=jd.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Hg()||Vg())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Ev(e){return new Qie({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=a_(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(C_(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var Dv=Ra(),{getOwnPropertyNames:Ov,getOwnPropertySymbols:kv}=Object,{hasOwnProperty:Av}=Object.prototype;function jv(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Mv(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Nv(e){return e?.[Symbol.toStringTag]}function Pv(e){return Ov(e).concat(kv(e))}var Fv=Object.hasOwn||((e,t)=>Av.call(e,t));function Iv(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Lv=`__v`,Rv=`__o`,zv=`_owner`,{getOwnPropertyDescriptor:Bv,keys:Vv}=Object;function Hv(e,t){return e.byteLength===t.byteLength&&ty(new Uint8Array(e),new Uint8Array(t))}function Uv(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Wv(e,t){return e.byteLength===t.byteLength&&ty(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Gv(e,t){return Iv(e.getTime(),t.getTime())}function Kv(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function qv(e,t){return e===t}function Jv(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Yv=Iv;function Xv(e,t,n){let r=Vv(e),i=r.length;if(Vv(t).length!==i)return!1;for(;i-- >0;)if(!ry(e,t,n,r[i]))return!1;return!0}function Zv(e,t,n){let r=Pv(e),i=r.length;if(Pv(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!ry(e,t,n,a)||(o=Bv(e,a),s=Bv(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Qv(e,t){return Iv(e.valueOf(),t.valueOf())}function $v(e,t){return e.source===t.source&&e.flags===t.flags}function ey(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function ty(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function ny(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ry(e,t,n,r){return(r===zv||r===Rv||r===Lv)&&(e.$$typeof||t.$$typeof)?!0:Fv(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var iy=`[object ArrayBuffer]`,ay=`[object Arguments]`,oy=`[object Boolean]`,sy=`[object DataView]`,cy=`[object Date]`,ly=`[object Error]`,uy=`[object Map]`,dy=`[object Number]`,fy=`[object Object]`,py=`[object RegExp]`,my=`[object Set]`,hy=`[object String]`,gy={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},_y=`[object URL]`,vy=Object.prototype.toString;function yy({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=vy.call(h);if(b===cy)return r(h,g,_);if(b===py)return u(h,g,_);if(b===uy)return o(h,g,_);if(b===my)return d(h,g,_);if(b===fy)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===_y)return p(h,g,_);if(b===ly)return i(h,g,_);if(b===ay)return c(h,g,_);if(gy[b])return f(h,g,_);if(b===iy)return e(h,g,_);if(b===sy)return n(h,g,_);if(b===oy||b===dy||b===hy)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Nv(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function by({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Hv,areArraysEqual:n?Zv:Uv,areDataViewsEqual:Wv,areDatesEqual:Gv,areErrorsEqual:Kv,areFunctionsEqual:qv,areMapsEqual:n?jv(Jv,Zv):Jv,areNumbersEqual:Yv,areObjectsEqual:n?Zv:Xv,arePrimitiveWrappersEqual:Qv,areRegExpsEqual:$v,areSetsEqual:n?jv(ey,Zv):ey,areTypedArraysEqual:n?jv(ty,Zv):ty,areUrlsEqual:ny,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Mv(r.areArraysEqual),t=Mv(r.areMapsEqual),n=Mv(r.areObjectsEqual),i=Mv(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function xy(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Sy({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Cy=wy();wy({strict:!0}),wy({circular:!0}),wy({circular:!0,strict:!0}),wy({createInternalComparator:()=>Iv}),wy({strict:!0,createInternalComparator:()=>Iv}),wy({circular:!0,createInternalComparator:()=>Iv}),wy({circular:!0,createInternalComparator:()=>Iv,strict:!0});function wy(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=yy(by(e));return Sy({circular:t,comparator:a,createState:r,equals:n?n(a):xy(a),strict:i})}var Ty=Je((e=>{var t=Bt(),n=Ra();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ey=Je(((e,t)=>{t.exports=Ty()}))(),Dy=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Oy=({contentComponent:e})=>{let t=(0,Dv.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,B.jsx)(B.Fragment,{children:Object.values(t)})};function ky(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:_n.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Ay=class extends z.Component{constructor(e){super(e),this.editorContentRef=z.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=ky(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{ref:Dy(t,this.editorContentRef),...n}),e?.contentComponent&&(0,B.jsx)(Oy,{contentComponent:e.contentComponent})]})}},jy=(0,z.forwardRef)((e,t)=>{let n=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return z.createElement(Ay,{key:n,innerRef:t,...e})}),My=z.memo(jy),Ny=typeof window<`u`?z.useLayoutEffect:z.useEffect,Py=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Fy(e){let[t]=(0,z.useState)(()=>new Py(e.editor)),n=(0,Ey.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Cy);return Ny(()=>t.watch(e.editor),[e.editor,t]),(0,z.useDebugValue)(n),n}typeof window>`u`||typeof window<`u`&&window.next;var Iy=(0,z.createContext)({editor:null});Iy.Consumer;var Ly=()=>(0,z.useContext)(Iy),Ry=(0,z.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),zy=()=>(0,z.useContext)(Ry),By=z.forwardRef((e,t)=>{let{onDragStart:n}=zy();return(0,B.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function Vy(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function Hy(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function Uy(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function Wy(e){if(Vy(e)||Hy(e))return!0;if(Uy(e)){let t=e.type;if(t)return Vy(t)||Hy(t)}return!1}function Gy(){try{if(z.version)return parseInt(z.version.split(`.`)[0],10)>=19}catch{}return!1}var Ky=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,_n.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=Gy(),a=Wy(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,B.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};z.createContext({markViewContentRef:()=>{}});var qy=class extends Tv{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,z.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,z.memo)(e=>(0,B.jsx)(Ry.Provider,{value:t,children:(0,z.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Ky(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},xv(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(Sv(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=u_(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Jy(e,t){return n=>n.editor.contentComponent?new qy(e,n,t):{}}var Yy=(0,z.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Yy.displayName=`TiptapContext`;var Xy=()=>(0,z.useContext)(Yy);function Zy({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,z.useMemo)(()=>({editor:r}),[r]),a=(0,z.useMemo)(()=>({editor:r}),[r]);return(0,B.jsx)(Iy.Provider,{value:a,children:(0,B.jsx)(Yy.Provider,{value:i,children:n})})}Zy.displayName=`Tiptap`;function Qy({...e}){let{editor:t}=Xy();return(0,B.jsx)(My,{editor:t,...e})}Qy.displayName=`Tiptap.Content`,Object.assign(Zy,{Content:Qy});var $y=()=>new Map,eb=e=>{let t=$y();return e.forEach((e,n)=>{t.set(n,e)}),t},tb=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},nb=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},rb=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},ib=()=>new Set,ab=e=>e[e.length-1],ob=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},sb=Array.from,cb=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},lb=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},ub=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},db=Array.isArray,fb=class{constructor(){this._observers=$y()}on(e,t){return tb(this._observers,e,ib).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return sb((this._observers.get(e)||$y()).values()).forEach(e=>e(...t))}destroy(){this._observers=$y()}},pb=Math.floor,mb=Math.abs,hb=(e,t)=>e<t?e:t,gb=(e,t)=>e>t?e:t;Number.isNaN;var _b=e=>e===0?1/e<0:e<0,vb=1<<17,yb=1<<18,bb=1<<19,xb=1<<20,Sb=1<<21,Cb=1<<22,wb=1<<23,Tb=1<<24,Eb=1<<25,Db=1<<26,Ob=1<<27,kb=1<<28,Ab=1<<29;vb-1,yb-1,bb-1,xb-1,Sb-1,Cb-1,wb-1,Tb-1,Eb-1,Db-1,Ob-1,kb-1,Ab-1;var jb=2**53-1,Mb=-(2**53-1),Nb=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&pb(e)===e);Number.isNaN,Number.parseInt;var Pb=String.fromCharCode;String.fromCodePoint,Pb(65535);var Fb=e=>e.toLowerCase(),Ib=/^\s*/g,Lb=e=>e.replace(Ib,``),Rb=/([A-Z])/g,zb=(e,t)=>Lb(e.replace(Rb,e=>`${t}${Fb(e)}`)),Bb=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Vb=typeof TextEncoder<`u`?new TextEncoder:null,Hb=Vb?e=>Vb.encode(e):Bb,Ub=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Ub&&Ub.decode(new Uint8Array).length===1&&(Ub=null);var Wb=(e,t)=>ub(t,()=>e).join(``),Gb=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Kb=()=>new Gb,qb=e=>{let t=Kb();return e(t),Yb(t)},Jb=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},Yb=e=>{let t=new Uint8Array(Jb(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Xb=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(gb(n,t)*2),e.cpos=0)},Zb=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Qb=Zb,$b=(e,t)=>{for(;t>127;)Zb(e,128|127&t),t=pb(t/128);Zb(e,127&t)},ex=(e,t)=>{let n=_b(t);for(n&&(t=-t),Zb(e,(t>63?128:0)|(n?64:0)|63&t),t=pb(t/64);t>0;)Zb(e,(t>127?128:0)|127&t),t=pb(t/128)},tx=new Uint8Array(3e4),nx=tx.length/3,rx=Vb&&Vb.encodeInto?(e,t)=>{if(t.length<nx){let n=Vb.encodeInto(t,tx).written||0;$b(e,n);for(let t=0;t<n;t++)Zb(e,tx[t])}else ax(e,Hb(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;$b(e,r);for(let t=0;t<r;t++)Zb(e,n.codePointAt(t))},ix=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=hb(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(gb(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},ax=(e,t)=>{$b(e,t.byteLength),ix(e,t)},ox=(e,t)=>{Xb(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},sx=(e,t)=>ox(e,4).setFloat32(0,t,!1),cx=(e,t)=>ox(e,8).setFloat64(0,t,!1),lx=(e,t)=>ox(e,8).setBigInt64(0,t,!1),ux=new DataView(new ArrayBuffer(4)),dx=e=>(ux.setFloat32(0,e),ux.getFloat32(0)===e),fx=(e,t)=>{switch(typeof t){case`string`:Zb(e,119),rx(e,t);break;case`number`:Nb(t)&&mb(t)<=2147483647?(Zb(e,125),ex(e,t)):dx(t)?(Zb(e,124),sx(e,t)):(Zb(e,123),cx(e,t));break;case`bigint`:Zb(e,122),lx(e,t);break;case`object`:if(t===null)Zb(e,126);else if(db(t)){Zb(e,117),$b(e,t.length);for(let n=0;n<t.length;n++)fx(e,t[n])}else if(t instanceof Uint8Array)Zb(e,116),ax(e,t);else{Zb(e,118);let n=Object.keys(t);$b(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];rx(e,i),fx(e,t[i])}}break;case`boolean`:Zb(e,t?120:121);break;default:Zb(e,127)}},px=class extends Gb{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&$b(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},mx=e=>{e.count>0&&(ex(e.encoder,e.count===1?e.s:-e.s),e.count>1&&$b(e.encoder,e.count-2))},hx=class{constructor(){this.encoder=new Gb,this.s=0,this.count=0}write(e){this.s===e?this.count++:(mx(this),this.count=1,this.s=e)}toUint8Array(){return mx(this),Yb(this.encoder)}},gx=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);ex(e.encoder,t),e.count>1&&$b(e.encoder,e.count-2)}},_x=class{constructor(){this.encoder=new Gb,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(gx(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return gx(this),Yb(this.encoder)}},vx=class{constructor(){this.sarr=[],this.s=``,this.lensE=new hx}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new Gb;return this.sarr.push(this.s),this.s=``,rx(e,this.sarr.join(``)),ix(e,this.lensE.toUint8Array()),Yb(e)}},yx=e=>Error(e),bx=()=>{throw yx(`Method unimplemented`)},xx=()=>{throw yx(`Unexpected case`)},Sx=yx(`Unexpected end of array`),Cx=yx(`Integer out of Range`),wx=class{constructor(e){this.arr=e,this.pos=0}},Tx=e=>new wx(e),Ex=e=>e.pos!==e.arr.length,Dx=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Ox=e=>Dx(e,Ax(e)),kx=e=>e.arr[e.pos++],Ax=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>jb)throw Cx}throw Sx},jx=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>jb)throw Cx}throw Sx},Mx=Ub?e=>Ub.decode(Ox(e)):e=>{let t=Ax(e);if(t===0)return``;{let n=String.fromCodePoint(kx(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(kx(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Nx=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Px=[e=>void 0,e=>null,jx,e=>Nx(e,4).getFloat32(0,!1),e=>Nx(e,8).getFloat64(0,!1),e=>Nx(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Mx,e=>{let t=Ax(e),n={};for(let r=0;r<t;r++){let t=Mx(e);n[t]=Fx(e)}return n},e=>{let t=Ax(e),n=[];for(let r=0;r<t;r++)n.push(Fx(e));return n},Ox],Fx=e=>Px[127-kx(e)](e),Ix=class extends wx{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Ex(this)?this.count=Ax(this)+1:this.count=-1),this.count--,this.s}},Lx=class extends wx{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=jx(this);let e=_b(this.s);this.count=1,e&&(this.s=-this.s,this.count=Ax(this)+2)}return this.count--,this.s}},Rx=class extends wx{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=jx(this),t=e&1;this.diff=pb(e/2),this.count=1,t&&(this.count=Ax(this)+2)}return this.s+=this.diff,this.count--,this.s}},zx=class{constructor(e){this.decoder=new Lx(e),this.str=Mx(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var Bx=crypto.getRandomValues.bind(crypto),Vx=Math.random,Hx=()=>Bx(new Uint32Array(1))[0],Ux=e=>e[pb(Vx()*e.length)],Wx=`10000000-1000-4000-8000-100000000000`,Gx=()=>Wx.replace(/[018]/g,e=>(e^Hx()&15>>e/4).toString(16)),Kx=Date.now,qx=e=>new Promise(e);Promise.all.bind(Promise);var Jx=e=>e===void 0?null:e,Yx=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{typeof localStorage<`u`&&localStorage&&(Yx=localStorage)}catch{}var Xx=Yx,Zx=Symbol(`Equality`),Qx=(e,t)=>e===t||!!e?.[Zx]?.(t)||!1,$x=e=>typeof e==`object`,eS=Object.assign,tS=Object.keys,nS=(e,t)=>{for(let n in e)t(e[n],n)},rS=e=>tS(e).length,iS=e=>{for(let t in e)return!1;return!0},aS=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},oS=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),sS=(e,t)=>e===t||rS(e)===rS(t)&&aS(e,(e,n)=>(e!==void 0||oS(t,n))&&Qx(t[n],e)),cS=Object.freeze,lS=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&lS(e[t])}return cS(e)},uS=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&uS(e,t,n+1)}},dS=e=>e,fS=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Zx]!=null)return e[Zx](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!fS(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(rS(e)!==rS(t))return!1;for(let n in e)if(!oS(e,n)||!fS(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!fS(e[n],t[n]))return!1;break;default:return!1}return!0},pS=(e,t)=>t.includes(e),mS=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,hS=typeof window<`u`&&typeof document<`u`&&!mS;typeof navigator<`u`&&/Mac/.test(navigator.platform);var gS,_S=[],vS=()=>{if(gS===void 0)if(mS){gS=$y();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&gS.set(t,``),t=r):t===null?_S.push(r):(gS.set(t,r),t=null)}t!==null&&gS.set(t,``)}else typeof location==`object`?(gS=$y(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);gS.set(`--${zb(t,`-`)}`,n),gS.set(`-${zb(t,`-`)}`,n)}})):gS=$y();return gS},yS=e=>vS().has(e),bS=e=>Jx(mS?{}[e.toUpperCase().replaceAll(`-`,`_`)]:Xx.getItem(e)),xS=e=>yS(`--`+e)||bS(e)!==null,SS=xS(`production`),CS=mS&&pS({}.FORCE_COLOR,[`true`,`1`,`2`])||!yS(`--no-colors`)&&!xS(`no-color`)&&(!mS||process.stdout.isTTY)&&(!mS||yS(`--color`)||bS(`COLORTERM`)!==null||(bS(`TERM`)||``).includes(`color`)),wS=e=>new Uint8Array(e),TS=hS?e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=Pb(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),ES=e=>{let t=wS(e.byteLength);return t.set(e),t},DS=e=>qb(t=>fx(t,e)),OS=class{constructor(e,t){this.left=e,this.right=t}},kS=(e,t)=>new OS(e,t),AS=(e,t)=>e.forEach(e=>t(e.left,e.right)),jS=e=>e.next()>=.5,MS=(e,t,n)=>pb(e.next()*(n+1-t)+t),NS=(e,t,n)=>pb(e.next()*(n+1-t)+t),PS=(e,t,n)=>NS(e,t,n),FS=e=>Pb(PS(e,97,122)),IS=(e,t=0,n=20)=>{let r=PS(e,t,n),i=``;for(let t=0;t<r;t++)i+=FS(e);return i},LS=(e,t)=>t[PS(e,0,t.length-1)],RS=Symbol(`0schema`),zS=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(Wb(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
147
+ `)}},BS=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Zx]?Qx(e,t):db(e)?cb(e,e=>lb(t,t=>BS(e,t))):$x(e)?aS(e,(e,n)=>BS(e,t[n])):!1,VS=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),BS(t,n)}equals(e){return this.constructor===e.constructor&&fS(this.shape,e.shape)}[RS](){return!0}[Zx](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){bx()}get nullable(){return bC(this,FC)}get optional(){return new QS(this)}cast(e){return zC(e,this),e}expect(e){return zC(e,this),e}},HS=class extends VS{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},US=(e,t=null)=>new HS(e,t);US(HS);var WS=class extends VS{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},GS=e=>new WS(e);US(WS);var KS=class extends VS{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},qS=(...e)=>new KS(e),JS=US(KS),YS=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),XS=e=>{if(AC.check(e))return[YS(e)];if(JS.check(e))return e.shape.map(e=>e+``);if(kC.check(e))return[`[+-]?\\d+.?\\d*`];if(jC.check(e))return[`.*`];if(xC.check(e))return e.shape.map(XS).flat(1);xx()};US(class extends VS{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(XS).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var ZS=Symbol(`optional`),QS=class extends VS{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[ZS](){return!0}},$S=US(QS),eC=class extends VS{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new eC,US(eC);var tC=class e extends VS{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):aS(this.shape,(n,r)=>{let i=this._isPartial&&!oS(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},nC=e=>new tC(e),rC=US(tC),iC=GS(e=>e!=null&&(e.constructor===Object||e.constructor==null)),aC=class extends VS{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&aS(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},oC=(e,t)=>new aC(e,t),sC=US(aC),cC=class extends VS{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&aS(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},lC=(...e)=>new cC(e);US(cC);var uC=class extends VS{constructor(e){super(),this.shape=e.length===1?e[0]:new yC(e)}check(e,t){let n=db(e)&&cb(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},dC=(...e)=>new uC(e),fC=US(uC),pC=GS(e=>db(e)),mC=class extends VS{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},hC=(e,t=null)=>new mC(e,t);US(mC);var gC=hC(VS),_C=US(class extends VS{constructor(e){super(),this.len=e.length-1,this.args=lC(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),vC=GS(e=>typeof e==`function`);US(class extends VS{constructor(e){super(),this.shape=e}check(e,t){let n=cb(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var yC=class extends VS{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=lb(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},bC=(...e)=>e.findIndex(e=>xC.check(e))>=0?bC(...e.map(e=>RC(e)).map(e=>xC.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new yC(e),xC=US(yC),SC=()=>!0,CC=GS(SC),wC=US(WS,e=>e.shape===SC),TC=GS(e=>typeof e==`bigint`),EC=GS(e=>e===TC),DC=GS(e=>typeof e==`symbol`);GS(e=>e===DC);var OC=GS(e=>typeof e==`number`),kC=GS(e=>e===OC),AC=GS(e=>typeof e==`string`),jC=GS(e=>e===AC),MC=GS(e=>typeof e==`boolean`),NC=GS(e=>e===MC),PC=qS(void 0);US(KS,e=>e.shape.length===1&&e.shape[0]===void 0),qS(void 0);var FC=qS(null),IC=US(KS,e=>e.shape.length===1&&e.shape[0]===null);US(Uint8Array),US(HS,e=>e.shape===Uint8Array);var LC=bC(OC,AC,FC,PC,TC,MC,DC);(()=>{let e=dC(CC),t=oC(AC,CC),n=bC(OC,AC,FC,MC,e,t);return e.shape=n,t.shape.values=n,n})();var RC=e=>{if(gC.check(e))return e;if(iC.check(e)){let t={};for(let n in e)t[n]=RC(e[n]);return nC(t)}else if(pC.check(e))return bC(...e.map(RC));else if(LC.check(e))return qS(e);else if(vC.check(e))return US(e);xx()},zC=SS?()=>{}:(e,t)=>{let n=new zS;if(!t.check(e,n))throw yx(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},BC=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:RC(e),h:t}),this}else(e){return this.if(CC,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw yx(`Unhandled pattern`)}}},VC=(e=>new BC(e))(CC).if(kC,(e,t)=>MS(t,Mb,jb)).if(jC,(e,t)=>IS(t)).if(NC,(e,t)=>jS(t)).if(EC,(e,t)=>BigInt(MS(t,Mb,jb))).if(xC,(e,t)=>HC(t,LS(t,e.shape))).if(rC,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if($S.check(i)){if(jS(t))continue;i=i.shape}n[r]=VC(i,t)}return n}).if(fC,(e,t)=>{let n=[],r=NS(t,0,42);for(let i=0;i<r;i++)n.push(HC(t,e.shape));return n}).if(JS,(e,t)=>LS(t,e.shape)).if(IC,(e,t)=>null).if(_C,(e,t)=>{let n=HC(t,e.res);return()=>n}).if(wC,(e,t)=>HC(t,LS(t,[OC,AC,FC,PC,TC,MC,dC(OC),oC(bC(`a`,`b`,`c`),OC)]))).if(sC,(e,t)=>{let n={},r=MS(t,0,3);for(let i=0;i<r;i++){let r=HC(t,e.shape.keys);n[r]=HC(t,e.shape.values)}return n}).done(),HC=(e,t)=>VC(RC(t),e),UC=typeof document<`u`?document:{},WC=e=>UC.createElement(e),GC=()=>UC.createDocumentFragment();GS(e=>e.nodeType===rw);var KC=e=>UC.createTextNode(e);typeof DOMParser<`u`&&new DOMParser;var qC=(e,t)=>(AS(t,(t,n)=>{n===!1?e.removeAttribute(t):n===!0?e.setAttribute(t,``):e.setAttribute(t,n)}),e),JC=e=>{let t=GC();for(let n=0;n<e.length;n++)$C(t,e[n]);return t},YC=(e,t)=>($C(e,JC(t)),e),XC=(e,t=[],n=[])=>YC(qC(WC(e),t),n);GS(e=>e.nodeType===ew);var ZC=KC;GS(e=>e.nodeType===tw);var QC=e=>nb(e,(e,t)=>`${t}:${e};`).join(``),$C=(e,t)=>e.appendChild(t),ew=UC.ELEMENT_NODE,tw=UC.TEXT_NODE;UC.CDATA_SECTION_NODE,UC.COMMENT_NODE;var nw=UC.DOCUMENT_NODE;UC.DOCUMENT_TYPE_NODE;var rw=UC.DOCUMENT_FRAGMENT_NODE;GS(e=>e.nodeType===nw);var iw=(e=>class{constructor(e){this._=e}destroy(){e(this._)}})(clearTimeout),aw=(e,t)=>new iw(setTimeout(t,e)),ow=Symbol,sw=ow(),cw=ow(),lw=ow(),uw=ow(),dw=ow(),fw=ow(),pw=ow(),mw=ow(),hw=ow(),gw=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};Kx();var _w={[sw]:kS(`font-weight`,`bold`),[cw]:kS(`font-weight`,`normal`),[lw]:kS(`color`,`blue`),[dw]:kS(`color`,`green`),[uw]:kS(`color`,`grey`),[fw]:kS(`color`,`red`),[pw]:kS(`color`,`purple`),[mw]:kS(`color`,`orange`),[hw]:kS(`color`,`black`)},vw=CS?e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=$y(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=_w[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=QC(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i}:gw,yw=(...e)=>{console.log(...vw(e)),xw.forEach(t=>t.print(e))},bw=(...e)=>{console.warn(...vw(e)),e.unshift(mw),xw.forEach(t=>t.print(e))},xw=ib(),Sw=e=>({[Symbol.iterator](){return this},next:e}),Cw=(e,t)=>Sw(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),ww=(e,t)=>Sw(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),Tw=class{constructor(e,t){this.clock=e,this.len=t}},Ew=class{constructor(){this.clients=new Map}},Dw=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])KT(e,i,o.clock,o.len,n)}}),Ow=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=pb((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},kw=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&Ow(n,t.clock)!==null},Aw=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new Tw(r.clock,gb(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},jw=e=>{let t=new Ew;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)ob(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return Aw(t),t},Mw=(e,t,n,r)=>{tb(e.clients,t,()=>[]).push(new Tw(n,r))},Nw=()=>new Ew,Pw=e=>{let t=Nw();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new Tw(i,a))}}r.length>0&&t.clients.set(n,r)}),t},Fw=(e,t)=>{$b(e.restEncoder,t.clients.size),sb(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),$b(e.restEncoder,t);let r=n.length;$b(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},Iw=e=>{let t=new Ew,n=Ax(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Ax(e.restDecoder),r=Ax(e.restDecoder);if(r>0){let i=tb(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new Tw(e.readDsClock(),e.readDsLen()))}}return t},Lw=(e,t,n)=>{let r=new Ew,i=Ax(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Ax(e.restDecoder),a=Ax(e.restDecoder),o=n.clients.get(i)||[],s=RT(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&Mw(r,i,s,a-s);let e=BT(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,jD(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,jD(t,c,a-c.id.clock)),c.delete(t))}else Mw(r,i,n,a-n)}}if(r.clients.size>0){let e=new qw;return $b(e.restEncoder,0),Fw(e,r),e.toUint8Array()}return null},Rw=Hx,zw=class e extends fb{constructor({guid:e=Gx(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Rw(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new IT,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=qx(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>qx(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&eE(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(sb(this.subdocs).map(e=>e.guid))}transact(e,t=null){return eE(this,e,t)}get(e,t=AE){let n=tb(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==AE&&r!==t)if(r===AE){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,ZE)}getText(e=``){return this.get(e,pD)}getMap(e=``){return this.get(e,eD)}getXmlElement(e=``){return this.get(e,gD)}getXmlFragment(e=``){return this.get(e,hD)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,sb(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,eE(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},Bw=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Ax(this.restDecoder)}readDsLen(){return Ax(this.restDecoder)}},Vw=class extends Bw{readLeftID(){return vT(Ax(this.restDecoder),Ax(this.restDecoder))}readRightID(){return vT(Ax(this.restDecoder),Ax(this.restDecoder))}readClient(){return Ax(this.restDecoder)}readInfo(){return kx(this.restDecoder)}readString(){return Mx(this.restDecoder)}readParentInfo(){return Ax(this.restDecoder)===1}readTypeRef(){return Ax(this.restDecoder)}readLen(){return Ax(this.restDecoder)}readAny(){return Fx(this.restDecoder)}readBuf(){return ES(Ox(this.restDecoder))}readJSON(){return JSON.parse(Mx(this.restDecoder))}readKey(){return Mx(this.restDecoder)}},Hw=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Ax(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Ax(this.restDecoder)+1;return this.dsCurrVal+=e,e}},Uw=class extends Hw{constructor(e){super(e),this.keys=[],Ax(e),this.keyClockDecoder=new Rx(Ox(e)),this.clientDecoder=new Lx(Ox(e)),this.leftClockDecoder=new Rx(Ox(e)),this.rightClockDecoder=new Rx(Ox(e)),this.infoDecoder=new Ix(Ox(e),kx),this.stringDecoder=new zx(Ox(e)),this.parentInfoDecoder=new Ix(Ox(e),kx),this.typeRefDecoder=new Lx(Ox(e)),this.lenDecoder=new Lx(Ox(e))}readLeftID(){return new gT(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new gT(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Fx(this.restDecoder)}readBuf(){return Ox(this.restDecoder)}readJSON(){return Fx(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},Ww=class{constructor(){this.restEncoder=Kb()}toUint8Array(){return Yb(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){$b(this.restEncoder,e)}writeDsLen(e){$b(this.restEncoder,e)}},Gw=class extends Ww{writeLeftID(e){$b(this.restEncoder,e.client),$b(this.restEncoder,e.clock)}writeRightID(e){$b(this.restEncoder,e.client),$b(this.restEncoder,e.clock)}writeClient(e){$b(this.restEncoder,e)}writeInfo(e){Qb(this.restEncoder,e)}writeString(e){rx(this.restEncoder,e)}writeParentInfo(e){$b(this.restEncoder,+!!e)}writeTypeRef(e){$b(this.restEncoder,e)}writeLen(e){$b(this.restEncoder,e)}writeAny(e){fx(this.restEncoder,e)}writeBuf(e){ax(this.restEncoder,e)}writeJSON(e){rx(this.restEncoder,JSON.stringify(e))}writeKey(e){rx(this.restEncoder,e)}},Kw=class{constructor(){this.restEncoder=Kb(),this.dsCurrVal=0}toUint8Array(){return Yb(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,$b(this.restEncoder,t)}writeDsLen(e){e===0&&xx(),$b(this.restEncoder,e-1),this.dsCurrVal+=e}},qw=class extends Kw{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new _x,this.clientEncoder=new hx,this.leftClockEncoder=new _x,this.rightClockEncoder=new _x,this.infoEncoder=new px(Qb),this.stringEncoder=new vx,this.parentInfoEncoder=new px(Qb),this.typeRefEncoder=new hx,this.lenEncoder=new hx}toUint8Array(){let e=Kb();return $b(e,0),ax(e,this.keyClockEncoder.toUint8Array()),ax(e,this.clientEncoder.toUint8Array()),ax(e,this.leftClockEncoder.toUint8Array()),ax(e,this.rightClockEncoder.toUint8Array()),ax(e,Yb(this.infoEncoder)),ax(e,this.stringEncoder.toUint8Array()),ax(e,Yb(this.parentInfoEncoder)),ax(e,this.typeRefEncoder.toUint8Array()),ax(e,this.lenEncoder.toUint8Array()),ix(e,Yb(this.restEncoder)),Yb(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){fx(this.restEncoder,e)}writeBuf(e){ax(this.restEncoder,e)}writeJSON(e){fx(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},Jw=(e,t,n,r)=>{r=gb(r,t[0].id.clock);let i=BT(t,r);$b(e.restEncoder,t.length-i),e.writeClient(n),$b(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},Yw=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{RT(t,n)>e&&r.set(n,e)}),LT(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),$b(e.restEncoder,r.size),sb(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{Jw(e,t.clients.get(n),n,r)})},Xw=(e,t)=>{let n=$y(),r=Ax(e.restDecoder);for(let i=0;i<r;i++){let r=Ax(e.restDecoder),i=Array(r),a=e.readClient(),o=Ax(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new yD(vT(a,o),t),o+=t;break}case 10:{let t=Ax(e.restDecoder);i[n]=new ID(vT(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new PD(vT(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,FD(e,r));i[n]=c,o+=c.length}}}}return n},Zw=(e,t,n)=>{let r=[],i=sb(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new IT,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==ID){let i=tb(d,u.id.client,()=>RT(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,RT(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new qw;return Yw(e,s,new Map),$b(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},Qw=(e,t)=>Yw(e,t.doc.store,t.beforeState),$w=(e,t,n,r=new Uw(e))=>eE(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=Zw(e,i,Xw(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<RT(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=uE([o.update,a.update])}}else i.pendingStructs=a;let s=Lw(r,e,i);if(i.pendingDs){let t=new Uw(Tx(i.pendingDs));Ax(t.restDecoder);let n=Lw(t,e,i);s&&n?i.pendingDs=uE([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,eT(e.doc,t)}},n,!1),eT=(e,t,n,r=Uw)=>{let i=Tx(t);$w(i,e,n,new r(i))},tT=(e,t,n)=>eT(e,t,n,Vw),nT=(e,t,n=new Map)=>{Yw(e,t.store,n),Fw(e,Pw(t.store))},rT=(e,t=new Uint8Array([0]),n=new qw)=>{nT(n,e,oT(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(dE(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Gw)return cE(r.map((e,t)=>t===0?e:gE(e)));if(n.constructor===qw)return uE(r)}return r[0]},iT=(e,t)=>rT(e,t,new Gw),aT=e=>{let t=new Map,n=Ax(e.restDecoder);for(let r=0;r<n;r++){let n=Ax(e.restDecoder),r=Ax(e.restDecoder);t.set(n,r)}return t},oT=e=>aT(new Bw(Tx(e))),sT=(e,t)=>($b(e.restEncoder,t.size),sb(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{$b(e.restEncoder,t),$b(e.restEncoder,n)}),e),cT=(e,t)=>sT(e,LT(t.store)),lT=(e,t=new Kw)=>(e instanceof Map?sT(t,e):cT(t,e),t.toUint8Array()),uT=e=>lT(e,new Ww),dT=class{constructor(){this.l=[]}},fT=()=>new dT,pT=(e,t)=>e.l.push(t),mT=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},hT=(e,t,n)=>uS(e.l,[t,n]),gT=class{constructor(e,t){this.client=e,this.clock=t}},_T=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,vT=(e,t)=>new gT(e,t),yT=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw xx()},bT=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},xT=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},ST=e=>{let t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},CT=e=>new xT(e.type==null?null:vT(e.type.client,e.type.clock),e.tname??null,e.item==null?null:vT(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),wT=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},TT=(e,t,n=0)=>new wT(e,t,n),ET=(e,t,n)=>{let r=null,i=null;return e._item===null?i=yT(e):r=vT(e._item.id.client,e._item.id.clock),new xT(r,i,t,n)},DT=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return ET(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return ET(e,vT(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return ET(e,r.lastId,n);r=r.right}return ET(e,null,n)},OT=(e,t)=>{let n=VT(e,t);return{item:n,diff:t.clock-n.id.clock}},kT=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(RT(r,i.client)<=i.clock)return null;let e=n?kD(r,i):OT(r,i),t=e.item;if(!(t instanceof PD))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(RT(r,a.client)<=a.clock)return null;let{item:e}=n?kD(r,a):{item:VT(r,a)};if(e instanceof PD&&e.content instanceof OD)c=e.content.type;else return null}else throw xx();l=s>=0?c._length:0}return TT(c,l,e.assoc)},AT=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&_T(e.item,t.item)&&_T(e.type,t.type)&&e.assoc===t.assoc,jT=class{constructor(e,t){this.ds=e,this.sv=t}},MT=(e,t)=>new jT(e,t);MT(Nw(),new Map);var NT=e=>MT(Pw(e.store),LT(e.store)),PT=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!kw(t.ds,e.id),FT=(e,t)=>{let n=tb(e.meta,FT,ib),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<RT(r,n)&&UT(e,vT(n,t))}),Dw(e,t.ds,e=>{}),n.add(t))},IT=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},LT=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},RT=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},zT=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw xx()}n.push(t)},BT=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=pb(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=pb((n+r)/2)}throw xx()},VT=(e,t)=>{let n=e.clients.get(t.client);return n[BT(n,t.clock)]},HT=(e,t,n)=>{let r=BT(t,n),i=t[r];return i.id.clock<n&&i instanceof PD?(t.splice(r+1,0,jD(e,i,n-i.id.clock)),r+1):r},UT=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[HT(e,n,t.clock)]},WT=(e,t,n)=>{let r=t.clients.get(n.client),i=BT(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==yD&&r.splice(i+1,0,jD(e,a,n.clock-a.id.clock+1)),a},GT=(e,t,n)=>{let r=e.clients.get(t.id.client);r[BT(r,t.id.clock)]=n},KT=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=HT(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&HT(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},qT=class{constructor(e,t,n){this.doc=e,this.deleteSet=new Ew,this.beforeState=LT(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},JT=(e,t)=>t.deleteSet.clients.size===0&&!rb(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(Aw(t.deleteSet),Qw(e,t),Fw(e,t.deleteSet),!0),YT=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&tb(e.changed,t,ib).add(n)},XT=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof PD&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},ZT=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=BT(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof PD&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},QT=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=hb(r.length-1,1+BT(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+XT(r,e)}})},$T=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{Aw(a),n.afterState=LT(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{hT(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&uae(n)})}),uS(e,[])}finally{r.gc&&ZT(a,i,r.gcFilter),QT(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=gb(BT(e,r),1);for(let t=e.length-1;t>=n;)t-=1+XT(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=BT(r,n);a+1<r.length&&XT(r,a+1)>1||a>0&&XT(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(yw(mw,sw,`[yjs] `,cw,fw,`Changed the client-id because another client seems to be using it.`),r.clientID=Rw()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new Gw;JT(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new qw;JT(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):$T(e,t+1)}}},eE=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new qT(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&$T(i,0)}}return o},tE=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},nE=(e,t,n)=>{Dw(e,n.deletions,n=>{n instanceof PD&&t.scope.some(t=>t===e.doc||bT(t,n))&&AD(n,!1)})},rE=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;eE(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;Dw(n,o.insertions,e=>{if(e instanceof PD){if(e.redone!==null){let{item:t,diff:i}=kD(r,e.id);i>0&&(t=UT(n,vT(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||bT(t,e))&&c.push(e)}}),Dw(n,o.deletions,e=>{e instanceof PD&&a.some(t=>t===n.doc||bT(t,e))&&!kw(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=ND(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},iE=class extends fb{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=db(e)?e[0].doc:e instanceof zw?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new Ew;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&Mw(i,n,r,a)});let a=Kx(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=jw([t.deletions,e.deleteSet]),t.insertions=jw([t.insertions,i])}else r.push(new tE(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),Dw(e,e.deleteSet,t=>{t instanceof PD&&this.scope.some(n=>n===e.doc||bT(n,t))&&AD(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=db(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof AE?e.doc!==this.doc:e!==this.doc)&&bw(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>nE(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>nE(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=rE(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=rE(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}};function*aE(e){let t=Ax(e.restDecoder);for(let n=0;n<t;n++){let t=Ax(e.restDecoder),n=e.readClient(),r=Ax(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Ax(e.restDecoder);yield new ID(vT(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new PD(vT(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,FD(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new yD(vT(n,r),t),r+=t}}}}var oE=class{constructor(e,t){this.gen=aE(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===ID);return this.curr}},sE=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},cE=e=>uE(e,Vw,Gw),lE=(e,t)=>{if(e.constructor===yD){let{client:n,clock:r}=e.id;return new yD(vT(n,r+t),e.length-t)}else if(e.constructor===ID){let{client:n,clock:r}=e.id;return new ID(vT(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new PD(vT(r,i+t),null,vT(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},uE=(e,t=Uw,n=qw)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(Tx(e))),i=r.map(e=>new oE(e,!0)),a=null,o=new n,s=new sE(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===ID?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)pE(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===ID)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{pE(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new ID(vT(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===ID?a.struct.length-=t:n=lE(n,t)),a.struct.mergeWith(n)||(pE(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==ID;n=e.next())pE(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(pE(s,a.struct,a.offset),a=null),mE(s),Fw(o,jw(r.map(e=>Iw(e)))),o.toUint8Array()},dE=(e,t,n=Uw,r=qw)=>{let i=oT(t),a=new r,o=new sE(a),s=new n(Tx(e)),c=new oE(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===ID){c.next();continue}if(e.id.clock+e.length>n)for(pE(o,e,gb(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)pE(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return mE(o),Fw(a,Iw(s)),a.toUint8Array()},fE=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Yb(e.encoder.restEncoder)}),e.encoder.restEncoder=Kb(),e.written=0)},pE=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&fE(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),$b(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},mE=e=>{fE(e);let t=e.encoder.restEncoder;$b(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];$b(t,r.written),ix(t,r.restEncoder)}},hE=(e,t,n,r)=>{let i=new n(Tx(e)),a=new oE(i,!1),o=new r,s=new sE(o);for(let e=a.curr;e!==null;e=a.next())pE(s,t(e),0);return mE(s),Fw(o,Iw(i)),o.toUint8Array()},gE=e=>hE(e,dS,Uw,Gw),_E=`You must not compute changes after the event-handler fired.`,vE=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=yE(this.currentTarget,this.target)}deletes(e){return kw(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw yx(_E);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=ab(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=ab(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=ab(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw yx(_E);let t=this.target,n=ib(),r=ib(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},yE=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},bE=()=>{bw(`Invalid access: Add Yjs type to a document before reading data.`)},xE=80,SE=0,CE=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=SE++}},wE=e=>{e.timestamp=SE++},TE=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=SE++},EE=(e,t,n)=>{if(e.length>=xE){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return TE(r,t,n),r}else{let r=new CE(t,n);return e.push(r),r}},DE=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>mb(t-e.index)<mb(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,wE(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&mb(n.index-i)<r.parent.length/xE?(TE(n,r,i),n):EE(e._searchMarker,r,i)},OE=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=gb(t,i.index+n))}},kE=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;tb(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;hT(r._eH,n,t)},AE=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=fT(),this._dEH=fT(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw bx()}clone(){throw bx()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){pT(this._eH,e)}observeDeep(e){pT(this._dEH,e)}unobserve(e){mT(this._eH,e)}unobserveDeep(e){mT(this._dEH,e)}toJSON(){}},jE=(e,t,n)=>{e.doc??bE(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},ME=e=>{e.doc??bE();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},NE=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&PT(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},PE=(e,t)=>{let n=0,r=e._start;for(e.doc??bE();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},FE=(e,t)=>{let n=[];return PE(e,(r,i)=>{n.push(t(r,i,e))}),n},IE=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},LE=(e,t)=>{e.doc??bE();let n=DE(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},RE=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new PD(vT(o,RT(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new ED(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new PD(vT(o,RT(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new bD(new Uint8Array(n))),i.integrate(e,0);break;case zw:i=new PD(vT(o,RT(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new CD(n)),i.integrate(e,0);break;default:if(n instanceof AE)i=new PD(vT(o,RT(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new OD(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},zE=()=>yx(`Length exceeded!`),BE=(e,t,n,r)=>{if(n>t._length)throw zE();if(n===0)return t._searchMarker&&OE(t._searchMarker,n,r.length),RE(e,t,null,r);let i=n,a=DE(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&UT(e,vT(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&OE(t._searchMarker,i,r.length),RE(e,t,o,r)},VE=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return RE(e,t,r,n)},HE=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=DE(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&UT(e,vT(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&UT(e,vT(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw zE();t._searchMarker&&OE(t._searchMarker,i,-a+r)},UE=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},WE=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new ED([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new ED([r]);break;case Uint8Array:s=new bD(r);break;case zw:s=new CD(r);break;default:if(r instanceof AE)s=new OD(r);else throw Error(`Unexpected content type`)}new PD(vT(o,RT(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},GE=(e,t)=>{e.doc??bE();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},KE=e=>{let t={};return e.doc??bE(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},qE=(e,t)=>{e.doc??bE();let n=e._map.get(t);return n!==void 0&&!n.deleted},JE=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&PT(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},YE=e=>(e.doc??bE(),Cw(e._map.entries(),e=>!e[1].deleted)),XE=class extends vE{},ZE=class e extends AE{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof AE?e.clone():e)),t}get length(){return this.doc??bE(),this._length}_callObserver(e,t){super._callObserver(e,t),kE(this,e,new XE(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):eE(this.doc,n=>{BE(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):eE(this.doc,t=>{VE(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):eE(this.doc,n=>{HE(n,this,e,t)})}get(e){return LE(this,e)}toArray(){return ME(this)}slice(e=0,t=this.length){return jE(this,e,t)}toJSON(){return this.map(e=>e instanceof AE?e.toJSON():e)}map(e){return FE(this,e)}forEach(e){PE(this,e)}[Symbol.iterator](){return IE(this)}_write(e){e.writeTypeRef(jae)}},QE=e=>new ZE,$E=class extends vE{constructor(e,t,n){super(e,t),this.keysChanged=n}},eD=class e extends AE{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof AE?e.clone():e)}),t}_callObserver(e,t){kE(this,e,new $E(this,e,t))}toJSON(){this.doc??bE();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof AE?r.toJSON():r}}),e}get size(){return[...YE(this)].length}keys(){return ww(YE(this),e=>e[0])}values(){return ww(YE(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return ww(YE(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??bE(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):eE(this.doc,t=>{UE(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):eE(this.doc,n=>{WE(n,this,e,t)}),t}get(e){return GE(this,e)}has(e){return qE(this,e)}clear(){this.doc===null?this._prelimContent.clear():eE(this.doc,e=>{this.forEach(function(t,n,r){UE(e,r,n)})})}_write(e){e.writeTypeRef(Mae)}},sae=e=>new eD,tD=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&sS(e,t),nD=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&xx(),this.right.content.constructor){case TD:this.right.deleted||oD(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},rD=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case TD:t.right.deleted||oD(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&UT(e,vT(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},iD=(e,t,n,r)=>{let i=new Map,a=r?DE(t,n):null;return a?rD(e,new nD(a.p.left,a.p,a.index,i),n-a.index):rD(e,new nD(null,t._start,0,i),n)},aD=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===TD&&tD(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new PD(vT(a,RT(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new TD(o,r));l.integrate(e,0),n.right=l,n.forward()})},oD=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},sD=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===TD&&tD(t[e.right.content.key]??null,e.right.content.value));)e.forward()},cD=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!tD(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new PD(vT(a,RT(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new TD(s,c)),n.right.integrate(e,0),n.forward()}}return o},lD=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;sD(n,i);let s=cD(e,t,n,i),c=r.constructor===String?new DD(r):r instanceof AE?new OD(r):new wD(r),{left:l,right:u,index:d}=n;t._searchMarker&&OE(t._searchMarker,n.index,c.getLength()),u=new PD(vT(o,RT(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),aD(e,t,n,s)},uD=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;sD(n,i);let s=cD(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===TD));){if(!n.right.deleted)switch(n.right.content.constructor){case TD:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(tD(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&UT(e,vT(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
148
+ `;n.right=new PD(vT(o,RT(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new DD(i)),n.right.integrate(e,0),n.forward()}aD(e,t,n,s)},dD=(e,t,n,r,i)=>{let a=t,o=$y();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===TD){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case TD:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&oD(i,n);break}}}t=t.right}return s},cae=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===TD){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},lae=e=>{let t=0;return eE(e.doc,n=>{let r=e._start,i=e._start,a=$y(),o=eb(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case TD:oD(o,i.content);break;default:t+=dD(n,r,i,a,o),a=eb(o),r=i;break}i=i.right}}),t},uae=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&KT(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===TD&&e.constructor!==yD&&t.add(e.parent)})}eE(n,n=>{Dw(e,e.deleteSet,e=>{if(e instanceof yD||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===TD?t.add(r):cae(n,e)});for(let e of t)lae(e)})},fD=(e,t,n)=>{let r=n,i=eb(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case OD:case wD:case DD:n<t.right.length&&UT(e,vT(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&dD(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&OE(o._searchMarker,t.index,-r+n),t},dae=class extends vE{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];eE(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},iS(o)||(e.attributes=eS({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case OD:case wD:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case DD:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case TD:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(tD(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),tD(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;tD(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(tD(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),oD(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},pD=class e extends AE{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??bE(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new dae(this,e,t);kE(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??bE();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===DD&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):eE(this.doc,n=>{let r=new nD(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
149
+ `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&lD(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&fD(n,r,a.delete):uD(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??bE();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(PT(s,e)||t!==void 0&&PT(s,t))switch(s.content.constructor){case DD:{let r=i.get(`ychange`);e!==void 0&&!PT(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!PT(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case OD:case wD:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case TD:PT(s,e)&&(c(),oD(i,s.content));break}s=s.right}c()};return e||t?eE(a,n=>{e&&FT(n,e),t&&FT(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):eE(r,r=>{let i=iD(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),lD(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):eE(r,r=>{let i=iD(r,this,e,!n);lD(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):eE(n,n=>{fD(n,iD(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):eE(r,r=>{let i=iD(r,this,e,!1);i.right!==null&&uD(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):eE(this.doc,t=>{UE(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):eE(this.doc,n=>{WE(n,this,e,t)})}getAttribute(e){return GE(this,e)}getAttributes(){return KE(this)}_write(e){e.writeTypeRef(Nae)}},fae=e=>new pD,mD=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??bE()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===gD||t.constructor===hD)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},hD=class e extends AE{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof AE?e.clone():e)),t}get length(){return this.doc??bE(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new mD(this,e)}querySelector(e){e=e.toUpperCase();let t=new mD(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),sb(new mD(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){kE(this,e,new hae(this,t,e))}toString(){return FE(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),PE(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):eE(this.doc,n=>{BE(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)eE(this.doc,n=>{let r=e&&e instanceof AE?e._item:e;RE(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw yx(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):eE(this.doc,n=>{HE(n,this,e,t)})}toArray(){return ME(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return LE(this,e)}slice(e=0,t=this.length){return jE(this,e,t)}forEach(e){PE(this,e)}_write(e){e.writeTypeRef(Fae)}},pae=e=>new hD,gD=class e extends hD{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return nS(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof AE?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):eE(this.doc,t=>{UE(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):eE(this.doc,n=>{WE(n,this,e,t)})}getAttribute(e){return GE(this,e)}hasAttribute(e){return qE(this,e)}getAttributes(e){return e?JE(this,e):KE(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return PE(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Pae),e.writeKey(this.nodeName)}},mae=e=>new gD(e.readKey()),hae=class extends vE{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},gae=class e extends eD{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(Iae),e.writeKey(this.hookName)}},_ae=e=>new gae(e.readKey()),_D=class e extends pD{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Lae)}},vae=e=>new _D,vD=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw bx()}mergeWith(e){return!1}write(e,t,n){throw bx()}integrate(e,t){throw bx()}},yae=0,yD=class extends vD{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),zT(e.doc.store,this)}write(e,t){e.writeInfo(yae),e.writeLen(this.length-t)}getMissing(e,t){return null}},bD=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw bx()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},bae=e=>new bD(e.readBuf()),xD=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Mw(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},xae=e=>new xD(e.readLen()),SD=(e,t)=>new zw({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),CD=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(SD(this.doc.guid,this.opts))}splice(e){throw bx()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},Sae=e=>new CD(SD(e.readString(),e.readAny())),wD=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw bx()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},Cae=e=>new wD(e.readJSON()),TD=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw bx()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},wae=e=>new TD(e.readKey(),e.readJSON()),Tae=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},Eae=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new Tae(n)},Dae=bS(`node_env`)===`development`,ED=class e{constructor(e){this.arr=e,Dae&&lS(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},Oae=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new ED(n)},DD=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},kae=e=>new DD(e.readString()),Aae=[QE,sae,fae,mae,pae,_ae,vae],jae=0,Mae=1,Nae=2,Pae=3,Fae=4,Iae=5,Lae=6,OD=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw bx()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},Rae=e=>new OD(Aae[e.readTypeRef()](e)),kD=(e,t)=>{let n=t,r=0,i;do r>0&&(n=vT(n.client,n.clock+r)),i=VT(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof PD);return{item:i,diff:r}},AD=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},jD=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new PD(vT(r,i+n),t,vT(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=vT(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},MD=(e,t)=>lb(e,e=>kw(e.deletions,t)),ND=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return UT(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||ND(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=UT(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:UT(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:UT(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||kw(r,d.right.id)||MD(a.undoStack,d.right.id)||MD(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=UT(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=vT(c,RT(s,c)),h=new PD(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,AD(h,!0),h.integrate(e,0),h},PD=class e extends vD{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=RT(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=RT(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===gT&&this.id.client!==this.parent.client&&this.parent.clock>=RT(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=WT(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=UT(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===yD||this.right&&this.right.constructor===yD)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===gT){let e=VT(n,this.parent);e.constructor===yD?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=WT(e,e.doc.store,vT(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),_T(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(_T(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(VT(e.doc.store,n.origin)))r.has(VT(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),zT(e.doc.store,this),this.content.integrate(e,this),YT(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new yD(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:vT(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&_T(e.origin,this.lastId)&&this.right===e&&_T(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Mw(e.deleteSet,this.id.client,this.id.clock,this.length),YT(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw xx();this.content.gc(e),t?GT(e,this,new yD(this.id,this.length)):this.content=new xD(this.length)}write(e,t){let n=t>0?vT(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=yT(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===gT?(e.writeParentInfo(!1),e.writeLeftID(t)):xx();i!==null&&e.writeString(i)}this.content.write(e,t)}},FD=(e,t)=>zae[t&31](e),zae=[()=>{xx()},xae,Eae,bae,kae,Cae,wae,Rae,Oae,Sae,()=>{xx()}],Bae=10,ID=class extends vD{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){xx()}write(e,t){e.writeInfo(Bae),$b(e.restEncoder,this.length-t)}getMissing(e,t){return null}},LD=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},RD=`__ $YJS$ __`;LD[RD]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),LD[RD]=!0;var zD=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},Vae=/[\uD800-\uDBFF]/,Hae=/[\uDC00-\uDFFF]/,Uae=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&Vae.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&Hae.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},BD=(e,t)=>e>>>t|e<<32-t,Wae=e=>BD(e,2)^BD(e,13)^BD(e,22),Gae=e=>BD(e,6)^BD(e,11)^BD(e,25),Kae=e=>BD(e,7)^BD(e,18)^e>>>3,qae=e=>BD(e,17)^BD(e,19)^e>>>10,Jae=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Yae=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xae=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Yae),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=qae(t[e-2])+t[e-7]+Kae(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+Gae(o)+(o&s^~o&c)+Jae[e]+t[e]>>>0,d=Wae(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Ab,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},Zae=e=>new Xae().digest(e),VD=new Xd(`y-sync`),HD=new Xd(`y-undo`),UD=new Xd(`yjs-cursor`),Qae=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},$ae=e=>TS(Qae(Zae(DS(e)))),WD=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!kw(t.ds,e.id),eoe=[{light:`#ecd44433`,dark:`#ecd444`}],toe=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=ib();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Ux(t))}return e.get(n)},noe=(e,{colors:t=eoe,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new aoe(e,a),c=new qd({props:{editable:e=>{let t=VD.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:VD,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(VD);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&aw(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=HD.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},VD)})}},destroy:()=>{s.destroy()}})});return c},roe=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Nd(e.doc));else if(t.type===`node`){let r=lO(n.doc,n.type,t.anchor,n.mapping);e.setSelection(ioe(e,r))}else{let r=lO(n.doc,n.type,t.anchor,n.mapping),i=lO(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(kd.between(e.doc.resolve(r),e.doc.resolve(i)))}},ioe=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?jd.create(e.doc,t):kd.near(n)},GD=(e,t)=>({type:t.selection.jsonID,anchor:cO(t.selection.anchor,e.type,e.mapping),head:cO(t.selection.head,e.type,e.mapping)}),aoe=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=zD(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=GD(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(hS&&this._domSelectionInView===null&&(aw(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=UC.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=MT(Nw(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(VD,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>qD(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new H(V.from(e),0,0));t.setMeta(VD,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>qD(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new H(V.from(t),0,0));if(e){let t=hb(gb(e.anchor,0),n.doc.content.size),r=hb(gb(e.head,0),n.doc.content.size);n.setSelection(kd.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(VD,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=NT(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&xx(),r=new zw({gc:!1}),eT(r,t),t=NT(r),eT(r,e),e=NT(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[BT(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Dw(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:toe(n.colorMapping,n.colors,r)}},s=NE(i,new jT(t.ds,e.sv)).map(n=>!n._item.deleted||WD(n._item,e)||WD(n._item,t)?qD(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new H(V.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(VD,{isChangeOrigin:!0}))},VD)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=VD.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Dw(t,t.deleteSet,e=>{if(e.constructor===PD){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>KD(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new H(V.from(n),0,0));roe(r,this.beforeTransactionSelection,this),r=r.setMeta(VD,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof iE}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{iO(this.doc,this.type,e,this),this.beforeTransactionSelection=GD(this,this.prosemirrorView.state)},VD)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},KD=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof gD)return qD(e,t,n,r,i,a);throw bx()}return o},qD=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof gD){let s=KD(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof pD&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=ooe(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):NE(e,new jT(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(WD(e._item,r)?WD(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},ooe=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,foe(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},soe=(e,t)=>{let n=new _D,r=e.map(e=>({insert:e.text,attributes:rO(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},coe=(e,t)=>{let n=new gD(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,ZD(e).map(e=>JD(e,t))),t.mapping.set(n,e),n},JD=(e,t)=>e instanceof Array?soe(e,t):coe(e,t),YD=e=>typeof e==`object`&&!!e,XD=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||YD(o)&&YD(s)&&XD(o,s)}return r},ZD=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},QD=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&tS(e.attributes||{}).length===t[n].marks.length&&aS(e.attributes,(e,r)=>{let i=nO(r),a=t[n].marks;return a.find(e=>e.type.name===i)?XD(e,a.find(e=>e.type.name===i)?.attrs):!1}))},$D=(e,t)=>{if(e instanceof gD&&!(t instanceof Array)&&aO(e,t)){let n=ZD(t);return e._length===n.length&&XD(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>$D(e,n[t]))}return e instanceof _D&&t instanceof Array&&QD(e,t)},eO=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),tO=(e,t,n)=>{let r=e.toArray(),i=ZD(t),a=i.length,o=r.length,s=hb(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(eO(n.mapping.get(e),t))u=!0;else if(!$D(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(eO(n.mapping.get(e),t))u=!0;else if(!$D(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},loe=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof DD?t+=n.content.str:n.content instanceof TD&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},uoe=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=loe(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,rO(e.marks,n))})),{insert:o,remove:s,index:c}=Uae(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},doe=/(.*)(--[a-zA-Z0-9+/=]{8})$/,nO=e=>doe.exec(e)?.[1]??e,foe=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(nO(r),e[r]));return n},rO=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=tb(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${$ae(e.toJSON())}`:e.type.name]=e.attrs}}),n},iO=(e,t,n,r)=>{if(t instanceof gD&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof gD){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=ZD(n),a=i.length,o=t.toArray(),s=o.length,c=hb(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!eO(r.mapping.get(e),t))if($D(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!eO(r.mapping.get(e),t))if($D(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof _D&&c instanceof Array)QD(n,c)||uoe(n,c,r),l+=1;else{let i=n instanceof gD&&aO(n,c),a=d instanceof gD&&aO(d,f);if(i&&a){let e=tO(n,c,r),t=tO(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(iO(e,n,c,r),l+=1):a?(iO(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[JD(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof _D?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(JD(i[t],r));t.insert(l,e)}},VD)},aO=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,oO=null,poe=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=VD.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},moe=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=oO;oO=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new poe(t,r,e))})}),new e(n)}},sO=(e=moe.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||aw(0,()=>sO(e,!0));return}throw r}n=!1,e.dequeueFirst()}},hoe=(e,t,n)=>{oO||(oO=new Map,aw(0,sO)),tb(oO,e,$y).set(t,n)},cO=(e,t,n)=>{if(e===0)return DT(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof _D){if(r._length>=e)return DT(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new xT(r._item===null?null:r._item.id,r._item===null?yT(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new xT(r._item===null?null:r._item.id,r._item===null?yT(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw xx();if(e===0&&r.constructor!==_D&&r!==t)return goe(r._item.parent,r._item)}return DT(t,t._length,-1)},goe=(e,t)=>{let n=null,r=null;return e._item===null?r=yT(e):n=vT(e._item.id.client,e._item.id.clock),new xT(n,r,t.id)},lO=(e,t,n,r)=>{let i=kT(n,e);if(i===null||i.type!==t&&!bT(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===_D)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof _D?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof _D?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},_oe=(e,t,n)=>e!==t,voe=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},yoe=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),boe=/^#[0-9a-fA-F]{6}$/,uO=(e,t,n,r,i)=>{let a=VD.getState(e);if(a==null||a.doc==null||a.binding==null)return ng.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?ng.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:boe.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=lO(o,a.type,CT(t.cursor.anchor),a.binding.mapping),u=lO(o,a.type,CT(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=gb(e.doc.content.size-1,0);l=hb(l,t),u=hb(u,t),s.push($h.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=hb(l,u),o=gb(l,u);s.push($h.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),ng.create(e.doc,s))},xoe=(e,{awarenessStateFilter:t=_oe,cursorBuilder:n=voe,selectionBuilder:r=yoe,getSelection:i=e=>e.selection}={},a=`cursor`)=>new qd({key:UD,state:{init(i,a){return uO(a,e,t,n,r)},apply(i,a,o,s){let c=VD.getState(s),l=i.getMeta(UD);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?uO(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>UD.getState(e)},view:t=>{let n=()=>{t.docView&&hoe(t,UD,{awarenessUpdated:!0})},r=()=>{let n=VD.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=cO(o.anchor,n.type,n.binding.mapping),c=cO(o.head,n.type,n.binding.mapping);(r.cursor==null||!AT(CT(r.cursor.anchor),s)||!AT(CT(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&lO(n.doc,n.type,CT(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),Soe=e=>{let t=HD.getState(e).undoManager;if(t!=null)return t.undo(),!0},Coe=e=>{let t=HD.getState(e).undoManager;if(t!=null)return t.redo(),!0},woe=new Set([`paragraph`]),Toe=(e,t)=>!(e instanceof PD)||!(e.content instanceof OD)||!(e.content.type instanceof pD||e.content.type instanceof gD&&t.has(e.content.type.nodeName))||e.content.type._length===0,Eoe=({protectedNodes:e=woe,trackedOrigins:t=[],undoManager:n=null}={})=>new qd({key:HD,state:{init:(r,i)=>{let a=VD.getState(i),o=n||new iE(a.type,{trackedOrigins:new Set([VD].concat(t)),deleteFilter:t=>Toe(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=VD.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:GD(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=VD.getState(e.state),n=HD.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,HD.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),dO=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,fO=Js,pO=(e,t)=>n=>{if(t?.variants==null)return fO(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=dO(t)||dO(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return fO(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Doe=pO(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80 font-mono uppercase`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground text-muted-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40 font-mono uppercase`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function mO(e){let t=(0,gn.c)(16),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,variant:i,size:a,asChild:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`default`:i,c=a===void 0?`default`:a,l=o!==void 0&&o?sr:`button`,u;t[6]!==n||t[7]!==c||t[8]!==s?(u=_l(Doe({variant:s,size:c,className:n})),t[6]=n,t[7]=c,t[8]=s,t[9]=u):u=t[9];let d;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==u||t[14]!==s?(d=(0,B.jsx)(l,{"data-slot":`button`,"data-variant":s,"data-size":c,className:u,...r}),t[10]=l,t[11]=r,t[12]=c,t[13]=u,t[14]=s,t[15]=d):d=t[15],d}function hO(e){let t=(0,gn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,B.jsx)(ja,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function Ooe(e){let t=(0,gn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,B.jsx)(Ma,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function koe(e){let t=(0,gn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,B.jsx)(La,{"data-slot":`dialog-close`,className:`font-mono uppercase`,...n}),t[2]=n,t[3]=r),r}function Aoe(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(Na,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gO(e){let t=(0,gn.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?!0:a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(Aoe,{}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=_l(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=c);let l;t[8]===o?l=t[9]:(l=o&&(0,B.jsx)(La,{"data-slot":`dialog-close`,asChild:!0,children:(0,B.jsxs)(mO,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,B.jsx)(nr,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[8]=o,t[9]=l);let u;return t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==l?(u=(0,B.jsxs)(Ooe,{children:[s,(0,B.jsxs)(Pa,{"data-slot":`dialog-content`,className:c,...i,children:[n,l]})]}),t[10]=n,t[11]=i,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}function _O(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`flex flex-col gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vO(e){let t=(0,gn.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?!1:a,s;t[5]===r?s=t[6]:(s=_l(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=s);let c;t[7]===o?c=t[8]:(c=o&&(0,B.jsx)(La,{asChild:!0,children:(0,B.jsx)(mO,{variant:`outline`,children:`Close`})}),t[7]=o,t[8]=c);let l;return t[9]!==n||t[10]!==i||t[11]!==s||t[12]!==c?(l=(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s,...i,children:[n,c]}),t[9]=n,t[10]=i,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function yO(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(Fa,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bO(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(Ia,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xO(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function joe(e){let t=xO(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function SO(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function Moe(e){let t=new Set;function n(e){for(let r of e)r.kind===`folder`&&(t.add(r.path),n(r.children))}return n(e),t}function Noe(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function Poe(e,t){let n=t.trim(),r=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${r}`:r}function Foe(e,t){let n=t.trim();if(n.includes(`/`)){let t=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${t}`:t}return e?`${e}/${n}/index.md`:`${n}/index.md`}function Ioe(e){let t=[];for(let n of e){let e=n.docName.split(`/`).filter(Boolean),r=t;for(let[t,i]of e.entries()){let a=e.slice(0,t+1).join(`/`),o=t===e.length-1,s=r.find(e=>e.path===a);s||(s={name:i,path:a,kind:o?`file`:`folder`,children:[],...o&&{isSymlink:n.isSymlink,canonicalDocName:n.canonicalDocName,targetPath:n.targetPath}},r.push(s)),r=s.children}}function n(e){e.sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`folder`?-1:1);for(let t of e)n(t.children)}return n(t),t}function Loe(e){return xO(e).replace(/\/+$/g,``)}function CO(e){let t=new Set;for(let n of e)for(let e of SO(n))t.add(e);return t}function wO(e,t){let n=Loe(e);if(!n)return{kind:`missing`,target:n};if(t.pages.has(n))return{kind:`doc`,target:n,docName:n};let r=`${n}/index`;if(t.pages.has(r))return{kind:`folder-index`,target:n,folderPath:n,docName:r,noteKind:`canonical-index`};let i=n.split(`/`).pop(),a=i?`${n}/${i}`:null;return a&&t.pages.has(a)?{kind:`folder-index`,target:n,folderPath:n,docName:a,noteKind:`legacy-folder-note`}:(t.folderPaths??CO(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function TO(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`folder`:return null}}async function Roe(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0}}}function EO(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?OO(e.position):`start`in e||`end`in e?OO(e):`line`in e||`column`in e?DO(e):``}function DO(e){return kO(e&&e.line)+`:`+kO(e&&e.column)}function OO(e){return DO(e&&e.start)+`-`+DO(e&&e.end)}function kO(e){return e&&typeof e==`number`?e:1}var AO=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=EO(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};AO.prototype.file=``,AO.prototype.name=``,AO.prototype.reason=``,AO.prototype.message=``,AO.prototype.stack=``,AO.prototype.column=void 0,AO.prototype.line=void 0,AO.prototype.ancestors=void 0,AO.prototype.cause=void 0,AO.prototype.fatal=void 0,AO.prototype.place=void 0,AO.prototype.ruleId=void 0,AO.prototype.source=void 0;var zoe=2e3;function Boe(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function Voe(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var jO=`__system__`,MO=[`incoming`,`outgoing`,`both`];function Hoe(e){return MO.includes(e)}var NO=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],PO=4,Uoe=/^```([a-z]+)?[\s\n]$/,Woe=/^~~~([a-z]+)?[\s\n]$/,FO=wv.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:PO,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,l_(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
150
+ `):`\`\`\`${r}
151
+
152
+ \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??PO,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
153
+ `,`
154
+ `).split(`
155
+ `).map(e=>o+e).join(`
156
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??PO,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
157
+ `,`
158
+ `).split(`
159
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(kd.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
160
+ `,`
161
+ `).split(`
162
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
163
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
164
+
165
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(Td.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[iv({find:Uoe,type:this.type,getAttributes:e=>({language:e[1]})}),iv({find:Woe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new qd({key:new Xd(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
166
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(kd.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Goe=FO.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3}}}}),IO=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},Koe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,qoe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Joe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Yoe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,LO=V_.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return IO(`strong`,{...l_(this.options.HTMLAttributes,e),children:IO(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[nv({find:Koe,type:this.type}),nv({find:Joe,type:this.type})]},addPasteRules(){return[Ev({find:qoe,type:this.type}),Ev({find:Yoe,type:this.type})]}}),Xoe=LO,Zoe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Qoe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,$oe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ese=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,RO=V_.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,l_(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[nv({find:Zoe,type:this.type}),nv({find:$oe,type:this.type})]},addPasteRules(){return[Ev({find:Qoe,type:this.type}),Ev({find:ese,type:this.type})]}}),tse=RO.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}}}),nse=Xoe.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}}}),rse=V_.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),ise=/^---\r?\n([\s\S]*?\r?\n)?---(\r?\n|$)/;function ase(e){let t=e.match(ise);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}var zO=wv.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,l_(this.options.HTMLAttributes,e)]},renderText(){return`
167
+ `},renderMarkdown:()=>`
168
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ose=zO.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),BO=wv.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,l_(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>iv({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),sse=BO.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`}}}}),cse=wv.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),VO=wv.create({name:`jsxComponent`,group:`block`,atom:!0,isolating:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{content:e.getAttribute(`data-content`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-content":e.content}]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{content:e}})}}}),lse=wv.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`inline*`,isolating:!0,selectable:!0,priority:60,addAttributes(){return{attributes:{default:[]},sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-jsx-inline]`,getAttrs:e=>typeof e==`string`?!1:{sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-jsx-inline":``,"data-source-raw":e.sourceRaw,contenteditable:`false`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`span`);t.setAttribute(`data-jsx-inline`,``),t.setAttribute(`contenteditable`,`false`),t.classList.add(`jsx-inline`),e.sourceRaw&&t.setAttribute(`data-source-raw`,e.sourceRaw);let n=document.createElement(`span`);return n.classList.add(`jsx-inline-content`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),use=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,dse=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,HO=`numeric`,UO=`ascii`,WO=`alpha`,GO=`asciinumeric`,KO=`alphanumeric`,qO=`domain`,JO=`emoji`,fse=`scheme`,pse=`slashscheme`,YO=`whitespace`;function mse(e,t){return e in t||(t[e]=[]),t[e]}function XO(e,t,n){t[HO]&&(t[GO]=!0,t[KO]=!0),t[UO]&&(t[GO]=!0,t[WO]=!0),t[GO]&&(t[KO]=!0),t[WO]&&(t[KO]=!0),t[KO]&&(t[qO]=!0),t[JO]&&(t[qO]=!0);for(let r in t){let t=mse(r,n);t.indexOf(e)<0&&t.push(e)}}function hse(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function ZO(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}ZO.groups={},ZO.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=ZO.groups;let i;return t&&t.j?i=t:(i=new ZO(t),n&&r&&XO(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=ZO.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new ZO,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new ZO,a&&(r&&(o.t&&typeof o.t==`string`?XO(a,Object.assign(hse(o.t,r),n),r):n&&XO(a,n,r)),o.t=a),i.j[e]=o,o}};var QO=(e,t,n,r,i)=>e.ta(t,n,r,i),$O=(e,t,n,r,i)=>e.tr(t,n,r,i),ek=(e,t,n,r,i)=>e.ts(t,n,r,i),U=(e,t,n,r,i)=>e.tt(t,n,r,i),tk=`WORD`,nk=`UWORD`,rk=`ASCIINUMERICAL`,ik=`ALPHANUMERICAL`,ak=`LOCALHOST`,ok=`TLD`,sk=`UTLD`,ck=`SCHEME`,lk=`SLASH_SCHEME`,uk=`NUM`,dk=`WS`,fk=`NL`,pk=`OPENBRACE`,mk=`CLOSEBRACE`,hk=`OPENBRACKET`,gk=`CLOSEBRACKET`,_k=`OPENPAREN`,vk=`CLOSEPAREN`,yk=`OPENANGLEBRACKET`,bk=`CLOSEANGLEBRACKET`,xk=`FULLWIDTHLEFTPAREN`,Sk=`FULLWIDTHRIGHTPAREN`,Ck=`LEFTCORNERBRACKET`,wk=`RIGHTCORNERBRACKET`,Tk=`LEFTWHITECORNERBRACKET`,Ek=`RIGHTWHITECORNERBRACKET`,Dk=`FULLWIDTHLESSTHAN`,Ok=`FULLWIDTHGREATERTHAN`,kk=`AMPERSAND`,Ak=`APOSTROPHE`,jk=`ASTERISK`,Mk=`AT`,Nk=`BACKSLASH`,Pk=`BACKTICK`,Fk=`CARET`,Ik=`COLON`,Lk=`COMMA`,Rk=`DOLLAR`,zk=`DOT`,Bk=`EQUALS`,Vk=`EXCLAMATION`,Hk=`HYPHEN`,Uk=`PERCENT`,Wk=`PIPE`,Gk=`PLUS`,Kk=`POUND`,qk=`QUERY`,Jk=`QUOTE`,Yk=`FULLWIDTHMIDDLEDOT`,Xk=`SEMI`,Zk=`SLASH`,Qk=`TILDE`,$k=`UNDERSCORE`,eA=`EMOJI`,tA=`SYM`,nA=Object.freeze({__proto__:null,ALPHANUMERICAL:ik,AMPERSAND:kk,APOSTROPHE:Ak,ASCIINUMERICAL:rk,ASTERISK:jk,AT:Mk,BACKSLASH:Nk,BACKTICK:Pk,CARET:Fk,CLOSEANGLEBRACKET:bk,CLOSEBRACE:mk,CLOSEBRACKET:gk,CLOSEPAREN:vk,COLON:Ik,COMMA:Lk,DOLLAR:Rk,DOT:zk,EMOJI:eA,EQUALS:Bk,EXCLAMATION:Vk,FULLWIDTHGREATERTHAN:Ok,FULLWIDTHLEFTPAREN:xk,FULLWIDTHLESSTHAN:Dk,FULLWIDTHMIDDLEDOT:Yk,FULLWIDTHRIGHTPAREN:Sk,HYPHEN:Hk,LEFTCORNERBRACKET:Ck,LEFTWHITECORNERBRACKET:Tk,LOCALHOST:ak,NL:fk,NUM:uk,OPENANGLEBRACKET:yk,OPENBRACE:pk,OPENBRACKET:hk,OPENPAREN:_k,PERCENT:Uk,PIPE:Wk,PLUS:Gk,POUND:Kk,QUERY:qk,QUOTE:Jk,RIGHTCORNERBRACKET:wk,RIGHTWHITECORNERBRACKET:Ek,SCHEME:ck,SEMI:Xk,SLASH:Zk,SLASH_SCHEME:lk,SYM:tA,TILDE:Qk,TLD:ok,UNDERSCORE:$k,UTLD:sk,UWORD:nk,WORD:tk,WS:dk}),rA=/[a-z]/,iA=/\p{L}/u,aA=/\p{Emoji}/u,oA=/\d/,sA=/\s/,cA=`\r`,lA=`
169
+ `,gse=`️`,_se=`‍`,uA=``,dA=null,fA=null;function vse(e=[]){let t={};ZO.groups=t;let n=new ZO;dA??=hA(use),fA??=hA(dse),U(n,`'`,Ak),U(n,`{`,pk),U(n,`}`,mk),U(n,`[`,hk),U(n,`]`,gk),U(n,`(`,_k),U(n,`)`,vk),U(n,`<`,yk),U(n,`>`,bk),U(n,`(`,xk),U(n,`)`,Sk),U(n,`「`,Ck),U(n,`」`,wk),U(n,`『`,Tk),U(n,`』`,Ek),U(n,`<`,Dk),U(n,`>`,Ok),U(n,`&`,kk),U(n,`*`,jk),U(n,`@`,Mk),U(n,"`",Pk),U(n,`^`,Fk),U(n,`:`,Ik),U(n,`,`,Lk),U(n,`$`,Rk),U(n,`.`,zk),U(n,`=`,Bk),U(n,`!`,Vk),U(n,`-`,Hk),U(n,`%`,Uk),U(n,`|`,Wk),U(n,`+`,Gk),U(n,`#`,Kk),U(n,`?`,qk),U(n,`"`,Jk),U(n,`/`,Zk),U(n,`;`,Xk),U(n,`~`,Qk),U(n,`_`,$k),U(n,`\\`,Nk),U(n,`・`,Yk);let r=$O(n,oA,uk,{[HO]:!0});$O(r,oA,r);let i=$O(r,rA,rk,{[GO]:!0}),a=$O(r,iA,ik,{[KO]:!0}),o=$O(n,rA,tk,{[UO]:!0});$O(o,oA,i),$O(o,rA,o),$O(i,oA,i),$O(i,rA,i);let s=$O(n,iA,nk,{[WO]:!0});$O(s,rA),$O(s,oA,a),$O(s,iA,s),$O(a,oA,a),$O(a,rA),$O(a,iA,a);let c=U(n,lA,fk,{[YO]:!0}),l=U(n,cA,dk,{[YO]:!0}),u=$O(n,sA,dk,{[YO]:!0});U(n,uA,u),U(l,lA,c),U(l,uA,u),$O(l,sA,u),U(u,cA),U(u,lA),$O(u,sA,u),U(u,uA,u);let d=$O(n,aA,eA,{[JO]:!0});U(d,`#`),$O(d,aA,d),U(d,gse,d);let f=U(d,_se);U(f,`#`),$O(f,aA,d);let p=[[rA,o],[oA,i]],m=[[rA,null],[iA,s],[oA,a]];for(let e=0;e<dA.length;e++)mA(n,dA[e],ok,tk,p);for(let e=0;e<fA.length;e++)mA(n,fA[e],sk,nk,m);XO(ok,{tld:!0,ascii:!0},t),XO(sk,{utld:!0,alpha:!0},t),mA(n,`file`,ck,tk,p),mA(n,`mailto`,ck,tk,p),mA(n,`http`,lk,tk,p),mA(n,`https`,lk,tk,p),mA(n,`ftp`,lk,tk,p),mA(n,`ftps`,lk,tk,p),XO(ck,{scheme:!0,ascii:!0},t),XO(lk,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[fse]:!0}:{[pse]:!0};r.indexOf(`-`)>=0?i[qO]=!0:rA.test(r)?oA.test(r)?i[GO]=!0:i[UO]=!0:i[HO]=!0,ek(n,r,r,i)}return ek(n,`localhost`,ak,{ascii:!0}),n.jd=new ZO(tA),{start:n,tokens:Object.assign({groups:t},nA)}}function pA(e,t){let n=yse(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function yse(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function mA(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new ZO(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new ZO(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function hA(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var gA={defaultProtocol:`http`,events:null,format:vA,formatHref:vA,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _A(e,t=null){let n=Object.assign({},gA);e&&(n=Object.assign(n,e instanceof _A?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}_A.prototype={o:gA,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:gA[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function vA(e){return e}function yA(e,t){this.t=`token`,this.v=e,this.tk=t}yA.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=gA.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function bA(e,t){class n extends yA{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var xA=bA(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),SA=bA(`text`),bse=bA(`nl`),CA=bA(`url`,{isLink:!0,toHref(e=gA.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==ak&&e[1].t===Ik}}),wA=e=>new ZO(e);function xse({groups:e}){let t=e.domain.concat([kk,jk,Mk,Nk,Pk,Fk,Rk,Bk,Hk,uk,Uk,Wk,Gk,Kk,Zk,tA,Qk,$k]),n=[Ak,Ik,Lk,zk,Vk,Uk,qk,Jk,Xk,yk,bk,pk,mk,gk,hk,_k,vk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok],r=[kk,Ak,jk,Nk,Pk,Fk,Rk,Bk,Hk,pk,mk,Uk,Wk,Gk,Kk,qk,Zk,tA,Qk,$k],i=wA(),a=U(i,Qk);QO(a,r,a),QO(a,e.domain,a);let o=wA(),s=wA(),c=wA();QO(i,e.domain,o),QO(i,e.scheme,s),QO(i,e.slashscheme,c),QO(o,r,a),QO(o,e.domain,o);let l=U(o,Mk);U(a,Mk,l),U(s,Mk,l),U(c,Mk,l);let u=U(a,zk);QO(u,r,a),QO(u,e.domain,a);let d=wA();QO(l,e.domain,d),QO(d,e.domain,d);let f=U(d,zk);QO(f,e.domain,d);let p=wA(xA);QO(f,e.tld,p),QO(f,e.utld,p),U(l,ak,p);let m=U(d,Hk);U(m,Hk,m),QO(m,e.domain,d),QO(p,e.domain,d),U(p,zk,f),U(p,Hk,m),QO(U(p,Ik),e.numeric,xA);let h=U(o,Hk),g=U(o,zk);U(h,Hk,h),QO(h,e.domain,o),QO(g,r,a),QO(g,e.domain,o);let _=wA(CA);QO(g,e.tld,_),QO(g,e.utld,_),QO(_,e.domain,o),QO(_,r,a),U(_,zk,g),U(_,Hk,h),U(_,Mk,l);let v=U(_,Ik),y=wA(CA);QO(v,e.numeric,y);let b=wA(CA),x=wA();QO(b,t,b),QO(b,n,x),QO(x,t,b),QO(x,n,x),U(_,Zk,b),U(y,Zk,b);let S=U(s,Ik),C=U(U(U(c,Ik),Zk),Zk);QO(s,e.domain,o),U(s,zk,g),U(s,Hk,h),QO(c,e.domain,o),U(c,zk,g),U(c,Hk,h),QO(S,e.domain,b),U(S,Zk,b),U(S,qk,b),QO(C,e.domain,b),QO(C,t,b),U(C,Zk,b);let w=[[pk,mk],[hk,gk],[_k,vk],[yk,bk],[xk,Sk],[Ck,wk],[Tk,Ek],[Dk,Ok]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=U(b,r);U(x,r,a),U(a,i,b);let o=wA(CA);QO(a,t,o);let s=wA();QO(a,n),QO(o,t,o),QO(o,n,s),QO(s,t,o),QO(s,n,s),U(o,i,b),U(s,i,b)}return U(i,ak,_),U(i,fk,bse),{start:i,tokens:nA}}function Sse(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(TA(SA,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(TA(e,t,r))}}return o.length>0&&a.push(TA(SA,t,o)),a}function TA(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var Cse=typeof console<`u`&&console&&console.warn||(()=>{}),wse=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,EA={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Tse(){return ZO.groups={},EA.scanner=null,EA.parser=null,EA.tokenQueue=[],EA.pluginQueue=[],EA.customSchemes=[],EA.initialized=!1,EA}function DA(e,t=!1){if(EA.initialized&&Cse(`linkifyjs: already initialized - will not register custom scheme "${e}" ${wse}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
170
+ 1. Must only contain digits, lowercase ASCII letters or "-"
171
+ 2. Cannot start or end with "-"
172
+ 3. "-" cannot repeat`);EA.customSchemes.push([e,t])}function Ese(){EA.scanner=vse(EA.customSchemes);for(let e=0;e<EA.tokenQueue.length;e++)EA.tokenQueue[e][1]({scanner:EA.scanner});EA.parser=xse(EA.scanner.tokens);for(let e=0;e<EA.pluginQueue.length;e++)EA.pluginQueue[e][1]({scanner:EA.scanner,parser:EA.parser});return EA.initialized=!0,EA}function OA(e){return EA.initialized||Ese(),Sse(EA.parser.start,e,pA(EA.scanner.start,e))}OA.scan=pA;function kA(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new _A(n),i=OA(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var AA=`[\0- \xA0 ᠎ -\u2029  ]`,Dse=new RegExp(AA),Ose=RegExp(`${AA}$`),kse=new RegExp(AA,`g`);function Ase(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function jse(e){return new qd({key:new Xd(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(S_(Qg(n.doc,[...t])).forEach(({newRange:t})=>{let n=uie(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Ose.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Dse).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=OA(n).map(t=>t.toObject(e.defaultProtocol));if(!Ase(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{C_(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Mse(e){return new qd({key:new Xd(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=x_(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function Nse(e){return new qd({key:new Xd(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=kA(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function jA(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(kse,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var MA=V_.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){DA(e);return}DA(e.scheme,e.optionalSlashes)})},onDestroy(){Tse()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!jA(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!jA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!jA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,l_(this.options.HTMLAttributes,e),0]:[`a`,l_(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!jA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!jA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Ev({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=kA(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!jA(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(jse({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!jA(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Mse({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Nse({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),NA=MA.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:e=>{try{let t=new URL(e,`https://placeholder.invalid`).protocol.toLowerCase();return![`javascript:`,`data:`,`vbscript:`].includes(t)}catch{return!1}},validate:()=>!0,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1}}}}),Pse=wv.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function PA(e){return e.type.name===`list`&&!e.attrs.ordered}function Fse(e){return e.type.name===`list`&&!!e.attrs.ordered}function FA(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function IA(e,t,n,r,i,a,o){let s=e_(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Rf(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return Ff(n,a)(e,void 0)?t?Ff(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var Ise=wv.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,l_(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:IA(e,t,n,r,e=>PA(e)&&!FA(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:IA(e,t,n,r,e=>Fse(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:IA(e,t,n,r,e=>PA(e)&&FA(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[av({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),av({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new I_({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Hu(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Lse=wv.create({name:`listItem`,content:`paragraph block*`,defining:!0,priority:60,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,l_(t),0]:[`li`,l_(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(l_(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),Rse=Ise,zse=Lse,LA=wv.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),Bse=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Vse=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Hse=V_.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,l_(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[nv({find:Bse,type:this.type})]},addPasteRules(){return[Ev({find:Vse,type:this.type})]}}),Use=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Wse=wv.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,l_(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new sv({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[rv({find:Use,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),RA,zA;if(typeof WeakMap<`u`){let e=new WeakMap;RA=t=>e.get(t),zA=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;RA=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},zA=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var BA=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return RA(e)||zA(e,Gse(e))}};function Gse(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Kse(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new BA(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&qse(s,o,e),s}function Kse(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function qse(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=Jse(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function Jse(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function VA(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var HA=new Xd(`selectingCells`);function UA(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Yse(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function WA(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function GA(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=UA(t.$head)||Xse(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Xse(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function KA(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Zse(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function qA(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function JA(e,t,n){let r=e.node(-1),i=BA.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function YA(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function XA(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Qse(e,t,n){let r=VA(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var ZA=class e extends Td{constructor(e,t=e){let n=e.node(-1),r=BA.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Ed(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(KA(r)&&KA(i)&&qA(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return kd.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=BA.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=YA(e,0,l)),u>0&&(e=YA(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(V.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new H(V.from(o),1,1)}replace(e,t=H.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?H.empty:t)}let i=Td.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new H(V.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=BA.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=BA.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=BA.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=BA.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new $se(this.$anchorCell.pos,this.$headCell.pos)}};ZA.prototype.visible=!1,Td.jsonID(`cell`,ZA);var $se=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&qA(t,n)?new ZA(t,n):Td.near(n,1)}};function ece(e){if(!(e.selection instanceof ZA))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push($h.node(n,n+e.nodeSize,{class:`selectedCell`}))}),ng.create(e.doc,t)}function tce({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function nce({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function rce(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof jd&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=ZA.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=ZA.rowSelection(e,e)}else if(!n){let e=BA.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=ZA.create(i,t+1,n)}}else r instanceof kd&&tce(r)?a=kd.create(i,r.from):r instanceof kd&&nce(r)&&(a=kd.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var ice=new Xd(`fix-tables`);function QA(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?QA(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function $A(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=ace(e,t,r,n))};return t?t.doc!=e.doc&&QA(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ace(e,t,n,r){let i=BA.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,YA(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=VA(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(ice,{fixTables:!0})}function ej(e){let t=e.selection,n=GA(e),r=n.node(-1),i=n.start(-1),a=BA.get(r);return{...t instanceof ZA?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function tj(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Qse(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,XA(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?VA(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function oce(e,t){if(!WA(e))return!1;if(t){let n=ej(e);t(tj(e.tr,n,n.left))}return!0}function sce(e,t){if(!WA(e))return!1;if(t){let n=ej(e);t(tj(e.tr,n,n.right))}return!0}function cce(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,YA(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function lce(e,t){if(!WA(e))return!1;if(t){let n=ej(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;cce(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=BA.get(e)}t(r)}return!0}function uce(e,t,n){let r=VA(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function nj(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;uce(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?VA(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,VA(r.type.schema).row.create(null,o)),e}function dce(e,t){if(!WA(e))return!1;if(t){let n=ej(e);t(nj(e.tr,n,n.top))}return!0}function fce(e,t){if(!WA(e))return!1;if(t){let n=ej(e);t(nj(e.tr,n,n.bottom))}return!0}function pce(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function mce(e,t){if(!WA(e))return!1;if(t){let n=ej(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;pce(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=BA.get(n.table)}t(r)}return!0}function rj(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function hce({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function ij(e,t){let n=e.selection;if(!(n instanceof ZA)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=ej(e),{map:i}=r;if(hce(i,r))return!1;if(t){let n=e.tr,a={},o=V.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{rj(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...XA(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=rj(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new ZA(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function aj(e,t){let n=VA(e.schema);return gce(({node:e})=>n[e.type.spec.tableRole])(e,t)}function gce(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof ZA){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Yse(r.$from),!i)return!1;a=UA(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=ej(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof ZA&&u.setSelection(new ZA(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function _ce(e,t){return function(n,r){if(!WA(n))return!1;let i=GA(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof ZA?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function vce(e){return function(t,n){if(!WA(t))return!1;if(n){let r=VA(t.schema),i=ej(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function oj(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function sj(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?vce(e):function(t,n){if(!WA(t))return!1;if(n){let r=VA(t.schema),i=ej(t),a=t.tr,o=oj(`row`,i,r),s=oj(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}sj(`row`,{useDeprecatedLogic:!0}),sj(`column`,{useDeprecatedLogic:!0});var yce=sj(`cell`,{useDeprecatedLogic:!0});function bce(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function cj(e){return function(t,n){if(!WA(t))return!1;let r=bce(GA(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(kd.between(e,Zse(e))).scrollIntoView())}return!0}}function xce(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function lj(e,t){let n=e.selection;if(!(n instanceof ZA))return!1;if(t){let r=e.tr,i=VA(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new H(i,0,0))}),r.docChanged&&t(r)}return!0}function Sce(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=uj(VA(o).row,new H(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?uj(VA(o).row,new H(t,n,r)).content:t);else return null;return Cce(o,s)}function Cce(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(V.empty),n[i]<r){let a=VA(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(V.from(o))}return{height:t.length,width:r,rows:t}}function uj(e,t){let n=e.createAndFill();return new Cd(n).replace(0,n.content.size,t).doc}function wce({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(YA(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(V.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(V.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Tce(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=VA(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,V.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function dj(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function fj(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,YA(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(YA(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function pj(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=BA.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=BA.get(a),f=d.mapping.maps.length}Tce(d,o,a,n,l,u,f)&&p(),dj(d,o,a,n,c,l,s,f)&&p(),dj(d,o,a,n,c,l,u,f)&&p(),fj(d,o,a,n,s,u,c,f)&&p(),fj(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new H(i.rows[e-s],0,0))}p(),d.setSelection(new ZA(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Ece=Eg({ArrowLeft:hj(`horiz`,-1),ArrowRight:hj(`horiz`,1),ArrowUp:hj(`vert`,-1),ArrowDown:hj(`vert`,1),"Shift-ArrowLeft":gj(`horiz`,-1),"Shift-ArrowRight":gj(`horiz`,1),"Shift-ArrowUp":gj(`vert`,-1),"Shift-ArrowDown":gj(`vert`,1),Backspace:lj,"Mod-Backspace":lj,Delete:lj,"Mod-Delete":lj});function mj(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function hj(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof ZA)return mj(n,r,Td.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=_j(i,e,t);if(o==null)return!1;if(e==`horiz`)return mj(n,r,Td.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=JA(i,e,t),s;return s=a?Td.near(a,1):t<0?Td.near(n.doc.resolve(i.before(-1)),-1):Td.near(n.doc.resolve(i.after(-1)),1),mj(n,r,s)}}}function gj(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof ZA)o=a;else{let r=_j(i,e,t);if(r==null)return!1;o=new ZA(n.doc.resolve(r))}let s=JA(o.$headCell,e,t);return s?mj(n,r,new ZA(o.$anchorCell,s)):!1}}function Dce(e,t){let n=e.state.doc,r=UA(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new ZA(r))),!0):!1}function Oce(e,t,n){if(!WA(e.state))return!1;let r=Sce(n),i=e.state.selection;if(i instanceof ZA){r||={width:1,height:1,rows:[V.from(uj(VA(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=BA.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=wce(r,o.right-o.left,o.bottom-o.top),pj(e.state,e.dispatch,a,o,r),!0}else if(r){let t=GA(e.state),n=t.start(-1);return pj(e.state,e.dispatch,n,BA.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function kce(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=vj(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof ZA)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=UA(e.state.selection.$anchor))!=null&&yj(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=yj(e,n),i=HA.getState(e.state)==null;if(!r||!qA(t,r))if(i)r=t;else return;let a=new ZA(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(HA,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),HA.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(HA,-1))}function o(r){let o=r,s=HA.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(vj(e,o.target)!=n&&(c=yj(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function _j(e,t,n){if(!(e.state.selection instanceof kd))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function vj(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function yj(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&UA(e.state.doc.resolve(r))||UA(e.state.doc.resolve(i))}var Ace=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),bj(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,bj(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function bj(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var xj=new Xd(`tableColumnResizing`);function jce({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Ace,lastColumnResizable:i=!0}={}){let a=new qd({key:xj,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=VA(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Mce(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=xj.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Nce(t,n,e,i)},mouseleave:e=>{Pce(e)},mousedown:(e,r)=>{Fce(e,r,t,n)}},decorations:e=>{let t=xj.getState(e);if(t&&t.activeHandle>-1)return Bce(e,t.activeHandle)},nodeViews:{}}});return a}var Mce=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(xj);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return KA(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Nce(e,t,n,r){if(!e.editable)return;let i=xj.getState(e.state);if(i&&!i.dragging){let a=Lce(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Sj(e,t,`left`,n):i-t.clientX<=n&&(o=Sj(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=BA.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}wj(e,o)}}}function Pce(e){if(!e.editable)return;let t=xj.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&wj(e,-1)}function Fce(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=xj.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Ice(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(xj,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=xj.getState(e.state);r?.dragging&&(Rce(e,r.activeHandle,Cj(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(xj,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=xj.getState(e.state);if(i&&i.dragging){let a=Cj(i.dragging,t,n);Tj(e,i.activeHandle,a,r)}}return Tj(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Ice(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function Lce(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function Sj(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=UA(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=BA.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function Cj(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function wj(e,t){e.dispatch(e.state.tr.setMeta(xj,{setHandle:t}))}function Rce(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=BA.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():zce(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function Tj(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=BA.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&bj(a,c.firstChild,c,r,s,n)}function zce(e){return Array(e).fill(0)}function Bce(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return ng.empty;let a=BA.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,xj.getState(e)?.dragging&&n.push($h.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push($h.widget(s,c))}}return ng.create(e.doc,n)}function Vce({allowTableNodeSelection:e=!1}={}){return new qd({key:HA,state:{init(){return null},apply(e,t){let n=e.getMeta(HA);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:ece,handleDOMEvents:{mousedown:kce},createSelectionBetween(e){return HA.getState(e.state)==null?null:e.state.selection},handleTripleClick:Dce,handleKeyDown:Ece,handlePaste:Oce},appendTransaction(t,n,r){return rce(r,$A(r,n),e)}})}function Ej(e){return e===`left`||e===`right`||e===`center`?e:null}function Hce(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return Ej(t||n)}function Uce(e){return Ej(e?.align)}function Dj(){return{default:null,parseHTML:e=>Hce(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var Oj=wv.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:Dj()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,l_(this.options.HTMLAttributes,e),0]}}),kj=wv.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:Dj()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,l_(this.options.HTMLAttributes,e),0]}}),Aj=wv.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,l_(this.options.HTMLAttributes,e),0]}});function jj(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Mj(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=jj(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=jj(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var Wce=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Mj(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,Mj(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function Gce(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=jj(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Nj(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Kce(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function qce(e,t,n,r,i){let a=Kce(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Nj(a.cell,i);if(e&&s.push(e),r){let e=Nj(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function Jce(e){return e instanceof ZA}var Pj=({editor:e})=>{let{selection:t}=e.state;if(!Jce(t))return!1;let n=0;return $g(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Yce(e){return(e||``).replace(/\s+/g,` `).trim()}function Xce(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Yce(i),o=e.type===`tableHeader`,s=Uce(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
173
+ `,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
174
+ `,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
175
+ `,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
176
+ `}),d}var Zce=Xce,Fj=wv.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Wce,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=Gce(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,l_(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=Ej(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=Ej(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>Zce(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=qce(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(kd.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>oce(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>sce(e,t),deleteColumn:()=>({state:e,dispatch:t})=>lce(e,t),addRowBefore:()=>({state:e,dispatch:t})=>dce(e,t),addRowAfter:()=>({state:e,dispatch:t})=>fce(e,t),deleteRow:()=>({state:e,dispatch:t})=>mce(e,t),deleteTable:()=>({state:e,dispatch:t})=>xce(e,t),mergeCells:()=>({state:e,dispatch:t})=>ij(e,t),splitCell:()=>({state:e,dispatch:t})=>aj(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>sj(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>sj(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>yce(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>ij(e,t)?!0:aj(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>_ce(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>cj(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>cj(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&$A(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=ZA.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Pj,"Mod-Backspace":Pj,Delete:Pj,"Mod-Delete":Pj}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[jce({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Vce({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:a_(t_(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});W_.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Fj.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Oj.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(kj.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Aj.configure(this.options.tableRow)),e}});var Qce=/^\s*>\s$/,$ce=wv.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return IO(`blockquote`,{...l_(this.options.HTMLAttributes,e),children:IO(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
177
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
178
+ `))}),n.join(`
179
+ >
180
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[av({find:Qce,type:this.type})]}}),ele=/(^|[^`])`([^`]+)`(?!`)$/,tle=/(^|[^`])`([^`]+)`(?!`)/g,Ij=V_.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,l_(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[nv({find:ele,type:this.type})]},addPasteRules(){return[Ev({find:tle,type:this.type})]}}),nle=Ij,rle=wv.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
181
+
182
+ `):``}),Lj=wv.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,l_(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!cv(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return A_(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(kd.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(jd.create(t.doc,n.pos)):t.setSelection(kd.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(kd.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[rv({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ile=Lj,ale=Object.defineProperty,ole=(e,t)=>{for(var n in t)ale(e,n,{get:t[n],enumerable:!0})},sle=`listItem`,Rj=`textStyle`,zj=/^\s*([-+*])\s$/,Bj=wv.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,l_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
183
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sle,this.editor.getAttributes(Rj)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=av({find:zj,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=av({find:zj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Rj),editor:this.editor})),[e]}}),Vj=wv.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,l_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>yv(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});ole({},{findListItemPos:()=>Hj,getNextListDepth:()=>Uj,handleBackspace:()=>qj,handleDelete:()=>Xj,hasListBefore:()=>Wj,hasListItemAfter:()=>cle,hasListItemBefore:()=>Gj,listItemHasSubList:()=>Kj,nextListIsDeeper:()=>Jj,nextListIsHigher:()=>Yj});var Hj=(e,t)=>{let{$from:n}=t.selection,r=jg(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},Uj=(e,t)=>{let n=Hj(e,t);if(!n)return!1;let[,r]=vie(t,e,n.$pos.pos+4);return r},Wj=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Gj=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},Kj=(e,t,n)=>{if(!n)return!1;let r=jg(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},qj=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!qg(e.state,t)&&Wj(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!qg(e.state,t)||!Sie(e.state))return!1;let r=Hj(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Kj(t,e.state,i);return Gj(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Jj=(e,t)=>{let n=Uj(e,t),r=Hj(e,t);return!r||!n?!1:n>r.depth},Yj=(e,t)=>{let n=Uj(e,t),r=Hj(e,t);return!r||!n?!1:n<r.depth},Xj=(e,t)=>{if(!qg(e.state,t)||!xie(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Jj(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Yj(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},cle=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},Zj=W_.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Xj(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Xj(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&qj(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&qj(e,n,r)&&(t=!0)}),t}}}}),Qj=/^(\s*)(\d+)\.\s+(.*)$/,lle=/^\s/;function ule(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Qj);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(Qj))break;if(t.trim()===``)f.push(t),u+=`
184
+ `,d+=1;else if(t.match(lle))f.push(t),u+=`
185
+ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
186
+ `)}),r=d,n=d}return[t,r]}function $j(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
187
+ `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
188
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=$j(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
189
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function dle(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var fle=`listItem`,eM=`textStyle`,tM=/^(\d+)\.\s$/,nM=wv.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,l_(this.options.HTMLAttributes,n),0]:[`ol`,l_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?dle(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
190
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
191
+ `),[i,a]=ule(r);if(i.length===0)return;let o=$j(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
192
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fle,this.editor.getAttributes(eM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=av({find:tM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=av({find:tM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(eM)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ple=/^\s*(\[([( |x])?\])\s$/,mle=wv.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,l_(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>yv(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=u_(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[av({find:ple,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),hle=wv.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,l_(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
193
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=vv(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=vv(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});W_.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Bj.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Vj.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Zj.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(nM.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(mle.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(hle.configure(this.options.taskList)),e}});var rM=`&nbsp;`,iM=`\xA0`,gle=wv.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,l_(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===rM||n[0].text===rM||n[0].raw===iM||n[0].text===iM)&&r.length===1&&r[0].type===`text`&&(r[0].text===rM||r[0].text===iM)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?rM:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_le=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,vle=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yle=V_.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,l_(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[nv({find:_le,type:this.type})]},addPasteRules(){return[Ev({find:vle,type:this.type})]}}),ble=wv.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),xle=V_.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,l_(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Sle(e={}){return new qd({view(t){return new Cle(t,e)}})}var Cle=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=id(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},aM=class e extends Td{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Td.near(r)}content(){return H.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new wle(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!sM(e)||!cM(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!jd.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};aM.prototype.visible=!1,aM.findFrom=aM.findGapCursorFrom,Td.jsonID(`gapcursor`,aM);var wle=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return aM.valid(t)?new aM(t):Td.near(t)}};function oM(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function sM(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||oM(e.type))return!0;if(e.inlineContent)return!1}}return!0}function cM(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||oM(e.type))return!0;if(e.inlineContent)return!1}}return!0}function lM(){return new qd({props:{decorations:mM,createSelectionBetween(e,t,n){return t.pos==n.pos&&aM.valid(n)?new aM(n):null},handleClick:fM,handleKeyDown:uM,handleDOMEvents:{beforeinput:pM}}})}var uM=Eg({ArrowLeft:dM(`horiz`,-1),ArrowRight:dM(`horiz`,1),ArrowUp:dM(`vert`,-1),ArrowDown:dM(`vert`,1)});function dM(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof kd){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=aM.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new aM(c))),!0):!1}}function fM(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!aM.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&jd.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new aM(r))),!0)}function pM(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof aM))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=V.empty;for(let e=r.length-1;e>=0;e--)i=V.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new H(i,0,0));return a.setSelection(kd.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function mM(e){if(!(e.selection instanceof aM))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,ng.create(e.doc,[$h.widget(e.selection.head,t,{key:`gapcursor`})])}var hM=200,gM=function(){};gM.prototype.append=function(e){return e.length?(e=gM.from(e),!this.length&&e||e.length<hM&&this.leafAppend(e)||this.length<hM&&e.leafPrepend(this)||this.appendInner(e)):this},gM.prototype.prepend=function(e){return e.length?gM.from(e).append(this):this},gM.prototype.appendInner=function(e){return new vM(this,e)},gM.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?gM.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},gM.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},gM.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},gM.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},gM.from=function(e){return e instanceof gM?e:e&&e.length?new _M(e):gM.empty};var _M=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=hM)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=hM)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(gM);gM.empty=new _M([]);var vM=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(gM),yM=500,bM=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new SM(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new SM(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new SM(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>wM&&(s=xM(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Ou;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new SM(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new SM(i,o,l))}else r.push(new SM(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new SM(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>yM&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new SM(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(gM.from(i.reverse()),a)}};bM.empty=new bM(gM.empty,0);function xM(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var SM=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},CM=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},wM=20;function TM(e,t,n,r){let i=n.getMeta(NM),a;if(i)return i.historyState;n.getMeta(PM)&&(e=new CM(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(NM))return o.getMeta(NM).redo?new CM(e.done.addTransform(n,void 0,r,MM(t)),e.undone,DM(n.mapping.maps),e.prevTime,e.prevComposition):new CM(e.done,e.undone.addTransform(n,void 0,r,MM(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!EM(n,e.prevRanges)),s=o?OM(e.prevRanges,n.mapping):DM(n.mapping.maps);return new CM(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,MM(t)),bM.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new CM(e.done.rebased(n,a),e.undone.rebased(n,a),OM(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new CM(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),OM(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function EM(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function DM(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function OM(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function kM(e,t,n){let r=MM(t),i=NM.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new CM(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(NM,{redo:n,historyState:c})}var AM=!1,jM=null;function MM(e){let t=e.plugins;if(jM!=t){AM=!1,jM=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){AM=!0;break}}return AM}var NM=new Xd(`history`),PM=new Xd(`closeHistory`);function FM(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new qd({key:NM,state:{init(){return new CM(bM.empty,bM.empty,null,0,-1)},apply(t,n,r){return TM(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?LM:n==`historyRedo`?RM:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function IM(e,t){return(n,r)=>{let i=NM.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=kM(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var LM=IM(!1,!0),RM=IM(!0,!0);W_.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new qd({key:new Xd(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var zM=W_.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Sle(this.options)]}});W_.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new qd({key:new Xd(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return ng.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push($h.node(t,t+e.nodeSize,{class:this.options.className}))}),ng.create(e,a)}}})]}});var BM=W_.create({name:`gapCursor`,addProseMirrorPlugins(){return[lM()]},extendNodeSchema(e){return{allowGapCursor:a_(t_(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),VM=`placeholder`;function HM(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var UM=W_.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:VM,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${HM(this.options.dataAttribute)}`:`data-${VM}`;return[new qd({key:new Xd(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&k_(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=$h.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),ng.create(t,a)}}})]}});W_.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new qd({key:new Xd(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||A_(n.selection)||e.view.dragging?null:ng.create(n.doc,[$h.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function WM({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var GM=W_.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Xd(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new qd({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!WM({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!WM({node:r,types:n})}}})]}}),KM=W_.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>LM(e,t),redo:()=>({state:e,dispatch:t})=>RM(e,t)}},addProseMirrorPlugins(){return[FM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),qM=W_.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(LO.configure(this.options.bold)),this.options.blockquote!==!1&&e.push($ce.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Bj.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Ij.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(FO.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(rle.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(zM.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(BM.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(zO.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(BO.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(KM.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Lj.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(RO.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Vj.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Zj.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(MA.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(nM.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(gle.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(yle.configure(this.options.strike)),this.options.text!==!1&&e.push(ble.configure(this.options.text)),this.options.underline!==!1&&e.push(xle.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(GM.configure(this.options?.trailingNode)),e}}),JM=nle.extend({excludes:``}),YM=ile.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}}});function XM(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function ZM(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var QM=wv.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:XM(e.getAttribute(`data-alias`)),anchor:XM(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:XM(e.getAttribute(`data-alias`)),anchor:XM(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=XM(e.attrs.alias),i=XM(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},ZM({target:n,alias:r,anchor:i})]}}),$M=[VO,LA,lse,QM,Rse,zse,tse,nse,JM,Goe,sse,YM,NA,cse,Pse,ose,rse,qM.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1}),Fj.configure({resizable:!0}),Aj,kj,Oj,Wse.configure({inline:!0}),Hse],eN=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};eN.prototype.normal={},eN.prototype.property={},eN.prototype.space=void 0;function tN(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new eN(n,r,t)}function nN(e){return e.toLowerCase()}var rN=class{constructor(e,t){this.attribute=t,this.property=e}};rN.prototype.attribute=``,rN.prototype.booleanish=!1,rN.prototype.boolean=!1,rN.prototype.commaOrSpaceSeparated=!1,rN.prototype.commaSeparated=!1,rN.prototype.defined=!1,rN.prototype.mustUseProperty=!1,rN.prototype.number=!1,rN.prototype.overloadedBoolean=!1,rN.prototype.property=``,rN.prototype.spaceSeparated=!1,rN.prototype.space=void 0;var iN=Ye({boolean:()=>oN,booleanish:()=>sN,commaOrSpaceSeparated:()=>dN,commaSeparated:()=>uN,number:()=>W,overloadedBoolean:()=>cN,spaceSeparated:()=>lN}),aN=0,oN=fN(),sN=fN(),cN=fN(),W=fN(),lN=fN(),uN=fN(),dN=fN();function fN(){return 2**++aN}var pN=Object.keys(iN),mN=class extends rN{constructor(e,t,n,r){let i=-1;if(super(e,t),hN(this,`space`,r),typeof n==`number`)for(;++i<pN.length;){let e=pN[i];hN(this,pN[i],(n&iN[e])===iN[e])}}};mN.prototype.defined=!0;function hN(e,t,n){n&&(e[t]=n)}function gN(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new mN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[nN(r)]=r,n[nN(a.attribute)]=r}return new eN(t,n,e.space)}var _N=gN({properties:{ariaActiveDescendant:null,ariaAtomic:sN,ariaAutoComplete:null,ariaBusy:sN,ariaChecked:sN,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:lN,ariaCurrent:null,ariaDescribedBy:lN,ariaDetails:null,ariaDisabled:sN,ariaDropEffect:lN,ariaErrorMessage:null,ariaExpanded:sN,ariaFlowTo:lN,ariaGrabbed:sN,ariaHasPopup:null,ariaHidden:sN,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lN,ariaLevel:W,ariaLive:null,ariaModal:sN,ariaMultiLine:sN,ariaMultiSelectable:sN,ariaOrientation:null,ariaOwns:lN,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:sN,ariaReadOnly:sN,ariaRelevant:null,ariaRequired:sN,ariaRoleDescription:lN,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:sN,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function vN(e,t){return t in e?e[t]:t}function yN(e,t){return vN(e,t.toLowerCase())}var bN=gN({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:uN,acceptCharset:lN,accessKey:lN,action:null,allow:null,allowFullScreen:oN,allowPaymentRequest:oN,allowUserMedia:oN,alt:null,as:null,async:oN,autoCapitalize:null,autoComplete:lN,autoFocus:oN,autoPlay:oN,blocking:lN,capture:null,charSet:null,checked:oN,cite:null,className:lN,cols:W,colSpan:null,content:null,contentEditable:sN,controls:oN,controlsList:lN,coords:W|uN,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oN,defer:oN,dir:null,dirName:null,disabled:oN,download:cN,draggable:sN,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oN,formTarget:null,headers:lN,height:W,hidden:cN,high:W,href:null,hrefLang:null,htmlFor:lN,httpEquiv:lN,id:null,imageSizes:null,imageSrcSet:null,inert:oN,inputMode:null,integrity:null,is:null,isMap:oN,itemId:null,itemProp:lN,itemRef:lN,itemScope:oN,itemType:lN,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oN,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:oN,muted:oN,name:null,nonce:null,noModule:oN,noValidate:oN,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oN,optimum:W,pattern:null,ping:lN,placeholder:null,playsInline:oN,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oN,referrerPolicy:null,rel:lN,required:oN,reversed:oN,rows:W,rowSpan:W,sandbox:lN,scope:null,scoped:oN,seamless:oN,selected:oN,shadowRootClonable:oN,shadowRootDelegatesFocus:oN,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:sN,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:oN,useMap:null,value:sN,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lN,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oN,declare:oN,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:oN,noHref:oN,noShade:oN,noWrap:oN,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:sN,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:oN,disableRemotePlayback:oN,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:yN}),xN=gN({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:dN,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:lN,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:oN,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uN,g2:uN,glyphName:uN,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:dN,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lN,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dN,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dN,rev:dN,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dN,requiredFeatures:dN,requiredFonts:dN,requiredFormats:dN,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:dN,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dN,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dN,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:vN}),SN=gN({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),CN=gN({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:yN}),wN=gN({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),TN=/[A-Z]/g,EN=/-[a-z]/g,DN=/^data[-\w.:]+$/i;function ON(e,t){let n=nN(t),r=t,i=rN;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&DN.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(EN,AN);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!EN.test(e)){let n=e.replace(TN,kN);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mN}return new i(r,t)}function kN(e){return`-`+e.toLowerCase()}function AN(e){return e.charAt(1).toUpperCase()}var jN=tN([_N,bN,SN,CN,wN],`html`),MN=tN([_N,xN,SN,CN,wN],`svg`);function NN(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function PN(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var FN=/[#.]/g;function IN(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){FN.lastIndex=i;let e=FN.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function LN(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function RN(e){return e.join(` `).trim()}function zN(e,t,n){let r=n?GN(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=IN(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,BN(i))a.unshift(i);else for(let[t,n]of Object.entries(i))VN(e,o.properties,t,n)}for(let e of a)HN(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function BN(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function VN(e,t,n,r){let i=ON(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?LN(r):i.commaSeparated?NN(r):i.commaOrSpaceSeparated?LN(NN(r).join(` `)):UN(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?WN(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(UN(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function HN(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)HN(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?HN(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function UN(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||nN(n)===nN(t)))return!0}return n}function WN(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function GN(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var KN=`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.solidColor.textArea.textPath`.split(`.`),qN=zN(jN,`div`),JN=zN(MN,`g`,KN);function YN(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=XN(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=XN(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function XN(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
194
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var ZN={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},QN={}.hasOwnProperty,$N=Object.prototype;function eP(e,t){let n=t||{};return tP({file:n.file||void 0,location:!1,schema:n.space===`svg`?MN:jN,verbose:n.verbose||!1},e)}function tP(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},iP(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:nP(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=YN(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},iP(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},iP(e,r,n),n}default:return n=rP(e,t),n}}function nP(e,t){let n=-1,r=[];for(;++n<t.length;){let i=tP(e,t[n]);r.push(i)}return r}function rP(e,t){let n=e.schema;e.schema=t.namespaceURI===ZN.svg?MN:jN;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;QN.call($N,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?JN:qN)(t.tagName,i,nP(e,t.childNodes));if(iP(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&oP(r.startTag),o=r&&r.endTag&&oP(r.endTag),s=tP(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function iP(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=aP(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function aP(e,t,n){let r=oP(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)QN.call(n.attrs,i)&&(r[ON(e.schema,i).property]=oP(n.attrs[i]));n.startTag;let a=oP(n.startTag),o=n.endTag?oP(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function oP(e){let t=sP({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=sP({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function sP(e){return e.line&&e.column?e:void 0}var cP=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),G;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(G||={});var lP={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function uP(e){return e>=55296&&e<=57343}function dP(e){return e>=56320&&e<=57343}function fP(e,t){return(e-55296)*1024+9216+t}function pP(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function mP(e){return e>=64976&&e<=65007||cP.has(e)}var K;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(K||={});var hP=65536,gP=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=hP,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(dP(t))return this.pos++,this._addGap(),fP(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(K.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let n=this.html.charCodeAt(t);return n===G.CARRIAGE_RETURN?G.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let e=this.html.charCodeAt(this.pos);return e===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):e===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,uP(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===G.LINE_FEED||e===G.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){pP(e)?this._err(K.controlCharacterInInputStream):mP(e)&&this._err(K.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},_P;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(_P||={});function vP(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var yP=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),bP=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]]);String.fromCodePoint;function xP(e){return e>=55296&&e<=57343||e>1114111?65533:bP.get(e)??e}var SP;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(SP||={});var CP=32,wP;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(wP||={});function TP(e){return e>=SP.ZERO&&e<=SP.NINE}function EP(e){return e>=SP.UPPER_A&&e<=SP.UPPER_F||e>=SP.LOWER_A&&e<=SP.LOWER_F}function DP(e){return e>=SP.UPPER_A&&e<=SP.UPPER_Z||e>=SP.LOWER_A&&e<=SP.LOWER_Z||TP(e)}function OP(e){return e===SP.EQUALS||DP(e)}var kP;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(kP||={});var AP;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(AP||={});var jP=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=kP.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=AP.Strict}startEntity(e){this.decodeMode=e,this.state=kP.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case kP.EntityStart:return e.charCodeAt(t)===SP.NUM?(this.state=kP.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=kP.NamedEntity,this.stateNamedEntity(e,t));case kP.NumericStart:return this.stateNumericStart(e,t);case kP.NumericDecimal:return this.stateNumericDecimal(e,t);case kP.NumericHex:return this.stateNumericHex(e,t);case kP.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|CP)===SP.LOWER_X?(this.state=kP.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=kP.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(TP(r)||EP(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(TP(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===SP.SEMI)this.consumed+=1;else if(this.decodeMode===AP.Strict)return 0;return this.emitCodePoint(xP(this.result),this.consumed),this.errors&&(e!==SP.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&wP.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=MP(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===AP.Attribute&&(i===0||OP(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&wP.VALUE_LENGTH)>>14,i!==0){if(a===SP.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==AP.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&wP.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~wP.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case kP.NamedEntity:return this.result!==0&&(this.decodeMode!==AP.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case kP.NumericDecimal:return this.emitNumericEntity(0,2);case kP.NumericHex:return this.emitNumericEntity(0,3);case kP.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case kP.EntityStart:return 0}}};function MP(e,t,n,r){let i=(t&wP.BRANCH_LENGTH)>>7,a=t&wP.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var q;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(q||={});var NP;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(NP||={});var PP;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(PP||={});var J;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(J||={});var Y;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(Y||={});var FP=new Map([[J.A,Y.A],[J.ADDRESS,Y.ADDRESS],[J.ANNOTATION_XML,Y.ANNOTATION_XML],[J.APPLET,Y.APPLET],[J.AREA,Y.AREA],[J.ARTICLE,Y.ARTICLE],[J.ASIDE,Y.ASIDE],[J.B,Y.B],[J.BASE,Y.BASE],[J.BASEFONT,Y.BASEFONT],[J.BGSOUND,Y.BGSOUND],[J.BIG,Y.BIG],[J.BLOCKQUOTE,Y.BLOCKQUOTE],[J.BODY,Y.BODY],[J.BR,Y.BR],[J.BUTTON,Y.BUTTON],[J.CAPTION,Y.CAPTION],[J.CENTER,Y.CENTER],[J.CODE,Y.CODE],[J.COL,Y.COL],[J.COLGROUP,Y.COLGROUP],[J.DD,Y.DD],[J.DESC,Y.DESC],[J.DETAILS,Y.DETAILS],[J.DIALOG,Y.DIALOG],[J.DIR,Y.DIR],[J.DIV,Y.DIV],[J.DL,Y.DL],[J.DT,Y.DT],[J.EM,Y.EM],[J.EMBED,Y.EMBED],[J.FIELDSET,Y.FIELDSET],[J.FIGCAPTION,Y.FIGCAPTION],[J.FIGURE,Y.FIGURE],[J.FONT,Y.FONT],[J.FOOTER,Y.FOOTER],[J.FOREIGN_OBJECT,Y.FOREIGN_OBJECT],[J.FORM,Y.FORM],[J.FRAME,Y.FRAME],[J.FRAMESET,Y.FRAMESET],[J.H1,Y.H1],[J.H2,Y.H2],[J.H3,Y.H3],[J.H4,Y.H4],[J.H5,Y.H5],[J.H6,Y.H6],[J.HEAD,Y.HEAD],[J.HEADER,Y.HEADER],[J.HGROUP,Y.HGROUP],[J.HR,Y.HR],[J.HTML,Y.HTML],[J.I,Y.I],[J.IMG,Y.IMG],[J.IMAGE,Y.IMAGE],[J.INPUT,Y.INPUT],[J.IFRAME,Y.IFRAME],[J.KEYGEN,Y.KEYGEN],[J.LABEL,Y.LABEL],[J.LI,Y.LI],[J.LINK,Y.LINK],[J.LISTING,Y.LISTING],[J.MAIN,Y.MAIN],[J.MALIGNMARK,Y.MALIGNMARK],[J.MARQUEE,Y.MARQUEE],[J.MATH,Y.MATH],[J.MENU,Y.MENU],[J.META,Y.META],[J.MGLYPH,Y.MGLYPH],[J.MI,Y.MI],[J.MO,Y.MO],[J.MN,Y.MN],[J.MS,Y.MS],[J.MTEXT,Y.MTEXT],[J.NAV,Y.NAV],[J.NOBR,Y.NOBR],[J.NOFRAMES,Y.NOFRAMES],[J.NOEMBED,Y.NOEMBED],[J.NOSCRIPT,Y.NOSCRIPT],[J.OBJECT,Y.OBJECT],[J.OL,Y.OL],[J.OPTGROUP,Y.OPTGROUP],[J.OPTION,Y.OPTION],[J.P,Y.P],[J.PARAM,Y.PARAM],[J.PLAINTEXT,Y.PLAINTEXT],[J.PRE,Y.PRE],[J.RB,Y.RB],[J.RP,Y.RP],[J.RT,Y.RT],[J.RTC,Y.RTC],[J.RUBY,Y.RUBY],[J.S,Y.S],[J.SCRIPT,Y.SCRIPT],[J.SEARCH,Y.SEARCH],[J.SECTION,Y.SECTION],[J.SELECT,Y.SELECT],[J.SOURCE,Y.SOURCE],[J.SMALL,Y.SMALL],[J.SPAN,Y.SPAN],[J.STRIKE,Y.STRIKE],[J.STRONG,Y.STRONG],[J.STYLE,Y.STYLE],[J.SUB,Y.SUB],[J.SUMMARY,Y.SUMMARY],[J.SUP,Y.SUP],[J.TABLE,Y.TABLE],[J.TBODY,Y.TBODY],[J.TEMPLATE,Y.TEMPLATE],[J.TEXTAREA,Y.TEXTAREA],[J.TFOOT,Y.TFOOT],[J.TD,Y.TD],[J.TH,Y.TH],[J.THEAD,Y.THEAD],[J.TITLE,Y.TITLE],[J.TR,Y.TR],[J.TRACK,Y.TRACK],[J.TT,Y.TT],[J.U,Y.U],[J.UL,Y.UL],[J.SVG,Y.SVG],[J.VAR,Y.VAR],[J.WBR,Y.WBR],[J.XMP,Y.XMP]]);function IP(e){return FP.get(e)??Y.UNKNOWN}var X=Y,LP={[q.HTML]:new Set([X.ADDRESS,X.APPLET,X.AREA,X.ARTICLE,X.ASIDE,X.BASE,X.BASEFONT,X.BGSOUND,X.BLOCKQUOTE,X.BODY,X.BR,X.BUTTON,X.CAPTION,X.CENTER,X.COL,X.COLGROUP,X.DD,X.DETAILS,X.DIR,X.DIV,X.DL,X.DT,X.EMBED,X.FIELDSET,X.FIGCAPTION,X.FIGURE,X.FOOTER,X.FORM,X.FRAME,X.FRAMESET,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HEADER,X.HGROUP,X.HR,X.HTML,X.IFRAME,X.IMG,X.INPUT,X.LI,X.LINK,X.LISTING,X.MAIN,X.MARQUEE,X.MENU,X.META,X.NAV,X.NOEMBED,X.NOFRAMES,X.NOSCRIPT,X.OBJECT,X.OL,X.P,X.PARAM,X.PLAINTEXT,X.PRE,X.SCRIPT,X.SECTION,X.SELECT,X.SOURCE,X.STYLE,X.SUMMARY,X.TABLE,X.TBODY,X.TD,X.TEMPLATE,X.TEXTAREA,X.TFOOT,X.TH,X.THEAD,X.TITLE,X.TR,X.TRACK,X.UL,X.WBR,X.XMP]),[q.MATHML]:new Set([X.MI,X.MO,X.MN,X.MS,X.MTEXT,X.ANNOTATION_XML]),[q.SVG]:new Set([X.TITLE,X.FOREIGN_OBJECT,X.DESC]),[q.XLINK]:new Set,[q.XML]:new Set,[q.XMLNS]:new Set},RP=new Set([X.H1,X.H2,X.H3,X.H4,X.H5,X.H6]);new Set([J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT]);var Z;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Z||={});var zP={DATA:Z.DATA,RCDATA:Z.RCDATA,RAWTEXT:Z.RAWTEXT,SCRIPT_DATA:Z.SCRIPT_DATA,PLAINTEXT:Z.PLAINTEXT,CDATA_SECTION:Z.CDATA_SECTION};function BP(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function VP(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function HP(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function UP(e){return HP(e)||VP(e)}function WP(e){return UP(e)||BP(e)}function GP(e){return e+32}function KP(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function qP(e){return KP(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function JP(e){return e===G.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:uP(e)?K.surrogateCharacterReference:mP(e)?K.noncharacterCharacterReference:pP(e)||e===G.CARRIAGE_RETURN?K.controlCharacterReference:null}var YP=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Z.DATA,this.returnState=Z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new gP(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new jP(yP,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=JP(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:_P.START_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:_P.END_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:_P.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:_P.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(vP(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(K.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=IP(e.tagName),e.type===_P.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(K.endTagWithAttributes),e.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case _P.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case _P.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case _P.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:_P.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=KP(e)?_P.WHITESPACE_CHARACTER:e===G.NULL?_P.NULL_CHARACTER:_P.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(_P.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?AP.Attribute:AP.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Z.DATA:this._stateData(e);break;case Z.RCDATA:this._stateRcdata(e);break;case Z.RAWTEXT:this._stateRawtext(e);break;case Z.SCRIPT_DATA:this._stateScriptData(e);break;case Z.PLAINTEXT:this._statePlaintext(e);break;case Z.TAG_OPEN:this._stateTagOpen(e);break;case Z.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Z.TAG_NAME:this._stateTagName(e);break;case Z.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Z.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Z.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Z.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Z.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Z.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Z.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Z.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Z.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Z.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Z.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Z.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Z.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Z.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Z.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Z.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Z.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Z.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Z.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Z.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Z.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Z.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Z.BOGUS_COMMENT:this._stateBogusComment(e);break;case Z.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Z.COMMENT_START:this._stateCommentStart(e);break;case Z.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Z.COMMENT:this._stateComment(e);break;case Z.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Z.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Z.COMMENT_END:this._stateCommentEnd(e);break;case Z.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Z.DOCTYPE:this._stateDoctype(e);break;case Z.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Z.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Z.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Z.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Z.CDATA_SECTION:this._stateCdataSection(e);break;case Z.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Z.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Z.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Z.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.TAG_OPEN;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitCodePoint(e);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case G.AMPERSAND:this._startCharacterReference();break;case G.LESS_THAN_SIGN:this.state=Z.RCDATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.RAWTEXT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(UP(e))this._createStartTagToken(),this.state=Z.TAG_NAME,this._stateTagName(e);else switch(e){case G.EXCLAMATION_MARK:this.state=Z.MARKUP_DECLARATION_OPEN;break;case G.SOLIDUS:this.state=Z.END_TAG_OPEN;break;case G.QUESTION_MARK:this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e);break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Z.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(UP(e))this._createEndTagToken(),this.state=Z.TAG_NAME,this._stateTagName(e);else switch(e){case G.GREATER_THAN_SIGN:this._err(K.missingEndTagName),this.state=Z.DATA;break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this.state=Z.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.tagName+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(VP(e)?GP(e):e)}}_stateRcdataLessThanSign(e){e===G.SOLIDUS?this.state=Z.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Z.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){UP(e)?(this.state=Z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Z.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Z.BEFORE_ATTRIBUTE_NAME,!1;case G.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Z.SELF_CLOSING_START_TAG,!1;case G.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===G.SOLIDUS?this.state=Z.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){UP(e)?(this.state=Z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case G.SOLIDUS:this.state=Z.SCRIPT_DATA_END_TAG_OPEN;break;case G.EXCLAMATION_MARK:this.state=Z.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){UP(e)?(this.state=Z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===G.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===G.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.GREATER_THAN_SIGN:this.state=Z.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===G.SOLIDUS?this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:UP(e)?(this._emitChars(`<`),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){UP(e)?(this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(lP.SCRIPT,!1)&&qP(this.preprocessor.peek(lP.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<lP.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.GREATER_THAN_SIGN:this.state=Z.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===G.SOLIDUS?(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(lP.SCRIPT,!1)&&qP(this.preprocessor.peek(lP.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<lP.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._err(K.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Z.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this._leaveAttrName(),this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._leaveAttrName(),this.state=Z.BEFORE_ATTRIBUTE_VALUE;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:this._err(K.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(VP(e)?GP(e):e)}}_stateAfterAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:this.state=Z.SELF_CLOSING_START_TAG;break;case G.EQUALS_SIGN:this.state=Z.BEFORE_ATTRIBUTE_VALUE;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:this.state=Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case G.APOSTROPHE:this.state=Z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingAttributeValue),this.state=Z.DATA,this.emitCurrentTagToken();break;default:this.state=Z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case G.APOSTROPHE:this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.AMPERSAND:this._startCharacterReference();break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:case G.EQUALS_SIGN:case G.GRAVE_ACCENT:this._err(K.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this._leaveAttrValue(),this.state=Z.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.missingWhitespaceBetweenAttributes),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case G.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Z.DATA,this.emitCurrentTagToken();break}case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.unexpectedSolidusInTag),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(lP.DASH_DASH,!0)?(this._createCommentToken(lP.DASH_DASH.length+1),this.state=Z.COMMENT_START):this._consumeSequenceIfMatch(lP.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(lP.DOCTYPE.length+1),this.state=Z.DOCTYPE):this._consumeSequenceIfMatch(lP.CDATA_START,!0)?this.inForeignNode?this.state=Z.CDATA_SECTION:(this._err(K.cdataInHtmlContent),this._createCommentToken(lP.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(K.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_START_DASH;break;case G.GREATER_THAN_SIGN:{this._err(K.abruptClosingOfEmptyComment),this.state=Z.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END;break;case G.GREATER_THAN_SIGN:this._err(K.abruptClosingOfEmptyComment),this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Z.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END_DASH;break;case G.LESS_THAN_SIGN:t.data+=`<`,this.state=Z.COMMENT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case G.EXCLAMATION_MARK:t.data+=`!`,this.state=Z.COMMENT_LESS_THAN_SIGN_BANG;break;case G.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===G.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Z.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===G.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Z.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==G.GREATER_THAN_SIGN&&e!==G.EOF&&this._err(K.nestedComment),this.state=Z.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EXCLAMATION_MARK:this.state=Z.COMMENT_END_BANG;break;case G.HYPHEN_MINUS:t.data+=`-`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:t.data+=`--!`,this.state=Z.COMMENT_END_DASH;break;case G.GREATER_THAN_SIGN:this._err(K.incorrectlyClosedComment),this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Z.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(K.missingWhitespaceBeforeDoctypeName),this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(VP(e))this._createDoctypeToken(String.fromCharCode(GP(e))),this.state=Z.DOCTYPE_NAME;else switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.NULL:this._err(K.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Z.DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:{this._err(K.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Z.DATA;break}case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Z.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.AFTER_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.NULL:this._err(K.unexpectedNullCharacter),t.name+=`�`;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(VP(e)?GP(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(lP.PUBLIC,!1)?this.state=Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(lP.SYSTEM,!1)?this.state=Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(K.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.QUOTATION_MARK:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.NULL:this._err(K.unexpectedNullCharacter);break;case G.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case G.RIGHT_SQUARE_BRACKET:this.state=Z.CDATA_SECTION_BRACKET;break;case G.EOF:this._err(K.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===G.RIGHT_SQUARE_BRACKET?this.state=Z.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Z.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA;break;case G.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Z.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(G.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&WP(this.preprocessor.peek(1))?Z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){WP(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===G.SEMICOLON&&this._err(K.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},XP=new Set([Y.DD,Y.DT,Y.LI,Y.OPTGROUP,Y.OPTION,Y.P,Y.RB,Y.RP,Y.RT,Y.RTC]),ZP=new Set([...XP,Y.CAPTION,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]),QP=new Set([Y.APPLET,Y.CAPTION,Y.HTML,Y.MARQUEE,Y.OBJECT,Y.TABLE,Y.TD,Y.TEMPLATE,Y.TH]),$P=new Set([...QP,Y.OL,Y.UL]),eF=new Set([...QP,Y.BUTTON]),tF=new Set([Y.ANNOTATION_XML,Y.MI,Y.MN,Y.MO,Y.MS,Y.MTEXT]),nF=new Set([Y.DESC,Y.FOREIGN_OBJECT,Y.TITLE]),rF=new Set([Y.TR,Y.TEMPLATE,Y.HTML]),iF=new Set([Y.TBODY,Y.TFOOT,Y.THEAD,Y.TEMPLATE,Y.HTML]),aF=new Set([Y.TABLE,Y.TEMPLATE,Y.HTML]),oF=new Set([Y.TD,Y.TH]),sF=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Y.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===q.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==q.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(RP,q.HTML)}popUntilTableCellPopped(){this.popUntilPopped(oF,q.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(aF,q.HTML)}clearBackToTableBodyContext(){this.clearBackTo(iF,q.HTML)}clearBackToTableRowContext(){this.clearBackTo(rF,q.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Y.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===Y.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case q.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case q.SVG:if(nF.has(r))return!1;break;case q.MATHML:if(tF.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,QP)}hasInListItemScope(e){return this.hasInDynamicScope(e,$P)}hasInButtonScope(e){return this.hasInDynamicScope(e,eF)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case q.HTML:if(RP.has(t))return!0;if(QP.has(t))return!1;break;case q.SVG:if(nF.has(t))return!1;break;case q.MATHML:if(tF.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===q.HTML)switch(this.tagIDs[e]){case Y.TBODY:case Y.THEAD:case Y.TFOOT:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.OPTION:case Y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&XP.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ZP.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&ZP.has(this.currentTagId);)this.pop()}},cF=3,lF;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(lF||={});var uF={type:lF.Marker},dF=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===lF.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<cF)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<cF)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=cF&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(uF)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:lF.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:lF.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(uF);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===lF.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===lF.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===lF.Element&&t.element===e)}},fF={createDocument(){return{nodeName:`#document`,mode:PP.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};fF.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(fF.isTextNode(n)){n.value+=t;return}}fF.appendChild(e,fF.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&fF.isTextNode(r)?r.value+=t:fF.insertBefore(e,fF.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},pF=`html`,mF=`about:legacy-compat`,hF=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,gF=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),_F=[...gF,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],vF=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),yF=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],bF=[...yF,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function xF(e,t){return t.some(t=>e.startsWith(t))}function SF(e){return e.name===pF&&e.publicId===null&&(e.systemId===null||e.systemId===mF)}function CF(e){if(e.name!==pF)return PP.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===hF)return PP.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),vF.has(n))return PP.QUIRKS;let e=t===null?_F:gF;if(xF(n,e))return PP.QUIRKS;if(e=t===null?yF:bF,xF(n,e))return PP.LIMITED_QUIRKS}return PP.NO_QUIRKS}var wF={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},TF=`definitionurl`,EF=`definitionURL`,DF=new Map(`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`.split(`.`).map(e=>[e.toLowerCase(),e])),OF=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:q.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:q.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:q.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:q.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:q.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:q.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:q.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:q.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:q.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:q.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:q.XMLNS}]]),kF=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),AF=new Set([Y.B,Y.BIG,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.CENTER,Y.CODE,Y.DD,Y.DIV,Y.DL,Y.DT,Y.EM,Y.EMBED,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HR,Y.I,Y.IMG,Y.LI,Y.LISTING,Y.MENU,Y.META,Y.NOBR,Y.OL,Y.P,Y.PRE,Y.RUBY,Y.S,Y.SMALL,Y.SPAN,Y.STRONG,Y.STRIKE,Y.SUB,Y.SUP,Y.TABLE,Y.TT,Y.U,Y.UL,Y.VAR]);function jF(e){let t=e.tagID;return t===Y.FONT&&e.attrs.some(({name:e})=>e===NP.COLOR||e===NP.SIZE||e===NP.FACE)||AF.has(t)}function MF(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===TF){e.attrs[t].name=EF;break}}function NF(e){for(let t=0;t<e.attrs.length;t++){let n=DF.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function PF(e){for(let t=0;t<e.attrs.length;t++){let n=OF.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function FF(e){let t=kF.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=IP(e.tagName))}function IF(e,t){return t===q.MATHML&&(e===Y.MI||e===Y.MO||e===Y.MN||e===Y.MS||e===Y.MTEXT)}function LF(e,t,n){if(t===q.MATHML&&e===Y.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===NP.ENCODING){let t=n[e].value.toLowerCase();return t===wF.TEXT_HTML||t===wF.APPLICATION_XML}}return t===q.SVG&&(e===Y.FOREIGN_OBJECT||e===Y.DESC||e===Y.TITLE)}function RF(e,t,n,r){return(!r||r===q.HTML)&&LF(e,t,n)||(!r||r===q.MATHML)&&IF(e,t)}var zF=`hidden`,BF=8,VF=3,Q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Q||={});var HF={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},UF=new Set([Y.TABLE,Y.TBODY,Y.TFOOT,Y.THEAD,Y.TR]),WF={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:fF,onParseError:null},GF=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Q.INITIAL,this.originalInsertionMode=Q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...WF,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new YP(this.options,this),this.activeFormattingElements=new dF(this.treeAdapter),this.fragmentContextID=n?IP(this.treeAdapter.getTagName(n)):Y.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new sF(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...WF,...t};e??=n.treeAdapter.createElement(J.TEMPLATE,q.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,q.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===Y.TEMPLATE&&i.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??HF,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===q.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,q.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=zP.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===J.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==q.HTML))switch(this.fragmentContextID){case Y.TITLE:case Y.TEXTAREA:this.tokenizer.state=zP.RCDATA;break;case Y.STYLE:case Y.XMP:case Y.IFRAME:case Y.NOEMBED:case Y.NOFRAMES:case Y.NOSCRIPT:this.tokenizer.state=zP.RAWTEXT;break;case Y.SCRIPT:this.tokenizer.state=zP.SCRIPT_DATA;break;case Y.PLAINTEXT:this.tokenizer.state=zP.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,q.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,q.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(J.HTML,q.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Y.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===_P.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===Y.SVG&&this.treeAdapter.getTagName(t)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===q.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===Y.MGLYPH||e.tagID===Y.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,q.HTML)}_processToken(e){switch(e.type){case _P.CHARACTER:this.onCharacter(e);break;case _P.NULL_CHARACTER:this.onNullCharacter(e);break;case _P.COMMENT:this.onComment(e);break;case _P.DOCTYPE:this.onDoctype(e);break;case _P.START_TAG:this._processStartTag(e);break;case _P.END_TAG:this.onEndTag(e);break;case _P.EOF:this.onEof(e);break;case _P.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return RF(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===lF.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(Y.P),this.openElements.popUntilTagNamePopped(Y.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Y.TR:this.insertionMode=Q.IN_ROW;return;case Y.TBODY:case Y.THEAD:case Y.TFOOT:this.insertionMode=Q.IN_TABLE_BODY;return;case Y.CAPTION:this.insertionMode=Q.IN_CAPTION;return;case Y.COLGROUP:this.insertionMode=Q.IN_COLUMN_GROUP;return;case Y.TABLE:this.insertionMode=Q.IN_TABLE;return;case Y.BODY:this.insertionMode=Q.IN_BODY;return;case Y.FRAMESET:this.insertionMode=Q.IN_FRAMESET;return;case Y.SELECT:this._resetInsertionModeForSelect(e);return;case Y.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case Y.HTML:this.insertionMode=this.headElement?Q.AFTER_HEAD:Q.BEFORE_HEAD;return;case Y.TD:case Y.TH:if(e>0){this.insertionMode=Q.IN_CELL;return}break;case Y.HEAD:if(e>0){this.insertionMode=Q.IN_HEAD;return}break}this.insertionMode=Q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===Y.TEMPLATE)break;if(e===Y.TABLE){this.insertionMode=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(e){return UF.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case Y.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===q.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Y.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return LP[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lR(this,e);return}switch(this.insertionMode){case Q.INITIAL:iI(this,e);break;case Q.BEFORE_HTML:sI(this,e);break;case Q.BEFORE_HEAD:uI(this,e);break;case Q.IN_HEAD:mI(this,e);break;case Q.IN_HEAD_NO_SCRIPT:_I(this,e);break;case Q.AFTER_HEAD:bI(this,e);break;case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:CI(this,e);break;case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:vL(this,e);break;case Q.IN_TABLE_TEXT:jL(this,e);break;case Q.IN_COLUMN_GROUP:RL(this,e);break;case Q.AFTER_BODY:eR(this,e);break;case Q.AFTER_AFTER_BODY:oR(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){cR(this,e);return}switch(this.insertionMode){case Q.INITIAL:iI(this,e);break;case Q.BEFORE_HTML:sI(this,e);break;case Q.BEFORE_HEAD:uI(this,e);break;case Q.IN_HEAD:mI(this,e);break;case Q.IN_HEAD_NO_SCRIPT:_I(this,e);break;case Q.AFTER_HEAD:bI(this,e);break;case Q.TEXT:this._insertCharacters(e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:vL(this,e);break;case Q.IN_COLUMN_GROUP:RL(this,e);break;case Q.AFTER_BODY:eR(this,e);break;case Q.AFTER_AFTER_BODY:oR(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){$F(this,e);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:$F(this,e);break;case Q.IN_TABLE_TEXT:ML(this,e);break;case Q.AFTER_BODY:eI(this,e);break;case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:tI(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:rI(this,e);break;case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:this._err(e,K.misplacedDoctype);break;case Q.IN_TABLE_TEXT:ML(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?dR(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Q.INITIAL:iI(this,e);break;case Q.BEFORE_HTML:aI(this,e);break;case Q.BEFORE_HEAD:cI(this,e);break;case Q.IN_HEAD:dI(this,e);break;case Q.IN_HEAD_NO_SCRIPT:hI(this,e);break;case Q.AFTER_HEAD:vI(this,e);break;case Q.IN_BODY:nL(this,e);break;case Q.IN_TABLE:DL(this,e);break;case Q.IN_TABLE_TEXT:ML(this,e);break;case Q.IN_CAPTION:PL(this,e);break;case Q.IN_COLUMN_GROUP:IL(this,e);break;case Q.IN_TABLE_BODY:zL(this,e);break;case Q.IN_ROW:VL(this,e);break;case Q.IN_CELL:UL(this,e);break;case Q.IN_SELECT:GL(this,e);break;case Q.IN_SELECT_IN_TABLE:qL(this,e);break;case Q.IN_TEMPLATE:YL(this,e);break;case Q.AFTER_BODY:QL(this,e);break;case Q.IN_FRAMESET:tR(this,e);break;case Q.AFTER_FRAMESET:rR(this,e);break;case Q.AFTER_AFTER_BODY:aR(this,e);break;case Q.AFTER_AFTER_FRAMESET:sR(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?fR(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Q.INITIAL:iI(this,e);break;case Q.BEFORE_HTML:oI(this,e);break;case Q.BEFORE_HEAD:lI(this,e);break;case Q.IN_HEAD:fI(this,e);break;case Q.IN_HEAD_NO_SCRIPT:gI(this,e);break;case Q.AFTER_HEAD:yI(this,e);break;case Q.IN_BODY:mL(this,e);break;case Q.TEXT:gL(this,e);break;case Q.IN_TABLE:OL(this,e);break;case Q.IN_TABLE_TEXT:ML(this,e);break;case Q.IN_CAPTION:FL(this,e);break;case Q.IN_COLUMN_GROUP:LL(this,e);break;case Q.IN_TABLE_BODY:BL(this,e);break;case Q.IN_ROW:HL(this,e);break;case Q.IN_CELL:WL(this,e);break;case Q.IN_SELECT:KL(this,e);break;case Q.IN_SELECT_IN_TABLE:JL(this,e);break;case Q.IN_TEMPLATE:XL(this,e);break;case Q.AFTER_BODY:$L(this,e);break;case Q.IN_FRAMESET:nR(this,e);break;case Q.AFTER_FRAMESET:iR(this,e);break;case Q.AFTER_AFTER_BODY:oR(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Q.INITIAL:iI(this,e);break;case Q.BEFORE_HTML:sI(this,e);break;case Q.BEFORE_HEAD:uI(this,e);break;case Q.IN_HEAD:mI(this,e);break;case Q.IN_HEAD_NO_SCRIPT:_I(this,e);break;case Q.AFTER_HEAD:bI(this,e);break;case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:hL(this,e);break;case Q.TEXT:_L(this,e);break;case Q.IN_TABLE_TEXT:ML(this,e);break;case Q.IN_TEMPLATE:ZL(this,e);break;case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:nI(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===G.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:this._insertCharacters(e);break;case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:SI(this,e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:vL(this,e);break;case Q.IN_TABLE_TEXT:AL(this,e);break;default:}}};function KF(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):pL(e,t),n}function qF(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function JF(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=VF;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=YF(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function YF(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function XF(e,t,n){let r=IP(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===Y.TEMPLATE&&i===q.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function ZF(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function QF(e,t){for(let n=0;n<BF;n++){let n=KF(e,t);if(!n)break;let r=qF(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=JF(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&XF(e,a,i),ZF(e,r,n)}}function $F(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function eI(e,t){e._appendCommentNode(t,e.openElements.items[0])}function tI(e,t){e._appendCommentNode(t,e.document)}function nI(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function rI(e,t){e._setDocumentType(t);let n=t.forceQuirks?PP.QUIRKS:CF(t);SF(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function iI(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,PP.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function aI(e,t){t.tagID===Y.HTML?(e._insertElement(t,q.HTML),e.insertionMode=Q.BEFORE_HEAD):sI(e,t)}function oI(e,t){let n=t.tagID;(n===Y.HTML||n===Y.HEAD||n===Y.BODY||n===Y.BR)&&sI(e,t)}function sI(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function cI(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.HEAD:e._insertElement(t,q.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break;default:uI(e,t)}}function lI(e,t){let n=t.tagID;n===Y.HEAD||n===Y.BODY||n===Y.HTML||n===Y.BR?uI(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function uI(e,t){e._insertFakeElement(J.HEAD,Y.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function dI(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TITLE:e._switchToTextParsing(t,zP.RCDATA);break;case Y.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,zP.RAWTEXT):(e._insertElement(t,q.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break;case Y.NOFRAMES:case Y.STYLE:e._switchToTextParsing(t,zP.RAWTEXT);break;case Y.SCRIPT:e._switchToTextParsing(t,zP.SCRIPT_DATA);break;case Y.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:mI(e,t)}}function fI(e,t){switch(t.tagID){case Y.HEAD:e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break;case Y.BODY:case Y.BR:case Y.HTML:mI(e,t);break;case Y.TEMPLATE:pI(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function pI(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Y.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function mI(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function hI(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.BASEFONT:case Y.BGSOUND:case Y.HEAD:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.STYLE:dI(e,t);break;case Y.NOSCRIPT:e._err(t,K.nestedNoscriptInHead);break;default:_I(e,t)}}function gI(e,t){switch(t.tagID){case Y.NOSCRIPT:e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break;case Y.BR:_I(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function _I(e,t){let n=t.type===_P.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function vI(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.BODY:e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break;case Y.FRAMESET:e._insertElement(t,q.HTML),e.insertionMode=Q.IN_FRAMESET;break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,Y.HEAD),dI(e,t),e.openElements.remove(e.headElement);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:bI(e,t)}}function yI(e,t){switch(t.tagID){case Y.BODY:case Y.HTML:case Y.BR:bI(e,t);break;case Y.TEMPLATE:pI(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function bI(e,t){e._insertFakeElement(J.BODY,Y.BODY),e.insertionMode=Q.IN_BODY,xI(e,t)}function xI(e,t){switch(t.type){case _P.CHARACTER:CI(e,t);break;case _P.WHITESPACE_CHARACTER:SI(e,t);break;case _P.COMMENT:$F(e,t);break;case _P.START_TAG:nL(e,t);break;case _P.END_TAG:mL(e,t);break;case _P.EOF:hL(e,t);break;default:}}function SI(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function CI(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function wI(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function TI(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function EI(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_FRAMESET)}function DI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function OI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&RP.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,q.HTML)}function kI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function AI(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),n||(e.formElement=e.openElements.current))}function jI(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===Y.LI&&r===Y.LI||(n===Y.DD||n===Y.DT)&&(r===Y.DD||r===Y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Y.ADDRESS&&r!==Y.DIV&&r!==Y.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function MI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.tokenizer.state=zP.PLAINTEXT}function NI(e,t){e.openElements.hasInScope(Y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1}function PI(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);n&&(QF(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FI(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function II(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Y.NOBR)&&(QF(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LI(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function RI(e,t){e.treeAdapter.getDocumentMode(e.document)!==PP.QUIRKS&&e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function zI(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function BI(e){let t=vP(e,NP.TYPE);return t!=null&&t.toLowerCase()===zF}function VI(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),BI(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function HI(e,t){e._appendElement(t,q.HTML),t.ackSelfClosing=!0}function UI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function WI(e,t){t.tagName=J.IMG,t.tagID=Y.IMG,zI(e,t)}function GI(e,t){e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.tokenizer.state=zP.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function KI(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,zP.RAWTEXT)}function qI(e,t){e.framesetOk=!1,e._switchToTextParsing(t,zP.RAWTEXT)}function JI(e,t){e._switchToTextParsing(t,zP.RAWTEXT)}function YI(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function XI(e,t){e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function ZI(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,q.HTML)}function QI(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Y.RTC),e._insertElement(t,q.HTML)}function $I(e,t){e._reconstructActiveFormattingElements(),MF(t),PF(t),t.selfClosing?e._appendElement(t,q.MATHML):e._insertElement(t,q.MATHML),t.ackSelfClosing=!0}function eL(e,t){e._reconstructActiveFormattingElements(),NF(t),PF(t),t.selfClosing?e._appendElement(t,q.SVG):e._insertElement(t,q.SVG),t.ackSelfClosing=!0}function tL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function nL(e,t){switch(t.tagID){case Y.I:case Y.S:case Y.B:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.SMALL:case Y.STRIKE:case Y.STRONG:FI(e,t);break;case Y.A:PI(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:OI(e,t);break;case Y.P:case Y.DL:case Y.OL:case Y.UL:case Y.DIV:case Y.DIR:case Y.NAV:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.DETAILS:case Y.ADDRESS:case Y.ARTICLE:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:DI(e,t);break;case Y.LI:case Y.DD:case Y.DT:jI(e,t);break;case Y.BR:case Y.IMG:case Y.WBR:case Y.AREA:case Y.EMBED:case Y.KEYGEN:zI(e,t);break;case Y.HR:UI(e,t);break;case Y.RB:case Y.RTC:ZI(e,t);break;case Y.RT:case Y.RP:QI(e,t);break;case Y.PRE:case Y.LISTING:kI(e,t);break;case Y.XMP:KI(e,t);break;case Y.SVG:eL(e,t);break;case Y.HTML:wI(e,t);break;case Y.BASE:case Y.LINK:case Y.META:case Y.STYLE:case Y.TITLE:case Y.SCRIPT:case Y.BGSOUND:case Y.BASEFONT:case Y.TEMPLATE:dI(e,t);break;case Y.BODY:TI(e,t);break;case Y.FORM:AI(e,t);break;case Y.NOBR:II(e,t);break;case Y.MATH:$I(e,t);break;case Y.TABLE:RI(e,t);break;case Y.INPUT:VI(e,t);break;case Y.PARAM:case Y.TRACK:case Y.SOURCE:HI(e,t);break;case Y.IMAGE:WI(e,t);break;case Y.BUTTON:NI(e,t);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:LI(e,t);break;case Y.IFRAME:qI(e,t);break;case Y.SELECT:YI(e,t);break;case Y.OPTION:case Y.OPTGROUP:XI(e,t);break;case Y.NOEMBED:case Y.NOFRAMES:JI(e,t);break;case Y.FRAMESET:EI(e,t);break;case Y.TEXTAREA:GI(e,t);break;case Y.NOSCRIPT:e.options.scriptingEnabled?JI(e,t):tL(e,t);break;case Y.PLAINTEXT:MI(e,t);break;case Y.COL:case Y.TH:case Y.TD:case Y.TR:case Y.HEAD:case Y.FRAME:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.CAPTION:case Y.COLGROUP:break;default:tL(e,t)}}function rL(e,t){if(e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function iL(e,t){e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Q.AFTER_BODY,$L(e,t))}function aL(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function oL(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Y.FORM):n&&e.openElements.remove(n))}function sL(e){e.openElements.hasInButtonScope(Y.P)||e._insertFakeElement(J.P,Y.P),e._closePElement()}function cL(e){e.openElements.hasInListItemScope(Y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Y.LI),e.openElements.popUntilTagNamePopped(Y.LI))}function lL(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function uL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function dL(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function fL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,Y.BR),e.openElements.pop(),e.framesetOk=!1}function pL(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==Y.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function mL(e,t){switch(t.tagID){case Y.A:case Y.B:case Y.I:case Y.S:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.NOBR:case Y.SMALL:case Y.STRIKE:case Y.STRONG:QF(e,t);break;case Y.P:sL(e);break;case Y.DL:case Y.UL:case Y.OL:case Y.DIR:case Y.DIV:case Y.NAV:case Y.PRE:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.BUTTON:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.ADDRESS:case Y.ARTICLE:case Y.DETAILS:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.LISTING:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:aL(e,t);break;case Y.LI:cL(e);break;case Y.DD:case Y.DT:lL(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:uL(e);break;case Y.BR:fL(e);break;case Y.BODY:rL(e,t);break;case Y.HTML:iL(e,t);break;case Y.FORM:oL(e);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:dL(e,t);break;case Y.TEMPLATE:pI(e,t);break;default:pL(e,t)}}function hL(e,t){e.tmplInsertionModeStack.length>0?ZL(e,t):nI(e,t)}function gL(e,t){var n;t.tagID===Y.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function _L(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function vL(e,t){if(e.openElements.currentTagId!==void 0&&UF.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case _P.CHARACTER:jL(e,t);break;case _P.WHITESPACE_CHARACTER:AL(e,t);break}else kL(e,t)}function yL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_CAPTION}function bL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function xL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,Y.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,IL(e,t)}function SL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_TABLE_BODY}function CL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,Y.TBODY),e.insertionMode=Q.IN_TABLE_BODY,zL(e,t)}function wL(e,t){e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function TL(e,t){BI(t)?e._appendElement(t,q.HTML):kL(e,t),t.ackSelfClosing=!0}function EL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,q.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function DL(e,t){switch(t.tagID){case Y.TD:case Y.TH:case Y.TR:CL(e,t);break;case Y.STYLE:case Y.SCRIPT:case Y.TEMPLATE:dI(e,t);break;case Y.COL:xL(e,t);break;case Y.FORM:EL(e,t);break;case Y.TABLE:wL(e,t);break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:SL(e,t);break;case Y.INPUT:TL(e,t);break;case Y.CAPTION:yL(e,t);break;case Y.COLGROUP:bL(e,t);break;default:kL(e,t)}}function OL(e,t){switch(t.tagID){case Y.TABLE:e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode());break;case Y.TEMPLATE:pI(e,t);break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:kL(e,t)}}function kL(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xI(e,t),e.fosterParentingEnabled=n}function AL(e,t){e.pendingCharacterTokens.push(t)}function jL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ML(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)kL(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var NL=new Set([Y.CAPTION,Y.COL,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]);function PL(e,t){let n=t.tagID;NL.has(n)?e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_TABLE,DL(e,t)):nL(e,t)}function FL(e,t){let n=t.tagID;switch(n){case Y.CAPTION:case Y.TABLE:e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_TABLE,n===Y.TABLE&&OL(e,t));break;case Y.BODY:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:mL(e,t)}}function IL(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.COL:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TEMPLATE:dI(e,t);break;default:RL(e,t)}}function LL(e,t){switch(t.tagID){case Y.COLGROUP:e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE);break;case Y.TEMPLATE:pI(e,t);break;case Y.COL:break;default:RL(e,t)}}function RL(e,t){e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE,e._processToken(t))}function zL(e,t){switch(t.tagID){case Y.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_ROW;break;case Y.TH:case Y.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(J.TR,Y.TR),e.insertionMode=Q.IN_ROW,VL(e,t);break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE,DL(e,t));break;default:DL(e,t)}}function BL(e,t){let n=t.tagID;switch(t.tagID){case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE);break;case Y.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE,OL(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:case Y.TR:break;default:OL(e,t)}}function VL(e,t){switch(t.tagID){case Y.TH:case Y.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_CELL,e.activeFormattingElements.insertMarker();break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,zL(e,t));break;default:DL(e,t)}}function HL(e,t){switch(t.tagID){case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY);break;case Y.TABLE:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,BL(e,t));break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(Y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,BL(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:break;default:OL(e,t)}}function UL(e,t){let n=t.tagID;NL.has(n)?(e.openElements.hasInTableScope(Y.TD)||e.openElements.hasInTableScope(Y.TH))&&(e._closeTableCell(),VL(e,t)):nL(e,t)}function WL(e,t){let n=t.tagID;switch(n){case Y.TD:case Y.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_ROW);break;case Y.TABLE:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),HL(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:break;default:mL(e,t)}}function GL(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.OPTGROUP:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.HR:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.INPUT:case Y.KEYGEN:case Y.TEXTAREA:case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),t.tagID!==Y.SELECT&&e._processStartTag(t));break;case Y.SCRIPT:case Y.TEMPLATE:dI(e,t);break;default:}}function KL(e,t){switch(t.tagID){case Y.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===Y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop();break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop();break;case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode());break;case Y.TEMPLATE:pI(e,t);break;default:}}function qL(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):GL(e,t)}function JL(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):KL(e,t)}function YL(e,t){switch(t.tagID){case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:dI(e,t);break;case Y.CAPTION:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,DL(e,t);break;case Y.COL:e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,IL(e,t);break;case Y.TR:e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,zL(e,t);break;case Y.TD:case Y.TH:e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,VL(e,t);break;default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,nL(e,t)}}function XL(e,t){t.tagID===Y.TEMPLATE&&pI(e,t)}function ZL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):nI(e,t)}function QL(e,t){t.tagID===Y.HTML?nL(e,t):eR(e,t)}function $L(e,t){if(t.tagID===Y.HTML){if(e.fragmentContext||(e.insertionMode=Q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Y.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else eR(e,t)}function eR(e,t){e.insertionMode=Q.IN_BODY,xI(e,t)}function tR(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.FRAMESET:e._insertElement(t,q.HTML);break;case Y.FRAME:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.NOFRAMES:dI(e,t);break;default:}}function nR(e,t){t.tagID===Y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==Y.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function rR(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.NOFRAMES:dI(e,t);break;default:}}function iR(e,t){t.tagID===Y.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function aR(e,t){t.tagID===Y.HTML?nL(e,t):oR(e,t)}function oR(e,t){e.insertionMode=Q.IN_BODY,xI(e,t)}function sR(e,t){switch(t.tagID){case Y.HTML:nL(e,t);break;case Y.NOFRAMES:dI(e,t);break;default:}}function cR(e,t){t.chars=`�`,e._insertCharacters(t)}function lR(e,t){e._insertCharacters(t),e.framesetOk=!1}function uR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==q.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function dR(e,t){if(jF(t))uR(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===q.MATHML?MF(t):r===q.SVG&&(FF(t),NF(t)),PF(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function fR(e,t){if(t.tagID===Y.P||t.tagID===Y.BR){uR(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===q.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR]);function pR(e,t){return GF.parse(e,t)}function mR(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=GF.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var hR={basename:gR,dirname:_R,extname:vR,join:yR,sep:`/`};function gR(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);SR(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _R(e){if(SR(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function vR(e){SR(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function yR(...e){let t=-1,n;for(;++t<e.length;)SR(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:bR(n)}function bR(e){SR(e);let t=e.codePointAt(0)===47,n=xR(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function xR(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function SR(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var CR={cwd:wR};function wR(){return`/`}function TR(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ER(e){if(typeof e==`string`)e=new URL(e);else if(!TR(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return DR(e)}function DR(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var OR=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],kR=class{constructor(e){let t;t=e?TR(e)?{path:e}:typeof e==`string`||NR(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:CR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<OR.length;){let e=OR[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)OR.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?hR.basename(this.path):void 0}set basename(e){jR(e,`basename`),AR(e,`basename`),this.path=hR.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?hR.dirname(this.path):void 0}set dirname(e){MR(this.basename,`dirname`),this.path=hR.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?hR.extname(this.path):void 0}set extname(e){if(AR(e,`extname`),MR(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=hR.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){TR(e)&&(e=ER(e)),jR(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?hR.basename(this.path,this.extname):void 0}set stem(e){jR(e,`stem`),AR(e,`stem`),this.path=hR.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new AO(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function AR(e,t){if(e&&e.includes(hR.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+hR.sep+"`")}function jR(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function MR(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function NR(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var PR={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},FR=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,IR=/-[a-z]/g,LR=/%c(?:([-+])(\d+))?/g,RR=/%x/g,zR={2:!0,1:!1,0:null},BR={};function VR(e,t){let n=t||BR,r=n.onerror,i=e instanceof kR?e:new kR(e),a=n.fragment?mR:pR,o=String(i);return eP(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=HR(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=PR[a],o=new AO(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=zR[c],o.note=l(n.description),o.url=n.url===!1?void 0:FR+t,r(o)}function l(t){return t.replace(LR,n).replace(RR,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return WR(o.charAt(e.startOffset+i))}function r(){return GR(o.charCodeAt(e.startOffset))}}}}function HR(e){return e.replace(IR,UR)}function UR(e){return e.charAt(1).toUpperCase()}function WR(e){return e==="`"?"` ` `":e}function GR(e){return`0x`+e.toString(16).toUpperCase()}function KR(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return VR(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var qR=typeof self==`object`?self:globalThis,JR=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new qR[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new qR[a](o),i)};return r},YR=e=>JR(new Map,e)(0),XR=``,{toString:ZR}={},{keys:QR}=Object,$R=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=ZR.call(e).slice(8,-1);switch(n){case`Array`:return[1,XR];case`Object`:return[2,XR];case`Date`:return[3,XR];case`RegExp`:return[4,XR];case`Map`:return[5,XR];case`Set`:return[6,XR];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ez=([e,t])=>e===0&&(t===`function`||t===`symbol`),tz=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=$R(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of QR(r))(e||!ez($R(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ez($R(n))||ez($R(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ez($R(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},nz=(e,{json:t,lossy:n}={})=>{let r=[];return tz(!(t||n),!!t,new Map,r)(e),r},rz=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?YR(nz(e,t)):structuredClone(e):(e,t)=>YR(nz(e,t)),iz=(function(e,t,n,r,i){let a=az(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return uz(e)?a.call(i,e,n,r):!1}),az=(function(e){if(e==null)return lz;if(typeof e==`string`)return sz(e);if(typeof e==`object`)return oz(e);if(typeof e==`function`)return cz(e);throw Error("Expected function, string, or array as `test`")});function oz(e){let t=[],n=-1;for(;++n<e.length;)t[n]=az(e[n]);return cz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sz(e){return cz(t);function t(t){return t.tagName===e}}function cz(e){return t;function t(t,n,r){return!!(uz(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function lz(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function uz(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var dz=az(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),fz=/[ \t\n\f\r]/g;function pz(e){return typeof e==`object`?e.type===`text`?mz(e.value):!1:mz(e)}function mz(e){return e.replace(fz,``)===``}var hz=(function(e,t,n,r,i){let a=gz(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!hz(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return Sz(e)?a.call(i,e,n,r):!1}),gz=(function(e){if(e==null)return xz;if(typeof e==`function`)return bz(e);if(typeof e==`object`)return Array.isArray(e)?_z(e):vz(e);if(typeof e==`string`)return yz(e);throw Error(`Expected function, string, or object as test`)});function _z(e){let t=[],n=-1;for(;++n<e.length;)t[n]=gz(e[n]);return bz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function vz(e){let t=e;return bz(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function yz(e){return bz(t);function t(t){return t&&t.type===e}}function bz(e){return t;function t(t,n,r){return!!(Sz(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function xz(){return!0}function Sz(e){return typeof e==`object`&&!!e&&`type`in e}var Cz=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),wz=[`button`,`input`,`select`,`textarea`],Tz=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],Ez={},Dz=gz([`comment`,`doctype`]);function Oz(e,t){kz(e,{collapse:Bz((t||Ez).newlines?Rz:zz),whitespace:`normal`})}function kz(e,t){if(`children`in e){let n={...t};return(e.type===`root`||Fz(e))&&(n.before=!0,n.after=!0),n.whitespace=Vz(e,t),jz(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return Az(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:Dz(e),stripAtStart:!1,remove:!1}}function Az(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&Lz(n.charAt(0))&&i++,i!==a&&Lz(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function jz(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=kz(i[o],{...t,after:Mz(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),Pz(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function Mz(e,t,n){for(;++t<e.length;){let n=e[t],r=Nz(n);if(r===void 0&&`children`in n&&!Iz(n)&&(r=Mz(n.children,-1)),typeof r==`boolean`)return r}return n}function Nz(e){if(e.type===`element`){if(Pz(e))return!1;if(Fz(e))return!0}else if(e.type===`text`){if(!pz(e))return!1}else if(!Dz(e))return!1}function Pz(e){return dz(e)||iz(e,wz)}function Fz(e){return iz(e,Cz)}function Iz(e){return!!(e.type===`element`&&e.properties.hidden)||Dz(e)||iz(e,Tz)}function Lz(e){return e===` `||e===`
195
+ `}function Rz(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function zz(){return` `}function Bz(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function Vz(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function Hz(e){return function(t){Oz(t,e)}}function Uz(e){return e}var Wz=[],Gz=`skip`;function Kz(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=gz(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Uz(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Wz,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=qz(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function qz(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Wz:[e]}function Jz(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Kz(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Yz=Zz(`end`),Xz=Zz(`start`);function Zz(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Qz(e){let t=Xz(e),n=Yz(e);if(t&&n)return{start:t,end:n}}function $z(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function eB(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function tB(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function nB(e,t){let n={type:`break`};return e.patch(t,n),n}var rB=(function(e,t,n){let r=gz(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),iB=/\n/g,aB=/[\t ]+/g,oB=az(`br`),sB=az(bB),cB=az(`p`),lB=az(`tr`),uB=az([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,yB,xB]),dB=az(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function fB(e,t){let n=t||{},r=`children`in e?e.children:[],i=dB(e),a=vB(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...hB(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...pB(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?oB(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
196
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function pB(e,t,n){return e.type===`element`?mB(e,t,n):e.type===`text`?n.whitespace===`normal`?hB(e,n):gB(e):[]}function mB(e,t,n){let r=vB(e,n),i=e.children||[],a=-1,o=[];if(uB(e))return o;let s,c;for(oB(e)||lB(e)&&rB(t,e,lB)?c=`
197
+ `:cB(e)?(s=2,c=2):dB(e)&&(s=1,c=1);++a<i.length;)o=o.concat(pB(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?oB(i[a+1]):c}));return sB(e)&&rB(t,e,sB)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function hB(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){iB.lastIndex=a;let e=iB.exec(n),i=e&&`index`in e?e.index:n.length;r.push(_B(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function gB(e){return[String(e.value)]}function _B(e,t,n){let r=[],i=0,a;for(;i<e.length;){aB.lastIndex=i;let n=aB.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function vB(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function yB(e){return!!(e.properties||{}).hidden}function bB(e){return e.tagName===`td`||e.tagName===`th`}function xB(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function SB(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var CB=`language-`;function wB(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===CB){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:SB(fB(t))};return e.patch(t,o),o}function TB(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function EB(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function DB(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function OB(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...kB(e,r[i].titles),...kB(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:DB(o),children:o};return e.patch(t,n),n}}function kB(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,AB);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:DB(r),children:r}]}function AB(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function jB(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function MB(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function NB(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:MB(e.all(t))};return e.patch(t,n),n}function PB(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function FB(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function IB(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function LB(e,t){let n={type:`inlineCode`,value:fB(t)};return e.patch(t,n),n}function RB(e,t){let n=[],r=[],i=t||e.properties||{},a=zB(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=fB(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function zB(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...zB(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var BB=`[x]`,VB=`[ ]`;function HB(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||BB:e.options.unchecked||VB};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=RB(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var UB={}.hasOwnProperty;function WB(e,t){let n=e.type===`element`&&UB.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var GB=new Set([`pingback`,`prefetch`,`stylesheet`]);function KB(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!GB.has(String(t[n])))return!1;return!0}var qB=az(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),JB=az(`meta`);function YB(e){return!!(e.type===`text`||qB(e)||dz(e)||KB(e)||JB(e)&&WB(e,`itemProp`))}function XB(e,t){let{rest:n,checkbox:r}=QB(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:ZB(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function ZB(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(YB(r))continue;if(r.tagName===`p`||n||ZB(r))return!0;n=!0}}return!1}function QB(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=QB(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function $B(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),eV),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:DB(r),children:r};return e.patch(t,a),a}function eV(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var tV={};function nV(e,t){let n=t||tV;return rV(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function rV(e,t,n){if(aV(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return iV(e.children,t,n)}return Array.isArray(e)?iV(e,t,n):``}function iV(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=rV(e[i],t,n);return r.join(``)}function aV(e){return!!(e&&typeof e==`object`)}var oV=gz([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function sV(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!fV(n)||`children`in n&&sV(n.children))return!0}return!1}function cV(e){return uV(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?pz(e.value):!1})?[]:[{type:`paragraph`,children:MB(e)}]}}function lV(e){return uV(e.children,t,n);function t(t){let n=pV(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=pV(e),r=pV(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function uV(e,t,n){let r=dV(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];fV(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function dV(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&sV(r.children)?t.push(...lV(r)):t.push(r)}return t}function fV(e){let t=e.data&&e.data.hName;return t?YB({type:`element`,tagName:t,properties:{},children:[]}):oV(e)}function pV(e){return rz({...e,children:[]})}function mV(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(Jz({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||sV(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:nV(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function hV(e,t){let n=MB(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var gV=[`"`];function _V(e,t){let n=e.options.quotes||gV;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function vV(e,t){let n=e.all(t);(e.options.document||sV(n))&&(n=cV(n));let r={type:`root`,children:n};return e.patch(t,r),r}function yV(e,t){let n=RB(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function bV(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function xV(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function SV(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),CV)};return e.patch(t,n),n}function CV(){return{type:`tableCell`,children:[]}}function wV(e,t){if(e.inTable){let n={type:`text`,value:fB(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=TV(t),i=e.toSpecificContent(e.all(t),DV);r&&i.unshift(DV());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,EV)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function TV(e){let t={align:[null],headless:!0},n=0,r=0;return Jz(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return Gz;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function EV(){return{type:`tableCell`,children:[]}}function DV(){return{type:`tableRow`,children:[]}}function OV(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function kV(e,t){let n={type:`text`,value:fB(t)};return e.patch(t,n),n}function AV(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var jV={comment:TB,doctype:FV,root:vV,text:OV},MV={applet:FV,area:FV,basefont:FV,bgsound:FV,caption:FV,col:FV,colgroup:FV,command:FV,content:FV,datalist:FV,dialog:FV,element:FV,embed:FV,frame:FV,frameset:FV,isindex:FV,keygen:FV,link:FV,math:FV,menu:FV,menuitem:FV,meta:FV,nextid:FV,noembed:FV,noframes:FV,optgroup:FV,option:FV,param:FV,script:FV,shadow:FV,source:FV,spacer:FV,style:FV,svg:FV,template:FV,title:FV,track:FV,abbr:NV,acronym:NV,bdi:NV,bdo:NV,big:NV,blink:NV,button:NV,canvas:NV,cite:NV,data:NV,details:NV,dfn:NV,font:NV,ins:NV,label:NV,map:NV,marquee:NV,meter:NV,nobr:NV,noscript:NV,object:NV,output:NV,progress:NV,rb:NV,rbc:NV,rp:NV,rt:NV,rtc:NV,ruby:NV,slot:NV,small:NV,span:NV,sup:NV,sub:NV,tbody:NV,tfoot:NV,thead:NV,time:NV,address:PV,article:PV,aside:PV,body:PV,center:PV,div:PV,fieldset:PV,figcaption:PV,figure:PV,form:PV,footer:PV,header:PV,hgroup:PV,html:PV,legend:PV,main:PV,multicol:PV,nav:PV,picture:PV,section:PV,a:$z,audio:mV,b:bV,base:eB,blockquote:tB,br:nB,code:LB,dir:$B,dl:OB,dt:XB,dd:XB,del:EB,em:jB,h1:NB,h2:NB,h3:NB,h4:NB,h5:NB,h6:NB,hr:PB,i:jB,iframe:FB,img:IB,image:IB,input:HB,kbd:LB,li:XB,listing:wB,mark:jB,ol:$B,p:hV,plaintext:wB,pre:wB,q:_V,s:EB,samp:LB,select:yV,strike:EB,strong:bV,summary:hV,table:wV,td:xV,textarea:kV,th:xV,tr:SV,tt:LB,u:jB,ul:$B,var:LB,video:mV,wbr:AV,xmp:wB};function NV(e,t){return e.all(t)}function PV(e,t){return e.toFlow(e.all(t))}function FV(){}var IV={}.hasOwnProperty;function LV(e){return{all:RV,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...MV,...e.handlers},inTable:!1,nodeHandlers:{...jV,...e.nodeHandlers},one:zV,options:e,patch:BV,qNesting:0,resolve:VV,toFlow:HV,toSpecificContent:UV}}function RV(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function zV(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(IV.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(IV.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function BV(e,t){e.position&&(t.position=Qz(e))}function VV(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function HV(e){return cV(e)}function UV(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var WV={};function GV(e,t){let n=rz(e),r=t||WV,i=Hz({newlines:r.newlines===!0}),a=LV(r),o;i(n),Jz(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},Jz(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var KV={document:!0};function qV(e,t){return e&&`run`in e?async function(n,r){let i=GV(n,{...KV,...t});await e.run(i,r)}:function(t){return GV(t,{...KV,...e})}}function JV(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var YV=sH(/[A-Za-z]/),XV=sH(/[\dA-Za-z]/),ZV=sH(/[#-'*+\--9=?A-Z^-~]/);function QV(e){return e!==null&&(e<32||e===127)}var $V=sH(/\d/),eH=sH(/[\dA-Fa-f]/),tH=sH(/[!-/:-@[-`{-~]/);function nH(e){return e!==null&&e<-2}function rH(e){return e!==null&&(e<0||e===32)}function iH(e){return e===-2||e===-1||e===32}var aH=sH(/\p{P}|\p{S}/u),oH=sH(/\s/);function sH(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function cH(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function lH(e,t,n){let r=gz((n||{}).ignore||[]),i=uH(t),a=-1;for(;++a<i.length;)Kz(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function uH(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([dH(e[0]),fH(e[1])])}return t}function dH(e){return typeof e==`string`?new RegExp(cH(e),`g`):e}function fH(e){return typeof e==`function`?e:function(){return e}}var pH=`phrasing`,mH=[`autolink`,`link`,`image`,`label`];function hH(){return{transforms:[CH],enter:{literalAutolink:_H,literalAutolinkEmail:vH,literalAutolinkHttp:vH,literalAutolinkWww:vH},exit:{literalAutolink:SH,literalAutolinkEmail:xH,literalAutolinkHttp:yH,literalAutolinkWww:bH}}}function gH(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:pH,notInConstruct:mH},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:pH,notInConstruct:mH},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:pH,notInConstruct:mH}]}}function _H(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function vH(e){this.config.enter.autolinkProtocol.call(this,e)}function yH(e){this.config.exit.autolinkProtocol.call(this,e)}function bH(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function xH(e){this.config.exit.autolinkEmail.call(this,e)}function SH(e){this.exit(e)}function CH(e){lH(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wH],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,TH]],{ignore:[`link`,`linkReference`]})}function wH(e,t,n,r,i){let a=``;if(!OH(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!EH(n)))return!1;let o=DH(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function TH(e,t,n,r){return!OH(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function EH(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function DH(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=JV(e,`(`),a=JV(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function OH(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||oH(n)||aH(n))&&(!t||n!==47)}function kH(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}zH.peek=RH;function AH(){this.buffer()}function jH(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function MH(){this.buffer()}function NH(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function PH(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kH(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FH(e){this.exit(e)}function IH(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kH(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LH(e){this.exit(e)}function RH(){return`[`}function zH(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function BH(){return{enter:{gfmFootnoteCallString:AH,gfmFootnoteCall:jH,gfmFootnoteDefinitionLabelString:MH,gfmFootnoteDefinition:NH},exit:{gfmFootnoteCallString:PH,gfmFootnoteCall:FH,gfmFootnoteDefinitionLabelString:IH,gfmFootnoteDefinition:LH}}}function VH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:zH},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
198
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?UH:HH))),s(),o}}function HH(e,t,n){return t===0?e:UH(e,t,n)}function UH(e,t,n){return(n?``:` `)+e}var WH=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];YH.peek=XH;function GH(){return{canContainEols:[`delete`],enter:{strikethrough:qH},exit:{strikethrough:JH}}}function KH(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:WH}],handlers:{delete:YH}}}function qH(e){this.enter({type:`delete`,children:[]},e)}function JH(e){this.exit(e)}function YH(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function XH(){return`~`}function ZH(e){return e.length}function QH(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZH,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=$H(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=eU(r[d]);else{let e=eU(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
199
+ `)}function $H(e){return e==null?``:String(e)}function eU(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var tU={}.hasOwnProperty;function nU(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&tU.call(t,e)){let n=String(t[e]);i=tU.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var rU={}.hasOwnProperty;function iU(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)iU(e,t.extensions[n]);for(r in t)if(rU.call(t,r))switch(r){case`extensions`:break;case`unsafe`:aU(e[r],t[r]);break;case`join`:aU(e[r],t[r]);break;case`handlers`:oU(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function aU(e,t){t&&e.push(...t)}function oU(e,t){t&&Object.assign(e,t)}function sU(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),cU);return i(),o}function cU(e,t,n){return`>`+(n?``:` `)+e}function lU(e,t){return uU(e,t.inConstruct,!0)&&!uU(e,t.notInConstruct,!1)}function uU(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function dU(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
200
+ `&&lU(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
201
+ `}function fU(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function pU(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function mU(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hU(e,t,n,r){let i=mU(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(pU(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,gU);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(fU(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
202
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
203
+ `),a&&(u+=s.move(a+`
204
+ `)),u+=s.move(c),l(),u}function gU(e,t,n){return(n?``:` `)+e}function _U(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function vU(e,t,n,r){let i=_U(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
205
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function yU(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bU(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function xU(e){if(e===null||rH(e)||oH(e))return 1;if(aH(e))return 2}function SU(e,t,n){let r=xU(e),i=xU(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}CU.peek=wU;function CU(e,t,n,r){let i=yU(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=SU(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bU(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=SU(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bU(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function wU(e,t,n){return n.options.emphasis||`*`}function TU(e,t){let n=!1;return Jz(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&nV(e)&&(t.options.setext||n))}function EU(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(TU(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
206
+ `,after:`
207
+ `});return r(),t(),o+`
208
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
209
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
210
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=bU(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}DU.peek=OU;function DU(e){return e.value||``}function OU(){return`<`}kU.peek=AU;function kU(e,t,n,r){let i=_U(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function AU(){return`!`}jU.peek=MU;function jU(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function MU(){return`!`}NU.peek=PU;function NU(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function PU(){return"`"}function FU(e,t){let n=nV(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}IU.peek=LU;function IU(e,t,n,r){let i=_U(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(FU(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function LU(e,t,n){return FU(e,n)?`<`:`[`}RU.peek=zU;function RU(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function zU(){return`[`}function BU(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function VU(e){let t=BU(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function HU(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function UU(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function WU(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?HU(n):BU(n),s=e.ordered?o===`.`?`)`:`.`:VU(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),UU(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function GU(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function KU(e,t,n,r){let i=GU(n),a=n.bulletCurrent||BU(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function qU(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function JU(e,t,n,r){return(e.children.some(function(e){return oV(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function YU(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}XU.peek=ZU;function XU(e,t,n,r){let i=YU(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=SU(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=bU(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=SU(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+bU(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ZU(e,t,n){return n.options.strong||`*`}function QU(e,t,n,r){return n.safe(e.value,r)}function $U(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function eW(e,t,n){let r=(UU(n)+(n.options.ruleSpaces?` `:``)).repeat($U(n));return n.options.ruleSpaces?r.slice(0,-1):r}var tW={blockquote:sU,break:dU,code:hU,definition:vU,emphasis:CU,hardBreak:dU,heading:EU,html:DU,image:kU,imageReference:jU,inlineCode:NU,link:IU,linkReference:RU,list:WU,listItem:KU,paragraph:qU,root:JU,strong:XU,text:QU,thematicBreak:eW},nW=[rW];function rW(e,t,n,r){if(t.type===`code`&&pU(t,r)&&(e.type===`list`||e.type===t.type&&pU(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&TU(t,r))?void 0:+!!n.spread}var iW=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],aW=[{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:`
211
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:iW},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
212
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:iW},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
213
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:iW},{atBreak:!0,character:`+`,after:`(?:[ \r
214
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
215
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
216
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:iW},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:iW},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:iW},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:iW},{atBreak:!0,character:`~`}],oW=document.createElement(`i`);function sW(e){let t=`&`+e+`;`;oW.innerHTML=t;let n=oW.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function cW(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var lW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uW(e){return e.replace(lW,dW)}function dW(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return cW(n.slice(t?2:1),t?16:10)}return sW(n)||e}function fW(e){return e.label||!e.identifier?e.label||``:uW(e.identifier)}function pW(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function mW(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
217
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=bU(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+bU(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function hW(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
218
+ `,after:`
219
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(gW(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function gW(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
220
+ `.repeat(1+a);if(a===!1)return`
221
+
222
+ <!---->
223
+
224
+ `}return`
225
+
226
+ `}var _W=/\r?\n|\r/g;function vW(e,t){let n=[],r=0,i=0,a;for(;a=_W.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function yW(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!lU(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(bW);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(xW(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(bU(r.charCodeAt(e))),c++))}return a.push(xW(r.slice(c,l),n.after)),a.join(``)}function bW(e,t){return e-t}function xW(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function SW(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function CW(e,t){let n=t||{},r={associationId:fW,containerPhrasing:DW,containerFlow:OW,createTracker:SW,compilePattern:pW,enter:a,handlers:{...tW},handle:void 0,indentLines:vW,indexStack:[],join:[...nW],options:{},safe:kW,stack:[],unsafe:[...aW]};iU(r,n),r.options.tightDefinitions&&r.join.push(EW),r.handle=nU(`type`,{invalid:wW,unknown:TW,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
227
+ `,after:`
228
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
229
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function wW(e){throw Error("Cannot handle value `"+e+"`, expected node")}function TW(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function EW(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function DW(e,t){return mW(e,this,t)}function OW(e,t){return hW(e,this,t)}function kW(e,t){return yW(this,e,t)}function AW(){return{enter:{table:jW,tableData:FW,tableHeader:FW,tableRow:NW},exit:{codeText:IW,table:MW,tableData:PW,tableHeader:PW,tableRow:PW}}}function jW(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function MW(e){this.exit(e),this.data.inTable=void 0}function NW(e){this.enter({type:`tableRow`,children:[]},e)}function PW(e){this.exit(e)}function FW(e){this.enter({type:`tableCell`,children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,LW));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function LW(e,t){return t===`|`?t:e}function RW(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
230
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
231
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return QH(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=tW.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function zW(){return{exit:{taskListCheckValueChecked:VW,taskListCheckValueUnchecked:VW,paragraph:HW}}}function BW(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:UW}}}function VW(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function HW(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function UW(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=tW.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function WW(){return[hH(),BH(),GH(),AW(),zW()]}function GW(e){return{extensions:[gH(),VH(e),KH(),RW(e),BW()]}}function KW(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function qW(e,t){return e.length>0?(KW(e,e.length,0,t),e):t}var JW={}.hasOwnProperty;function YW(e){let t={},n=-1;for(;++n<e.length;)XW(t,e[n]);return t}function XW(e,t){let n;for(n in t){let r=(JW.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){JW.call(r,a)||(r[a]=[]);let e=i[a];ZW(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ZW(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);KW(e,0,0,r)}var QW={tokenize:fG,partial:!0},$W={tokenize:pG,partial:!0},eG={tokenize:mG,partial:!0},tG={tokenize:hG,partial:!0},nG={tokenize:gG,partial:!0},rG={name:`wwwAutolink`,tokenize:uG,previous:_G},iG={name:`protocolAutolink`,tokenize:dG,previous:vG},aG={name:`emailAutolink`,tokenize:lG,previous:yG},oG={};function sG(){return{text:oG}}for(var cG=48;cG<123;)oG[cG]=aG,cG++,cG===58?cG=65:cG===91&&(cG=97);oG[43]=aG,oG[45]=aG,oG[46]=aG,oG[95]=aG,oG[72]=[aG,iG],oG[104]=[aG,iG],oG[87]=[aG,rG],oG[119]=[aG,rG];function lG(e,t,n){let r=this,i,a;return o;function o(t){return!bG(t)||!yG.call(r,r.previous)||xG(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return bG(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(nG,u,l)(t):t===45||t===95||XV(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&YV(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function uG(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!_G.call(r,r.previous)||xG(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(QW,e.attempt($W,e.attempt(eG,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function dG(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&vG.call(r,r.previous)&&!xG(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(YV(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||QV(t)||rH(t)||oH(t)||aH(t)?n(t):e.attempt($W,e.attempt(eG,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function fG(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function pG(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(tG,c,s)(t):t===null||rH(t)||oH(t)||t!==45&&aH(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function mG(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(tG,t,a)(o):o===null||rH(o)||oH(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function hG(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||rH(o)||oH(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||rH(e)||oH(e)?t(e):r(e)}function a(e){return YV(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):YV(t)?(e.consume(t),o):n(t)}}function gG(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return XV(e)?n(e):t(e)}}function _G(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rH(e)}function vG(e){return!YV(e)}function yG(e){return!(e===47||bG(e))}function bG(e){return e===43||e===45||e===46||e===95||XV(e)}function xG(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function SG(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&XV(e.charCodeAt(n+1))&&XV(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function CG(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var wG={name:`attention`,resolveAll:TG,tokenize:EG};function TG(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};DG(d,-c),DG(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=qW(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=qW(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=qW(l,CG(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=qW(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=qW(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,KW(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function EG(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=xU(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=xU(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function DG(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var OG={name:`autolink`,tokenize:kG};function kG(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return YV(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||XV(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||XV(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||QV(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ZV(t)?(e.consume(t),l):n(t)}function u(e){return XV(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||XV(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function AG(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return iH(r)?(e.enter(n),s(r)):t(r)}function s(r){return iH(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var jG={partial:!0,tokenize:MG};function MG(e,t,n){return r;function r(t){return iH(t)?AG(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||nH(e)?t(e):n(e)}}var NG={continuation:{tokenize:FG},exit:IG,name:`blockQuote`,tokenize:PG};function PG(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return iH(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function FG(e,t,n){let r=this;return i;function i(t){return iH(t)?AG(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(NG,t,n)(r)}}function IG(e){e.exit(`blockQuote`)}var LG={name:`characterEscape`,tokenize:RG};function RG(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return tH(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var zG={name:`characterReference`,tokenize:BG};function BG(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=XV,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=eH,u):(e.enter(`characterReferenceValue`),a=7,o=$V,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===XV&&!sW(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var VG={partial:!0,tokenize:WG},HG={concrete:!0,name:`codeFenced`,tokenize:UG};function UG(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),iH(t)?AG(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||nH(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(VG,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||nH(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):iH(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),AG(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||nH(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||nH(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&iH(t)?AG(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||nH(t)?e.check(VG,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||nH(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),iH(t)?AG(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),iH(t)?AG(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||nH(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function WG(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var GG={name:`codeIndented`,tokenize:qG},KG={partial:!0,tokenize:JG};function qG(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),AG(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):nH(t)?e.attempt(KG,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||nH(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function JG(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):nH(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):AG(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):nH(e)?i(e):n(e)}}var YG={name:`codeText`,previous:ZG,resolve:XG,tokenize:QG};function XG(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ZG(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function QG(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):nH(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||nH(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var $G=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw 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,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&eK(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),eK(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),eK(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){let t=this.left.splice(e,1/0);eK(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);eK(this.left,t.reverse())}}};function eK(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tK(e){let t={},n=-1,r,i,a,o,s,c,l,u=new $G(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,nK(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return KW(e,0,1/0,u.slice(0)),!l}function nK(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var rK={resolve:aK,tokenize:oK},iK={partial:!0,tokenize:sK};function aK(e){return tK(e),e}function oK(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):nH(t)?e.check(iK,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function sK(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),AG(e,a,`linePrefix`)}function a(i){if(i===null||nH(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function cK(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||QV(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||nH(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||rH(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||QV(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function lK(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):nH(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||nH(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!iH(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function uK(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):nH(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),AG(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||nH(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function dK(e,t){let n;return r;function r(i){return nH(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):iH(i)?AG(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var fK={name:`definition`,tokenize:mK},pK={partial:!0,tokenize:hK};function mK(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return lK.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=kH(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return rH(t)?dK(e,l)(t):l(t)}function l(t){return cK(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(pK,d,d)(t)}function d(t){return iH(t)?AG(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||nH(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function hK(e,t,n){return r;function r(t){return rH(t)?dK(e,i)(t):n(t)}function i(t){return uK(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return iH(t)?AG(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||nH(e)?t(e):n(e)}}var gK={name:`hardBreakEscape`,tokenize:_K};function _K(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return nH(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var vK={name:`headingAtx`,resolve:yK,tokenize:bK};function yK(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},KW(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function bK(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||rH(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||nH(n)?(e.exit(`atxHeading`),t(n)):iH(n)?AG(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||rH(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var xK=`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`.split(`.`),SK=[`pre`,`script`,`style`,`textarea`],CK={concrete:!0,name:`htmlFlow`,resolveTo:EK,tokenize:DK},wK={partial:!0,tokenize:kK},TK={partial:!0,tokenize:OK};function EK(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function DK(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):YV(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):YV(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return YV(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||rH(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&SK.includes(l)?(i=1,r.interrupt?t(s):O(s)):xK.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||XV(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return iH(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||YV(t)?(e.consume(t),b):iH(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||XV(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):iH(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):iH(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||nH(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||rH(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||iH(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||nH(t)?O(t):iH(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):nH(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(wK,te,k)(t)):t===null||nH(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(TK,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||nH(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return SK.includes(n)?(e.consume(t),ee):O(t)}return YV(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||nH(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),ee)}function te(n){return e.exit(`htmlFlow`),t(n)}}function OK(e,t,n){let r=this;return i;function i(t){return nH(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function kK(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(jG,t,n)}}var AK={name:`htmlText`,tokenize:jK};function jK(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):YV(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):YV(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):nH(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):nH(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):nH(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):nH(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return YV(t)?(e.consume(t),S):n(t)}function S(t){return t===45||XV(t)?(e.consume(t),S):C(t)}function C(t){return nH(t)?(o=C,N(t)):iH(t)?(e.consume(t),C):M(t)}function w(t){return t===45||XV(t)?(e.consume(t),w):t===47||t===62||rH(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||YV(t)?(e.consume(t),E):nH(t)?(o=T,N(t)):iH(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||XV(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):nH(t)?(o=D,N(t)):iH(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):nH(t)?(o=O,N(t)):iH(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):nH(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||rH(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||rH(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return iH(t)?AG(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var MK={name:`labelEnd`,resolveAll:IK,resolveTo:LK,tokenize:RK},NK={tokenize:zK},PK={tokenize:BK},FK={tokenize:VK};function IK(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&KW(e,0,e.length,n),e}function LK(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=qW(s,e.slice(a+1,a+r+3)),s=qW(s,[[`enter`,u,t]]),s=qW(s,CG(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=qW(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=qW(s,e.slice(o+1)),s=qW(s,[[`exit`,c,t]]),KW(e,a,e.length,s),e}function RK(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(kH(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(NK,u,o?u:d)(t):t===91?e.attempt(PK,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(FK,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function zK(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return rH(t)?dK(e,a)(t):a(t)}function a(t){return t===41?u(t):cK(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return rH(t)?dK(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?uK(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return rH(t)?dK(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function BK(e,t,n){let r=this;return i;function i(t){return lK.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(kH(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function VK(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var HK={name:`labelStartImage`,resolveAll:MK.resolveAll,tokenize:UK};function UK(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var WK={name:`labelStartLink`,resolveAll:MK.resolveAll,tokenize:GK};function GK(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var KK={name:`lineEnding`,tokenize:qK};function qK(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),AG(e,t,`linePrefix`)}}var JK={name:`thematicBreak`,tokenize:YK};function YK(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||nH(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),iH(t)?AG(e,s,`whitespace`)(t):s(t))}}var XK={continuation:{tokenize:eq},exit:nq,name:`list`,tokenize:$K},ZK={partial:!0,tokenize:rq},QK={partial:!0,tokenize:tq};function $K(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:$V(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(JK,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return $V(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(jG,r.interrupt?n:u,e.attempt(ZK,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return iH(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function eq(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(jG,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,AG(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!iH(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(QK,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,AG(e,e.attempt(XK,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function tq(e,t,n){let r=this;return AG(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function nq(e){e.exit(this.containerState.type)}function rq(e,t,n){let r=this;return AG(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!iH(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var iq={name:`setextUnderline`,resolveTo:aq,tokenize:oq};function aq(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function oq(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),iH(t)?AG(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||nH(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var sq={tokenize:hq,partial:!0};function cq(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:fq,continuation:{tokenize:pq},exit:mq}},text:{91:{name:`gfmFootnoteCall`,tokenize:dq},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:lq,resolveTo:uq}}}}function lq(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=kH(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function uq(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function dq(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||rH(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(kH(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return rH(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function fq(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||rH(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=kH(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return rH(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),AG(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function pq(e,t,n){return e.check(jG,t,e.attempt(sq,t,n))}function mq(e){e.exit(`gfmFootnoteDefinition`)}function hq(e,t,n){let r=this;return AG(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function gq(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&KW(o,o.length,0,CG(s,e.slice(r+1,n),t)),KW(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),KW(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=xU(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=xU(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var _q=class{constructor(){this.map=[]}add(e,t,n){vq(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function vq(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function yq(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function bq(){return{flow:{null:{name:`table`,tokenize:xq,resolveAll:Sq}}}}function xq(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):nH(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):iH(t)?AG(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||rH(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,iH(t)?AG(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return iH(t)?AG(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||nH(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return iH(t)?AG(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||nH(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||nH(n)?(e.exit(`tableRow`),t(n)):iH(n)?AG(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||rH(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Sq(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new _q;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(wq(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Cq(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Cq(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Cq(f,t,o,i,n,d)):(o[0]=o[1],d=Cq(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&wq(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=yq(t.events,n))}return e}function Cq(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Tq(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Tq(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Tq(t.events,n[2]),a=Tq(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Tq(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function wq(e,t,n,r,i){let a=[],o=Tq(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Tq(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Eq={name:`tasklistCheck`,tokenize:Oq};function Dq(){return{text:{91:Eq}}}function Oq(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return rH(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return nH(r)?t(r):iH(r)?e.check({tokenize:kq},t,n)(r):n(r)}}function kq(e,t,n){return AG(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Aq(e){return YW([sG(),cq(),gq(e),bq(),Dq()])}var jq={};function Mq(e){let t=this,n=e||jq,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Aq(n)),a.push(WW()),o.push(GW(n))}function Nq(e){let t=this;t.compiler=n;function n(n){return CW(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function Pq(e){if(e)throw e}var Fq=Ze(Je(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Iq(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Lq(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Rq(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Rq(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var zq=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Bq={}.hasOwnProperty,Vq=new class e extends zq{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=Lq()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Fq.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Wq(`data`,this.frozen),this.namespace[e]=t,this):Bq.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Wq(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=qq(e),n=this.parser||this.Parser;return Hq(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Hq(`process`,this.parser||this.Parser),Uq(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=qq(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Yq(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Hq(`processSync`,this.parser||this.Parser),Uq(`processSync`,this.compiler||this.Compiler),this.process(e,r),Kq(`processSync`,`process`,t),n;function r(e,r){t=!0,Pq(e),n=r}}run(e,t,n){Gq(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=qq(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Kq(`runSync`,`run`,n),r;function i(e,t){Pq(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=qq(t),r=this.compiler||this.Compiler;return Uq(`stringify`,r),Gq(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Wq(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,Fq.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Iq(o)&&Iq(r)&&(r=(0,Fq.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Hq(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Uq(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Wq(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gq(e){if(!Iq(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Kq(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function qq(e){return Jq(e)?e:new kR(e)}function Jq(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Yq(e){return typeof e==`string`||Xq(e)}function Xq(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Zq=/notionvc:/i,Qq=()=>e=>{$q(e)&&(eJ(e),tJ(e))};function $q(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(Zq.test(e))return!0}if(t.type===`element`&&$q(t))return!0}return!1}function eJ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&eJ(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
232
+ `)){t.push(n);continue}let r=e.split(`
233
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function tJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!Zq.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&tJ(t)}}var nJ=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),rJ=()=>e=>{iJ(e)};function iJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&iJ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return aJ(t)?[]:oJ(t)?t.children:[t]})}}function aJ(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function oJ(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>nJ.has(String(e))):!1}var sJ=`docs-internal-guid-`;function cJ(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var lJ=()=>e=>{uJ(e)};function uJ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&uJ(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(dJ(r)||fJ(r)){cJ(e,t);continue}t++}}function dJ(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(sJ)}function fJ(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var pJ=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),mJ=()=>e=>{hJ(e)};function hJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&hJ(t);for(let t of e.children)t.type===`element`&&gJ(t)}}function gJ(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!pJ.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var _J=/^gmail_/,vJ=()=>e=>{yJ(e)};function yJ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&yJ(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&bJ(r,`gmail_quote`)&&(r.tagName=`blockquote`),xJ(r),SJ(r)){e.children.splice(t,1,...r.children);continue}t++}}function bJ(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function xJ(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!_J.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function SJ(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var CJ=()=>e=>{wJ(e)};function wJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&wJ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(TJ(t),[t])})}}function TJ(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var EJ=[`o:`,`w:`,`m:`,`v:`,`u1:`],DJ=/^Mso[A-Z]/,OJ=/^\s*\[if\s+[^\]]*\]/,kJ=()=>e=>{AJ(e)};function AJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&AJ(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return OJ.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return jJ(t)?[]:(MJ(t),[t])})}}function jJ(e){return EJ.some(t=>e.tagName.startsWith(t))}function MJ(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!DJ.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&DJ.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);EJ.some(e=>e===`${n}:`)&&delete t[e]}}var NJ=/^c-(message_kit__|message__|compose|timestamp)/,PJ=()=>e=>{FJ(e)};function FJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&FJ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return IJ(t)?[]:(LJ(t),[t])})}}function IJ(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function LJ(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!NJ.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var RJ=()=>e=>{zJ(e)};function zJ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&zJ(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;BJ(r)&&(e.children[t]=HJ(r))}}}function BJ(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>VJ(e))}function VJ(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||VJ(e))return!0}return!1}function HJ(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>UJ(e)).join(`
234
+ `)}]}]}}function UJ(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=UJ(n));return t}var WJ=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},GJ=[lJ,kJ,rJ,vJ,Qq,RJ,CJ,PJ,mJ];function KJ(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new WJ(e.length,n);let r=Vq().use(KR,{fragment:!0});for(let e of GJ)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(qV);let i=r.parse(e);return r.runSync(i)}function qJ(e){return String(Vq().use(Mq).use(Nq).stringify(e))}var JJ=9,YJ=32;function XJ(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ZJ(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ZJ(t.slice(i),i>0,!1)),a.join(``)}function ZJ(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===JJ||t===YJ;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===JJ||t===YJ;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function QJ(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return Jz(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return oY(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){if(i&&r[i-1]?.type===`break`&&(!Array.isArray(a)&&a.type===e.nodes.text&&(a=e.text(nY(a.text))),!Array.isArray(a)&&a.type!==e.nodes.text)){let t=a.firstChild;t&&t.type===e.nodes.text&&(a=a.copy(V.from(a.content).replaceChild(0,e.text(nY(t.text)))))}Array.isArray(a)?n.push(...a):n.push(a)}}}return n}}function $J(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function eY(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(V.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(V.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function tY(e){throw Error(`unknown markdown node: ${e.type}`)}function nY(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rY(){}function iY(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function aY(e,t,n,r){return nU(`tagName`,{handlers:e})(t,n,r)}function oY(e,t,n,r,i,a){return nU(`type`,{invalid:iY,unknown:tY,handlers:{toml:rY,yaml:rY,definition:rY,footnoteDefinition:rY,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=VR(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?aY(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=$J(XJ(String(t.value)));return n?e.text(/^\s+$/.test(n)?n.replace(/ /g,`\xA0`):n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return eY(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function sY(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function cY(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var lY=function(e,t){let n=oY(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,QJ(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},uY=function(e){this.compiler=function(t){return lY(t,e)}};function dY(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>hz(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function fY(e,t){return dY(t.nodeHandlers,t.markHandlers).one(e)}function pY(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function mY(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var hY={parseFallback:{blockLevel:0,wholeDoc:0}};function gY(){hY.parseFallback.blockLevel++}function _Y(){hY.parseFallback.wholeDoc++}var vY=/^(`{3,}|~{3,})/gm;function yY(e){let t=[],n=null;for(let r of e.matchAll(vY)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function bY(e,t){return t.some(([t,n])=>e>=t&&e<n)}var xY=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function SY(e){let t=yY(e),n=[];for(let r of e.matchAll(xY))bY(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
235
+ `)}\n\n`:``}function CY(e,t){return wY(e,t.parse,0)}function wY(e,t,n){if(n>20)return _Y(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),MY(e);try{return t(e)}catch(r){let i=TY(r);if(i===void 0){if(n===0){let n=jY(e,t,r);if(n)return n}return _Y(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:r?.message??`unknown error (no position)`})),MY(e)}gY(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:i,reason:r?.message??`parse error`}));try{let a=kY(e,i),o=e.slice(0,a.start),s=e.slice(a.start,a.end),c=e.slice(a.end),l=o.trim()?wY(o,t,n+1):{type:`doc`,content:[]},u=c.trim()?wY(SY(o)+c,t,n+1):{type:`doc`,content:[]},d={type:`rawMdxFallback`,attrs:{reason:r?.message??`parse error`,originalSpan:{start:a.start,end:a.end}},content:s?[{type:`text`,text:s}]:[]},f=[...l.content??[],d,...u.content??[]];return{type:`doc`,content:f.length>0?f:[{type:`paragraph`,content:[]}]}}catch(t){return _Y(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${t?.message??`unknown`}`})),MY(e)}}}function TY(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function EY(e,t){let n=yY(e);if(bY(t,n))return null;let r=/<([A-Z][A-Za-z0-9.]*)[\s/>]/g,i=/<\/([A-Z][A-Za-z0-9.]*)\s*>/g,a=null;for(let i of e.matchAll(r)){if(i.index>t)break;bY(i.index,n)||(a={name:i[1],start:i.index})}if(!a)return null;for(let r of e.matchAll(i))if(!(r.index<t)&&!bY(r.index,n)&&r[1]===a.name)return{start:a.start,end:r.index+r[0].length};let o=OY(e,t);return{start:a.start,end:o??e.length}}function DY(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function OY(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}function kY(e,t){return EY(e,t)||{start:DY(e,t)??0,end:OY(e,t)??e.length}}function AY(e){let t=yY(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;bY(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function jY(e,t,n){let r=AY(e);if(r.length<2)return null;let i=[],a=!1,o=``;for(let e of r){let r=o+e.src;try{let n=t(r).content??[];o+=SY(e.src);let s=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(s.length===0&&n.length>0){a=!0;continue}i.push(...s),a=!0}catch(t){gY();let r=t?.message?.slice(0,200)??`unknown block error`,a=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${a}`,blockError:r,blockErrorName:t?.name})),i.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return a?{type:`doc`,content:i.length>0?i:[{type:`paragraph`,content:[]}]}:null}function MY(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var NY=Ze(Je(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),PY=Object.assign(FY(Error),{eval:FY(EvalError),range:FY(RangeError),reference:FY(ReferenceError),syntax:FY(SyntaxError),type:FY(TypeError),uri:FY(URIError)});function FY(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,NY.default)(t,...n))}}var IY={}.hasOwnProperty,LY={yaml:`-`,toml:`+`};function RY(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=zY(r[n]);return t}function zY(e){let t=e;if(typeof t==`string`){if(!IY.call(LY,t))throw PY("Missing matter definition for `%s`",t);t={type:t,marker:LY[t]}}else if(typeof t!=`object`)throw PY("Expected matter to be an object, not `%j`",t);if(!IY.call(t,`type`))throw PY("Missing `type` in matter `%j`",t);if(!IY.call(t,`fence`)&&!IY.call(t,`marker`))throw PY("Missing `marker` or `fence` in matter `%j`",t);return t}function BY(e){let t=RY(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=HY(e,`open`).charCodeAt(0),a=VY(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function VY(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=HY(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),iH(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return iH(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return nH(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=HY(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||nH(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||nH(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),iH(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return iH(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||nH(i)?(e.exit(r),t(i)):n(i)}}}function HY(e,t){return e.marker?UY(e.marker,t).repeat(3):UY(e.fence,t)}function UY(e,t){return typeof e==`string`?e:e[t]}function WY(e){let t=RY(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=GY(e),r[e.type]=KY,r[e.type+`Value`]=qY}return{enter:n,exit:r}}function GY(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function KY(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function qY(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function JY(e){let t=[],n={},r=RY(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=YY(e);let a=XY(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:cH(a.charAt(1))})}return{unsafe:t,handlers:n}}function YY(e){let t=XY(e,`open`),n=XY(e,`close`);return r;function r(e){return t+(e.value?`
236
+ `+e.value:``)+`
237
+ `+n}}function XY(e,t){return e.marker?ZY(e.marker,t).repeat(3):ZY(e.fence,t)}function ZY(e,t){return typeof e==`string`?e:e[t]}var QY=`yaml`;function $Y(e){let t=this,n=e||QY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(BY(n)),a.push(WY(n)),o.push(JY(n))}var eX={tokenize:tX};function tX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),AG(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return nH(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var nX={tokenize:iX},rX={tokenize:aX};function iX(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return KW(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rX,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(rX,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return nH(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;KW(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function aX(e,t,n){return AG(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var oX={tokenize:sX};function sX(e){let t=this,n=e.attempt(jG,r,e.attempt(this.parser.constructs.flowInitial,i,AG(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rK,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var cX={resolveAll:fX()},lX=dX(`string`),uX=dX(`text`);function dX(e){return{resolveAll:fX(e===`text`?pX:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function fX(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function pX(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var mX=Ye({attentionMarkers:()=>SX,contentInitial:()=>gX,disable:()=>CX,document:()=>hX,flow:()=>vX,flowInitial:()=>_X,insideSpan:()=>xX,string:()=>yX,text:()=>bX}),hX={42:XK,43:XK,45:XK,48:XK,49:XK,50:XK,51:XK,52:XK,53:XK,54:XK,55:XK,56:XK,57:XK,62:NG},gX={91:fK},_X={[-2]:GG,[-1]:GG,32:GG},vX={35:vK,42:JK,45:[iq,JK],60:CK,61:iq,95:JK,96:HG,126:HG},yX={38:zG,92:LG},bX={[-5]:KK,[-4]:KK,[-3]:KK,33:HK,38:zG,42:wG,60:[OG,AK],91:WK,92:[gK,LG],93:MK,95:wG,96:YG},xX={null:[wG,cX]},SX={null:[42,95]},CX={null:[]};function wX(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=qW(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=CG(a,l.events,l),l.events):[]}function f(e,t){return EX(p(e),t)}function p(e){return TX(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){nH(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&KW(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TX(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function EX(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
238
+ `;break;case-3:o=`\r
239
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function DX(e){let t={constructs:YW([mX,...(e||{}).extensions||[]]),content:n(eX),defined:[],document:n(nX),flow:n(oX),lazy:{},string:n(lX),text:n(uX)};return t;function n(e){return n;function n(n){return wX(t,e,n)}}}function OX(e){for(;!tK(e););return e}var kX=/[\0\t\n\r]/g;function AX(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(kX.lastIndex=u,c=kX.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var jX={}.hasOwnProperty;function MX(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),NX(n)(OX(DX(n).document().write(AX()(e,t,!0))))}function NX(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ge),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(fe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(R,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ue),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(de),hardBreakEscape:a(pe),hardBreakTrailing:a(pe),htmlFlow:a(me,o),htmlFlowData:T,htmlText:a(me,o),htmlTextData:T,image:a(he),label:o,link:a(ge),listItem:a(ve),listItemValue:f,listOrdered:a(_e,d),listUnordered:a(_e),paragraph:a(ye),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(fe),strong:a(be),thematicBreak:a(Se)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:ie,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:I,resourceTitleString:ee,resource:te,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};FX(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];jX.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||LX).call(a,void 0,e[0])}for(r.position={start:PX(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:PX(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:PX(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||LX).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+EO({start:e.start,end:e.end})+`): it’s not open`);n.position.end=PX(e.end)}function u(){return nV(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=kH(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:PX(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=PX(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=PX(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=uW(t),n.identifier=kH(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function te(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=kH(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=cW(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=sW(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=PX(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function R(){return{type:`inlineCode`,value:``}}function ue(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function de(){return{type:`emphasis`,children:[]}}function fe(){return{type:`heading`,depth:0,children:[]}}function pe(){return{type:`break`}}function me(){return{type:`html`,value:``}}function he(){return{type:`image`,title:null,url:``,alt:null}}function ge(){return{type:`link`,title:null,url:``,children:[]}}function _e(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ve(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ye(){return{type:`paragraph`,children:[]}}function be(){return{type:`strong`,children:[]}}function xe(){return{type:`text`,value:``}}function Se(){return{type:`thematicBreak`}}}function PX(e){return{line:e.line,column:e.column,offset:e.offset}}function FX(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?FX(e,r):IX(e,r)}}function IX(e,t){let n;for(n in t)if(jX.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function LX(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+EO({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+EO({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+EO({start:t.start,end:t.end})+`) is still open`)}function RX(e){let t=this;t.parser=n;function n(n){return MX(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var zX=``,BX=``,VX=``,HX=``,UX=``,WX=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,GX=/<!--[\s\S]*?-->/g,KX=/<\/([a-z][a-z0-9]*)\s*>/g,qX=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,JX=/<\/([A-Z][A-Za-z0-9.]*)>/g;function YX(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function XX(e){let t=new Map,n=new RegExp(JX.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function ZX(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function QX(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function $X(e){let t=e;t=t.replace(GX,e=>e.replace(/</g,zX).replace(/>/g,BX)),t=t.replace(WX,(e,t)=>`${zX}${t.replaceAll(`:`,VX).replaceAll(`@`,HX)}${BX}`),t=t.replace(KX,e=>e.replace(/</g,zX).replace(/>/g,BX)),t=t.replace(qX,(e,t)=>t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,zX).replace(/>/g,BX):e),t=t.replace(/<>/g,`${zX}${BX}`);let n=XX(t),r=ZX(t),i=QX(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:zX;let s=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!s)return zX;let c=s[1],l=YX(r,a),u=YX(i,l<r.length?r[l]:t.length);if(u>0){let n=i[u-1];if(n>a){let r=a+s[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let d=n.get(c);return d&&YX(d,a)<d.length?e:zX});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
240
+ `){let i=t[r+1];if(i===`
241
+ `||i===`>`){if(e.push(...n),n.length=0,i===`
242
+ `)for(;t[r+1]===`
243
+ `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=UX;t=n.join(``)}}return t}function eZ(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function tZ(){return e=>{Jz(e,e=>{let t=e;typeof t.value==`string`&&eZ(t.value)&&(t.value=nZ(t.value)),typeof t.url==`string`&&eZ(t.url)&&(t.url=nZ(t.url)),typeof t.title==`string`&&eZ(t.title)&&(t.title=nZ(t.title)),typeof t.alt==`string`&&eZ(t.alt)&&(t.alt=nZ(t.alt))})}}function nZ(e){return e.replaceAll(zX,`<`).replaceAll(BX,`>`).replaceAll(VX,`:`).replaceAll(HX,`@`).replaceAll(UX,`{`)}var rZ=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function iZ(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;rZ.lastIndex=0;let i=[],a=0;for(;;){let t=rZ.exec(e);if(t===null)break;let r=t[0],o=t[1],s=t.index;s>a&&i.push({type:`text`,value:e.slice(a,s)});let c={type:`link`,url:o,title:null,children:[{type:`text`,value:o}],data:{sourceStyle:`autolink`}};i.push(c),a=s+r.length,n=!0}i.length===0?t.push(r):(a<e.length&&i.push({type:`text`,value:e.slice(a)}),t.push(...i))}n&&(e.children=t)}function aZ(e,t){if(e.children.length===0)return;let n=e.children[0];if(n.type!==`yaml`||(n.value??``).trim()!==``)return;let r=n.position?.start?.offset;if(r!==0)return;let i=n.position?.end?.offset;if(typeof i!=`number`)return;let a=typeof t.value==`string`?t.value:``;if(!a)return;let o=a.slice(r,i).split(`
244
+ `),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}var oZ=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function sZ(e,t,n=!1){if(!t)return;let r=e.position;if(!r||typeof r.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let i=r.start.offset,a=r.end?.offset??i;if(i<0||a>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${i} end=${a} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(i,a),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&oZ.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}break}case`emphasis`:{let n=t[i];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(i,i+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:if(t[i]===`#`)e.data.sourceStyle=`atx`;else{let n=t.slice(i,a);/\n[=]+\s*$/.test(n)||/\n[-]+\s*$/.test(n)?e.data.sourceStyle=`setext`:e.data.sourceStyle=`atx`}break;case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`code`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=3&&(e.data.sourceFenceLength=r)}break}case`thematicBreak`:e.data.sourceRaw=t.slice(i,a);break;case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var cZ=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.math.inlineMath.rawMdxFallbackMdast`.split(`.`));function lZ(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function uZ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;aZ(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;Jz(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!cZ.has(e.type)){let r=lZ(e,n);return i.children[t]=r,Gz}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&iZ(t)}sZ(e,n,r)})}}function dZ(){return{enter:{mdxFlowExpression:pZ,mdxTextExpression:mZ},exit:{mdxFlowExpression:hZ,mdxFlowExpressionChunk:gZ,mdxTextExpression:hZ,mdxTextExpressionChunk:gZ}}}function fZ(){return{handlers:{mdxFlowExpression:_Z,mdxTextExpression:_Z},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function pZ(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function mZ(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function hZ(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function gZ(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function _Z(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var vZ=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),yZ={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function bZ(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function xZ(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function SZ(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function CZ(e){return SZ(e)||bZ(e)}var wZ=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function TZ(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?CZ:u===`decimal`?bZ:xZ;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&vZ.includes(y)&&(_=y,v=sW(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?sW(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):CZ(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(EZ(e))h(7,S),C=`�`;else if(e in yZ)h(6,S),C=yZ[e];else{let t=``;DZ(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,wZ[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function EZ(e){return e>=55296&&e<=57343||e>1114111}function DZ(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var OZ=/["&'<>`]/g,kZ=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,AZ=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,jZ=/[|\\{}()[\]^$+*?.]/g,MZ=new WeakMap;function NZ(e,t){if(e=e.replace(t.subset?PZ(t.subset):OZ,r),t.subset||t.escapeOnly)return e;return e.replace(kZ,n).replace(AZ,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function PZ(e){let t=MZ.get(e);return t||(t=FZ(e),MZ.set(e,t)),t}function FZ(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(jZ,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var IZ=/[\dA-Fa-f]/;function LZ(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!IZ.test(String.fromCharCode(t))?r:r+`;`}var RZ=/\d/;function zZ(e,t,n){let r=`&#`+String(e);return n&&t&&!RZ.test(String.fromCharCode(t))?r:r+`;`}var BZ={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},VZ=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],HZ={}.hasOwnProperty,UZ={},WZ;for(WZ in BZ)HZ.call(BZ,WZ)&&(UZ[BZ[WZ]]=WZ);var GZ=/[^\dA-Za-z]/;function KZ(e,t,n,r){let i=String.fromCharCode(e);if(HZ.call(UZ,i)){let e=UZ[i],a=`&`+e;return n&&vZ.includes(e)&&!VZ.includes(e)&&(!r||t&&t!==61&&GZ.test(String.fromCharCode(t)))?a:a+`;`}return``}function qZ(e,t,n){let r=LZ(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=KZ(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=zZ(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function JZ(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function YZ(e,t){return NZ(e,Object.assign({format:qZ},t))}function XZ(e,t){return NZ(e,Object.assign({format:JZ},t))}var ZZ=` `;function QZ(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new AO("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new AO(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new AO("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=TZ(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new AO("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+EO(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new AO("Expected a closing tag for `"+S(r)+"` ("+EO({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new AO("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+EO(t.end)+") or another opening tag after the start of `"+t.type+"` ("+EO(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function $Z(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=rQ,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=nQ(tQ(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&JV(e,n)>JV(e,o)?o:n;s=t+XZ(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+ZZ+m[e];b+=y.move(`
245
+ `+m.join(`
246
+ `)+`
247
+ `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
248
+ `),b+=y.move(eQ(e,s,y.current())),b+=y.move(`
249
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function eQ(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=nQ(tQ(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
250
+ `,after:`
251
+ `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
252
+
253
+ `))}return r.pop(),s.join(``)}function tQ(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function nQ(e){return ZZ.repeat(e)}function rQ(){return`<`}function iQ(){return{enter:{mdxjsEsm:oQ},exit:{mdxjsEsm:sQ,mdxjsEsmData:cQ}}}function aQ(){return{handlers:{mdxjsEsm:lQ}}}function oQ(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function sQ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function cQ(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function lQ(e){return e.value||``}function uQ(){return[dZ(),QZ(),iQ()]}function dQ(e){return{extensions:[fZ(),$Z(e),aQ()]}}function fQ(e){return e}var pQ={}.hasOwnProperty,mQ=Symbol(`continue`),hQ=Symbol(`exit`),gQ=Symbol(`skip`);function _Q(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return yQ(e)&&(s.displayName=`node (`+fQ(e.type)+`)`),s;function s(){let s=n?vQ(n(e,t,a,o)):[];if(s[0]===hQ)return s;if(s[0]!==gQ){let t;for(t in e)if(pQ.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(yQ(r)){let e=i(r,t,a,n)();if(e[0]===hQ)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(yQ(r)){let e=i(r,t,void 0,n)();if(e[0]===hQ)return e}}}return r?vQ(r(e,t,a,o)):s}}}function vQ(e){return Array.isArray(e)?e:typeof e==`number`?[mQ,e]:[e]}function yQ(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function bQ(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=SQ(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&xQ(m);if(g&&!t.allowEmpty)throw new AO(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(xQ(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,_Q(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=CQ(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function xQ(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function SQ(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=wQ(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function CQ(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function wQ(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
254
+ `;break;case-3:a=`\r
255
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function TQ(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=EQ(n.start,r[0]||t.start),a=EQ(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function EQ(e,t){if(e&&typeof e==`object`){let n=`line`in e?DQ(e.line):void 0,r=`column`in e?DQ(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:DQ(t)}}}function DQ(e){return typeof e==`number`&&e>-1?e:void 0}var OQ=2,kQ=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,AQ=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,jQ=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,MQ=`#unexpected-type-in-code-expected-an-object-spread-spread`,NQ=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,PQ=`#could-not-parse-expression-with-acorn`;function FQ(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new AO("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=kQ+AQ,e}if(nH(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?IQ.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||nH(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new AO("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=kQ+jQ,e}return iH(t)?AG(e,_,`linePrefix`,OQ+1)(t):_(t)}}function IQ(e,t,n,r,i,a,o){let s=bQ(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=TQ(e),n=new AO("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kQ+MQ,n}if(e.expression.properties[1]){let t=new AO(`Unexpected extra content in spread: only a single spread is supported`,{place:TQ(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=kQ+NQ,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=TQ(e.expression.properties[0]),n=new AO("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kQ+MQ,n}}if(s.error){let e=new AO(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=kQ+PQ,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function LQ(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return FQ.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return iH(t)?AG(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||nH(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return FQ.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var RQ=/[$_\p{ID_Start}]/u,zQ=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,BQ=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,VQ={};function HQ(e){return e?RQ.test(String.fromCodePoint(e)):!1}function UQ(e,t){let n=(t||VQ).jsx?BQ:zQ;return e?n.test(String.fromCodePoint(e)):!1}var WQ=`https://github.com/micromark/micromark-extension-mdx-jsx`;function GQ(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),I}function I(e){return rH(e)?n(e):(N=ee,xe(e))}function ee(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=te,xe;if(t===62)return be(t);if(t!==null&&t>=0&&HQ(t))return e.enter(d),e.enter(f),e.consume(t),ne;we(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function te(t){if(t===62)return be(t);if(t!==null&&t>=0&&HQ(t))return e.enter(d),e.enter(f),e.consume(t),ne;we(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ne(t){if(t!==null&&t>=0&&UQ(t,{jsx:!0}))return e.consume(t),ne;if(t===46||t===47||t===58||t===62||t===123||rH(t)||oH(t))return e.exit(f),N=re,xe(t);we(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function re(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=L,xe;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=oe,xe;if(t===47||t===62||t===123||t!==null&&t>=0&&HQ(t))return e.exit(d),le(t);we(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function L(t){if(t!==null&&t>=0&&HQ(t))return e.enter(m),e.consume(t),ie;we(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ie(t){if(t!==null&&t>=0&&UQ(t,{jsx:!0}))return e.consume(t),ie;if(t===46||t===47||t===62||t===123||rH(t)||oH(t))return e.exit(m),N=ae,xe(t);we(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ae(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=L,xe;if(t===47||t===62||t===123||t!==null&&t>=0&&HQ(t))return e.exit(d),le(t);we(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe(t){if(t!==null&&t>=0&&HQ(t))return e.enter(g),e.consume(t),se;we(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function se(t){if(t!==null&&t>=0&&UQ(t,{jsx:!0}))return e.consume(t),se;if(t===47||t===62||t===123||rH(t)||oH(t))return e.exit(g),N=ce,xe(t);we(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ce(t){if(t===47||t===62||t===123||t!==null&&t>=0&&HQ(t))return e.exit(d),le(t);we(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=ye,xe;if(t===62)return be(t);if(t===123)return FQ.call(M,e,R,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&HQ(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),ue;we(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function R(e){return N=le,xe(e)}function ue(t){if(t!==null&&t>=0&&UQ(t,{jsx:!0}))return e.consume(t),ue;if(t===47||t===58||t===61||t===62||t===123||rH(t)||oH(t))return e.exit(S),N=de,xe(t);we(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function de(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=fe,xe;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=he,xe;if(t===47||t===62||t===123||rH(t)||oH(t)||t!==null&&t>=0&&HQ(t))return e.exit(x),e.exit(b),N=le,xe(t);we(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function fe(t){if(t!==null&&t>=0&&HQ(t))return e.enter(w),e.consume(t),pe;we(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&UQ(t,{jsx:!0}))return e.consume(t),pe;if(t===47||t===61||t===62||t===123||rH(t)||oH(t))return e.exit(w),e.exit(x),N=me,xe(t);we(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function me(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=he,xe;if(t===47||t===62||t===123||t!==null&&t>=0&&HQ(t))return e.exit(b),le(t);we(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function he(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,_e;if(t===123)return FQ.call(M,e,ge,k,A,j,r,i,a,!1,!1,o)(t);we(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function ge(t){return e.exit(b),N=le,xe(t)}function _e(t){return t===null&&we(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=le,xe):nH(t)?(N=_e,xe(t)):(e.enter(O),ve(t))}function ve(t){return t===null||t===P||nH(t)?(e.exit(O),_e(t)):(e.consume(t),ve)}function ye(e){if(e===62)return be(e);we(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function be(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function xe(t){return nH(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ce):iH(t)||oH(t)?(e.enter(`esWhitespace`),Se(t)):N(t)}function Se(t){return nH(t)?(e.exit(`esWhitespace`),xe(t)):iH(t)||oH(t)?(e.consume(t),Se):(e.exit(`esWhitespace`),N(t))}function Ce(e){if(!o&&M.parser.lazy[M.now().line]){let e=new AO("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=WQ+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return xe(e)}function we(e,t,n){let r=new AO(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+KQ(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=WQ+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function KQ(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function qQ(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return GQ.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function JQ(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return GQ.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return iH(e)?AG(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||nH(e)?r(e):i(e)}}}function YQ(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:JQ(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:qQ(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function XQ(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function ZQ(){return YW([LQ(),YQ(),XQ()])}var QQ=ZQ(),$Q=uQ(),e$=dQ();function t$(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===QQ)||t.push(QQ);let n=e.fromMarkdownExtensions;n.some(e=>e===$Q)||n.push($Q);let r=e.toMarkdownExtensions;r.some(e=>e===e$)||r.push(e$)}var n$=91,r$=93,i$=124,a$=35,o$={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===n$?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===n$?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===n$?n(t):t===r$?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===a$?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===i$?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===n$?n(t):t===r$?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===i$?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===n$?n(t):t===r$?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===r$?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===r$?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}};function s$(){return{text:{[n$]:o$}}}function c$(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function l$(e){return e.stack[e.stack.length-1]}function u$(e){let t=l$(this);t.data.target=this.sliceSerialize(e).trim()}function d$(e){let t=l$(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function f$(e){let t=l$(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function p$(e){let t=l$(this),{target:n,anchor:r,alias:i}=t.data,a=i||(r?`${n}#${r}`:n);t.value=a,t.children=[{type:`text`,value:a}],this.exit(e)}var m$={enter:{wikiLink:c$},exit:{wikiLinkTarget:u$,wikiLinkAnchor:d$,wikiLinkAlias:f$,wikiLink:p$}},h$={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},g$=s$();function _$(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===g$)||e.micromarkExtensions.push(g$),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===m$)||e.fromMarkdownExtensions.push(m$),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===h$)||e.toMarkdownExtensions.push(h$)}function v$(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`&&t!==`footnoteDefinition`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}function y$(e){let t=Vq().use(RX).use($Y,[`yaml`]).use(t$).use(Mq).use(_$).use(tZ).use(uZ).use(()=>v$).use(uY,{schema:e.schema,handlers:e.handlers});return t.freeze(),t}function b$(e){let t=Vq().use($Y,[`yaml`]).use(Mq).use(t$).use(_$).use(Nq,{bullet:`-`,fences:!0,rule:`-`,...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function x$(e,t){let n=new kR($X(e)),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function S$(e,t){let n=new kR($X(e)),r=t.parse(n);return n.value=e,t.runSync(r,n)}function C$(e,t,n){let r=fY(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}var w$={text(e,t,n,r){if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=D$(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=D$(n,t.slice(o),r)),a}return D$(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(T$(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(T$(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},thematicBreak(e,t,n){let r=e.data?.sourceRaw;return Array.isArray(n?.indexStack)&&n.indexStack.length===1&&n.indexStack[0]===0&&(!r||/^-[-\s]*-\s*$/.test(r))?`***`:r??`---`},break(e){return e.data?.sourceStyle===`backslash`?`\\
256
+ `:`
257
+ `},code(e){let t=e.data?.sourceFenceChar===`~`?`~`:"`",n=Math.max(3,e.data?.sourceFenceLength??3),r=t.repeat(n);return`${r}${e.lang??``}${e.meta?` ${e.meta}`:``}\n${e.value??``}\n${r}`},heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
258
+ `,after:`
259
+ `});return`${t}\n${(a===1?`=`:`-`).repeat(Math.max(t.length,3))}`}let o=`#`.repeat(a),s=n.containerPhrasing(e,{...r,before:`${o} `,after:`
260
+ `});return s?`${o} ${s}`:o},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=a?`${d+t}${u}`:e.data?.bulletMarker??i,f=s;o.checked===!0?f+=` [x]`:o.checked===!1&&(f+=` [ ]`);let p=` `.repeat(s.length+1),m=n.containerFlow(o,r).split(`
261
+ `).map((e,t)=>t===0?`${f} ${e}`:e&&`${p}${e}`).join(`
262
+ `);l.push(m)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
263
+
264
+ `:`
265
+ `;return l.join(f)},mdxJsxFlowElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},rawMdxFallback(e){return e.value??``}};function T$(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function E$(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function D$(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return E$(i)}var O$=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;constructor(e){this.schema=__(e.extensions),this.handlers=M$(this.schema);let{nodeHandlers:t,markHandlers:n}=N$(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=y$({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=b$({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:w$})}parse(e){return e.trim()?x$(e,this.parseProcessor).toJSON():{type:`doc`,content:[{type:`paragraph`,content:[]}]}}parseToMdast(e){return e.trim()?S$(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e){return e.trim()?CY(e,{parse:e=>this.parse(e)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return C$(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};function k$(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function A$(e){if(e.length===0)return{type:`inlineCode`,value:``};if(e.every(e=>e.type===`text`))return{type:`inlineCode`,value:e.map(e=>e.value).join(``)};if(e.length===1&&`children`in e[0]){let t=e[0];return{...t,children:[A$(t.children)]}}return{type:`inlineCode`,value:j$(e)}}function j$(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=j$(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}function M$(e){let t=e.nodes,n=e.marks,r={};t.paragraph&&(r.paragraph=(e,n,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),n=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=t.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...n),r.length===1?r[0]:r}return t.paragraph.createAndFill(null,i.length>0?i:null)}),t.blockquote&&(r.blockquote=sY(t.blockquote)),t.table&&(r.table=sY(t.table)),t.tableRow&&(r.tableRow=sY(t.tableRow)),t.tableCell&&(r.tableCell=(e=>(n,r,i)=>{let a=i.all(n).flat();if(a.length>0&&t.paragraph){let n=t.paragraph.create(null,a);return e.createAndFill(null,[n])}return e.createAndFill(null,null)})(t.tableCell),t.tableHeader),t.image&&(r.image=e=>t.image.createAndFill({src:e.url??``,alt:e.alt??null,title:e.title??null}),r.imageReference=e=>t.image.createAndFill({src:``,alt:e.alt??null,title:null})),n.escapeMark&&(r.text=t=>{let r=t.value??``;if(!r)return null;let i=t.data?.escapedChars;if(!i?.length)return e.text(r.replaceAll(`\xA0`,` `));let a=[],o=0;for(let{offset:t}of i){if(t>o){let n=r.slice(o,t).replaceAll(`\xA0`,` `);n&&a.push(e.text(n))}if(t<r.length){let i=r[t].replaceAll(`\xA0`,` `);a.push(e.text(i,[n.escapeMark.create()])),o=t+1}}if(o<r.length){let t=r.slice(o).replaceAll(`\xA0`,` `);t&&a.push(e.text(t))}return a.length===1?a[0]:a}),n.code&&(r.inlineCode=t=>e.text(t.value,[n.code.create()]));let i=n.strike??n.delete;i&&(r.delete=cY(i)),n.emphasis&&(r.emphasis=cY(n.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),n.strong&&(r.strong=cY(n.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),t.heading&&(r.heading=sY(t.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`}))),t.codeBlock&&(r.code=n=>{let r=n.value?[e.text(n.value)]:[];return t.codeBlock.createAndFill({language:n.lang??null,meta:n.meta??null,fenceDelimiter:n.data?.sourceFenceChar??"`",fenceLength:n.data?.sourceFenceLength??3},r)}),t.thematicBreak&&(r.thematicBreak=e=>t.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),t.hardBreak&&(r.break=e=>t.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),t.list&&(r.list=sY(t.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),t.listItem&&(r.listItem=sY(t.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),n.link&&(r.link=cY(n.link,e=>({href:e.url??``,title:e.title??null,linkStyle:e.data?.sourceStyle??`inline`,refLabel:null})),r.linkReference=cY(n.link,e=>({href:``,title:null,linkStyle:e.referenceType??`shortcut`,refLabel:e.label??e.identifier??null}))),t.htmlBlock&&(r.html=e=>t.htmlBlock.createAndFill({content:e.value??``}));let a=t.linkDefinition??t.linkRefDef;if(a){let e=!!a.spec.attrs?.url,t=!!a.spec.attrs?.href,n=!!a.spec.attrs?.identifier;r.definition=r=>{let i={title:r.title??null};return n&&(i.identifier=r.identifier??``),i.label=r.label??r.identifier??``,e?i.url=r.url??``:t&&(i.href=r.url??``),a.createAndFill(i)}}if(t.jsxComponent){let n=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};r.mdxJsxFlowElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),t.jsxInline?r.mdxJsxTextElement=(e,r,i)=>{let a=i.all(e).flat(),o={sourceRaw:n(e.data)??``,attributes:(e.attributes??[]).map(e=>`type`in e&&e.type===`mdxJsxExpressionAttribute`?{type:`spread`,value:e.value}:{type:`attr`,name:e.name,value:e.value})};return t.jsxInline.createAndFill(o,a.length>0?a:null)}:r.mdxJsxTextElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),r.mdxFlowExpression=e=>t.jsxComponent.createAndFill({content:n(e.data)??`{${e.value??``}}`}),r.mdxTextExpression=t=>{let r=n(t.data)??`{${t.value??``}}`;return e.text(r)}}t.wikiLink&&(r.wikiLink=e=>t.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null}));let o=n=>{let r=n.value??n.type;return t.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.type,reason:`Unhandled block mdast: ${n.type}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${n.type}`},r?[e.text(r)]:null)):null},s=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return r.math||=o,r.inlineMath||=s,r.footnoteReference||=s,r.rawMdxFallbackMdast=n=>{if(!t.rawMdxFallback)return null;let r=n.position?{start:n.position.start?.offset??0,end:n.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.originalType,reason:`Unhandled mdast: ${n.originalType}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${n.originalType}`,originalSpan:r},n.value?[e.text(n.value)]:null)},r}function N$(e){let t={},n={},r=e.nodes,i=e.marks;if(r.paragraph&&(t.paragraph=pY(`paragraph`)),r.blockquote&&(t.blockquote=pY(`blockquote`)),r.heading&&(t.heading=pY(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle}}))),r.codeBlock&&(t.codeBlock=e=>({type:`code`,lang:e.attrs.language??null,meta:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength}})),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=pY(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&k$(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=pY(`table`)),r.tableRow&&(t.tableRow=pY(`tableRow`)),r.tableCell&&(t.tableCell=pY(`tableCell`)),r.tableHeader&&(t.tableHeader=pY(`tableCell`)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>({type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title})}if(r.jsxComponent&&(t.jsxComponent=e=>({type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(e.attrs.content??``)}})),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=mY(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=mY(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>A$(n)),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=mY(`delete`)}return i.link&&(n.link=(e,t,n)=>{let r=e.attrs.linkStyle;return r===`autolink`?{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}}:r===`inline`||!r?{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n}:{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),{nodeHandlers:t,markHandlers:n}}var P$=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],F$=/^>|^->|<!--|-->|--!>|<!-$/g,I$=[`>`],L$=[`<`,`>`];function R$(e,t,n,r){return r.settings.bogusComments?`<?`+YZ(e.value,Object.assign({},r.settings.characterReferences,{subset:I$}))+`>`:`<!--`+e.value.replace(F$,i)+`-->`;function i(e){return YZ(e,Object.assign({},r.settings.characterReferences,{subset:L$}))}}function z$(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var B$=U$(1),V$=U$(-1),H$=[];function U$(e){return t;function t(t,n,r){let i=t?t.children:H$,a=(n||0)+e,o=i[a];if(!r)for(;o&&pz(o);)a+=e,o=i[a];return o}}var W$={}.hasOwnProperty;function G$(e){return t;function t(t,n,r){return W$.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var K$=G$({body:Y$,caption:q$,colgroup:q$,dd:$$,dt:Q$,head:q$,html:J$,li:Z$,optgroup:t1,option:n1,p:X$,rp:e1,rt:e1,tbody:i1,td:s1,tfoot:a1,th:s1,thead:r1,tr:o1});function q$(e,t,n){let r=B$(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&pz(r.value.charAt(0)))}function J$(e,t,n){let r=B$(n,t);return!r||r.type!==`comment`}function Y$(e,t,n){let r=B$(n,t);return!r||r.type!==`comment`}function X$(e,t,n){let r=B$(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Z$(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Q$(e,t,n){let r=B$(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function $$(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function e1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function t1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function n1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function r1(e,t,n){let r=B$(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function i1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function a1(e,t,n){return!B$(n,t)}function o1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function s1(e,t,n){let r=B$(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var c1=G$({body:d1,colgroup:f1,head:u1,html:l1,tbody:p1});function l1(e){let t=B$(e,-1);return!t||t.type!==`comment`}function u1(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function d1(e){let t=B$(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&pz(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function f1(e,t,n){let r=V$(n,t),i=B$(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&K$(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function p1(e,t,n){let r=V$(n,t),i=B$(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&K$(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var m1={name:[[`
266
+ \f\r &/=>`.split(``),`
267
+ \f\r "&'/=>\``.split(``)],[`\0
268
+ \f\r "&'/<=>`.split(``),`\0
269
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
270
+ \f\r &>`.split(``),`\0
271
+ \f\r "&'<=>\``.split(``)],[`\0
272
+ \f\r "&'<=>\``.split(``),`\0
273
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function h1(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=MN);let l=g1(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!c1(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!K$(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function g1(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=_1(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function _1(e,t,n){let r=ON(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=YZ(r.attribute,Object.assign({},e.settings.characterReferences,{subset:m1.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?PN:RN)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=YZ(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:m1.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&JV(n,o)>JV(n,e.alternative)&&(o=e.alternative),s=o+YZ(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?m1.single:m1.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var v1=[`<`,`&`];function y1(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:YZ(e.value,Object.assign({},r.settings.characterReferences,{subset:v1}))}function b1(e,t,n,r){return r.settings.allowDangerousHtml?e.value:y1(e,t,n,r)}function x1(e,t,n,r){return r.all(e)}var S1=nU(`type`,{invalid:C1,unknown:w1,handlers:{comment:R$,doctype:z$,element:h1,raw:b1,root:x1,text:y1}});function C1(e){throw Error("Expected node, not `"+e+"`")}function w1(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var T1={},E1={},D1=[];function O1(e,t){let n=t||T1,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:k1,all:A1,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||P$,characterReferences:n.characterReferences||E1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?MN:jN,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function k1(e,t,n){return S1(e,t,n,this)}function A1(e){let t=[],n=e&&e.children||D1,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Tle(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return O1(e,n)}}function Ele(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Dle(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
274
+ `}]}function Ole(e,t){let n=t.value?t.value+`
275
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function kle(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ale(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jle(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=SG(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Mle(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nle(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function j1(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Ple(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j1(e,t);let i={src:SG(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Fle(e,t){let n={src:SG(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ile(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Lle(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return j1(e,t);let i={href:SG(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Rle(e,t){let n={href:SG(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zle(e,t,n){let r=e.all(t),i=n?Ble(n):M1(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
276
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
277
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Ble(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=M1(n[r])}return t}function M1(e){return e.spread??e.children.length>1}function Vle(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Hle(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ule(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Wle(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gle(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Xz(t.children[1]),o=Yz(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Kle(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function qle(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jle(e,t){let n={type:`text`,value:XJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yle(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Xle={blockquote:Ele,break:Dle,code:Ole,delete:kle,emphasis:Ale,footnoteReference:jle,heading:Mle,html:Nle,imageReference:Ple,image:Fle,inlineCode:Ile,linkReference:Lle,link:Rle,listItem:zle,list:Vle,paragraph:Hle,root:Ule,strong:Wle,table:Gle,tableCell:qle,tableRow:Kle,text:Jle,thematicBreak:Yle,toml:N1,yaml:N1,definition:N1,footnoteDefinition:N1};function N1(){}function Zle(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Qle(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function $le(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Zle,r=e.options.footnoteBackLabel||Qle,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=SG(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...rz(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
278
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
279
+ `}]}}var P1={}.hasOwnProperty,eue={};function tue(e,t){let n=t||eue,r=new Map,i=new Map,a={all:s,applyData:rue,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Xle,...n.handlers},one:o,options:n,patch:nue,wrap:aue};return Jz(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(P1.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=rz(n);return r.children=a.all(e),r}return rz(e)}return(a.options.unknownHandler||iue)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=F1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=F1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function nue(e,t){e.position&&(t.position=Qz(e))}function rue(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,rz(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function iue(e,t){let n=t.data||{},r=`value`in t&&!(P1.call(n,`hProperties`)||P1.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aue(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
280
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
281
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
282
+ `}),n}function F1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function I1(e,t){let n=tue(e,t),r=n.one(e,void 0),i=$le(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
283
+ `},i)),a}function oue(e,t){return e&&`run`in e?async function(n,r){let i=I1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return I1(n,{file:r,...e||t})}}var sue=/\p{M}+/gu,cue=/[^\p{L}\p{N}]+/gu,lue=/^-+|-+$/g;function L1(e){return e.trim().normalize(`NFKD`).replace(sue,``).toLowerCase().replace(cue,`-`).replace(lue,``)}function uue(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function due(e,t){let n=L1(e);return n?uue(n,t):``}function fue(e,t){let n=L1(e);return t?`#${n}-${L1(t)}`:`#${n}`}var pue={wikiLink:(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:fue(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},mdxJsxFlowElement:(e,t)=>{let n=t,r={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,r),e.applyData(t,r)},mdxJsxTextElement:(e,t)=>{let n=t,r={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`]},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,r),e.applyData(t,r)},rawMdxFallback:(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a={type:`comment`,value:` Parse error: ${r.replace(/--/g,`—`)} `},o={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,o),[a,e.applyData(t,o)]}},mue=/^(https?:|mailto:|tel:|ftp:|sms:|\/|#|\?|\.\/|\.\.\/)/i;function R1(e){let t=e.trim();return t===``?!0:mue.test(t)}var hue=()=>e=>{Jz(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(n){if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!R1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!R1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!R1(e)&&delete n.action}}})};function z1(e){let t=Vq().use(RX).use($Y,[`yaml`]).use(t$).use(Mq).use(_$).use(oue,{handlers:pue}).use(hue).use(Tle);return String(t.processSync(e))}var B1=Ze(Je(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var D=-b+v;D<=b-y;D+=2){for(var T=l+D,E=D==-b||D!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,O=E-D;E<o&&O<s&&e.charAt(o-E-1)==t.charAt(s-O-1);)E++,O++;if(f[T]=E,E>o)y+=2;else if(O>s)v+=2;else if(!h){var S=l+m-D;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
284
+ `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
285
+ `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
286
+ `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
287
+ `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);new B1.default,new B1.default;var gue=new B1.default;gue.Match_Threshold=.5;var V1=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function _ue(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??vue,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new V1(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function vue(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function yue(){let e=!1,t=``,n=0;return r=>{let i=bue(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function bue(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var H1=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],xue=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Sue(e){let t=0;for(let n of e)t=(t<<5)-t+n.charCodeAt(0)|0;return H1[Math.abs(t)%H1.length]}function Cue(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function wue(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Tue(e){let[t]=Cue(e);return wue(t,45,32)}var Eue=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Due=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],U1=`ok-user-name-v2`,W1=`ok-user-color-v2`;function G1(e){return e[Math.floor(Math.random()*e.length)]}function Oue(){return`${G1(Eue)} ${G1(Due)}`}function kue(){return G1(xue)}function K1(e){try{return localStorage.getItem(e)}catch{return null}}function q1(e,t){try{localStorage.setItem(e,t)}catch{}}function Aue(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=K1(U1),r=K1(W1);return n||(n=Oue(),q1(U1,n)),r||(r=kue(),q1(W1,r)),{name:n,color:r,coeditor:e,tabId:t}}function jue(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=o.endsWith(`.md`)?o.slice(0,-3):o,c=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(e);return c.length===0?null:{docName:c.join(`/`),anchor:a||null}}var Mue=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function J1(e){return e.split(`/`).filter(Boolean)}function Y1(e){let t=e.trim();return Mue.test(t)||t.startsWith(`//`)}function X1(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=jue(n,t);return r?{kind:`doc`,docName:r.docName,anchor:r.anchor}:n.startsWith(`/`)||Y1(n)?{kind:`external`,url:n}:null}function Z1(e,t){let n=e.trim();return n?Y1(n)?{kind:`external`,url:t?`${n}#${t}`:n}:{kind:`doc`,docName:n,anchor:t?.trim()||null}:null}function Nue(e,t,n=null){let r=J1(e);r.pop();let i=J1(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Pue(e){return typeof e==`object`&&!!e}function Fue(e){return e===`files`||e===`backlinks`||e===`graph`||e===`sync-status`}function Iue(e){let t;try{t=JSON.parse(e)}catch{return null}return!Pue(t)||t.v!==1||!Fue(t.ch)||typeof t.seq!=`number`?null:{v:1,ch:t.ch,seq:t.seq}}function Lue(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function Rue(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function Q1(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var zue=2e3,Bue=15e3;function Vue(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??zue,r=e.maxDelayMs??Bue,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function Hue(){let e=(0,gn.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,z.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,z.useRef)(i),[o,s]=(0,z.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=Rue(typeof window<`u`?window:void 0);if(t){r(Q1(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(Q1(t))});return()=>{n()}}let n=Vue({fetchConfig:Roe,fallbackUrl:Lue,now:Date.now,setTimeout:Kue,clearTimeout:Gue,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let l;e[3]===o?l=e[4]:(l=[o],e[3]=o,e[4]=l),(0,z.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(Wue),s(Uue)},e[5]=u):u=e[5];let d=u,f;return e[6]===n?f=e[7]:(f={...n,retry:d},e[6]=n,e[7]=f),f}function Uue(e){return e+1}function Wue(e){return{...e,terminal:!1,lastError:null}}function Gue(e){return globalThis.clearTimeout(e)}function Kue(e,t){return globalThis.setTimeout(e,t)}var que=Math.floor,Jue=(e,t)=>e<t?e:t,Yue=(e,t)=>e>t?e:t;Number.isNaN;var $1=128,Xue=1<<17,Zue=1<<18,Que=1<<19,$ue=1<<20,ede=1<<21,tde=1<<22,nde=1<<23,rde=1<<24,ide=1<<25,ade=1<<26,ode=1<<27,sde=1<<28,cde=1<<29,lde=1<<30,e0=127;Xue-1,Zue-1,Que-1,$ue-1,ede-1,tde-1,nde-1,rde-1,ide-1,ade-1,ode-1,sde-1,cde-1,lde-1;var ude=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var dde=String.fromCharCode;String.fromCodePoint,dde(65535);var fde=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},t0=typeof TextEncoder<`u`?new TextEncoder:null,pde=t0?e=>t0.encode(e):fde,n0=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});n0&&n0.decode(new Uint8Array).length===1&&(n0=null);var r0=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},i0=(e,t)=>{for(;t>e0;)r0(e,$1|e0&t),t=que(t/128);r0(e,e0&t)},a0=new Uint8Array(3e4),mde=a0.length/3,hde=t0&&t0.encodeInto?(e,t)=>{if(t.length<mde){let n=t0.encodeInto(t,a0).written||0;i0(e,n);for(let t=0;t<n;t++)r0(e,a0[t])}else _de(e,pde(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;i0(e,r);for(let t=0;t<r;t++)r0(e,n.codePointAt(t))},gde=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Jue(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Yue(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},_de=(e,t)=>{i0(e,t.byteLength),gde(e,t)},o0=e=>Error(e),vde=o0(`Unexpected end of array`),yde=o0(`Integer out of Range`),bde=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},xde=e=>bde(e,c0(e)),s0=e=>e.arr[e.pos++],c0=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&e0)*n,n*=128,r<$1)return t;if(t>ude)throw yde}throw vde},l0=n0?e=>n0.decode(xde(e)):e=>{let t=c0(e);if(t===0)return``;{let n=String.fromCodePoint(s0(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(s0(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},u0=function(e){return e[e.Token=0]=`Token`,e[e.PermissionDenied=1]=`PermissionDenied`,e[e.Authenticated=2]=`Authenticated`,e}({}),Sde=(e,t)=>{i0(e,u0.Token),hde(e,t)},Cde=(e,t,n,r)=>{switch(c0(e)){case u0.Token:t();break;case u0.PermissionDenied:n(l0(e));break;case u0.Authenticated:r(l0(e));break;default:}},d0=e=>Array.from(e.entries()).map(([e,t])=>({clientId:e,...t})),f0=`\0`;function wde(e,t){return e+f0+t}function Tde(e){let t=e.indexOf(f0);return t===-1?{documentName:e,sessionId:null}:{documentName:e.substring(0,t),sessionId:e.substring(t+1)}}var Ede=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Open=1]=`Open`,e[e.Closing=2]=`Closing`,e[e.Closed=3]=`Closed`,e}({});function Dde(e){return e||={},{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function p0(e){return new Promise(t=>setTimeout(t,e))}function Ode(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=t.factor**(e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);n=Math.floor(Math.random()*(Math.floor(n)-e+1))+e}return Math.round(n)}async function kde(e,t){let n=Dde(t);for(let e of[`delay`,`initialDelay`,`minDelay`,`maxDelay`,`maxAttempts`,`timeout`]){let t=n[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw Error(`Value for factor must be a number greater than or equal to 0`);if(n.delay<n.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);let r={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){r.aborted=!0}},i=n.calculateDelay||Ode;async function a(){if(n.beforeAttempt&&n.beforeAttempt(r,n),r.aborted){let e=Error(`Attempt aborted`);throw e.code=`ATTEMPT_ABORTED`,e}let t=async e=>{if(n.handleError&&await n.handleError(e,r,n),r.aborted||r.attemptsRemaining===0)throw e;r.attemptNum++;let t=i(r,n);return t&&await p0(t),a()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((i,a)=>{let o=setTimeout(()=>{if(n.handleTimeout)try{i(n.handleTimeout(r,n))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);e.code=`ATTEMPT_TIMEOUT`,a(e)}},n.timeout);e(r,n).then(e=>{clearTimeout(o),i(e)}).catch(e=>{clearTimeout(o),t(e).then(i).catch(a)})}):e(r,n).catch(t)}let o=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(o&&await p0(o),r.attemptNum<1&&n.initialJitter){let e=i(r,n);e&&await p0(e)}return a()}var m0=Math.floor,Ade=(e,t)=>e<t?e:t,jde=(e,t)=>e>t?e:t;Number.isNaN;var Mde=64,h0=128,Nde=1<<17,Pde=1<<18,Fde=1<<19,Ide=1<<20,Lde=1<<21,Rde=1<<22,zde=1<<23,Bde=1<<24,Vde=1<<25,Hde=1<<26,Ude=1<<27,Wde=1<<28,Gde=1<<29,Kde=1<<30,qde=63,g0=127;Nde-1,Pde-1,Fde-1,Ide-1,Lde-1,Rde-1,zde-1,Bde-1,Vde-1,Hde-1,Ude-1,Wde-1,Gde-1,Kde-1;var _0=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var Jde=()=>new Set,Yde=Array.from;Array.isArray;var Xde=String.fromCharCode;String.fromCodePoint,Xde(65535);var Zde=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},v0=typeof TextEncoder<`u`?new TextEncoder:null,Qde=v0?e=>v0.encode(e):Zde,y0=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});y0&&y0.decode(new Uint8Array).length===1&&(y0=null);var $de=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},b0=()=>new $de,x0=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},S0=e=>{let t=new Uint8Array(x0(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},C0=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},w0=(e,t)=>{for(;t>g0;)C0(e,h0|g0&t),t=m0(t/128);C0(e,g0&t)},T0=new Uint8Array(3e4),efe=T0.length/3,E0=v0&&v0.encodeInto?(e,t)=>{if(t.length<efe){let n=v0.encodeInto(t,T0).written||0;w0(e,n);for(let t=0;t<n;t++)C0(e,T0[t])}else D0(e,Qde(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;w0(e,r);for(let t=0;t<r;t++)C0(e,n.codePointAt(t))},tfe=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Ade(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(jde(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},D0=(e,t)=>{w0(e,t.byteLength),tfe(e,t)},O0=e=>Error(e),k0=O0(`Unexpected end of array`),A0=O0(`Integer out of Range`),nfe=class{constructor(e){this.arr=e,this.pos=0}},j0=e=>new nfe(e),rfe=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},M0=e=>rfe(e,P0(e)),N0=e=>e.arr[e.pos++],P0=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&g0)*n,n*=128,r<h0)return t;if(t>_0)throw A0}throw k0},ife=e=>{let t=e.arr[e.pos++],n=t&qde,r=64,i=(t&Mde)>0?-1:1;if((t&h0)===0)return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&g0)*r,r*=128,t<h0)return i*n;if(n>_0)throw A0}throw k0},F0=y0?e=>y0.decode(M0(e)):e=>{let t=P0(e);if(t===0)return``;{let n=String.fromCodePoint(N0(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(N0(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},afe=e=>{let t=e.pos,n=F0(e);return e.pos=t,n},I0=Date.now,L0=()=>new Map,ofe=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},sfe=class{constructor(){this._observers=L0()}on(e,t){ofe(this._observers,e,Jde).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Yde((this._observers.get(e)||L0()).values()).forEach(e=>e(...t))}destroy(){this._observers=L0()}},R0=Symbol(`Equality`),cfe=Object.keys,z0=e=>cfe(e).length,lfe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),B0=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[R0]!=null)return e[R0](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!B0(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(z0(e)!==z0(t))return!1;for(let n in e)if(!lfe(e,n)||!B0(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!B0(e[n],t[n]))return!1;break;default:return!1}return!0},V0=3e4,ufe=class extends sfe{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=I0();this.getLocalState()!==null&&V0/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&V0<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&H0(this,t,`timeout`)},m0(V0/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:I0()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),B0(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},H0=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:I0()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},U0=(e,t,n=e.states)=>{let r=t.length,i=b0();w0(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;w0(i,r),w0(i,s),E0(i,JSON.stringify(o))}return S0(i)},dfe=(e,t,n)=>{let r=j0(t),i=I0(),a=[],o=[],s=[],c=[],l=P0(r);for(let t=0;t<l;t++){let t=P0(r),n=P0(r),l=JSON.parse(F0(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(B0(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},W0=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}},G0=class{constructor(e){this.data=e,this.encoder=b0(),this.decoder=j0(new Uint8Array(this.data))}peekVarString(){return afe(this.decoder)}readVarUint(){return P0(this.decoder)}readVarString(){return F0(this.decoder)}readVarUint8Array(){return M0(this.decoder)}writeVarUint(e){return w0(this.encoder,e)}writeVarString(e){return E0(this.encoder,e)}writeVarUint8Array(e){return D0(this.encoder,e)}length(){return x0(this.encoder)}},K0=function(e){return e[e.Sync=0]=`Sync`,e[e.Awareness=1]=`Awareness`,e[e.Auth=2]=`Auth`,e[e.QueryAwareness=3]=`QueryAwareness`,e[e.Stateless=5]=`Stateless`,e[e.CLOSE=7]=`CLOSE`,e[e.SyncStatus=8]=`SyncStatus`,e[e.Ping=9]=`Ping`,e[e.Pong=10]=`Pong`,e}({}),q0=function(e){return e.Connecting=`connecting`,e.Connected=`connected`,e.Disconnected=`disconnected`,e}({}),J0=class{constructor(){this.encoder=b0()}get(e){return e.encoder}toUint8Array(){return S0(this.encoder)}},ffe=class extends J0{constructor(...e){super(...e),this.type=K0.CLOSE,this.description=`Ask the server to close the connection`}get(e){return E0(this.encoder,e.documentName),w0(this.encoder,this.type),this.encoder}},pfe=class e extends W0{static{this.DEDUPLICATABLE_TYPES=new Set([K0.Awareness,K0.QueryAwareness])}constructor(e){super(),this.messageQueue=[],this.configuration={url:``,autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=q0.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on(`open`,this.configuration.onOpen),this.on(`open`,this.onOpen.bind(this)),this.on(`connect`,this.configuration.onConnect),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`status`,this.configuration.onStatus),this.on(`disconnect`,this.configuration.onDisconnect),this.on(`close`,this.configuration.onClose),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`close`,this.onClose.bind(this)),this.on(`message`,this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=q0.Connected,this.emit(`status`,{status:q0.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){let t=e.effectiveName,n=this.configuration.providerMap.get(t);if(n&&n!==e&&n.isAuthenticated)throw Error(`Cannot attach two providers with the same effective name "${t}". Use sessionAwareness: true to multiplex providers with the same document name.`);this.configuration.providerMap.set(t,e),this.status===q0.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===q0.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){let t=e.effectiveName;this.configuration.providerMap.has(t)&&(e.send(ffe,{documentName:t}),this.configuration.providerMap.delete(t))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===q0.Connected)return;this.cancelWebsocketRetry&&=(this.cancelWebsocketRetry(),void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;let{retryPromise:e,cancelFunc:t}=(()=>{let e=!1;return{retryPromise:kde(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:t=>{(!this.shouldConnect||e)&&t.abort()}}).catch(e=>{if(e&&e.code!==`ATTEMPT_ABORTED`)throw e}),cancelFunc:()=>{e=!0}}})();return this.cancelWebsocketRetry=t,e}attachWebSocketListeners(e,t){let{identifier:n}=e,r=e=>this.emit(`message`,e),i=e=>this.emit(`close`,{event:e}),a=e=>this.emit(`open`,e),o=e=>{t(e)};this.webSocketHandlers[n]={message:r,close:i,open:a,error:o};let s=this.webSocketHandlers[e.identifier];Object.keys(s).forEach(t=>{e.addEventListener(t,s[t])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(n=>{this.webSocket?.removeEventListener(n,t[n]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let n=new this.configuration.WebSocketPolyfill(this.url);n.binaryType=`arraybuffer`,n.identifier=this.identifier,this.attachWebSocketListeners(n,t),this.webSocket=n,this.status=q0.Connecting,this.emit(`status`,{status:q0.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){this.resolveConnectionAttempt(),this.lastMessageReceived=I0();let t=new Uint8Array(e.data);if(t.length===1&&t[0]===K0.Ping){this.sendPong();return}let n=new G0(t).peekVarString();this.configuration.providerMap.get(n)?.onMessage(e)}sendPong(){let e=b0();w0(e,K0.Pong),this.send(S0(e))}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=q0.Connected,this.emit(`status`,{status:q0.Connected}),this.emit(`connect`),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){this.connectionAttempt?.reject(),this.connectionAttempt=null}checkConnection(){this.status===q0.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=I0()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:`forced`}}),this.closeTries=0):(this.webSocket?.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]===`/`;)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}parseQueuedMessage(e){try{let t=j0(e);return{documentName:F0(t),messageType:P0(t)}}catch{return null}}addToQueue(t){if(t instanceof Uint8Array){let n=this.parseQueuedMessage(t);n&&e.DEDUPLICATABLE_TYPES.has(n.messageType)&&(this.messageQueue=this.messageQueue.filter(e=>{if(!(e instanceof Uint8Array))return!0;let t=this.parseQueuedMessage(e);return t?!(t.documentName===n.documentName&&t.messageType===n.messageType):!0}))}this.messageQueue.push(t)}send(e){this.webSocket?.readyState===Ede.Open?this.webSocket.send(e):this.addToQueue(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=q0.Disconnected,this.emit(`status`,{status:q0.Disconnected}),this.emit(`disconnect`,{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit(`destroy`),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}},Y0=0,X0=1,Z0=2,mfe=(e,t)=>{w0(e,Y0),D0(e,uT(t))},hfe=(e,t,n)=>{w0(e,X0),D0(e,iT(t,n))},gfe=(e,t,n)=>hfe(t,n,M0(e)),Q0=(e,t,n,r)=>{try{tT(t,M0(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},_fe=(e,t)=>{w0(e,Z0),D0(e,t)},vfe=Q0,yfe=(e,t,n,r,i)=>{let a=P0(e);switch(a){case Y0:gfe(e,t,n);break;case X0:Q0(e,n,r,i);break;case Z0:vfe(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},bfe=class{constructor(e){this.message=e}apply(e,t){let{message:n}=this,r=n.readVarUint(),i=n.length();switch(r){case K0.Sync:this.applySyncMessage(e,t);break;case K0.Awareness:this.applyAwarenessMessage(e);break;case K0.Auth:this.applyAuthMessage(e);break;case K0.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case K0.Stateless:e.receiveStateless(F0(n.decoder));break;case K0.SyncStatus:this.applySyncStatusMessage(e,ife(n.decoder)===1);break;case K0.CLOSE:let i={code:1e3,reason:F0(n.decoder)};e.onClose(),e.configuration.onClose({event:i}),e.forwardClose({event:i});break;default:console.error(`Can’t apply message of unknown type: ${r}`)}n.length()>i+1&&e.send(J0,{encoder:n.encoder})}applySyncMessage(e,t){let{message:n}=this;n.writeVarUint(K0.Sync);let r=yfe(n.decoder,n.encoder,e.document,e);t&&r===X0&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;dfe(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){let{message:t}=this;Cde(t.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;t.writeVarUint(K0.Awareness),t.writeVarUint8Array(U0(e.awareness,Array.from(e.awareness.getStates().keys())))}},xfe=class{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return S0(this.encoder)}send(e){e?.send(this.create())}},Sfe=`4.0.0-rc.1`,Cfe=class extends J0{constructor(...e){super(...e),this.type=K0.Auth,this.description=`Authentication`}get(e){if(e.token===void 0)throw Error("The authentication message requires `token` as an argument.");return E0(this.encoder,e.documentName),w0(this.encoder,this.type),Sde(this.encoder,e.token),E0(this.encoder,Sfe),this.encoder}},$0=class extends J0{constructor(...e){super(...e),this.type=K0.Awareness,this.description=`Awareness states update`}get(e){if(e.awareness===void 0)throw Error(`The awareness message requires awareness as an argument`);if(e.clients===void 0)throw Error(`The awareness message requires clients as an argument`);E0(this.encoder,e.documentName),w0(this.encoder,this.type);let t;return t=e.states===void 0?U0(e.awareness,e.clients):U0(e.awareness,e.clients,e.states),D0(this.encoder,t),this.encoder}},wfe=class extends J0{constructor(...e){super(...e),this.type=K0.Stateless,this.description=`A stateless message`}get(e){return E0(this.encoder,e.documentName),w0(this.encoder,this.type),E0(this.encoder,e.payload??``),this.encoder}},e2=class extends J0{constructor(...e){super(...e),this.type=K0.Sync,this.description=`First sync step`}get(e){if(e.document===void 0)throw Error(`The sync step one message requires document as an argument`);return E0(this.encoder,e.documentName),w0(this.encoder,this.type),mfe(this.encoder,e.document),this.encoder}},Tfe=class extends J0{constructor(...e){super(...e),this.type=K0.Sync,this.description=`A document update`}get(e){return E0(this.encoder,e.documentName),w0(this.encoder,this.type),_fe(this.encoder,e.update),this.encoder}},Efe=class extends Error{constructor(...e){super(...e),this.code=1001}},t2=class extends W0{get effectiveName(){return this.configuration.sessionAwareness?wde(this.configuration.name,this.sessionId):this.configuration.name}constructor(e){super(),this.configuration={name:``,document:void 0,awareness:void 0,token:null,sessionAwareness:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.sessionId=Math.random().toString(36).slice(2),this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit(`connect`),this.forwardStatus=e=>this.emit(`status`,e),this.forwardClose=e=>this.emit(`close`,e),this.forwardDisconnect=e=>this.emit(`disconnect`,e),this.forwardDestroy=()=>this.emit(`destroy`),this.setConfiguration(e),this.configuration.document=e.document?e.document:new zw,this.configuration.awareness=e.awareness===void 0?new ufe(this.document):e.awareness,this.on(`open`,this.configuration.onOpen),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`synced`,this.configuration.onSynced),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`stateless`,this.configuration.onStateless),this.on(`unsyncedChanges`,this.configuration.onUnsyncedChanges),this.on(`authenticated`,this.configuration.onAuthenticated),this.on(`authenticationFailed`,this.configuration.onAuthenticationFailed),this.awareness?.on(`update`,()=>{this.emit(`awarenessUpdate`,{states:d0(this.awareness.getStates())})}),this.awareness?.on(`change`,()=>{this.emit(`awarenessChange`,{states:d0(this.awareness.getStates())})}),this.document.on(`update`,this.boundDocumentUpdateHandler),this.awareness?.on(`update`,this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval==`number`&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new pfe(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&--this.unsyncedChanges,this.unsyncedChanges===0&&(this.synced=!0),this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(e2,{document:this.document,documentName:this.effectiveName})}pageHide(){this.awareness&&H0(this.awareness,[this.document.clientID],`page hide`)}registerEventListeners(){typeof window>`u`||!(`addEventListener`in window)||window.addEventListener(`pagehide`,this.boundPageHide)}sendStateless(e){this.send(wfe,{documentName:this.effectiveName,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(e){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${e}`);return}this.send(Cfe,{token:e??``,documentName:this.effectiveName})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(Tfe,{update:e,documentName:this.effectiveName}))}awarenessUpdateHandler({added:e,updated:t,removed:n},r){let i=e.concat(t).concat(n);this.send($0,{awareness:this.awareness,clients:i,documentName:this.effectiveName})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit(`synced`,{state:e}))}receiveStateless(e){this.emit(`stateless`,{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn(`HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn(`HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}async onOpen(e){this.isAuthenticated=!1,this.emit(`open`,{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token==`function`?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(e2,{document:this.document,documentName:this.effectiveName}),this.awareness&&this.awareness.getLocalState()!==null&&this.send($0,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.effectiveName})}send(e,t){if(!this._isAttached)return;let n=new xfe(e,t);this.emit(`outgoingMessage`,{message:n.message}),n.send(this.configuration.websocketProvider)}onMessage(e){let t=new G0(e.data),{documentName:n}=Tde(t.readVarString());t.writeVarString(this.effectiveName),this.emit(`message`,{event:e,message:new G0(e.data)}),new bfe(t).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&H0(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit(`destroy`),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(H0(this.awareness,[this.document.clientID],`provider destroy`),this.awareness.off(`update`,this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off(`update`,this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>`u`||!(`removeEventListener`in window))&&window.removeEventListener(`pagehide`,this.boundPageHide)}detach(){this.configuration.websocketProvider.off(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.off(`connect`,this.forwardConnect),this.configuration.websocketProvider.off(`status`,this.forwardStatus),this.configuration.websocketProvider.off(`status`,this.configuration.onStatus),this.configuration.websocketProvider.off(`open`,this.boundOnOpen),this.configuration.websocketProvider.off(`close`,this.boundOnClose),this.configuration.websocketProvider.off(`close`,this.configuration.onClose),this.configuration.websocketProvider.off(`close`,this.forwardClose),this.configuration.websocketProvider.off(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.off(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.off(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.off(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||=(this.configuration.websocketProvider.on(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.on(`connect`,this.forwardConnect),this.configuration.websocketProvider.on(`status`,this.configuration.onStatus),this.configuration.websocketProvider.on(`status`,this.forwardStatus),this.configuration.websocketProvider.on(`open`,this.boundOnOpen),this.configuration.websocketProvider.on(`close`,this.boundOnClose),this.configuration.websocketProvider.on(`close`,this.configuration.onClose),this.configuration.websocketProvider.on(`close`,this.forwardClose),this.configuration.websocketProvider.on(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.on(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.on(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.on(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.attach(this),!0)}permissionDeniedHandler(e){this.emit(`authenticationFailed`,{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit(`authenticated`,{scope:e})}setAwarenessField(e,t){if(!this.awareness)throw new Efe(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}};function n2(e){return!(e.viewCount>0&&e.viewCount>=50||e.bytes>5e5)}var r2=new Map,i2=new Map,a2=[],o2=[],s2=new Set,c2=null;function l2(){if(c2)return c2;if(typeof document>`u`||typeof document.createElement!=`function`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,c2=e,e}function Dfe(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!n2(i)){let e=r(n);return vl(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=r2.get(t);if(a){if(jfe(a,n),a.activeMountKey=t,m2(a2,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return vl(`ok/cache/hit`,{docName:t,kind:`tiptap`}),i&&vl(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;r2.size>=10;){let e=h2(a2,t);if(!e)break;u2(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return r2.set(t,s),m2(a2,t),vl(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&vl(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function Ofe(e){if(e.__uncached){try{e.editor.destroy()}catch{}e.activeMountKey=null;return}let t=f2(e.editor);if(t){e.hadFocus=p2(t.dom),e.scrollTop=(t.scrollDOM??t.dom.parentElement??t.dom).scrollTop??0;let n=t.dom.parentElement;n&&n.removeChild(t.dom);let r=l2();r&&r.appendChild(t.dom)}e.activeMountKey=null}function u2(e){let t=r2.get(e);if(!t)return!1;try{t.editor.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}r2.delete(e);let n=a2.indexOf(e);return n!==-1&&a2.splice(n,1),vl(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function kfe(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!n2(i)){let e=r(n);return vl(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=i2.get(t);if(a){if(Mfe(a,n),a.activeMountKey=t,m2(o2,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return vl(`ok/cache/hit`,{docName:t,kind:`cm`}),i&&vl(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;i2.size>=10;){let e=h2(o2,t);if(!e)break;d2(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return i2.set(t,s),m2(o2,t),vl(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&vl(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Afe(e){if(e.__uncached){try{e.view.destroy()}catch{}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=p2(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t);let r=l2();r&&r.appendChild(t),e.activeMountKey=null}function d2(e){let t=i2.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){vl(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}i2.delete(e);let n=o2.indexOf(e);return n!==-1&&o2.splice(n,1),vl(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function f2(e){return e.editorView??null}function p2(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function jfe(e,t){let n=f2(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function Mfe(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function m2(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function h2(e,t){for(let n of e)if(n!==t&&!s2.has(n))return n;vl(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:s2.size});for(let n of e)if(n!==t)return n;return null}function Nfe(e){let t=s2,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=g2(e);if(t)try{t.disconnect(),vl(`ok/cache/disconnect`,{docName:e})}catch(t){vl(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=g2(e);if(!n)continue;let r=t=>{vl(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>vl(`ok/cache/connect`,{docName:e}),e=>r(e)):vl(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}s2=n}function g2(e){let t=r2.get(e);if(t)return t.provider;let n=i2.get(e);return n?n.provider:null}var Pfe=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new qd({key:e||new Xd(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),Ffe=W_.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[Pfe({key:new Xd(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),_2=new Xd(`imageUpload`);function Ife(){let e=document.createElement(`div`);return e.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,e.setAttribute(`data-upload-widget`,`loading`),e.setAttribute(`role`,`status`),e.setAttribute(`aria-label`,`Uploading image...`),e}var Lfe=new qd({key:_2,state:{init(){return{decorations:ng.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(_2);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=$h.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return _2.getState(e)?.decorations??ng.empty}}}),v2=null;function Rfe(e){v2=e}async function y2(e,t,n){let r=v2?`${v2}.md`:``;if(!r){Mn.error(`Cannot upload: no document is open`);return}let i=crypto.randomUUID(),a=Ife();t.view.dispatch(t.state.tr.setMeta(_2,{type:`add`,id:i,pos:n,widget:a}));let o=new FormData;o.append(`file`,e),o.append(`parentDocName`,r);let s;try{s=await fetch(`/api/upload-image`,{method:`POST`,body:o})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),b2(t,i);return}if(!s.ok){let e=`Upload failed (${s.status})`;try{let t=await s.json();t.error&&(e=t.error)}catch{}console.error(`[uploadAndInsert] Server error:`,e),b2(t,i,e);return}let c;try{let e=await s.json();if(typeof e.src!=`string`)throw Error(`missing src in response`);c=e.src}catch(e){console.error(`[uploadAndInsert] Response parse error:`,e),b2(t,i);return}let l=e.name.replace(/\.[^.]+$/,``),{state:u}=t,d=_2.getState(u)?.uploads.get(i)??n,f=u.schema.nodes.image;if(!f){console.error(`[uploadAndInsert] Image node type not found in schema`),b2(t,i);return}let p=u.tr.setMeta(_2,{type:`remove`,id:i}).insert(d,f.create({src:c,alt:l}));t.view.dispatch(p)}function b2(e,t,n){e.view.dispatch(e.state.tr.setMeta(_2,{type:`remove`,id:t})),Mn.error(n??`Upload failed`)}function x2(e){let{$from:t}=e.selection;return t.depth===0?null:{from:t.before(1),to:t.after(1)}}function zfe(e,t){let n=x2(e);if(!n)return!1;let{from:r,to:i}=n;if(r===0)return!1;let a=e.doc.resolve(r-1);if(a.depth===0)return!1;let o=a.before(1),s=e.doc.slice(r,i).content,c=e.doc.slice(o,r).content;if(!t)return!0;let l=e.tr;l.replaceWith(o,i,s.append(c));let u=o+1,d=o+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(kd.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}function Bfe(e,t){let n=x2(e);if(!n)return!1;let{from:r,to:i}=n;if(i>=e.doc.content.size)return!1;let a=e.doc.resolve(i+1);if(a.depth===0)return!1;let o=a.after(1),s=e.doc.slice(r,i).content,c=e.doc.slice(i,o).content;if(!t)return!0;let l=e.tr;l.replaceWith(r,o,c.append(s));let u=r+c.size+1,d=r+c.size+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(kd.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}var Vfe=W_.create({name:`blockMover`,addKeyboardShortcuts(){return{"Mod-Shift-ArrowUp":({editor:e})=>zfe(e.state,e.view.dispatch),"Mod-Shift-ArrowDown":({editor:e})=>Bfe(e.state,e.view.dispatch)}}});function S2(e){return!!e.getMeta(VD)}function Hfe(e,t){let n=VD.getState(e);return lO(n.doc,n.type,t,n.binding.mapping)||0}function C2(e,t){let n=VD.getState(e);return cO(t,n.type,n.binding.mapping)}var w2=class e extends j_{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function Ufe(e,t){return new w2(e,C2(t,e))}function Wfe(e,t,n){let r=e instanceof w2?e.yRelativePosition:null;if(S2(t)&&r)return{position:new w2(Hfe(n,r),r),mapResult:null};let i=M_(e,t),a=i.position.position;return{position:new w2(a,r??C2(n,a)),mapResult:i.mapResult}}var Gfe=W_.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>Wfe(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>Ufe(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),HD.getState(t).undoManager.undoStack.length===0?!1:n?Soe(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),HD.getState(t).undoManager.redoStack.length===0?!1:n?Coe(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=Eoe(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=HD.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[noe(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new qd({key:new Xd(`filterInvalidContent`),filterTransaction:t=>{if(!S2(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function T2(e){if(!e.length)return ng.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push($h.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),ng.create(n,t)}function Kfe(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function E2(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new Vl(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=Kfe(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new Ed(a.resolve(l),a.resolve(u));i.push(p)}),i}var qfe=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new D2(e.resolve(this.anchor),e.resolve(this.head))}},D2=class e extends Td{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=E2(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new qfe(this.anchor,this.head)}};D2.prototype.visible=!1;function O2(e){return e instanceof D2}W_.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!O2(a)){let e=D2.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!O2(a)){let e=D2.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=D2.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;O2(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new qd({key:new Xd(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=D2.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=O2(r);if(e=!1,!t)return i?(e=!0,T2(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=E2(a,o,this.options.depth);return s.length?(e=!0,T2(s)):null}}})]}});function Jfe(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function Yfe(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=Jfe(e)}),t}var Xfe=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],k2={edges:[`left`,`top`],threshold:12,strength:500};function A2(e){return e===void 0||e===`left`?{...k2}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...k2,...e}}function Zfe(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function Qfe(e,t,n,r){return!t||n.edges.length===0?0:Zfe(e,t,n)?n.strength*r:0}var $fe=1e3;function j2(e,t,n,r){let i=$fe,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=Qfe(r,o,n,e.depth),i<=0?-1:i}function M2(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function epe(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...Xfe),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!M2(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=j2({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=M2(a,l,n.allowedContainers)),p){let r=j2({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function tpe(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function N2(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function npe(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!N2(s)||!N2(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var P2=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=npe(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=epe(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=tpe(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function rpe(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function F2(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function ipe(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=P2({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return E2(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function ape(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=ipe(e,t,n,r),l=E2(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,rpe(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=jd.create(i.state.doc,m)):(v=D2.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=Yfe(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,document.body.append(p),e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=e.clientX-y.left;e.dataTransfer.setDragImage(p,Math.max(0,Math.min(b,y.width)),0);let x=!1,S=()=>{x||(x=!0,F2(p),document.removeEventListener(`drop`,S),document.removeEventListener(`dragend`,S))},C=v instanceof jd?v:void 0;i.dragging={slice:_,move:!0,node:C},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,S),document.addEventListener(`dragend`,S)}var I2=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},L2=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},R2=(e,t)=>{let n=VD.getState(e);return n?cO(t,n.type,n.binding.mapping):null},ope=(e,t)=>{let n=VD.getState(e);return n?lO(n.doc,n.type,t,n.binding.mapping)||0:-1},z2=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},spe=new Xd(`dragHandle`),B2=({pluginKey:e=spe,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){Ks(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),ape(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function b(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function x(){if(uv()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new qd({key:typeof e==`string`?new Xd(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(S2(e)){let e=ope(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=R2(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,b),document.addEventListener(`drop`,x),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=z2(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=L2(n.state.doc,s),l=I2(n.state.doc,s);d=c,f=l,p=R2(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null),t&&F2(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=P2({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=z2(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=L2(n.state.doc,t),l=I2(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=R2(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function V2(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:A2(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:A2(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:A2(e.edgeDetection)}}var cpe={placement:`left-start`,strategy:`absolute`};W_.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=V2(this.options.nested);return[B2({computePositionConfig:{...cpe,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var lpe=20,upe=44,dpe=28;function fpe(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`div`);return n.className=`ok-drag-grip`,n.setAttribute(`aria-hidden`,`true`),n.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t}}function ppe(e,t,n){let{state:r,view:i}=e,a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=kd.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var mpe=W_.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i}=fpe();return i.addEventListener(`click`,()=>{t&&n>=0&&ppe(e,n,t)}),[B2({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[Ls(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=upe?e.reference.height:dpe)-lpe)/2}))]},nestedOptions:V2(!1)}).plugin]}});function H2(e){let t=e.trim();if(!t)return null;let n=L1(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function U2(e){let t=e.trim();if(!t)return[];let n=L1(t);return n.length>0&&n!==t?[n]:[]}function W2(e,t){let n=e.trim();return n?t.has(n)?!0:U2(n).some(e=>t.has(e)):!1}var hpe=W_.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new qd({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=due(e.textContent,n);if(!i)return;t.push($h.node(r,r+e.nodeSize,{id:i}))}}),ng.create(e.doc,t)}}})]}});function gpe(e){if(!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function G2(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}var _pe=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function K2(e){try{let t=new URL(e);return _pe.has(t.protocol)}catch{return!1}}function q2(e=window.location.hash){let t=e.match(/^#\/([^?#]+)/);return t?decodeURIComponent(t[1]):``}function J2(e,t=window.location.hash){return X1(e,q2(t))}function Y2({docName:e,anchor:t}){return t?`#/${e}?anchor=${encodeURIComponent(t)}`:`#/${e}`}function X2(e){e.startsWith(`#`)||K2(e)?window.open(e,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,e)}function vpe(e){window.location.assign(Y2(e))}function Z2(e){X2(Y2(e))}function ype(e){return e.metaKey||e.ctrlKey}function bpe(e,t=window.location.hash){let n=q2(t);if(!n)return;let r=document.getElementById(e);r&&r.scrollIntoView({behavior:`smooth`,block:`start`}),window.location.assign(G2(n,e))}function Q2(e,t=window.location.hash){if(e.kind===`doc`){vpe(e);return}if(e.kind===`anchor`){bpe(e.anchor,t);return}X2(e.url)}function $2(e,t,n=window.location.hash){return Nue(q2(n),e,t)}var e4=e=>{let t=(0,gn.c)(13),{kind:n,ariaLabel:r,onDeactivate:i,children:a,layout:o,className:s,"data-slot":c}=e,l=(o===void 0?`standard`:o)===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,u;t[0]!==s||t[1]!==l?(u=_l(`ok-interaction-prop-panel pointer-events-auto absolute left-1/2 top-2 z-40 -translate-x-1/2 rounded-md border border-border bg-popover p-3 shadow-lg`,l,s),t[0]=s,t[1]=l,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(nr,{className:`size-3.5`,"aria-hidden":`true`}),t[3]=d):d=t[3];let f;t[4]===i?f=t[5]:(f=(0,B.jsx)(mO,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:i,className:`absolute right-1 top-1 size-7`,children:d}),t[4]=i,t[5]=f);let p;return t[6]!==r||t[7]!==a||t[8]!==c||t[9]!==n||t[10]!==u||t[11]!==f?(p=(0,B.jsxs)(`div`,{role:`dialog`,"aria-label":r,"data-ok-prop-panel":n,"data-slot":c,className:u,children:[a,f]}),t[6]=r,t[7]=a,t[8]=c,t[9]=n,t[10]=u,t[11]=f,t[12]=p):p=t[12],p};function t4(e,t){let n=[e,...t.fallbackTargets??[]],r=new Set,i=null;for(let e of n){if(r.has(e))continue;r.add(e);let n=wO(e,{pages:t.pages,folderPaths:t.folderPaths});if(n.kind===`missing`){i??=n;continue}return{kind:`navigate`,displayState:n.kind===`folder`?`folder`:`resolved`,resolvedTarget:n,hashDocName:n.target}}let a=i??wO(e,{pages:t.pages,folderPaths:t.folderPaths});if(a.kind!==`missing`)return{kind:`navigate`,displayState:a.kind===`folder`?`folder`:`resolved`,resolvedTarget:a,hashDocName:a.target};let o=t.createDialogSeed??joe(a.target);return{kind:`create`,displayState:`missing`,resolvedTarget:a,initialDir:o.initialDir,suggestedName:o.suggestedName}}function n4(e){if(e.kind!==`navigate`||e.displayState!==`folder`)return null;let t=e.resolvedTarget;return`folderPath`in t?{initialDir:t.folderPath,suggestedName:`index.md`}:null}var r4=null,i4=new Set;function a4(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function xpe(e,t){return e===null?!1:e===t?!0:a4(e.pages,t.pages)&&a4(e.folderPaths,t.folderPaths)}function Spe(){return r4}function Cpe(e){if(!xpe(r4,e)){r4=e;for(let t of[...i4])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function wpe(e){if(i4.add(e),r4!==null)try{e(r4)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{i4.delete(e)}}var o4=`open-knowledge:documents-changed`;function Tpe(e){return[...new Set(e)]}function s4(e=[`files`]){window.dispatchEvent(new CustomEvent(o4,{detail:{channels:Tpe(e)}}))}function c4(e){let t=t=>{e((t instanceof CustomEvent?t.detail?.channels:void 0)??[`files`])};return window.addEventListener(o4,t),()=>window.removeEventListener(o4,t)}var l4=(0,z.createContext)(null);function Epe(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function Dpe(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Ope(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function kpe(){let e=await fetch(`/api/pages`);if(!e.ok)throw Error(`/api/pages responded with ${e.status}`);let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}function Ape(e){console.error(`[PageListContext] Failed to load pages:`,e)}function jpe(e){let t=(0,gn.c)(33),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,z.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,z.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,z.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,z.useState)(f),[h,g]=(0,z.useState)(!0),[_,v]=(0,z.useState)(null),y=(0,z.useRef)(0),b;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){let e=y.current+=1;g(!0),kpe().then(t=>{if(e!==y.current)return;let n=new Set(t.map(Ppe));a(n),c(new Map(t.map(Npe))),d(new Map(t.map(Mpe))),m(e=>Dpe(e,n)),v(null)}).catch(t=>{e===y.current&&(Ape(t),v(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===y.current&&g(!1)})},t[4]=b):b=t[4];let x=b,S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){m(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),v(null)},t[5]=S):S=t[5];let C=S,w,T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{x();let e=()=>{document.visibilityState===`visible`&&x()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=c4(e=>{e.includes(`files`)&&x()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},T=[],t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,z.useEffect)(w,T);let E,D,O,k;if(t[8]!==p||t[9]!==u||t[10]!==s||t[11]!==i){O=Epe(i,p);let e;t[16]!==p||t[17]!==s?(e=Ope(s,p),t[16]=p,t[17]=s,t[18]=e):e=t[18],D=e,E=u,k=CO(O),t[8]=p,t[9]=u,t[10]=s,t[11]=i,t[12]=E,t[13]=D,t[14]=O,t[15]=k}else E=t[12],D=t[13],O=t[14],k=t[15];let A=k,j,M;t[19]!==A||t[20]!==O?(j=()=>{Cpe({pages:O,folderPaths:A})},M=[O,A],t[19]=A,t[20]=O,t[21]=j,t[22]=M):(j=t[21],M=t[22]),(0,z.useEffect)(j,M);let N;t[23]!==_||t[24]!==A||t[25]!==h||t[26]!==E||t[27]!==D||t[28]!==O?(N={pages:O,pageTitles:D,pageMeta:E,folderPaths:A,loading:h,error:_,refetch:x,addPage:C},t[23]=_,t[24]=A,t[25]=h,t[26]=E,t[27]=D,t[28]=O,t[29]=N):N=t[29];let P;return t[30]!==n||t[31]!==N?(P=(0,B.jsx)(l4,{value:N,children:n}),t[30]=n,t[31]=N,t[32]=P):P=t[32],P}function Mpe(e){return[e.docName,{size:e.size,modified:e.modified}]}function Npe(e){return[e.docName,e.title]}function Ppe(e){return e.docName}function u4(){let e=(0,z.use)(l4);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function d4(e){let t=(0,gn.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=_l(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,B.jsx)(`input`,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function f4(e){return e.trim()?e.includes(`..`)?`Path cannot contain ".."`:e.startsWith(`/`)?`Path cannot start with "/"`:e.includes(`\\`)?`Path cannot contain backslashes`:e.includes(`\0`)?`Path cannot contain null bytes`:null:`Name cannot be empty`}function Fpe(e){return e.endsWith(`.md`)?e:`${e}.md`}function Ipe(e){let t=Fpe(e.fileName.trim());if(e.kind===`folder`){let n=(e.folderName??``).trim();return`${e.initialDir?`${e.initialDir}/${n}`:n}/${t}`}return e.initialDir?`${e.initialDir}/${t}`:t}function Lpe(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&e.altKey&&e.key.toLowerCase()===`n`)}function Rpe(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function p4(e){let t=(0,gn.c)(87),{open:n,onOpenChange:r,kind:i,initialDir:a,suggestedName:o,description:s,onCreated:c}=e,{addPage:l}=u4(),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(``),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(!1),[v,y]=(0,z.useState)(null),b=(0,z.useId)(),x=(0,z.useId)(),S=(0,z.useId)(),C=(0,z.useRef)(null),w=(0,z.useRef)(null),T,E;t[0]!==i||t[1]!==n||t[2]!==o?(T=()=>{n&&(h(null),y(null),_(!1),p(``),d(i===`file`?o??`untitled.md`:`index.md`))},E=[n,i,o],t[0]=i,t[1]=n,t[2]=o,t[3]=T,t[4]=E):(T=t[3],E=t[4]),(0,z.useEffect)(T,E);let D;t[5]!==u||t[6]!==f||t[7]!==a||t[8]!==i?(D=function(){return Ipe({kind:i,initialDir:a,fileName:u,folderName:f})},t[5]=u,t[6]=f,t[7]=a,t[8]=i,t[9]=D):D=t[9];let O=D,k;t[10]!==u||t[11]!==f||t[12]!==i?(k=function(){if(i===`folder`){let e=f4(f.trim());if(e)return{message:`Folder name: ${e}`,field:`folder`}}let e=f4(u.trim());return e?{message:e,field:`file`}:null},t[10]=u,t[11]=f,t[12]=i,t[13]=k):k=t[13];let A=k,j;t[14]!==g||t[15]!==u||t[16]!==f||t[17]!==i?(j=g||!u.trim()||i===`folder`&&!f.trim(),t[14]=g,t[15]=u,t[16]=f,t[17]=i,t[18]=j):j=t[18];let M=j,N;t[19]!==l||t[20]!==O||t[21]!==A||t[22]!==i||t[23]!==c||t[24]!==r?(N=async function(){let e=A();if(e){h(e.message),y(e.field);return}_(!0),h(null),y(null);let t=O();try{let e=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t})});if(!e.ok){let t=`Server error (HTTP ${e.status})`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}_(!1),h(t),y(`form`);return}let n=await e.json();if(_(!1),!n.ok){h(n.error??`Failed to create ${i}`),y(`form`);return}let a=n.docName??t.replace(/\.md$/,``);r(!1),window.location.hash=`#/${a}`,l(a),s4([`files`,`backlinks`,`graph`]),c?.(a)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),_(!1),h(`Network error — please try again`),y(`form`)}},t[19]=l,t[20]=O,t[21]=A,t[22]=i,t[23]=c,t[24]=r,t[25]=N):N=t[25];let P=N,F=a||`(root)`,I=i===`file`?`New file`:`New folder`,ee;t[26]===I?ee=t[27]:(ee=(0,B.jsx)(yO,{children:I}),t[26]=I,t[27]=ee);let te;t[28]!==s||t[29]!==F?(te=s??(0,B.jsxs)(B.Fragment,{children:[`Create in `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:F})]}),t[28]=s,t[29]=F,t[30]=te):te=t[30];let ne;t[31]===te?ne=t[32]:(ne=(0,B.jsx)(bO,{children:te}),t[31]=te,t[32]=ne);let re;t[33]!==ee||t[34]!==ne?(re=(0,B.jsxs)(_O,{children:[ee,ne]}),t[33]=ee,t[34]=ne,t[35]=re):re=t[35];let L;t[36]!==m||t[37]!==v||t[38]!==b||t[39]!==x||t[40]!==f||t[41]!==i?(L=i===`folder`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:x,children:`Folder name`}),(0,B.jsx)(d4,{ref:w,id:x,value:f,onChange:e=>{p(e.target.value),h(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":m&&(v===`folder`||v===`form`)?b:void 0,"aria-invalid":m&&(v===`folder`||v===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=f4(f.trim());if(t){h(`Folder name: ${t}`),y(`folder`);return}C.current?.focus()}}})]}),t[36]=m,t[37]=v,t[38]=b,t[39]=x,t[40]=f,t[41]=i,t[42]=L):L=t[42];let ie=i===`folder`?`First file name`:`File name`,ae;t[43]!==S||t[44]!==ie?(ae=(0,B.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:S,children:ie}),t[43]=S,t[44]=ie,t[45]=ae):ae=t[45];let oe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(oe=e=>{d(e.target.value),h(null)},t[46]=oe):oe=t[46];let se=i===`file`,ce=m&&(v===`file`||v===`form`)?b:void 0,le=m&&(v===`file`||v===`form`)?!0:void 0,R;t[47]!==P||t[48]!==M?(R=e=>{e.key===`Enter`&&!M&&P()},t[47]=P,t[48]=M,t[49]=R):R=t[49];let ue;t[50]!==S||t[51]!==u||t[52]!==se||t[53]!==ce||t[54]!==le||t[55]!==R?(ue=(0,B.jsx)(d4,{ref:C,id:S,value:u,onChange:oe,placeholder:`my-note.md`,autoFocus:se,"aria-describedby":ce,"aria-invalid":le,onFocus:zpe,onKeyDown:R}),t[50]=S,t[51]=u,t[52]=se,t[53]=ce,t[54]=le,t[55]=R,t[56]=ue):ue=t[56];let de;t[57]!==ae||t[58]!==ue?(de=(0,B.jsxs)(`div`,{children:[ae,ue]}),t[57]=ae,t[58]=ue,t[59]=de):de=t[59];let fe;t[60]!==m||t[61]!==b?(fe=m&&(0,B.jsx)(`p`,{id:b,role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:m}),t[60]=m,t[61]=b,t[62]=fe):fe=t[62];let pe;t[63]!==L||t[64]!==de||t[65]!==fe?(pe=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[L,de,fe]}),t[63]=L,t[64]=de,t[65]=fe,t[66]=pe):pe=t[66];let me;t[67]===r?me=t[68]:(me=()=>r(!1),t[67]=r,t[68]=me);let he;t[69]!==g||t[70]!==me?(he=(0,B.jsx)(mO,{variant:`outline`,className:`font-mono uppercase`,onClick:me,disabled:g,children:`Cancel`}),t[69]=g,t[70]=me,t[71]=he):he=t[71];let ge=g?`Creating...`:`Create`,_e;t[72]!==P||t[73]!==M||t[74]!==ge?(_e=(0,B.jsx)(mO,{onClick:P,disabled:M,children:ge}),t[72]=P,t[73]=M,t[74]=ge,t[75]=_e):_e=t[75];let ve;t[76]!==he||t[77]!==_e?(ve=(0,B.jsxs)(vO,{children:[he,_e]}),t[76]=he,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==re||t[80]!==pe||t[81]!==ve?(ye=(0,B.jsxs)(gO,{className:`sm:max-w-md`,"data-ok-layer-spawned":``,children:[re,pe,ve]}),t[79]=re,t[80]=pe,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==r||t[84]!==n||t[85]!==ye?(be=(0,B.jsx)(hO,{open:n,onOpenChange:r,children:ye}),t[83]=r,t[84]=n,t[85]=ye,t[86]=be):be=t[86],be}function zpe(e){return Rpe(e.currentTarget)}var Bpe=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function m4(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}var Vpe=e=>{let t=(0,gn.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,z.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,z.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,B.jsxs)(B.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function h4(e){return e.editorView?.dom??e.view?.dom??null}function Hpe(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function Upe(e){let{editor:t}=e,n=new Bpe,r=h4(t),i=!1,a=null,o=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;a=t&&Hpe(t,e)?t:null}return}if(typeof document>`u`)return;let i=a;if(a=null,i&&document.contains(i)&&typeof i.focus==`function`){try{i.focus({preventScroll:!0})}catch{}return}let o=r??h4(t);if(o&&typeof o.focus==`function`)try{o.focus({preventScroll:!0})}catch{}}),s=e=>{let t=e;if(t.button===2)return;if(t.metaKey||t.ctrlKey||t.button===1){t.button===1&&t.preventDefault?.();return}let r=m4(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1})||n.setActiveNode(r)},c=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1||!(t.metaKey||t.ctrlKey||t.button===1))return;let r=m4(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!0})&&t.preventDefault?.()},l=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(n.setActiveNode(null),t.preventDefault?.());return}if(t.key!==`Enter`&&t.key!==` `&&t.key!==`Spacebar`)return;let r=m4(e.target,n);if(r===null)return;let i=n.getRegistration(r);t.preventDefault?.(),!(i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1}))&&n.setActiveNode(r)},u=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||n.setActiveNode(null))},d=()=>{i||(r=h4(t),r&&(r.addEventListener(`pointerdown`,s,!0),r.addEventListener(`click`,c,!0),r.addEventListener(`auxclick`,c,!0),r.addEventListener(`keydown`,l,!0),typeof document<`u`&&document.addEventListener(`pointerdown`,u,!0),i=!0))},f=()=>{i&&=(r?.removeEventListener(`pointerdown`,s,!0),r?.removeEventListener(`click`,c,!0),r?.removeEventListener(`auxclick`,c,!0),r?.removeEventListener(`keydown`,l,!0),typeof document<`u`&&document.removeEventListener(`pointerdown`,u,!0),!1)};return d(),{register(e){n.register(e),i||d()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){f(),o(),n.clear()},store:n}}var Wpe=e=>{let t=(0,gn.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,B.jsx)(Vpe,{store:n})}),t[0]=n,t[1]=r),r},g4=new WeakMap;function _4(e){let t=g4.get(e);if(t)return t;let n=Upe({editor:e});return g4.set(e,n),e.on(`destroy`,()=>{n.destroy(),g4.delete(e)}),n}var v4=new Xd(`markIdentity`);function Gpe(){return{byId:new Map,counter:0}}function y4(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&b4(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function b4(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&!(typeof n==`object`&&n&&typeof i==`object`&&i&&b4(n,i)))return!1}return!0}function Kpe(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function qpe(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new qd({key:v4,state:{init(e,t){return y4(t.doc,Gpe(),a,n)},apply(e,t,r,i){return e.docChanged?y4(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=v4.getState(t.state);n&&(e=Kpe(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}function x4(e,t){return v4.getState(e)?.byId.get(t)??null}function Jpe(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function Ype(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=Jpe({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return qpe({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function Xpe(e){let t=_4(e.editor);return Ype({...e,layer:t})}function Zpe(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=lv(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function Qpe(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
288
+ `);return/\s/.test(n)}):!1}var $pe=new Xd(`suggestion`);function eme({pluginKey:e=$pe,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=Zpe,shouldShow:g,shouldResetDismissed:_}){let v,y=p?.(),b=r&&!i,x=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},S=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,C=({match:e,dismissedRange:n,state:r,transaction:i})=>_?.({editor:t,state:r,range:n,match:e,transaction:i,allowSpaces:b})?!1:b?e.range.from===n.from:e.range.from===n.from&&!Qpe(i);function w(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:S(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let T=new qd({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,g=p||u&&h,_=h||u,b=m||u&&h;if(!g&&!_&&!b)return;let x=b&&!g?c:l,C=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>d({editor:t,range:x.range,props:e}),decorationNode:C,clientRect:S(e,C)},g&&((r=y?.onBeforeStart)==null||r.call(y,v)),_&&((i=y?.onBeforeUpdate)==null||i.call(y,v)),(_||g)&&(v.items=await f({editor:t,query:x.query})),b&&((a=y?.onExit)==null||a.call(y,v)),_&&((o=y?.onUpdate)==null||o.call(y,v)),g&&((s=y?.onStart)==null||s.call(y,v))},destroy:()=>{var e;v&&((e=y?.onExit)==null||e.call(y,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=c.active?{...c.range}:c.dismissedRange,y;if(y.composing=f,s.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:s.mapping.map(y.dismissedRange.from),to:s.mapping.map(y.dismissedRange.to)}),d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.dismissedRange!==null&&!C({match:e,dismissedRange:y.dismissedRange,state:u,transaction:s})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1):(e||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,n){var r;let{active:i,range:a}=T.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=T.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),w(t,e),!0}return(y?.onKeyDown)?.call(y,{view:t,event:n,range:a})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=T.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),ng.create(e.doc,[$h.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return T}var S4=eme,C4=Ze(Je(((e,t)=>{((e,n)=>{typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.fuzzysort=n()})(e,e=>{var t=(e,t)=>{if(!e||!t)return F;var n=p(e);j(t)||(t=f(t));var r=n.bitflags;return(r&t._bitflags)===r?h(n,t):F},n=(e,t,n)=>{if(!e)return n?.all?m(t,n):P;var r=p(e),i=r.bitflags,a=r.containsSpace,o=u(n?.threshold||0),c=n?.limit||M,l=0,d=0,g=t.length;function _(e){l<c?(ee.add(e),++l):(++d,e._score>ee.peek()._score&&ee.replaceTop(e))}if(n?.key)for(var v=n.key,y=0;y<g;++y){var b=t[y],x=A(b,v);if(x&&(j(x)||(x=f(x)),(i&x._bitflags)===i)){var S=h(r,x);S!==F&&(S._score<o||(S.obj=b,_(S)))}}else if(n?.keys){var C=n.keys,w=C.length;outer:for(var y=0;y<g;++y){for(var b=t[y],T=0,te=0;te<w;++te){var v=C[te],x=A(b,v);if(!x){O[te]=I;continue}j(x)||(x=f(x)),O[te]=x,T|=x._bitflags}if((i&T)===i){if(a)for(let e=0;e<r.spaceSearches.length;e++)E[e]=N;for(var te=0;te<w;++te){if(x=O[te],x===I){k[te]=I;continue}if(k[te]=h(r,x,!1,a),k[te]===F){k[te]=I;continue}if(a)for(let e=0;e<r.spaceSearches.length;e++){if(D[e]>-1e3&&E[e]>N){var ne=(E[e]+D[e])/4;ne>E[e]&&(E[e]=ne)}D[e]>E[e]&&(E[e]=D[e])}}if(a){for(let e=0;e<r.spaceSearches.length;e++)if(E[e]===N)continue outer}else{var re=!1;for(let e=0;e<w;e++)if(k[e]._score!==N){re=!0;break}if(!re)continue}var L=new s(w);for(let e=0;e<w;e++)L[e]=k[e];if(a){var ie=0;for(let e=0;e<r.spaceSearches.length;e++)ie+=E[e]}else{var ie=N;for(let e=0;e<w;e++){var S=L[e];if(S._score>-1e3&&ie>N){var ne=(ie+S._score)/4;ne>ie&&(ie=ne)}S._score>ie&&(ie=S._score)}}if(L.obj=b,L._score=ie,n?.scoreFn){if(ie=n.scoreFn(L),!ie)continue;ie=u(ie),L._score=ie}ie<o||_(L)}}}else for(var y=0;y<g;++y){var x=t[y];if(x&&(j(x)||(x=f(x)),(i&x._bitflags)===i)){var S=h(r,x);S!==F&&(S._score<o||_(S))}}if(l===0)return P;for(var ae=Array(l),y=l-1;y>=0;--y)ae[y]=ee.poll();return ae.total=l+d,ae},r=(e,t=`<b>`,n=`</b>`)=>{for(var r=typeof t==`function`?t:void 0,i=e.target,a=i.length,o=e.indexes,s=``,c=0,l=0,u=!1,d=[],f=0;f<a;++f){var p=i[f];if(o[l]===f){if(++l,u||(u=!0,r?(d.push(s),s=``):s+=t),l===o.length){r?(s+=p,d.push(r(s,c++)),s=``,d.push(i.substr(f+1))):s+=p+n+i.substr(f+1);break}}else u&&(u=!1,r?(d.push(r(s,c++)),s=``):s+=n);s+=p}return r?d:s},i=e=>{typeof e==`number`?e=``+e:typeof e!=`string`&&(e=``);var t=v(e);return c(e,{_targetLower:t._lower,_targetLowerCodes:t.lowerCodes,_bitflags:t.bitflags})},a=()=>{x.clear(),S.clear()};class o{get indexes(){return this._indexes.slice(0,this._indexes.len).sort((e,t)=>e-t)}set indexes(e){return this._indexes=e}highlight(e,t){return r(this,e,t)}get score(){return l(this._score)}set score(e){this._score=u(e)}}class s extends Array{get score(){return l(this._score)}set score(e){this._score=u(e)}}var c=(e,t)=>{let n=new o;return n.target=e,n.obj=t.obj??F,n._score=t._score??N,n._indexes=t._indexes??[],n._targetLower=t._targetLower??``,n._targetLowerCodes=t._targetLowerCodes??F,n._nextBeginningIndexes=t._nextBeginningIndexes??F,n._bitflags=t._bitflags??0,n},l=e=>e===N?0:e>1?e:Math.E**(((-e+1)**.04307-1)*-2),u=e=>e===0?N:e>1?e:1-(Math.log(e)/-2+1)**(1/.04307),d=e=>{typeof e==`number`?e=``+e:typeof e!=`string`&&(e=``),e=e.trim();var t=v(e),n=[];if(t.containsSpace){var r=e.split(/\s+/);r=[...new Set(r)];for(var i=0;i<r.length;i++)if(r[i]!==``){var a=v(r[i]);n.push({lowerCodes:a.lowerCodes,_lower:r[i].toLowerCase(),containsSpace:!1})}}return{lowerCodes:t.lowerCodes,_lower:t._lower,containsSpace:t.containsSpace,bitflags:t.bitflags,spaceSearches:n}},f=e=>{if(e.length>999)return i(e);var t=x.get(e);return t===void 0?(t=i(e),x.set(e,t),t):t},p=e=>{if(e.length>999)return d(e);var t=S.get(e);return t===void 0?(t=d(e),S.set(e,t),t):t},m=(e,t)=>{var n=[];n.total=e.length;var r=t?.limit||M;if(t?.key)for(var i=0;i<e.length;i++){var a=e[i],o=A(a,t.key);if(o!=F){j(o)||(o=f(o));var l=c(o.target,{_score:o._score,obj:a});if(n.push(l),n.length>=r)return n}}else if(t?.keys)for(var i=0;i<e.length;i++){for(var a=e[i],u=new s(t.keys.length),d=t.keys.length-1;d>=0;--d){var o=A(a,t.keys[d]);if(!o){u[d]=I;continue}j(o)||(o=f(o)),o._score=N,o._indexes.len=0,u[d]=o}if(u.obj=a,u._score=N,n.push(u),n.length>=r)return n}else for(var i=0;i<e.length;i++){var o=e[i];if(o!=F&&(j(o)||(o=f(o)),o._score=N,o._indexes.len=0,n.push(o),n.length>=r))return n}return n},h=(e,t,n=!1,r=!1)=>{if(n===!1&&e.containsSpace)return g(e,t,r);for(var i=e._lower,a=e.lowerCodes,s=a[0],c=t._targetLowerCodes,l=a.length,u=c.length,d=0,f=0,p=0;;){var m=s===c[f];if(m){if(C[p++]=f,++d,d===l)break;s=a[d]}if(++f,f>=u)return F}var d=0,h=!1,_=0,v=t._nextBeginningIndexes;v===F&&(v=t._nextBeginningIndexes=b(t.target)),f=C[0]===0?0:v[C[0]-1];var y=0;if(f!==u)for(;;)if(f>=u){if(d<=0||(++y,y>200))break;--d;var x=w[--_];f=v[x]}else{var m=a[d]===c[f];if(m){if(w[_++]=f,++d,d===l){h=!0;break}++f}else f=v[f]}var S=l<=1?-1:t._targetLower.indexOf(i,C[0]),T=!!~S,E=T?S===0||t._nextBeginningIndexes[S-1]===S:!1;if(T&&!E){for(var D=0;D<v.length;D=v[D])if(!(D<=S)){for(var O=0;O<l&&a[O]===t._targetLowerCodes[D+O];O++);if(O===l){S=D,E=!0;break}}}var k=e=>{for(var t=0,n=0,r=1;r<l;++r)e[r]-e[r-1]!==1&&(t-=e[r],++n);var i=e[l-1]-e[0]-(l-1);if(t-=(12+i)*n,e[0]!==0&&(t-=e[0]*e[0]*.2),!h)t*=1e3;else{for(var a=1,r=v[0];r<u;r=v[r])++a;a>24&&(t*=(a-24)*10)}return t-=(u-l)/2,T&&(t/=1+l*l*1),E&&(t/=1+l*l*1),t-=(u-l)/2,t};if(!h){if(T)for(var D=0;D<l;++D)C[D]=S+D;var A=C,j=k(A)}else if(E){for(var D=0;D<l;++D)C[D]=S+D;var A=C,j=k(C)}else var A=w,j=k(w);t._score=j;for(var D=0;D<l;++D)t._indexes[D]=A[D];t._indexes.len=l;let M=new o;return M.target=t.target,M._score=t._score,M._indexes=t._indexes,M},g=(e,t,n)=>{for(var r=new Set,i=0,a=F,o=0,s=e.spaceSearches,c=s.length,l=0,u=()=>{for(let e=l-1;e>=0;e--)t._nextBeginningIndexes[T[e*2+0]]=T[e*2+1]},d=!1,f=0;f<c;++f){D[f]=N;var p=s[f];if(a=h(p,t),n){if(a===F)continue;d=!0}else if(a===F)return u(),F;if(f!==c-1){var m=a._indexes,g=!0;for(let e=0;e<m.len-1;e++)if(m[e+1]-m[e]!==1){g=!1;break}if(g){var _=m[m.len-1]+1,v=t._nextBeginningIndexes[_-1];for(let e=_-1;e>=0&&v===t._nextBeginningIndexes[e];e--)t._nextBeginningIndexes[e]=_,T[l*2+0]=e,T[l*2+1]=v,l++}}i+=a._score/c,D[f]=a._score/c,a._indexes[0]<o&&(i-=(o-a._indexes[0])*2),o=a._indexes[0];for(var y=0;y<a._indexes.len;++y)r.add(a._indexes[y])}if(n&&!d)return F;u();var b=h(e,t,!0);if(b!==F&&b._score>i){if(n)for(var f=0;f<c;++f)D[f]=b._score/c;return b}n&&(a=t),a._score=i;var f=0;for(let e of r)a._indexes[f++]=e;return a._indexes.len=f,a},_=e=>e.replace(/\p{Script=Latin}+/gu,e=>e.normalize(`NFD`)).replace(/[\u0300-\u036f]/g,``),v=e=>{e=_(e);for(var t=e.length,n=e.toLowerCase(),r=[],i=0,a=!1,o=0;o<t;++o){var s=r[o]=n.charCodeAt(o);if(s===32){a=!0;continue}var c=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;i|=1<<c}return{lowerCodes:r,bitflags:i,containsSpace:a,_lower:n}},y=e=>{for(var t=e.length,n=[],r=0,i=!1,a=!1,o=0;o<t;++o){var s=e.charCodeAt(o),c=s>=65&&s<=90,l=c||s>=97&&s<=122||s>=48&&s<=57,u=c&&!i||!a||!l;i=c,a=l,u&&(n[r++]=o)}return n},b=e=>{e=_(e);for(var t=e.length,n=y(e),r=[],i=n[0],a=0,o=0;o<t;++o)i>o?r[o]=i:(i=n[++a],r[o]=i===void 0?t:i);return r},x=new Map,S=new Map,C=[],w=[],T=[],E=[],D=[],O=[],k=[],A=(e,t)=>{var n=e[t];if(n!==void 0)return n;if(typeof t==`function`)return t(e);var r=t;Array.isArray(t)||(r=t.split(`.`));for(var i=r.length,a=-1;e&&++a<i;)e=e[r[a]];return e},j=e=>typeof e==`object`&&typeof e._bitflags==`number`,M=1/0,N=-M,P=[];P.total=0;var F=null,I=i(``),ee=(e=>{var t=[],n=0,r={},i=e=>{for(var r=0,i=t[r],a=1;a<n;){var o=a+1;r=a,o<n&&t[o]._score<t[a]._score&&(r=o),t[r-1>>1]=t[r],a=1+(r<<1)}for(var s=r-1>>1;r>0&&i._score<t[s]._score;s=(r=s)-1>>1)t[r]=t[s];t[r]=i};return r.add=(e=>{var r=n;t[n++]=e;for(var i=r-1>>1;r>0&&e._score<t[i]._score;i=(r=i)-1>>1)t[r]=t[i];t[r]=e}),r.poll=(e=>{if(n!==0){var r=t[0];return t[0]=t[--n],i(),r}}),r.peek=(e=>{if(n!==0)return t[0]}),r.replaceTop=(e=>{t[0]=e,i()}),r})();return{single:t,go:n,prepare:i,cleanup:a}})}))(),1);function tme(e){return e.kind===`anchor`?`${e.docName}#${e.slug}`:e.docName}function nme(e){return e.kind===`anchor`?`Heading H${e.level}: ${e.text}`:e.kind===`create`?e.actionLabel:e.title}function rme(e){let t=(0,gn.c)(41),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,mode:c,pageTarget:l,anchorQuery:u}=e,d=o===void 0?!1:o,f=s===void 0?null:s,p=c===void 0?`page`:c,m=l===void 0?``:l,h=u===void 0?``:u,g=(0,z.useRef)(null),_=(0,z.useId)(),v=i>=0&&i<n.length?`${_}-option-${i}`:void 0,y,b;t[0]===i?(y=t[1],b=t[2]):(y=()=>{let e=g.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},b=[i],t[0]=i,t[1]=y,t[2]=b),(0,z.useEffect)(y,b);let x=ime;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n=p===`anchor`?`Loading headings for ${m}…`:`Loading pages…`,r;return t[4]===n?r=t[5]:(r=(0,B.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:x,children:n}),t[4]=n,t[5]=r),r}if(n.length===0){let e;t[6]!==h||t[7]!==f||t[8]!==p||t[9]!==m||t[10]!==r?(e=f??(p===`anchor`?h.trim()?`No headings match "${h.trim()}"`:`No headings in ${m}`:r.trim()?`No pages found for "${r.trim()}"`:`No pages found`),t[6]=h,t[7]=f,t[8]=p,t[9]=m,t[10]=r,t[11]=e):e=t[11];let n=e,i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[12]=i):i=t[12];let a;return t[13]===n?a=t[14]:(a=(0,B.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:x,children:n}),t[13]=n,t[14]=a),a}let S=i>=0&&i<n.length?n[i]:null,C=p===`anchor`?`Heading suggestions`:`Wiki link suggestions`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[15]=w):w=t[15];let T;t[16]===S?T=t[17]:(T=S?nme(S):``,t[16]=S,t[17]=T);let E;t[18]===T?E=t[19]:(E=(0,B.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:T}),t[18]=T,t[19]=E);let D;t[20]===f?D=t[21]:(D=f&&(0,B.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[20]=f,t[21]=D);let O;t[22]!==p||t[23]!==m?(O=p===`anchor`&&(0,B.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m}),t[22]=p,t[23]=m,t[24]=O):O=t[24];let k;if(t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==i){let e;t[30]!==_||t[31]!==a||t[32]!==i?(e=(e,t)=>{let n=t===i,r=tme(e);return e.kind===`anchor`?(0,B.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,style:{paddingLeft:`${(e.level-1)*10+8}px`},onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,B.jsxs)(`span`,{className:`w-6 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,B.jsx)(`span`,{className:`truncate font-medium`,children:e.text})]},r):(0,B.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full flex-col rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,B.jsx)(`span`,{className:`truncate font-medium`,children:e.kind===`create`?e.actionLabel:e.title}),e.kind===`page`&&e.title!==e.docName&&(0,B.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.docName}),e.kind===`create`&&(0,B.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.docName,`.md`]})]},r)},t[30]=_,t[31]=a,t[32]=i,t[33]=e):e=t[33],k=n.map(e),t[25]=n,t[26]=_,t[27]=a,t[28]=i,t[29]=k}else k=t[29];let A;return t[34]!==v||t[35]!==E||t[36]!==D||t[37]!==O||t[38]!==k||t[39]!==C?(A=(0,B.jsxs)(`div`,{ref:g,role:`listbox`,"aria-label":C,"aria-activedescendant":v,tabIndex:-1,onMouseDown:x,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:w,children:[E,D,O,k]}),t[34]=v,t[35]=E,t[36]=D,t[37]=O,t[38]=k,t[39]=C,t[40]=A):A=t[40],A}function ime(e){return e.preventDefault()}function w4(e,t){let n=document.createElement(`div`);n.style.position=`fixed`,n.style.zIndex=`50`,n.style.visibility=`hidden`,document.body.appendChild(n);let r={getBoundingClientRect:()=>e()?.clientRect?.()??new DOMRect,get contextElement(){return e()?.editor.view.dom}},i=!1,a=!1,o=()=>{n.isConnected&&(n.style.removeProperty(`--suggestion-menu-max-height`),Ks(r,n,{placement:`bottom-start`,middleware:[Ls(4),Bs(),Vs({apply({availableHeight:e}){n.isConnected&&n.style.setProperty(`--suggestion-menu-max-height`,`${Math.min(e,window.innerHeight*.4)}px`)}})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`,i&&!a&&(n.style.removeProperty(`visibility`),a=!0))}).catch(e=>{n.isConnected&&console.warn(`[${t}] computePosition failed`,e)}))};return{popup:n,doPosition:o,startAutoUpdate:()=>Is(r,n,o),reveal:()=>{a||(i=!0,o())}}}function T4(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var E4=new Xd(`wikiLinkSuggestion`),D4=8;function O4(e){let t=e.indexOf(`#`);return t>0?{mode:`anchor`,pageTarget:e.slice(0,t),anchorQuery:e.slice(t+1)}:{mode:`page`,pageTarget:``,anchorQuery:``}}function k4(e,t){return t?C4.default.go(t,e,{keys:[`title`,`docName`],threshold:-1e4}).map(e=>e.obj).slice(0,D4):e.slice(0,D4)}function A4(e,t){return t?C4.default.go(t,e,{key:`text`,threshold:-1e4}).map(e=>e.obj).slice(0,D4):e.slice(0,D4)}function ame(e,t){let n=k4(e,t);if(n.length>0)return n.map(e=>({kind:`page`,...e}));let r=H2(t);return r?[{kind:`create`,docName:r.target,title:t.trim(),actionLabel:`Insert unresolved link "${t.trim()}"`}]:[]}function ome(e,t,n){return A4(t,n).map(t=>({kind:`anchor`,docName:e,level:t.level,text:t.text,slug:t.slug}))}function sme(e){let{mode:t,pageTarget:n,anchorQuery:r}=O4(e);return t===`anchor`&&n?{target:n,alias:null,anchor:r.trim()||null}:H2(e)}function cme(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``),r=n.match(/\[\[([^\]]*)$/);if(!r)return null;let i=r[1];return{range:{from:t.start()+n.lastIndexOf(`[[`),to:t.pos},query:i,text:r[0]}}async function j4(){let e=await fetch(`/api/pages`);if(!e.ok)throw Error(`/api/pages responded with ${e.status}`);let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function M4(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/page-headings responded with ${t.status}`);let n=await t.json();return n.ok&&Array.isArray(n.headings)?n.headings:[]}function lme(e){let t=[],n=!1,r=!1,i=new Map,a=null,o=null,s=null;return S4({editor:e,pluginKey:E4,char:`[[`,allowedPrefixes:null,findSuggestionMatch:cme,items:async({query:e})=>{let{mode:c,pageTarget:l,anchorQuery:u}=O4(e);if(c===`anchor`){if(!i.has(l)&&a!==l){a=l;try{let e=await M4(l);i.set(l,e),s=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch headings:`,e),i.set(l,[]),s=`Failed to load headings for ${l}. Press Escape and type [[ again to retry.`}finally{a=null}}return ome(l,i.get(l)??[],u)}if(!n&&!r){r=!0;try{t=await j4(),o=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch pages:`,e),o=`Failed to load pages. Press Escape and type [[ again to retry, or continue typing to insert an unresolved link.`,t=[]}finally{n=!0,r=!1}}return ame(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=null;if(n.kind===`page`?r={target:n.docName,alias:null,anchor:null}:n.kind===`anchor`?r={target:n.docName,alias:null,anchor:n.slug}:n.kind===`create`&&(r=H2(n.title)),!r)return;e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:r}).run()}catch(e){console.error(`[wiki-link-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,c=null,l=0,u={popup:null,stopAutoUpdate:null},d=null,f=null,p=e=>{c?.command(e)};function m(e,t,r){let{mode:a,pageTarget:c,anchorQuery:u}=O4(e.query??``),d=t===null?a===`anchor`?!i.has(c):!n:t;return{items:e.items,query:e.query??``,selectedIndex:l,onSelect:r,loading:d,error:a===`page`?o:s,mode:a,pageTarget:c,anchorQuery:u}}let h=t=>{!e||!c||e.updateProps(m(c,t,p))},g=()=>{if(!c)return;let{editor:e,range:t}=c,n=sme(c.query??``);if(n)try{e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:n}).run()}catch(e){console.error(`[wiki-link-suggestion] fallback insert error:`,e)}};return{onBeforeStart(t){c=t,l=0;let n=w4(()=>c,`wiki-link-suggestion`);u.popup=n.popup,d=n.doPosition,f=n.reveal,e=new Ky(rme,{props:m(t,!0,p),editor:t.editor}),n.popup.appendChild(e.element),u.stopAutoUpdate=n.startAutoUpdate()},onBeforeUpdate(e){let t=c?O4(c.query??``).mode:null,n=O4(e.query??``).mode;c=e,t!==n&&(l=0,h(!0))},onStart(e){c=e,l=0,h(null),f?.()},onUpdate(e){c=e,l=Math.min(l,Math.max(0,e.items.length-1)),h(null),d?.()},onKeyDown({event:e}){if(!c)return!1;let t=c.items;if(e.key===`ArrowDown`)return t.length===0?!1:(l=(l+1)%t.length,h(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(l=(l-1+t.length)%t.length,h(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[l];return e?c.command(e):g(),!0}return e.key,!1},onExit(){T4(u),d=null,f=null,e?.destroy(),e=null,c=null,l=0,t=[],i=new Map,o=null,s=null,n=!1,r=!1,a=null}}}})}function N4(e,t){let n=(0,gn.c)(4),[r,i]=(0,z.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),M4(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,z.useEffect)(a,o),r}function ume(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:n.startsWith(`/`)||Y1(n)?`external`:`doc`:t}function dme(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function fme(e){let t=(0,gn.c)(64),{open:n,href:r,pages:i,onOpenChange:a,onSave:o}=e,[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(`doc`),p=(0,z.useId)(),m=(0,z.useId)(),h=(0,z.useId)(),g,_;t[0]!==r||t[1]!==n?(g=()=>{if(!n)return;let e=J2(r);if(f(dme(e)),e?.kind===`doc`){c(e.docName),u(e.anchor??``);return}if(e?.kind===`anchor`){c(`#${e.anchor}`),u(``);return}c(e?.kind===`external`?e.url:r),u(``)},_=[r,n],t[0]=r,t[1]=n,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,z.useEffect)(g,_);let v,y,b;t[4]!==d||t[5]!==s||t[6]!==i?(v=xO(s),y=d===`doc`,b=y&&W2(v,i),t[4]=d,t[5]=s,t[6]=i,t[7]=v,t[8]=y,t[9]=b):(v=t[7],y=t[8],b=t[9]);let x=N4(v,b&&n),S=!!x?.length,C;t[10]!==v||t[11]!==y||t[12]!==l||t[13]!==s||t[14]!==a||t[15]!==o?(C=function(){let e=s.trim();e&&(o(y?$2(v,l.trim()||null):e),a(!1))},t[10]=v,t[11]=y,t[12]=l,t[13]=s,t[14]=a,t[15]=o,t[16]=C):C=t[16];let w=C,T;t[17]===w?T=t[18]:(T=function(e){e.key===`Enter`&&(e.preventDefault(),w())},t[17]=w,t[18]=T);let E=T,D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,B.jsx)(Na,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[19]=D):D=t[19];let O,k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,B.jsx)(Fa,{className:`mb-1 text-base font-semibold`,children:`Edit markdown link`}),k=(0,B.jsx)(Ia,{className:`mb-4 text-sm text-muted-foreground`,children:`Update the destination and optional section anchor.`}),t[20]=O,t[21]=k):(O=t[20],k=t[21]);let A=y?`Page`:`Link target`,j;t[22]!==A||t[23]!==p?(j=(0,B.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:p,children:A}),t[22]=A,t[23]=p,t[24]=j):j=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{let t=e.target.value;c(t),f(e=>ume(t,e))},t[25]=M):M=t[25];let N;t[26]!==s||t[27]!==E||t[28]!==p?(N=(0,B.jsx)(d4,{id:p,value:s,onChange:M,placeholder:`guides/install or https://example.com`,autoFocus:!0,onKeyDown:E}),t[26]=s,t[27]=E,t[28]=p,t[29]=N):N=t[29];let P;t[30]===y?P=t[31]:(P=y?(0,B.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:`This changes the destination page. The visible link text stays editable inline in the document.`}):null,t[30]=y,t[31]=P);let F;t[32]!==j||t[33]!==N||t[34]!==P?(F=(0,B.jsxs)(`div`,{children:[j,N,P]}),t[32]=j,t[33]=N,t[34]=P,t[35]=F):F=t[35];let I;t[36]!==m||t[37]!==y||t[38]!==l||t[39]!==E||t[40]!==h||t[41]!==x||t[42]!==S?(I=y?(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:m,children:[`Section`,` `,(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`})]}),(0,B.jsx)(d4,{id:m,value:l,onChange:e=>u(e.target.value),placeholder:`heading-slug`,"aria-controls":S?h:void 0,"aria-expanded":S?!0:void 0,"aria-haspopup":S?`listbox`:void 0,onKeyDown:E}),S?(0,B.jsx)(`div`,{role:`listbox`,id:h,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:x.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":l===e.slug,className:_l(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,l===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>u(l===e.slug?``:e.slug),children:[(0,B.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,B.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[36]=m,t[37]=y,t[38]=l,t[39]=E,t[40]=h,t[41]=x,t[42]=S,t[43]=I):I=t[43];let ee;t[44]!==F||t[45]!==I?(ee=(0,B.jsxs)(`div`,{className:`mb-4 space-y-6`,children:[F,I]}),t[44]=F,t[45]=I,t[46]=ee):ee=t[46];let te;t[47]===a?te=t[48]:(te=(0,B.jsx)(mO,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),t[47]=a,t[48]=te);let ne;t[49]===s?ne=t[50]:(ne=s.trim(),t[49]=s,t[50]=ne);let re=!ne,L;t[51]!==w||t[52]!==re?(L=(0,B.jsx)(mO,{onClick:w,disabled:re,children:`Save`}),t[51]=w,t[52]=re,t[53]=L):L=t[53];let ie;t[54]!==te||t[55]!==L?(ie=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[te,L]}),t[54]=te,t[55]=L,t[56]=ie):ie=t[56];let ae;t[57]!==ee||t[58]!==ie?(ae=(0,B.jsxs)(Ma,{children:[D,(0,B.jsxs)(Pa,{"data-slot":`dialog-content`,"data-ok-layer-spawned":``,className:`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[O,k,ee,ie]})]}),t[57]=ee,t[58]=ie,t[59]=ae):ae=t[59];let oe;return t[60]!==a||t[61]!==n||t[62]!==ae?(oe=(0,B.jsx)(ja,{open:n,onOpenChange:a,children:ae}),t[60]=a,t[61]=n,t[62]=ae,t[63]=oe):oe=t[63],oe}function pme(e){let t=(0,gn.c)(81),{editor:n,nodeId:r,sourceDocName:i,onClose:a}=e,o=x4(n.state,r),s=o?.attrs?.href??``,[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(null),{folderPaths:f,pages:p,loading:m}=u4();if(!o||!s)return null;let h=X1(s,i),g;t[0]!==n||t[1]!==r?(g=function(e){let t=x4(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run()},t[0]=n,t[1]=r,t[2]=g):g=t[2];let _=g,v;t[3]!==n||t[4]!==r||t[5]!==a?(v=function(){let e=x4(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),a())},t[3]=n,t[4]=r,t[5]=a,t[6]=v):v=t[6];let y=v,b=function(e){if(h){if(h.kind===`external`){Q2(h);return}if(h.kind===`anchor`||h.kind===`doc`){let t=h.kind===`doc`?h.docName:i,n=h.anchor??null;e.newTab?Z2({docName:t,anchor:n}):window.location.assign(Y2({docName:t,anchor:n}))}}},x=function(e){if(u!==`missing`)return;let t=x4(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:$2(e,h?.kind===`doc`?h.anchor??null:null)}).run()},S,C=!1,w=!1,T=null;if(m){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Qn,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[7]=e):e=t[7],S={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(h?.kind===`external`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Hn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[8]=e):e=t[8],S={icon:e,text:`External link`,className:`text-foreground`}}else if(h?.kind===`anchor`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Wn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[9]=e):e=t[9],S={icon:e,text:`Anchor in this page`,className:`text-foreground`}}else if(h?.kind===`doc`){let e=t4(h.docName,{pages:p,folderPaths:f});if(T=n4(e),w=e.kind===`navigate`&&e.displayState===`folder`,C=e.kind===`create`,w){let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[10]=e):e=t[10],S={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(C){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[11]=e):e=t[11],S={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else{let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Wn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[12]=e):e=t[12],S={icon:e,text:`Page link`,className:`text-foreground`}}}else{let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[13]=e):e=t[13],S={icon:e,text:`Unrecognized link`,className:`text-muted-foreground`}}let E=_l(`text-sm font-medium`,S.className),D;t[14]!==S.text||t[15]!==E?(D=(0,B.jsx)(`div`,{className:E,children:S.text}),t[14]=S.text,t[15]=E,t[16]=D):D=t[16];let O;t[17]===s?O=t[18]:(O=(0,B.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:s,children:s}),t[17]=s,t[18]=O);let k;t[19]!==D||t[20]!==O?(k=(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[D,O]}),t[19]=D,t[20]=O,t[21]=k):k=t[21];let A;t[22]!==b||t[23]!==C||t[24]!==a||t[25]!==h?.kind?(A=C?null:(0,B.jsx)(mO,{size:`sm`,variant:`default`,onClick:()=>{b({}),a()},children:h?.kind===`external`?`Open in new tab`:`Open`}),t[22]=b,t[23]=C,t[24]=a,t[25]=h?.kind,t[26]=A):A=t[26];let j;t[27]!==C||t[28]!==d?(j=C?(0,B.jsx)(mO,{size:`sm`,variant:`default`,onClick:()=>d(`missing`),children:`Create page`}):null,t[27]=C,t[28]=d,t[29]=j):j=t[29];let M;t[30]!==T||t[31]!==w||t[32]!==d?(M=w&&T?(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,onClick:()=>d(`folder-index`),children:[(0,B.jsx)(Un,{className:`size-3.5`,"aria-hidden":`true`}),`Create index`]}):null,t[30]=T,t[31]=w,t[32]=d,t[33]=M):M=t[33];let N;t[34]===l?N=t[35]:(N=()=>l(!0),t[34]=l,t[35]=N);let P;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,B.jsx)($n,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=P):P=t[36];let F;t[37]===N?F=t[38]:(F=(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,onClick:N,children:[P,`Edit`]}),t[37]=N,t[38]=F);let I;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,B.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}),t[39]=I):I=t[39];let ee;t[40]===y?ee=t[41]:(ee=(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,className:`text-red-700 hover:bg-red-50 hover:text-red-800 dark:text-red-300 dark:hover:bg-red-100/10 dark:hover:text-red-200`,onClick:y,children:[I,`Remove`]}),t[40]=y,t[41]=ee);let te;t[42]!==M||t[43]!==F||t[44]!==ee||t[45]!==A||t[46]!==j?(te=(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[A,j,M,F,ee]}),t[42]=M,t[43]=F,t[44]=ee,t[45]=A,t[46]=j,t[47]=te):te=t[47];let ne=u!==null,re;t[48]===d?re=t[49]:(re=e=>{e||d(null)},t[48]=d,t[49]=re);let L;t[50]!==u||t[51]!==T||t[52]!==f||t[53]!==C||t[54]!==p||t[55]!==h?(L=u===`folder-index`&&T?T.initialDir:C&&h?.kind===`doc`&&t4(h.docName,{pages:p,folderPaths:f}).kind===`create`?t4(h.docName,{pages:p,folderPaths:f}).initialDir:``,t[50]=u,t[51]=T,t[52]=f,t[53]=C,t[54]=p,t[55]=h,t[56]=L):L=t[56];let ie;t[57]!==u||t[58]!==T||t[59]!==f||t[60]!==C||t[61]!==p||t[62]!==h?(ie=u===`folder-index`&&T?T.suggestedName:C&&h?.kind===`doc`&&t4(h.docName,{pages:p,folderPaths:f}).kind===`create`?t4(h.docName,{pages:p,folderPaths:f}).suggestedName:void 0,t[57]=u,t[58]=T,t[59]=f,t[60]=C,t[61]=p,t[62]=h,t[63]=ie):ie=t[63];let ae;t[64]!==u||t[65]!==T||t[66]!==h?(ae=u===`folder-index`&&T?(0,B.jsxs)(B.Fragment,{children:[`Create an index note for`,` `,(0,B.jsxs)(`span`,{className:`font-medium text-foreground`,children:[T.initialDir,`/`]})]}):(0,B.jsxs)(B.Fragment,{children:[`Create a page for`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:h?.kind===`doc`?h.docName:``})]}),t[64]=u,t[65]=T,t[66]=h,t[67]=ae):ae=t[67];let oe;t[68]!==x||t[69]!==ne||t[70]!==re||t[71]!==L||t[72]!==ie||t[73]!==ae?(oe=(0,B.jsx)(p4,{open:ne,onOpenChange:re,kind:`file`,initialDir:L,suggestedName:ie,description:ae,onCreated:x}),t[68]=x,t[69]=ne,t[70]=re,t[71]=L,t[72]=ie,t[73]=ae,t[74]=oe):oe=t[74];let se;return t[75]!==c||t[76]!==_||t[77]!==s||t[78]!==p||t[79]!==l?(se=(0,B.jsx)(fme,{open:c,href:s,pages:p,onOpenChange:l,onSave:_}),t[75]=c,t[76]=_,t[77]=s,t[78]=p,t[79]=l,t[80]=se):se=t[80],(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(e4,{kind:`internal-link`,ariaLabel:`Link options`,onDeactivate:a,children:[(0,B.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 pr-8`,children:[(0,B.jsx)(`div`,{className:_l(`mt-0.5 flex shrink-0`,S.className),children:S.icon}),k]}),te]}),oe,se]})}function mme(e,t,n){let r=X1(e,t);if(!r)return`unresolved`;if(r.kind===`external`)return`external`;if(r.kind===`anchor`)return`anchor`;if(n===null)return`loading`;let i=t4(r.docName,{pages:n.pages,folderPaths:n.folderPaths});return i.kind===`create`?`unresolved`:i.displayState}function hme(e,t,n){let r=e.attrs?.href;return typeof r!=`string`||r.length===0?null:{"data-resolution-state":mme(r,n,t)}}function gme(e){return(t,n)=>hme(t,n,e)}var P4=new Xd(`linkResolutionDecoration`);function _me(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i);t!==null&&a.push($h.inline(e.from,e.to,t))}return a.length===0?null:ng.create(e,a)}function vme(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new qd({key:P4,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(P4);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=v4.getState(e);if(!r)return null;let i=Spe();return _me(e.doc,r.byId,t,n,i)}},view(e){let t=wpe(()=>{e.dispatch(e.state.tr.setMeta(P4,{refresh:!0}))});return{destroy(){t()}}}})}var yme=new Xd(`markIdentityDecoration`),bme=`data-mark-id`;function xme(){return new qd({key:yme,props:{decorations(e){let t=v4.getState(e);if(!t||t.byId.size===0)return null;let n=[];for(let e of t.byId.values())n.push($h.inline(e.from,e.to,{[bme]:e.id}));return ng.create(e.doc,n)}}})}var Sme=NA.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,l_(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``;return[Xpe({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:t,nodeId:n,deactivate:r})=>(0,z.createElement)(pme,{editor:t,nodeId:n,sourceDocName:e,onClose:r}),handlePrimary:({editor:t,nodeId:n,newTab:r})=>{if(!r)return!1;let i=x4(t.state,n)?.attrs?.href;if(typeof i!=`string`||!i)return!1;let a=X1(i,e);return a?a.kind===`doc`?(Z2({docName:a.docName,anchor:a.anchor}),!0):a.kind===`anchor`?(Z2({docName:e,anchor:a.anchor}),!0):K2(a.url)?(X2(a.url),!0):!1:!1}}),xme(),vme({markTypes:[`link`],computeAttrs:gme(e)})]}}),Cme={warning:`bg-amber-100 text-amber-900 dark:bg-amber-900/40 dark:text-amber-200`,info:`bg-sky-100 text-sky-900 dark:bg-sky-900/40 dark:text-sky-200`,error:`bg-red-100 text-red-900 dark:bg-red-900/40 dark:text-red-200`},wme={warning:`alert`,error:`alert`,info:`note`};function Tme(e){let t=(0,gn.c)(11),{type:n,children:r}=e,i=wme[n]||`note`,a=Cme[n]||`bg-muted text-foreground`,o;t[0]===a?o=t[1]:(o=_l(`p-3 px-4 rounded-md`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=n.toUpperCase(),t[2]=n,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,B.jsx)(`strong`,{children:s}),t[4]=s,t[5]=c);let l;return t[6]!==r||t[7]!==i||t[8]!==o||t[9]!==c?(l=(0,B.jsxs)(`div`,{role:i,className:o,children:[c,`: `,r]}),t[6]=r,t[7]=i,t[8]=o,t[9]=c,t[10]=l):l=t[10],l}function Eme(e){let t=e.match(/<(\w+)/);return t?t[1]:`Unknown`}function Dme(e){let t=(0,gn.c)(19),{editor:n,getPos:r,onDismiss:i}=e,a;if(t[0]!==n||t[1]!==r){let e=r();a=Eme((typeof e==`number`?n.state.doc.nodeAt(e):null)?.attrs.content??``),t[0]=n,t[1]=r,t[2]=a}else a=t[2];let o=a,s;t[3]!==n||t[4]!==r||t[5]!==i?(s=function(){let e=r();if(typeof e!=`number`)return;let t=n.state.doc.nodeAt(e);t&&(n.chain().focus().deleteRange({from:e,to:e+t.nodeSize}).run(),i())},t[3]=n,t[4]=r,t[5]=i,t[6]=s):s=t[6];let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Component`}),t[7]=l):l=t[7];let u;t[8]===o?u=t[9]:(u=(0,B.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs font-mono`,children:o}),t[8]=o,t[9]=u);let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(`div`,{className:`flex-1`}),t[10]=d):d=t[10];let f;t[11]===c?f=t[12]:(f=(0,B.jsx)(mO,{variant:`outline`,size:`sm`,onClick:c,children:`Delete`}),t[11]=c,t[12]=f);let p;t[13]!==u||t[14]!==f?(p=(0,B.jsxs)(`div`,{className:`flex items-center gap-2 pr-8`,children:[l,u,d,f]}),t[13]=u,t[14]=f,t[15]=p):p=t[15];let m;return t[16]!==i||t[17]!==p?(m=(0,B.jsx)(e4,{kind:`jsx-component`,ariaLabel:`Component properties`,onDeactivate:i,children:p}),t[16]=i,t[17]=p,t[18]=m):m=t[18],m}var Ome=0;function kme(){return`jsx-${++Ome}`}function Ame(e){let t=e.match(/<(\w+)\s+type="([^"]*)">([\s\S]*?)<\/\1>/);return t?{component:t[1],type:t[2],children:t[3].trim()}:{component:`Unknown`,type:`info`,children:e.trim()}}function jme(e){let t=(0,gn.c)(17),{node:n,editor:r,getPos:i}=e,a=n.attrs.content||``,o;t[0]===a?o=t[1]:(o=Ame(a),t[0]=a,t[1]=o);let s=o,[c]=(0,z.useState)(kme),l=(0,z.useRef)(i),u,d;t[2]===i?(u=t[3],d=t[4]):(u=()=>{l.current=i},d=[i],t[2]=i,t[3]=u,t[4]=d),(0,z.useEffect)(u,d);let f,p;t[5]!==r||t[6]!==c?(f=()=>{let e=_4(r),t=()=>{let e=l.current();return typeof e==`number`?e:void 0};return e.register({type:`jsxComponent`,nodeId:c,getPos:t,controls:{propPanel:e=>(0,B.jsx)(Dme,{editor:r,getPos:t,onDismiss:e.deactivate})}}),()=>{e.deregister(c)}},p=[r,c],t[5]=r,t[6]=c,t[7]=f,t[8]=p):(f=t[7],p=t[8]),(0,z.useEffect)(f,p);let m;t[9]!==a||t[10]!==s.children||t[11]!==s.component||t[12]!==s.type?(m=s.component===`Callout`?(0,B.jsx)(Tme,{type:s.type,children:s.children}):(0,B.jsxs)(`div`,{className:`bg-muted dark:bg-muted/40 p-3 px-4 rounded-md font-mono text-[13px]`,children:[(0,B.jsxs)(`strong`,{children:[`<`,s.component,`>`]}),(0,B.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap`,children:a})]}),t[9]=a,t[10]=s.children,t[11]=s.component,t[12]=s.type,t[13]=m):m=t[13];let h;return t[14]!==c||t[15]!==m?(h=(0,B.jsx)(By,{className:`jsx-component-wrapper`,contentEditable:!1,"data-node-id":c,children:m}),t[14]=c,t[15]=m,t[16]=h):h=t[16],h}var Mme=VO.extend({addNodeView(){return Jy(jme)}}),F4=`raw-mdx-nav`,Nme=0;function Pme(){return`raw-mdx-${++Nme}`}function Fme(e){let t=e.doc??(typeof document<`u`?document:{createElement:null}),n=t.createElement(`div`);n.setAttribute(`data-raw-mdx-fallback`,``),n.setAttribute(`data-raw-badge`,`raw`),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`${e.reason??`Parse failed`} — click to edit`),n.classList.add(`raw-mdx-fallback-wrapper`),e.reason&&n.setAttribute(`data-reason`,e.reason);let r=t.createElement(`span`);r.classList.add(`raw-mdx-fallback-badge`),r.textContent=`raw`,r.setAttribute(`aria-hidden`,`true`),n.appendChild(r);let i=t.createElement(`pre`);return i.classList.add(`raw-mdx-fallback-content`),i.setAttribute(`contenteditable`,`false`),n.appendChild(i),{dom:n,contentDOM:i}}var Ime=LA.extend({addNodeView(){return({editor:e,node:t,getPos:n,HTMLAttributes:r})=>{let i=Pme(),{dom:a,contentDOM:o}=Fme({nodeId:i,reason:r.reason??t.attrs.reason}),s=()=>{let e=n();return typeof e==`number`?e:void 0},c=_4(e);return c.register({type:`rawMdxFallback`,nodeId:i,getPos:s,controls:{},handlePrimary:()=>{let t=s();if(typeof t!=`number`)return!1;let n=e.state.doc.nodeAt(t)?.attrs.originalSpan??{start:0,end:0};return window.dispatchEvent(new CustomEvent(F4,{detail:{offset:n.start}})),!0}}),{dom:a,contentDOM:o,ignoreMutation:()=>!0,destroy:()=>{c.deregister(i)}}}}}),Lme=[{name:`heading1`,label:`Heading 1`,icon:Kn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:1}).run(),aliases:[`h1`]},{name:`heading2`,label:`Heading 2`,icon:qn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:2}).run(),aliases:[`h2`]},{name:`heading3`,label:`Heading 3`,icon:Jn,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:3}).run(),aliases:[`h3`]},{name:`bulletList`,label:`Bullet List`,icon:Zn,category:`basic`,command:e=>e.chain().focus().toggleBulletList().run(),aliases:[`ul`,`unordered`]},{name:`orderedList`,label:`Ordered List`,icon:Yn,category:`basic`,command:e=>e.chain().focus().toggleOrderedList().run(),aliases:[`ol`,`numbered`]},{name:`taskList`,label:`Task List`,icon:Xn,category:`basic`,command:e=>e.chain().focus().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`]},{name:`blockquote`,label:`Quote`,icon:er,category:`basic`,command:e=>e.chain().focus().toggleBlockquote().run(),aliases:[`quote`]},{name:`codeBlock`,label:`Code Block`,icon:Zee,category:`basic`,command:e=>e.chain().focus().toggleCodeBlock().run(),aliases:[`code`,`fence`]},{name:`table`,label:`Table`,icon:ete,category:`insert`,command:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),aliases:[`grid`]},{name:`separator`,label:`Separator`,icon:$ee,category:`insert`,command:e=>e.chain().focus().setHorizontalRule().run(),aliases:[`hr`,`divider`,`rule`]},{name:`image`,label:`Image`,icon:Qee,category:`insert`,aliases:[`img`,`photo`],command:e=>{let t=document.createElement(`input`);t.type=`file`,t.accept=NO.join(`,`),t.onchange=()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;y2(n,e,t)}},t.click()}}];function Rme(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)||e.aliases?.some(e=>e.toLowerCase().includes(n)))}function zme(e){let t=(0,gn.c)(14),{items:n,selectedIndex:r,categoryLabels:i,onSelect:a}=e,o=(0,z.useRef)(null),s=(0,z.useId)(),c=r>=0&&r<n.length?`${s}-option-${r}`:void 0,l=Bme,u,d;if(t[0]===r?(u=t[1],d=t[2]):(u=()=>{let e=o.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},d=[r],t[0]=r,t[1]=u,t[2]=d),(0,z.useEffect)(u,d),n.length===0){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`div`,{ref:o,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:{maxHeight:`var(--suggestion-menu-max-height, 40vh)`},onMouseDown:l,children:`No results`}),t[3]=e):e=t[3],e}let f;if(t[4]!==c||t[5]!==i||t[6]!==n||t[7]!==s||t[8]!==a||t[9]!==r){let e=[],u=0,d=new Map;for(let t of n){d.set(t,u++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}let p=r>=0&&r<n.length?n[r]:null,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[11]=m):m=t[11];let h=p?p.label:``,g;t[12]===h?g=t[13]:(g=(0,B.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:h}),t[12]=h,t[13]=g),f=(0,B.jsxs)(`div`,{ref:o,role:`listbox`,"aria-label":`Slash commands`,"aria-activedescendant":c,tabIndex:-1,onMouseDown:l,className:`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:m,children:[g,e.map(e=>(0,B.jsxs)(`div`,{role:`group`,"aria-labelledby":`${s}-group-${e.key}`,children:[(0,B.jsx)(`div`,{id:`${s}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:i[e.key]??e.key}),e.items.map(e=>{let t=d.get(e)??0,n=t===r,i=e.icon;return(0,B.jsxs)(`button`,{id:`${s}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,B.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,B.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,B.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key))]}),t[4]=c,t[5]=i,t[6]=n,t[7]=s,t[8]=a,t[9]=r,t[10]=f}else f=t[10];return f}function Bme(e){return e.preventDefault()}var Vme=new Xd(`slashCommand`),Hme=W_.create({name:`slashCommand`,addOptions(){return{itemsSources:[()=>Lme],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[S4({editor:this.editor,pluginKey:Vme,char:`/`,startOfLine:!1,items:({query:t})=>Rme(e.options.itemsSources.flatMap(e=>{try{return e()}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),t),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${n.name}"`,e);return}try{n.command(e)}catch(e){console.error(`[slash-command] command "${n.name}" threw an error`,e)}},render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command})};return{onStart(o){n=o,r=0;let s=w4(()=>n,`slash-command`);i.popup=s.popup,a=s.doPosition,t=new Ky(zme,{props:{items:o.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:o.command},editor:o.editor}),s.popup.appendChild(t.element),i.stopAutoUpdate=s.startAutoUpdate(),s.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),o(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,o(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,o(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){T4(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}});function Ume(e){let t=(0,gn.c)(112),{open:n,target:r,alias:i,anchor:a,pages:o,onOpenChange:s,onSave:c}=e,[l,u]=(0,z.useState)(r),[d,f]=(0,z.useState)(i??``),[p,m]=(0,z.useState)(a??``),h=(0,z.useId)(),g=(0,z.useId)(),_=(0,z.useId)(),v=(0,z.useId)(),y;t[0]!==l||t[1]!==o?(y=W2(l,o),t[0]=l,t[1]=o,t[2]=y):y=t[2];let b=N4(l,y&&n),x,S;t[3]!==i||t[4]!==a||t[5]!==n||t[6]!==r?(x=()=>{n&&(u(r),f(i??``),m(a??``))},S=[n,r,i,a],t[3]=i,t[4]=a,t[5]=n,t[6]=r,t[7]=x,t[8]=S):(x=t[7],S=t[8]),(0,z.useEffect)(x,S);let C;t[9]!==d||t[10]!==p||t[11]!==l||t[12]!==s||t[13]!==c?(C=function(){let e=l.trim();e&&(c(e,d.trim()||null,p.trim()||null),s(!1))},t[9]=d,t[10]=p,t[11]=l,t[12]=s,t[13]=c,t[14]=C):C=t[14];let w=C,T;t[15]===w?T=t[16]:(T=function(e){e.key===`Enter`&&w()},t[15]=w,t[16]=T);let E=T,D,O,k,A,j,M,N,P,F,I,ee,te,ne,re,L,ie;if(t[17]!==g||t[18]!==p||t[19]!==l||t[20]!==E||t[21]!==v||t[22]!==b||t[23]!==s||t[24]!==n||t[25]!==h){let e=new Map,r=b?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;k=ja,ee=n,te=s,O=Ma,t[42]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,B.jsx)(Na,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[42]=I):I=t[42],D=Pa,j=`dialog-content`,M=``,N=`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,B.jsx)(Fa,{className:`mb-1 text-base font-semibold`,children:`Edit wiki link`}),F=(0,B.jsx)(Ia,{className:`mb-4 text-sm text-muted-foreground`,children:`Modify the link target, anchor, and display label.`}),t[43]=P,t[44]=F):(P=t[43],F=t[44]),ie=`mb-4 space-y-6`;let a;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(`span`,{className:`text-red-500`,children:`*`}),t[45]=a):a=t[45];let o;t[46]===h?o=t[47]:(o=(0,B.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:h,children:[`Page `,a]}),t[46]=h,t[47]=o);let c;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>u(e.target.value),t[48]=c):c=t[48];let d;t[49]!==l||t[50]!==E||t[51]!==h?(d=(0,B.jsx)(d4,{id:h,value:l,onChange:c,placeholder:`page-name`,autoFocus:!0,"aria-required":`true`,onKeyDown:E}),t[49]=l,t[50]=E,t[51]=h,t[52]=d):d=t[52],t[53]!==o||t[54]!==d?(A=(0,B.jsxs)(`div`,{children:[o,d]}),t[53]=o,t[54]=d,t[55]=A):A=t[55];let f;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`}),t[56]=f):f=t[56],t[57]===g?ne=t[58]:(ne=(0,B.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:g,children:[`Section`,` `,f]}),t[57]=g,t[58]=ne);let _;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>m(e.target.value),t[59]=_):_=t[59],t[60]!==g||t[61]!==p||t[62]!==E?(re=(0,B.jsx)(d4,{id:g,value:p,onChange:_,placeholder:`heading-slug`,onKeyDown:E}),t[60]=g,t[61]=p,t[62]=E,t[63]=re):re=t[63],L=i&&(0,B.jsx)(`div`,{role:`listbox`,id:v,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":p===e.slug,className:_l(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,p===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>m(p===e.slug?``:e.slug),children:[(0,B.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,B.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[17]=g,t[18]=p,t[19]=l,t[20]=E,t[21]=v,t[22]=b,t[23]=s,t[24]=n,t[25]=h,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P,t[34]=F,t[35]=I,t[36]=ee,t[37]=te,t[38]=ne,t[39]=re,t[40]=L,t[41]=ie}else D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31],N=t[32],P=t[33],F=t[34],I=t[35],ee=t[36],te=t[37],ne=t[38],re=t[39],L=t[40],ie=t[41];let ae;t[64]!==ne||t[65]!==re||t[66]!==L?(ae=(0,B.jsxs)(`div`,{children:[ne,re,L]}),t[64]=ne,t[65]=re,t[66]=L,t[67]=ae):ae=t[67];let oe;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional display text)`}),t[68]=oe):oe=t[68];let se;t[69]===_?se=t[70]:(se=(0,B.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:_,children:[`Label`,` `,oe]}),t[69]=_,t[70]=se);let ce;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>f(e.target.value),t[71]=ce):ce=t[71];let le;t[72]!==_||t[73]!==d||t[74]!==E?(le=(0,B.jsx)(d4,{id:_,value:d,onChange:ce,placeholder:`Custom display text`,onKeyDown:E}),t[72]=_,t[73]=d,t[74]=E,t[75]=le):le=t[75];let R;t[76]!==se||t[77]!==le?(R=(0,B.jsxs)(`div`,{children:[se,le]}),t[76]=se,t[77]=le,t[78]=R):R=t[78];let ue;t[79]!==A||t[80]!==ae||t[81]!==R||t[82]!==ie?(ue=(0,B.jsxs)(`div`,{className:ie,children:[A,ae,R]}),t[79]=A,t[80]=ae,t[81]=R,t[82]=ie,t[83]=ue):ue=t[83];let de;t[84]===s?de=t[85]:(de=(0,B.jsx)(mO,{variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),t[84]=s,t[85]=de);let fe;t[86]===l?fe=t[87]:(fe=l.trim(),t[86]=l,t[87]=fe);let pe=!fe,me;t[88]!==w||t[89]!==pe?(me=(0,B.jsx)(mO,{onClick:w,disabled:pe,children:`Save`}),t[88]=w,t[89]=pe,t[90]=me):me=t[90];let he;t[91]!==de||t[92]!==me?(he=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[de,me]}),t[91]=de,t[92]=me,t[93]=he):he=t[93];let ge;t[94]!==D||t[95]!==j||t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==ue||t[101]!==he?(ge=(0,B.jsxs)(D,{"data-slot":j,"data-ok-layer-spawned":M,className:N,children:[P,F,ue,he]}),t[94]=D,t[95]=j,t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=ue,t[101]=he,t[102]=ge):ge=t[102];let _e;t[103]!==O||t[104]!==I||t[105]!==ge?(_e=(0,B.jsxs)(O,{children:[I,ge]}),t[103]=O,t[104]=I,t[105]=ge,t[106]=_e):_e=t[106];let ve;return t[107]!==k||t[108]!==ee||t[109]!==te||t[110]!==_e?(ve=(0,B.jsx)(k,{open:ee,onOpenChange:te,children:_e}),t[107]=k,t[108]=ee,t[109]=te,t[110]=_e,t[111]=ve):ve=t[111],ve}function Wme(e){let t=(0,gn.c)(112),{editor:n,getPos:r,onClose:i}=e,a=r(),o=a==null?null:n.state.doc.nodeAt(a),s=String(o?.attrs.target??``),c=XM(o?.attrs.alias),l=XM(o?.attrs.anchor),u=ZM({target:s,alias:c,anchor:l}),{folderPaths:d,pages:f,loading:p}=u4(),m=Z1(s,l),h=m?.kind===`external`?m:null,g=t4(s,{pages:f,folderPaths:d,fallbackTargets:U2(s)}),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(null),x=n4(g);if(!o)return null;let S;t[0]!==n||t[1]!==r?(S=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n,t[1]=r,t[2]=S):S=t[2];let C=S,w;t[3]!==n||t[4]!==r||t[5]!==i?(w=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),i())},t[3]=n,t[4]=r,t[5]=i,t[6]=w):w=t[6];let T=w,E;t[7]!==l||t[8]!==h||t[9]!==g||t[10]!==b?(E=function(e){if(h){K2(h.url)?window.open(h.url,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,h.url);return}if(g.kind===`create`){b(`missing`);return}let t=g.hashDocName;if(e.newTab){Z2({docName:t,anchor:l});return}if(l){let e=window.location.hash.match(/^#\/([^?#/]+)/);if((e?decodeURIComponent(e[1]):null)===t){let e=document.getElementById(l);e&&e.scrollIntoView({behavior:`smooth`,block:`start`})}window.location.hash=`#/${t}?anchor=${encodeURIComponent(l)}`;return}window.location.hash=`#/${t}`},t[7]=l,t[8]=h,t[9]=g,t[10]=b,t[11]=E):E=t[11];let D=E,O;t[12]!==c||t[13]!==y||t[14]!==n||t[15]!==r||t[16]!==u||t[17]!==s?(O=function(e){if(y===`missing`&&e!==s){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:c??u}))}},t[12]=c,t[13]=y,t[14]=n,t[15]=r,t[16]=u,t[17]=s,t[18]=O):O=t[18];let k=O,A=!h&&!p&&g.kind===`navigate`&&g.displayState===`resolved`,j=!h&&!p&&g.kind===`navigate`&&g.displayState===`folder`,M=!h&&!p&&g.kind===`create`,N,P,F,I,ee,te,ne,re,L;if(t[19]!==h||t[20]!==j||t[21]!==A||t[22]!==M||t[23]!==p||t[24]!==i){if(p){let e;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Qn,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[34]=e):e=t[34],P={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(h){let e;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Hn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[35]=e):e=t[35],P={icon:e,text:`External wiki link`,className:`text-foreground`}}else if(j){let e;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Gn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[36]=e):e=t[36],P={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(M){let e;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[37]=e):e=t[37],P={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else if(A){let e;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Wn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[38]=e):e=t[38],P={icon:e,text:`Wiki link`,className:`text-foreground`}}else{let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(Vn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[39]=e):e=t[39],P={icon:e,text:`Unrecognized wiki link`,className:`text-muted-foreground`}}N=e4,L=`wiki-link`,F=`Wiki link options`,I=i,ne=`mb-2 flex items-start gap-2 pr-8`,re=(0,B.jsx)(`div`,{className:_l(`mt-0.5 flex shrink-0`,P.className),children:P.icon}),te=`flex-1 min-w-0`,ee=_l(`text-sm font-medium`,P.className),t[19]=h,t[20]=j,t[21]=A,t[22]=M,t[23]=p,t[24]=i,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=ee,t[30]=te,t[31]=ne,t[32]=re,t[33]=L}else N=t[25],P=t[26],F=t[27],I=t[28],ee=t[29],te=t[30],ne=t[31],re=t[32],L=t[33];let ie;t[40]!==P.text||t[41]!==ee?(ie=(0,B.jsx)(`div`,{className:ee,children:P.text}),t[40]=P.text,t[41]=ee,t[42]=ie):ie=t[42];let ae=h?h.url:`[[${s}${l?`#${l}`:``}]]`,oe=h?h.url:`[[${s}${l?`#${l}`:``}]]`,se;t[43]!==ae||t[44]!==oe?(se=(0,B.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:ae,children:oe}),t[43]=ae,t[44]=oe,t[45]=se):se=t[45];let ce;t[46]!==ie||t[47]!==se||t[48]!==te?(ce=(0,B.jsxs)(`div`,{className:te,children:[ie,se]}),t[46]=ie,t[47]=se,t[48]=te,t[49]=ce):ce=t[49];let le;t[50]!==ce||t[51]!==ne||t[52]!==re?(le=(0,B.jsxs)(`div`,{className:ne,children:[re,ce]}),t[50]=ce,t[51]=ne,t[52]=re,t[53]=le):le=t[53];let R;t[54]!==h||t[55]!==D||t[56]!==M||t[57]!==i?(R=M?null:(0,B.jsx)(mO,{size:`sm`,variant:`default`,onClick:()=>{D({}),i()},children:h?`Open in new tab`:`Open`}),t[54]=h,t[55]=D,t[56]=M,t[57]=i,t[58]=R):R=t[58];let ue;t[59]!==M||t[60]!==b?(ue=M?(0,B.jsx)(mO,{size:`sm`,variant:`default`,onClick:()=>b(`missing`),children:`Create page`}):null,t[59]=M,t[60]=b,t[61]=ue):ue=t[61];let de;t[62]!==x||t[63]!==j||t[64]!==b?(de=j&&x?(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,onClick:()=>b(`folder-index`),children:[(0,B.jsx)(Un,{className:`size-3.5`,"aria-hidden":`true`}),`Create index`]}):null,t[62]=x,t[63]=j,t[64]=b,t[65]=de):de=t[65];let fe;t[66]===v?fe=t[67]:(fe=()=>v(!0),t[66]=v,t[67]=fe);let pe;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,B.jsx)($n,{className:`size-3.5`,"aria-hidden":`true`}),t[68]=pe):pe=t[68];let me;t[69]===fe?me=t[70]:(me=(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,onClick:fe,children:[pe,`Edit`]}),t[69]=fe,t[70]=me);let he;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,B.jsx)(tr,{className:`size-3.5`,"aria-hidden":`true`}),t[71]=he):he=t[71];let ge;t[72]===T?ge=t[73]:(ge=(0,B.jsxs)(mO,{size:`sm`,variant:`outline`,className:`text-red-700 hover:bg-red-50 hover:text-red-800 dark:text-red-300 dark:hover:bg-red-100/10 dark:hover:text-red-200`,onClick:T,children:[he,`Remove`]}),t[72]=T,t[73]=ge);let _e;t[74]!==R||t[75]!==ue||t[76]!==de||t[77]!==me||t[78]!==ge?(_e=(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[R,ue,de,me,ge]}),t[74]=R,t[75]=ue,t[76]=de,t[77]=me,t[78]=ge,t[79]=_e):_e=t[79];let ve;t[80]!==N||t[81]!==F||t[82]!==I||t[83]!==le||t[84]!==_e||t[85]!==L?(ve=(0,B.jsxs)(N,{kind:L,ariaLabel:F,onDeactivate:I,children:[le,_e]}),t[80]=N,t[81]=F,t[82]=I,t[83]=le,t[84]=_e,t[85]=L,t[86]=ve):ve=t[86];let ye=y!==null,be;t[87]===b?be=t[88]:(be=e=>{e||b(null)},t[87]=b,t[88]=be);let xe=y===`folder-index`&&x?x.initialDir:g.kind===`create`?g.initialDir:``,Se=y===`folder-index`&&x?x.suggestedName:g.kind===`create`?g.suggestedName:void 0,Ce;t[89]!==y||t[90]!==x||t[91]!==s?(Ce=y===`folder-index`&&x?(0,B.jsxs)(B.Fragment,{children:[`Create an index note for`,` `,(0,B.jsxs)(`span`,{className:`font-medium text-foreground`,children:[x.initialDir,`/`]})]}):(0,B.jsxs)(B.Fragment,{children:[`Create a page for `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:s})]}),t[89]=y,t[90]=x,t[91]=s,t[92]=Ce):Ce=t[92];let we;t[93]!==k||t[94]!==ye||t[95]!==be||t[96]!==xe||t[97]!==Se||t[98]!==Ce?(we=(0,B.jsx)(p4,{open:ye,onOpenChange:be,kind:`file`,initialDir:xe,suggestedName:Se,description:Ce,onCreated:k}),t[93]=k,t[94]=ye,t[95]=be,t[96]=xe,t[97]=Se,t[98]=Ce,t[99]=we):we=t[99];let Te;t[100]!==c||t[101]!==l||t[102]!==_||t[103]!==C||t[104]!==f||t[105]!==v||t[106]!==s?(Te=(0,B.jsx)(Ume,{open:_,target:s,alias:c,anchor:l,pages:f,onOpenChange:v,onSave:C}),t[100]=c,t[101]=l,t[102]=_,t[103]=C,t[104]=f,t[105]=v,t[106]=s,t[107]=Te):Te=t[107];let Ee;return t[108]!==ve||t[109]!==we||t[110]!==Te?(Ee=(0,B.jsxs)(B.Fragment,{children:[ve,we,Te]}),t[108]=ve,t[109]=we,t[110]=Te,t[111]=Ee):Ee=t[111],Ee}var Gme=0;function Kme(){return`wiki-link-${++Gme}`}function qme(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}var Jme=QM.extend({priority:200,addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=Kme(),{dom:i}=qme({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),a=t,o=()=>{let e=n();return typeof e==`number`?e:void 0},s=_4(e);return s.register({type:`wikiLink`,nodeId:r,getPos:o,controls:{propPanel:t=>(0,z.createElement)(Wme,{editor:e,getPos:o,onClose:t.deactivate})},handlePrimary:({newTab:e})=>{if(!e)return!1;let t=a.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=Z1(n,typeof t.anchor==`string`?t.anchor:null);return r?r.kind===`doc`?(Z2({docName:r.docName,anchor:r.anchor}),!0):K2(r.url)?(X2(r.url),!0):!1:!1}}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;a=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);return i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`),i.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{s.deregister(r)}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(E4.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(E4.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[lme(this.editor)]}}),I4=[...$M.map(e=>e.name===`jsxComponent`?Mme:e.name===`rawMdxFallback`?Ime:e.name===`wikiLink`?Jme:e.name===`link`?Sme:e),Hme,Ffe.configure({allowedMimeTypes:[...NO],onDrop(e,t,n){for(let r of t)y2(r,e,n)},onPaste(e,t,n){for(let n of t)y2(n,e,e.state.selection.from)}}),hpe,mpe,Vfe];function L4(e){return e===jO}var R4=0;function Yme(){return R4}function Xme(){R4=Date.now()}function Zme(e){let{xmlFragment:t,ytext:n}=e,r=(e,t)=>{},i=(e,t)=>{};return t.observeDeep(r),n.observe(i),()=>{t.unobserveDeep(r),n.unobserve(i)}}var Qme=3e4,z4=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},B4=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},$me=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},V4=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},H4=new Map,U4=!1;function W4(){for(let e of H4.values())if(!e.settled)return!0;return!1}function G4(){typeof document>`u`||document.visibilityState===`visible`&&ehe(Date.now())}function ehe(e){let t=[];for(let[n,r]of H4){if(r.settled)continue;let i=e-r.createdAt;if(i<3e4)continue;r.settled=!0;let a=new z4(n,i);J4(r),r.reject(a),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return W4()||K4(),t.length}function the(){U4||typeof document>`u`||(document.addEventListener(`visibilitychange`,G4),U4=!0)}function K4(){U4&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,G4),U4=!1))}var q4=new Map;function J4(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function nhe(e,t){let n=H4.get(e);if(n)return n.promise;let r=q4.get(e);if(r!==void 0){q4.delete(e);let n=r===`timeout`?new z4(e,0):new B4(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),vl(`ok/sync/create`,{docName:e,warm:!1,armed:r}),vl(`ok/sync/reject`,{docName:e,reason:`armed-${r}`});let i=ihe(n);return H4.set(e,ahe(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`),vl(`ok/sync/create`,{docName:e,warm:!0}),vl(`ok/sync/resolve`,{docName:e,elapsedMs:0,warm:!0});let n=Promise.resolve();return H4.set(e,rhe(n,t)),n}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=H4.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`),vl(`ok/sync/resolve`,{docName:e,elapsedMs:n,warm:!1}),J4(t),W4()||K4(),t.resolve()},l=t=>{let n=H4.get(e);if(!n||n.settled)return;n.settled=!0;let r=new B4(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),vl(`ok/sync/reject`,{docName:e,reason:`pre-sync-disconnect`}),J4(n),W4()||K4(),n.reject(r)},u=setTimeout(()=>{let t=H4.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new z4(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),vl(`ok/sync/reject`,{docName:e,reason:`timeout`,elapsedMs:n}),J4(t),W4()||K4(),t.reject(r)},Qme),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,detached:!1};return H4.set(e,d),t.on(`synced`,c),t.on(`close`,l),the(),vl(`ok/sync/create`,{docName:e,warm:!1}),s}function rhe(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,detached:!0}}function ihe(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function ahe(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,detached:!0}}function Y4(e){let t=H4.get(e);t&&(t.settled=!0,J4(t),H4.delete(e),W4()||K4())}function ohe(e,t){let n=H4.get(e);return!n||n.settled?!1:(n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),J4(n),W4()||K4(),n.reject(t),!0)}var she=__(I4),che=4e3,lhe=5e3,uhe=class{entries=new Map;lruOrder=[];activeDocName=null;maxSize;wsUrl;recycleDebounceMs;onChange=null;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n??che}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}open(e){if(L4(e))return null;let t=this.entries.get(e);if(t)return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),t;this.entries.size>=this.maxSize&&this.evictLru();let n=new t2({url:this.wsUrl,name:e,forceSyncInterval:lhe}),r={provider:n,observerCleanup:null,syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),hasSynced:!1,tearingDown:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1};return n.on(`status`,({status:t})=>{r.tearingDown||this.entries.get(e)!==r||t===`disconnected`&&(r.syncState=`disconnected`,this.notify())}),n.on(`synced`,()=>{if(!(r.tearingDown||this.entries.get(e)!==r)&&(r.syncState=`synced`,r.hasSynced=!0,r.pendingRecycleTimer&&=(clearTimeout(r.pendingRecycleTimer),null),this.notify(),!r.observerCleanup))try{let t=n.document,i=new O$({extensions:I4});r.observerCleanup=Zme({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:i,schema:she,onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),r.bridgeSetupFailed=!0,ohe(e,new V4(e,t))}}),n.on(`disconnect`,()=>{r.tearingDown||this.entries.get(e)!==r||(r.syncState=`disconnected`,this.notify(),r.hasSynced&&n.unsyncedChanges===0&&!r.pendingRecycleTimer&&(r.pendingRecycleTimer=setTimeout(()=>{r.pendingRecycleTimer=null,!(r.tearingDown||this.entries.get(e)!==r)&&this.recycleDisconnectedEntry(e)},this.recycleDebounceMs)))}),this.entries.set(e,r),this.touch(e),this.notify(),r}prewarm(e){if(L4(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this.entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this.entries.values())this.destroyEntry(e);this.entries.clear(),this.lruOrder=[],this.activeDocName=null,this.onChange=null}evictLru(){for(let e of this.lruOrder)if(e!==this.activeDocName){vl(`ok/pool/evict-lru`,{docName:e}),this.close(e);return}}destroyEntry(e){e.tearingDown=!0,e.pendingRecycleTimer&&=(clearTimeout(e.pendingRecycleTimer),null),Y4(e.docName),u2(e.docName),d2(e.docName),e.observerCleanup?.(),e.observerCleanup=null;try{e.provider.destroy()}catch(t){console.warn(`[ProviderPool] Provider destroy failed for ${e.docName}:`,t)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.tearingDown)return;let n=this.activeDocName===e;if(vl(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.destroyEntry(t),this.entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},X4=`ok-pin-v1`,Z4=!1;function Q4(e){Z4||(Z4=!0,console.warn(`[DocumentContext] localStorage unavailable — pinned doc will not persist across tabs/reloads.`,e))}function dhe(){if(typeof window>`u`)return null;try{return window.localStorage.getItem(X4)}catch(e){return Q4(e),null}}function $4(e){if(!(typeof window>`u`))try{e===null?window.localStorage.removeItem(X4):window.localStorage.setItem(X4,e)}catch(e){Q4(e)}}var e3=(0,z.createContext)(null),t3=null;function n3(e){return t3||=new uhe(10,e),t3}var fhe={activeDocName:null,activeProvider:null,syncState:`connecting`,poolEntries:[]};function r3(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,poolEntries:n}}function phe(e){let t=(0,gn.c)(40),{children:n}=e,[r,i]=(0,z.useState)(fhe),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),{collabUrl:l,terminal:u,lastError:d,retry:f}=Hue(),p,m;t[0]===l?(p=t[1],m=t[2]):(p=()=>{if(l===null)return;let e=n3(l);i(r3(e)),e.setOnChange(()=>i(r3(e)));let t=dhe();return t!==null&&c(t),()=>{e.setOnChange(null)}},m=[l],t[0]=l,t[1]=p,t[2]=m),(0,z.useEffect)(p,m);let h;t[3]===l?h=t[4]:(h=e=>{if(vl(`ok/nav/open-document`,{docName:e,transition:!1}),l===null)return;let t=n3(l);t.open(e)&&(t.setActive(e),o({kind:`doc`,target:e,docName:e}))},t[3]=l,t[4]=h);let g=h,_;t[5]===g?_=t[6]:(_=e=>{vl(`ok/nav/open-document`,{docName:e,transition:!1}),g(e)},t[5]=g,t[6]=_);let v=_,y;t[7]===l?y=t[8]:(y=e=>{if(l===null)return;let t=n3(l),n=TO(e);n?(t.open(n),t.setActive(n)):t.clearActive(),o(e)},t[7]=l,t[8]=y);let b=y,x;t[9]===b?x=t[10]:(x=e=>{vl(`ok/nav/open-target`,{docName:TO(e),kind:e.kind,transition:!1}),b(e)},t[9]=b,t[10]=x);let S=x,C,w,T,E;t[11]===l?(C=t[12],w=t[13],T=t[14],E=t[15]):(w=()=>{if(l===null){o(null);return}n3(l).clearActive(),o(null)},T=e=>{l!==null&&(n3(l).close(e),o(t=>t&&(TO(t)===e?null:t)))},E=e=>{l!==null&&n3(l).recycle(e)},C=e=>{l!==null&&n3(l).prewarm(e)},t[11]=l,t[12]=C,t[13]=w,t[14]=T,t[15]=E);let D,O;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{c(e),$4(e)},O=()=>{c(null),$4(null)},t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k;t[18]!==a||t[19]!==d||t[20]!==u||t[21]!==l||t[22]!==g||t[23]!==v||t[24]!==b||t[25]!==S||t[26]!==s||t[27]!==f||t[28]!==r.activeDocName||t[29]!==r.activeProvider||t[30]!==r.poolEntries||t[31]!==r.syncState||t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==E?(k={activeTarget:a,activeDocName:r.activeDocName,activeProvider:r.activeProvider,syncState:r.syncState,poolEntries:r.poolEntries,openDocument:g,openDocumentTransition:v,openTarget:b,openTargetTransition:S,clearTarget:w,closeDocument:T,recycleDocument:E,prewarm:C,pinnedDoc:s,pin:D,unpin:O,collabUrl:l,collabTerminal:u,collabLastError:d,retryCollab:f},t[18]=a,t[19]=d,t[20]=u,t[21]=l,t[22]=g,t[23]=v,t[24]=b,t[25]=S,t[26]=s,t[27]=f,t[28]=r.activeDocName,t[29]=r.activeProvider,t[30]=r.poolEntries,t[31]=r.syncState,t[32]=C,t[33]=w,t[34]=T,t[35]=E,t[36]=k):k=t[36];let A=k,j;return t[37]!==n||t[38]!==A?(j=(0,B.jsx)(e3,{value:A,children:n}),t[37]=n,t[38]=A,t[39]=j):j=t[39],j}function i3(){let e=(0,z.use)(e3);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function mhe(){let e=(0,gn.c)(3),{openDocumentTransition:t,openTargetTransition:n}=i3(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}var a3=new Map;function o3(e,t){a3.set(e,t)}function hhe(e){let t=a3.get(e)??null;return a3.delete(e),t}function ghe(e){a3.delete(e)}var s3=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[je.contextHash,r]]}addChild(e,t){e.prop(je.contextHash)!=this.hash&&(e=new ie(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new ie(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new ie(me.none,e,t,n,this.hashProp)})}},$;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})($||={});var _he=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},vhe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return d3(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function c3(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==$.OrderedList?v3:_3)(n,t,!1);return r>0&&(e.type!=$.BulletList||h3(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var l3={[$.Blockquote](e,t,n){return n.next==62?(n.markers.push(V3($.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(u3(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[$.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[$.OrderedList]:c3,[$.BulletList]:c3,[$.Document](){return!0}};function u3(e){return e==32||e==9||e==10||e==13}function d3(e,t=0){for(;t<e.length&&u3(e.charCodeAt(t));)t++;return t}function f3(e,t,n){for(;t>n&&u3(e.charCodeAt(t-1));)t--;return t}function p3(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function m3(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function h3(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!u3(n))return-1}return n&&e.next==45&&b3(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(A3.SetextHeading)>-1||r<3?-1:1}function g3(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function _3(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||u3(e.text.charCodeAt(e.pos+1)))&&(!n||g3(t,$.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function v3(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!u3(e.text.charCodeAt(r+1))||n&&!g3(t,$.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function y3(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function b3(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&u3(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var x3=/^[ \t]*$/,S3=/-->/,C3=/\?>/,w3=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,S3],[/^\s*<\?/,C3],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,x3],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,x3]];function T3(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=w3.length-+!!n;e<t;e++)if(w3[e][0].test(r))return e;return-1}function E3(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function D3(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==$.CodeText?e[r].to=n:e.push(V3($.CodeText,t,n))}var O3={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(D3(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){D3(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==$.CodeText?D3(o,e.from,e.to):o.push(e);s=[]}D3(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&D3(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=$.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish($.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=p3(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=f3(t.text,t.text.length,o),c=[V3($.CodeMark,r,r+a)];o<s&&c.push(V3($.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&D3(c,e.lineStart-1,e.lineStart),c.push(V3($.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(D3(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(D3(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish($.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=m3(t);return n<0?!1:(e.startContext($.Blockquote,t.pos),e.addNode($.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(h3(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode($.HorizontalRule,n),!0},BulletList(e,t){let n=_3(t,e,!1);if(n<0)return!1;e.block.type!=$.BulletList&&e.startContext($.BulletList,t.basePos,t.next);let r=E3(t,t.pos+1);return e.startContext($.ListItem,t.basePos,r-t.baseIndent),e.addNode($.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=v3(t,e,!1);if(n<0)return!1;e.block.type!=$.OrderedList&&e.startContext($.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=E3(t,t.pos+n);return e.startContext($.ListItem,t.basePos,r-t.baseIndent),e.addNode($.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=y3(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=f3(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!u3(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write($.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write($.HeaderMark,o-r,a-r);let c=s.finish($.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=T3(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=w3[n][1],a=[],o=i!=x3;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==S3?$.CommentBlock:i==C3?$.ProcessingInstructionBlock:$.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},yhe=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
289
+ `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&d3(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,V3($.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Z3(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(V3($.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Y3(e,d3(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=d3(e,this.pos),n=0;if(t>this.pos){let r=X3(e,t,this.start);if(r){let t=k3(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=k3(e,this.pos),n>0&&n<e.length?n:-1}else return k3(e,this.pos)}};function k3(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!u3(n))return-1}return t}var bhe=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:b3(t),i=t.next;if(r<0)return!1;let a=V3($.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,V3(i==61?$.SetextHeading1:$.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},A3={LinkReference(e,t){return t.content.charCodeAt(0)==91?new yhe(t):null},SetextHeading(){return new bhe}},xhe=[(e,t)=>y3(t)>=0,(e,t)=>p3(t)>=0,(e,t)=>m3(t)>=0,(e,t)=>_3(t,e,!0)>=0,(e,t)=>v3(t,e,!0)>=0,(e,t)=>h3(t,e,!0)>=0,(e,t)=>T3(t,e,!0)>=0],She={text:``,end:0},Che=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new vhe,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=s3.create($.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Dhe(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new _he(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
290
+ `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=e6(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=She;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+$[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
291
+ `?``:t;else{let e=t.indexOf(`
292
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=s3.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new ie(this.parser.nodeSet.types[e],L3,L3,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements($3(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?j3(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=$3(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish($.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?V3(this.parser.getNodeType(e),t,n,r):new B3(e,t)}get buffer(){return new R3(this.parser.nodeSet)}};function j3(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=j3(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new ie(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var M3=class e extends re{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Che(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=P3(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(N3(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=$.ATXHeading1&&c<=$.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(me.define({id:c,name:n,props:l&&[[je.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof eee?t[n]=s:Object.assign(t,s))}r=new te(e),t&&(r=r.extend(Oe(t)))}if(N3(n.props)&&(r=r.extend(...n.props)),N3(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(N3(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?F3(s,e.before):e.after?F3(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(N3(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?F3(l,e.before):e.after?F3(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new Q3(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function N3(e){return e!=null&&e.length>0}function P3(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=P3(e[0]);if(e.length==1)return t;let n=P3(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||L3).concat(t||L3),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function F3(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var I3=[me.none];for(let e=1,t;t=$[e];e++)I3[e]=me.define({id:e,name:t,props:e>=$.Escape?[]:[[je.group,e in l3?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var L3=[],R3=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return ie.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},z3=class{constructor(e,t,n,r=L3){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new R3(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},B3=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return L3}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function V3(e,t,n,r){return new z3(e,t,n,r)}var H3={resolve:`Emphasis`,mark:`EmphasisMark`},U3={resolve:`Emphasis`,mark:`EmphasisMark`},W3={},G3={},K3=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},whe=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,q3=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{q3=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var J3={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(whe.charCodeAt(t)==r)return e.append(V3($.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(V3($.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(V3($.InlineCode,n,r+1,[V3($.CodeMark,n,n+i),V3($.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(V3($.Autolink,n,n+1+i[0].length,[V3($.LinkMark,n,n+1),V3($.URL,n+1,n+i[0].length),V3($.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(V3($.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(V3($.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(V3($.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=q3.test(i),s=q3.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new K3(t==95?H3:U3,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(V3($.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(V3($.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new K3(W3,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new K3(G3,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof K3&&(r.type==W3||r.type==G3)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=The(e,i,r.type==W3?$.Link:$.Image,r.from,n+1);if(r.type==W3)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof K3&&t.type==W3&&(t.side=0)}return a.to}}return-1}};function The(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(V3($.LinkMark,r,r+(n==$.Image?2:1))),t.push(V3($.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Y3(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=X3(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(V3($.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(V3($.LinkMark,n,s)))}else if(o==91){let n=Z3(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return V3(n,r,s,t)}function Y3(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return V3($.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(u3(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?V3($.URL,t+n,i+n):i==e.length?null:!1}}function X3(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return V3($.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Z3(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:V3($.LinkLabel,t+n,a+1+n);else{if(r&&!u3(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var Q3=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new K3(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof K3&&(t.type==W3||t.type==G3))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof K3&&n.type.resolve&&n.side&2))continue;let r=n.type==H3||n.type==U3,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof K3&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof z3&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new K3(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new K3(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof z3&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof K3&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof K3?t:null}skipSpace(e){return d3(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?V3(this.parser.getNodeType(e),t,n,r):new B3(e,t)}};Q3.linkStart=W3,Q3.imageStart=G3;function $3(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof z3&&(n[r]=new z3(t.type,t.from,t.to,$3(t.children,[e])))}else n.splice(r++,0,e)}return n}var Ehe=[$.CodeBlock,$.ListItem,$.OrderedList,$.BulletList],Dhe=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
293
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(je.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=e6(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new ie(e.parser.nodeSet.types[$.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(Ehe.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function e6(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var Ohe=Oe({"Blockquote/...":R.quote,HorizontalRule:R.contentSeparator,"ATXHeading1/... SetextHeading1/...":R.heading1,"ATXHeading2/... SetextHeading2/...":R.heading2,"ATXHeading3/...":R.heading3,"ATXHeading4/...":R.heading4,"ATXHeading5/...":R.heading5,"ATXHeading6/...":R.heading6,"Comment CommentBlock":R.comment,Escape:R.escape,Entity:R.character,"Emphasis/...":R.emphasis,"StrongEmphasis/...":R.strong,"Link/... Image/...":R.link,"OrderedList/... BulletList/...":R.list,"BlockQuote/...":R.quote,"InlineCode CodeText":R.monospace,"URL Autolink":R.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":R.processingInstruction,"CodeInfo LinkLabel":R.labelName,LinkTitle:R.string,Paragraph:R.content}),khe=new M3(new te(I3).extend(Ohe),Object.keys(O3).map(e=>O3[e]),Object.keys(O3).map(e=>A3[e]),Object.keys(O3),xhe,l3,Object.keys(J3).map(e=>J3[e]),Object.keys(J3),[]);function Ahe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function jhe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Ce((e,r)=>{let i=e.type.id;if(t&&(i==$.CodeBlock||i==$.FencedCode)){let n=``;if(i==$.FencedCode){let t=e.node.getChild($.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==$.CodeText,bracketed:i==$.FencedCode}}else if(n&&(i==$.HTMLBlock||i==$.HTMLTag||i==$.CommentBlock))return{parser:n,overlay:Ahe(e.node,e.from,e.to)};return null})}}var Mhe={resolve:`Strikethrough`,mark:`StrikethroughMark`},Nhe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":R.strikethrough}},{name:`StrikethroughMark`,style:R.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=q3.test(r),c=q3.test(i);return e.addDelimiter(Mhe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function t6(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function n6(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var r6=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,i6=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&r6.test(r=t.text.slice(t.pos))){let i=[];t6(e,n.content,0,i,n.start)==t6(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];t6(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},Phe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":R.heading}},`TableRow`,{name:`TableCell`,style:R.content},{name:`TableDelimiter`,style:R.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return n6(t.content,0)?new i6:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof i6)||!n6(t.text,t.basePos))return!1;let r=e.peekLine();return r6.test(r)&&t6(e,t.text,t.basePos)==t6(e,r,t.basePos)},before:`SetextHeading`}]},Fhe=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},Ihe={defineNodes:[{name:`Task`,block:!0,style:R.list},{name:`TaskMarker`,style:R.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new Fhe:null},after:`SetextHeading`}]},a6=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,o6=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Lhe=/[\w-]+\.[\w-]+($|\/)/,s6=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,c6=/\/[a-zA-Z\d@.]+/gy;function l6(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function Rhe(e,t){o6.lastIndex=t;let n=o6.exec(e);if(!n||Lhe.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&l6(e,t,r,`)`)>l6(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function u6(e,t){s6.lastIndex=t;let n=s6.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var d6=[Phe,Ihe,Nhe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;a6.lastIndex=r;let i=a6.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=Rhe(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=u6(e.text,r):(a=u6(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(c6.lastIndex=a,i=c6.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function f6(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),u3(s))break}return-1}}var zhe={defineNodes:[{name:`Superscript`,style:R.special(R.content)},{name:`SuperscriptMark`,style:R.processingInstruction}],parseInline:[{name:`Superscript`,parse:f6(94,`Superscript`,`SuperscriptMark`)}]},Bhe={defineNodes:[{name:`Subscript`,style:R.special(R.content)},{name:`SubscriptMark`,style:R.processingInstruction}],parseInline:[{name:`Subscript`,parse:f6(126,`Subscript`,`SubscriptMark`)}]},Vhe={defineNodes:[{name:`Emoji`,style:R.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},Hhe=55,Uhe=1,Whe=56,Ghe=2,Khe=57,qhe=3,p6=4,Jhe=5,m6=6,h6=7,g6=8,_6=9,v6=10,Yhe=11,Xhe=12,Zhe=13,y6=58,Qhe=14,$he=15,b6=59,x6=21,ege=23,S6=24,tge=25,C6=27,w6=28,nge=29,rge=32,ige=35,age=37,oge=38,sge=0,cge=1,lge={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},uge={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},T6={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function dge(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var E6=null,D6=null,O6=0;function k6(e,t){let n=e.pos+t;if(O6==n&&D6==e)return E6;let r=e.peek(t),i=``;for(;dge(r);)i+=String.fromCharCode(r),r=e.peek(++t);return D6=e,O6=n,E6=i?i.toLowerCase():r==fge||r==pge?void 0:null}var A6=60,j6=62,M6=47,fge=63,pge=33,mge=45;function N6(e,t){this.name=e,this.parent=t}var hge=[m6,v6,h6,g6,_6],gge=new Ke({start:null,shift(e,t,n,r){return hge.indexOf(t)>-1?new N6(k6(r,1)||``,e):e},reduce(e,t){return t==x6&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==m6||i==age?new N6(k6(r,1)||``,e):e},strict:!1}),_ge=new We((e,t)=>{if(e.next!=A6){e.next<0&&t.context&&e.acceptToken(y6);return}e.advance();let n=e.next==M6;n&&e.advance();let r=k6(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?$he:Qhe);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(Yhe);if(i&&uge[i])return e.acceptToken(y6,-2);if(t.dialectEnabled(sge))return e.acceptToken(Xhe);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(Zhe)}else{if(r==`script`)return e.acceptToken(h6);if(r==`style`)return e.acceptToken(g6);if(r==`textarea`)return e.acceptToken(_6);if(lge.hasOwnProperty(r))return e.acceptToken(v6);i&&T6[i]&&T6[i][r]?e.acceptToken(y6,-1):e.acceptToken(m6)}},{contextual:!0}),vge=new We(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(b6);break}if(e.next==mge)t++;else if(e.next==j6&&t>=2){n>=3&&e.acceptToken(b6,-2);break}else t=0;e.advance()}});function yge(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var bge=new We((e,t)=>{if(e.next==M6&&e.peek(1)==j6){let n=t.dialectEnabled(cge)||yge(t.context);e.acceptToken(n?Jhe:p6,2)}else e.next==j6&&e.acceptToken(p6,1)});function P6(e,t,n){let r=2+e.length;return new We(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==A6||a==1&&i.next==M6||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==j6){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var xge=P6(`script`,Hhe,Uhe),Sge=P6(`style`,Whe,Ghe),Cge=P6(`textarea`,Khe,qhe),wge=Oe({"Text RawText IncompleteTag IncompleteCloseTag":R.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":R.angleBracket,TagName:R.tagName,"MismatchedCloseTag/TagName":[R.tagName,R.invalid],AttributeName:R.attributeName,"AttributeValue UnquotedAttributeValue":R.attributeValue,Is:R.definitionOperator,"EntityReference CharacterReference":R.character,Comment:R.blockComment,ProcessingInst:R.processingInstruction,DoctypeDecl:R.documentMeta}),Tge=Ge.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:gge,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[wge],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[xge,Sge,Cge,bge,_ge,vge,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function F6(e,t){let n=Object.create(null);for(let r of e.getChildren(S6)){let e=r.getChild(tge),i=r.getChild(C6)||r.getChild(w6);e&&(n[t.read(e.from,e.to)]=i?i.type.id==C6?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function I6(e,t){let n=e.getChild(ege);return n?t.read(n.from,n.to):` `}function L6(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=F6(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function R6(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return Ce((e,t)=>{let s=e.type.id;if(s==nge)return L6(e,t,n);if(s==rge)return L6(e,t,r);if(s==ige)return L6(e,t,i);if(s==x6&&a.length){let n=e.node,r=n.firstChild,i=r&&I6(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=F6(r,t)))){let t=n.lastChild,i=t.type.id==oge?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==S6){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=I6(n.parent,t))continue;let e=n.lastChild;if(e.type.id==C6){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==w6)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var Ege=135,z6=1,Dge=136,Oge=137,B6=2,kge=138,Age=3,jge=4,V6=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Mge=58,Nge=40,H6=95,Pge=91,U6=45,Fge=46,Ige=35,Lge=37,Rge=38,zge=92,Bge=10,Vge=42;function W6(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function G6(e){return e>=48&&e<=57}function K6(e){return G6(e)||e>=97&&e<=102||e>=65&&e<=70}var q6=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(W6(c)||c==U6||c==H6||a&&G6(c))!a&&(c!=U6||s>0)&&(a=!0),o===s&&c==U6&&o++,r.advance();else if(c==zge&&r.peek(1)!=Bge){if(r.advance(),K6(r.next)){do r.advance();while(K6(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(B6)?t:c==Nge?n:e);break}}},Hge=new We(q6(Dge,B6,Oge),{contextual:!0}),Uge=new We(q6(kge,Age,jge),{contextual:!0}),Wge=new We(e=>{if(V6.includes(e.peek(-1))){let{next:t}=e;(W6(t)||t==H6||t==Ige||t==Fge||t==Vge||t==Pge||t==Mge&&W6(e.peek(1))||t==U6||t==Rge)&&e.acceptToken(Ege)}}),Gge=new We(e=>{if(!V6.includes(e.peek(-1))){let{next:t}=e;if(t==Lge&&(e.advance(),e.acceptToken(z6)),W6(t)){do e.advance();while(W6(e.next)||G6(e.next));e.acceptToken(z6)}}}),Kge=Oe({"AtKeyword import charset namespace keyframes media supports font-feature-values":R.definitionKeyword,"from to selector scope MatchFlag":R.keyword,NamespaceName:R.namespace,KeyframeName:R.labelName,KeyframeRangeName:R.operatorKeyword,TagName:R.tagName,ClassName:R.className,PseudoClassName:R.constant(R.className),IdName:R.labelName,"FeatureName PropertyName":R.propertyName,AttributeName:R.attributeName,NumberLiteral:R.number,KeywordQuery:R.keyword,UnaryQueryOp:R.operatorKeyword,"CallTag ValueName FontName":R.atom,VariableName:R.variableName,Callee:R.operatorKeyword,Unit:R.unit,"UniversalSelector NestingSelector":R.definitionOperator,"MatchOp CompareOp":R.compareOperator,"ChildOp SiblingOp, LogicOp":R.logicOperator,BinOp:R.arithmeticOperator,Important:R.modifier,Comment:R.blockComment,ColorLiteral:R.color,"ParenthesizedContent StringLiteral":R.string,":":R.punctuation,"PseudoOp #":R.derefOperator,"; , |":R.separator,"( )":R.paren,"[ ]":R.squareBracket,"{ }":R.brace}),qge={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},Jge={__proto__:null,or:104,and:104,not:112,only:112,layer:186},Yge={__proto__:null,selector:118,layer:182},Xge={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},Zge={__proto__:null,to:223},Qge=Ge.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[Kge],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Wge,Gge,Hge,Uge,1,2,3,4,new Ue(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>qge[e]||-1},{term:138,get:e=>Jge[e]||-1},{term:4,get:e=>Yge[e]||-1},{term:28,get:e=>Xge[e]||-1},{term:136,get:e=>Zge[e]||-1}],tokenPrec:2256}),J6=null;function Y6(){if(!J6&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));J6=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return J6||[]}var X6=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),Z6=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),$ge=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),e_e=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),Q6=/^(\w[\w-]*|-\w[\w-]*|)$/,t_e=/^-(-[\w-]*)?$/;function n_e(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var $6=new Ne,r_e=[`Declaration`];function i_e(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function e8(e,t,n){if(t.to-t.from>4096){let r=$6.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(xe.IncludeAnonymous);if(o.firstChild())do for(let t of e8(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return $6.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(r_e)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var a_e=(e=>t=>{let{state:n,pos:r}=t,i=j(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Y6(),validFor:Q6};if(i.name==`ValueName`)return{from:i.from,options:Z6,validFor:Q6};if(i.name==`PseudoClassName`)return{from:i.from,options:X6,validFor:Q6};if(e(i)||(t.explicit||a)&&n_e(i,n.doc))return{from:e(i)||a?i.from:r,options:e8(n.doc,i_e(i),e),validFor:t_e};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:Y6(),validFor:Q6};return{from:i.from,options:$ge,validFor:Q6}}if(i.name==`AtKeyword`)return{from:i.from,options:e_e,validFor:Q6};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:X6,validFor:Q6}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:Z6,validFor:Q6}:o.name==`Block`||o.name==`Styles`?{from:r,options:Y6(),validFor:Q6}:null})(e=>e.name==`VariableName`),t8=ce.define({name:`css`,parser:Qge.configure({props:[h.add({Declaration:ae()}),_.add({"Block KeyframeList":i})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function n8(){return new ke(t8,t8.data.of({autocomplete:a_e}))}var o_e=316,s_e=317,r8=1,c_e=2,l_e=3,u_e=4,d_e=318,f_e=320,p_e=321,m_e=5,h_e=6,g_e=0,i8=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],a8=125,__e=59,o8=47,v_e=42,y_e=43,b_e=45,x_e=60,S_e=44,C_e=63,w_e=46,T_e=91,E_e=new Ke({start:!1,shift(e,t){return t==m_e||t==h_e||t==f_e?e:t==p_e},strict:!1}),D_e=new We((e,t)=>{let{next:n}=e;(n==a8||n==-1||t.context)&&e.acceptToken(d_e)},{contextual:!0,fallback:!0}),O_e=new We((e,t)=>{let{next:n}=e,r;i8.indexOf(n)>-1||n==o8&&((r=e.peek(1))==o8||r==v_e)||n!=a8&&n!=__e&&n!=-1&&!t.context&&e.acceptToken(o_e)},{contextual:!0}),k_e=new We((e,t)=>{e.next==T_e&&!t.context&&e.acceptToken(s_e)},{contextual:!0}),A_e=new We((e,t)=>{let{next:n}=e;if(n==y_e||n==b_e){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(r8);e.acceptToken(n?r8:c_e)}}else n==C_e&&e.peek(1)==w_e&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(l_e))},{contextual:!0});function s8(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var j_e=new We((e,t)=>{if(e.next!=x_e||!t.dialectEnabled(g_e)||(e.advance(),e.next==o8))return;let n=0;for(;i8.indexOf(e.next)>-1;)e.advance(),n++;if(s8(e.next,!0)){for(e.advance(),n++;s8(e.next,!1);)e.advance(),n++;for(;i8.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==S_e)return;for(let t=0;;t++){if(t==7){if(!s8(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(u_e,-n)}),M_e=Oe({"get set async static":R.modifier,"for while do if else switch try catch finally return throw break continue default case defer":R.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":R.operatorKeyword,"let var const using function class extends":R.definitionKeyword,"import export from":R.moduleKeyword,"with debugger new":R.keyword,TemplateString:R.special(R.string),super:R.atom,BooleanLiteral:R.bool,this:R.self,null:R.null,Star:R.modifier,VariableName:R.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":R.function(R.variableName),VariableDefinition:R.definition(R.variableName),Label:R.labelName,PropertyName:R.propertyName,PrivatePropertyName:R.special(R.propertyName),"CallExpression/MemberExpression/PropertyName":R.function(R.propertyName),"FunctionDeclaration/VariableDefinition":R.function(R.definition(R.variableName)),"ClassDeclaration/VariableDefinition":R.definition(R.className),"NewExpression/VariableName":R.className,PropertyDefinition:R.definition(R.propertyName),PrivatePropertyDefinition:R.definition(R.special(R.propertyName)),UpdateOp:R.updateOperator,"LineComment Hashbang":R.lineComment,BlockComment:R.blockComment,Number:R.number,String:R.string,Escape:R.escape,ArithOp:R.arithmeticOperator,LogicOp:R.logicOperator,BitOp:R.bitwiseOperator,CompareOp:R.compareOperator,RegExp:R.regexp,Equals:R.definitionOperator,Arrow:R.function(R.punctuation),": Spread":R.punctuation,"( )":R.paren,"[ ]":R.squareBracket,"{ }":R.brace,"InterpolationStart InterpolationEnd":R.special(R.brace),".":R.derefOperator,", ;":R.separator,"@":R.meta,TypeName:R.typeName,TypeDefinition:R.definition(R.typeName),"type enum interface implements namespace module declare":R.definitionKeyword,"abstract global Privacy readonly override":R.modifier,"is keyof unique infer asserts":R.operatorKeyword,JSXAttributeValue:R.attributeValue,JSXText:R.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":R.angleBracket,"JSXIdentifier JSXNameSpacedName":R.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":R.attributeName,"JSXBuiltin/JSXIdentifier":R.standard(R.tagName)}),N_e={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},P_e={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},F_e={__proto__:null,"<":193},I_e=Ge.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:E_e,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[M_e],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[O_e,k_e,A_e,j_e,2,3,4,5,6,7,8,9,10,11,12,13,14,D_e,new Ue("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Ue(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>N_e[e]||-1},{term:343,get:e=>P_e[e]||-1},{term:95,get:e=>F_e[e]||-1}],tokenPrec:15201}),c8=[Re("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),Re("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),Re("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),Re(`do {
294
+ \${}
295
+ } while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),Re(`while (\${}) {
296
+ \${}
297
+ }`,{label:`while`,detail:`loop`,type:`keyword`}),Re(`try {
298
+ \${}
299
+ } catch (\${error}) {
300
+ \${}
301
+ }`,{label:`try`,detail:`/ catch block`,type:`keyword`}),Re(`if (\${}) {
302
+ \${}
303
+ }`,{label:`if`,detail:`block`,type:`keyword`}),Re(`if (\${}) {
304
+ \${}
305
+ } else {
306
+ \${}
307
+ }`,{label:`if`,detail:`/ else block`,type:`keyword`}),Re(`class \${name} {
308
+ constructor(\${params}) {
309
+ \${}
310
+ }
311
+ }`,{label:`class`,detail:`definition`,type:`keyword`}),Re('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),Re('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],L_e=c8.concat([Re(`interface \${name} {
312
+ \${}
313
+ }`,{label:`interface`,detail:`definition`,type:`keyword`}),Re("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),Re(`enum \${name} {
314
+ \${}
315
+ }`,{label:`enum`,detail:`definition`,type:`keyword`})]),l8=new Ne,u8=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function d8(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var R_e=[`FunctionDeclaration`],z_e={FunctionDeclaration:d8(`function`),ClassDeclaration:d8(`class`),ClassExpression:()=>!0,EnumDeclaration:d8(`constant`),TypeAliasDeclaration:d8(`type`),NamespaceDeclaration:d8(`namespace`),VariableDefinition(e,t){e.matchContext(R_e)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function f8(e,t){let n=l8.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(xe.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=z_e[t.name];if(e&&e(t,a)||u8.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of f8(e,t.node))r.push(n);return!1}}),l8.set(t,r),r}var p8=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,m8=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function B_e(e){let t=j(e.state).resolveInner(e.pos,-1);if(m8.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&p8.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)u8.has(n.name)&&(r=r.concat(f8(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:p8}}var h8=ce.define({name:`javascript`,parser:I_e.configure({props:[h.add({IfStatement:ae({except:/^\s*({|else\b)/}),TryStatement:ae({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:nee,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:ree({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":ae({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),_.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":i,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),g8={test:e=>/^JSX/.test(e.name),facet:Pe({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},_8=h8.configure({dialect:`ts`},`typescript`),v8=h8.configure({dialect:`jsx`,props:[p.add(e=>e.isTop?[g8]:void 0)]}),y8=h8.configure({dialect:`jsx ts`,props:[p.add(e=>e.isTop?[g8]:void 0)]},`typescript`),b8=e=>({label:e,type:`keyword`}),x8=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(b8),V_e=x8.concat([`declare`,`implements`,`private`,`protected`,`public`].map(b8));function S8(e={}){let t=e.jsx?e.typescript?y8:v8:e.typescript?_8:h8,n=e.typescript?L_e.concat(V_e):c8.concat(x8);return new ke(t,[h8.data.of({autocomplete:He(m8,aee(n))}),h8.data.of({autocomplete:B_e}),e.jsx?W_e:[]])}function H_e(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function C8(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var U_e=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),W_e=oe.inputHandler.of((e,t,n,r,i)=>{if((U_e?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!h8.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=j(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=C8(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:m.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=H_e(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=C8(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),w8=[`_blank`,`_self`,`_top`,`_parent`],T8=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],E8=[`get`,`post`,`put`,`delete`],D8=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],O8=[`true`,`false`],k8={},G_e={a:{attrs:{href:null,ping:null,type:null,media:null,target:w8,hreflang:null}},abbr:k8,address:k8,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:k8,aside:k8,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:k8,base:{attrs:{href:null,target:w8}},bdi:k8,bdo:k8,blockquote:{attrs:{cite:null}},body:k8,br:k8,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:D8,formmethod:E8,formnovalidate:[`novalidate`],formtarget:w8,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:k8,center:k8,cite:k8,code:k8,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:k8,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:k8,div:k8,dl:k8,dt:k8,em:k8,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:k8,figure:k8,footer:k8,form:{attrs:{action:null,name:null,"accept-charset":T8,autocomplete:[`on`,`off`],enctype:D8,method:E8,novalidate:[`novalidate`],target:w8}},h1:k8,h2:k8,h3:k8,h4:k8,h5:k8,h6:k8,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:k8,hgroup:k8,hr:k8,html:{attrs:{manifest:null}},i:k8,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:D8,formmethod:E8,formnovalidate:[`novalidate`],formtarget:w8,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:k8,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:k8,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:k8,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:T8,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:k8,noscript:k8,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:k8,param:{attrs:{name:null,value:null}},pre:k8,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:k8,rt:k8,ruby:k8,samp:k8,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:T8}},section:k8,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:k8,source:{attrs:{src:null,type:null,media:null}},span:k8,strong:k8,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:k8,summary:k8,sup:k8,table:k8,tbody:k8,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:k8,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:k8,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:k8,time:{attrs:{datetime:null}},title:k8,tr:k8,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:k8,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:k8},A8={accesskey:null,class:null,contenteditable:O8,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:O8,autocorrect:O8,autocapitalize:O8,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":O8,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":O8,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":O8,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":O8,"aria-hidden":O8,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":O8,"aria-multiselectable":O8,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":O8,"aria-relevant":null,"aria-required":O8,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},j8=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of j8)A8[e]=null;var M8=class{constructor(e,t){this.tags={...G_e,...e},this.globalAttrs={...A8,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};M8.default=new M8;function N8(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function P8(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function F8(e,t,n){return n.tags[N8(e,P8(t))]?.children||n.allTags}function I8(e,t){let n=[];for(let r=P8(t);r&&!r.type.isTop;r=P8(r.parent)){let i=N8(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var L8=/^[:\-\.\w\u00b7-\uffff]*$/;function R8(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=P8(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:F8(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(I8(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function z8(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:I8(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:L8}}function K_e(e,t,n,r){let i=[],a=0;for(let r of F8(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of I8(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function q_e(e,t,n,r,i){let a=P8(n),o=a?t.tags[N8(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:L8}}function J_e(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=P8(n),i=r?t.tags[N8(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function B8(e,t){let{state:n,pos:r}=t,i=j(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?z8(n,i,i.from,r):R8(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?R8(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?z8(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?q_e(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?J_e(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?K_e(n,e,i,r):null}function Y_e(e){return B8(M8.default,e)}function X_e(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new M8(t,n):M8.default;return e=>B8(r,e)}var Z_e=h8.parser.configure({top:`SingleExpression`}),V8=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:_8.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:v8.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:y8.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Z_e},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:h8.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:t8.parser}],H8=[{name:`style`,parser:t8.parser.configure({top:`Styles`})}].concat(j8.map(e=>({name:e,parser:h8.parser}))),U8=ce.define({name:`html`,parser:Tge.configure({props:[h.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),_.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),he.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),W8=U8.configure({wrap:R6(V8,H8)});function G8(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=R6((e.nestedLanguages||[]).concat(V8),(e.nestedAttributes||[]).concat(H8))),new ke(n?U8.configure({wrap:n,dialect:t}):t?W8.configure({dialect:t}):W8,[W8.data.of({autocomplete:X_e(e)}),e.autoCloseTags===!1?[]:Q_e,S8().support,n8().support])}var K8=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),Q_e=oe.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!W8.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=j(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=N8(o.doc,t.parent,n))&&!K8.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=N8(o.doc,e,n))&&!K8.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:m.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),q8=Pe({commentTokens:{block:{open:`<!--`,close:`-->`}}}),J8=new je,Y8=khe.configure({props:[_.add(e=>!e.is(`Block`)||e.is(`Document`)||X8(e)!=null||$_e(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),J8.add(X8),h.add({Document:()=>null}),O.add({Document:q8})]});function X8(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function $_e(e){return e.name==`OrderedList`||e.name==`BulletList`}function eve(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=X8(e.type))!=null&&r<=t)break;n=e}return n.to}var tve=de.of((e,t,n)=>{for(let r=j(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(J8);if(e==null)continue;let t=eve(r,e);if(t>n)return{from:n,to:t}}return null});function Z8(e){return new N(q8,e,[],`markdown`)}var nve=Z8(Y8),Q8=Z8(Y8.configure([d6,Bhe,zhe,Vhe,{props:[_.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function rve(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):ye.matchLanguageName(e,n,!0),t instanceof ye)return t.support?t.support.language.parser:I.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var $8=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+t5(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function e5(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new $8(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new $8(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new $8(i.parent,s,s+t,a[1],e,n,i))}}return r}function t5(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function n5(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=t5(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function r5(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(l)!=` `)return e;let r=Ae(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var ive=((e={})=>({state:t,dispatch:n})=>{let r=j(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!Q8.isActiveAt(t,n.from,-1)&&!Q8.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=e5(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&n5(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&n5(e.item,i,r),{range:m.cursor(t+n.length),changes:r}}else{let e=a5(c,t,s);return{range:m.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&n5(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?Ae(s.text,4,c[e+1].from)-p.length:null);let h=o;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return p=r5(p,t),ave(l.node,t.doc)&&(p=a5(c,t,s)+t.lineBreak+p),d.push({from:h,to:o,insert:t.lineBreak+p}),{range:m.cursor(h+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function i5(e){return e.name==`QuoteMark`||e.name==`ListMark`}function ave(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function a5(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?Ae(n.text,4,e[t+1].from)-r.length:null,t<i);return r5(r,t)}function ove(e,t){let n=e.resolveInner(t,-1),r=t;i5(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(i5(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var sve=[{key:`Enter`,run:ive},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=j(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Q8.isActiveAt(e,t.from)){let t=a.lineAt(i),r=e5(ove(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:m.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(Ae(t.text,4,n.to)-Ae(t.text,4,n.from));return r==t.from&&(i=r5(i,e)),{range:m.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:m.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],o5=G8({matchClosingTags:!1});function cve(t={}){let{codeLanguages:n,defaultCodeLanguage:r,addKeymap:i=!0,base:{parser:a}=nve,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=o5}=t;if(!(a instanceof M3))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],u=[c.support,tve],d;s&&u.push(fve),r instanceof ke?(u.push(r.support),d=r.language):r&&(d=r);let f=n||d?rve(n,d):void 0;l.push(jhe({codeParser:f,htmlParser:c.language.parser})),i&&u.push(A.high(e.of(sve)));let p=Z8(a.configure(l));return o&&u.push(p.data.of({autocomplete:lve})),new ke(p,u)}function lve(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=j(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:uve(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var s5=null;function uve(){if(s5)return s5;let e=Y_e(new see(Te.create({extensions:o5}),0,!0));return s5=e?e.options:[]}var dve=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,fve=oe.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Q8.isActiveAt(t.state,n.from,1)))return!1;let i=j(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||dve.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function c5(){return c5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c5.apply(null,arguments)}var l5=e=>{var{theme:t,settings:n={},styles:r=[]}=e,i={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(i[`&`]=a),n.fontFamily&&(i[`&.cm-editor .cm-scroller`]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[`.cm-gutters`].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[`.cm-gutters`].color=n.gutterForeground),n.gutterBorder&&(i[`.cm-gutters`].borderRightColor=n.gutterBorder),n.caret&&(i[`.cm-content`]={caretColor:n.caret},i[`.cm-cursor, .cm-dropCursor`]={borderLeftColor:n.caret});var o={};return n.gutterActiveForeground&&(o.color=n.gutterActiveForeground),n.lineHighlight&&(i[`.cm-activeLine`]={backgroundColor:n.lineHighlight},o.backgroundColor=n.lineHighlight),i[`.cm-activeLineGutter`]=o,n.selection&&(i[`&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection`]={background:n.selection+` !important`}),n.selectionMatch&&(i[`& .cm-selectionMatch`]={backgroundColor:n.selectionMatch}),[oe.theme(i,{dark:t===`dark`}),we(_e.define(r))]},pve={background:`#2E3235`,foreground:`#DDDDDD`,caret:`#DDDDDD`,selection:`#202325`,selectionMatch:`#202325`,gutterBackground:`#292d30`,gutterForeground:`#808080`,gutterBorder:`1px solid #ffffff10`,lineHighlight:`#B9D2FF30`},mve=[{tag:R.keyword,color:`#fda331`},{tag:[R.name,R.deleted,R.character,R.propertyName,R.macroName],color:`#b5bd68`},{tag:[R.variableName],color:`#6fb3d2`},{tag:[R.function(R.variableName)],color:`#fda331`},{tag:[R.labelName],color:`#fc6d24`},{tag:[R.color,R.constant(R.name),R.standard(R.name)],color:`#fda331`},{tag:[R.definition(R.name),R.separator],color:`#cc99cc`},{tag:[R.brace],color:`#cc99cc`},{tag:[R.annotation],color:`#fc6d24`},{tag:[R.number,R.changed,R.annotation,R.modifier,R.self,R.namespace],color:`#fda331`},{tag:[R.typeName,R.className],color:`#6fb3d2`},{tag:[R.operator,R.operatorKeyword],color:`#cc99cc`},{tag:[R.tagName],color:`#fda331`},{tag:[R.squareBracket],color:`#cc99cc`},{tag:[R.angleBracket],color:`#cc99cc`},{tag:[R.attributeName],color:`#6fb3d2`},{tag:[R.regexp],color:`#fda331`},{tag:[R.quote],color:`#DDDDDD`},{tag:[R.string],color:`#b5bd68`},{tag:R.link,color:`#6987AF`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[R.url,R.escape,R.special(R.string)],color:`#8abeb7`},{tag:[R.meta],color:`#A54543`},{tag:[R.comment],color:`#808080`,fontStyle:`italic`},{tag:R.monospace,color:`#DDDDDD`},{tag:R.strong,fontWeight:`bold`,color:`#fda331`},{tag:R.emphasis,fontStyle:`italic`,color:`#6fb3d2`},{tag:R.strikethrough,textDecoration:`line-through`},{tag:R.heading,fontWeight:`bold`,color:`#DDDDDD`},{tag:R.special(R.heading1),fontWeight:`bold`,color:`#DDDDDD`},{tag:R.heading1,fontWeight:`bold`,color:`#DDDDDD`},{tag:[R.heading2,R.heading3,R.heading4],fontWeight:`bold`,color:`#DDDDDD`},{tag:[R.heading5,R.heading6],color:`#DDDDDD`},{tag:[R.atom,R.bool,R.special(R.variableName)],color:`#8abeb7`},{tag:[R.processingInstruction,R.inserted],color:`#8abeb7`},{tag:[R.contentSeparator],color:`#6fb3d2`},{tag:R.invalid,color:`#B9D2FF`,borderBottom:`1px dotted #fc6d24`}],u5=e=>{var{theme:t=`dark`,settings:n={},styles:r=[]}=e||{};return l5({theme:t,settings:c5({},pve,n),styles:[...mve,...r]})};u5();var hve={background:`#ffffff`,foreground:`#2e3440`,caret:`#3b4252`,selection:`#eceff4`,selectionMatch:`#e5e9f0`,gutterBackground:`#eceff4`,gutterForeground:`#2e3440`,gutterBorder:`none`,lineHighlight:`#02255f11`},gve=[{tag:R.keyword,color:`#5e81ac`},{tag:[R.name,R.deleted,R.character,R.propertyName,R.macroName],color:`#d08770`},{tag:[R.variableName],color:`#d08770`},{tag:[R.function(R.variableName)],color:`#5e81ac`},{tag:[R.labelName],color:`#81a1c1`},{tag:[R.color,R.constant(R.name),R.standard(R.name)],color:`#5e81ac`},{tag:[R.definition(R.name),R.separator],color:`#a3be8c`},{tag:[R.brace],color:`#8fbcbb`},{tag:[R.annotation],color:`#d30102`},{tag:[R.number,R.changed,R.annotation,R.modifier,R.self,R.namespace],color:`#88c0d0`},{tag:[R.typeName,R.className],color:`#ebcb8b`},{tag:[R.operator,R.operatorKeyword],color:`#a3be8c`},{tag:[R.tagName],color:`#b48ead`},{tag:[R.squareBracket],color:`#bf616a`},{tag:[R.angleBracket],color:`#d08770`},{tag:[R.attributeName],color:`#ebcb8b`},{tag:[R.regexp],color:`#5e81ac`},{tag:[R.quote],color:`#3b4252`},{tag:[R.string],color:`#d08770`},{tag:R.link,color:`#8fbcbb`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[R.url,R.escape,R.special(R.string)],color:`#d08770`},{tag:[R.meta],color:`#88c0d0`},{tag:[R.comment],color:`#434c5e`,fontStyle:`italic`},{tag:R.strong,fontWeight:`bold`,color:`#5e81ac`},{tag:R.emphasis,fontStyle:`italic`,color:`#5e81ac`},{tag:R.strikethrough,textDecoration:`line-through`},{tag:R.heading,fontWeight:`bold`,color:`#5e81ac`},{tag:R.special(R.heading1),fontWeight:`bold`,color:`#5e81ac`},{tag:R.heading1,fontWeight:`bold`,color:`#5e81ac`},{tag:[R.heading2,R.heading3,R.heading4],fontWeight:`bold`,color:`#5e81ac`},{tag:[R.heading5,R.heading6],color:`#5e81ac`},{tag:[R.atom,R.bool,R.special(R.variableName)],color:`#d08770`},{tag:[R.processingInstruction,R.inserted],color:`#8fbcbb`},{tag:[R.contentSeparator],color:`#ebcb8b`},{tag:R.invalid,color:`#434c5e`,borderBottom:`1px dotted #d30102`}],d5=e=>{var{theme:t=`light`,settings:n={},styles:r=[]}=e||{};return l5({theme:t,settings:c5({},hve,n),styles:[...gve,...r]})};d5();var _ve=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=p5(e.state,n.from);return r.line?vve(e):r.block?bve(e):!1};function f5(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var vve=f5(Cve,0),yve=f5(h5,0),bve=f5((e,t)=>h5(e,t,Sve(t)),0);function p5(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var m5=50;function xve(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-m5,r),o=e.sliceDoc(i,i+m5),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*m5?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+m5),d=e.sliceDoc(i-m5,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function Sve(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function h5(e,t,n=t.selection.ranges){let r=n.map(e=>p5(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>xve(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function Cve(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=p5(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var g5=D.define(),wve=D.define(),Tve=f.define(),_5=f.define({combine(e){return be(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),v5=Me.define({create(){return k5.empty},update(e,t){let n=t.state.facet(_5),r=t.annotation(g5);if(r){let i=C5.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?w5(o,o.length,n.minDepth,i):D5(o,t.startState.selection),new k5(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(wve);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(De.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=C5.fromTransaction(t),o=t.annotation(De.time),s=t.annotation(De.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new k5(e.done.map(C5.fromJSON),e.undone.map(C5.fromJSON))}});function y5(e={}){return[v5,_5.of(e),oe.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?x5:e.inputType==`historyRedo`?S5:null;return n?(e.preventDefault(),n(t)):!1}})]}function b5(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(v5,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var x5=b5(0,!1),S5=b5(1,!1),Eve=b5(0,!0),Dve=b5(1,!0),C5=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&T.fromJSON(t.changes),[],t.mapped&&u.fromJSON(t.mapped),t.startSelection&&m.fromJSON(t.startSelection),t.selectionsAfter.map(m.fromJSON))}static fromTransaction(t,n){let r=E5;for(let e of t.startState.facet(Tve)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,E5)}static selection(t){return new e(void 0,E5,void 0,void 0,t)}};function w5(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Ove(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function kve(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function T5(e,t){return e.length?t.length?e.concat(t):e:t}var E5=[],Ave=200;function D5(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Ave));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),w5(e,e.length-1,1e9,n.setSelAfter(r)))}else return[C5.selection([t])]}function jve(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function O5(e,t){if(!e.length)return e;let n=e.length,r=E5;for(;n;){let i=Mve(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[C5.selection(r)]:E5}function Mve(e,t,n){let r=T5(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):E5,n);if(!e.changes)return C5.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new C5(i,L.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Nve=/^(input\.type|delete)($|\.)/,k5=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Nve.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Ove(s.changes,t.changes))||r==`input.type.compose`)?w5(o,o.length-1,i.minDepth,new C5(t.changes.compose(s.changes),T5(L.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,E5)):w5(o,o.length,i.minDepth,t),new e(o,E5,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:E5;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&kve(a[a.length-1],t)?this:new e(D5(this.done,t),this.undone,n,r)}addMapping(t){return new e(O5(this.done,t),O5(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:g5.of({side:e,rest:jve(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?E5:r.slice(0,r.length-1);return i.mapped&&(n=O5(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:g5.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};k5.empty=new k5(E5,E5);var A5=[{key:`Mod-z`,run:x5,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:S5,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:S5,preventDefault:!0},{key:`Mod-u`,run:Eve,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Dve,preventDefault:!0}];function j5(e,t){return m.create(e.ranges.map(t),e.mainIndex)}function M5(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function N5({state:e,dispatch:t},n){let r=j5(e.selection,n);return r.eq(e.selection,!0)?!1:(t(M5(e,r)),!0)}function P5(e,t){return m.cursor(t?e.to:e.from)}function F5(e,t){return N5(e,n=>n.empty?e.moveByChar(n,t):P5(n,t))}function I5(e){return e.textDirectionAt(e.state.selection.main.head)==se.LTR}var L5=e=>F5(e,!I5(e)),R5=e=>F5(e,I5(e));function z5(e,t){return N5(e,n=>n.empty?e.moveByGroup(n,t):P5(n,t))}var Pve=e=>z5(e,!I5(e)),Fve=e=>z5(e,I5(e));typeof Intl<`u`&&Intl.Segmenter;function Ive(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function B5(e,t,n){let r=j(e).resolveInner(t.head),i=n?je.closedBy:je.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Ive(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?c(e,r.from,1):c(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,m.cursor(s,n?-1:1)}var Lve=e=>N5(e,t=>B5(e.state,t,!I5(e))),Rve=e=>N5(e,t=>B5(e.state,t,I5(e)));function V5(e,t){return N5(e,n=>{if(!n.empty)return P5(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var H5=e=>V5(e,!1),U5=e=>V5(e,!0);function W5(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(oe.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function G5(e,t){let n=W5(e),{state:r}=e,i=j5(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):P5(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=oe.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(M5(r,i),{effects:a}),!0}var K5=e=>G5(e,!1),q5=e=>G5(e,!0);function J5(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=m.cursor(r.from+n))}return i}var zve=e=>N5(e,t=>J5(e,t,!0)),Bve=e=>N5(e,t=>J5(e,t,!1)),Vve=e=>N5(e,t=>J5(e,t,!I5(e))),Hve=e=>N5(e,t=>J5(e,t,I5(e))),Uve=e=>N5(e,t=>m.cursor(e.lineBlockAt(t.head).from,1)),Wve=e=>N5(e,t=>m.cursor(e.lineBlockAt(t.head).to,-1));function Gve(e,t,n){let r=!1,i=j5(e.selection,t=>{let i=c(e,t.head,-1)||c(e,t.head,1)||t.head>0&&c(e,t.head-1,1)||t.head<e.doc.length&&c(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?m.range(t.anchor,a):m.cursor(a)});return r?(t(M5(e,i)),!0):!1}var Kve=({state:e,dispatch:t})=>Gve(e,t,!1);function Y5(e,t){let n=j5(e.state.selection,e=>{let n=t(e);return m.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(M5(e.state,n)),!0)}function X5(e,t){return Y5(e,n=>e.moveByChar(n,t))}var Z5=e=>X5(e,!I5(e)),Q5=e=>X5(e,I5(e));function $5(e,t){return Y5(e,n=>e.moveByGroup(n,t))}var qve=e=>$5(e,!I5(e)),Jve=e=>$5(e,I5(e)),Yve=e=>Y5(e,t=>B5(e.state,t,!I5(e))),Xve=e=>Y5(e,t=>B5(e.state,t,I5(e)));function e7(e,t){return Y5(e,n=>e.moveVertically(n,t))}var t7=e=>e7(e,!1),n7=e=>e7(e,!0);function r7(e,t){return Y5(e,n=>e.moveVertically(n,t,W5(e).height))}var i7=e=>r7(e,!1),a7=e=>r7(e,!0),Zve=e=>Y5(e,t=>J5(e,t,!0)),Qve=e=>Y5(e,t=>J5(e,t,!1)),$ve=e=>Y5(e,t=>J5(e,t,!I5(e))),eye=e=>Y5(e,t=>J5(e,t,I5(e))),tye=e=>Y5(e,t=>m.cursor(e.lineBlockAt(t.head).from)),nye=e=>Y5(e,t=>m.cursor(e.lineBlockAt(t.head).to)),o7=({state:e,dispatch:t})=>(t(M5(e,{anchor:0})),!0),s7=({state:e,dispatch:t})=>(t(M5(e,{anchor:e.doc.length})),!0),c7=({state:e,dispatch:t})=>(t(M5(e,{anchor:e.selection.main.anchor,head:0})),!0),l7=({state:e,dispatch:t})=>(t(M5(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),rye=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),iye=({state:e,dispatch:t})=>{let n=v7(e).map(({from:t,to:n})=>m.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:m.create(n),userEvent:`select`})),!0},aye=({state:e,dispatch:t})=>{let n=j5(e.selection,t=>{let n=j(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return m.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(M5(e,n)),!0)};function u7(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(M5(n,m.create(i,i.length-1))),!0)}var oye=e=>u7(e,!1),sye=e=>u7(e,!0),cye=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=m.create([n.main]):n.main.empty||(r=m.create([m.cursor(n.main.head)])),r?(t(M5(e,r)),!0):!1};function d7(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=f7(e,o,!1)):o>i&&(n=`delete.forward`,o=f7(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=f7(e,i,!1),a=f7(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:m.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?oe.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function f7(e,t,n){if(e instanceof oe)for(let r of e.state.facet(oe.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var p7=(e,t,n)=>d7(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=Ae(s,a.tabSize)%y(a)||y(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=ee(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=ee(o.text,c-o.from,!1,!1)+o.from);return c}),m7=e=>p7(e,!1,!0),h7=e=>p7(e,!0,!1),g7=(e,t)=>d7(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=ee(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),_7=e=>g7(e,!1),lye=e=>g7(e,!0),uye=e=>d7(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),dye=e=>d7(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),fye=e=>d7(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),pye=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:ve.of([``,``])},range:m.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},mye=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:ee(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:ee(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:m.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function v7(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function y7(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of v7(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(m.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(m.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:m.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var hye=({state:e,dispatch:t})=>y7(e,t,!1),gye=({state:e,dispatch:t})=>y7(e,t,!0);function b7(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of v7(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var _ye=({state:e,dispatch:t})=>b7(e,t,!1),vye=({state:e,dispatch:t})=>b7(e,t,!0),yye=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(v7(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=j5(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function bye(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=j(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(je.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var x7=S7(!1),xye=S7(!0);function S7(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),s=!e&&r==i&&bye(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let c=new Ee(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=o(c,r);for(l??=Ae(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;s?{from:r,to:i}=s:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let u=[``,E(t,l)];return s&&u.push(E(t,c.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:ve.of(u)},range:m.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function C7(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:m.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Sye=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ee(e,{overrideIndentation:e=>n[e]??-1}),i=C7(e,(t,i,a)=>{let s=o(r,t.from);if(s==null)return;/\S/.test(t.text)||(s=0);let c=/^\s*/.exec(t.text)[0],l=E(e,s);(c!=l||a.from<t.from+c.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+c.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},w7=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(C7(e,(t,n)=>{n.push({from:t.from,insert:e.facet(l)})}),{userEvent:`input.indent`})),!0),T7=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(C7(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=Ae(r,e.tabSize),a=0,o=E(e,Math.max(0,i-y(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Cye=e=>(e.setTabFocusMode(),!0),wye=[{key:`Ctrl-b`,run:L5,shift:Z5,preventDefault:!0},{key:`Ctrl-f`,run:R5,shift:Q5},{key:`Ctrl-p`,run:H5,shift:t7},{key:`Ctrl-n`,run:U5,shift:n7},{key:`Ctrl-a`,run:Uve,shift:tye},{key:`Ctrl-e`,run:Wve,shift:nye},{key:`Ctrl-d`,run:h7},{key:`Ctrl-h`,run:m7},{key:`Ctrl-k`,run:uye},{key:`Ctrl-Alt-h`,run:_7},{key:`Ctrl-o`,run:pye},{key:`Ctrl-t`,run:mye},{key:`Ctrl-v`,run:q5}],Tye=[{key:`ArrowLeft`,run:L5,shift:Z5,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Pve,shift:qve,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Vve,shift:$ve,preventDefault:!0},{key:`ArrowRight`,run:R5,shift:Q5,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Fve,shift:Jve,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Hve,shift:eye,preventDefault:!0},{key:`ArrowUp`,run:H5,shift:t7,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:o7,shift:c7},{mac:`Ctrl-ArrowUp`,run:K5,shift:i7},{key:`ArrowDown`,run:U5,shift:n7,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:s7,shift:l7},{mac:`Ctrl-ArrowDown`,run:q5,shift:a7},{key:`PageUp`,run:K5,shift:i7},{key:`PageDown`,run:q5,shift:a7},{key:`Home`,run:Bve,shift:Qve,preventDefault:!0},{key:`Mod-Home`,run:o7,shift:c7},{key:`End`,run:zve,shift:Zve,preventDefault:!0},{key:`Mod-End`,run:s7,shift:l7},{key:`Enter`,run:x7,shift:x7},{key:`Mod-a`,run:rye},{key:`Backspace`,run:m7,shift:m7,preventDefault:!0},{key:`Delete`,run:h7,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:_7,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:lye,preventDefault:!0},{mac:`Mod-Backspace`,run:dye,preventDefault:!0},{mac:`Mod-Delete`,run:fye,preventDefault:!0}].concat(wye.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),E7=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Lve,shift:Yve},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Rve,shift:Xve},{key:`Alt-ArrowUp`,run:hye},{key:`Shift-Alt-ArrowUp`,run:_ye},{key:`Alt-ArrowDown`,run:gye},{key:`Shift-Alt-ArrowDown`,run:vye},{key:`Mod-Alt-ArrowUp`,run:oye},{key:`Mod-Alt-ArrowDown`,run:sye},{key:`Escape`,run:cye},{key:`Mod-Enter`,run:xye},{key:`Alt-l`,mac:`Ctrl-l`,run:iye},{key:`Mod-i`,run:aye,preventDefault:!0},{key:`Mod-[`,run:T7},{key:`Mod-]`,run:w7},{key:`Mod-Alt-\\`,run:Sye},{key:`Shift-Mod-k`,run:yye},{key:`Shift-Mod-\\`,run:Kve},{key:`Mod-/`,run:_ve},{key:`Alt-A`,run:yve},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Cye}].concat(Tye),Eye={key:`Tab`,run:w7,shift:T7},D7=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,O7=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(D7(e)):D7,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return le(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=pe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=P(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(O7.prototype[Symbol.iterator]=function(){return this});var k7={from:-1,to:-1,match:/.*/.exec(``)},A7=`gm`+(/x/.unicode==null?``:`u`),j7=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=k7,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new P7(e,t,n,r,i);this.re=new RegExp(t,A7+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=F7(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=F7(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},M7=new WeakMap,N7=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=M7.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return M7.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),M7.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},P7=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=k7,this.matchPos=F7(e,r),this.re=new RegExp(t,A7+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=N7.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=F7(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=N7.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(j7.prototype[Symbol.iterator]=P7.prototype[Symbol.iterator]=function(){return this});function Dye(e){try{return new RegExp(e,A7),!0}catch{return!1}}function F7(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var Oye=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=d(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=m.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,oe.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},kye={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},I7=f.define({combine(e){return be(e,kye,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Aye(e){let t=[Fye,Pye];return e&&t.push(I7.of(e)),t}var jye=ge.mark({class:`cm-selectionMatch`}),Mye=ge.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function L7(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=k.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=k.Word)}function Nye(e,t,n,r){return e(t.sliceDoc(n,n+1))==k.Word&&e(t.sliceDoc(r-1,r))==k.Word}var Pye=Fe.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(I7),{state:n}=e,r=n.selection;if(r.ranges.length>1)return ge.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return ge.none;let e=n.wordAt(i.head);if(!e)return ge.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return ge.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(L7(o,n,i.from,i.to)&&Nye(o,n,i.from,i.to)))return ge.none}else if(a=n.sliceDoc(i.from,i.to),!a)return ge.none}let s=[];for(let r of e.visibleRanges){let e=new O7(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||L7(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Mye.range(r,a)):(r>=i.to||a<=i.from)&&s.push(jye.range(r,a)),s.length>t.maxMatches))return ge.none}}return ge.set(s)}},{decorations:e=>e.decorations}),Fye=oe.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Iye=({state:e,dispatch:t})=>{let{selection:n}=e,r=m.create(n.ranges.map(t=>e.wordAt(t.head)||m.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Lye(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new O7(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new O7(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Rye=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Iye({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Lye(e,r);return i?(t(e.update({selection:e.selection.addRange(m.range(i.from,i.to),!1),effects:oe.scrollIntoView(i.to)})),!0):!1},R7=f.define({combine(e){return be(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Qye(e),scrollToMatch:e=>oe.scrollIntoView(e)})}}),z7=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||Dye(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
316
+ `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Wye(this):new Vye(this)}getCursor(e,t=0,n){let r=e.doc?e:Te.create({doc:e});return n??=r.doc.length,this.regexp?H7(this,r,t,n):V7(this,r,t,n)}},B7=class{constructor(e){this.spec=e}};function zye(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function V7(e,t,n,r){let i;return e.wholeWord&&(i=Bye(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=zye(e.test,t,i)),new O7(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Bye(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(U7(i,n-a))!=k.Word||t(W7(i,n-a))!=k.Word)&&(t(W7(i,r-a))!=k.Word||t(U7(i,r-a))!=k.Word))}var Vye=class extends B7{constructor(e){super(e)}nextMatch(e,t,n){let r=V7(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=V7(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=V7(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=V7(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=V7(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Hye(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function H7(e,t,n,r){let i;return e.wholeWord&&(i=Uye(t.charCategorizer(t.selection.main.head))),e.test&&(i=Hye(e.test,t,i)),new j7(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function U7(e,t){return e.slice(ee(e,t,!1),t)}function W7(e,t){return e.slice(t,ee(e,t))}function Uye(e){return(t,n,r)=>!r[0].length||(e(U7(r.input,r.index))!=k.Word||e(W7(r.input,r.index))!=k.Word)&&(e(W7(r.input,r.index+r[0].length))!=k.Word||e(U7(r.input,r.index+r[0].length))!=k.Word)}var Wye=class extends B7{nextMatch(e,t,n){let r=H7(this.spec,e,n,e.doc.length).next();return r.done&&(r=H7(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=H7(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=H7(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=H7(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},G7=L.define(),K7=L.define(),q7=Me.define({create(e){return new J7(e9(e).create(),null)},update(e,t){for(let n of t.effects)n.is(G7)?e=new J7(n.value.create(),e.panel):n.is(K7)&&(e=new J7(e.query,n.value?$7:null));return e},provide:e=>g.from(e,e=>e.panel)}),J7=class{constructor(e,t){this.query=e,this.panel=t}},Gye=ge.mark({class:`cm-searchMatch`}),Kye=ge.mark({class:`cm-searchMatch cm-searchMatch-selected`}),qye=Fe.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(q7))}update(e){let t=e.state.field(q7);(t!=e.startState.field(q7)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return ge.none;let{view:n}=this,r=new x;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Kye:Gye)})}return r.finish()}},{decorations:e=>e.decorations});function Y7(e){return t=>{let n=t.state.field(q7,!1);return n&&n.query.spec.valid?e(t,n):r9(t)}}var X7=Y7((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=m.single(r.from,r.to),a=e.state.facet(R7);return e.dispatch({selection:i,effects:[c9(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),n9(e),!0}),Z7=Y7((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=m.single(i.from,i.to),o=e.state.facet(R7);return e.dispatch({selection:a,effects:[c9(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),n9(e),!0}),Jye=Y7((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:m.create(n.map(e=>m.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Yye=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new O7(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(m.range(t.value.from,t.value.to))}return t(e.update({selection:m.create(a,o),userEvent:`select.search.matches`})),!0},Q7=Y7((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(oe.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=m.single(o.from,o.to).map(d),u.push(c9(e,o)),u.push(n.facet(R7).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),Xye=Y7((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:oe.announce.of(r),userEvent:`input.replace.all`}),!0});function $7(e){return e.state.facet(R7).createPanel(e)}function e9(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(R7);return new z7({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function t9(e){let n=t(e,$7);return n&&n.dom.querySelector(`[main-field]`)}function n9(e){let t=t9(e);t&&t==e.root.activeElement&&t.select()}var r9=e=>{let t=e.state.field(q7,!1);if(t&&t.panel){let n=t9(e);if(n&&n!=e.root.activeElement){let r=e9(e.state,t.query.spec);r.valid&&e.dispatch({effects:G7.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[K7.of(!0),t?G7.of(e9(e.state,t.query.spec)):L.appendConfig.of(ebe)]});return!0},i9=e=>{let n=e.state.field(q7,!1);if(!n||!n.panel)return!1;let r=t(e,$7);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:K7.of(!1)}),!0},Zye=[{key:`Mod-f`,run:r9,scope:`editor search-panel`},{key:`F3`,run:X7,shift:Z7,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:X7,shift:Z7,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:i9,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Yye},{key:`Mod-Alt-g`,run:Oye},{key:`Mod-d`,run:Rye,preventDefault:!0}],Qye=class{constructor(e){this.view=e;let t=this.query=e.state.field(q7).query.spec;this.commit=this.commit.bind(this),this.searchField=Le(`input`,{value:t.search,placeholder:a9(e,`Find`),"aria-label":a9(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=Le(`input`,{value:t.replace,placeholder:a9(e,`Replace`),"aria-label":a9(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=Le(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=Le(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=Le(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return Le(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=Le(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>X7(e),[a9(e,`next`)]),n(`prev`,()=>Z7(e),[a9(e,`previous`)]),n(`select`,()=>Jye(e),[a9(e,`all`)]),Le(`label`,null,[this.caseField,a9(e,`match case`)]),Le(`label`,null,[this.reField,a9(e,`regexp`)]),Le(`label`,null,[this.wordField,a9(e,`by word`)]),...e.state.readOnly?[]:[Le(`br`),this.replaceField,n(`replace`,()=>Q7(e),[a9(e,`replace`)]),n(`replaceAll`,()=>Xye(e),[a9(e,`replace all`)])],Le(`button`,{name:`close`,onclick:()=>i9(e),"aria-label":a9(e,`close`),type:`button`},[`×`])])}commit(){let e=new z7({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:G7.of(e)}))}keydown(e){s(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Z7:X7)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Q7(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(G7)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(R7).top}};function a9(e,t){return e.state.phrase(t)}var o9=30,s9=/[\s\.,:;?!]/;function c9(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-o9),o=Math.min(i,n+o9),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<o9;e++)if(!s9.test(s[e+1])&&s9.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-o9;e--)if(!s9.test(s[e-1])&&s9.test(s[e])){s=s.slice(0,e);break}}return oe.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var $ye=oe.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),ebe=[q7,A.low(qye),$ye],l9=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},u9=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(_9).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new x,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=fbe(s);if(i)o.add(n,n,ge.widget({widget:new cbe(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,ge.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,d9(f))}};function d9(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new l9(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new l9(r.from,n,r.diagnostic)}),r}function tbe(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(_9).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(f9))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function nbe(e,t){return e.field(h9,!1)?t:t.concat(L.appendConfig.of(pbe))}var f9=L.define(),p9=L.define(),m9=L.define(),h9=Me.define({create(){return new u9(ge.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=d9(n,e.selected.diagnostic,i)||d9(n,null,i)}!n.size&&i&&t.state.facet(_9).autoPanel&&(i=null),e=new u9(n,i,r)}for(let n of t.effects)if(n.is(f9)){let r=t.state.facet(_9).autoPanel?n.value.length?S9.open:null:e.panel;e=u9.init(n.value,r,t.state)}else n.is(p9)?e=new u9(e.diagnostics,n.value?S9.open:null,e.selected):n.is(m9)&&(e=new u9(e.diagnostics,e.panel,n.value));return e},provide:e=>[g.from(e,e=>e.panel),oe.decorations.from(e,e=>e.diagnostics)]}),rbe=ge.mark({class:`cm-lintRange cm-lintRange-active`});function ibe(e,t,n){let{diagnostics:r}=e.state.field(h9),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(_9).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:abe(e,i)}}}:null}function abe(e,t){return Le(`ul`,{class:`cm-tooltip-lint`},t.map(t=>b9(e,t,!1)))}var obe=e=>{let n=e.state.field(h9,!1);(!n||!n.panel)&&e.dispatch({effects:nbe(e.state,[p9.of(!0)])});let r=t(e,S9.open);return r&&r.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},g9=e=>{let t=e.state.field(h9,!1);return!t||!t.panel?!1:(e.dispatch({effects:p9.of(!1)}),!0)},sbe=[{key:`Mod-Shift-m`,run:obe,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(h9,!1);if(!t)return!1;let n=e.state.selection.main,r=d9(t.diagnostics,null,n.to+1);return!r&&(r=d9(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],_9=f.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...be(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:v9,tooltipFilter:v9,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function v9(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function y9(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function b9(e,t,n){let r=n?y9(t.actions):[];return Le(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},Le(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=d9(e.state.field(h9).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),Le(`u`,s.slice(c,c+1)),s.slice(c+1)];return Le(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&Le(`div`,{class:`cm-diagnosticSource`},t.source))}var cbe=class extends iee{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Le(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},x9=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=b9(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},S9=class e{constructor(e){this.view=e,this.items=[],this.list=Le(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)g9(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=y9(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=d9(this.view.state.field(h9).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=Le(`div`,{class:`cm-panel-lint`},this.list,Le(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>g9(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(h9).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(h9),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new x9(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new x9(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=d9(this.view.state.field(h9).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:m9.of(t)})}static open(t){return new e(t)}};function lbe(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function C9(e){return lbe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var ube=oe.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:C9(`#d11`)},".cm-lintRange-warning":{backgroundImage:C9(`orange`)},".cm-lintRange-info":{backgroundImage:C9(`#999`)},".cm-lintRange-hint":{backgroundImage:C9(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function dbe(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function fbe(e){let t=`hint`,n=1;for(let r of e){let e=dbe(r.severity);e>n&&(n=e,t=r.severity)}return t}var pbe=[h9,oe.decorations.compute([h9],e=>{let{selected:t,panel:n}=e.field(h9);return!t||!n||t.from==t.to?ge.none:ge.set([rbe.range(t.from,t.to)])}),fe(ibe,{hideOn:tbe}),ube],mbe=[ue(),r(),v(),y5(),w(),Ie(),C(),Te.allowMultipleSelections.of(!0),S(),we(M,{fallback:!0}),Se(),Ve(),ze(),b(),F(),a(),Aye(),e.of([...oee,...E7,...Zye,...A5,...n,...Be,...sbe])];v(),y5(),Ie(),we(M,{fallback:!0}),e.of([...E7,...A5]);function w9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`section`,{"data-slot":`panel`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function T9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`panel-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function E9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`h2`,{"data-slot":`panel-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function D9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`p`,{"data-slot":`panel-count`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function O9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`panel-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`p`,{"data-slot":`panel-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function A9(e){let t=(0,gn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_l(`text-sm text-destructive`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`p`,{"data-slot":`panel-error`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hbe(e,t){let n=(0,gn.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,z.useEffect)(s,c),i}var gbe=300;async function _be(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Server error: ${t.status} ${t.statusText}`);let n=await t.json();if(!n.ok)throw Error(n.error??`Failed to load headings`);return n.headings??[]}var j9=32,M9=6,N9=6,P9=8;function vbe(e){return(e-1)*P9+.5}function ybe(e){if(e.length===0)return``;let t=[];for(let n=0;n<e.length;n++){let r=vbe(e[n].level),i=n*j9+M9,a=n*j9+j9-N9;t.push(`${n===0?`M`:`L`}${r} ${i}`),t.push(`L${r} ${a}`)}return t.join(` `)}var F9=`open-knowledge:outline-nav`;function bbe(e){let t=(0,gn.c)(2),n;return t[0]===e?n=t[1]:(n=(0,B.jsx)(yl,{name:`outline-panel`,children:(0,B.jsx)(xbe,{...e})}),t[0]=e,t[1]=n),n}function xbe(e){let t=(0,gn.c)(54),{docName:n,isSourceMode:r,className:i}=e,a=i===void 0?``:i,{pages:o,loading:s}=u4(),c=Ut(),{activeProvider:l,activeDocName:u}=i3(),d,f;t[0]===n?(d=t[1],f=t[2]):(d=[`page-headings`,n],f=()=>_be(n),t[0]=n,t[1]=d,t[2]=f);let p;t[3]!==n||t[4]!==s||t[5]!==o?(p=!s&&o.has(n),t[3]=n,t[4]=s,t[5]=o,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==f||t[9]!==p?(m={queryKey:d,queryFn:f,enabled:p,staleTime:1/0},t[7]=d,t[8]=f,t[9]=p,t[10]=m):m=t[10];let{data:h,isLoading:g,error:_}=Xt(m),v;t[11]===h?v=t[12]:(v=h===void 0?[]:h,t[11]=h,t[12]=v);let y=v,b,x;t[13]!==u||t[14]!==l||t[15]!==n||t[16]!==c?(b=()=>{if(!l||u!==n)return;let e=l.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,c.invalidateQueries({queryKey:[`page-headings`,n]})},gbe)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},x=[l,u,n,c],t[13]=u,t[14]=l,t[15]=n,t[16]=c,t[17]=b,t[18]=x):(b=t[17],x=t[18]),(0,z.useEffect)(b,x);let S;t[19]===y?S=t[20]:(S=y.map(Cbe),t[19]=y,t[20]=S);let C=hbe(S,r),w;t[21]!==C||t[22]!==y?(w=C?y.findIndex(e=>e.slug===C):-1,t[21]=C,t[22]=y,t[23]=w):w=t[23];let T=w,E;t[24]!==n||t[25]!==r?(E=function(e,t){let i={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&o3(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(F9,{detail:i}))},t[24]=n,t[25]=r,t[26]=E):E=t[26];let D=E,O=(y.reduce(Sbe,1)-1)*P9+1,k=y.length*j9,A;t[27]===y?A=t[28]:(A=ybe(y),t[27]=y,t[28]=A);let j=A,M=j?`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${O} ${k}"><path d="${j}" stroke="black" stroke-width="2" fill="none" /></svg>`)}")`:void 0,N=T>=0?T*j9+M9:0,P=T>=0?j9-M9-N9:0,F;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,B.jsx)(E9,{children:`Outline`}),t[29]=F):F=t[29];let I;t[30]!==y.length||t[31]!==g?(I=!g&&(0,B.jsx)(D9,{children:y.length}),t[30]=y.length,t[31]=g,t[32]=I):I=t[32];let ee;t[33]===I?ee=t[34]:(ee=(0,B.jsxs)(T9,{children:[F,I]}),t[33]=I,t[34]=ee);let te;t[35]!==C||t[36]!==_||t[37]!==D||t[38]!==y||t[39]!==g||t[40]!==j||t[41]!==M||t[42]!==k||t[43]!==O||t[44]!==P||t[45]!==N?(te=_?(0,B.jsx)(A9,{className:`px-2`,children:_ instanceof Error?_.message:`Failed to load headings`}):y.length===0&&!g?(0,B.jsx)(k9,{className:`px-2`,children:`No headings yet.`}):(0,B.jsxs)(`nav`,{"aria-label":`Document outline`,className:`relative`,children:[(0,B.jsx)(`svg`,{width:O,height:k,className:`pointer-events-none absolute left-0 top-0`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:j,fill:`none`,strokeWidth:`1`,style:{stroke:`var(--border)`}})}),M&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute left-0 top-0`,style:{width:O,height:k,maskImage:M,WebkitMaskImage:M},children:(0,B.jsx)(`div`,{className:`w-full motion-safe:[transition:transform_0.25s_var(--ease-out-strong),height_0.1s_var(--ease-out-strong)]`,style:{transform:`translateY(${N}px)`,height:P,backgroundColor:`var(--primary)`}})}),y.map((e,t)=>{let n=e.slug===C;return(0,B.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>D(t,e.slug),className:_l(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*P9+16}px`},title:e.text,children:e.text},t)})]}),t[35]=C,t[36]=_,t[37]=D,t[38]=y,t[39]=g,t[40]=j,t[41]=M,t[42]=k,t[43]=O,t[44]=P,t[45]=N,t[46]=te):te=t[46];let ne;t[47]!==g||t[48]!==te?(ne=(0,B.jsx)(O9,{className:`px-3 py-2`,"aria-busy":g,children:te}),t[47]=g,t[48]=te,t[49]=ne):ne=t[49];let re;return t[50]!==a||t[51]!==ee||t[52]!==ne?(re=(0,B.jsxs)(w9,{className:a,children:[ee,ne]}),t[50]=a,t[51]=ee,t[52]=ne,t[53]=re):re=t[53],re}function Sbe(e,t){return Math.max(e,t.level)}function Cbe(e){return e.slug}function I9(e){if(!e)return`plaintext`;if(e.types.includes(`vscode-editor-data`))return`vscode`;if(e.types.includes(`text/x-gfm`))return`gfm`;let t=e.getData(`text/html`);return t?/data-pm-slice/i.test(t)?`pm-origin`:/docs-internal-guid-/i.test(t)?`gdocs`:/xmlns:o="urn:schemas-microsoft-com:office/i.test(t)||/<meta[^>]*Generator[^>]*Microsoft Word/i.test(t)?`word`:/class="gmail_|class='gmail_/i.test(t)?`gmail`:/notionvc:/i.test(t)?`notion`:/Cocoa HTML Writer/i.test(t)?`apple`:/c-message_kit__|c-message__|c-compose/i.test(t)?`slack`:/google-sheets-html-origin/i.test(t)?`gsheets`:/data-hovercard-type=/i.test(t)?`github`:`generic`:`plaintext`}var wbe=250,Tbe=100;function L9(e,t){let n=performance.now()-e;n<(t.op===`paste`?wbe:Tbe)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function R9(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function z9(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function B9(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function Ebe(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function V9(e){if(e instanceof WJ)return`HtmlPayloadTooLargeError`;if(e instanceof V1)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var Dbe=/^```/m,Obe=/^#{1,6} /m,kbe=/^[-*+] /m,Abe=/^\d+[.)] /m,jbe=/\[[^\]\n]+\]\([^)\n]+\)/,Mbe=/^\|.*\|$/m,Nbe=/^\|?\s*(:?-+:?)(\s*\|\s*:?-+:?)+\s*\|?$/m,Pbe=/\$\$[\s\S]+?\$\$/;function H9(e){if(!e)return!1;let t=0;Dbe.test(e)&&t++,Obe.test(e)&&t++,kbe.test(e)&&t++,Abe.test(e)&&t++,jbe.test(e)&&t++,Mbe.test(e)&&Nbe.test(e)&&t++,Pbe.test(e)&&t++;let n=e.split(`
317
+ `).length,r=Math.min(3,Math.floor(n/5));return t>=Math.max(1,r)}var Fbe=3e3,U9=new Map;function W9(e,t=`Pasted as plain text — some formatting could not be converted.`){let n=Date.now();return n-(U9.get(e)??0)<Fbe?!1:(U9.set(e,n),Mn.error(t),!0)}var G9=!1,K9=!1;function Ibe(e){G9=e.shiftKey}function Lbe(e){(e.key===`Shift`||!e.shiftKey)&&(G9=!1)}function Rbe(){G9=!1}function q9(){K9||typeof window>`u`||(window.addEventListener(`keydown`,Ibe,!0),window.addEventListener(`keyup`,Lbe,!0),window.addEventListener(`blur`,Rbe,!0),K9=!0)}function zbe(){q9()}function Bbe(){return q9(),G9}function J9(e){return Bbe()?!0:e.shiftKey===!0}function Vbe(e){return(t,n)=>{let r=n.clipboardData;if(!r||r.types.length===0)return!1;let i=performance.now(),a=I9(r),o=r.getData(`text/plain`),s=r.getData(`text/html`);if(J9(n))return o&&Y9(t,o),R9({view:`wysiwyg`,branch:`shift`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`shift`,source:a}),!0;if(Hbe(t))return o&&Y9(t,o),R9({view:`wysiwyg`,branch:`codeblock`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`codeblock`,source:a}),!0;let c=r.getData(`vscode-editor-data`);if(c&&o&&Wbe(t,c,o,a))return R9({view:`wysiwyg`,branch:`A`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`A`,source:a}),!0;let l=r.getData(`text/x-gfm`);return l&&X9(t,l,e,`B`,a)?(R9({view:`wysiwyg`,branch:`B`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`B`,source:a}),!0):s&&/data-pm-slice/i.test(s)?(R9({view:`wysiwyg`,branch:`C`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`C`,source:a}),!1):o&&s&&H9(o)&&X9(t,o,e,`B`,a)?(R9({view:`wysiwyg`,branch:`B`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`B`,source:a}),!0):s&&Gbe(t,s,e,a)?(R9({view:`wysiwyg`,branch:`D`,source:a}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`D`,source:a,htmlBytes:s.length}),!0):o?H9(o)&&X9(t,o,e,`E`,`markdown-text`)?(R9({view:`wysiwyg`,branch:`E`,source:`markdown-text`}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`E`,source:`markdown-text`}),!0):(Y9(t,o),R9({view:`wysiwyg`,branch:`E`,source:`plaintext`}),L9(i,{op:`paste`,view:`wysiwyg`,branch:`E`,source:`plaintext`}),!0):!1}}function Hbe(e){let{$from:t}=e.state.selection;for(let e=t.depth;e>=0;e--)if(t.node(e).type.name===`codeBlock`)return!0;return!1}function Y9(e,t){let{schema:n,tr:r}=e.state;t&&e.dispatch(r.replaceSelectionWith(n.text(t)).scrollIntoView())}var Ube=/^[A-Za-z0-9_+-]+$/;function Wbe(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=Ube.test(i)?i:``,o=e.state.schema.nodes.codeBlock;if(!o)return!1;let s=o.create({language:a},n?e.state.schema.text(n):null);return e.dispatch(e.state.tr.replaceSelectionWith(s).scrollIntoView()),!0}catch(e){return z9({view:`wysiwyg`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:V9(e)}),!1}}function X9(e,t,n,r,i){let a;try{a=n.mdManager.parse(t)}catch(e){return z9({view:`wysiwyg`,stage:`mdManagerParse`,source:i,branch:r,reason:e?.message??`unknown`,errorClass:V9(e)}),!1}return Z9(e,a,i,r)}function Gbe(e,t,n,r){let i;try{i=KJ(t)}catch(e){return z9({view:`wysiwyg`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:V9(e),htmlBytes:t.length}),W9(`wysiwyg`),!1}let a;try{a=qJ(i)}catch(e){return z9({view:`wysiwyg`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:V9(e),htmlBytes:t.length}),W9(`wysiwyg`),!1}let o;try{o=n.mdManager.parse(a)}catch(e){return z9({view:`wysiwyg`,stage:`mdManagerParse`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:V9(e),htmlBytes:t.length}),W9(`wysiwyg`),!1}return Z9(e,o,r,`D`,t.length)}function Z9(e,t,n,r,i){try{let n=e.state.schema.nodeFromJSON(t);return e.dispatch(e.state.tr.replaceSelection(n.slice(0,n.content.size)).scrollIntoView()),!0}catch(e){return z9({view:`wysiwyg`,stage:`applyJsonSlice`,source:n,branch:r,reason:e?.message??`unknown`,errorClass:V9(e),...i==null?{}:{htmlBytes:i}}),!1}}function Kbe(e){return(t,n)=>{try{return Q9(t,n.state.schema,e.mdManager)}catch(e){return console.warn(`[clipboard] text serialize fell through — PM default textBetween`,e),t.content.textBetween(0,t.content.size,`
318
+
319
+ `)}}}var qbe=class extends mu{mdManager;constructor(e){super({},{}),this.mdManager=e}serializeFragment(e,t,n){try{let t=e.firstChild?.type.schema;if(!t)return n??document.createDocumentFragment();let r=Zbe(Ybe(e,t,this.mdManager));if(n){for(let e of Array.from(r.childNodes))n.appendChild(e);return n}return r}catch(e){return console.warn(`[clipboard] HTML serialize fell through — PM default DOMSerializer`,e),n??document.createDocumentFragment()}}};function Jbe(e){return new qbe(e.mdManager)}function Q9(e,t,n){return n.serialize(Xbe(e,t))}function Ybe(e,t,n){return z1(Q9(new H(e,0,0),t,n))}function Xbe(e,t){let n=t.topNodeType.createAndFill(null,e.content);if(!n){let e=t.topNodeType.createAndFill();if(!e)throw Error(`[clipboard] schema cannot fill topNodeType`);return e.toJSON()}return n.toJSON()}function Zbe(e){let t=new DOMParser().parseFromString(e,`text/html`),n=document.createDocumentFragment();for(let e of Array.from(t.body.childNodes))n.appendChild(e);return n}function Qbe(e){return zbe(),oe.domEventHandlers({copy:(e,t)=>$9(e,t,`copy`),cut:(e,t)=>$9(e,t,`cut`),paste:(t,n)=>$be(t,n,e)})}function $9(e,t,n){let{from:r,to:i}=t.state.selection.main;if(r===i)return e.preventDefault(),!0;let a=e.clipboardData;if(!a)return!1;let o=performance.now();try{let s=t.state.sliceDoc(r,i);a.setData(`text/plain`,s);try{a.setData(`text/html`,z1(s))}catch(e){B9({view:`source`,kind:`html`,reason:e?.message??`unknown`})}return e.preventDefault(),n===`cut`&&t.dispatch({changes:{from:r,to:i,insert:``}}),L9(o,{op:n,view:`source`,branch:`serialize`,source:`local`}),!0}catch(e){return B9({view:`source`,kind:`text`,reason:e?.message??`unknown`}),!1}}function $be(e,t,n){let r=e.clipboardData;if(!r||r.types.length===0)return!1;let i=performance.now(),a=I9(r),o=r.getData(`text/plain`),s=r.getData(`text/html`);if(J9(e))return R9({view:`source`,branch:`shift`,source:a}),L9(i,{op:`paste`,view:`source`,branch:`shift`,source:a}),!1;let c=r.getData(`vscode-editor-data`);return c&&o&&txe(t,c,o,a)?(e.preventDefault(),R9({view:`source`,branch:`A`,source:a}),L9(i,{op:`paste`,view:`source`,branch:`A`,source:a}),!0):s&&/data-pm-slice/i.test(s)?(R9({view:`source`,branch:`C`,source:a}),L9(i,{op:`paste`,view:`source`,branch:`C`,source:a}),!1):s&&nxe(t,s,n,a)?(e.preventDefault(),R9({view:`source`,branch:`D`,source:a}),L9(i,{op:`paste`,view:`source`,branch:`D`,source:a,htmlBytes:s.length}),!0):(R9({view:`source`,branch:`E`,source:a}),L9(i,{op:`paste`,view:`source`,branch:`E`,source:a}),!1)}var exe=/^[A-Za-z0-9_+-]+$/;function txe(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=`\`\`\`${exe.test(i)?i:``}\n${n}\n\`\`\`\n`,{from:o,to:s}=e.state.selection.main;return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length}}),!0}catch(e){return z9({view:`source`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:V9(e)}),!1}}function nxe(e,t,n,r){let i;try{i=KJ(t)}catch(e){return z9({view:`source`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:V9(e),htmlBytes:t.length}),!1}let a;try{a=qJ(i)}catch(e){return z9({view:`source`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:V9(e),htmlBytes:t.length}),!1}let{from:o,to:s}=e.state.selection.main;if(!(a.length>500*1024))return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length}}),!0;let c=o===s?``:e.state.sliceDoc(o,s);o!==s&&e.dispatch({changes:{from:o,to:s,insert:``}});let l=o,u=DT(n.ytext,l);return _ue(n.ydoc,n.ytext,l,a,{resolveOffset:e=>{let t=kT(u,n.ydoc);return t==null?e:t.index+(e-l)}}).catch(i=>{rxe({view:e,source:r,html:t,restoreText:c,anchorIndex:l,anchorRelPos:u,ydoc:n.ydoc,err:i})}),!0}function rxe(e){let{view:t,source:n,html:r,restoreText:i,anchorIndex:a,anchorRelPos:o,ydoc:s,err:c}=e;if(c instanceof V1&&c.bytesWritten>0){let e=o&&s?kT(o,s)?.index??a:a,n=Math.min(e+c.bytesWritten,t.state.doc.length);try{t.dispatch({changes:{from:e,to:n,insert:i}})}catch(e){console.warn(`[clipboard] partial-chunk rollback dispatch failed`,e)}}else if(i.length>0)try{t.dispatch({changes:{from:a,to:a,insert:i}})}catch(e){console.warn(`[clipboard] selection-restore dispatch failed`,e)}if(c instanceof V1){Ebe({view:`source`,chunksCompleted:c.chunksCompleted,totalChunks:c.totalChunks,bytesWritten:c.bytesWritten,bytesRemaining:c.bytesRemaining,reason:c.message}),Mn.error(`Paste was incomplete — ${c.chunksCompleted} of ${c.totalChunks} chunks landed. Your selection has been restored.`);return}z9({view:`source`,stage:`chunkedYTextInsert`,source:n,branch:`D`,reason:c?.message??`unknown`,errorClass:V9(c),htmlBytes:r.length}),Mn.error(`Paste failed. Your selection has been restored.`)}export{c4 as $,gr as $n,yt as $r,iE as $t,V4 as A,Bs as An,rn as Ar,jO as At,F4 as B,Na as Bn,Dt as Br,Noe as Bt,d6 as C,yl as Cn,Un as Cr,O$ as Ct,phe as D,Rs as Dn,hn as Dr,ase as Dt,o3 as E,Us as En,Mn as Er,ZA as Et,nhe as F,zs as Fn,Bt as Fr,Ioe as Ft,_4 as G,na as Gn,mee as Gr,vO as Gt,j4 as H,ja as Hn,_t as Hr,koe as Ht,Yme as I,Vs as In,bee as Ir,Moe as It,Lpe as J,Kr as Jn,gee as Jr,mO as Jt,Wpe as K,si as Kn,lt as Kr,_O as Kt,Xme as L,La as Ln,Mt as Lr,Poe as Lt,B4 as M,Ws as Mn,Eee as Mr,Boe as Mt,z4 as N,Gs as Nn,Ut as Nr,Voe as Nt,i3 as O,Is as On,pn as Or,MO as Ot,Y4 as P,Ls as Pn,Vt as Pr,wO as Pt,s4 as Q,br as Qn,ot as Qr,zw as Qt,L4 as R,Pa as Rn,jt as Rr,Foe as Rt,n8 as S,Jte as Sn,Wn as Sr,yue as St,hhe as T,_l as Tn,Wee as Tr,UM as Tt,A4 as U,Fa as Un,vt as Ur,gO as Ut,M4 as V,Ma as Vn,St as Vr,hO as Vt,k4 as W,ca as Wn,bt as Wr,bO as Wt,jpe as X,Dr as Xn,rt as Xr,xoe as Xt,d4 as Y,Fr as Yn,hee as Yr,pO as Yt,u4 as Z,Er as Zn,ut as Zr,zD as Zt,u5 as _,Rg as _n,Yn as _r,Iue as _t,F9 as a,XC as an,sr as ar,ype as at,G8 as b,qd as bn,Kn as br,Tue as bt,O9 as c,gb as cn,ir as cr,Gfe as ct,A9 as d,Ly as dn,tr as dr,kfe as dt,$e as ei,AT as en,mr as er,n4 as et,T9 as f,Fy as fn,er as fr,Dfe as ft,d5 as g,b_ as gn,Xn as gr,t2 as gt,Eye as h,y_ as hn,Zn as hr,Nfe as ht,Vbe as i,ST as in,ur as ir,Z2 as it,$me as j,Hs as jn,Xt as jr,zoe as jt,mhe as k,Ks as kn,an as kr,Hoe as kt,D9 as l,hb as ln,ar as lr,Rfe as lt,mbe as m,W_ as mn,Qn as mr,Ofe as mt,Jbe as n,Je as ni,CT as nn,dr as nr,J2 as nt,bbe as o,ZC as on,or,gpe as ot,E9 as p,oae as pn,$n as pr,Afe as pt,p4 as q,ai as qn,ct as qr,yO as qt,Kbe as r,Ze as ri,DT as rn,lr as rr,Q2 as rt,w9 as s,kS as sn,nte as sr,G2 as st,Qbe as t,Qe as ti,kT as tn,pr as tr,t4 as tt,k9 as u,My as un,nr as ur,Lfe as ut,cve as v,wie as vn,Jn as vr,Z1 as vt,ghe as w,vl as wn,Bn as wr,$M as wt,S8 as x,Xd as xn,Gn as xr,Aue as xt,Q8 as y,jd as yn,qn as yr,Sue as yt,I4 as z,Ia as zn,Ot as zr,SO as zt};