@isardsat/editorial-admin 6.21.0 → 6.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/clear-button-C666rKTW.js +1 -0
- package/build/client/assets/{dashboard-CXsgx-dc.js → dashboard-Crt5fSJe.js} +1 -1
- package/build/client/assets/{dashboard._collection._document-BiIWfKiL.js → dashboard._collection._document-D3XXkcBD.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-PercY47A.js → dashboard._collection.new-rMBf1ZGC.js} +1 -1
- package/build/client/assets/{dashboard._layout-BLI8ZXFq.js → dashboard._layout-DOj1cBNu.js} +1 -1
- package/build/client/assets/date-picker-CqVT8lwM.js +1 -0
- package/build/client/assets/datetime-picker-DemhHfWW.js +1 -0
- package/build/client/assets/{index-DutSppa2.js → index-CW4Lhoah.js} +1 -1
- package/build/client/assets/{index-CU6_POhE.js → index-DRumOFGs.js} +1 -1
- package/build/client/assets/itemForm-DcKqLtr7.js +8 -0
- package/build/client/assets/{manifest-9cecc256.js → manifest-63bbd580.js} +1 -1
- package/build/client/assets/{markdownEditor-CZVz5-rL.js → markdownEditor-D3QMBKBF.js} +4 -4
- package/build/client/assets/root-CvQSRYkS.css +1 -0
- package/build/client/assets/{schemas-D-U8dKAF.js → schemas-BabmyWH6.js} +1 -1
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/clear-button-DehdxgmB.js +0 -1
- package/build/client/assets/date-picker-6Pg8PIj8.js +0 -1
- package/build/client/assets/datetime-picker-XkOBOVOZ.js +0 -1
- package/build/client/assets/index-nnJosT4e.js +0 -1
- package/build/client/assets/itemForm-BLyILW73.js +0 -8
- package/build/client/assets/root-DZYAU5bq.css +0 -1
- /package/build/client/assets/{root-dzmn7V-J.js → root-CqtjpfTE.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-DWtXmmFR.js";import{_ as h0,D as u9,b as uc}from"./utils-B48p8Qal.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,g as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-DutSppa2.js";import{i as b9,u as rw}from"./zod-DU3Qlmru.js";import{R as y9,A as k9,P as S9,C as w9,a as v9}from"./index-nnJosT4e.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as C9}from"./index-CU6_POhE.js";import{c as Pm,a as ri,b as vi,u as Rh}from"./index-B5ynPIRP.js";import{c as T9,u as Qm,R as _9,S as P9,T as Q9,V as $9,a as E9,P as A9,C as M9,b as L9,d as I9,e as R9}from"./itemForm-BLyILW73.js";import{u as N9}from"./index-CbaefyjV.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
1
|
+
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-DWtXmmFR.js";import{_ as h0,D as u9,b as uc}from"./utils-B48p8Qal.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,m as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-CW4Lhoah.js";import{i as b9,u as rw}from"./zod-DU3Qlmru.js";import{c as y9,u as Pm,R as k9,S as S9,T as w9,V as v9,a as C9,P as T9,C as _9,b as P9,d as Q9,e as $9,f as E9,A as A9,g as M9,h as L9,i as I9}from"./itemForm-DcKqLtr7.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as R9}from"./index-DRumOFGs.js";import{c as Qm,a as ri,b as vi,u as Rh}from"./index-B5ynPIRP.js";import{u as N9}from"./index-CbaefyjV.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-BabmyWH6.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
2
2
|
|
|
3
3
|
`,sQ=Ci?" ":Dh,xw="֑-߿יִ-﷽ﹰ-ﻼ",bw="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",oQ=new RegExp("^[^"+bw+"]*["+xw+"]"),lQ=new RegExp("^[^"+xw+"]*["+bw+"]"),ps={bold:1,capitalize:1024,code:16,highlight:Em,italic:2,lowercase:256,strikethrough:$u,subscript:32,superscript:64,underline:Eu,uppercase:512},aQ={directionless:1,unmergeable:2},p0={center:Mm,end:Nm,justify:Im,left:Am,right:Lm,start:Rm},cQ={[Mm]:"center",[Nm]:"end",[Im]:"justify",[Am]:"left",[Lm]:"right",[Rm]:"start"},uQ={normal:0,segmented:2,token:1},hQ={[tQ]:"normal",[rQ]:"segmented",[nQ]:"token"},fQ="$";function yw(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(I(o)&&yw(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}const dQ=100;let dp=!1,Dm=0;function pQ(n){Dm=n.timeStamp}function Ef(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Jh(n,t)!==void 0}function gQ(n,e,t){const r=Gn(An(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&lO(e,o,i,s,!1)}function mQ(n,e,t){if(z(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ui(e)&&t.isAttached()}function OQ(n,e,t,r){for(let i=n;i&&!i$(i);i=za(i)){const s=Jh(i,e);if(s!==void 0){const o=Ke(s,t);if(o)return Qe(o)||!nt(i)?void 0:[i,o]}else if(i===r)return[r,l2(t)]}}function kw(n,e,t){dp=!0;const r=performance.now()-Dm>dQ;try{vn(n,(()=>{const i=X()||(function(f){return f.getEditorState().read((()=>{const d=X();return d!==null?d.clone():null}))})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const d=e[f],p=d.type,g=d.target,m=OQ(g,n,l,o);if(!m)continue;const[O,b]=m;if(p==="characterData")r&&q(b)&&ui(g)&&mQ(i,g,b)&&gQ(g,b,n);else if(p==="childList"){c=!0;const x=d.addedNodes;for(let k=0;k<x.length;k++){const S=x[k],v=s2(S),T=S.parentNode;if(T!=null&&S!==a&&v===null&&!Ef(S,T,n)){if(Ci){const A=(nt(S)?S.innerText:null)||S.nodeValue;A&&(u+=A)}T.removeChild(S)}}const y=d.removedNodes,w=y.length;if(w>0){let k=0;for(let S=0;S<w;S++){const v=y[S];(Ef(v,g,n)||a===v)&&(g.appendChild(v),k++)}w!==k&&s.set(O,b)}}}if(s.size>0)for(const[f,d]of s)d.reconcileObservedMutation(f,n);const h=t.takeRecords();if(h.length>0){for(let f=0;f<h.length;f++){const d=h[f],p=d.addedNodes,g=d.target;for(let m=0;m<p.length;m++){const O=p[m],b=O.parentNode;b==null||O.nodeName!=="BR"||Ef(O,g,n)||b.removeChild(O)}}t.takeRecords()}i!==null&&(c&&dt(i),Ci&&h2(n)&&i.insertRawText(u))}))}finally{dp=!1}}function Sw(n){const e=n._observer;e!==null&&kw(n,e.takeRecords(),e)}function ww(n){(function(e){Dm===0&&An(e).addEventListener("textInput",pQ,!0)})(n),n._observer=new MutationObserver(((e,t)=>{kw(n,e,t)}))}let xQ=class vw{constructor(e,t=new Map,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedConfigMap=t,this.unknownState=r,this.knownState=i;const o=s!==void 0?s:(function(l,a,c){let u=c.size;if(a)for(const h in a){const f=l.get(h);f&&c.has(f)||u++}return u})(t,r,i);this.size=o}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState};for(const[t,r]of this.knownState)t.isEqual(r,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(r);return fc(e)?{[fQ]:e}:{}}getWritable(e){if(this.node===e)return this;const t=new Map(this.knownState),r=fc(i=this.unknownState)&&{...i};var i;if(r)for(const s of t.keys())delete r[s.key];return new vw(e,this.sharedConfigMap,fc(r),t,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||this.size++,i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState={},e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i);this.unknownState=fc(this.unknownState)}};function fc(n){if(n)for(const e in n)return n}function bQ(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new xQ(e);return e.__state=t,t}function g0(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,h){if(u===h)return!0;if(u&&h&&u.size!==h.size)return!1;const f=new Set,d=(g,m)=>{for(const[O,b]of g.knownState){if(f.has(O.key))continue;f.add(O.key);const x=m?m.getValue(O):O.defaultValue;if(x!==b&&!O.isEqual(x,b))return!0}return!1},p=(g,m)=>{const{unknownState:O}=g,b=m?m.unknownState:void 0;if(O){for(const[x,y]of Object.entries(O))if(!f.has(x)&&(f.add(x),y!==(b?b[x]:void 0)))return!0}return!1};return!(u&&d(u,h)||h&&d(h,u)||u&&p(u,h)||h&&p(h,u))})(a,c))}function m0(n,e){const t=n.mergeWithSibling(e),r=tt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function O0(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(g0(e,r)){r=m0(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(g0(r,t)){r=m0(r,t);break}break}t.remove()}}else r.remove()}function gs(n){return x0(n.anchor),x0(n.focus),n}function x0(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),q(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!I(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let Pi,Ft,Yl,Zh,pp,gp,ms,Yn,mp,Hl,gt="",Vt="",dr=null,pr="",Yr="",Cw=!1,Ul=!1,su=null;function Au(n,e){const t=ms.get(n);if(e!==null){const r=bp(n);r.parentNode===e&&e.removeChild(r)}if(Yn.has(n)||Ft._keyToDOMMap.delete(n),I(t)){const r=Lu(t,ms);Op(r,0,r.length-1,null)}t!==void 0&&aO(Hl,Yl,Zh,t,"destroyed")}function Op(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&Au(s,r)}}function ji(n,e){n.setProperty("text-align",e)}const yQ="40px";function Tw(n,e){const t=Pi.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||yQ;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function _w(n,e){const t=n.style;e===0?ji(t,""):e===Am?ji(t,"left"):e===Mm?ji(t,"center"):e===Lm?ji(t,"right"):e===Im?ji(t,"justify"):e===Rm?ji(t,"start"):e===Nm&&ji(t,"end")}function Mu(n,e){const t=Yn.get(n);t===void 0&&F(60);const r=t.createDOM(Pi,Ft);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const h=`__lexicalKey_${c._key}`;a[h]=u})(s,o,i),l.set(i,s)})(n,r,Ft),q(t)?r.setAttribute("data-lexical-text","true"):Qe(t)&&r.setAttribute("data-lexical-decorator","true"),I(t)){const i=t.__indent,s=t.__size;if(i!==0&&Tw(r,i),s!==0){const l=s-1;(function(a,c,u,h){const f=Vt;Vt="",xp(a,u,0,c,u.getDOMSlot(h)),Qw(u,h),Vt=f})(Lu(t,Yn),l,t,r)}const o=t.__format;o!==0&&_w(r,o),t.isInline()||Pw(null,t,r),ef(t)&&(gt+=ii,Yr+=ii)}else{const i=t.getTextContent();if(Qe(t)){const s=t.decorate(Ft,Pi);s!==null&&$w(n,s),r.contentEditable="false"}else q(t)&&(t.isDirectionless()||(Vt+=i));gt+=i,Yr+=i}return e!==null&&e.insertChild(r),aO(Hl,Yl,Zh,t,"created"),r}function xp(n,e,t,r,i){const s=gt;gt="";let o=t;for(;o<=r;++o){Mu(n[o],i);const l=Yn.get(n[o]);l!==null&&q(l)&&(dr===null&&(dr=l.getFormat()),pr===""&&(pr=l.getStyle()))}ef(e)&&(gt+=ii),i.element.__lexicalTextContent=gt,gt=s+gt}function b0(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Hn(r)?"line-break":Qe(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Pw(n,e,t){const r=b0(n,ms),i=b0(e,Yn);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Qw(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==Vt||r!==su){const i=Vt==="",s=i?su:(function(o){return oQ.test(o)?"rtl":lQ.test(o)?"ltr":null})(Vt);if(s!==r){const o=e.classList,l=Pi.theme;let a=r!==null?l[r]:void 0,c=s!==null?l[s]:void 0;if(a!==void 0){if(typeof a=="string"){const u=Qu(a);a=l[r]=u}o.remove(...a)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const u=Qu(c);c=l[s]=u}c!==void 0&&o.add(...c)}e.dir=s}Ul||(n.getWritable().__dir=s)}su=s,e.__lexicalDirTextContent=Vt,e.__lexicalDir=s}}function kQ(n,e,t){const r=Vt;var i;Vt="",dr=null,pr="",(function(s,o,l){const a=gt,c=s.__size,u=o.__size;gt="";const h=l.element;if(c===1&&u===1){const f=s.__first,d=o.__first;if(f===d)gl(f,h);else{const g=bp(f),m=Mu(d,null);try{h.replaceChild(m,g)}catch(O){if(typeof O=="object"&&O!=null){const b=`${O.toString()} Parent: ${h.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(b)}throw O}Au(f,null)}const p=Yn.get(d);q(p)&&(dr===null&&(dr=p.getFormat()),pr===""&&(pr=p.getStyle()))}else{const f=Lu(s,ms),d=Lu(o,Yn);if(f.length!==c&&F(227),d.length!==u&&F(228),c===0)u!==0&&xp(d,o,0,u-1,l);else if(u===0){if(c!==0){const p=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Op(f,0,c-1,p?null:h),p&&(h.textContent="")}}else(function(p,g,m,O,b,x){const y=O-1,w=b-1;let k,S,v=x.getFirstChild(),T=0,A=0;for(;T<=y&&A<=w;){const E=g[T],D=m[A];if(E===D)v=Af(gl(D,x.element)),T++,A++;else{k===void 0&&(k=new Set(g)),S===void 0&&(S=new Set(m));const J=S.has(E),U=k.has(D);if(J)if(U){const le=fo(Ft,D);le===v?v=Af(gl(D,x.element)):(x.withBefore(v).insertChild(le),gl(D,x.element)),T++,A++}else Mu(D,x.withBefore(v)),A++;else v=Af(bp(E)),Au(E,x.element),T++}const B=Yn.get(D);B!==null&&q(B)&&(dr===null&&(dr=B.getFormat()),pr===""&&(pr=B.getStyle()))}const M=T>y,L=A>w;if(M&&!L){const E=m[w+1],D=E===void 0?null:Ft.getElementByKey(E);xp(m,p,A,w,x.withBefore(D))}else L&&!M&&Op(g,T,y,x.element)})(o,f,d,c,u,l)}ef(o)&&(gt+=ii),h.__lexicalTextContent=gt,gt=a+gt})(n,e,e.getDOMSlot(t)),Qw(e,t),i=e,dr==null||dr===i.__textFormat||Ul||i.setTextFormat(dr),(function(s){pr===""||pr===s.__textStyle||Ul||s.setTextStyle(pr)})(e),Vt=r}function Lu(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function gl(n,e){const t=ms.get(n);let r=Yn.get(n);t!==void 0&&r!==void 0||F(61);const i=Cw||gp.has(n)||pp.has(n),s=fo(Ft,n);if(t===r&&!i){if(I(t)){const o=s.__lexicalTextContent;o!==void 0&&(gt+=o,Yr+=o);const l=s.__lexicalDirTextContent;l!==void 0&&(Vt+=l)}else{const o=t.getTextContent();q(t)&&!t.isDirectionless()&&(Vt+=o),Yr+=o,gt+=o}return s}if(t!==r&&i&&aO(Hl,Yl,Zh,r,"updated"),r.updateDOM(t,s,Pi)){const o=Mu(n,null);return e===null&&F(62),e.replaceChild(o,s),Au(n,null),o}if(I(t)&&I(r)){const o=r.__indent;o!==t.__indent&&Tw(s,o);const l=r.__format;l!==t.__format&&_w(s,l),i&&(kQ(t,r,s),Qt(r)||r.isInline()||Pw(t,r,s)),ef(r)&&(gt+=ii,Yr+=ii)}else{const o=r.getTextContent();if(Qe(r)){const l=r.decorate(Ft,Pi);l!==null&&$w(n,l)}else q(r)&&!r.isDirectionless()&&(Vt+=o);gt+=o,Yr+=o}if(!Ul&&Qt(r)&&r.__cachedText!==Yr){const o=r.getWritable();o.__cachedText=Yr,r=o}return s}function $w(n,e){let t=Ft._pendingDecorators;const r=Ft._decorators;if(t===null){if(r[n]===e)return;t=o2(Ft)}t[n]=e}function Af(n){let e=n.nextSibling;return e!==null&&e===Ft._blockCursorElement&&(e=e.nextSibling),e}function SQ(n,e,t,r,i,s){gt="",Yr="",Vt="",Cw=r===uo,su=null,Ft=t,Pi=t._config,Yl=t._nodes,Zh=Ft._listeners.mutation,pp=i,gp=s,ms=n._nodeMap,Yn=e._nodeMap,Ul=e._readOnly,mp=new Map(t._keyToDOMMap);const o=new Map;return Hl=o,gl("root",null),Ft=void 0,Yl=void 0,pp=void 0,gp=void 0,ms=void 0,Yn=void 0,Pi=void 0,mp=void 0,Hl=void 0,o}function bp(n){const e=mp.get(n);return e===void 0&&F(75,n),e}function ci(n){return{}}const Bh={},wQ={},zh={},ls={},Hs={},Gl={},Us={},Aa={},yp={},Kl={},Jl={},Kr={},Vh={},Fh={},Ew={},Aw={},vQ={},Zm={},CQ={},Bm={},zm={},ea={},Vm={},Xh={},Ma={},Wh={},Fm={},Mw={},Iu={},kp={},Xm={},TQ={},qh={},Wm={},_Q={},jh={},qm={},Sp={},PQ={},QQ={},ml={},Ol={},Lw={},Iw={},Rw={},Vr=Object.freeze({}),wp=30,vp=[["keydown",function(n,e){if(Ql=n.timeStamp,Cp=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;if(!re(e,Ew,n)&&t!=null){if(Mf&&As(Cp))return vn(e,(()=>{dc(e,Lf)})),Mf=!1,void(Lf="");if((function(l,a,c,u){return q0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Aw,n);else if((function(l,a,c,u,h){return q0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,vQ,n);else if((function(l,a,c,u){return W0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Zm,n);else if((function(l,a,c,u,h){return W0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,CQ,n);else if((function(l,a,c){return(function(u){return u==="ArrowUp"})(l)&&!a&&!c})(t,i,s))re(e,Bm,n);else if((function(l,a,c){return(function(u){return u==="ArrowDown"})(l)&&!a&&!c})(t,i,s))re(e,zm,n);else if((function(l,a){return j0(l)&&a})(t,r))$l=!0,re(e,ea,n);else if((function(l){return l===" "})(t))re(e,Vm,n);else if((function(l,a){return Vn&&a&&l.toLowerCase()==="o"})(t,i))n.preventDefault(),$l=!0,re(e,Hs,!0);else if((function(l,a){return j0(l)&&!a})(t,r))$l=!1,re(e,ea,n);else if((function(l,a,c,u){return Vn?!a&&!c&&(As(l)||l.toLowerCase()==="h"&&u):u||a||c?!1:As(l)})(t,o,s,i))As(t)?re(e,Xh,n):(n.preventDefault(),re(e,ls,!0));else if((function(l){return l==="Escape"})(t))re(e,Ma,n);else if((function(l,a,c,u,h){return Vn?!(c||u||h)&&(nl(l)||l.toLowerCase()==="d"&&a):a||u||h?!1:nl(l)})(t,i,r,o,s))nl(t)?re(e,Wh,n):(n.preventDefault(),re(e,ls,!1));else if((function(l,a,c){return As(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!0);else if((function(l,a,c){return nl(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!1);else if((function(l,a){return Vn&&a&&As(l)})(t,s))n.preventDefault(),re(e,Jl,!0);else if((function(l,a){return Vn&&a&&nl(l)})(t,s))n.preventDefault(),re(e,Jl,!1);else if((function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"bold");else if((function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"underline");else if((function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"italic");else if((function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u})(t,o,i,s))re(e,Fm,n);else if((function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&xl(c,u)})(t,r,s,i))n.preventDefault(),re(e,Vh,void 0);else if((function(l,a,c,u){return Vn?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a})(t,r,s,i))n.preventDefault(),re(e,Fh,void 0);else{const l=e._editorState._selection;l===null||z(l)?!Ci&&Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="c"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,jh,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="x"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,qm,n)):Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n))}(function(l,a,c,u){return l||a||c||u})(i,r,o,s)&&re(e,Rw,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Bo(t)&&r!=="touch"&&n.button===0&&vn(e,(()=>{Qe(Ar(t))||(_p=!0)}))}],["compositionstart",function(n,e){vn(e,(()=>{const t=X();if(z(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Tt(r.key),(n.timeStamp<Ql+wp||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||q(i)&&i.getStyle()!==t.style)&&re(e,Us,sQ)}}))}],["compositionend",function(n,e){Ci?tl=!0:co||!jl&&!Pu?vn(e,(()=>{dc(e,n.data)})):(Mf=!0,Lf=n.data)}],["input",function(n,e){n.stopPropagation(),vn(e,(()=>{const t=X(),r=n.data,i=zw(n);if(r!=null&&z(t)&&Zw(t,i,r,n.timeStamp,!1)){tl&&(dc(e,r),tl=!1);const s=t.anchor.getNode(),o=Gn(An(e));if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;_u&&!t.isCollapsed()&&q(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===u2(o.anchorNode)||re(e,Us,r);const u=r.length;Ci&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),jl||co||Pu||!e.isComposing()||(Ql=0,Tt(null))}else oO(!1,e,r!==null?r:void 0),tl&&(dc(e,r||void 0),tl=!1);(function(){At();const s=tt();Sw(s)})()}),{event:n}),Ns=null}],["click",function(n,e){vn(e,(()=>{const t=X(),r=Gn(An(e)),i=No();if(r){if(z(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Qt(o)&&Fe().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=(function(a,c){let u=a;for(;u!==Fe()&&u!=null;){if(c(u))return u;u=u.getParent()}return null})(o,(a=>I(a)&&!a.isInline()));I(l)&&l.select(0)}}else if(n.pointerType==="touch"){const s=r.anchorNode;(nt(s)||ui(s))&&dt(Um(i,r,e,n))}}re(e,zh,n)}))}],["cut",Vr],["copy",Vr],["dragstart",Vr],["dragover",Vr],["dragend",Vr],["paste",Vr],["focus",Vr],["blur",Vr],["drop",Vr]];_u&&vp.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType,s=zw(t);i==="deleteCompositionText"||Ci&&h2(r)||i!=="insertCompositionText"&&vn(r,(()=>{const o=X();if(i==="deleteContentBackward"){if(o===null){const d=No();if(!z(d))return;dt(d.clone())}if(z(o)){const d=o.anchor.key===o.focus.key;if(l=t.timeStamp,Cp==="MediaLast"&&l<Ql+wp&&r.isComposing()&&d){if(Tt(null),Ql=0,setTimeout((()=>{vn(r,(()=>{Tt(null)}))}),wp),z(o)){const p=o.anchor.getNode();p.markDirty(),q(p)||F(142),Bw(o,p)}}else{Tt(null),t.preventDefault();const p=o.anchor.getNode(),g=p.getTextContent(),m=p.canInsertTextAfter(),O=o.anchor.offset===0&&o.focus.offset===g.length;let b=d0&&d&&!O&&m;if(b&&o.isCollapsed()&&(b=!Qe(Ep(o.anchor,!0))),!b){re(r,ls,!0);const x=X();d0&&z(x)&&x.isCollapsed()&&(Ki=x,setTimeout((()=>Ki=null)))}}return}}var l;if(!z(o))return;const a=t.data;Ns!==null&&oO(!1,r,Ns),o.dirty&&Ns===null||!o.isCollapsed()||Qt(o.anchor.getNode())||s===null||o.applyDOMRange(s),Ns=null;const c=o.anchor,u=o.focus,h=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(r,Us,t);break;case"insertFromComposition":Tt(null),re(r,Us,t);break;case"insertLineBreak":Tt(null),re(r,Hs,!1);break;case"insertParagraph":Tt(null),$l&&!co?($l=!1,re(r,Hs,!1)):re(r,Gl,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(r,Aa,t);break;case"deleteByComposition":(function(d,p){return d!==p||I(d)||I(p)||!d.isToken()||!p.isToken()})(h,f)&&re(r,yp,t);break;case"deleteByDrag":case"deleteByCut":re(r,yp,t);break;case"deleteContent":re(r,ls,!1);break;case"deleteWordBackward":re(r,Kl,!0);break;case"deleteWordForward":re(r,Kl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(r,Jl,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(r,Jl,!1);break;case"formatStrikeThrough":re(r,Kr,"strikethrough");break;case"formatBold":re(r,Kr,"bold");break;case"formatItalic":re(r,Kr,"italic");break;case"formatUnderline":re(r,Kr,"underline");break;case"historyUndo":re(r,Vh,void 0);break;case"historyRedo":re(r,Fh,void 0)}else{if(a===`
|
|
4
4
|
`)t.preventDefault(),re(r,Hs,!1);else if(a===ii)t.preventDefault(),re(r,Gl,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&Zw(o,s,a,t.timeStamp,!0)?(t.preventDefault(),re(r,Us,a)):Ns=a;Nw=t.timeStamp}}))})(n,e)]);let Ql=0,Cp=null,Nw=0,Ns=null;const Ru=new WeakMap;let Tp=!1,_p=!1,$l=!1,tl=!1,Mf=!1,Lf="",Ki=null,Dw=[0,"",0,"root",0];function Zw(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=tt(),c=Gn(An(a)),u=c!==null?c.anchorNode:null,h=s.key,f=a.getElementByKey(h),d=t.length;return h!==o.key||!q(l)||(!i&&(!_u||Nw<r+50)||l.isDirty()&&d<2||a2(t))&&s.offset!==o.offset&&!l.isComposing()||Ds(l)||l.isDirty()&&d>1||(i||!_u)&&f!==null&&!l.isComposing()&&u!==ho(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(p,g){if(g.isSegmented())return!0;if(!p.isCollapsed())return!1;const m=p.anchor.offset,O=g.getParentOrThrow(),b=g.isToken();return m===0?!g.canInsertTextBefore()||!O.canInsertTextBefore()&&!g.isComposing()||b||(function(x){const y=x.getPreviousSibling();return(q(y)||I(y)&&y.isInline())&&!y.canInsertTextAfter()})(g):m===g.getTextContentSize()&&(!g.canInsertTextAfter()||!O.canInsertTextAfter()&&!g.isComposing()||b)})(n,l)}function y0(n,e){return ui(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function k0(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Tp&&(Tp=!1,y0(r,i)&&y0(s,o)&&!Ki)||vn(e,(()=>{if(!t)return void dt(null);if(!Ba(e,r,s))return;let l=X();if(Ki&&z(l)&&l.isCollapsed()){const a=l.anchor,c=Ki.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ki.clone(),dt(l))}if(Ki=null,z(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=An(e).event,h=u?u.timeStamp:performance.now(),[f,d,p,g,m]=Dw,O=Fe(),b=e.isComposing()===!1&&O.getTextContent()==="";if(h<m+200&&a.offset===p&&a.key===g)ou(l,f,d);else if(a.type==="text")q(c)||F(141),Bw(l,c);else if(a.type==="element"&&!b){I(c)||F(259);const x=a.getNode();x.isEmpty()?(function(y,w){const k=w.getTextFormat(),S=w.getTextStyle();ou(y,k,S)})(l,x):ou(l,0,"")}}else{const u=a.key,h=l.focus.key,f=l.getNodes(),d=f.length,p=l.isBackward(),g=p?o:i,m=p?i:o,O=p?h:u,b=p?u:h;let x=iQ,y=!1;for(let w=0;w<d;w++){const k=f[w],S=k.getTextContentSize();if(q(k)&&S!==0&&!(w===0&&k.__key===O&&g===S||w===d-1&&k.__key===b&&m===0)&&(y=!0,x&=k.getFormat(),x===0))break}l.format=y?x:0}}re(e,Bh,void 0)}))}function ou(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Bw(n,e){ou(n,e.getFormat(),e.getStyle())}function zw(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function dc(n,e){const t=n._compositionKey;if(Tt(null),t!==null&&e!=null){if(e===""){const r=Ke(t),i=ho(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&q(r)&&lO(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
@@ -56,7 +56,7 @@ import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";i
|
|
|
56
56
|
`;break}case-3:{o=`\r
|
|
57
57
|
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function s6(n){const r={constructs:O8([t6,...(n||{}).extensions||[]]),content:i(y8),defined:[],document:i(S8),flow:i(B4),lazy:{},string:i(F4),text:i(X4)};return r;function i(s){return o;function o(l){return n6(r,s,l)}}}function o6(n){for(;!av(n););return n}const qx=/[\0\t\n\r]/g;function l6(){let n=1,e="",t=!0,r;return i;function i(s,o,l){const a=[];let c,u,h,f,d;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,e="",t&&(s.charCodeAt(0)===65279&&h++,t=void 0);h<s.length;){if(qx.lastIndex=h,c=qx.exec(s),f=c&&c.index!==void 0?c.index:s.length,d=s.charCodeAt(f),!c){e=s.slice(h);break}if(d===10&&h===f&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),h<f&&(a.push(s.slice(h,f)),n+=f-h),d){case 0:{a.push(65533),n++;break}case 9:{for(u=Math.ceil(n/4)*4,a.push(-2);n++<u;)a.push(-1);break}case 10:{a.push(-4),n=1;break}default:r=!0,n=1}h=f+1}return l&&(r&&a.push(-5),e&&a.push(e),a.push(null)),a}}const pv={}.hasOwnProperty;function a6(n,e,t){return typeof e!="string"&&(t=e,e=void 0),c6(t)(o6(s6(t).document().write(l6()(n,e,!0))))}function c6(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(cn),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(jt),blockQuote:s(Oe),characterEscape:T,characterReference:T,codeFenced:s(Ae),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Ae,o),codeText:s(St,o),codeTextData:T,data:T,codeFlowValue:T,definition:s(wt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(wn),hardBreakEscape:s(Yt),hardBreakTrailing:s(Yt),htmlFlow:s(an,o),htmlFlowData:T,htmlText:s(an,o),htmlTextData:T,image:s(di),label:o,link:s(cn),listItem:s(Zt),listItemValue:f,listOrdered:s(ar,h),listUnordered:s(ar),paragraph:s(qi),reference:$,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(jt),strong:s(Dn),thematicBreak:s(un)},exit:{atxHeading:a(),atxHeadingSequence:w,autolink:a(),autolinkEmail:ue,autolinkProtocol:ie,blockQuote:a(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:pe,characterReference:ae,codeFenced:a(m),codeFencedFence:g,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:A,codeIndented:a(O),codeText:a(B),codeTextData:A,data:A,definition:a(),definitionDestinationString:y,definitionLabelString:b,definitionTitleString:x,emphasis:a(),hardBreakEscape:a(L),hardBreakTrailing:a(L),htmlFlow:a(E),htmlFlowData:A,htmlText:a(D),htmlTextData:A,image:a(U),label:te,labelText:le,lineEnding:M,link:a(J),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:ye,resourceDestinationString:Q,resourceTitleString:fe,resource:de,setextHeading:a(v),setextHeadingLineSequence:S,setextHeadingText:k,strong:a(),thematicBreak:a()}};gv(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(Z){let V={type:"root",children:[]};const _={stack:[V],tokenStack:[],config:e,enter:l,exit:c,buffer:o,resume:u,data:t},me=[];let we=-1;for(;++we<Z.length;)if(Z[we][1].type==="listOrdered"||Z[we][1].type==="listUnordered")if(Z[we][0]==="enter")me.push(we);else{const qe=me.pop();we=i(Z,qe,we)}for(we=-1;++we<Z.length;){const qe=e[Z[we][0]];pv.call(qe,Z[we][1].type)&&qe[Z[we][1].type].call(Object.assign({sliceSerialize:Z[we][2].sliceSerialize},_),Z[we][1])}if(_.tokenStack.length>0){const qe=_.tokenStack[_.tokenStack.length-1];(qe[1]||jx).call(_,void 0,qe[0])}for(V.position={start:pi(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:pi(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<e.transforms.length;)V=e.transforms[we](V)||V;return V}function i(Z,V,_){let me=V-1,we=-1,qe=!1,Zr,Br,Jo,el;for(;++me<=_;){const hn=Z[me];switch(hn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{hn[0]==="enter"?we++:we--,el=void 0;break}case"lineEndingBlank":{hn[0]==="enter"&&(Zr&&!el&&!we&&!Jo&&(Jo=me),el=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:el=void 0}if(!we&&hn[0]==="enter"&&hn[1].type==="listItemPrefix"||we===-1&&hn[0]==="exit"&&(hn[1].type==="listUnordered"||hn[1].type==="listOrdered")){if(Zr){let Es=me;for(Br=void 0;Es--;){const zr=Z[Es];if(zr[1].type==="lineEnding"||zr[1].type==="lineEndingBlank"){if(zr[0]==="exit")continue;Br&&(Z[Br][1].type="lineEndingBlank",qe=!0),zr[1].type="lineEnding",Br=Es}else if(!(zr[1].type==="linePrefix"||zr[1].type==="blockQuotePrefix"||zr[1].type==="blockQuotePrefixWhitespace"||zr[1].type==="blockQuoteMarker"||zr[1].type==="listItemIndent"))break}Jo&&(!Br||Jo<Br)&&(Zr._spread=!0),Zr.end=Object.assign({},Br?Z[Br][1].start:hn[1].end),Z.splice(Br||me,0,["exit",Zr,hn[2]]),me++,_++}if(hn[1].type==="listItemPrefix"){const Es={type:"listItem",_spread:!1,start:Object.assign({},hn[1].start),end:void 0};Zr=Es,Z.splice(me,0,["enter",Es,hn[2]]),me++,_++,Jo=void 0,el=!0}}}return Z[V][1]._spread=qe,_}function s(Z,V){return _;function _(me){l.call(this,Z(me),me),V&&V.call(this,me)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(Z,V,_){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([V,_||void 0]),Z.position={start:pi(V.start),end:void 0}}function a(Z){return V;function V(_){Z&&Z.call(this,_),c.call(this,_)}}function c(Z,V){const _=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==Z.type&&(V?V.call(this,Z,me[0]):(me[1]||jx).call(this,Z,me[0]));else throw new Error("Cannot close `"+Z.type+"` ("+Jr({start:Z.start,end:Z.end})+"): it’s not open");_.position.end=pi(Z.end)}function u(){return kO(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(Z){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function d(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.lang=Z}function p(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.meta=Z}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function O(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.value=Z.replace(/(\r?\n|\r)$/g,"")}function b(Z){const V=this.resume(),_=this.stack[this.stack.length-1];_.label=V,_.identifier=Js(this.sliceSerialize(Z)).toLowerCase()}function x(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.title=Z}function y(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.url=Z}function w(Z){const V=this.stack[this.stack.length-1];if(!V.depth){const _=this.sliceSerialize(Z).length;V.depth=_}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function S(Z){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function v(){this.data.setextHeadingSlurpLineEnding=void 0}function T(Z){const _=this.stack[this.stack.length-1].children;let me=_[_.length-1];(!me||me.type!=="text")&&(me=Be(),me.position={start:pi(Z.start),end:void 0},_.push(me)),this.stack.push(me)}function A(Z){const V=this.stack.pop();V.value+=this.sliceSerialize(Z),V.position.end=pi(Z.end)}function M(Z){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _=V.children[V.children.length-1];_.position.end=pi(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(V.type)&&(T.call(this,Z),A.call(this,Z))}function L(){this.data.atHardBreak=!0}function E(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.value=Z}function D(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.value=Z}function B(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.value=Z}function J(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=V,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function U(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=V,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function le(Z){const V=this.sliceSerialize(Z),_=this.stack[this.stack.length-2];_.label=ev(V),_.identifier=Js(V).toLowerCase()}function te(){const Z=this.stack[this.stack.length-1],V=this.resume(),_=this.stack[this.stack.length-1];if(this.data.inReference=!0,_.type==="link"){const me=Z.children;_.children=me}else _.alt=V}function Q(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.url=Z}function fe(){const Z=this.resume(),V=this.stack[this.stack.length-1];V.title=Z}function de(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function ye(Z){const V=this.resume(),_=this.stack[this.stack.length-1];_.label=V,_.identifier=Js(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function ke(Z){this.data.characterReferenceType=Z.type}function pe(Z){const V=this.sliceSerialize(Z),_=this.data.characterReferenceType;let me;_?(me=J2(V,_==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=na(V);const we=this.stack[this.stack.length-1];we.value+=me}function ae(Z){const V=this.stack.pop();V.position.end=pi(Z.end)}function ie(Z){A.call(this,Z);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(Z)}function ue(Z){A.call(this,Z);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(Z)}function Oe(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function St(){return{type:"inlineCode",value:""}}function wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wn(){return{type:"emphasis",children:[]}}function jt(){return{type:"heading",depth:0,children:[]}}function Yt(){return{type:"break"}}function an(){return{type:"html",value:""}}function di(){return{type:"image",title:null,url:"",alt:null}}function cn(){return{type:"link",title:null,url:"",children:[]}}function ar(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function Zt(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function qi(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function Be(){return{type:"text",value:""}}function un(){return{type:"thematicBreak"}}}function pi(n){return{line:n.line,column:n.column,offset:n.offset}}function gv(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?gv(n,r):u6(n,r)}}function u6(n,e){let t;for(t in e)if(pv.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function jx(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Jr({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Jr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Jr({start:e.start,end:e.end})+") is still open")}function sl(n){return n.children instanceof Array}class qp extends Error{constructor(e,t){super(e),this.name="MarkdownParseError",this.cause=t}}class jp extends Error{constructor(e){super(e),this.name="UnrecognizedMarkdownConstructError"}}function h6(n){const e=new Map;return n.type!=="root"?{importDeclarations:{}}:(n.children.filter(r=>r.type==="mdxjsEsm").filter(r=>r.value.startsWith("import ")).forEach(r=>{var i,s;(((s=(i=r.data)==null?void 0:i.estree)==null?void 0:s.body)??[]).forEach(o=>{o.type==="ImportDeclaration"&&o.specifiers.forEach(l=>{e.set(l.local.name,{source:`${o.source.value}`,defaultExport:l.type==="ImportDefaultSpecifier"})})})}),{importDeclarations:Object.fromEntries(e.entries())})}function f6({root:n,markdown:e,visitors:t,syntaxExtensions:r,mdastExtensions:i,...s}){var o;let l;try{l=a6(e,{extensions:r,mdastExtensions:i})}catch(a){throw a instanceof Error?new qp(`Error parsing markdown: ${a.message}`,a):new qp(`Error parsing markdown: ${a}`,a)}l.children.length===0&&l.children.push({type:"paragraph",children:[]}),((o=l.children.at(-1))==null?void 0:o.type)!=="paragraph"&&l.children.push({type:"paragraph",children:[]}),d6({root:n,mdastRoot:l,visitors:t,...s})}function d6({root:n,mdastRoot:e,visitors:t,...r}){const i=new WeakMap,s=new WeakMap,o=h6(e);t=t.sort((c,u)=>(u.priority??0)-(c.priority??0));function l(c,u){if(!sl(c))throw new Error("Attempting to visit children of a non-parent");c.children.forEach(h=>{a(h,u,c)})}function a(c,u,h,f=null){const d=t.find((p,g)=>f?.has(g)?!1:typeof p.testNode=="string"?p.testNode===c.type:p.testNode(c,r));if(!d)try{throw new jp(`Unsupported markdown syntax: ${tv(c)}`)}catch{throw new jp(`Parsing of the following markdown structure failed: ${JSON.stringify({type:c.type,name:"name"in c?c.name:"N/A"})}`)}d.visitNode({mdastNode:c,lexicalParent:u,mdastParent:h,descriptors:r,metaData:o,actions:{visitChildren:l,nextVisitor(){a(c,u,h,(f??new Set).add(t.indexOf(d)))},addAndStepInto(p){u.append(p),sl(c)&&l(c,p)},addFormatting(p,g){g||sl(c)&&(g=c),g&&i.set(g,p|(i.get(h)??0))},removeFormatting(p,g){g||sl(c)&&(g=c),g&&i.set(g,p^(i.get(h)??0))},getParentFormatting(){return i.get(h)??0},addStyle(p,g){g||sl(c)&&(g=c),g&&s.set(g,p)},getParentStyle(){return s.get(h)??""}}})}a(e,n,null)}var p6=Object.defineProperty,g6=(n,e,t)=>e in n?p6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Jf=(n,e,t)=>(g6(n,typeof e!="symbol"?e+"":e,t),t);const Yx="generic-html";class Xa extends nr{constructor(e,t,r,i){super(i),Jf(this,"__tag"),Jf(this,"__nodeType"),Jf(this,"__attributes"),this.__tag=e,this.__nodeType=t,this.__attributes=r}static getType(){return Yx}static clone(e){return new Xa(e.__tag,e.__nodeType,e.__attributes,e.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){const t=this.getWritable();t.__attributes=e}getStyle(){var e;return(e=this.__attributes.find(t=>t.name==="style"))==null?void 0:e.value}createDOM(){const e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(r=>{t.setAttribute(r.name,r.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){const{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){const t=mv(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:Yx,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType==="mdxJsxTextElement"}}function mv(n,e,t){return on(new Xa(n,e,t))}function m6(n){return n instanceof Xa}const O6={testLexicalNode:m6,visitLexicalNode({actions:n,lexicalNode:e}){n.addAndStepInto("mdxJsxTextElement",{name:e.getTag(),type:e.getNodeType(),attributes:e.getAttributes()})},priority:-100},x6={testLexicalNode:Hn,visitLexicalNode:({mdastParent:n,actions:e})=>{e.appendToParent(n,{type:"text",value:`
|
|
58
58
|
`})}},b6={testLexicalNode:tO,visitLexicalNode:({actions:n})=>{n.addAndStepInto("paragraph")}},y6={testLexicalNode:Qt,visitLexicalNode:({actions:n})=>{n.addAndStepInto("root")}},Ll=1,Il=2,hu=4,Rl=8,vO=16,fu=32,du=64;function Hx(n){return n.type==="text"}const k6=["u","span","sub","sup"],S6={shouldJoin:(n,e)=>{if(["text","emphasis","strong"].includes(n.type))return n.type===e.type;if(n.type==="mdxJsxTextElement"&&e.type==="mdxJsxTextElement"&&k6.includes(e.name)){const t=e;return n.name===t.name&&JSON.stringify(n.attributes)===JSON.stringify(t.attributes)}return!1},join(n,e){return Hx(n)&&Hx(e)?{type:"text",value:n.value+e.value}:{...n,children:[...n.children,...e.children]}},testLexicalNode:q,visitLexicalNode:({lexicalNode:n,mdastParent:e,actions:t})=>{const r=n.getPreviousSibling(),i=q(r)?r.getFormat():0,s=n.getTextContent(),o=n.getFormat(),l=n.getStyle();let a=e;if(l&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"span",children:[],attributes:[{type:"mdxJsxAttribute",name:"style",value:l}]})),i&o&Rl&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),i&o&du&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),i&o&fu&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),i&o&Il&&(a=t.appendToParent(a,{type:"emphasis",children:[]})),i&o&Ll&&(a=t.appendToParent(a,{type:"strong",children:[]})),i&o&hu&&(a=t.appendToParent(a,{type:"delete",children:[]})),o&Rl&&!(i&Rl)&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),o&du&&!(i&du)&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),o&fu&&!(i&fu)&&(a=t.appendToParent(a,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),o&Il&&!(i&Il)&&(a=t.appendToParent(a,{type:"emphasis",children:[]})),o&Ll&&!(i&Ll)&&(a=t.appendToParent(a,{type:"strong",children:[]})),o&hu&&!(i&hu)&&(a=t.appendToParent(a,{type:"delete",children:[]})),o&vO){t.appendToParent(a,{type:"inlineCode",value:s});return}t.appendToParent(a,{type:"text",value:s})}},w6={testNode:"break",visitNode:function({lexicalParent:n}){n.append(Un())}};function yc(n,e){return[{testNode:t=>t.type==="mdxJsxTextElement"&&t.name===n,visitNode({actions:t,mdastNode:r,lexicalParent:i}){t.addFormatting(e),t.visitChildren(r,i)}},{testNode:t=>t.type==="html"&&t.value===`<${n}>`,visitNode({actions:t,mdastParent:r}){t.addFormatting(e,r)}},{testNode:t=>t.type==="html"&&t.value===`</${n}>`,visitNode({actions:t,mdastParent:r}){t.removeFormatting(e,r)}}]}const v6={testNode:"delete",visitNode({mdastNode:n,actions:e,lexicalParent:t}){e.addFormatting(hu),e.visitChildren(n,t)}},C6={testNode:"inlineCode",visitNode({mdastNode:n,actions:e}){e.addAndStepInto(He(n.value).setFormat(e.getParentFormatting()|vO))}},T6={testNode:"emphasis",visitNode({mdastNode:n,actions:e,lexicalParent:t}){e.addFormatting(Il),e.visitChildren(n,t)}},_6={testNode:"strong",visitNode({mdastNode:n,actions:e,lexicalParent:t}){e.addFormatting(Ll),e.visitChildren(n,t)}},P6=[T6,_6,...yc("u",Rl),...yc("code",vO),C6,v6,...yc("sup",du),...yc("sub",fu)],Q6={testNode:nv,visitNode:function({mdastNode:n,actions:e,lexicalParent:t}){n.name==="span"&&n.attributes.length===1&&n.attributes[0].type==="mdxJsxAttribute"&&n.attributes[0].name==="style"?(e.addStyle(n.attributes[0].value,n),e.visitChildren(n,t)):e.addAndStepInto(mv(n.name,n.type,n.attributes))},priority:-100},$6=["listitem","quote","admonition"],E6={testNode:"paragraph",visitNode:function({mdastNode:n,lexicalParent:e,actions:t}){$6.includes(e.getType())?t.visitChildren(n,e):t.addAndStepInto(Re())}},A6={testNode:"root",visitNode({actions:n,mdastNode:e,lexicalParent:t}){n.visitChildren(e,t)}},M6={testNode:"text",visitNode({mdastNode:n,actions:e}){const t=He(n.value);t.setFormat(e.getParentFormatting());const r=e.getParentStyle();r!==""&&t.setStyle(r),e.addAndStepInto(t)}},L6=()=>C.createElement(I$,{externalHistoryState:nn(aA)}),Bn={eof:null,exclamationMark:33,dash:45,greaterThan:62},Hi={data:"data",lineEnding:"lineEnding",linePrefix:"linePrefix"};function I6(n){return{canContainEols:["comment"],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}const Ux=(n,e,t)=>{return r;function r(p){return n.enter("comment"),n.consume(p),i}function i(p){return p===Bn.exclamationMark?(n.consume(p),s):t(p)}function s(p){return p===Bn.dash?(n.consume(p),o):t(p)}function o(p){return p===Bn.dash?(n.consume(p),l):t(p)}function l(p){return p===Bn.greaterThan?t(p):he(p)?u(p):(n.enter(Hi.data),p===Bn.dash?(n.consume(p),a):c(p))}function a(p){return p===Bn.greaterThan?t(p):c(p)}function c(p){return p===Bn.eof?t(p):p===Bn.dash?(n.consume(p),f):he(p)?(n.exit(Hi.data),u(p)):(n.consume(p),c)}function u(p){return n.enter(Hi.lineEnding),n.consume(p),n.exit(Hi.lineEnding),Ie(n,h,Hi.linePrefix)}function h(p){return he(p)?u(p):(n.enter(Hi.data),c(p))}function f(p){return p===Bn.dash?(n.consume(p),d):c(p)}function d(p){return p===Bn.greaterThan?(n.exit(Hi.data),n.enter("commentEnd"),n.consume(p),n.exit("commentEnd"),n.exit("comment"),e(p)):p===Bn.dash?(n.consume(p),d):c(p)}},R6={flow:{60:{tokenize:Ux,concrete:!0}},text:{60:{tokenize:Ux}}},N6="_bold_1tncs_10",D6="_italic_1tncs_14",Z6="_underline_1tncs_18",B6="_strikethrough_1tncs_34",z6="_underlineStrikethrough_1tncs_38",V6="_subscript_1tncs_42",F6="_superscript_1tncs_47",X6="_code_1tncs_52",W6="_nestedListItem_1tncs_59",q6="_listitem_1tncs_69",j6="_listItemChecked_1tncs_73",Y6="_listItemUnchecked_1tncs_74",H6="_admonitionDanger_1tncs_151",U6="_admonitionInfo_1tncs_152",G6="_admonitionNote_1tncs_153",K6="_admonitionTip_1tncs_154",J6="_admonitionCaution_1tncs_155",vt={bold:N6,italic:D6,underline:Z6,strikethrough:B6,underlineStrikethrough:z6,subscript:V6,superscript:F6,code:X6,nestedListItem:W6,listitem:q6,listItemChecked:j6,listItemUnchecked:Y6,admonitionDanger:H6,admonitionInfo:U6,admonitionNote:G6,admonitionTip:K6,admonitionCaution:J6},CO={text:{bold:vt.bold,italic:vt.italic,underline:vt.underline,code:vt.code,strikethrough:vt.strikethrough,subscript:vt.subscript,superscript:vt.superscript,underlineStrikethrough:vt.underlineStrikethrough},list:{listitem:vt.listitem,listitemChecked:vt.listItemChecked,listitemUnchecked:vt.listItemUnchecked,nested:{listitem:vt.nestedListItem}},admonition:{danger:vt.admonitionDanger,info:vt.admonitionInfo,note:vt.admonitionNote,tip:vt.admonitionTip,caution:vt.admonitionCaution}},TO=ci(),zi=oe(null),st=oe(null),Yp=oe(""),Hp=oe(!0),yn=oe(!1,n=>{n.sub(n.pipe(yn,Je(zi)),([e,t])=>{t?.setEditable(!e)})}),Up=oe(""),Gx=oe(!1),ra=oe(!1),Ov=oe(0),ia=oe(null),Gp=bt(n=>{n.link(n.pipe(ia,Ea(e=>e!==null)),Gp)}),xv=bt(n=>{n.sub(n.pipe(xv,Je(st)),([e,t])=>{t?.dispatchCommand(Kr,e)})}),xo=oe(null,n=>{n.sub(n.pipe(xo,Je(st)),([e,t])=>{if(!e||!t)return;const r=e.anchor.getNode();let i=r.getKey()==="root"?r:Zi(r,l=>{const a=l.getParent();return a!==null&&et(a)});i===null&&(i=r.getTopLevelElementOrThrow());const s=i.getKey();if(t.getElementByKey(s)!==null){const l=of(i)?i.getTag():i.getType();n.pub(Zv,l)}})}),bv=oe(""),Lr=oe(""),Wu=oe(!1),uf=bt(n=>{n.link(Lr,uf),n.sub(bv,e=>{n.pubIn({[Wu]:!0,[Lr]:e})})}),Kp=bt(n=>{n.link(n.pipe(uf,Je(ng),Ea(([,e])=>!e),js(([e])=>e)),Kp)}),yv=oe([]),kv=oe([]),Sv=oe([]),wv=oe([]),vv=oe([]),Cv=oe([]),Jp=oe({}),eA=oe(!1),Tv=oe([]),tA=oe([]),hf=oe([]),Wa=oe(null),nA=oe(null),Vi=qt(kv),oi=qt(yv),eg=qt(Sv),tg=qt(wv),Fi=qt(vv),_v=qt(Cv),ng=oe(!1),_O=bt(n=>{n.sub(n.pipe(_O,Je(Lr,zi,ra),Ea(([e,t])=>e.trim()!==t.trim())),([e,,t,r])=>{n.pub(ng,!0),t?.update(()=>{Fe().clear(),PO(n,Fe(),e),r?t.focus():dt(null)},{onUpdate:()=>{n.pub(ng,!1)}})})}),Pv=bt(n=>{n.sub(n.pipe(Pv,Je(st,ra)),([e,t,r])=>{t?.update(()=>{const i=X();if(i!==null){const s={children:[],append(o){this.children.push(o)},getType(){return i.getNodes()[0].getType()}};PO(n,s,e),Do(s.children)}r?t.focus():dt(null)})})});function Qv(){return pw((n,[e,t])=>(n.forEach(r=>{if(!r)throw new Error("You have a subscription that does not return a teardown");r()}),t?e.map(r=>r(t)):[]),[])}const $v=oe([],n=>{n.pipe(n.combine($v,st),Qv())}),Ev=oe([],n=>{n.pipe(n.combine(Ev,zi),Qv())}),rA=oe(null),sa=bt(),rr=oe(n=>{throw new Error(`No icon component for ${n}`)});function qt(n,e){return bt((t,r)=>{t.changeWith(n,r,(i,s)=>{Array.isArray(s)||(s=[s]);let o=i;for(const l of s)i.includes(l)||(o=[...o,l]);return o}),e?.(t,r)})}function Av(n){const e=X();z(e)&&n.pubIn({[xo]:e,[Ov]:e.format})}const Mv=qt(Ev,(n,e)=>{n.pub(e,[t=>t.registerCommand(Bh,(r,i)=>(n.pubIn({[st]:i,[ra]:!0}),i._parentEditor===null&&i.getEditorState().read(()=>{n.pub(rA,{rootNode:Fe(),editorType:"lexical"})}),Av(n),!1),si),t=>t.registerUpdateListener(({dirtyElements:r,dirtyLeaves:i,editorState:s})=>{if(n.getValue(ia)!==null||r.size===0&&i.size===0)return;let l;s.read(()=>{Fe().getLastChild()instanceof Da&&t.update(()=>{Fe().append(Re())},{discrete:!0}),l=m8({root:Fe(),visitors:n.getValue(vv),jsxComponentDescriptors:n.getValue(Tv),toMarkdownExtensions:n.getValue(Cv),toMarkdownOptions:n.getValue(Jp),jsxIsAvailable:n.getValue(eA)})}),n.pub(Lr,l.trim()),n.pub(Wu,!1)}),t=>t.registerCommand(Lw,()=>(n.pub(ra,!0),!1),si)])}),oa=qt($v,(n,e)=>{n.pub(e,[t=>t.registerUpdateListener(({editorState:r})=>{r.read(()=>{Av(n)})}),t=>t.registerCommand(Iw,r=>{var i;const s=n.getValue(zi);return s&&!((i=s.getRootElement())!=null&&i.contains(r.relatedTarget))&&n.pubIn({[ra]:!1,[sa]:r}),!1},si)])});function PO(n,e,t){try{f6({root:e,visitors:n.getValue(yv),mdastExtensions:n.getValue(wv),markdown:t,syntaxExtensions:n.getValue(Sv),jsxComponentDescriptors:n.getValue(Tv),directiveDescriptors:n.getValue(tA),codeBlockEditorDescriptors:n.getValue(hf)}),n.pub(ia,null)}catch(r){if(r instanceof qp||r instanceof jp)n.pubIn({[Lr]:t,[ia]:{error:r.message,source:t}});else throw r}}const Lv=oe([]),Qs=qt(Lv),Iv=oe([]),iA=qt(Iv),Rv=oe([]),sA=qt(Rv),Nv=oe([]),oA=qt(Nv),lA=oe([]),Dv=qt(lA),aA=oe(v2()),Zv=oe("");bt();const qu=bt(n=>{n.sub(n.pipe(qu,Je(st)),([e,t])=>{t?.update(()=>{const r=X();z(r)&&(x$(r,e),setTimeout(()=>{t.focus()}))})})}),Bv=bt(n=>{n.sub(n.pipe(Bv,Je(st)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{const r=X();z(r)&&(t.update(()=>{const i=e();i.isInline()?(Do([i]),et(i.getParentOrThrow())&&xO(i,Re).selectEnd()):w2(i),setTimeout(()=>{"select"in i&&typeof i.select=="function"&&i.select()})}),setTimeout(()=>{t.dispatchCommand(TO,void 0)}))})},{defaultSelection:"rootEnd"})})}),Ei=oe("rich-text",n=>{function e(){return pw((t,r)=>({current:t.next,next:r}),{current:"rich-text",next:"rich-text"})}n.sub(n.pipe(Ei,e(),Je(bo)),([{current:t},r])=>{(t==="source"||t==="diff")&&n.pub(_O,r)}),n.sub(n.pipe(Ei,e(),Ea(t=>t.current==="rich-text"),Je(st)),([,t])=>{t?.dispatchCommand(TO,void 0)})}),bo=oe("",n=>{n.link(Lr,bo),n.link(bo,uf)}),QO=oe([]),Fo=qt(QO),zv=oe(()=>{throw new Error("No translation function provided")}),Kx=oe(CO),cA=Ln({init(n,e){const t=e?.initialMarkdown??"";n.register(Mv),n.register(oa),n.register(uf),n.pubIn({[bv]:e?.trim?t.trim():t,[rr]:e?.iconComponentFor,[oi]:[A6,E6,M6,w6,...P6],[Vi]:[Zo,Rr,Xa],[Fi]:[y6,b6,S6,x6,O6],[Qs]:L6,[Yp]:e?.contentEditableClassName,[Hp]:e?.spellCheck,[Jp]:e?.toMarkdownOptions,[Gx]:e?.autoFocus,[Up]:e?.placeholder,[yn]:e?.readOnly,[zv]:e?.translation,[tg]:s7(),[eg]:r7(),[_v]:[_7(),o7()],[Kx]:e?.lexicalTheme??CO}),n.singletonSub(Gp,e?.onError),n.singletonSub(Kp,r=>{e?.onChange(r,n.getValue(Wu))}),n.singletonSub(sa,e?.onBlur),e?.suppressHtmlProcessing||n.pubIn({[tg]:[T7(),I6()],[eg]:[G7(),K7(),R6],[oi]:Q6})},postInit(n,e){const t=XQ({editable:e?.readOnly!==!0,namespace:"MDXEditor",nodes:n.getValue(kv),onError:r=>{throw r},theme:n.getValue(Kx)});t.update(()=>{const r=e?.initialMarkdown.trim()??"";PO(n,Fe(),r);const i=e?.autoFocus;if(i){if(i===!0){setTimeout(()=>{t.focus(Ys,{defaultSelection:"rootStart"})});return}setTimeout(()=>{t.focus(Ys,{defaultSelection:i.defaultSelection??"rootStart"})})}}),n.pub(zi,t),n.pub(st,t)},update(n,e){n.pubIn({[Yp]:e?.contentEditableClassName,[Hp]:e?.spellCheck,[Jp]:e?.toMarkdownOptions,[Gx]:e?.autoFocus,[Up]:e?.placeholder,[yn]:e?.readOnly}),n.singletonSub(Kp,t=>{e?.onChange(t,n.getValue(Wu))}),n.singletonSub(sa,e?.onBlur),n.singletonSub(Gp,e?.onError)}});function kn(){return nn(zv)}function uA(){return Fe().getTextContent()}function hA(n,e=!0){if(n)return!1;let t=uA();return e&&(t=t.trim()),t===""}function fA(n){if(!hA(n,!1))return!1;const e=Fe().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(Qe(i))return!1;if(I(i)){if(!tO(i)||i.__indent!==0)return!1;const s=i.getChildren(),o=s.length;for(let l=0;l<o;l++){const a=s[r];if(!q(a))return!1}}}return!0}function Vv(n){return()=>fA(n)}const Fv=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?R.useLayoutEffect:R.useEffect;function dA({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:s,ariaExpanded:o,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:h,ariaRequired:f,autoCapitalize:d,className:p,id:g,role:m="textbox",spellCheck:O=!0,style:b,tabIndex:x,"data-testid":y,...w},k){const[S,v]=R.useState(n.isEditable()),T=R.useCallback((M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?n.setRootElement(M):n.setRootElement(null)}),[n]),A=R.useMemo((()=>(function(...M){return L=>{M.forEach((E=>{typeof E=="function"?E(L):E!=null&&(E.current=L)}))}})(k,T)),[T,k]);return Fv((()=>(v(n.isEditable()),n.registerEditableListener((M=>{v(M)})))),[n]),G.jsx("div",{"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":i,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":S&&m==="combobox"?!!o:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":c,"aria-multiline":u,"aria-owns":S?h:void 0,"aria-readonly":!S||void 0,"aria-required":f,autoCapitalize:d,className:p,contentEditable:S,"data-testid":y,id:g,ref:A,role:S?m:void 0,spellCheck:O,style:b,tabIndex:x,...w})}const pA=R.forwardRef(dA);function Jx(n){return n.getEditorState().read(Vv(n.isComposing()))}const gA=R.forwardRef(mA);function mA(n,e){const{placeholder:t,...r}=n,[i]=Nt();return G.jsxs(G.Fragment,{children:[G.jsx(pA,{editor:i,...r,ref:e}),t!=null&&G.jsx(OA,{editor:i,content:t})]})}function OA({content:n,editor:e}){const t=(function(o){const[l,a]=R.useState((()=>Jx(o)));return Fv((()=>{function c(){const u=Jx(o);a(u)}return c(),ln(o.registerUpdateListener((()=>{c()})),o.registerEditableListener((()=>{c()})))}),[o]),l})(e),[r,i]=R.useState(e.isEditable());if(R.useLayoutEffect((()=>(i(e.isEditable()),e.registerEditableListener((o=>{i(o)})))),[e]),!t)return null;let s=null;return typeof n=="function"?s=n(r):n!==null&&(s=n),s===null?null:G.jsx("div",{"aria-hidden":!0,children:s})}const xA=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?R.useLayoutEffect:R.useEffect;function bA(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function yA(){return(function(n){const[e]=Nt(),t=R.useMemo((()=>n(e)),[e,n]),[r,i]=R.useState((()=>t.initialValueFn())),s=R.useRef(r);return xA((()=>{const{initialValueFn:o,subscribe:l}=t,a=o();return s.current!==a&&(s.current=a,i(a)),l((c=>{s.current=c,i(c)}))}),[t,n]),r})(bA)}function kA(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const s=r.data;if(typeof s=="string"){let o;try{o=JSON.parse(s)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const l=o.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,h,f,d,p]=a;n.update((()=>{const g=X();if(z(g)){const m=g.anchor;let O=m.getNode(),b=0,x=0;if(q(O)&&c>=0&&u>=0&&(b=c,x=c+u,g.setTextNodeRange(O,b,O,x)),b===x&&h===""||(g.insertRawText(h),O=m.getNode()),q(O)){b=f,x=f+d;const y=O.getTextContentSize();b=b>y?y:b,x=x>y?y:x,g.setTextNodeRange(O,b,O,x)}r.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}const rg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?R.useLayoutEffect:R.useEffect;function eb(n){return n.getEditorState().read(Vv(n.isComposing()))}function SA({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Nt(),i=(function(s,o){const[l,a]=R.useState((()=>s.getDecorators()));return rg((()=>s.registerDecoratorListener((c=>{fp.flushSync((()=>{a(c)}))}))),[s]),R.useEffect((()=>{a(s.getDecorators())}),[s]),R.useMemo((()=>{const c=[],u=Object.keys(l);for(let h=0;h<u.length;h++){const f=u[h],d=G.jsx(o,{onError:g=>s._onError(g),children:G.jsx(R.Suspense,{fallback:null,children:l[f]})}),p=s.getElementByKey(f);p!==null&&c.push(fp.createPortal(d,p,f))}return c}),[o,l,s])})(r,t);return(function(s){rg((()=>ln(K$(s),kA(s))),[s])})(r),G.jsxs(G.Fragment,{children:[n,G.jsx(wA,{content:e}),i]})}function wA({content:n}){const[e]=Nt(),t=(function(i){const[s,o]=R.useState((()=>eb(i)));return rg((()=>{function l(){const a=eb(i);o(a)}return l(),ln(i.registerUpdateListener((()=>{l()})),i.registerEditableListener((()=>{l()})))}),[i]),s})(e),r=yA();return t?typeof n=="function"?n(r):n:null}var ed={exports:{}};var tb;function vA(){return tb||(tb=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o<arguments.length;o++){var l=arguments[o];l&&(s=i(s,r(l)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var l in s)e.call(s,l)&&s[l]&&(o=i(o,l));return o}function i(s,o){return o?s?s+" "+o:s+o:s}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(ed)),ed.exports}var CA=vA();const Me=nw(CA),TA="_editorRoot_sects_53",_A="_editorWrapper_sects_155",PA="_toolbarRoot_sects_162",QA="_readOnlyToolbarRoot_sects_189",$A="_toolbarToggleItem_sects_208",EA="_toolbarGroupOfGroups_sects_219",AA="_toolbarToggleSingleGroup_sects_224",MA="_toolbarButton_sects_239",LA="_selectContainer_sects_288",IA="_selectItem_sects_301",RA="_selectTrigger_sects_308",NA="_selectDropdownArrow_sects_374",DA="_contentEditable_sects_380",ZA="_iconButton_sects_457",BA="_primaryButton_sects_507",zA="_secondaryButton_sects_508",VA="_linkDialogEditForm_sects_541",FA="_linkDialogAnchor_sects_587",XA="_linkDialogPopoverContent_sects_601",WA="_dialogContent_sects_603",qA="_popoverArrow_sects_650",jA="_linkDialogPreviewAnchor_sects_654",YA="_tooltipTrigger_sects_677",HA="_tooltipContent_sects_681",UA="_actionButton_sects_695",GA="_dialogOverlay_sects_870",KA="_focusedImage_sects_916",JA="_imageWrapper_sects_920",eM="_editImageToolbar_sects_933",tM="_editImageButton_sects_937",nM="_diffSourceToggleWrapper_sects_986",rM="_ggDiffSourceToggle_sects_994",iM="_diffSourceToggle_sects_986",sM="_toolbarTitleMode_sects_1027",oM="_imageControlWrapperResizing_sects_1032",lM="_imageResizer_sects_1036",aM="_imageResizerN_sects_1045",cM="_imageResizerNe_sects_1051",uM="_imageResizerE_sects_1057",hM="_imageResizerSe_sects_1063",fM="_imageResizerS_sects_1063",dM="_imageResizerSw_sects_1075",pM="_imageResizerW_sects_1081",gM="_imageResizerNw_sects_1087",mM="_imagePlaceholder_sects_1093",OM="_placeholder_sects_1101",xM="_rootContentEditableWrapper_sects_1114",bM="_downshiftInputWrapper_sects_1124",yM="_downshiftInput_sects_1124",kM="_downshiftAutocompleteContainer_sects_1155",SM="_textInput_sects_1201",wM="_multiFieldForm_sects_1209",vM="_formField_sects_1215",CM="_markdownParseError_sects_1226",TM="_popupContainer_sects_1235",H={editorRoot:TA,editorWrapper:_A,toolbarRoot:PA,readOnlyToolbarRoot:QA,toolbarToggleItem:$A,toolbarGroupOfGroups:EA,toolbarToggleSingleGroup:AA,toolbarButton:MA,selectContainer:LA,selectItem:IA,selectTrigger:RA,selectDropdownArrow:NA,contentEditable:DA,iconButton:ZA,primaryButton:BA,secondaryButton:zA,linkDialogEditForm:VA,linkDialogAnchor:FA,linkDialogPopoverContent:XA,dialogContent:WA,popoverArrow:qA,linkDialogPreviewAnchor:jA,tooltipTrigger:YA,tooltipContent:HA,actionButton:UA,dialogOverlay:GA,focusedImage:KA,imageWrapper:JA,editImageToolbar:eM,editImageButton:tM,diffSourceToggleWrapper:nM,ggDiffSourceToggle:rM,diffSourceToggle:iM,toolbarTitleMode:sM,imageControlWrapperResizing:oM,imageResizer:lM,imageResizerN:aM,imageResizerNe:cM,imageResizerE:uM,imageResizerSe:hM,imageResizerS:fM,imageResizerSw:dM,imageResizerW:pM,imageResizerNw:gM,imagePlaceholder:mM,placeholder:OM,rootContentEditableWrapper:xM,downshiftInputWrapper:bM,downshiftInput:yM,downshiftAutocompleteContainer:kM,textInput:SM,multiFieldForm:wM,formField:vM,markdownParseError:CM,popupContainer:TM},_M={undo:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z",fill:"currentColor"})),redo:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z",fill:"currentColor"})),format_bold:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z",fill:"currentColor"})),format_italic:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z",fill:"currentColor"})),format_underlined:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z",fill:"currentColor"})),code:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z",fill:"currentColor"})),strikeThrough:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z",fill:"currentColor"})),superscript:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z",fill:"currentColor"})),subscript:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z",fill:"currentColor"})),format_list_bulleted:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z",fill:"currentColor"})),format_list_numbered:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z",fill:"currentColor"})),format_list_checked:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z",fill:"currentColor"})),link:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z",fill:"currentColor"})),add_photo:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z",fill:"currentColor"})),table:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z",fill:"currentColor"})),horizontal_rule:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M4.5 12.75V11.25H19.5V12.75H4.5Z",fill:"currentColor"})),frontmatter:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M4.5 8.75V7.25H8.5V8.75H4.5Z",fill:"currentColor"}),C.createElement("path",{d:"M4.5 14.75V13.25H8.5V14.75H4.5Z",fill:"currentColor"}),C.createElement("path",{d:"M9.5 8.75V7.25H13.5V8.75H9.5Z",fill:"currentColor"}),C.createElement("path",{d:"M9.5 14.75V13.25H13.5V14.75H9.5Z",fill:"currentColor"}),C.createElement("path",{d:"M14.5 8.75V7.25H18.5V8.75H14.5Z",fill:"currentColor"}),C.createElement("path",{d:"M14.5 14.75V13.25H18.5V14.75H14.5Z",fill:"currentColor"})),frame_source:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z",fill:"currentColor"})),arrow_drop_down:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:"currentColor"})),admonition:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z",fill:"currentColor"})),sandpack:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M12.9999 22.5C12.4947 22.5 12.0671 22.325 11.7171 21.975C11.3671 21.625 11.1921 21.1974 11.1921 20.6922V7.30775C11.1921 6.80258 11.3671 6.375 11.7171 6.025C12.0671 5.675 12.4947 5.5 12.9999 5.5H16.3844C16.8895 5.5 17.3171 5.675 17.6671 6.025C18.0171 6.375 18.1921 6.80258 18.1921 7.30775V20.6922C18.1921 21.1974 18.0171 21.625 17.6671 21.975C17.3171 22.325 16.8895 22.5 16.3844 22.5H12.9999ZM12.6921 7.30775V20.6922C12.6921 20.7692 12.7242 20.8398 12.7884 20.9038C12.8524 20.9679 12.9229 21 12.9999 21H16.3844C16.4614 21 16.5319 20.9679 16.5959 20.9038C16.66 20.8398 16.6921 20.7692 16.6921 20.6922V7.30775C16.6921 7.23075 16.66 7.16025 16.5959 7.09625C16.5319 7.03208 16.4614 7 16.3844 7H12.9999C12.9229 7 12.8524 7.03208 12.7884 7.09625C12.7242 7.16025 12.6921 7.23075 12.6921 7.30775ZM6.61537 18.5C6.1102 18.5 5.68262 18.325 5.33262 17.975C4.98262 17.625 4.80762 17.1974 4.80762 16.6923V3.30775C4.80762 2.80258 4.98262 2.375 5.33262 2.025C5.68262 1.675 6.1102 1.5 6.61537 1.5H9.99987C10.505 1.5 10.9326 1.675 11.2826 2.025C11.6326 2.375 11.8076 2.80258 11.8076 3.30775V16.6923C11.8076 17.1974 11.6326 17.625 11.2826 17.975C10.9326 18.325 10.505 18.5 9.99987 18.5H6.61537ZM6.30762 3.30775V16.6923C6.30762 16.7692 6.3397 16.8398 6.40387 16.9038C6.46787 16.9679 6.53837 17 6.61537 17H9.99987C10.0769 17 10.1474 16.9679 10.2114 16.9038C10.2755 16.8398 10.3076 16.7692 10.3076 16.6923V3.30775C10.3076 3.23075 10.2755 3.16025 10.2114 3.09625C10.1474 3.03208 10.0769 3 9.99987 3H6.61537C6.53837 3 6.46787 3.03208 6.40387 3.09625C6.3397 3.16025 6.30762 3.23075 6.30762 3.30775Z",fill:"currentColor"})),rich_text:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z",fill:"currentColor"}),C.createElement("path",{d:"M12.5 7H17.5V8.25H12.5V7Z",fill:"currentColor"}),C.createElement("path",{d:"M12.5 9.25H17.5V10.5H12.5V9.25Z",fill:"currentColor"})),difference:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),C.createElement("rect",{x:"9",y:"10",width:"5.5",height:"1.5",fill:"currentColor"}),C.createElement("rect",{x:"9",y:"15",width:"5.5",height:"1.5",fill:"currentColor"}),C.createElement("rect",{x:"11",y:"8",width:"1.5",height:"5.5",fill:"currentColor"})),markdown:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),C.createElement("path",{d:"M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z",fill:"currentColor"}),C.createElement("path",{d:"M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z",fill:"currentColor"})),open_in_new:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z",fill:"currentColor"})),link_off:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z",fill:"currentColor"})),edit:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z",fill:"currentColor"})),content_copy:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z",fill:"currentColor"})),more_horiz:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z",fill:"currentColor"})),more_vert:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z",fill:"currentColor"})),close:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z",fill:"currentColor"})),settings:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})),delete_big:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),delete_small:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),format_align_center:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_left:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_right:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z",fill:"currentColor"})),add_row:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z",fill:"currentColor"}),C.createElement("path",{d:"M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z",fill:"currentColor"})),add_column:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z",fill:"currentColor"}),C.createElement("path",{d:"M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z",fill:"currentColor"})),insert_col_left:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z",fill:"currentColor"})),insert_row_above:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z",fill:"currentColor"})),insert_row_below:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z",fill:"currentColor"})),insert_col_right:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z",fill:"currentColor"})),check:C.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z",fill:"currentColor"}))};function ig(n,e){return ig=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ig(n,e)}var nb={error:null},PM=(function(n){var e,t;function r(){for(var s,o=arguments.length,l=new Array(o),a=0;a<o;a++)l[a]=arguments[a];return(s=n.call.apply(n,[this].concat(l))||this).state=nb,s.resetErrorBoundary=function(){for(var c,u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];s.props.onReset==null||(c=s.props).onReset.apply(c,h),s.reset()},s}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ig(e,t),r.getDerivedStateFromError=function(s){return{error:s}};var i=r.prototype;return i.reset=function(){this.setState(nb)},i.componentDidCatch=function(s,o){var l,a;(l=(a=this.props).onError)==null||l.call(a,s,o)},i.componentDidUpdate=function(s,o){var l,a,c,u,h=this.state.error,f=this.props.resetKeys;h!==null&&o.error!==null&&((c=s.resetKeys)===void 0&&(c=[]),(u=f)===void 0&&(u=[]),c.length!==u.length||c.some((function(d,p){return!Object.is(d,u[p])})))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,s.resetKeys,f),this.reset())},i.render=function(){var s=this.state.error,o=this.props,l=o.fallbackRender,a=o.FallbackComponent,c=o.fallback;if(s!==null){var u={error:s,resetErrorBoundary:this.resetErrorBoundary};if(R.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return R.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r})(R.Component);function QM({children:n,onError:e}){return G.jsx(PM,{fallback:G.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const $M=({children:n})=>{const e=nn(zi),t=C.useMemo(()=>[e,Y9(null,CO)],[e]);return C.createElement(gw.Provider,{value:t},n)},EM=()=>{const n=kn(),e=ut(nA),t=u=>{e({current:u})},[r,i,s,o,l,a,c]=Wt(Yp,Hp,Lv,Iv,Nv,Up,Rv);return C.createElement(C.Fragment,null,o.map((u,h)=>C.createElement(u,{key:h})),C.createElement(Xv,{wrappers:l},C.createElement("div",{className:Me(H.rootContentEditableWrapper,"mdxeditor-root-contenteditable")},C.createElement(SA,{contentEditable:C.createElement("div",{ref:t},C.createElement(gA,{className:Me(H.contentEditable,r),ariaLabel:n("contentArea.editableMarkdown","editable markdown"),spellCheck:i})),placeholder:C.createElement("div",{className:Me(H.contentEditable,H.placeholder,r)},C.createElement("p",null,a)),ErrorBoundary:QM}))),s.map((u,h)=>C.createElement(u,{key:h})),c.map((u,h)=>C.createElement(u,{key:h})))},AM={listItemIndent:"one"},MM=n=>_M[n];function LM(n,e,t={}){let r=e;for(const[i,s]of Object.entries(t))r=r.replaceAll(`{{${i}}}`,String(s));return r}const Xv=({wrappers:n,children:e})=>{if(n.length===0)return C.createElement(C.Fragment,null,e);const t=n[0];return C.createElement(t,null,C.createElement(Xv,{wrappers:n.slice(1)},e))},IM=({children:n,className:e,overlayContainer:t})=>{const r=C.useRef(null),i=ut(Wa);return C.useEffect(()=>{const s=document.createElement("div");return s.classList.add("mdxeditor-popup-container",H.editorRoot,H.popupContainer,...(e??"").trim().split(" ").filter(Boolean)),(t??document.body).appendChild(s),r.current=s,i(r),()=>{s.remove()}},[e,r,t,i]),C.createElement("div",{className:Me("mdxeditor",H.editorRoot,H.editorWrapper,e)},n)},RM=({mdxRef:n})=>{const e=$a();return C.useImperativeHandle(n,()=>({getMarkdown:()=>{const t=e.getValue(Ei);return t==="source"||t==="diff"?e.getValue(bo):e.getValue(Lr)},setMarkdown:t=>{e.pub(_O,t)},insertMarkdown:t=>{e.pub(Pv,t)},focus:(t,r)=>{var i;(i=e.getValue(zi))==null||i.focus(t,r)}}),[e]),null},NM=C.forwardRef((n,e)=>C.createElement(j9,{plugins:[cA({contentEditableClassName:n.contentEditableClassName??"",spellCheck:n.spellCheck??!0,initialMarkdown:n.markdown,onChange:n.onChange??Ys,onBlur:n.onBlur??Ys,toMarkdownOptions:n.toMarkdownOptions??AM,autoFocus:n.autoFocus??!1,placeholder:n.placeholder??"",readOnly:!!n.readOnly,iconComponentFor:n.iconComponentFor??MM,suppressHtmlProcessing:n.suppressHtmlProcessing??!1,onError:n.onError??Ys,translation:n.translation??LM,trim:n.trim??!0,lexicalTheme:n.lexicalTheme}),...n.plugins??[]]},C.createElement(IM,{className:n.className,overlayContainer:n.overlayContainer},C.createElement($M,null,C.createElement(EM,null))),C.createElement(RM,{mdxRef:e}))),Wv=typeof window<"u"&&typeof window.document.createElement<"u",ju=Wv&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function DM(n,e){return ju?n:e}const ZM={testLexicalNode:of,visitLexicalNode:({lexicalNode:n,actions:e})=>{const t=parseInt(n.getTag()[1],10);e.addAndStepInto("heading",{depth:t})}},BM={testNode:"heading",visitNode:function({mdastNode:n,actions:e}){e.addAndStepInto(wr(`h${n.depth}`))}},zM=[48,49,50,51,52,53,54],qv=[1,2,3,4,5,6],VM={49:1,50:2,51:3,52:4,53:5,54:6},ff=oe(qv,n=>{n.pub(Mv,e=>e.registerCommand(Ew,t=>{const{keyCode:r,ctrlKey:i,metaKey:s,altKey:o}=t;return zM.includes(r)&&DM(s,i)&&o?(t.preventDefault(),e.update(()=>{if(r===48)n.pub(qu,()=>Re());else{const l=n.getValue(ff),a=VM[r];l.includes(a)||n.pub(qu,()=>wr(`h${a}`))}}),!0):!1},Ye))}),FM=Ln({init(n){n.pubIn({[Fo]:"headings",[oi]:BM,[Vi]:Fa,[Fi]:ZM})},update(n,e){n.pub(ff,e?.allowedHeadingLevels??qv)}});function rb(n,e){return n.getEditorState().read((()=>{const t=Ke(e);return t!==null&&t.isSelected()}))}function jv(n){const[e]=Nt(),[t,r]=R.useState((()=>rb(e,n)));return R.useEffect((()=>{let i=!0;const s=e.registerUpdateListener((()=>{i&&r(rb(e,n))}));return()=>{i=!1,s()}}),[e,n]),[t,R.useCallback((i=>{e.update((()=>{let s=X();pt(s)||(s=Hm(),dt(s)),pt(s)&&(i?s.add(n):s.delete(n))}))}),[e,n]),R.useCallback((()=>{e.update((()=>{const i=X();pt(i)&&i.clear()}))}),[e])]}const Yv=ci();function XM({nodeKey:n}){const[e]=Nt(),[t,r,i]=jv(n),s=R.useCallback((o=>{const l=X();return t&&pt(l)&&(o.preventDefault(),l.getNodes().forEach((a=>{df(a)&&a.remove()}))),!1}),[t]);return R.useEffect((()=>ln(e.registerCommand(zh,(o=>{const l=e.getElementByKey(n);return o.target===l&&(o.shiftKey||i(),r(!t),!0)}),Ye),e.registerCommand(Wh,s,Ye),e.registerCommand(Xh,s,Ye))),[i,e,t,n,s,r]),R.useEffect((()=>{const o=e.getElementByKey(n),l=e._config.theme.hrSelected??"selected";o!==null&&(t?Kn(o,l):rf(o,l))}),[e,t,n]),null}let qa=class Hv extends Da{static getType(){return"horizontalrule"}static clone(e){return new Hv(e.__key)}static importJSON(e){return Xo().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:WM,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return Kn(t,e.theme.hr),t}getTextContent(){return`
|
|
59
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return G.jsx(XM,{nodeKey:this.__key})}};function WM(){return{node:Xo()}}function Xo(){return on(new qa)}function df(n){return n instanceof qa}function qM(){const[n]=Nt();return R.useEffect((()=>n.registerCommand(Yv,(e=>{const t=X();if(!z(t))return!1;if(t.focus.getNode()!==null){const r=Xo();w2(r)}return!0}),Ce)),[n]),null}const jM={testLexicalNode:df,visitLexicalNode({actions:n}){n.addAndStepInto("thematicBreak")}},YM={testNode:"thematicBreak",visitNode({actions:n}){n.addAndStepInto(Xo())}},HM=Ni(n=>{n.sub(n.pipe(HM,Je(st)),([,e])=>{e?.dispatchCommand(Yv,void 0)})}),UM=Ln({init(n){n.pubIn({[Fo]:"thematicBreak",[oi]:YM,[Vi]:qa,[Fi]:jM,[Qs]:qM})}});function mr(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sg(n){let e=1,t=n.getParent();for(;t!=null;){if(_e(t)){const r=t.getParent();if(xe(r)){e++,t=r.getParent();continue}mr(40)}return e}return e}function og(n){let e=n.getParent();xe(e)||mr(40);let t=e;for(;t!==null;)t=t.getParent(),xe(t)&&(e=t);return e}function Uv(n){let e=[];const t=n.getChildren().filter(_e);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();xe(s)?e=e.concat(Uv(s)):e.push(i)}return e}function Or(n){return _e(n)&&xe(n.getFirstChild())}function ib(n){return Rt().append(n)}function Gv(n,e){return _e(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function lg(n){const e=X();if(e!==null){let t=e.getNodes();if(z(e)){const i=e.getStartEndPoints();i===null&&mr(143);const[s]=i,o=s.getNode(),l=o.getParent();if(et(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const c=Re();o.append(c),t=c.select().getNodes()}}else if(Gv(o,t)){const a=Lt(n);if(et(l)){o.replace(a);const c=Rt();I(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(_e(o)){const c=o.getParentOrThrow();ks(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(!I(s)||!s.isEmpty()||_e(s)||r.has(s.getKey())){if(r2(s)){let o=s.getParent();for(;o!=null;){const l=o.getKey();if(xe(o)){if(!r.has(l)){const a=Lt(n);ks(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(et(a)&&!r.has(l)){r.add(l),sb(o,n);break}o=a}}}}else sb(s,n)}}}function ks(n,e){n.splice(n.getChildrenSize(),0,e)}function sb(n,e){if(xe(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=Rt();let s;if(ks(i,n.getChildren()),xe(t)&&e===t.getListType())t.append(i),xe(r)&&e===r.getListType()&&(ks(t,r.getChildren()),r.remove()),s=t;else if(xe(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const o=Lt(e);o.append(i),n.replace(o),s=o}return i.setFormat(n.getFormatType()),i.setIndent(n.getIndent()),n.remove(),s}function $O(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&Or(t)&&Or(r)&&($O(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function GM(){const n=X();if(z(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Gv(r,t))e.add(og(r));else for(let i=0;i<t.length;i++){const s=t[i];if(r2(s)){const o=S2(s,ir);o!=null&&e.add(og(o))}}for(const i of e){let s=i;const o=Uv(i);for(const l of o){const a=Re().setTextStyle(n.style).setTextFormat(n.format);ks(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&ys(n.anchor,Tn(Mr(a,"next"))),l.__key===n.focus.key&&ys(n.focus,Tn(Mr(a,"next"))),l.remove()}i.remove()}}}function KM(n){const e=new Set;if(Or(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(Or(r)&&Or(i)){const s=i.getFirstChild();if(xe(s)){s.append(n);const o=r.getFirstChild();xe(o)&&(ks(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Or(r)){const s=r.getFirstChild();if(xe(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(Or(i)){const s=i.getFirstChild();xe(s)&&s.append(n)}else if(xe(t)){const s=Rt().setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle()),o=Lt(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function JM(n){if(Or(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(xe(t?t.getParent():void 0)&&_e(t)&&xe(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=Rt(),l=Lt(s);o.append(l),n.getPreviousSiblings().forEach((u=>l.append(u)));const a=Rt(),c=Lt(s);a.append(c),ks(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function eL(){const n=X();if(!z(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!_e(e)||e.getChildrenSize()!==0)return!1;const t=og(e),r=e.getParent();xe(r)||mr(40);const i=r.getParent();let s;if(et(i))s=Re(),t.insertAfter(s);else{if(!_e(i))return!1;s=Rt(),i.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const o=e.getNextSiblings();if(o.length>0){const l=Lt(r.getListType());if(_e(s)){const a=Rt();a.append(l),s.insertAfter(a)}else s.insertAfter(l);l.append(...o)}return(function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const c=a.getParent();if(c==null||!_e(c)&&!xe(c))break;a=c}a.remove()})(e),!0}function Yu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}class ir extends nr{static getType(){return"listitem"}static clone(e){return new ir(e.__value,e.__checked,e.__key)}constructor(e,t,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),r=this.getParent();xe(r)&&r.getListType()==="check"&&lb(t,this,null),t.value=this.__value,ob(t,e.theme,this);const i=this.__style||this.__textStyle;return i&&(t.style.cssText=i),t}updateDOM(e,t,r){const i=this.getParent();xe(i)&&i.getListType()==="check"&&lb(t,this,e),t.value=this.__value,ob(t,r.theme,this);const s=e.__style||e.__textStyle,o=this.__style||this.__textStyle;return s!==o&&(t.style.cssText=o,o===""&&t.removeAttribute("style")),!1}static transform(){return e=>{if(_e(e)||mr(144),e.__checked==null)return;const t=e.getParent();xe(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:tL,priority:0})}}static importJSON(e){return Rt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config);t.style.textAlign=this.getFormatType();const r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(I(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(_e(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!xe(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=Lt(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(I(e)||mr(139),this.getChildren().forEach((i=>{e.append(i)}))),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(xe(r)||mr(39),_e(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=Lt(r.getListType());i.forEach((o=>s.append(o))),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&Or(t)&&Or(r)&&($O(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=Rt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Re();this.getChildren().forEach((o=>t.append(o)));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=_e(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return xe(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;_e(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&mr(117),(e=Math.floor(e))>=0||mr(199);let t=this.getIndent();for(;t!==e;)t<e?(KM(this),t++):(JM(this),t--);return this}canInsertAfter(e){return _e(e)}canReplaceWith(e){return _e(e)}canMergeWith(e){return _e(e)||tO(e)}extractWithChild(e,t){if(!z(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Lt("bullet")}canMergeWhenEmpty(){return!0}}function ob(n,e,t){const r=[],i=[],s=e.list,o=s?s.listitem:void 0;let l;if(s&&s.nested&&(l=s.nested.listitem),o!==void 0&&r.push(...Yu(o)),s){const a=t.getParent(),c=xe(a)&&a.getListType()==="check",u=t.getChecked();c&&!u||i.push(s.listitemUnchecked),c&&u||i.push(s.listitemChecked),c&&r.push(u?s.listitemChecked:s.listitemUnchecked)}if(l!==void 0){const a=Yu(l);t.getChildren().some((c=>xe(c)))?r.push(...a):i.push(...a)}i.length>0&&rf(n,...i),r.length>0&&Kn(n,...r)}function lb(n,e,t,r){xe(e.getFirstChild())?(n.removeAttribute("role"),n.removeAttribute("tabIndex"),n.removeAttribute("aria-checked")):(n.setAttribute("role","checkbox"),n.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||n.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function tL(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return nL(t)}const e=n.getAttribute("aria-checked");return{node:Rt(e==="true"||e!=="false"&&void 0)}}function nL(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Rt(n.hasAttribute("checked"))}}function Rt(n){return on(new ir(void 0,n))}function _e(n){return n instanceof ir}class Nr extends nr{static getType(){return"list"}static clone(e){const t=e.__listType||ub[e.__tag];return new Nr(t,e.__start,e.__key)}constructor(e="number",t=1,r){super(r);const i=ub[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,ab(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||(ab(t,r.theme,this),!1)}static transform(){return e=>{xe(e)||mr(163),(function(t){const r=t.getNextSibling();xe(r)&&t.getListType()===r.getListType()&&$O(t,r)})(e),(function(t){const r=t.getListType()!=="check";let i=t.getStart();for(const s of t.getChildren())_e(s)&&(s.getValue()!==i&&s.setValue(i),r&&s.getLatest().__checked!=null&&s.setChecked(void 0),xe(s.getFirstChild())||i++)})(e)}}static importDOM(){return{ol:()=>({conversion:cb,priority:0}),ul:()=>({conversion:cb,priority:0})}}static importJSON(e){return Lt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return nt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(_e(r))super.append(r);else{const i=Rt();if(xe(r))i.append(r);else if(I(r))if(r.isInline())i.append(r);else{const s=He(r.getTextContent());i.append(s)}else i.append(r);super.append(i)}}return this}extractWithChild(e){return _e(e)}}function ab(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=sg(t)-1,a=l%o.length,c=o[a],u=s[t.__tag];let h;const f=s.nested,d=s.checklist;if(f!==void 0&&f.list&&(h=f.list),u!==void 0&&r.push(u),d!==void 0&&t.__listType==="check"&&r.push(d),c!==void 0){r.push(...Yu(c));for(let p=0;p<o.length;p++)p!==a&&i.push(t.__tag+p)}if(h!==void 0){const p=Yu(h);l>1?r.push(...p):i.push(...p)}}i.length>0&&rf(n,...i),r.length>0&&Kn(n,...r)}function rL(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(_e(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach((s=>{xe(s)&&e.push(ib(s))}))}else e.push(ib(r))}return e}function cb(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=Lt("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list"))return!0;for(const i of r.childNodes)if(nt(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?Lt("check"):Lt("bullet")),{after:rL,node:t}}const ub={ol:"number",ul:"bullet"};function Lt(n="number",e=1){return on(new Nr(n,e))}function xe(n){return n instanceof Nr}const Kv=ci(),Jv=ci(),e5=ci(),t5=ci();function iL(n){return ln(n.registerCommand(Jv,(()=>(lg("number"),!0)),Ye),n.registerCommand(Kv,(()=>(lg("bullet"),!0)),Ye),n.registerCommand(t5,(()=>(GM(),!0)),Ye),n.registerCommand(Gl,(()=>eL()),Ye),n.registerNodeTransform(ir,(e=>{const t=e.getFirstChild();if(t){if(q(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=X();z(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}})),n.registerNodeTransform(Rr,(e=>{const t=e.getParent();if(_e(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}})))}function sL(n,e){n.update((()=>lg(e)))}const oL={testNode:"list",visitNode:function({mdastNode:n,lexicalParent:e,actions:t}){const r=n.children.some(s=>typeof s.checked=="boolean")?"check":n.ordered?"number":"bullet",i=Lt(r);if(_e(e)){const s=Rt();s.append(i),e.insertAfter(s)}else e.append(i);t.visitChildren(n,i)}},lL={testNode:"listItem",visitNode({mdastNode:n,actions:e,lexicalParent:t}){const r=t.getListType()==="check"?n.checked??!1:void 0;e.addAndStepInto(Rt(r))}},aL={testLexicalNode:xe,visitLexicalNode:({lexicalNode:n,actions:e})=>{e.addAndStepInto("list",{ordered:n.getListType()==="number",spread:!1})}},cL={testLexicalNode:_e,visitLexicalNode:({lexicalNode:n,mdastParent:e,actions:t})=>{const r=n.getChildren(),i=r[0];if(r.length===1&&xe(i)){const s=e.children.at(-1);s?t.visitChildren(n,s):t.visitChildren(i,e)}else{const s=n.getParent(),o=t.appendToParent(e,{type:"listItem",checked:s.getListType()==="check"?!!n.getChecked():void 0,spread:!1,children:[]});let l=null;for(const a of n.getChildren())q(a)||Hn(a)||a.isInline()&&(I(a)||Qe(a))?(l||(l=t.appendToParent(o,{type:"paragraph",children:[]})),t.visit(a,l)):(l=null,t.visit(a,o))}}};function uL(n,e){return ln(n.registerCommand(Fm,(t=>{const r=X();if(!z(r))return!1;t.preventDefault();const i=(function(s){const o=s.getNodes();if(_$(o,(f=>Nu(f)&&f.canIndent()?f:null)).length>0)return!0;const l=s.anchor,a=s.focus,c=a.isBefore(l)?a:l,u=c.getNode(),h=Rp(u);if(h.canIndent()){const f=h.getKey();let d=Ra();if(d.anchor.set(f,0,"element"),d.focus.set(f,0,"element"),d=gs(d),d.anchor.is(c))return!0}return!1})(r)?t.shiftKey?kp:Iu:Mw;return n.dispatchCommand(i,void 0)}),Ce),n.registerCommand(Iu,(()=>{if(e==null)return!1;const t=X();if(!z(t))return!1;const r=t.getNodes().map((i=>Rp(i).getIndent()));return Math.max(...r)+1>=e}),si))}function hb({maxIndent:n}){const[e]=Nt();return R.useEffect((()=>uL(e,n)),[e,n]),null}function fb(){const[n]=Nt();return R.useEffect((()=>ln(n.registerCommand(e5,(()=>(sL(n,"check"),!0)),Ye),n.registerCommand(zm,(e=>gb(e,n,!1)),Ye),n.registerCommand(Bm,(e=>gb(e,n,!0)),Ye),n.registerCommand(Ma,(e=>{if(ag()!=null){const t=n.getRootElement();return t?.focus(),!0}return!1}),Ye),n.registerCommand(Vm,(e=>{const t=ag();return!(t==null||!n.isEditable())&&(n.update((()=>{const r=Ar(t);_e(r)&&(e.preventDefault(),r.toggleChecked())})),!0)}),Ye),n.registerCommand(Zm,(e=>n.getEditorState().read((()=>{const t=X();if(z(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=Zi(s,(l=>I(l)&&!l.isInline()));if(_e(o)){const l=o.getParent();if(xe(l)&&l.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const a=n.getElementByKey(o.__key);if(a!=null&&document.activeElement!==a)return a.focus(),e.preventDefault(),!0}}}}return!1}))),Ye),n.registerRootListener(((e,t)=>{e!==null&&(e.addEventListener("click",db),e.addEventListener("pointerdown",pb)),t!==null&&(t.removeEventListener("click",db),t.removeEventListener("pointerdown",pb))}))))),null}function n5(n,e){const t=n.target;if(!nt(t))return;const r=t.firstChild;if(nt(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=n.pageX/P$(t);(t.dir==="rtl"?o<s.right&&o>s.right-20:o>s.left&&o<s.left+20)&&e()}function db(n){n5(n,(()=>{if(nt(n.target)){const e=n.target,t=iO(e);t!=null&&t.isEditable()&&t.update((()=>{const r=Ar(e);_e(r)&&(e.focus(),r.toggleChecked())}))}}))}function pb(n){n5(n,(()=>{n.preventDefault()}))}function ag(){const n=document.activeElement;return nt(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function gb(n,e,t){const r=ag();return r!=null&&e.update((()=>{const i=Ar(r);if(!_e(i))return;const s=(function(o,l){let a=l?o.getPreviousSibling():o.getNextSibling(),c=o;for(;a==null&&_e(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;_e(a);){const u=l?a.getLastChild():a.getFirstChild();if(!xe(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout((()=>{o.focus()}),0))}})),!1}function mb(){const[n]=Nt();return R.useEffect((()=>{if(!n.hasNodes([Nr,ir]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[n]),(function(e){R.useEffect((()=>iL(e)),[e])})(n),null}const hL={name:"tasklistCheck",tokenize:dL};function fL(){return{text:{91:hL}}}function dL(n,e,t){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),s)}function s(a){return rt(a)?(n.enter("taskListCheckValueUnchecked"),n.consume(a),n.exit("taskListCheckValueUnchecked"),o):a===88||a===120?(n.enter("taskListCheckValueChecked"),n.consume(a),n.exit("taskListCheckValueChecked"),o):t(a)}function o(a){return a===93?(n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),l):t(a)}function l(a){return he(a)?e(a):Te(a)?n.check({tokenize:pL},e,t)(a):t(a)}}function pL(n,e,t){return Ie(n,r,"whitespace");function r(i){return i===null?t(i):e(i)}}function gL(){return{exit:{taskListCheckValueChecked:Ob,taskListCheckValueUnchecked:Ob,paragraph:OL}}}function mL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xL}}}function Ob(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function OL(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){o=l;break}}o===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(n)}function xL(n,e,t,r){const i=n.children[0],s=typeof n.checked=="boolean"&&i&&i.type==="paragraph",o="["+(n.checked?"x":" ")+"] ",l=t.createTracker(r);s&&l.move(o);let a=K2.listItem(n,e,t,{...r,...l.current()});return s&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(u){return u+o}}const bL=new Map([["number",Jv],["bullet",Kv],["check",e5],["",t5]]),cg=oe("",n=>{n.sub(n.pipe(xo,Je(st)),([e,t])=>{if(!e||!t)return;const r=e.anchor.getNode();let i=r.getKey()==="root"?r:Zi(r,l=>{const a=l.getParent();return a!==null&&et(a)});i===null&&(i=r.getTopLevelElementOrThrow());const s=i.getKey();if(t.getElementByKey(s)!==null)if(xe(i)){const l=S2(r,Nr),a=l?l.getListType():i.getListType();n.pub(cg,a)}else n.pub(cg,"")})}),r5=bt(n=>{n.sub(n.pipe(r5,Je(st)),([e,t])=>{t?.dispatchCommand(bL.get(e),void 0)})}),yL=Ln({init(n){var e;(e=n.getValue(zi))==null||e.registerCommand(Iu,()=>!SL(7),si),n.pubIn({[Fo]:"lists",[tg]:gL(),[eg]:fL(),[oi]:[oL,lL],[Vi]:[ir,Nr],[Fi]:[aL,cL],[_v]:mL(),[Qs]:[hb,mb,fb],[Dv]:[hb,mb,fb]})}});function kL(n){const e=n.getNodes();return e.length===0?new Set([n.anchor.getNode().getParentOrThrow(),n.focus.getNode().getParentOrThrow()]):new Set(e.map(t=>I(t)?t:t.getParentOrThrow()))}function SL(n){const e=X();if(!z(e))return!1;const t=kL(e);let r=0;for(const i of t)if(xe(i))r=Math.max(sg(i)+1,r);else if(_e(i)){const s=i.getParent();if(s?.getChildren().length===1){const o=s.getParent();if(_e(o)&&o.getChildren().length===1)return!1}if(!xe(s))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(sg(s)+1,r)}return r<=n}var td="rovingFocusGroup.onEntryFocus",wL={bubbles:!1,cancelable:!0},ja="RovingFocusGroup",[ug,i5,vL]=T9(ja),[CL,pf]=Pm(ja,[vL]),[TL,_L]=CL(ja),s5=R.forwardRef((n,e)=>G.jsx(ug.Provider,{scope:n.__scopeRovingFocusGroup,children:G.jsx(ug.Slot,{scope:n.__scopeRovingFocusGroup,children:G.jsx(PL,{...n,ref:e})})}));s5.displayName=ja;var PL=R.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=n,f=R.useRef(null),d=N9(e,f),p=Qm(s),[g,m]=Rh({prop:o,defaultProp:l??null,onChange:a,caller:ja}),[O,b]=R.useState(!1),x=f9(c),y=i5(t),w=R.useRef(!1),[k,S]=R.useState(0);return R.useEffect(()=>{const v=f.current;if(v)return v.addEventListener(td,x),()=>v.removeEventListener(td,x)},[x]),G.jsx(TL,{scope:t,orientation:r,dir:p,loop:i,currentTabStopId:g,onItemFocus:R.useCallback(v=>m(v),[m]),onItemShiftTab:R.useCallback(()=>b(!0),[]),onFocusableItemAdd:R.useCallback(()=>S(v=>v+1),[]),onFocusableItemRemove:R.useCallback(()=>S(v=>v-1),[]),children:G.jsx(ri.div,{tabIndex:O||k===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...n.style},onMouseDown:vi(n.onMouseDown,()=>{w.current=!0}),onFocus:vi(n.onFocus,v=>{const T=!w.current;if(v.target===v.currentTarget&&T&&!O){const A=new CustomEvent(td,wL);if(v.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=y().filter(J=>J.focusable),L=M.find(J=>J.active),E=M.find(J=>J.id===g),B=[L,E,...M].filter(Boolean).map(J=>J.ref.current);a5(B,u)}}w.current=!1}),onBlur:vi(n.onBlur,()=>b(!1))})})}),o5="RovingFocusGroupItem",l5=R.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...l}=n,a=h9(),c=s||a,u=_L(o5,t),h=u.currentTabStopId===c,f=i5(t),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:g}=u;return R.useEffect(()=>{if(r)return d(),()=>p()},[r,d,p]),G.jsx(ug.ItemSlot,{scope:t,id:c,focusable:r,active:i,children:G.jsx(ri.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...l,ref:e,onMouseDown:vi(n.onMouseDown,m=>{r?u.onItemFocus(c):m.preventDefault()}),onFocus:vi(n.onFocus,()=>u.onItemFocus(c)),onKeyDown:vi(n.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const O=EL(m,u.orientation,u.dir);if(O!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=f().filter(y=>y.focusable).map(y=>y.ref.current);if(O==="last")x.reverse();else if(O==="prev"||O==="next"){O==="prev"&&x.reverse();const y=x.indexOf(m.currentTarget);x=u.loop?AL(x,y+1):x.slice(y+1)}setTimeout(()=>a5(x))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});l5.displayName=o5;var QL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $L(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function EL(n,e,t){const r=$L(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QL[r]}function a5(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function AL(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var c5=s5,EO=l5,ML="Separator",xb="horizontal",LL=["horizontal","vertical"],u5=R.forwardRef((n,e)=>{const{decorative:t,orientation:r=xb,...i}=n,s=IL(r)?r:xb,l=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return G.jsx(ri.div,{"data-orientation":s,...l,...i,ref:e})});u5.displayName=ML;function IL(n){return LL.includes(n)}var RL=u5,h5="Toggle",f5=R.forwardRef((n,e)=>{const{pressed:t,defaultPressed:r,onPressedChange:i,...s}=n,[o,l]=Rh({prop:t,onChange:i,defaultProp:r??!1,caller:h5});return G.jsx(ri.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...s,ref:e,onClick:vi(n.onClick,()=>{n.disabled||l(!o)})})});f5.displayName=h5;var Xi="ToggleGroup",[d5,p5]=Pm(Xi,[pf]),g5=pf(),AO=C.forwardRef((n,e)=>{const{type:t,...r}=n;if(t==="single"){const i=r;return G.jsx(NL,{...i,ref:e})}if(t==="multiple"){const i=r;return G.jsx(DL,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Xi}\``)});AO.displayName=Xi;var[m5,O5]=d5(Xi),NL=C.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=Rh({prop:t,defaultProp:r??"",onChange:i,caller:Xi});return G.jsx(m5,{scope:n.__scopeToggleGroup,type:"single",value:C.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:C.useCallback(()=>l(""),[l]),children:G.jsx(x5,{...s,ref:e})})}),DL=C.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=Rh({prop:t,defaultProp:r??[],onChange:i,caller:Xi}),a=C.useCallback(u=>l((h=[])=>[...h,u]),[l]),c=C.useCallback(u=>l((h=[])=>h.filter(f=>f!==u)),[l]);return G.jsx(m5,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:a,onItemDeactivate:c,children:G.jsx(x5,{...s,ref:e})})});AO.displayName=Xi;var[ZL,BL]=d5(Xi),x5=C.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:l=!0,...a}=n,c=g5(t),u=Qm(o),h={role:"group",dir:u,...a};return G.jsx(ZL,{scope:t,rovingFocus:i,disabled:r,children:i?G.jsx(c5,{asChild:!0,...c,orientation:s,dir:u,loop:l,children:G.jsx(ri.div,{...h,ref:e})}):G.jsx(ri.div,{...h,ref:e})})}),Hu="ToggleGroupItem",b5=C.forwardRef((n,e)=>{const t=O5(Hu,n.__scopeToggleGroup),r=BL(Hu,n.__scopeToggleGroup),i=g5(n.__scopeToggleGroup),s=t.value.includes(n.value),o=r.disabled||n.disabled,l={...n,pressed:s,disabled:o},a=C.useRef(null);return r.rovingFocus?G.jsx(EO,{asChild:!0,...i,focusable:!o,active:s,ref:a,children:G.jsx(bb,{...l,ref:e})}):G.jsx(bb,{...l,ref:e})});b5.displayName=Hu;var bb=C.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:r,...i}=n,s=O5(Hu,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return G.jsx(f5,{...l,...i,ref:e,onPressedChange:a=>{a?s.onItemActivate(r):s.onItemDeactivate(r)}})}),zL=AO,VL=b5,MO="Toolbar",[FL]=Pm(MO,[pf,p5]),LO=pf(),y5=p5(),[XL,k5]=FL(MO),S5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,orientation:r="horizontal",dir:i,loop:s=!0,...o}=n,l=LO(t),a=Qm(i);return G.jsx(XL,{scope:t,orientation:r,dir:a,children:G.jsx(c5,{asChild:!0,...l,orientation:r,dir:a,loop:s,children:G.jsx(ri.div,{role:"toolbar","aria-orientation":r,dir:a,...o,ref:e})})})});S5.displayName=MO;var w5="ToolbarSeparator",v5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=k5(w5,t);return G.jsx(RL,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});v5.displayName=w5;var WL="ToolbarButton",IO=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=LO(t);return G.jsx(EO,{asChild:!0,...i,focusable:!n.disabled,children:G.jsx(ri.button,{type:"button",...r,ref:e})})});IO.displayName=WL;var qL="ToolbarLink",jL=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=LO(t);return G.jsx(EO,{asChild:!0,...i,focusable:!0,children:G.jsx(ri.a,{...r,ref:e,onKeyDown:vi(n.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});jL.displayName=qL;var C5="ToolbarToggleGroup",T5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=k5(C5,t),s=y5(t);return G.jsx(zL,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});T5.displayName=C5;var YL="ToolbarToggleItem",_5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=y5(t),s={__scopeToolbar:n.__scopeToolbar};return G.jsx(IO,{asChild:!0,...s,children:G.jsx(VL,{...i,...r,ref:e})})});_5.displayName=YL;var HL=S5,UL=v5,P5=IO,RO=T5,GL=_5;const KL=new Set(["http:","https:","mailto:","sms:","tel:"]);class hi extends nr{static getType(){return"link"}static clone(e){return new hi(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Kn(t,e.theme.link),t}updateDOM(e,t,r){if(d2(t)){const i=this.__url,s=this.__target,o=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),s!==e.__target&&(s?t.target=s:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:JL,priority:1})}}static importJSON(e){return Ss().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{const t=new URL(e);if(!KL.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=Ss(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!z(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function JL(n){let e=null;if(d2(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=Ss(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function Ss(n="",e){return on(new hi(n,e))}function xr(n){return n instanceof hi}class Wo extends hi{constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new Wo(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return hg().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(I(r)){const i=hg(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function hg(n="",e){return on(new Wo(n,e))}function Ji(n){return n instanceof Wo}const yo=ci();function yb(n,e){if(n.type==="element"){const t=n.getNode();return I(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const l of i)o.append("v",l);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function nd(n,e={}){const{target:t,title:r}=e,i=e.rel===void 0?"noreferrer":e.rel,s=X();if(!z(s))return;const o=s.extract();if(n===null)return void o.forEach((c=>{const u=Zi(c,(h=>!Ji(h)&&xr(h)));if(u){const h=u.getChildren();for(let f=0;f<h.length;f++)u.insertBefore(h[f]);u.remove()}}));const l=new Set,a=c=>{l.has(c.getKey())||(l.add(c.getKey()),c.setURL(n),t!==void 0&&c.setTarget(t),i!==void 0&&c.setRel(i),r!==void 0&&c.setTitle(r))};if(o.length===1){const c=kb(o[0],xr);if(c!==null)return a(c)}(function(c){const u=X();if(!z(u))return c();const h=gs(u),f=h.isBackward(),d=yb(h.anchor,f?-1:0),p=yb(h.focus,f?0:-1);if(c(),d||p){const g=X();if(z(g)){const m=g.clone();if(d){const O=d.getParent();O&&m.anchor.set(O.getKey(),d.getIndexWithinParent()+(f?1:0),"element")}if(p){const O=p.getParent();O&&m.focus.set(O.getKey(),p.getIndexWithinParent()+(f?0:1),"element")}dt(gs(m))}}})((()=>{let c=null;for(const u of o){if(!u.isAttached())continue;const h=kb(u,xr);if(h){a(h);continue}if(I(u)){if(!u.isInline())continue;if(xr(u)){if(!(Ji(u)||c!==null&&c.getParentOrThrow().isParentOf(u))){a(u),c=u;continue}for(const d of u.getChildren())u.insertBefore(d);u.remove();continue}}const f=u.getPreviousSibling();xr(f)&&f.is(c)?f.append(u):(c=Ss(n,{rel:i,target:t,title:r}),u.insertAfter(c),c.append(u))}}))}function kb(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}const eI={testNode:"link",visitNode({mdastNode:n,actions:e}){e.addAndStepInto(Ss(n.url,{title:n.title}))}},tI={testLexicalNode:xr,visitLexicalNode:({lexicalNode:n,actions:e})=>{e.addAndStepInto("link",{url:n.getURL(),title:n.getTitle()})}};function nI({validateUrl:n,attributes:e}){const[t]=Nt();return R.useEffect((()=>{if(!t.hasNodes([hi]))throw new Error("LinkPlugin: LinkNode not registered on editor");return ln(t.registerCommand(yo,(r=>{if(r===null)return nd(r),!0;if(typeof r=="string")return!(n!==void 0&&!n(r))&&(nd(r,e),!0);{const{url:i,target:s,rel:o,title:l}=r;return nd(i,{...e,rel:o,target:s,title:l}),!0}}),Ye),n!==void 0?t.registerCommand(Aa,(r=>{const i=X();if(!z(i)||i.isCollapsed()||!ki(r,ClipboardEvent))return!1;const s=r;if(s.clipboardData===null)return!1;const o=s.clipboardData.getData("text");return!!n(o)&&!i.getNodes().some((l=>I(l)))&&(t.dispatchCommand(yo,{...e,url:o}),r.preventDefault(),!0)}),Ye):()=>{})}),[t,n,e]),null}function Sb(n,e=(t=>t)){return t=>{const r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Q5(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const rI=/[.,;\s]/;function Uu(n){return rI.test(n)}function $5(n){return Uu(n[n.length-1])}function fg(n){return Uu(n[0])}function E5(n){let e=n.getPreviousSibling();return I(e)&&(e=e.getLastDescendant()),e===null||Hn(e)||q(e)&&$5(e.getTextContent())}function A5(n){let e=n.getNextSibling();return I(e)&&(e=e.getFirstDescendant()),e===null||Hn(e)||q(e)&&fg(e.getTextContent())}function iI(n,e,t,r){return(n>0?Uu(t[n-1]):E5(r[0]))?e<t.length?Uu(t[e]):A5(r[r.length-1]):!1}function sI(n,e,t){const r=[],i=[],s=[];let o=0,l=0;const a=[...n];for(;a.length>0;){const c=a[0],u=c.getTextContent().length,h=l;l+u<=e?(r.push(c),o+=u):h>=t?s.push(c):i.push(c),l+=u,a.shift()}return[o,r,i,s]}function oI(n,e,t,r){const i=hg(r.url,r.attributes);if(n.length===1){let s,o=n[0];e===0?[s,o]=o.splitText(t):[,s,o]=o.splitText(e,t);const l=He(r.text);return l.setFormat(s.getFormat()),l.setDetail(s.getDetail()),l.setStyle(s.getStyle()),i.append(l),s.replace(i),o}if(n.length>1){const s=n[0];let o,l=s.getTextContent().length;e===0?o=s:[,o]=s.splitText(e);const a=[];let c;for(let d=1;d<n.length;d++){const p=n[d],g=p.getTextContent().length,m=l;if(m<t)if(l+g<=t)a.push(p);else{const[O,b]=p.splitText(t-m);a.push(O),c=b}l+=g}const u=X(),h=u?u.getNodes().find(q):void 0,f=He(o.getTextContent());return f.setFormat(o.getFormat()),f.setDetail(o.getDetail()),f.setStyle(o.getStyle()),i.append(f,...a),h&&h===o&&(z(u)?f.select(u.anchor.offset,u.focus.offset):pt(u)&&f.select(0,f.getTextContent().length)),o.replace(i),c}}function rd(n,e,t){const r=n.getChildren(),i=r.length;for(let a=0;a<i;a++){const c=r[a];if(!q(c)||!c.isSimpleText())return pu(n),void t(null,n.getURL())}const s=n.getTextContent(),o=Q5(s,e);if(o===null||o.text!==s||!E5(n)||!A5(n))return pu(n),void t(null,n.getURL());const l=n.getURL();if(l!==o.url&&(n.setURL(o.url),t(o.url,l)),o.attributes){const a=n.getRel();a!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,a));const c=n.getTarget();c!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,c))}}function pu(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map((t=>t.getLatest()))}function lI(n,e,t){R.useEffect((()=>{n.hasNodes([Wo])||(function(i,...s){const o=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",i);for(const a of s)l.append("v",a);throw o.search=l.toString(),Error(`Minified Lexical error #${i}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77);const r=(i,s)=>{t&&t(i,s)};return ln(n.registerNodeTransform(Rr,(i=>{const s=i.getParentOrThrow(),o=i.getPreviousSibling();if(Ji(s)&&!s.getIsUnlinked())rd(s,e,r);else if(!xr(s)){if(i.isSimpleText()&&(fg(i.getTextContent())||!Ji(o))){const l=(function(a){const c=[a];let u=a.getNextSibling();for(;u!==null&&q(u)&&u.isSimpleText()&&(c.push(u),!/[\s]/.test(u.getTextContent()));)u=u.getNextSibling();return c})(i);(function(a,c,u){let h=[...a];const f=h.map((m=>m.getTextContent())).join("");let d,p=f,g=0;for(;(d=Q5(p,c))&&d!==null;){const m=d.index,O=m+d.length;if(iI(g+m,g+O,f,h)){const[b,,x,y]=sI(h,g+m,g+O),w=oI(x,g+m-b,g+O-b,d);h=w?[w,...y]:y,u(d.url,null),g=0}else g+=O;p=p.substring(O)}})(l,e,r)}(function(l,a,c){const u=l.getPreviousSibling(),h=l.getNextSibling(),f=l.getTextContent();var d;!Ji(u)||u.getIsUnlinked()||fg(f)&&(d=f,!(u.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(d):/^\.[a-zA-Z0-9]{1,}/.test(d)))||(u.append(l),rd(u,a,c),c(null,u.getURL())),!Ji(h)||h.getIsUnlinked()||$5(f)||(pu(h),rd(h,a,c),c(null,h.getURL()))})(i,e,r)}})),n.registerCommand(yo,(i=>{const s=X();return i!==null||!z(s)||s.extract().forEach((o=>{const l=o.getParent();if(Ji(l))return l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty(),!0})),!1}),Ye))}),[n,e,t])}function aI({matchers:n,onChange:e}){const[t]=Nt();return lI(t,n,e),null}const cI=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,uI=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,hI=[Sb(cI,n=>n.startsWith("http")?n:`https://${n}`),Sb(uI,n=>`mailto:${n}`)],fI=()=>C.createElement(aI,{matchers:hI}),dI=oe(!1),pI=Ln({init(n,e){const t=!!e?.disableAutoLink,r=e?.validateUrl?{validateUrl:e.validateUrl}:{};n.pubIn({[Fo]:"link",[oi]:eI,[Vi]:[hi,Wo],[Fi]:tI,[dI]:t,[Qs]:()=>C.createElement(C.Fragment,null,C.createElement(nI,{...r}),t?null:C.createElement(fI,null))})}});function gI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var mI=["color"],OI=R.forwardRef(function(n,e){var t=n.color,r=t===void 0?"currentColor":t,i=gI(n,mI);return R.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),R.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const wb=()=>C.createElement("div",{className:H.imagePlaceholder},C.createElement(OI,null));function dg({nodeKey:n,imageSource:e,initialImagePath:t,title:r,alt:i}){const[s,o,l]=Wt(eC,rr,yn),[a]=Nt(),c=ut(K5),u=kn();return C.createElement("div",{className:H.editImageToolbar},C.createElement("button",{className:H.iconButton,type:"button",title:u("imageEditor.deleteImage","Delete image"),disabled:l,onClick:h=>{h.preventDefault(),a.update(()=>{var f;(f=Ke(n))==null||f.remove()})}},o("delete_small")),!s&&C.createElement("button",{type:"button",className:Me(H.iconButton,H.editImageButton),title:u("imageEditor.editImage","Edit image"),disabled:l,onClick:()=>{c({nodeKey:n,initialValues:{src:t||e,title:r,altText:i}})}},o("settings")))}function bl(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ue(){return Ue=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ue.apply(null,arguments)}var id={exports:{}},sd,vb;function xI(){if(vb)return sd;vb=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return sd=n,sd}var od,Cb;function bI(){if(Cb)return od;Cb=1;var n=xI();function e(){}function t(){}return t.resetWarningCache=e,od=function(){function r(o,l,a,c,u,h){if(h!==n){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},od}var Tb;function yI(){return Tb||(Tb=1,id.exports=bI()()),id.exports}var kI=yI();const Y=nw(kI);var ld={exports:{}},Ne={};var _b;function SI(){if(_b)return Ne;_b=1;var n=60103,e=60106,t=60107,r=60108,i=60114,s=60109,o=60110,l=60112,a=60113,c=60120,u=60115,h=60116,f=60121,d=60122,p=60117,g=60129,m=60131;if(typeof Symbol=="function"&&Symbol.for){var O=Symbol.for;n=O("react.element"),e=O("react.portal"),t=O("react.fragment"),r=O("react.strict_mode"),i=O("react.profiler"),s=O("react.provider"),o=O("react.context"),l=O("react.forward_ref"),a=O("react.suspense"),c=O("react.suspense_list"),u=O("react.memo"),h=O("react.lazy"),f=O("react.block"),d=O("react.server.block"),p=O("react.fundamental"),g=O("react.debug_trace_mode"),m=O("react.legacy_hidden")}function b(E){if(typeof E=="object"&&E!==null){var D=E.$$typeof;switch(D){case n:switch(E=E.type,E){case t:case i:case r:case a:case c:return E;default:switch(E=E&&E.$$typeof,E){case o:case l:case h:case u:case s:return E;default:return D}}case e:return D}}}var x=s,y=n,w=l,k=t,S=h,v=u,T=e,A=i,M=r,L=a;return Ne.ContextConsumer=o,Ne.ContextProvider=x,Ne.Element=y,Ne.ForwardRef=w,Ne.Fragment=k,Ne.Lazy=S,Ne.Memo=v,Ne.Portal=T,Ne.Profiler=A,Ne.StrictMode=M,Ne.Suspense=L,Ne.isAsyncMode=function(){return!1},Ne.isConcurrentMode=function(){return!1},Ne.isContextConsumer=function(E){return b(E)===o},Ne.isContextProvider=function(E){return b(E)===s},Ne.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===n},Ne.isForwardRef=function(E){return b(E)===l},Ne.isFragment=function(E){return b(E)===t},Ne.isLazy=function(E){return b(E)===h},Ne.isMemo=function(E){return b(E)===u},Ne.isPortal=function(E){return b(E)===e},Ne.isProfiler=function(E){return b(E)===i},Ne.isStrictMode=function(E){return b(E)===r},Ne.isSuspense=function(E){return b(E)===a},Ne.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===t||E===i||E===g||E===r||E===a||E===c||E===m||typeof E=="object"&&E!==null&&(E.$$typeof===h||E.$$typeof===u||E.$$typeof===s||E.$$typeof===o||E.$$typeof===l||E.$$typeof===p||E.$$typeof===f||E[0]===d)},Ne.typeOf=b,Ne}var Pb;function wI(){return Pb||(Pb=1,ld.exports=SI()),ld.exports}wI();let Qb=n=>typeof n=="object"&&n!=null&&n.nodeType===1,$b=(n,e)=>(!e||n!=="hidden")&&n!=="visible"&&n!=="clip",ad=(n,e)=>{if(n.clientHeight<n.scrollHeight||n.clientWidth<n.scrollWidth){let t=getComputedStyle(n,null);return $b(t.overflowY,e)||$b(t.overflowX,e)||(r=>{let i=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(n)}return!1},kc=(n,e,t,r,i,s,o,l)=>s<n&&o>e||s>n&&o<e?0:s<=n&&l<=t||o>=e&&l>=t?s-n-r:o>e&&l<t||s<n&&l>t?o-e+i:0,vI=n=>{let e=n.parentElement;return e??(n.getRootNode().host||null)};var CI=(n,e)=>{var t,r,i,s,o,l;if(typeof document>"u")return[];let{inline:a,boundary:c,skipOverflowHiddenElements:u}=e,h=typeof c=="function"?c:L=>L!==c;if(!Qb(n))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,d=[],p=n;for(;Qb(p)&&h(p);){if(p=vI(p),p===f){d.push(p);break}p!=null&&p===document.body&&ad(p)&&!ad(document.documentElement)||p!=null&&ad(p,u)&&d.push(p)}let g=(r=(t=window.visualViewport)==null?void 0:t.width)!=null?r:innerWidth,m=(s=(i=window.visualViewport)==null?void 0:i.height)!=null?s:innerHeight,O=(o=window.scrollX)!=null?o:pageXOffset,b=(l=window.scrollY)!=null?l:pageYOffset,{height:x,width:y,top:w,right:k,bottom:S,left:v}=n.getBoundingClientRect(),T=w,A=a==="center"?v+y/2:a==="end"?k:v,M=[];for(let L=0;L<d.length;L++){let E=d[L],{height:D,width:B,top:J,right:U,bottom:le,left:te}=E.getBoundingClientRect();if(w>=0&&v>=0&&S<=m&&k<=g&&w>=J&&S<=le&&v>=te&&k<=U)return M;let Q=getComputedStyle(E),fe=parseInt(Q.borderLeftWidth,10),de=parseInt(Q.borderTopWidth,10),$=parseInt(Q.borderRightWidth,10),ye=parseInt(Q.borderBottomWidth,10),ke=0,pe=0,ae="offsetWidth"in E?E.offsetWidth-E.clientWidth-fe-$:0,ie="offsetHeight"in E?E.offsetHeight-E.clientHeight-de-ye:0,ue="offsetWidth"in E?E.offsetWidth===0?0:B/E.offsetWidth:0,Oe="offsetHeight"in E?E.offsetHeight===0?0:D/E.offsetHeight:0;if(f===E)ke=kc(b,b+m,m,de,ye,b+T,b+T+x,x),pe=a==="start"?A:a==="center"?A-g/2:a==="end"?A-g:kc(O,O+g,g,fe,$,O+A,O+A+y,y),ke=Math.max(0,ke+b),pe=Math.max(0,pe+O);else{ke=kc(J,le,D,de,ye+ie,T,T+x,x),pe=a==="start"?A-te-fe:a==="center"?A-(te+B/2)+ae/2:a==="end"?A-U+$+ae:kc(te,U,B,fe,$+ae,A,A+y,y);let{scrollLeft:Ae,scrollTop:St}=E;ke=Math.max(0,Math.min(St+ke/Oe,E.scrollHeight-D/Oe+ie)),pe=Math.max(0,Math.min(Ae+pe/ue,E.scrollWidth-B/ue+ae)),T+=St-ke,A+=Ae-pe}M.push({el:E,top:ke,left:pe})}return M},TI=0;function M5(){}function _I(n,e){if(n){var t=CI(n,{boundary:e});t.forEach(function(r){var i=r.el,s=r.top,o=r.left;i.scrollTop=s,i.scrollLeft=o})}}function Eb(n,e,t){var r=n===e||e instanceof t.Node&&n.contains&&n.contains(e);return r}function L5(n,e){var t;function r(){t&&clearTimeout(t)}function i(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];r(),t=setTimeout(function(){t=null,n.apply(void 0,o)},e)}return i.cancel=r,i}function Xr(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return e.some(function(l){return l&&l.apply(void 0,[r].concat(s)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function Sc(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(r){e.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function PI(){return String(TI++)}function QI(n){var e=n.isOpen,t=n.resultCount,r=n.previousResultCount;return e?t?t!==r?t+" result"+(t===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function pg(n,e){return Object.keys(n).reduce(function(t,r){return t[r]=I5(e,r)?e[r]:n[r],t},{})}function I5(n,e){return n[e]!==void 0}function $I(n){var e=n.key,t=n.keyCode;return t>=37&&t<=40&&e.indexOf("Arrow")!==0?"Arrow"+e:e}function wc(n,e,t,r,i){if(i===void 0&&(i=!0),t===0)return-1;var s=t-1;(typeof e!="number"||e<0||e>=t)&&(e=n>0?-1:s+1);var o=e+n;o<0?o=i?s:0:o>s&&(o=i?0:s);var l=la(n,o,t,r,i);return l===-1?e>=t?-1:e:l}function la(n,e,t,r,i){var s=r(e);if(!s||!s.hasAttribute("disabled"))return e;if(n>0){for(var o=e+1;o<t;o++)if(!r(o).hasAttribute("disabled"))return o}else for(var l=e-1;l>=0;l--)if(!r(l).hasAttribute("disabled"))return l;return i?n>0?la(1,0,t,r,!1):la(-1,t-1,t,r,!1):-1}function Ab(n,e,t,r){return r===void 0&&(r=!0),e.some(function(i){return i&&(Eb(i,n,t)||r&&Eb(i,t.document.activeElement,t))})}var EI=L5(function(n){R5(n).textContent=""},500);function AI(n,e){var t=R5(e);n&&(t.textContent=n,EI(e))}function R5(n){n===void 0&&(n=document);var e=n.getElementById("a11y-status-message");return e||(e=n.createElement("div"),e.setAttribute("id","a11y-status-message"),e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-relevant","additions text"),Object.assign(e.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),n.body.appendChild(e),e)}var MI=["isInitialMount","highlightedIndex","items","environment"],N5={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function LI(n,e,t){var r=n.props,i=n.type,s={};Object.keys(e).forEach(function(o){II(o,n,e,t),t[o]!==e[o]&&(s[o]=t[o])}),r.onStateChange&&Object.keys(s).length&&r.onStateChange(Ue({type:i},s))}function II(n,e,t,r){var i=e.props,s=e.type,o="on"+NO(n)+"Change";i[o]&&r[n]!==void 0&&r[n]!==t[n]&&i[o](Ue({type:s},r))}function RI(n,e){return e.changes}function NI(n){var e=n.selectedItem,t=n.itemToString;return e?t(e)+" has been selected.":""}var DI=L5(function(n,e){AI(n(),e)},200),ZI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?R.useLayoutEffect:R.useEffect;function BI(n){var e=n.id,t=e===void 0?"downshift-"+PI():e,r=n.labelId,i=n.menuId,s=n.getItemId,o=n.toggleButtonId,l=n.inputId,a=R.useRef({labelId:r||t+"-label",menuId:i||t+"-menu",getItemId:s||function(c){return t+"-item-"+c},toggleButtonId:o||t+"-toggle-button",inputId:l||t+"-input"});return a.current}function zI(n,e,t,r){var i,s;if(n===void 0){if(e===void 0)throw new Error(r);i=t[e],s=e}else s=e===void 0?t.indexOf(n):e,i=n;return[i,s]}function VI(n){return n?String(n):""}function NO(n){return""+n.slice(0,1).toUpperCase()+n.slice(1)}function D5(n){var e=R.useRef(n);return e.current=n,e}function FI(n,e,t){var r=R.useRef(),i=R.useRef(),s=R.useCallback(function(f,d){i.current=d,f=pg(f,d.props);var p=n(f,d),g=d.props.stateReducer(f,Ue({},d,{changes:p}));return g},[n]),o=R.useReducer(s,e),l=o[0],a=o[1],c=D5(t),u=R.useCallback(function(f){return a(Ue({props:c.current},f))},[c]),h=i.current;return R.useEffect(function(){h&&r.current&&r.current!==l&&LI(h,pg(r.current,h.props),l),r.current=l},[l,t,h]),[l,u]}var Nl={itemToString:VI,stateReducer:RI,getA11ySelectionMessage:NI,scrollIntoView:_I,environment:typeof window>"u"?{}:window};function vr(n,e,t){t===void 0&&(t=N5);var r=n["default"+NO(e)];return r!==void 0?r:t[e]}function vc(n,e,t){t===void 0&&(t=N5);var r=n[e];if(r!==void 0)return r;var i=n["initial"+NO(e)];return i!==void 0?i:vr(n,e,t)}function XI(n){var e=vc(n,"selectedItem"),t=vc(n,"isOpen"),r=vc(n,"highlightedIndex"),i=vc(n,"inputValue");return{highlightedIndex:r<0&&e&&t?n.items.indexOf(e):r,isOpen:t,selectedItem:e,inputValue:i}}function Dl(n,e,t){var r=n.items,i=n.initialHighlightedIndex,s=n.defaultHighlightedIndex,o=e.selectedItem,l=e.highlightedIndex;return r.length===0?-1:i!==void 0&&l===i?i:s!==void 0?s:o?r.indexOf(o):t===0?-1:t<0?r.length-1:0}function WI(n,e,t,r){var i=R.useRef({isMouseDown:!1,isTouchMove:!1});return R.useEffect(function(){if(t?.addEventListener!=null){var s=function(){i.current.isMouseDown=!0},o=function(h){i.current.isMouseDown=!1,n&&!Ab(h.target,e.map(function(f){return f.current}),t)&&r()},l=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},c=function(h){n&&!i.current.isTouchMove&&!Ab(h.target,e.map(function(f){return f.current}),t,!1)&&r()};return t.addEventListener("mousedown",s),t.addEventListener("mouseup",o),t.addEventListener("touchstart",l),t.addEventListener("touchmove",a),t.addEventListener("touchend",c),function(){t.removeEventListener("mousedown",s),t.removeEventListener("mouseup",o),t.removeEventListener("touchstart",l),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",c)}}},[n,t]),i}var qI=function(){return M5};function Mb(n,e,t){var r=t.isInitialMount,i=t.highlightedIndex,s=t.items,o=t.environment,l=bl(t,MI);R.useEffect(function(){r||DI(function(){return n(Ue({highlightedIndex:i,highlightedItem:s[i],resultCount:s.length},l))},o.document)},e)}function jI(n){var e=n.highlightedIndex,t=n.isOpen,r=n.itemRefs,i=n.getItemNodeFromIndex,s=n.menuElement,o=n.scrollIntoView,l=R.useRef(!0);return ZI(function(){e<0||!t||!Object.keys(r.current).length||(l.current===!1?l.current=!0:o(i(e),s))},[e]),l}var YI=M5;function Lb(n,e,t){var r;t===void 0&&(t=!0);var i=((r=n.items)==null?void 0:r.length)&&e>=0;return Ue({isOpen:!1,highlightedIndex:-1},i&&Ue({selectedItem:n.items[e],isOpen:vr(n,"isOpen"),highlightedIndex:vr(n,"highlightedIndex")},t&&{inputValue:n.itemToString(n.items[e])}))}function HI(n,e,t){var r=e.type,i=e.props,s;switch(r){case t.ItemMouseMove:s={highlightedIndex:e.disabled?-1:e.index};break;case t.MenuMouseLeave:s={highlightedIndex:-1};break;case t.ToggleButtonClick:case t.FunctionToggleMenu:s={isOpen:!n.isOpen,highlightedIndex:n.isOpen?-1:Dl(i,n,0)};break;case t.FunctionOpenMenu:s={isOpen:!0,highlightedIndex:Dl(i,n,0)};break;case t.FunctionCloseMenu:s={isOpen:!1};break;case t.FunctionSetHighlightedIndex:s={highlightedIndex:e.highlightedIndex};break;case t.FunctionSetInputValue:s={inputValue:e.inputValue};break;case t.FunctionReset:s={highlightedIndex:vr(i,"highlightedIndex"),isOpen:vr(i,"isOpen"),selectedItem:vr(i,"selectedItem"),inputValue:vr(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Ue({},n,s)}Y.array.isRequired,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.bool,Y.bool,Y.bool,Y.any,Y.any,Y.any,Y.string,Y.string,Y.string,Y.func,Y.string,Y.func,Y.func,Y.func,Y.func,Y.func,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});function UI(n){var e=n.isOpen,t=n.resultCount,r=n.previousResultCount;return e?t?t!==r?"".concat(t," result").concat(t===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}h0(h0({},Nl),{getA11yStatusMessage:UI});var DO=0,ZO=1,BO=2,zO=3,VO=4,FO=5,XO=6,WO=7,qO=8,Gu=9,jO=10,Z5=11,B5=12,YO=13,z5=14,V5=15,F5=16,X5=17,W5=18,HO=19,q5=20,j5=21,UO=22,Y5=Object.freeze({__proto__:null,InputKeyDownArrowDown:DO,InputKeyDownArrowUp:ZO,InputKeyDownEscape:BO,InputKeyDownHome:zO,InputKeyDownEnd:VO,InputKeyDownPageUp:FO,InputKeyDownPageDown:XO,InputKeyDownEnter:WO,InputChange:qO,InputBlur:Gu,InputFocus:jO,MenuMouseLeave:Z5,ItemMouseMove:B5,ItemClick:YO,ToggleButtonClick:z5,FunctionToggleMenu:V5,FunctionOpenMenu:F5,FunctionCloseMenu:X5,FunctionSetHighlightedIndex:W5,FunctionSelectItem:HO,FunctionSetInputValue:q5,FunctionReset:j5,ControlledPropUpdatedSelectedItem:UO});function GI(n){var e=XI(n),t=e.selectedItem,r=e.inputValue;return r===""&&t&&n.defaultInputValue===void 0&&n.initialInputValue===void 0&&n.inputValue===void 0&&(r=n.itemToString(t)),Ue({},e,{inputValue:r})}Y.array.isRequired,Y.func,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.bool,Y.bool,Y.bool,Y.any,Y.any,Y.any,Y.string,Y.string,Y.string,Y.string,Y.string,Y.string,Y.func,Y.string,Y.string,Y.func,Y.func,Y.func,Y.func,Y.func,Y.func,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});function KI(n,e,t){var r=R.useRef(),i=FI(n,e,t),s=i[0],o=i[1];return R.useEffect(function(){I5(t,"selectedItem")&&(t.selectedItemChanged(r.current,t.selectedItem)&&o({type:UO,inputValue:t.itemToString(t.selectedItem)}),r.current=s.selectedItem===r.current?t.selectedItem:s.selectedItem)},[s.selectedItem,t.selectedItem]),[pg(s,t),o]}var JI=Ue({},Nl,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:QI});function eR(n,e){var t,r=e.type,i=e.props,s=e.altKey,o;switch(r){case YO:o={isOpen:vr(i,"isOpen"),highlightedIndex:vr(i,"highlightedIndex"),selectedItem:i.items[e.index],inputValue:i.itemToString(i.items[e.index])};break;case DO:n.isOpen?o={highlightedIndex:wc(1,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:o={highlightedIndex:s&&n.selectedItem==null?-1:Dl(i,n,1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case ZO:n.isOpen?s?o=Lb(i,n.highlightedIndex):o={highlightedIndex:wc(-1,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:o={highlightedIndex:Dl(i,n,-1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case WO:o=Lb(i,n.highlightedIndex);break;case BO:o=Ue({isOpen:!1,highlightedIndex:-1},!n.isOpen&&{selectedItem:null,inputValue:""});break;case FO:o={highlightedIndex:wc(-10,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case XO:o={highlightedIndex:wc(10,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case zO:o={highlightedIndex:la(1,0,i.items.length,e.getItemNodeFromIndex,!1)};break;case VO:o={highlightedIndex:la(-1,i.items.length-1,i.items.length,e.getItemNodeFromIndex,!1)};break;case Gu:o=Ue({isOpen:!1,highlightedIndex:-1},n.highlightedIndex>=0&&((t=i.items)==null?void 0:t.length)&&e.selectItem&&{selectedItem:i.items[n.highlightedIndex],inputValue:i.itemToString(i.items[n.highlightedIndex])});break;case qO:o={isOpen:!0,highlightedIndex:vr(i,"highlightedIndex"),inputValue:e.inputValue};break;case jO:o={isOpen:!0,highlightedIndex:Dl(i,n,0)};break;case HO:o={selectedItem:e.selectedItem,inputValue:i.itemToString(e.selectedItem)};break;case UO:o={inputValue:e.inputValue};break;default:return HI(n,e,Y5)}return Ue({},n,o)}var tR=["onMouseLeave","refKey","ref"],nR=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],rR=["onClick","onPress","refKey","ref"],iR=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];H5.stateChangeTypes=Y5;function H5(n){n===void 0&&(n={});var e=Ue({},JI,n),t=e.initialIsOpen,r=e.defaultIsOpen,i=e.items,s=e.scrollIntoView,o=e.environment,l=e.getA11yStatusMessage,a=e.getA11ySelectionMessage,c=e.itemToString,u=GI(e),h=KI(eR,u,e),f=h[0],d=h[1],p=f.isOpen,g=f.highlightedIndex,m=f.selectedItem,O=f.inputValue,b=R.useRef(null),x=R.useRef({}),y=R.useRef(null),w=R.useRef(null),k=R.useRef(!0),S=BI(e),v=R.useRef(),T=D5({state:f,props:e}),A=R.useCallback(function(ae){return x.current[S.getItemId(ae)]},[S]);Mb(l,[p,g,O,i],Ue({isInitialMount:k.current,previousResultCount:v.current,items:i,environment:o,itemToString:c},f)),Mb(a,[m],Ue({isInitialMount:k.current,previousResultCount:v.current,items:i,environment:o,itemToString:c},f));var M=jI({menuElement:b.current,highlightedIndex:g,isOpen:p,itemRefs:x,scrollIntoView:s,getItemNodeFromIndex:A});YI({isInitialMount:k.current}),R.useEffect(function(){var ae=t||r||p;ae&&y.current&&y.current.focus()},[]),R.useEffect(function(){k.current||(v.current=i.length)});var L=WI(p,[y,b,w],o,function(){d({type:Gu,selectItem:!1})}),E=qI();R.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),R.useEffect(function(){var ae;if(!p)x.current={};else if(((ae=o.document)==null?void 0:ae.activeElement)!==y.current){var ie;y==null||(ie=y.current)==null||ie.focus()}},[p,o]);var D=R.useMemo(function(){return{ArrowDown:function(ie){ie.preventDefault(),d({type:DO,altKey:ie.altKey,getItemNodeFromIndex:A})},ArrowUp:function(ie){ie.preventDefault(),d({type:ZO,altKey:ie.altKey,getItemNodeFromIndex:A})},Home:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:zO,getItemNodeFromIndex:A}))},End:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:VO,getItemNodeFromIndex:A}))},Escape:function(ie){var ue=T.current.state;(ue.isOpen||ue.inputValue||ue.selectedItem||ue.highlightedIndex>-1)&&(ie.preventDefault(),d({type:BO}))},Enter:function(ie){var ue=T.current.state;!ue.isOpen||ie.which===229||(ie.preventDefault(),d({type:WO,getItemNodeFromIndex:A}))},PageUp:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:FO,getItemNodeFromIndex:A}))},PageDown:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:XO,getItemNodeFromIndex:A}))}}},[d,T,A]),B=R.useCallback(function(ae){return Ue({id:S.labelId,htmlFor:S.inputId},ae)},[S]),J=R.useCallback(function(ae,ie){var ue,Oe=ae===void 0?{}:ae,Ae=Oe.onMouseLeave,St=Oe.refKey,wt=St===void 0?"ref":St,wn=Oe.ref,jt=bl(Oe,tR),Yt=ie===void 0?{}:ie;return Yt.suppressRefError,Ue((ue={},ue[wt]=Sc(wn,function(an){b.current=an}),ue.id=S.menuId,ue.role="listbox",ue["aria-labelledby"]=jt&&jt["aria-label"]?void 0:""+S.labelId,ue.onMouseLeave=Xr(Ae,function(){d({type:Z5})}),ue),jt)},[d,E,S]),U=R.useCallback(function(ae){var ie,ue,Oe=ae===void 0?{}:ae,Ae=Oe.item,St=Oe.index,wt=Oe.refKey,wn=wt===void 0?"ref":wt,jt=Oe.ref,Yt=Oe.onMouseMove,an=Oe.onMouseDown,di=Oe.onClick;Oe.onPress;var cn=Oe.disabled,ar=bl(Oe,nR),Zt=T.current,qi=Zt.props,Dn=Zt.state,Be=zI(Ae,St,qi.items,"Pass either item or index to getItemProps!"),un=Be[1],Z="onClick",V=di,_=function(){un!==Dn.highlightedIndex&&(M.current=!1,d({type:B5,index:un,disabled:cn}))},me=function(){d({type:YO,index:un})},we=function(Zr){return Zr.preventDefault()};return Ue((ie={},ie[wn]=Sc(jt,function(qe){qe&&(x.current[S.getItemId(un)]=qe)}),ie.disabled=cn,ie.role="option",ie["aria-selected"]=""+(un===Dn.highlightedIndex),ie.id=S.getItemId(un),ie),!cn&&(ue={},ue[Z]=Xr(V,me),ue),{onMouseMove:Xr(Yt,_),onMouseDown:Xr(an,we)},ar)},[d,T,M,S]),le=R.useCallback(function(ae){var ie,ue=ae===void 0?{}:ae,Oe=ue.onClick;ue.onPress;var Ae=ue.refKey,St=Ae===void 0?"ref":Ae,wt=ue.ref,wn=bl(ue,rR),jt=T.current.state,Yt=function(){d({type:z5})};return Ue((ie={},ie[St]=Sc(wt,function(an){w.current=an}),ie["aria-controls"]=S.menuId,ie["aria-expanded"]=jt.isOpen,ie.id=S.toggleButtonId,ie.tabIndex=-1,ie),!wn.disabled&&Ue({},{onClick:Xr(Oe,Yt)}),wn)},[d,T,S]),te=R.useCallback(function(ae,ie){var ue,Oe=ae===void 0?{}:ae,Ae=Oe.onKeyDown,St=Oe.onChange,wt=Oe.onInput,wn=Oe.onFocus,jt=Oe.onBlur;Oe.onChangeText;var Yt=Oe.refKey,an=Yt===void 0?"ref":Yt,di=Oe.ref,cn=bl(Oe,iR),ar=ie===void 0?{}:ie;ar.suppressRefError;var Zt=T.current.state,qi=function(we){var qe=$I(we);qe&&D[qe]&&D[qe](we)},Dn=function(we){d({type:qO,inputValue:we.target.value})},Be=function(we){if(Zt.isOpen&&!L.current.isMouseDown){var qe=we.relatedTarget===null&&o.document.activeElement!==o.document.body;d({type:Gu,selectItem:!qe})}},un=function(){Zt.isOpen||d({type:jO})},Z="onChange",V={};if(!cn.disabled){var _;V=(_={},_[Z]=Xr(St,wt,Dn),_.onKeyDown=Xr(Ae,qi),_.onBlur=Xr(jt,Be),_.onFocus=Xr(wn,un),_)}return Ue((ue={},ue[an]=Sc(di,function(me){y.current=me}),ue["aria-activedescendant"]=Zt.isOpen&&Zt.highlightedIndex>-1?S.getItemId(Zt.highlightedIndex):"",ue["aria-autocomplete"]="list",ue["aria-controls"]=S.menuId,ue["aria-expanded"]=Zt.isOpen,ue["aria-labelledby"]=cn&&cn["aria-label"]?void 0:""+S.labelId,ue.autoComplete="off",ue.id=S.inputId,ue.role="combobox",ue.value=Zt.inputValue,ue),V,cn)},[E,T,S,D,d,L,o]),Q=R.useCallback(function(){d({type:V5})},[d]),fe=R.useCallback(function(){d({type:X5})},[d]),de=R.useCallback(function(){d({type:F5})},[d]),$=R.useCallback(function(ae){d({type:W5,highlightedIndex:ae})},[d]),ye=R.useCallback(function(ae){d({type:HO,selectedItem:ae})},[d]),ke=R.useCallback(function(ae){d({type:q5,inputValue:ae})},[d]),pe=R.useCallback(function(){d({type:j5})},[d]);return{getItemProps:U,getLabelProps:B,getMenuProps:J,getInputProps:te,getToggleButtonProps:le,toggleMenu:Q,openMenu:de,closeMenu:fe,setHighlightedIndex:$,setInputValue:ke,selectItem:ye,reset:pe,highlightedIndex:g,isOpen:p,selectedItem:m,inputValue:O}}Y.array,Y.array,Y.array,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.func,Y.func,Y.string,Y.string,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});Nl.itemToString,Nl.stateReducer,Nl.environment;const Ib=20,U5=n=>n.suggestions.length>0?C.createElement(sR,{...n}):C.createElement("input",{className:H.textInput,size:40,autoFocus:!0,...n.register(n.inputName)}),sR=({autofocus:n,suggestions:e,control:t,inputName:r,placeholder:i,initialInputValue:s,setValue:o})=>{const[l,a]=C.useState(e.slice(0,Ib)),c=nn(rr),u=e.length>0,{isOpen:h,getToggleButtonProps:f,getMenuProps:d,getInputProps:p,highlightedIndex:g,getItemProps:m,selectedItem:O}=H5({initialInputValue:s,onInputValueChange({inputValue:x=""}){o(r,x),x=x.toLowerCase()||"";const y=[];for(const w of e)if(w.toLowerCase().includes(x)&&(y.push(w),y.length>=Ib))break;a(y)},items:l,itemToString(x){return x??""}}),b=h&&l.length>0;return C.createElement("div",{className:H.downshiftAutocompleteContainer},C.createElement("div",{"data-visible-dropdown":b,className:H.downshiftInputWrapper},C.createElement(b9,{name:r,control:t,render:({field:x})=>{const y=p();return C.createElement("input",{...y,name:x.name,placeholder:i,className:H.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:n})}}),u&&C.createElement("button",{"aria-label":"toggle menu",type:"button",...f()},c("arrow_drop_down"))),C.createElement("div",{className:H.downshiftAutocompleteContainer},C.createElement("ul",{...d(),"data-visible":b},l.map((x,y)=>C.createElement("li",{"data-selected":O===x,"data-highlighted":g===y,key:`${x}${y}`,...m({item:x,index:y})},x)))))},oR=()=>{const[n,e,t,r]=Wt(gg,us,Wa,Si),i=ut(tC),s=ut(J5),o=kn(),{register:l,handleSubmit:a,control:c,setValue:u,reset:h}=rw({values:e.type==="editing"?e.initialValues:{}});return e.type==="inactive"?null:C.createElement(d9,{open:!0,onOpenChange:f=>{f||(s(),h({src:"",title:"",altText:""}))}},C.createElement(p9,{container:t?.current},C.createElement(g9,{className:H.dialogOverlay}),C.createElement(m9,{className:H.dialogContent,onOpenAutoFocus:f=>{f.preventDefault()}},C.createElement(O9,null,o("uploadImage.dialogTitle","Upload an image")),C.createElement("form",{onSubmit:async f=>{f.preventDefault(),f.stopPropagation(),await a(i)(f),h({src:"",title:"",altText:""})},className:H.multiFieldForm},r===null?C.createElement("input",{type:"hidden",accept:"image/*",...l("file")}):C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"file"},o("uploadImage.uploadInstructions","Upload an image from your device:")),C.createElement("input",{type:"file",accept:"image/*",...l("file")})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"src"},r!==null?o("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):o("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),C.createElement(U5,{register:l,initialInputValue:e.type==="editing"?e.initialValues.src??"":"",inputName:"src",suggestions:n,setValue:u,control:c,placeholder:o("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"alt"},o("uploadImage.alt","Alt:")),C.createElement("input",{type:"text",...l("altText"),className:H.textInput})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"title"},o("uploadImage.title","Title:")),C.createElement("input",{type:"text",...l("title"),className:H.textInput})),C.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},C.createElement("button",{type:"submit",title:o("dialogControls.save","Save"),"aria-label":o("dialogControls.save","Save"),className:Me(H.primaryButton)},o("dialogControls.save","Save")),C.createElement(x9,{asChild:!0},C.createElement("button",{type:"reset",title:o("dialogControls.cancel","Cancel"),"aria-label":o("dialogControls.cancel","Cancel"),className:Me(H.secondaryButton)},o("dialogControls.cancel","Cancel"))))))))};function cd(n,e,t){return Math.min(Math.max(n,e),t)}const ze={east:1,north:8,south:2,west:4};function lR({onResizeStart:n,onResizeEnd:e,imageRef:t,maxWidth:r,editor:i}){const s=R.useRef(null),o=R.useRef({priority:"",value:"default"}),l=R.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),a=i.getRootElement(),c=r||(a!==null?a.getBoundingClientRect().width-20:100),u=a!==null?a.getBoundingClientRect().height-20:100,h=100,f=100,d=b=>{const x=b===ze.east||b===ze.west,y=b===ze.north||b===ze.south,w=b&ze.north&&b&ze.west||b&ze.south&&b&ze.east,k=x?"ew":y?"ns":w?"nwse":"nesw";a!==null&&a.style.setProperty("cursor",`${k}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${k}-resize`,"important"),o.current.value=document.body.style.getPropertyValue("-webkit-user-select"),o.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},p=()=>{a!==null&&a.style.setProperty("cursor","text"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",o.current.value,o.current.priority))},g=(b,x)=>{if(!i.isEditable())return;const y=t.current,w=s.current;if(y!==null&&w!==null){b.preventDefault();const{width:k,height:S}=y.getBoundingClientRect(),v=l.current;v.startWidth=k,v.startHeight=S,v.ratio=k/S,v.currentWidth=k,v.currentHeight=S,v.startX=b.clientX,v.startY=b.clientY,v.isResizing=!0,v.direction=x,d(x),n(),w.classList.add(H.imageControlWrapperResizing),y.style.height=`${S}px`,y.style.width=`${k}px`,document.addEventListener("pointermove",m),document.addEventListener("pointerup",O)}},m=b=>{const x=t.current,y=l.current,w=y.direction&(ze.east|ze.west),k=y.direction&(ze.south|ze.north);if(x!==null&&y.isResizing)if(w&&k){let S=Math.floor(y.startX-b.clientX);S=y.direction&ze.east?-S:S;const v=cd(y.startWidth+S,h,c),T=v/y.ratio;x.style.width=`${v}px`,x.style.height=`${T}px`,y.currentHeight=T,y.currentWidth=v}else if(k){let S=Math.floor(y.startY-b.clientY);S=y.direction&ze.south?-S:S;const v=cd(y.startHeight+S,f,u);x.style.height=`${v}px`,y.currentHeight=v}else{let S=Math.floor(y.startX-b.clientX);S=y.direction&ze.east?-S:S;const v=cd(y.startWidth+S,h,c);x.style.width=`${v}px`,y.currentWidth=v}},O=()=>{const b=t.current,x=l.current,y=s.current;if(b!==null&&y!==null&&x.isResizing){const w=x.currentWidth,k=x.currentHeight;x.startWidth=0,x.startHeight=0,x.ratio=0,x.startX=0,x.startY=0,x.currentWidth=0,x.currentHeight=0,x.isResizing=!1,y.classList.remove(H.imageControlWrapperResizing),p(),e(w,k),document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",O)}};return R.createElement("div",{ref:s},R.createElement("div",{className:Me(H.imageResizer,H.imageResizerN),onPointerDown:b=>{g(b,ze.north)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerNe),onPointerDown:b=>{g(b,ze.north|ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerE),onPointerDown:b=>{g(b,ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerSe),onPointerDown:b=>{g(b,ze.south|ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerS),onPointerDown:b=>{g(b,ze.south)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerSw),onPointerDown:b=>{g(b,ze.south|ze.west)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerW),onPointerDown:b=>{g(b,ze.west)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerNw),onPointerDown:b=>{g(b,ze.north|ze.west)}}))}const aR="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
|
|
59
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return G.jsx(XM,{nodeKey:this.__key})}};function WM(){return{node:Xo()}}function Xo(){return on(new qa)}function df(n){return n instanceof qa}function qM(){const[n]=Nt();return R.useEffect((()=>n.registerCommand(Yv,(e=>{const t=X();if(!z(t))return!1;if(t.focus.getNode()!==null){const r=Xo();w2(r)}return!0}),Ce)),[n]),null}const jM={testLexicalNode:df,visitLexicalNode({actions:n}){n.addAndStepInto("thematicBreak")}},YM={testNode:"thematicBreak",visitNode({actions:n}){n.addAndStepInto(Xo())}},HM=Ni(n=>{n.sub(n.pipe(HM,Je(st)),([,e])=>{e?.dispatchCommand(Yv,void 0)})}),UM=Ln({init(n){n.pubIn({[Fo]:"thematicBreak",[oi]:YM,[Vi]:qa,[Fi]:jM,[Qs]:qM})}});function mr(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sg(n){let e=1,t=n.getParent();for(;t!=null;){if(_e(t)){const r=t.getParent();if(xe(r)){e++,t=r.getParent();continue}mr(40)}return e}return e}function og(n){let e=n.getParent();xe(e)||mr(40);let t=e;for(;t!==null;)t=t.getParent(),xe(t)&&(e=t);return e}function Uv(n){let e=[];const t=n.getChildren().filter(_e);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();xe(s)?e=e.concat(Uv(s)):e.push(i)}return e}function Or(n){return _e(n)&&xe(n.getFirstChild())}function ib(n){return Rt().append(n)}function Gv(n,e){return _e(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function lg(n){const e=X();if(e!==null){let t=e.getNodes();if(z(e)){const i=e.getStartEndPoints();i===null&&mr(143);const[s]=i,o=s.getNode(),l=o.getParent();if(et(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const c=Re();o.append(c),t=c.select().getNodes()}}else if(Gv(o,t)){const a=Lt(n);if(et(l)){o.replace(a);const c=Rt();I(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(_e(o)){const c=o.getParentOrThrow();ks(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(!I(s)||!s.isEmpty()||_e(s)||r.has(s.getKey())){if(r2(s)){let o=s.getParent();for(;o!=null;){const l=o.getKey();if(xe(o)){if(!r.has(l)){const a=Lt(n);ks(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(et(a)&&!r.has(l)){r.add(l),sb(o,n);break}o=a}}}}else sb(s,n)}}}function ks(n,e){n.splice(n.getChildrenSize(),0,e)}function sb(n,e){if(xe(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=Rt();let s;if(ks(i,n.getChildren()),xe(t)&&e===t.getListType())t.append(i),xe(r)&&e===r.getListType()&&(ks(t,r.getChildren()),r.remove()),s=t;else if(xe(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const o=Lt(e);o.append(i),n.replace(o),s=o}return i.setFormat(n.getFormatType()),i.setIndent(n.getIndent()),n.remove(),s}function $O(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&Or(t)&&Or(r)&&($O(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function GM(){const n=X();if(z(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Gv(r,t))e.add(og(r));else for(let i=0;i<t.length;i++){const s=t[i];if(r2(s)){const o=S2(s,ir);o!=null&&e.add(og(o))}}for(const i of e){let s=i;const o=Uv(i);for(const l of o){const a=Re().setTextStyle(n.style).setTextFormat(n.format);ks(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&ys(n.anchor,Tn(Mr(a,"next"))),l.__key===n.focus.key&&ys(n.focus,Tn(Mr(a,"next"))),l.remove()}i.remove()}}}function KM(n){const e=new Set;if(Or(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(Or(r)&&Or(i)){const s=i.getFirstChild();if(xe(s)){s.append(n);const o=r.getFirstChild();xe(o)&&(ks(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Or(r)){const s=r.getFirstChild();if(xe(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(Or(i)){const s=i.getFirstChild();xe(s)&&s.append(n)}else if(xe(t)){const s=Rt().setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle()),o=Lt(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function JM(n){if(Or(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(xe(t?t.getParent():void 0)&&_e(t)&&xe(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=Rt(),l=Lt(s);o.append(l),n.getPreviousSiblings().forEach((u=>l.append(u)));const a=Rt(),c=Lt(s);a.append(c),ks(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function eL(){const n=X();if(!z(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!_e(e)||e.getChildrenSize()!==0)return!1;const t=og(e),r=e.getParent();xe(r)||mr(40);const i=r.getParent();let s;if(et(i))s=Re(),t.insertAfter(s);else{if(!_e(i))return!1;s=Rt(),i.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const o=e.getNextSiblings();if(o.length>0){const l=Lt(r.getListType());if(_e(s)){const a=Rt();a.append(l),s.insertAfter(a)}else s.insertAfter(l);l.append(...o)}return(function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const c=a.getParent();if(c==null||!_e(c)&&!xe(c))break;a=c}a.remove()})(e),!0}function Yu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}class ir extends nr{static getType(){return"listitem"}static clone(e){return new ir(e.__value,e.__checked,e.__key)}constructor(e,t,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),r=this.getParent();xe(r)&&r.getListType()==="check"&&lb(t,this,null),t.value=this.__value,ob(t,e.theme,this);const i=this.__style||this.__textStyle;return i&&(t.style.cssText=i),t}updateDOM(e,t,r){const i=this.getParent();xe(i)&&i.getListType()==="check"&&lb(t,this,e),t.value=this.__value,ob(t,r.theme,this);const s=e.__style||e.__textStyle,o=this.__style||this.__textStyle;return s!==o&&(t.style.cssText=o,o===""&&t.removeAttribute("style")),!1}static transform(){return e=>{if(_e(e)||mr(144),e.__checked==null)return;const t=e.getParent();xe(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:tL,priority:0})}}static importJSON(e){return Rt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config);t.style.textAlign=this.getFormatType();const r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(I(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(_e(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!xe(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=Lt(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(I(e)||mr(139),this.getChildren().forEach((i=>{e.append(i)}))),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(xe(r)||mr(39),_e(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=Lt(r.getListType());i.forEach((o=>s.append(o))),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&Or(t)&&Or(r)&&($O(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=Rt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Re();this.getChildren().forEach((o=>t.append(o)));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=_e(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return xe(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;_e(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&mr(117),(e=Math.floor(e))>=0||mr(199);let t=this.getIndent();for(;t!==e;)t<e?(KM(this),t++):(JM(this),t--);return this}canInsertAfter(e){return _e(e)}canReplaceWith(e){return _e(e)}canMergeWith(e){return _e(e)||tO(e)}extractWithChild(e,t){if(!z(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Lt("bullet")}canMergeWhenEmpty(){return!0}}function ob(n,e,t){const r=[],i=[],s=e.list,o=s?s.listitem:void 0;let l;if(s&&s.nested&&(l=s.nested.listitem),o!==void 0&&r.push(...Yu(o)),s){const a=t.getParent(),c=xe(a)&&a.getListType()==="check",u=t.getChecked();c&&!u||i.push(s.listitemUnchecked),c&&u||i.push(s.listitemChecked),c&&r.push(u?s.listitemChecked:s.listitemUnchecked)}if(l!==void 0){const a=Yu(l);t.getChildren().some((c=>xe(c)))?r.push(...a):i.push(...a)}i.length>0&&rf(n,...i),r.length>0&&Kn(n,...r)}function lb(n,e,t,r){xe(e.getFirstChild())?(n.removeAttribute("role"),n.removeAttribute("tabIndex"),n.removeAttribute("aria-checked")):(n.setAttribute("role","checkbox"),n.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||n.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function tL(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return nL(t)}const e=n.getAttribute("aria-checked");return{node:Rt(e==="true"||e!=="false"&&void 0)}}function nL(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Rt(n.hasAttribute("checked"))}}function Rt(n){return on(new ir(void 0,n))}function _e(n){return n instanceof ir}class Nr extends nr{static getType(){return"list"}static clone(e){const t=e.__listType||ub[e.__tag];return new Nr(t,e.__start,e.__key)}constructor(e="number",t=1,r){super(r);const i=ub[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,ab(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||(ab(t,r.theme,this),!1)}static transform(){return e=>{xe(e)||mr(163),(function(t){const r=t.getNextSibling();xe(r)&&t.getListType()===r.getListType()&&$O(t,r)})(e),(function(t){const r=t.getListType()!=="check";let i=t.getStart();for(const s of t.getChildren())_e(s)&&(s.getValue()!==i&&s.setValue(i),r&&s.getLatest().__checked!=null&&s.setChecked(void 0),xe(s.getFirstChild())||i++)})(e)}}static importDOM(){return{ol:()=>({conversion:cb,priority:0}),ul:()=>({conversion:cb,priority:0})}}static importJSON(e){return Lt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return nt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(_e(r))super.append(r);else{const i=Rt();if(xe(r))i.append(r);else if(I(r))if(r.isInline())i.append(r);else{const s=He(r.getTextContent());i.append(s)}else i.append(r);super.append(i)}}return this}extractWithChild(e){return _e(e)}}function ab(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=sg(t)-1,a=l%o.length,c=o[a],u=s[t.__tag];let h;const f=s.nested,d=s.checklist;if(f!==void 0&&f.list&&(h=f.list),u!==void 0&&r.push(u),d!==void 0&&t.__listType==="check"&&r.push(d),c!==void 0){r.push(...Yu(c));for(let p=0;p<o.length;p++)p!==a&&i.push(t.__tag+p)}if(h!==void 0){const p=Yu(h);l>1?r.push(...p):i.push(...p)}}i.length>0&&rf(n,...i),r.length>0&&Kn(n,...r)}function rL(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(_e(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach((s=>{xe(s)&&e.push(ib(s))}))}else e.push(ib(r))}return e}function cb(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=Lt("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list"))return!0;for(const i of r.childNodes)if(nt(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?Lt("check"):Lt("bullet")),{after:rL,node:t}}const ub={ol:"number",ul:"bullet"};function Lt(n="number",e=1){return on(new Nr(n,e))}function xe(n){return n instanceof Nr}const Kv=ci(),Jv=ci(),e5=ci(),t5=ci();function iL(n){return ln(n.registerCommand(Jv,(()=>(lg("number"),!0)),Ye),n.registerCommand(Kv,(()=>(lg("bullet"),!0)),Ye),n.registerCommand(t5,(()=>(GM(),!0)),Ye),n.registerCommand(Gl,(()=>eL()),Ye),n.registerNodeTransform(ir,(e=>{const t=e.getFirstChild();if(t){if(q(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=X();z(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}})),n.registerNodeTransform(Rr,(e=>{const t=e.getParent();if(_e(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}})))}function sL(n,e){n.update((()=>lg(e)))}const oL={testNode:"list",visitNode:function({mdastNode:n,lexicalParent:e,actions:t}){const r=n.children.some(s=>typeof s.checked=="boolean")?"check":n.ordered?"number":"bullet",i=Lt(r);if(_e(e)){const s=Rt();s.append(i),e.insertAfter(s)}else e.append(i);t.visitChildren(n,i)}},lL={testNode:"listItem",visitNode({mdastNode:n,actions:e,lexicalParent:t}){const r=t.getListType()==="check"?n.checked??!1:void 0;e.addAndStepInto(Rt(r))}},aL={testLexicalNode:xe,visitLexicalNode:({lexicalNode:n,actions:e})=>{e.addAndStepInto("list",{ordered:n.getListType()==="number",spread:!1})}},cL={testLexicalNode:_e,visitLexicalNode:({lexicalNode:n,mdastParent:e,actions:t})=>{const r=n.getChildren(),i=r[0];if(r.length===1&&xe(i)){const s=e.children.at(-1);s?t.visitChildren(n,s):t.visitChildren(i,e)}else{const s=n.getParent(),o=t.appendToParent(e,{type:"listItem",checked:s.getListType()==="check"?!!n.getChecked():void 0,spread:!1,children:[]});let l=null;for(const a of n.getChildren())q(a)||Hn(a)||a.isInline()&&(I(a)||Qe(a))?(l||(l=t.appendToParent(o,{type:"paragraph",children:[]})),t.visit(a,l)):(l=null,t.visit(a,o))}}};function uL(n,e){return ln(n.registerCommand(Fm,(t=>{const r=X();if(!z(r))return!1;t.preventDefault();const i=(function(s){const o=s.getNodes();if(_$(o,(f=>Nu(f)&&f.canIndent()?f:null)).length>0)return!0;const l=s.anchor,a=s.focus,c=a.isBefore(l)?a:l,u=c.getNode(),h=Rp(u);if(h.canIndent()){const f=h.getKey();let d=Ra();if(d.anchor.set(f,0,"element"),d.focus.set(f,0,"element"),d=gs(d),d.anchor.is(c))return!0}return!1})(r)?t.shiftKey?kp:Iu:Mw;return n.dispatchCommand(i,void 0)}),Ce),n.registerCommand(Iu,(()=>{if(e==null)return!1;const t=X();if(!z(t))return!1;const r=t.getNodes().map((i=>Rp(i).getIndent()));return Math.max(...r)+1>=e}),si))}function hb({maxIndent:n}){const[e]=Nt();return R.useEffect((()=>uL(e,n)),[e,n]),null}function fb(){const[n]=Nt();return R.useEffect((()=>ln(n.registerCommand(e5,(()=>(sL(n,"check"),!0)),Ye),n.registerCommand(zm,(e=>gb(e,n,!1)),Ye),n.registerCommand(Bm,(e=>gb(e,n,!0)),Ye),n.registerCommand(Ma,(e=>{if(ag()!=null){const t=n.getRootElement();return t?.focus(),!0}return!1}),Ye),n.registerCommand(Vm,(e=>{const t=ag();return!(t==null||!n.isEditable())&&(n.update((()=>{const r=Ar(t);_e(r)&&(e.preventDefault(),r.toggleChecked())})),!0)}),Ye),n.registerCommand(Zm,(e=>n.getEditorState().read((()=>{const t=X();if(z(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=Zi(s,(l=>I(l)&&!l.isInline()));if(_e(o)){const l=o.getParent();if(xe(l)&&l.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const a=n.getElementByKey(o.__key);if(a!=null&&document.activeElement!==a)return a.focus(),e.preventDefault(),!0}}}}return!1}))),Ye),n.registerRootListener(((e,t)=>{e!==null&&(e.addEventListener("click",db),e.addEventListener("pointerdown",pb)),t!==null&&(t.removeEventListener("click",db),t.removeEventListener("pointerdown",pb))}))))),null}function n5(n,e){const t=n.target;if(!nt(t))return;const r=t.firstChild;if(nt(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=n.pageX/P$(t);(t.dir==="rtl"?o<s.right&&o>s.right-20:o>s.left&&o<s.left+20)&&e()}function db(n){n5(n,(()=>{if(nt(n.target)){const e=n.target,t=iO(e);t!=null&&t.isEditable()&&t.update((()=>{const r=Ar(e);_e(r)&&(e.focus(),r.toggleChecked())}))}}))}function pb(n){n5(n,(()=>{n.preventDefault()}))}function ag(){const n=document.activeElement;return nt(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function gb(n,e,t){const r=ag();return r!=null&&e.update((()=>{const i=Ar(r);if(!_e(i))return;const s=(function(o,l){let a=l?o.getPreviousSibling():o.getNextSibling(),c=o;for(;a==null&&_e(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;_e(a);){const u=l?a.getLastChild():a.getFirstChild();if(!xe(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout((()=>{o.focus()}),0))}})),!1}function mb(){const[n]=Nt();return R.useEffect((()=>{if(!n.hasNodes([Nr,ir]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[n]),(function(e){R.useEffect((()=>iL(e)),[e])})(n),null}const hL={name:"tasklistCheck",tokenize:dL};function fL(){return{text:{91:hL}}}function dL(n,e,t){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),s)}function s(a){return rt(a)?(n.enter("taskListCheckValueUnchecked"),n.consume(a),n.exit("taskListCheckValueUnchecked"),o):a===88||a===120?(n.enter("taskListCheckValueChecked"),n.consume(a),n.exit("taskListCheckValueChecked"),o):t(a)}function o(a){return a===93?(n.enter("taskListCheckMarker"),n.consume(a),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),l):t(a)}function l(a){return he(a)?e(a):Te(a)?n.check({tokenize:pL},e,t)(a):t(a)}}function pL(n,e,t){return Ie(n,r,"whitespace");function r(i){return i===null?t(i):e(i)}}function gL(){return{exit:{taskListCheckValueChecked:Ob,taskListCheckValueUnchecked:Ob,paragraph:OL}}}function mL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xL}}}function Ob(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function OL(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){o=l;break}}o===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(n)}function xL(n,e,t,r){const i=n.children[0],s=typeof n.checked=="boolean"&&i&&i.type==="paragraph",o="["+(n.checked?"x":" ")+"] ",l=t.createTracker(r);s&&l.move(o);let a=K2.listItem(n,e,t,{...r,...l.current()});return s&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(u){return u+o}}const bL=new Map([["number",Jv],["bullet",Kv],["check",e5],["",t5]]),cg=oe("",n=>{n.sub(n.pipe(xo,Je(st)),([e,t])=>{if(!e||!t)return;const r=e.anchor.getNode();let i=r.getKey()==="root"?r:Zi(r,l=>{const a=l.getParent();return a!==null&&et(a)});i===null&&(i=r.getTopLevelElementOrThrow());const s=i.getKey();if(t.getElementByKey(s)!==null)if(xe(i)){const l=S2(r,Nr),a=l?l.getListType():i.getListType();n.pub(cg,a)}else n.pub(cg,"")})}),r5=bt(n=>{n.sub(n.pipe(r5,Je(st)),([e,t])=>{t?.dispatchCommand(bL.get(e),void 0)})}),yL=Ln({init(n){var e;(e=n.getValue(zi))==null||e.registerCommand(Iu,()=>!SL(7),si),n.pubIn({[Fo]:"lists",[tg]:gL(),[eg]:fL(),[oi]:[oL,lL],[Vi]:[ir,Nr],[Fi]:[aL,cL],[_v]:mL(),[Qs]:[hb,mb,fb],[Dv]:[hb,mb,fb]})}});function kL(n){const e=n.getNodes();return e.length===0?new Set([n.anchor.getNode().getParentOrThrow(),n.focus.getNode().getParentOrThrow()]):new Set(e.map(t=>I(t)?t:t.getParentOrThrow()))}function SL(n){const e=X();if(!z(e))return!1;const t=kL(e);let r=0;for(const i of t)if(xe(i))r=Math.max(sg(i)+1,r);else if(_e(i)){const s=i.getParent();if(s?.getChildren().length===1){const o=s.getParent();if(_e(o)&&o.getChildren().length===1)return!1}if(!xe(s))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(sg(s)+1,r)}return r<=n}var td="rovingFocusGroup.onEntryFocus",wL={bubbles:!1,cancelable:!0},ja="RovingFocusGroup",[ug,i5,vL]=y9(ja),[CL,pf]=Qm(ja,[vL]),[TL,_L]=CL(ja),s5=R.forwardRef((n,e)=>G.jsx(ug.Provider,{scope:n.__scopeRovingFocusGroup,children:G.jsx(ug.Slot,{scope:n.__scopeRovingFocusGroup,children:G.jsx(PL,{...n,ref:e})})}));s5.displayName=ja;var PL=R.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=n,f=R.useRef(null),d=N9(e,f),p=Pm(s),[g,m]=Rh({prop:o,defaultProp:l??null,onChange:a,caller:ja}),[O,b]=R.useState(!1),x=f9(c),y=i5(t),w=R.useRef(!1),[k,S]=R.useState(0);return R.useEffect(()=>{const v=f.current;if(v)return v.addEventListener(td,x),()=>v.removeEventListener(td,x)},[x]),G.jsx(TL,{scope:t,orientation:r,dir:p,loop:i,currentTabStopId:g,onItemFocus:R.useCallback(v=>m(v),[m]),onItemShiftTab:R.useCallback(()=>b(!0),[]),onFocusableItemAdd:R.useCallback(()=>S(v=>v+1),[]),onFocusableItemRemove:R.useCallback(()=>S(v=>v-1),[]),children:G.jsx(ri.div,{tabIndex:O||k===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...n.style},onMouseDown:vi(n.onMouseDown,()=>{w.current=!0}),onFocus:vi(n.onFocus,v=>{const T=!w.current;if(v.target===v.currentTarget&&T&&!O){const A=new CustomEvent(td,wL);if(v.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=y().filter(J=>J.focusable),L=M.find(J=>J.active),E=M.find(J=>J.id===g),B=[L,E,...M].filter(Boolean).map(J=>J.ref.current);a5(B,u)}}w.current=!1}),onBlur:vi(n.onBlur,()=>b(!1))})})}),o5="RovingFocusGroupItem",l5=R.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...l}=n,a=h9(),c=s||a,u=_L(o5,t),h=u.currentTabStopId===c,f=i5(t),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:g}=u;return R.useEffect(()=>{if(r)return d(),()=>p()},[r,d,p]),G.jsx(ug.ItemSlot,{scope:t,id:c,focusable:r,active:i,children:G.jsx(ri.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...l,ref:e,onMouseDown:vi(n.onMouseDown,m=>{r?u.onItemFocus(c):m.preventDefault()}),onFocus:vi(n.onFocus,()=>u.onItemFocus(c)),onKeyDown:vi(n.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const O=EL(m,u.orientation,u.dir);if(O!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=f().filter(y=>y.focusable).map(y=>y.ref.current);if(O==="last")x.reverse();else if(O==="prev"||O==="next"){O==="prev"&&x.reverse();const y=x.indexOf(m.currentTarget);x=u.loop?AL(x,y+1):x.slice(y+1)}setTimeout(()=>a5(x))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});l5.displayName=o5;var QL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $L(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function EL(n,e,t){const r=$L(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QL[r]}function a5(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function AL(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var c5=s5,EO=l5,ML="Separator",xb="horizontal",LL=["horizontal","vertical"],u5=R.forwardRef((n,e)=>{const{decorative:t,orientation:r=xb,...i}=n,s=IL(r)?r:xb,l=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return G.jsx(ri.div,{"data-orientation":s,...l,...i,ref:e})});u5.displayName=ML;function IL(n){return LL.includes(n)}var RL=u5,h5="Toggle",f5=R.forwardRef((n,e)=>{const{pressed:t,defaultPressed:r,onPressedChange:i,...s}=n,[o,l]=Rh({prop:t,onChange:i,defaultProp:r??!1,caller:h5});return G.jsx(ri.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...s,ref:e,onClick:vi(n.onClick,()=>{n.disabled||l(!o)})})});f5.displayName=h5;var Xi="ToggleGroup",[d5,p5]=Qm(Xi,[pf]),g5=pf(),AO=C.forwardRef((n,e)=>{const{type:t,...r}=n;if(t==="single"){const i=r;return G.jsx(NL,{...i,ref:e})}if(t==="multiple"){const i=r;return G.jsx(DL,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Xi}\``)});AO.displayName=Xi;var[m5,O5]=d5(Xi),NL=C.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=Rh({prop:t,defaultProp:r??"",onChange:i,caller:Xi});return G.jsx(m5,{scope:n.__scopeToggleGroup,type:"single",value:C.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:C.useCallback(()=>l(""),[l]),children:G.jsx(x5,{...s,ref:e})})}),DL=C.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=Rh({prop:t,defaultProp:r??[],onChange:i,caller:Xi}),a=C.useCallback(u=>l((h=[])=>[...h,u]),[l]),c=C.useCallback(u=>l((h=[])=>h.filter(f=>f!==u)),[l]);return G.jsx(m5,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:a,onItemDeactivate:c,children:G.jsx(x5,{...s,ref:e})})});AO.displayName=Xi;var[ZL,BL]=d5(Xi),x5=C.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:l=!0,...a}=n,c=g5(t),u=Pm(o),h={role:"group",dir:u,...a};return G.jsx(ZL,{scope:t,rovingFocus:i,disabled:r,children:i?G.jsx(c5,{asChild:!0,...c,orientation:s,dir:u,loop:l,children:G.jsx(ri.div,{...h,ref:e})}):G.jsx(ri.div,{...h,ref:e})})}),Hu="ToggleGroupItem",b5=C.forwardRef((n,e)=>{const t=O5(Hu,n.__scopeToggleGroup),r=BL(Hu,n.__scopeToggleGroup),i=g5(n.__scopeToggleGroup),s=t.value.includes(n.value),o=r.disabled||n.disabled,l={...n,pressed:s,disabled:o},a=C.useRef(null);return r.rovingFocus?G.jsx(EO,{asChild:!0,...i,focusable:!o,active:s,ref:a,children:G.jsx(bb,{...l,ref:e})}):G.jsx(bb,{...l,ref:e})});b5.displayName=Hu;var bb=C.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:r,...i}=n,s=O5(Hu,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return G.jsx(f5,{...l,...i,ref:e,onPressedChange:a=>{a?s.onItemActivate(r):s.onItemDeactivate(r)}})}),zL=AO,VL=b5,MO="Toolbar",[FL]=Qm(MO,[pf,p5]),LO=pf(),y5=p5(),[XL,k5]=FL(MO),S5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,orientation:r="horizontal",dir:i,loop:s=!0,...o}=n,l=LO(t),a=Pm(i);return G.jsx(XL,{scope:t,orientation:r,dir:a,children:G.jsx(c5,{asChild:!0,...l,orientation:r,dir:a,loop:s,children:G.jsx(ri.div,{role:"toolbar","aria-orientation":r,dir:a,...o,ref:e})})})});S5.displayName=MO;var w5="ToolbarSeparator",v5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=k5(w5,t);return G.jsx(RL,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});v5.displayName=w5;var WL="ToolbarButton",IO=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=LO(t);return G.jsx(EO,{asChild:!0,...i,focusable:!n.disabled,children:G.jsx(ri.button,{type:"button",...r,ref:e})})});IO.displayName=WL;var qL="ToolbarLink",jL=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=LO(t);return G.jsx(EO,{asChild:!0,...i,focusable:!0,children:G.jsx(ri.a,{...r,ref:e,onKeyDown:vi(n.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});jL.displayName=qL;var C5="ToolbarToggleGroup",T5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=k5(C5,t),s=y5(t);return G.jsx(zL,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});T5.displayName=C5;var YL="ToolbarToggleItem",_5=R.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=y5(t),s={__scopeToolbar:n.__scopeToolbar};return G.jsx(IO,{asChild:!0,...s,children:G.jsx(VL,{...i,...r,ref:e})})});_5.displayName=YL;var HL=S5,UL=v5,P5=IO,RO=T5,GL=_5;const KL=new Set(["http:","https:","mailto:","sms:","tel:"]);class hi extends nr{static getType(){return"link"}static clone(e){return new hi(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Kn(t,e.theme.link),t}updateDOM(e,t,r){if(d2(t)){const i=this.__url,s=this.__target,o=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),s!==e.__target&&(s?t.target=s:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:JL,priority:1})}}static importJSON(e){return Ss().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{const t=new URL(e);if(!KL.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=Ss(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!z(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function JL(n){let e=null;if(d2(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=Ss(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function Ss(n="",e){return on(new hi(n,e))}function xr(n){return n instanceof hi}class Wo extends hi{constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new Wo(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return hg().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(I(r)){const i=hg(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function hg(n="",e){return on(new Wo(n,e))}function Ji(n){return n instanceof Wo}const yo=ci();function yb(n,e){if(n.type==="element"){const t=n.getNode();return I(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const l of i)o.append("v",l);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function nd(n,e={}){const{target:t,title:r}=e,i=e.rel===void 0?"noreferrer":e.rel,s=X();if(!z(s))return;const o=s.extract();if(n===null)return void o.forEach((c=>{const u=Zi(c,(h=>!Ji(h)&&xr(h)));if(u){const h=u.getChildren();for(let f=0;f<h.length;f++)u.insertBefore(h[f]);u.remove()}}));const l=new Set,a=c=>{l.has(c.getKey())||(l.add(c.getKey()),c.setURL(n),t!==void 0&&c.setTarget(t),i!==void 0&&c.setRel(i),r!==void 0&&c.setTitle(r))};if(o.length===1){const c=kb(o[0],xr);if(c!==null)return a(c)}(function(c){const u=X();if(!z(u))return c();const h=gs(u),f=h.isBackward(),d=yb(h.anchor,f?-1:0),p=yb(h.focus,f?0:-1);if(c(),d||p){const g=X();if(z(g)){const m=g.clone();if(d){const O=d.getParent();O&&m.anchor.set(O.getKey(),d.getIndexWithinParent()+(f?1:0),"element")}if(p){const O=p.getParent();O&&m.focus.set(O.getKey(),p.getIndexWithinParent()+(f?0:1),"element")}dt(gs(m))}}})((()=>{let c=null;for(const u of o){if(!u.isAttached())continue;const h=kb(u,xr);if(h){a(h);continue}if(I(u)){if(!u.isInline())continue;if(xr(u)){if(!(Ji(u)||c!==null&&c.getParentOrThrow().isParentOf(u))){a(u),c=u;continue}for(const d of u.getChildren())u.insertBefore(d);u.remove();continue}}const f=u.getPreviousSibling();xr(f)&&f.is(c)?f.append(u):(c=Ss(n,{rel:i,target:t,title:r}),u.insertAfter(c),c.append(u))}}))}function kb(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}const eI={testNode:"link",visitNode({mdastNode:n,actions:e}){e.addAndStepInto(Ss(n.url,{title:n.title}))}},tI={testLexicalNode:xr,visitLexicalNode:({lexicalNode:n,actions:e})=>{e.addAndStepInto("link",{url:n.getURL(),title:n.getTitle()})}};function nI({validateUrl:n,attributes:e}){const[t]=Nt();return R.useEffect((()=>{if(!t.hasNodes([hi]))throw new Error("LinkPlugin: LinkNode not registered on editor");return ln(t.registerCommand(yo,(r=>{if(r===null)return nd(r),!0;if(typeof r=="string")return!(n!==void 0&&!n(r))&&(nd(r,e),!0);{const{url:i,target:s,rel:o,title:l}=r;return nd(i,{...e,rel:o,target:s,title:l}),!0}}),Ye),n!==void 0?t.registerCommand(Aa,(r=>{const i=X();if(!z(i)||i.isCollapsed()||!ki(r,ClipboardEvent))return!1;const s=r;if(s.clipboardData===null)return!1;const o=s.clipboardData.getData("text");return!!n(o)&&!i.getNodes().some((l=>I(l)))&&(t.dispatchCommand(yo,{...e,url:o}),r.preventDefault(),!0)}),Ye):()=>{})}),[t,n,e]),null}function Sb(n,e=(t=>t)){return t=>{const r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Q5(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const rI=/[.,;\s]/;function Uu(n){return rI.test(n)}function $5(n){return Uu(n[n.length-1])}function fg(n){return Uu(n[0])}function E5(n){let e=n.getPreviousSibling();return I(e)&&(e=e.getLastDescendant()),e===null||Hn(e)||q(e)&&$5(e.getTextContent())}function A5(n){let e=n.getNextSibling();return I(e)&&(e=e.getFirstDescendant()),e===null||Hn(e)||q(e)&&fg(e.getTextContent())}function iI(n,e,t,r){return(n>0?Uu(t[n-1]):E5(r[0]))?e<t.length?Uu(t[e]):A5(r[r.length-1]):!1}function sI(n,e,t){const r=[],i=[],s=[];let o=0,l=0;const a=[...n];for(;a.length>0;){const c=a[0],u=c.getTextContent().length,h=l;l+u<=e?(r.push(c),o+=u):h>=t?s.push(c):i.push(c),l+=u,a.shift()}return[o,r,i,s]}function oI(n,e,t,r){const i=hg(r.url,r.attributes);if(n.length===1){let s,o=n[0];e===0?[s,o]=o.splitText(t):[,s,o]=o.splitText(e,t);const l=He(r.text);return l.setFormat(s.getFormat()),l.setDetail(s.getDetail()),l.setStyle(s.getStyle()),i.append(l),s.replace(i),o}if(n.length>1){const s=n[0];let o,l=s.getTextContent().length;e===0?o=s:[,o]=s.splitText(e);const a=[];let c;for(let d=1;d<n.length;d++){const p=n[d],g=p.getTextContent().length,m=l;if(m<t)if(l+g<=t)a.push(p);else{const[O,b]=p.splitText(t-m);a.push(O),c=b}l+=g}const u=X(),h=u?u.getNodes().find(q):void 0,f=He(o.getTextContent());return f.setFormat(o.getFormat()),f.setDetail(o.getDetail()),f.setStyle(o.getStyle()),i.append(f,...a),h&&h===o&&(z(u)?f.select(u.anchor.offset,u.focus.offset):pt(u)&&f.select(0,f.getTextContent().length)),o.replace(i),c}}function rd(n,e,t){const r=n.getChildren(),i=r.length;for(let a=0;a<i;a++){const c=r[a];if(!q(c)||!c.isSimpleText())return pu(n),void t(null,n.getURL())}const s=n.getTextContent(),o=Q5(s,e);if(o===null||o.text!==s||!E5(n)||!A5(n))return pu(n),void t(null,n.getURL());const l=n.getURL();if(l!==o.url&&(n.setURL(o.url),t(o.url,l)),o.attributes){const a=n.getRel();a!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,a));const c=n.getTarget();c!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,c))}}function pu(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map((t=>t.getLatest()))}function lI(n,e,t){R.useEffect((()=>{n.hasNodes([Wo])||(function(i,...s){const o=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",i);for(const a of s)l.append("v",a);throw o.search=l.toString(),Error(`Minified Lexical error #${i}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77);const r=(i,s)=>{t&&t(i,s)};return ln(n.registerNodeTransform(Rr,(i=>{const s=i.getParentOrThrow(),o=i.getPreviousSibling();if(Ji(s)&&!s.getIsUnlinked())rd(s,e,r);else if(!xr(s)){if(i.isSimpleText()&&(fg(i.getTextContent())||!Ji(o))){const l=(function(a){const c=[a];let u=a.getNextSibling();for(;u!==null&&q(u)&&u.isSimpleText()&&(c.push(u),!/[\s]/.test(u.getTextContent()));)u=u.getNextSibling();return c})(i);(function(a,c,u){let h=[...a];const f=h.map((m=>m.getTextContent())).join("");let d,p=f,g=0;for(;(d=Q5(p,c))&&d!==null;){const m=d.index,O=m+d.length;if(iI(g+m,g+O,f,h)){const[b,,x,y]=sI(h,g+m,g+O),w=oI(x,g+m-b,g+O-b,d);h=w?[w,...y]:y,u(d.url,null),g=0}else g+=O;p=p.substring(O)}})(l,e,r)}(function(l,a,c){const u=l.getPreviousSibling(),h=l.getNextSibling(),f=l.getTextContent();var d;!Ji(u)||u.getIsUnlinked()||fg(f)&&(d=f,!(u.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(d):/^\.[a-zA-Z0-9]{1,}/.test(d)))||(u.append(l),rd(u,a,c),c(null,u.getURL())),!Ji(h)||h.getIsUnlinked()||$5(f)||(pu(h),rd(h,a,c),c(null,h.getURL()))})(i,e,r)}})),n.registerCommand(yo,(i=>{const s=X();return i!==null||!z(s)||s.extract().forEach((o=>{const l=o.getParent();if(Ji(l))return l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty(),!0})),!1}),Ye))}),[n,e,t])}function aI({matchers:n,onChange:e}){const[t]=Nt();return lI(t,n,e),null}const cI=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,uI=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,hI=[Sb(cI,n=>n.startsWith("http")?n:`https://${n}`),Sb(uI,n=>`mailto:${n}`)],fI=()=>C.createElement(aI,{matchers:hI}),dI=oe(!1),pI=Ln({init(n,e){const t=!!e?.disableAutoLink,r=e?.validateUrl?{validateUrl:e.validateUrl}:{};n.pubIn({[Fo]:"link",[oi]:eI,[Vi]:[hi,Wo],[Fi]:tI,[dI]:t,[Qs]:()=>C.createElement(C.Fragment,null,C.createElement(nI,{...r}),t?null:C.createElement(fI,null))})}});function gI(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var mI=["color"],OI=R.forwardRef(function(n,e){var t=n.color,r=t===void 0?"currentColor":t,i=gI(n,mI);return R.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),R.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const wb=()=>C.createElement("div",{className:H.imagePlaceholder},C.createElement(OI,null));function dg({nodeKey:n,imageSource:e,initialImagePath:t,title:r,alt:i}){const[s,o,l]=Wt(eC,rr,yn),[a]=Nt(),c=ut(K5),u=kn();return C.createElement("div",{className:H.editImageToolbar},C.createElement("button",{className:H.iconButton,type:"button",title:u("imageEditor.deleteImage","Delete image"),disabled:l,onClick:h=>{h.preventDefault(),a.update(()=>{var f;(f=Ke(n))==null||f.remove()})}},o("delete_small")),!s&&C.createElement("button",{type:"button",className:Me(H.iconButton,H.editImageButton),title:u("imageEditor.editImage","Edit image"),disabled:l,onClick:()=>{c({nodeKey:n,initialValues:{src:t||e,title:r,altText:i}})}},o("settings")))}function bl(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ue(){return Ue=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ue.apply(null,arguments)}var id={exports:{}},sd,vb;function xI(){if(vb)return sd;vb=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return sd=n,sd}var od,Cb;function bI(){if(Cb)return od;Cb=1;var n=xI();function e(){}function t(){}return t.resetWarningCache=e,od=function(){function r(o,l,a,c,u,h){if(h!==n){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},od}var Tb;function yI(){return Tb||(Tb=1,id.exports=bI()()),id.exports}var kI=yI();const Y=nw(kI);var ld={exports:{}},Ne={};var _b;function SI(){if(_b)return Ne;_b=1;var n=60103,e=60106,t=60107,r=60108,i=60114,s=60109,o=60110,l=60112,a=60113,c=60120,u=60115,h=60116,f=60121,d=60122,p=60117,g=60129,m=60131;if(typeof Symbol=="function"&&Symbol.for){var O=Symbol.for;n=O("react.element"),e=O("react.portal"),t=O("react.fragment"),r=O("react.strict_mode"),i=O("react.profiler"),s=O("react.provider"),o=O("react.context"),l=O("react.forward_ref"),a=O("react.suspense"),c=O("react.suspense_list"),u=O("react.memo"),h=O("react.lazy"),f=O("react.block"),d=O("react.server.block"),p=O("react.fundamental"),g=O("react.debug_trace_mode"),m=O("react.legacy_hidden")}function b(E){if(typeof E=="object"&&E!==null){var D=E.$$typeof;switch(D){case n:switch(E=E.type,E){case t:case i:case r:case a:case c:return E;default:switch(E=E&&E.$$typeof,E){case o:case l:case h:case u:case s:return E;default:return D}}case e:return D}}}var x=s,y=n,w=l,k=t,S=h,v=u,T=e,A=i,M=r,L=a;return Ne.ContextConsumer=o,Ne.ContextProvider=x,Ne.Element=y,Ne.ForwardRef=w,Ne.Fragment=k,Ne.Lazy=S,Ne.Memo=v,Ne.Portal=T,Ne.Profiler=A,Ne.StrictMode=M,Ne.Suspense=L,Ne.isAsyncMode=function(){return!1},Ne.isConcurrentMode=function(){return!1},Ne.isContextConsumer=function(E){return b(E)===o},Ne.isContextProvider=function(E){return b(E)===s},Ne.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===n},Ne.isForwardRef=function(E){return b(E)===l},Ne.isFragment=function(E){return b(E)===t},Ne.isLazy=function(E){return b(E)===h},Ne.isMemo=function(E){return b(E)===u},Ne.isPortal=function(E){return b(E)===e},Ne.isProfiler=function(E){return b(E)===i},Ne.isStrictMode=function(E){return b(E)===r},Ne.isSuspense=function(E){return b(E)===a},Ne.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===t||E===i||E===g||E===r||E===a||E===c||E===m||typeof E=="object"&&E!==null&&(E.$$typeof===h||E.$$typeof===u||E.$$typeof===s||E.$$typeof===o||E.$$typeof===l||E.$$typeof===p||E.$$typeof===f||E[0]===d)},Ne.typeOf=b,Ne}var Pb;function wI(){return Pb||(Pb=1,ld.exports=SI()),ld.exports}wI();let Qb=n=>typeof n=="object"&&n!=null&&n.nodeType===1,$b=(n,e)=>(!e||n!=="hidden")&&n!=="visible"&&n!=="clip",ad=(n,e)=>{if(n.clientHeight<n.scrollHeight||n.clientWidth<n.scrollWidth){let t=getComputedStyle(n,null);return $b(t.overflowY,e)||$b(t.overflowX,e)||(r=>{let i=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(n)}return!1},kc=(n,e,t,r,i,s,o,l)=>s<n&&o>e||s>n&&o<e?0:s<=n&&l<=t||o>=e&&l>=t?s-n-r:o>e&&l<t||s<n&&l>t?o-e+i:0,vI=n=>{let e=n.parentElement;return e??(n.getRootNode().host||null)};var CI=(n,e)=>{var t,r,i,s,o,l;if(typeof document>"u")return[];let{inline:a,boundary:c,skipOverflowHiddenElements:u}=e,h=typeof c=="function"?c:L=>L!==c;if(!Qb(n))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,d=[],p=n;for(;Qb(p)&&h(p);){if(p=vI(p),p===f){d.push(p);break}p!=null&&p===document.body&&ad(p)&&!ad(document.documentElement)||p!=null&&ad(p,u)&&d.push(p)}let g=(r=(t=window.visualViewport)==null?void 0:t.width)!=null?r:innerWidth,m=(s=(i=window.visualViewport)==null?void 0:i.height)!=null?s:innerHeight,O=(o=window.scrollX)!=null?o:pageXOffset,b=(l=window.scrollY)!=null?l:pageYOffset,{height:x,width:y,top:w,right:k,bottom:S,left:v}=n.getBoundingClientRect(),T=w,A=a==="center"?v+y/2:a==="end"?k:v,M=[];for(let L=0;L<d.length;L++){let E=d[L],{height:D,width:B,top:J,right:U,bottom:le,left:te}=E.getBoundingClientRect();if(w>=0&&v>=0&&S<=m&&k<=g&&w>=J&&S<=le&&v>=te&&k<=U)return M;let Q=getComputedStyle(E),fe=parseInt(Q.borderLeftWidth,10),de=parseInt(Q.borderTopWidth,10),$=parseInt(Q.borderRightWidth,10),ye=parseInt(Q.borderBottomWidth,10),ke=0,pe=0,ae="offsetWidth"in E?E.offsetWidth-E.clientWidth-fe-$:0,ie="offsetHeight"in E?E.offsetHeight-E.clientHeight-de-ye:0,ue="offsetWidth"in E?E.offsetWidth===0?0:B/E.offsetWidth:0,Oe="offsetHeight"in E?E.offsetHeight===0?0:D/E.offsetHeight:0;if(f===E)ke=kc(b,b+m,m,de,ye,b+T,b+T+x,x),pe=a==="start"?A:a==="center"?A-g/2:a==="end"?A-g:kc(O,O+g,g,fe,$,O+A,O+A+y,y),ke=Math.max(0,ke+b),pe=Math.max(0,pe+O);else{ke=kc(J,le,D,de,ye+ie,T,T+x,x),pe=a==="start"?A-te-fe:a==="center"?A-(te+B/2)+ae/2:a==="end"?A-U+$+ae:kc(te,U,B,fe,$+ae,A,A+y,y);let{scrollLeft:Ae,scrollTop:St}=E;ke=Math.max(0,Math.min(St+ke/Oe,E.scrollHeight-D/Oe+ie)),pe=Math.max(0,Math.min(Ae+pe/ue,E.scrollWidth-B/ue+ae)),T+=St-ke,A+=Ae-pe}M.push({el:E,top:ke,left:pe})}return M},TI=0;function M5(){}function _I(n,e){if(n){var t=CI(n,{boundary:e});t.forEach(function(r){var i=r.el,s=r.top,o=r.left;i.scrollTop=s,i.scrollLeft=o})}}function Eb(n,e,t){var r=n===e||e instanceof t.Node&&n.contains&&n.contains(e);return r}function L5(n,e){var t;function r(){t&&clearTimeout(t)}function i(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];r(),t=setTimeout(function(){t=null,n.apply(void 0,o)},e)}return i.cancel=r,i}function Xr(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return e.some(function(l){return l&&l.apply(void 0,[r].concat(s)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function Sc(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(r){e.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function PI(){return String(TI++)}function QI(n){var e=n.isOpen,t=n.resultCount,r=n.previousResultCount;return e?t?t!==r?t+" result"+(t===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function pg(n,e){return Object.keys(n).reduce(function(t,r){return t[r]=I5(e,r)?e[r]:n[r],t},{})}function I5(n,e){return n[e]!==void 0}function $I(n){var e=n.key,t=n.keyCode;return t>=37&&t<=40&&e.indexOf("Arrow")!==0?"Arrow"+e:e}function wc(n,e,t,r,i){if(i===void 0&&(i=!0),t===0)return-1;var s=t-1;(typeof e!="number"||e<0||e>=t)&&(e=n>0?-1:s+1);var o=e+n;o<0?o=i?s:0:o>s&&(o=i?0:s);var l=la(n,o,t,r,i);return l===-1?e>=t?-1:e:l}function la(n,e,t,r,i){var s=r(e);if(!s||!s.hasAttribute("disabled"))return e;if(n>0){for(var o=e+1;o<t;o++)if(!r(o).hasAttribute("disabled"))return o}else for(var l=e-1;l>=0;l--)if(!r(l).hasAttribute("disabled"))return l;return i?n>0?la(1,0,t,r,!1):la(-1,t-1,t,r,!1):-1}function Ab(n,e,t,r){return r===void 0&&(r=!0),e.some(function(i){return i&&(Eb(i,n,t)||r&&Eb(i,t.document.activeElement,t))})}var EI=L5(function(n){R5(n).textContent=""},500);function AI(n,e){var t=R5(e);n&&(t.textContent=n,EI(e))}function R5(n){n===void 0&&(n=document);var e=n.getElementById("a11y-status-message");return e||(e=n.createElement("div"),e.setAttribute("id","a11y-status-message"),e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-relevant","additions text"),Object.assign(e.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),n.body.appendChild(e),e)}var MI=["isInitialMount","highlightedIndex","items","environment"],N5={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function LI(n,e,t){var r=n.props,i=n.type,s={};Object.keys(e).forEach(function(o){II(o,n,e,t),t[o]!==e[o]&&(s[o]=t[o])}),r.onStateChange&&Object.keys(s).length&&r.onStateChange(Ue({type:i},s))}function II(n,e,t,r){var i=e.props,s=e.type,o="on"+NO(n)+"Change";i[o]&&r[n]!==void 0&&r[n]!==t[n]&&i[o](Ue({type:s},r))}function RI(n,e){return e.changes}function NI(n){var e=n.selectedItem,t=n.itemToString;return e?t(e)+" has been selected.":""}var DI=L5(function(n,e){AI(n(),e)},200),ZI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?R.useLayoutEffect:R.useEffect;function BI(n){var e=n.id,t=e===void 0?"downshift-"+PI():e,r=n.labelId,i=n.menuId,s=n.getItemId,o=n.toggleButtonId,l=n.inputId,a=R.useRef({labelId:r||t+"-label",menuId:i||t+"-menu",getItemId:s||function(c){return t+"-item-"+c},toggleButtonId:o||t+"-toggle-button",inputId:l||t+"-input"});return a.current}function zI(n,e,t,r){var i,s;if(n===void 0){if(e===void 0)throw new Error(r);i=t[e],s=e}else s=e===void 0?t.indexOf(n):e,i=n;return[i,s]}function VI(n){return n?String(n):""}function NO(n){return""+n.slice(0,1).toUpperCase()+n.slice(1)}function D5(n){var e=R.useRef(n);return e.current=n,e}function FI(n,e,t){var r=R.useRef(),i=R.useRef(),s=R.useCallback(function(f,d){i.current=d,f=pg(f,d.props);var p=n(f,d),g=d.props.stateReducer(f,Ue({},d,{changes:p}));return g},[n]),o=R.useReducer(s,e),l=o[0],a=o[1],c=D5(t),u=R.useCallback(function(f){return a(Ue({props:c.current},f))},[c]),h=i.current;return R.useEffect(function(){h&&r.current&&r.current!==l&&LI(h,pg(r.current,h.props),l),r.current=l},[l,t,h]),[l,u]}var Nl={itemToString:VI,stateReducer:RI,getA11ySelectionMessage:NI,scrollIntoView:_I,environment:typeof window>"u"?{}:window};function vr(n,e,t){t===void 0&&(t=N5);var r=n["default"+NO(e)];return r!==void 0?r:t[e]}function vc(n,e,t){t===void 0&&(t=N5);var r=n[e];if(r!==void 0)return r;var i=n["initial"+NO(e)];return i!==void 0?i:vr(n,e,t)}function XI(n){var e=vc(n,"selectedItem"),t=vc(n,"isOpen"),r=vc(n,"highlightedIndex"),i=vc(n,"inputValue");return{highlightedIndex:r<0&&e&&t?n.items.indexOf(e):r,isOpen:t,selectedItem:e,inputValue:i}}function Dl(n,e,t){var r=n.items,i=n.initialHighlightedIndex,s=n.defaultHighlightedIndex,o=e.selectedItem,l=e.highlightedIndex;return r.length===0?-1:i!==void 0&&l===i?i:s!==void 0?s:o?r.indexOf(o):t===0?-1:t<0?r.length-1:0}function WI(n,e,t,r){var i=R.useRef({isMouseDown:!1,isTouchMove:!1});return R.useEffect(function(){if(t?.addEventListener!=null){var s=function(){i.current.isMouseDown=!0},o=function(h){i.current.isMouseDown=!1,n&&!Ab(h.target,e.map(function(f){return f.current}),t)&&r()},l=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},c=function(h){n&&!i.current.isTouchMove&&!Ab(h.target,e.map(function(f){return f.current}),t,!1)&&r()};return t.addEventListener("mousedown",s),t.addEventListener("mouseup",o),t.addEventListener("touchstart",l),t.addEventListener("touchmove",a),t.addEventListener("touchend",c),function(){t.removeEventListener("mousedown",s),t.removeEventListener("mouseup",o),t.removeEventListener("touchstart",l),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",c)}}},[n,t]),i}var qI=function(){return M5};function Mb(n,e,t){var r=t.isInitialMount,i=t.highlightedIndex,s=t.items,o=t.environment,l=bl(t,MI);R.useEffect(function(){r||DI(function(){return n(Ue({highlightedIndex:i,highlightedItem:s[i],resultCount:s.length},l))},o.document)},e)}function jI(n){var e=n.highlightedIndex,t=n.isOpen,r=n.itemRefs,i=n.getItemNodeFromIndex,s=n.menuElement,o=n.scrollIntoView,l=R.useRef(!0);return ZI(function(){e<0||!t||!Object.keys(r.current).length||(l.current===!1?l.current=!0:o(i(e),s))},[e]),l}var YI=M5;function Lb(n,e,t){var r;t===void 0&&(t=!0);var i=((r=n.items)==null?void 0:r.length)&&e>=0;return Ue({isOpen:!1,highlightedIndex:-1},i&&Ue({selectedItem:n.items[e],isOpen:vr(n,"isOpen"),highlightedIndex:vr(n,"highlightedIndex")},t&&{inputValue:n.itemToString(n.items[e])}))}function HI(n,e,t){var r=e.type,i=e.props,s;switch(r){case t.ItemMouseMove:s={highlightedIndex:e.disabled?-1:e.index};break;case t.MenuMouseLeave:s={highlightedIndex:-1};break;case t.ToggleButtonClick:case t.FunctionToggleMenu:s={isOpen:!n.isOpen,highlightedIndex:n.isOpen?-1:Dl(i,n,0)};break;case t.FunctionOpenMenu:s={isOpen:!0,highlightedIndex:Dl(i,n,0)};break;case t.FunctionCloseMenu:s={isOpen:!1};break;case t.FunctionSetHighlightedIndex:s={highlightedIndex:e.highlightedIndex};break;case t.FunctionSetInputValue:s={inputValue:e.inputValue};break;case t.FunctionReset:s={highlightedIndex:vr(i,"highlightedIndex"),isOpen:vr(i,"isOpen"),selectedItem:vr(i,"selectedItem"),inputValue:vr(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Ue({},n,s)}Y.array.isRequired,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.bool,Y.bool,Y.bool,Y.any,Y.any,Y.any,Y.string,Y.string,Y.string,Y.func,Y.string,Y.func,Y.func,Y.func,Y.func,Y.func,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});function UI(n){var e=n.isOpen,t=n.resultCount,r=n.previousResultCount;return e?t?t!==r?"".concat(t," result").concat(t===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}h0(h0({},Nl),{getA11yStatusMessage:UI});var DO=0,ZO=1,BO=2,zO=3,VO=4,FO=5,XO=6,WO=7,qO=8,Gu=9,jO=10,Z5=11,B5=12,YO=13,z5=14,V5=15,F5=16,X5=17,W5=18,HO=19,q5=20,j5=21,UO=22,Y5=Object.freeze({__proto__:null,InputKeyDownArrowDown:DO,InputKeyDownArrowUp:ZO,InputKeyDownEscape:BO,InputKeyDownHome:zO,InputKeyDownEnd:VO,InputKeyDownPageUp:FO,InputKeyDownPageDown:XO,InputKeyDownEnter:WO,InputChange:qO,InputBlur:Gu,InputFocus:jO,MenuMouseLeave:Z5,ItemMouseMove:B5,ItemClick:YO,ToggleButtonClick:z5,FunctionToggleMenu:V5,FunctionOpenMenu:F5,FunctionCloseMenu:X5,FunctionSetHighlightedIndex:W5,FunctionSelectItem:HO,FunctionSetInputValue:q5,FunctionReset:j5,ControlledPropUpdatedSelectedItem:UO});function GI(n){var e=XI(n),t=e.selectedItem,r=e.inputValue;return r===""&&t&&n.defaultInputValue===void 0&&n.initialInputValue===void 0&&n.inputValue===void 0&&(r=n.itemToString(t)),Ue({},e,{inputValue:r})}Y.array.isRequired,Y.func,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.bool,Y.bool,Y.bool,Y.any,Y.any,Y.any,Y.string,Y.string,Y.string,Y.string,Y.string,Y.string,Y.func,Y.string,Y.string,Y.func,Y.func,Y.func,Y.func,Y.func,Y.func,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});function KI(n,e,t){var r=R.useRef(),i=FI(n,e,t),s=i[0],o=i[1];return R.useEffect(function(){I5(t,"selectedItem")&&(t.selectedItemChanged(r.current,t.selectedItem)&&o({type:UO,inputValue:t.itemToString(t.selectedItem)}),r.current=s.selectedItem===r.current?t.selectedItem:s.selectedItem)},[s.selectedItem,t.selectedItem]),[pg(s,t),o]}var JI=Ue({},Nl,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:QI});function eR(n,e){var t,r=e.type,i=e.props,s=e.altKey,o;switch(r){case YO:o={isOpen:vr(i,"isOpen"),highlightedIndex:vr(i,"highlightedIndex"),selectedItem:i.items[e.index],inputValue:i.itemToString(i.items[e.index])};break;case DO:n.isOpen?o={highlightedIndex:wc(1,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:o={highlightedIndex:s&&n.selectedItem==null?-1:Dl(i,n,1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case ZO:n.isOpen?s?o=Lb(i,n.highlightedIndex):o={highlightedIndex:wc(-1,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!0)}:o={highlightedIndex:Dl(i,n,-1,e.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case WO:o=Lb(i,n.highlightedIndex);break;case BO:o=Ue({isOpen:!1,highlightedIndex:-1},!n.isOpen&&{selectedItem:null,inputValue:""});break;case FO:o={highlightedIndex:wc(-10,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case XO:o={highlightedIndex:wc(10,n.highlightedIndex,i.items.length,e.getItemNodeFromIndex,!1)};break;case zO:o={highlightedIndex:la(1,0,i.items.length,e.getItemNodeFromIndex,!1)};break;case VO:o={highlightedIndex:la(-1,i.items.length-1,i.items.length,e.getItemNodeFromIndex,!1)};break;case Gu:o=Ue({isOpen:!1,highlightedIndex:-1},n.highlightedIndex>=0&&((t=i.items)==null?void 0:t.length)&&e.selectItem&&{selectedItem:i.items[n.highlightedIndex],inputValue:i.itemToString(i.items[n.highlightedIndex])});break;case qO:o={isOpen:!0,highlightedIndex:vr(i,"highlightedIndex"),inputValue:e.inputValue};break;case jO:o={isOpen:!0,highlightedIndex:Dl(i,n,0)};break;case HO:o={selectedItem:e.selectedItem,inputValue:i.itemToString(e.selectedItem)};break;case UO:o={inputValue:e.inputValue};break;default:return HI(n,e,Y5)}return Ue({},n,o)}var tR=["onMouseLeave","refKey","ref"],nR=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],rR=["onClick","onPress","refKey","ref"],iR=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];H5.stateChangeTypes=Y5;function H5(n){n===void 0&&(n={});var e=Ue({},JI,n),t=e.initialIsOpen,r=e.defaultIsOpen,i=e.items,s=e.scrollIntoView,o=e.environment,l=e.getA11yStatusMessage,a=e.getA11ySelectionMessage,c=e.itemToString,u=GI(e),h=KI(eR,u,e),f=h[0],d=h[1],p=f.isOpen,g=f.highlightedIndex,m=f.selectedItem,O=f.inputValue,b=R.useRef(null),x=R.useRef({}),y=R.useRef(null),w=R.useRef(null),k=R.useRef(!0),S=BI(e),v=R.useRef(),T=D5({state:f,props:e}),A=R.useCallback(function(ae){return x.current[S.getItemId(ae)]},[S]);Mb(l,[p,g,O,i],Ue({isInitialMount:k.current,previousResultCount:v.current,items:i,environment:o,itemToString:c},f)),Mb(a,[m],Ue({isInitialMount:k.current,previousResultCount:v.current,items:i,environment:o,itemToString:c},f));var M=jI({menuElement:b.current,highlightedIndex:g,isOpen:p,itemRefs:x,scrollIntoView:s,getItemNodeFromIndex:A});YI({isInitialMount:k.current}),R.useEffect(function(){var ae=t||r||p;ae&&y.current&&y.current.focus()},[]),R.useEffect(function(){k.current||(v.current=i.length)});var L=WI(p,[y,b,w],o,function(){d({type:Gu,selectItem:!1})}),E=qI();R.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),R.useEffect(function(){var ae;if(!p)x.current={};else if(((ae=o.document)==null?void 0:ae.activeElement)!==y.current){var ie;y==null||(ie=y.current)==null||ie.focus()}},[p,o]);var D=R.useMemo(function(){return{ArrowDown:function(ie){ie.preventDefault(),d({type:DO,altKey:ie.altKey,getItemNodeFromIndex:A})},ArrowUp:function(ie){ie.preventDefault(),d({type:ZO,altKey:ie.altKey,getItemNodeFromIndex:A})},Home:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:zO,getItemNodeFromIndex:A}))},End:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:VO,getItemNodeFromIndex:A}))},Escape:function(ie){var ue=T.current.state;(ue.isOpen||ue.inputValue||ue.selectedItem||ue.highlightedIndex>-1)&&(ie.preventDefault(),d({type:BO}))},Enter:function(ie){var ue=T.current.state;!ue.isOpen||ie.which===229||(ie.preventDefault(),d({type:WO,getItemNodeFromIndex:A}))},PageUp:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:FO,getItemNodeFromIndex:A}))},PageDown:function(ie){T.current.state.isOpen&&(ie.preventDefault(),d({type:XO,getItemNodeFromIndex:A}))}}},[d,T,A]),B=R.useCallback(function(ae){return Ue({id:S.labelId,htmlFor:S.inputId},ae)},[S]),J=R.useCallback(function(ae,ie){var ue,Oe=ae===void 0?{}:ae,Ae=Oe.onMouseLeave,St=Oe.refKey,wt=St===void 0?"ref":St,wn=Oe.ref,jt=bl(Oe,tR),Yt=ie===void 0?{}:ie;return Yt.suppressRefError,Ue((ue={},ue[wt]=Sc(wn,function(an){b.current=an}),ue.id=S.menuId,ue.role="listbox",ue["aria-labelledby"]=jt&&jt["aria-label"]?void 0:""+S.labelId,ue.onMouseLeave=Xr(Ae,function(){d({type:Z5})}),ue),jt)},[d,E,S]),U=R.useCallback(function(ae){var ie,ue,Oe=ae===void 0?{}:ae,Ae=Oe.item,St=Oe.index,wt=Oe.refKey,wn=wt===void 0?"ref":wt,jt=Oe.ref,Yt=Oe.onMouseMove,an=Oe.onMouseDown,di=Oe.onClick;Oe.onPress;var cn=Oe.disabled,ar=bl(Oe,nR),Zt=T.current,qi=Zt.props,Dn=Zt.state,Be=zI(Ae,St,qi.items,"Pass either item or index to getItemProps!"),un=Be[1],Z="onClick",V=di,_=function(){un!==Dn.highlightedIndex&&(M.current=!1,d({type:B5,index:un,disabled:cn}))},me=function(){d({type:YO,index:un})},we=function(Zr){return Zr.preventDefault()};return Ue((ie={},ie[wn]=Sc(jt,function(qe){qe&&(x.current[S.getItemId(un)]=qe)}),ie.disabled=cn,ie.role="option",ie["aria-selected"]=""+(un===Dn.highlightedIndex),ie.id=S.getItemId(un),ie),!cn&&(ue={},ue[Z]=Xr(V,me),ue),{onMouseMove:Xr(Yt,_),onMouseDown:Xr(an,we)},ar)},[d,T,M,S]),le=R.useCallback(function(ae){var ie,ue=ae===void 0?{}:ae,Oe=ue.onClick;ue.onPress;var Ae=ue.refKey,St=Ae===void 0?"ref":Ae,wt=ue.ref,wn=bl(ue,rR),jt=T.current.state,Yt=function(){d({type:z5})};return Ue((ie={},ie[St]=Sc(wt,function(an){w.current=an}),ie["aria-controls"]=S.menuId,ie["aria-expanded"]=jt.isOpen,ie.id=S.toggleButtonId,ie.tabIndex=-1,ie),!wn.disabled&&Ue({},{onClick:Xr(Oe,Yt)}),wn)},[d,T,S]),te=R.useCallback(function(ae,ie){var ue,Oe=ae===void 0?{}:ae,Ae=Oe.onKeyDown,St=Oe.onChange,wt=Oe.onInput,wn=Oe.onFocus,jt=Oe.onBlur;Oe.onChangeText;var Yt=Oe.refKey,an=Yt===void 0?"ref":Yt,di=Oe.ref,cn=bl(Oe,iR),ar=ie===void 0?{}:ie;ar.suppressRefError;var Zt=T.current.state,qi=function(we){var qe=$I(we);qe&&D[qe]&&D[qe](we)},Dn=function(we){d({type:qO,inputValue:we.target.value})},Be=function(we){if(Zt.isOpen&&!L.current.isMouseDown){var qe=we.relatedTarget===null&&o.document.activeElement!==o.document.body;d({type:Gu,selectItem:!qe})}},un=function(){Zt.isOpen||d({type:jO})},Z="onChange",V={};if(!cn.disabled){var _;V=(_={},_[Z]=Xr(St,wt,Dn),_.onKeyDown=Xr(Ae,qi),_.onBlur=Xr(jt,Be),_.onFocus=Xr(wn,un),_)}return Ue((ue={},ue[an]=Sc(di,function(me){y.current=me}),ue["aria-activedescendant"]=Zt.isOpen&&Zt.highlightedIndex>-1?S.getItemId(Zt.highlightedIndex):"",ue["aria-autocomplete"]="list",ue["aria-controls"]=S.menuId,ue["aria-expanded"]=Zt.isOpen,ue["aria-labelledby"]=cn&&cn["aria-label"]?void 0:""+S.labelId,ue.autoComplete="off",ue.id=S.inputId,ue.role="combobox",ue.value=Zt.inputValue,ue),V,cn)},[E,T,S,D,d,L,o]),Q=R.useCallback(function(){d({type:V5})},[d]),fe=R.useCallback(function(){d({type:X5})},[d]),de=R.useCallback(function(){d({type:F5})},[d]),$=R.useCallback(function(ae){d({type:W5,highlightedIndex:ae})},[d]),ye=R.useCallback(function(ae){d({type:HO,selectedItem:ae})},[d]),ke=R.useCallback(function(ae){d({type:q5,inputValue:ae})},[d]),pe=R.useCallback(function(){d({type:j5})},[d]);return{getItemProps:U,getLabelProps:B,getMenuProps:J,getInputProps:te,getToggleButtonProps:le,toggleMenu:Q,openMenu:de,closeMenu:fe,setHighlightedIndex:$,setInputValue:ke,selectItem:ye,reset:pe,highlightedIndex:g,isOpen:p,selectedItem:m,inputValue:O}}Y.array,Y.array,Y.array,Y.func,Y.func,Y.func,Y.number,Y.number,Y.number,Y.func,Y.func,Y.string,Y.string,Y.shape({addEventListener:Y.func,removeEventListener:Y.func,document:Y.shape({getElementById:Y.func,activeElement:Y.any,body:Y.any})});Nl.itemToString,Nl.stateReducer,Nl.environment;const Ib=20,U5=n=>n.suggestions.length>0?C.createElement(sR,{...n}):C.createElement("input",{className:H.textInput,size:40,autoFocus:!0,...n.register(n.inputName)}),sR=({autofocus:n,suggestions:e,control:t,inputName:r,placeholder:i,initialInputValue:s,setValue:o})=>{const[l,a]=C.useState(e.slice(0,Ib)),c=nn(rr),u=e.length>0,{isOpen:h,getToggleButtonProps:f,getMenuProps:d,getInputProps:p,highlightedIndex:g,getItemProps:m,selectedItem:O}=H5({initialInputValue:s,onInputValueChange({inputValue:x=""}){o(r,x),x=x.toLowerCase()||"";const y=[];for(const w of e)if(w.toLowerCase().includes(x)&&(y.push(w),y.length>=Ib))break;a(y)},items:l,itemToString(x){return x??""}}),b=h&&l.length>0;return C.createElement("div",{className:H.downshiftAutocompleteContainer},C.createElement("div",{"data-visible-dropdown":b,className:H.downshiftInputWrapper},C.createElement(b9,{name:r,control:t,render:({field:x})=>{const y=p();return C.createElement("input",{...y,name:x.name,placeholder:i,className:H.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:n})}}),u&&C.createElement("button",{"aria-label":"toggle menu",type:"button",...f()},c("arrow_drop_down"))),C.createElement("div",{className:H.downshiftAutocompleteContainer},C.createElement("ul",{...d(),"data-visible":b},l.map((x,y)=>C.createElement("li",{"data-selected":O===x,"data-highlighted":g===y,key:`${x}${y}`,...m({item:x,index:y})},x)))))},oR=()=>{const[n,e,t,r]=Wt(gg,us,Wa,Si),i=ut(tC),s=ut(J5),o=kn(),{register:l,handleSubmit:a,control:c,setValue:u,reset:h}=rw({values:e.type==="editing"?e.initialValues:{}});return e.type==="inactive"?null:C.createElement(d9,{open:!0,onOpenChange:f=>{f||(s(),h({src:"",title:"",altText:""}))}},C.createElement(p9,{container:t?.current},C.createElement(g9,{className:H.dialogOverlay}),C.createElement(m9,{className:H.dialogContent,onOpenAutoFocus:f=>{f.preventDefault()}},C.createElement(O9,null,o("uploadImage.dialogTitle","Upload an image")),C.createElement("form",{onSubmit:async f=>{f.preventDefault(),f.stopPropagation(),await a(i)(f),h({src:"",title:"",altText:""})},className:H.multiFieldForm},r===null?C.createElement("input",{type:"hidden",accept:"image/*",...l("file")}):C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"file"},o("uploadImage.uploadInstructions","Upload an image from your device:")),C.createElement("input",{type:"file",accept:"image/*",...l("file")})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"src"},r!==null?o("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):o("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),C.createElement(U5,{register:l,initialInputValue:e.type==="editing"?e.initialValues.src??"":"",inputName:"src",suggestions:n,setValue:u,control:c,placeholder:o("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"alt"},o("uploadImage.alt","Alt:")),C.createElement("input",{type:"text",...l("altText"),className:H.textInput})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"title"},o("uploadImage.title","Title:")),C.createElement("input",{type:"text",...l("title"),className:H.textInput})),C.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},C.createElement("button",{type:"submit",title:o("dialogControls.save","Save"),"aria-label":o("dialogControls.save","Save"),className:Me(H.primaryButton)},o("dialogControls.save","Save")),C.createElement(x9,{asChild:!0},C.createElement("button",{type:"reset",title:o("dialogControls.cancel","Cancel"),"aria-label":o("dialogControls.cancel","Cancel"),className:Me(H.secondaryButton)},o("dialogControls.cancel","Cancel"))))))))};function cd(n,e,t){return Math.min(Math.max(n,e),t)}const ze={east:1,north:8,south:2,west:4};function lR({onResizeStart:n,onResizeEnd:e,imageRef:t,maxWidth:r,editor:i}){const s=R.useRef(null),o=R.useRef({priority:"",value:"default"}),l=R.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),a=i.getRootElement(),c=r||(a!==null?a.getBoundingClientRect().width-20:100),u=a!==null?a.getBoundingClientRect().height-20:100,h=100,f=100,d=b=>{const x=b===ze.east||b===ze.west,y=b===ze.north||b===ze.south,w=b&ze.north&&b&ze.west||b&ze.south&&b&ze.east,k=x?"ew":y?"ns":w?"nwse":"nesw";a!==null&&a.style.setProperty("cursor",`${k}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${k}-resize`,"important"),o.current.value=document.body.style.getPropertyValue("-webkit-user-select"),o.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},p=()=>{a!==null&&a.style.setProperty("cursor","text"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",o.current.value,o.current.priority))},g=(b,x)=>{if(!i.isEditable())return;const y=t.current,w=s.current;if(y!==null&&w!==null){b.preventDefault();const{width:k,height:S}=y.getBoundingClientRect(),v=l.current;v.startWidth=k,v.startHeight=S,v.ratio=k/S,v.currentWidth=k,v.currentHeight=S,v.startX=b.clientX,v.startY=b.clientY,v.isResizing=!0,v.direction=x,d(x),n(),w.classList.add(H.imageControlWrapperResizing),y.style.height=`${S}px`,y.style.width=`${k}px`,document.addEventListener("pointermove",m),document.addEventListener("pointerup",O)}},m=b=>{const x=t.current,y=l.current,w=y.direction&(ze.east|ze.west),k=y.direction&(ze.south|ze.north);if(x!==null&&y.isResizing)if(w&&k){let S=Math.floor(y.startX-b.clientX);S=y.direction&ze.east?-S:S;const v=cd(y.startWidth+S,h,c),T=v/y.ratio;x.style.width=`${v}px`,x.style.height=`${T}px`,y.currentHeight=T,y.currentWidth=v}else if(k){let S=Math.floor(y.startY-b.clientY);S=y.direction&ze.south?-S:S;const v=cd(y.startHeight+S,f,u);x.style.height=`${v}px`,y.currentHeight=v}else{let S=Math.floor(y.startX-b.clientX);S=y.direction&ze.east?-S:S;const v=cd(y.startWidth+S,h,c);x.style.width=`${v}px`,y.currentWidth=v}},O=()=>{const b=t.current,x=l.current,y=s.current;if(b!==null&&y!==null&&x.isResizing){const w=x.currentWidth,k=x.currentHeight;x.startWidth=0,x.startHeight=0,x.ratio=0,x.startX=0,x.startY=0,x.currentWidth=0,x.currentHeight=0,x.isResizing=!1,y.classList.remove(H.imageControlWrapperResizing),p(),e(w,k),document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",O)}};return R.createElement("div",{ref:s},R.createElement("div",{className:Me(H.imageResizer,H.imageResizerN),onPointerDown:b=>{g(b,ze.north)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerNe),onPointerDown:b=>{g(b,ze.north|ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerE),onPointerDown:b=>{g(b,ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerSe),onPointerDown:b=>{g(b,ze.south|ze.east)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerS),onPointerDown:b=>{g(b,ze.south)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerSw),onPointerDown:b=>{g(b,ze.south|ze.west)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerW),onPointerDown:b=>{g(b,ze.west)}}),R.createElement("div",{className:Me(H.imageResizer,H.imageResizerNw),onPointerDown:b=>{g(b,ze.north|ze.west)}}))}const aR="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
|
|
60
60
|
<svg id="imgLoadError" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
|
61
61
|
<rect x="0" y="0" width="100" height="100" fill="none" stroke="red" stroke-width="4" stroke-dasharray="4" />
|
|
62
62
|
<text x="50" y="55" text-anchor="middle" font-size="20" fill="red">⚠️</text>
|
|
@@ -84,7 +84,7 @@ import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";i
|
|
|
84
84
|
\${}
|
|
85
85
|
}
|
|
86
86
|
}`,{label:"class",detail:"definition",type:"keyword"}),Ut('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ut('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],yW=u3.concat([Ut("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ut("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ut("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Dk=new RT,h3=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function fl(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const kW=["FunctionDeclaration"],SW={FunctionDeclaration:fl("function"),ClassDeclaration:fl("class"),ClassExpression:()=>!0,EnumDeclaration:fl("constant"),TypeAliasDeclaration:fl("type"),NamespaceDeclaration:fl("namespace"),VariableDefinition(n,e){n.matchContext(kW)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function f3(n,e){let t=Dk.get(e);if(t)return t;let r=[],i=!0;function s(o,l){let a=n.sliceString(o.from,o.to);r.push({label:a,type:l})}return e.cursor(Le.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let l=SW[o.name];if(l&&l(o,s)||h3.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of f3(n,o.node))r.push(l);return!1}}),Dk.set(e,r),r}const Zk=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,d3=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function wW(n){let e=We(n.state).resolveInner(n.pos,-1);if(d3.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Zk.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let i=e;i;i=i.parent)h3.has(i.name)&&(r=r.concat(f3(n.state.doc,i)));return{options:r,from:t?e.from:n.pos,validFor:Zk}}const $r=To.define({name:"javascript",parser:bW.configure({props:[rc.add({IfStatement:wu({except:/^\s*({|else\b)/}),TryStatement:wu({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:PB,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:_B({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":wu({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Ho.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":XT,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),p3={test:n=>/^JSX/.test(n.name),facet:S1({commentTokens:{block:{open:"{/*",close:"*/}"}}})},g3=$r.configure({dialect:"ts"},"typescript"),m3=$r.configure({dialect:"jsx",props:[w1.add(n=>n.isTop?[p3]:void 0)]}),O3=$r.configure({dialect:"jsx ts",props:[w1.add(n=>n.isTop?[p3]:void 0)]},"typescript");let x3=n=>({label:n,type:"keyword"});const b3="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(x3),vW=b3.concat(["declare","implements","private","protected","public"].map(x3));function CW(n={}){let e=n.jsx?n.typescript?O3:m3:n.typescript?g3:$r,t=n.typescript?yW.concat(vW):u3.concat(b3);return new xa(e,[$r.data.of({autocomplete:oz(d3,i_(t))}),$r.data.of({autocomplete:wW}),n.jsx?PW:[]])}function TW(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function Bk(n,e,t=n.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const _W=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),PW=j.inputHandler.of((n,e,t,r,i)=>{if((_W?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!$r.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,l=o.changeByRange(a=>{var c;let{head:u}=a,h=We(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:"</>"}};if(r=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,p=d.parent;if(p&&d.from==u-2&&((f=Bk(o.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${f}>`;return{range:N.cursor(u+g.length,-1),changes:{from:u,insert:g}}}}else if(r==">"){let d=TW(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Bk(o.doc,d,u)))return{range:a,changes:{from:u,insert:`</${f}>`}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),dl=["_blank","_self","_top","_parent"],Fd=["ascii","utf-8","utf-16","latin1","latin1"],Xd=["get","post","put","delete"],Wd=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],dn=["true","false"],ce={},QW={a:{attrs:{href:null,ping:null,type:null,media:null,target:dl,hreflang:null}},abbr:ce,address:ce,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:ce,aside:ce,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:ce,base:{attrs:{href:null,target:dl}},bdi:ce,bdo:ce,blockquote:{attrs:{cite:null}},body:ce,br:ce,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Wd,formmethod:Xd,formnovalidate:["novalidate"],formtarget:dl,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:ce,center:ce,cite:ce,code:ce,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:ce,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:ce,div:ce,dl:ce,dt:ce,em:ce,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:ce,figure:ce,footer:ce,form:{attrs:{action:null,name:null,"accept-charset":Fd,autocomplete:["on","off"],enctype:Wd,method:Xd,novalidate:["novalidate"],target:dl}},h1:ce,h2:ce,h3:ce,h4:ce,h5:ce,h6:ce,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:ce,hgroup:ce,hr:ce,html:{attrs:{manifest:null}},i:ce,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:Wd,formmethod:Xd,formnovalidate:["novalidate"],formtarget:dl,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:ce,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:ce,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:ce,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Fd,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:ce,noscript:ce,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:ce,param:{attrs:{name:null,value:null}},pre:ce,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:ce,rt:ce,ruby:ce,samp:ce,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Fd}},section:ce,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:ce,source:{attrs:{src:null,type:null,media:null}},span:ce,strong:ce,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:ce,summary:ce,sup:ce,table:ce,tbody:ce,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:ce,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:ce,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:ce,time:{attrs:{datetime:null}},title:ce,tr:ce,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:ce,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:ce},y3={accesskey:null,class:null,contenteditable:dn,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:dn,autocorrect:dn,autocapitalize:dn,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":dn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":dn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":dn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":dn,"aria-hidden":dn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":dn,"aria-multiselectable":dn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":dn,"aria-relevant":null,"aria-required":dn,"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},k3="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(n=>"on"+n);for(let n of k3)y3[n]=null;class va{constructor(e,t){this.tags={...QW,...e},this.globalAttrs={...y3,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}va.default=new va;function Qo(n,e,t=n.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?n.sliceString(i.from,Math.min(i.to,t)):""}function $o(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function S3(n,e,t){let r=t.tags[Qo(n,$o(e))];return r?.children||t.allTags}function z1(n,e){let t=[];for(let r=$o(e);r&&!r.type.isTop;r=$o(r.parent)){let i=Qo(n,r);if(i&&r.lastChild.name=="CloseTag")break;i&&t.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(i)}return t}const w3=/^[:\-\.\w\u00b7-\uffff]*$/;function zk(n,e,t,r,i){let s=/\s*>/.test(n.sliceDoc(i,i+5))?"":">",o=$o(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:i,options:S3(n.doc,o,e).map(l=>({label:l,type:"type"})).concat(z1(n.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vk(n,e,t,r){let i=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:z1(n.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:w3}}function $W(n,e,t,r){let i=[],s=0;for(let o of S3(n.doc,t,e))i.push({label:"<"+o,type:"type"});for(let o of z1(n.doc,t))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function EW(n,e,t,r,i){let s=$o(t),o=s?e.tags[Qo(n.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:a.map(c=>({label:c,type:"property"})),validFor:w3}}function AW(n,e,t,r,i){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let c=n.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=$o(t),f=h?e.tags[Qo(n.doc,h)]:null;u=f?.attrs&&f.attrs[c]}if(u){let h=n.sliceDoc(r,i).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(a=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=n.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):a=/^[^\s<>='"]*$/;for(let p of u)l.push({label:p,apply:f+p+d,type:"constant"})}}return{from:r,to:i,options:l,validFor:a}}function v3(n,e){let{state:t,pos:r}=e,i=We(t).resolveInner(r,-1),s=i.resolve(r);for(let o=r,l;s==i&&(l=i.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.from<a.to)break;s=i=l,o=a.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?Vk(t,i,i.from,r):zk(t,n,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?zk(t,n,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?Vk(t,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?EW(t,n,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?AW(t,n,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?$W(t,n,i,r):null}function MW(n){return v3(va.default,n)}function LW(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new va(e,t):va.default;return i=>v3(r,i)}const IW=$r.parser.configure({top:"SingleExpression"}),C3=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:g3.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:m3.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:O3.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:IW},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:$r.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:vh.parser}],T3=[{name:"style",parser:vh.parser.configure({top:"Styles"})}].concat(k3.map(n=>({name:n,parser:$r.parser}))),_3=To.define({name:"html",parser:VX.configure({props:[rc.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Ho.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),r_.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Tu=_3.configure({wrap:a3(C3,T3)});function RW(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=a3((n.nestedLanguages||[]).concat(C3),(n.nestedAttributes||[]).concat(T3)));let r=t?_3.configure({wrap:t,dialect:e}):e?Tu.configure({dialect:e}):Tu;return new xa(r,[Tu.data.of({autocomplete:LW(n)}),n.autoCloseTags!==!1?NW:[],CW().support,iX().support])}const Fk=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),NW=j.inputHandler.of((n,e,t,r,i)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Tu.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,l=o.changeByRange(a=>{var c,u,h;let f=o.doc.sliceString(a.from-1,a.to)==r,{head:d}=a,p=We(o).resolveInner(d,-1),g;if(f&&r==">"&&p.name=="EndTag"){let m=p.parent;if(((u=(c=m.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(g=Qo(o.doc,m.parent,d))&&!Fk.has(g)){let O=d+(o.doc.sliceString(d,d+1)===">"?1:0),b=`</${g}>`;return{range:a,changes:{from:d,to:O,insert:b}}}}else if(f&&r=="/"&&p.name=="IncompleteCloseTag"){let m=p.parent;if(p.from==d-2&&((h=m.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(g=Qo(o.doc,m,d))&&!Fk.has(g)){let O=d+(o.doc.sliceString(d,d+1)===">"?1:0),b=`${g}>`;return{range:N.cursor(d+b.length,-1),changes:{from:d,to:O,insert:b}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Xk="#2e3440",V1="#3b4252",Wk="#434c5e",Wc="#4c566a",qk="#e5e9f0",gm="#eceff4",qd="#8fbcbb",jk="#88c0d0",DW="#81a1c1",zn="#5e81ac",ZW="#bf616a",Rs="#d08770",jd="#ebcb8b",Yk="#a3be8c",BW="#b48ead",Hk="#d30102",F1=gm,Yd=F1,zW="#ffffff",Hd=V1,VW=F1,Uk=V1,FW=j.theme({"&":{color:Xk,backgroundColor:zW},".cm-content":{caretColor:Uk},".cm-cursor, .cm-dropCursor":{borderLeftColor:Uk},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:VW},".cm-panels":{backgroundColor:F1,color:Wc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Wc}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:qk},".cm-activeLine":{backgroundColor:Yd},".cm-selectionMatch":{backgroundColor:qk},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Wc}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:gm},".cm-gutters":{backgroundColor:gm,color:Xk,border:"none"},".cm-activeLineGutter":{backgroundColor:Yd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Hd},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Hd,borderBottomColor:Hd},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Yd,color:Wc}}},{dark:!1}),XW=sc.define([{tag:P.keyword,color:zn},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:Rs},{tag:[P.variableName],color:Rs},{tag:[P.function(P.variableName)],color:zn},{tag:[P.labelName],color:DW},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:zn},{tag:[P.definition(P.name),P.separator],color:Yk},{tag:[P.brace],color:qd},{tag:[P.annotation],color:Hk},{tag:[P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:jk},{tag:[P.typeName,P.className],color:jd},{tag:[P.operator,P.operatorKeyword],color:Yk},{tag:[P.tagName],color:BW},{tag:[P.squareBracket],color:ZW},{tag:[P.angleBracket],color:Rs},{tag:[P.attributeName],color:jd},{tag:[P.regexp],color:zn},{tag:[P.quote],color:V1},{tag:[P.string],color:Rs},{tag:P.link,color:qd,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[P.url,P.escape,P.special(P.string)],color:Rs},{tag:[P.meta],color:jk},{tag:[P.comment],color:Wk,fontStyle:"italic"},{tag:P.strong,fontWeight:"bold",color:zn},{tag:P.emphasis,fontStyle:"italic",color:zn},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.heading,fontWeight:"bold",color:zn},{tag:P.special(P.heading1),fontWeight:"bold",color:zn},{tag:P.heading1,fontWeight:"bold",color:zn},{tag:[P.heading2,P.heading3,P.heading4],fontWeight:"bold",color:zn},{tag:[P.heading5,P.heading6],color:zn},{tag:[P.atom,P.bool,P.special(P.variableName)],color:Rs},{tag:[P.processingInstruction,P.inserted],color:qd},{tag:[P.contentSeparator],color:jd},{tag:P.invalid,color:Wk,borderBottom:`1px dotted ${Hk}`}]),WW=[FW,JT(XW)],Gk=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Eo{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(Gk(l)):Gk,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 Gt(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=e1(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=yr(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r;;s++){let l=i.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(a)return this.value=a,this;break}o==r&&s<t.length&&t.charCodeAt(s)==l&&o++}}}match(e,t,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Eo.prototype[Symbol.iterator]=function(){return this});const P3={from:-1,to:-1,match:/.*/.exec("")},X1="gm"+(/x/.unicode==null?"":"u");class Q3{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=P3,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new $3(e,t,r,i,s);this.re=new RegExp(t,X1+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Th(e,i),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 r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Th(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,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}}}const Ud=new WeakMap;class lo{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=Ud.get(e);if(!i||i.from>=r||i.to<=t){let l=new lo(t,e.sliceString(t,r));return Ud.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),Ud.set(e,new lo(o,s)),new lo(t,s.slice(t-o,r-o))}}class $3{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=P3,this.matchPos=Th(e,i),this.re=new RegExp(t,X1+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=lo.get(e,i,this.chunkEnd(i+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 r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Th(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=lo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Q3.prototype[Symbol.iterator]=$3.prototype[Symbol.iterator]=function(){return this});function qW(n){try{return new RegExp(n,X1),!0}catch{return!1}}function Th(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}const jW=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:r,result:i}=DZ(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){n.dispatch({effects:r});return}let l=e.doc.lineAt(e.selection.main.head),[,a,c,u,h]=o,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),g=N.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[r,j.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},YW={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},HW=ee.define({combine(n){return Dr(n,YW,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function UW(n){return[tq,eq]}const GW=se.mark({class:"cm-selectionMatch"}),KW=se.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Kk(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Ge.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Ge.Word)}function JW(n,e,t,r){return n(e.sliceDoc(t,t+1))==Ge.Word&&n(e.sliceDoc(r-1,r))==Ge.Word}const eq=ot.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(HW),{state:t}=n,r=t.selection;if(r.ranges.length>1)return se.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return se.none;let a=t.wordAt(i.head);if(!a)return se.none;o=t.charCategorizer(i.head),s=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a<e.minSelectionLength||a>200)return se.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(Kk(o,t,i.from,i.to)&&JW(o,t,i.from,i.to)))return se.none}else if(s=t.sliceDoc(i.from,i.to),!s)return se.none}let l=[];for(let a of n.visibleRanges){let c=new Eo(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||Kk(o,t,u,h))&&(i.empty&&u<=i.from&&h>=i.to?l.push(KW.range(u,h)):(u>=i.to||h<=i.from)&&l.push(GW.range(u,h)),l.length>e.maxMatches))return se.none}}return se.set(l)}},{decorations:n=>n.decorations}),tq=j.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),nq=({state:n,dispatch:e})=>{let{selection:t}=n,r=N.create(t.ranges.map(i=>n.wordAt(i.head)||N.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function rq(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,l=new Eo(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Eo(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(a=>a.from==l.value.from))continue;if(s){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const iq=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return nq({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=rq(n,r);return i?(e(n.update({selection:n.selection.addRange(N.range(i.from,i.to),!1),effects:j.scrollIntoView(i.to)})),!0):!1},Ko=ee.define({combine(n){return Dr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new xq(e),scrollToMatch:e=>j.scrollIntoView(e)})}});class E3{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||qW(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,(t,r)=>r=="n"?`
|
|
87
|
-
`:r=="r"?"\r":r=="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 uq(this):new lq(this)}getCursor(e,t=0,r){let i=e.doc?e:Se.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Bs(this,i,t,r):Zs(this,i,t,r)}}class A3{constructor(e){this.spec=e}}function sq(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let l=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(l,e,r,i)}}function Zs(n,e,t,r){let i;return n.wholeWord&&(i=oq(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=sq(n.test,e,i)),new Eo(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function oq(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(_h(i,t-s))!=Ge.Word||e(Ph(i,t-s))!=Ge.Word)&&(e(Ph(i,r-s))!=Ge.Word||e(_h(i,r-s))!=Ge.Word))}class lq extends A3{constructor(e){super(e)}nextMatch(e,t,r){let i=Zs(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=Zs(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=Zs(this.spec,e,s,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=Zs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=Zs(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function aq(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function Bs(n,e,t,r){let i;return n.wholeWord&&(i=cq(e.charCategorizer(e.selection.main.head))),n.test&&(i=aq(n.test,e,i)),new Q3(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function _h(n,e){return n.slice(Ot(n,e,!1),e)}function Ph(n,e){return n.slice(e,Ot(n,e))}function cq(n){return(e,t,r)=>!r[0].length||(n(_h(r.input,r.index))!=Ge.Word||n(Ph(r.input,r.index))!=Ge.Word)&&(n(Ph(r.input,r.index+r[0].length))!=Ge.Word||n(_h(r.input,r.index+r[0].length))!=Ge.Word)}class uq extends A3{nextMatch(e,t,r){let i=Bs(this.spec,e,r,e.doc.length).next();return i.done&&(i=Bs(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=Bs(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=Bs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=Bs(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Ca=ge.define(),W1=ge.define(),_i=lt.define({create(n){return new Gd(mm(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ca)?n=new Gd(t.value.create(),n.panel):t.is(W1)&&(n=new Gd(n.query,t.value?q1:null));return n},provide:n=>pa.from(n,e=>e.panel)});class Gd{constructor(e,t){this.query=e,this.panel=t}}const hq=se.mark({class:"cm-searchMatch"}),fq=se.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dq=ot.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(_i))}update(n){let e=n.state.field(_i);(e!=n.startState.field(_i)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return se.none;let{view:t}=this,r=new sn;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:l,to:a}=s[i];for(;i<o-1&&a>s[i+1].from-500;)a=s[++i].to;n.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?fq:hq)})}return r.finish()}},{decorations:n=>n.decorations});function ac(n){return e=>{let t=e.state.field(_i,!1);return t&&t.query.spec.valid?n(e,t):I3(e)}}const Qh=ac((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=N.single(r.from,r.to),s=n.state.facet(Ko);return n.dispatch({selection:i,effects:[j1(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),L3(n),!0}),$h=ac((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=N.single(i.from,i.to),o=n.state.facet(Ko);return n.dispatch({selection:s,effects:[j1(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),L3(n),!0}),pq=ac((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:N.create(t.map(r=>N.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),gq=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let l=new Eo(n.doc,n.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(N.range(l.value.from,l.value.to))}return e(n.update({selection:N.create(s,o),userEvent:"select.search.matches"})),!0},Jk=ac((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,l=[],a,c,u=[];o.from==r&&o.to==i&&(c=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),u.push(j.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+".")));let h=n.state.changes(l);return o&&(a=N.single(o.from,o.to).map(h),u.push(j1(n,o)),u.push(t.facet(Ko).scrollToMatch(a.main,n))),n.dispatch({changes:h,selection:a,effects:u,userEvent:"input.replace"}),!0}),mq=ac((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:j.announce.of(r),userEvent:"input.replace.all"}),!0});function q1(n){return n.state.facet(Ko).createPanel(n)}function mm(n,e){var t,r,i,s,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=n.facet(Ko);return new E3({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function M3(n){let e=O1(n,q1);return e&&e.dom.querySelector("[main-field]")}function L3(n){let e=M3(n);e&&e==n.root.activeElement&&e.select()}const I3=n=>{let e=n.state.field(_i,!1);if(e&&e.panel){let t=M3(n);if(t&&t!=n.root.activeElement){let r=mm(n.state,e.query.spec);r.valid&&n.dispatch({effects:Ca.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[W1.of(!0),e?Ca.of(mm(n.state,e.query.spec)):ge.appendConfig.of(yq)]});return!0},R3=n=>{let e=n.state.field(_i,!1);if(!e||!e.panel)return!1;let t=O1(n,q1);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:W1.of(!1)}),!0},Oq=[{key:"Mod-f",run:I3,scope:"editor search-panel"},{key:"F3",run:Qh,shift:$h,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qh,shift:$h,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:R3,scope:"editor search-panel"},{key:"Mod-Shift-l",run:gq},{key:"Mod-Alt-g",run:jW},{key:"Mod-d",run:iq,preventDefault:!0}];class xq{constructor(e){this.view=e;let t=this.query=e.state.field(_i).query.spec;this.commit=this.commit.bind(this),this.searchField=De("input",{value:t.search,placeholder:pn(e,"Find"),"aria-label":pn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=De("input",{value:t.replace,placeholder:pn(e,"Replace"),"aria-label":pn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=De("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=De("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=De("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return De("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=De("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Qh(e),[pn(e,"next")]),r("prev",()=>$h(e),[pn(e,"previous")]),r("select",()=>pq(e),[pn(e,"all")]),De("label",null,[this.caseField,pn(e,"match case")]),De("label",null,[this.reField,pn(e,"regexp")]),De("label",null,[this.wordField,pn(e,"by word")]),...e.state.readOnly?[]:[De("br"),this.replaceField,r("replace",()=>Jk(e),[pn(e,"replace")]),r("replaceAll",()=>mq(e),[pn(e,"replace all")])],De("button",{name:"close",onclick:()=>R3(e),"aria-label":pn(e,"close"),type:"button"},["×"])])}commit(){let e=new E3({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:Ca.of(e)}))}keydown(e){UD(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$h:Qh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Jk(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Ca)&&!r.value.eq(this.query)&&this.setQuery(r.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(Ko).top}}function pn(n,e){return n.state.phrase(e)}const qc=30,jc=/[\s\.,:;?!]/;function j1(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-qc),o=Math.min(i,t+qc),l=n.state.sliceDoc(s,o);if(s!=r.from){for(let a=0;a<qc;a++)if(!jc.test(l[a+1])&&jc.test(l[a])){l=l.slice(a);break}}if(o!=i){for(let a=l.length-1;a>l.length-qc;a--)if(!jc.test(l[a-1])&&jc.test(l[a])){l=l.slice(0,a);break}}return j.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const bq=j.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"}}),yq=[_i,sr.low(dq),bq];class eS{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class ts{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=r.facet(Ta).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new sn,l=[],a=0,c=r.doc.iter(),u=0,h=r.doc.length;for(let d=0;;){let p=d==s.length?null:s[d];if(!p&&!l.length)break;let g,m;if(l.length)g=a,m=l.reduce((x,y)=>Math.min(x,y.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>h)break;m=p.to,l.push(p),d++}for(;d<s.length;){let x=s[d];if(x.from==g&&(x.to>x.from||x.to==g))l.push(x),d++,m=Math.min(x.to,m);else{m=Math.min(x.from,m);break}}m=Math.min(m,h);let O=!1;if(l.some(x=>x.from==g&&(x.to==m||m==h))&&(O=g==m,!O&&m-g<10)){let x=g-(u+c.value.length);x>0&&(c.next(x),u=g);for(let y=g;;){if(y>=m){O=!0;break}if(!c.lineBreak&&u+c.value.length>y)break;y=u+c.value.length,u+=c.value.length,c.next()}}let b=Mq(l);if(O)o.add(g,g,se.widget({widget:new Qq(b),diagnostics:l.slice()}));else{let x=l.reduce((y,w)=>w.markClass?y+" "+w.markClass:y,"");o.add(g,m,se.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:l.slice(),inclusiveEnd:l.some(y=>y.to>m)}))}if(a=m,a==h)break;for(let x=0;x<l.length;x++)l[x].to<=a&&l.splice(x--,1)}let f=o.finish();return new ts(f,t,Ao(f))}}function Ao(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new eS(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new eS(r.from,s,r.diagnostic)}}),r}function kq(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Ta).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(N3))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function Sq(n,e){return n.field(xn,!1)?e:e.concat(ge.appendConfig.of(Lq))}const N3=ge.define(),Y1=ge.define(),D3=ge.define(),xn=lt.define({create(){return new ts(se.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=Ao(t,n.selected.diagnostic,s)||Ao(t,null,s)}!t.size&&i&&e.state.facet(Ta).autoPanel&&(i=null),n=new ts(t,i,r)}for(let t of e.effects)if(t.is(N3)){let r=e.state.facet(Ta).autoPanel?t.value.length?_a.open:null:n.panel;n=ts.init(t.value,r,e.state)}else t.is(Y1)?n=new ts(n.diagnostics,t.value?_a.open:null,n.selected):t.is(D3)&&(n=new ts(n.diagnostics,n.panel,t.value));return n},provide:n=>[pa.from(n,e=>e.panel),j.decorations.from(n,e=>e.diagnostics)]}),wq=se.mark({class:"cm-lintRange cm-lintRange-active"});function vq(n,e,t){let{diagnostics:r}=n.state.field(xn),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||t>0)&&(e<c||t<0)))return i=u.diagnostics,s=a,o=c,!1});let l=n.state.facet(Ta).tooltipFilter;return i&&l&&(i=l(i,n.state)),i?{pos:s,end:o,above:n.state.doc.lineAt(s).to<o,create(){return{dom:Cq(n,i)}}}:null}function Cq(n,e){return De("ul",{class:"cm-tooltip-lint"},e.map(t=>B3(n,t,!1)))}const Tq=n=>{let e=n.state.field(xn,!1);(!e||!e.panel)&&n.dispatch({effects:Sq(n.state,[Y1.of(!0)])});let t=O1(n,_a.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},tS=n=>{let e=n.state.field(xn,!1);return!e||!e.panel?!1:(n.dispatch({effects:Y1.of(!1)}),!0)},_q=n=>{let e=n.state.field(xn,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},Pq=[{key:"Mod-Shift-m",run:Tq,preventDefault:!0},{key:"F8",run:_q}],Ta=ee.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Dr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:nS,tooltipFilter:nS,needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t,hideOn:(e,t)=>e?t?(r,i,s)=>e(r,i,s)||t(r,i,s):e:t,autoPanel:(e,t)=>e||t})}}});function nS(n,e){return n?e?(t,r)=>e(n(t,r),r):n:e}function Z3(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function B3(n,e,t){var r;let i=t?Z3(e.actions):[];return De("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},De("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=Ao(n.state.field(xn).diagnostics,e);p&&s.apply(n,p.from,p.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,h=u<0?c:[c.slice(0,u),De("u",c.slice(u,u+1)),c.slice(u+1)],f=s.markClass?" "+s.markClass:"";return De("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&De("div",{class:"cm-diagnosticSource"},e.source))}class Qq extends In{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return De("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class rS{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=B3(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _a{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)tS(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Z3(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==i.keyCode){let a=Ao(this.view.state.field(xn).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;i.preventDefault()},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=De("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=De("div",{class:"cm-panel-lint"},this.list,De("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>tS(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(xn).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(xn),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let h=-1,f;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==u){h=d;break}h<0?(f=new rS(this.view,u),this.items.splice(r,0,f),i=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),i=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),s=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new rS(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(xn),r=Ao(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:D3.of(r)})}static open(e){return new _a(e)}}function $q(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Yc(n){return $q(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Eq=j.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:Yc("#d11")},".cm-lintRange-warning":{backgroundImage:Yc("orange")},".cm-lintRange-info":{backgroundImage:Yc("#999")},".cm-lintRange-hint":{backgroundImage:Yc("#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}}});function Aq(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function Mq(n){let e="hint",t=1;for(let r of n){let i=Aq(r.severity);i>t&&(t=i,e=r.severity)}return e}const Lq=[xn,j.decorations.compute([xn],n=>{let{selected:e,panel:t}=n.field(xn);return!e||!t||e.from==e.to?se.none:se.set([wq.range(e.from,e.to)])}),RZ(vq,{hideOn:kq}),Eq],Iq=[ET(),UZ(),dZ(),uV(),VB(),nZ(),lZ(),Se.allowMultipleSelections.of(!0),$B(),JT(qB,{fallback:!0}),JB(),Vz(),Jz(),CZ(),PZ(),bZ(),UW(),Ja.of([...qz,...pF,...Oq,...bV,...DB,...p_,...Pq])],cc=C.forwardRef(({title:n,children:e},t)=>{const r=nn(Wa);return C.createElement(iw,{delayDuration:100},C.createElement(sw,null,C.createElement(ow,{ref:t,asChild:!0},C.createElement("span",{className:H.tooltipTrigger},e)),C.createElement(lw,{container:r?.current},C.createElement(aw,{className:Me(H.tooltipContent),sideOffset:10},n))))}),Rq=C.forwardRef(({children:n,className:e,...t},r)=>C.createElement(I9,{...t,ref:r,className:Me(e,H.selectItem)},C.createElement(R9,null,n))),Nq=({title:n,placeholder:e,className:t})=>{const[r,i]=Wt(yn,rr);return C.createElement(cc,{title:n},C.createElement(Q9,{"aria-label":e,className:Me(H.selectTrigger,t),"data-toolbar-item":!0,disabled:r},C.createElement($9,{placeholder:e}),C.createElement(E9,{className:H.selectDropdownArrow},i("arrow_drop_down"))))},Dq=({children:n,className:e=H.selectContainer})=>{const t=nn(Wa);return C.createElement(A9,{container:t?.current},C.createElement(M9,{className:Me(e,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},C.createElement(L9,{"data-editor-dropdown":!0},n)))},Zq=n=>C.createElement(_9,{value:n.value||"",onValueChange:n.onChange,disabled:n.disabled},C.createElement(Nq,{title:n.triggerTitle,placeholder:n.placeholder}),C.createElement(Dq,null,n.items.map((e,t)=>e==="separator"?C.createElement(P9,{key:t}):C.createElement(Rq,{key:t,value:e.value},e.label))));function Bq(n){try{const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?nx(t)?r:i:nx(e)?r:i}catch{return null}}function z3(n){const e=X(),t=window.getSelection(),r=document.activeElement,i=n.getRootElement();if(e!==null&&t!==null&&i!==null&&i.contains(t.anchorNode)&&n.isEditable()){const s=t.getRangeAt(0);let o;if(t.isCollapsed){let l=t.anchorNode;l?.nodeType==3&&(l=l.parentNode),o=l.getBoundingClientRect(),o.width=0}else if(t.anchorNode===i){let l=i;for(;l.firstElementChild!=null;)l=l.firstElementChild;o=l.getBoundingClientRect()}else o=s.getBoundingClientRect();return{top:Math.round(o.top),left:Math.round(o.left),width:Math.round(o.width),height:Math.round(o.height)}}else if(!r||r.className!=="link-input")return null;return null}function zq({url:n,title:e,onSubmit:t,onCancel:r,linkAutocompleteSuggestions:i}){const{register:s,handleSubmit:o,control:l,setValue:a,reset:c}=rw({values:{url:n,title:e}}),u=kn();return C.createElement("form",{onSubmit:h=>{o(t)(h),h.stopPropagation(),h.preventDefault()},onReset:h=>{h.stopPropagation(),r()},className:Me(H.multiFieldForm,H.linkDialogEditForm)},C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"link-url"},u("createLink.url","URL")),C.createElement(U5,{register:s,initialInputValue:n,inputName:"url",suggestions:i,setValue:a,control:l,placeholder:u("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"link-title"},u("createLink.title","Title")),C.createElement("input",{id:"link-title",className:H.textInput,size:40,...s("title")})),C.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},C.createElement("button",{type:"submit",title:u("createLink.saveTooltip","Set URL"),"aria-label":u("createLink.saveTooltip","Set URL"),className:Me(H.primaryButton)},u("dialogControls.save","Save")),C.createElement("button",{type:"reset",title:u("createLink.cancelTooltip","Cancel change"),"aria-label":u("createLink.cancelTooltip","Cancel change"),className:Me(H.secondaryButton)},u("dialogControls.cancel","Cancel"))))}const Vq=()=>{const[n,e,t,r,i,s]=Wt(Wa,st,rr,Bt,j3,Y3),o=ut(V3),l=ut(F3),a=ut(X3),c=ut(W3),u=ut(q3);C.useEffect(()=>{const m=()=>{e?.getEditorState().read(()=>{o(!0)})};return window.addEventListener("resize",m),window.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m)}},[e,o]);const[h,f]=C.useState(!1),d=kn();if(r.type==="inactive")return null;const p=r.rectangle,g=r.type==="preview"&&r.url.startsWith("http");return C.createElement(y9,{open:!0},C.createElement(k9,{"data-visible":r.type==="edit",className:H.linkDialogAnchor,style:{top:`${p.top}px`,left:`${p.left}px`,width:`${p.width}px`,height:`${p.height}px`}}),C.createElement(S9,{container:n?.current},C.createElement(w9,{className:Me(H.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:m=>{m.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&C.createElement(zq,{url:r.url,title:r.title,onSubmit:l,onCancel:a.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&C.createElement(C.Fragment,null,C.createElement("a",{className:H.linkDialogPreviewAnchor,href:r.url,...g?{target:"_blank",rel:"noreferrer"}:{},onClick:m=>{s!==null&&(m.preventDefault(),s(r.url))},title:g?d("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},C.createElement("span",null,r.url),g&&t("open_in_new")),C.createElement(Kd,{onClick:()=>{c()},title:d("linkPreview.edit","Edit link URL"),"aria-label":d("linkPreview.edit","Edit link URL")},t("edit")),C.createElement(iw,null,C.createElement(sw,{open:h},C.createElement(ow,{asChild:!0},C.createElement(Kd,{title:d("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":d("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},t(h?"check":"content_copy"))),C.createElement(lw,{container:n?.current},C.createElement(aw,{className:Me(H.tooltipContent),sideOffset:5},d("linkPreview.copied","Copied!"),C.createElement(C9,null))))),C.createElement(Kd,{title:d("linkPreview.remove","Remove link"),"aria-label":d("linkPreview.remove","Remove link"),onClick:()=>{u()}},t("link_off"))),C.createElement(v9,{className:H.popoverArrow}))))},Kd=C.forwardRef(({className:n,...e},t)=>C.createElement("button",{className:Me(H.actionButton,n),ref:t,...e}));function Om(n){if(!n)return null;const e=Bq(n);if(e===null)return null;const t=e.getParent();return xr(t)?t:xr(e)?e:null}const V3=bt(),Bt=oe({type:"inactive"},n=>{n.pub(oa,e=>e.registerCommand(Ma,()=>n.getValue(Bt).type==="preview"?(n.pub(Bt,{type:"inactive"}),!0):!1,Ye)),n.sub(n.pipe(Ei),e=>{e!=="rich-text"&&n.pub(Bt,{type:"inactive"})}),n.pub(oa,e=>e.registerCommand(Rw,t=>{if(t.key==="k"&&(ju?t.metaKey:t.ctrlKey)&&!n.getValue(yn)){const r=X();return z(r)?(n.pub(H1),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},$p)),n.link(n.pipe(W3,Je(Bt),js(([,e])=>{if(e.type==="preview")return{type:"edit",initialUrl:e.url,url:e.url,title:e.title,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),Bt),n.sub(n.pipe(F3,Je(st,Bt,xo)),([e,t,r,i])=>{var s,o;const l=((s=e.url)==null?void 0:s.trim())??"",a=((o=e.title)==null?void 0:o.trim())??"";if(l!==""){if(i?.isCollapsed()){const c=a||l;t?.update(()=>{const u=Om(i);if(u)u.setURL(l),u.setTitle(a);else{const h=Ss(l,{title:a});h.append(He(c)),Do([h]),h.select()}},{discrete:!0})}else t?.dispatchCommand(yo,{url:l,title:a});n.pub(Bt,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:a,url:l})}else r.type==="edit"&&r.initialUrl!==""&&t?.dispatchCommand(yo,null),n.pub(Bt,{type:"inactive"})}),n.link(n.pipe(X3,Je(Bt,st),js(([,e,t])=>{if(e.type==="edit")return t?.focus(),e.initialUrl===""?{type:"inactive"}:{type:"preview",url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),Bt),n.link(n.pipe(n.combine(xo,V3),Je(st,Bt,yn),js(([[e],t,r,i])=>{if(z(e)&&t&&!i){const s=Om(e);if(s){const o=z3(t);return o?{type:"preview",url:s.getURL(),linkNodeKey:s.getKey(),title:s.getTitle(),rectangle:o}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),Bt)}),F3=bt(),X3=Ni();Ni();const W3=Ni(),q3=Ni(n=>{n.sub(n.pipe(q3,Je(st)),([,e])=>{e?.dispatchCommand(yo,null)})}),H1=Ni(n=>{n.sub(n.pipe(H1,Je(xo,st),Ea(([,e])=>z(e))),([,e,t])=>{t?.focus(()=>{setTimeout(()=>{t.getEditorState().read(()=>{const r=Om(e),i=z3(t);r?n.pub(Bt,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):n.pub(Bt,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})})}),j3=oe([]),Y3=oe(null),H3=oe(null,n=>{n.pub(oa,e=>{function t(r){const[i,s]=n.getValues([yn,H3]);!i||s===null||e.update(()=>{const o=Ar(r.target);if(o!==null){const l=Zi(o,a=>a instanceof hi);l!==null&&s(r,l,l.getURL())}})}return e.registerRootListener((r,i)=>{r&&r.addEventListener("click",t),i&&i.removeEventListener("click",t)})})}),Fq=Ln({init(n,e){n.pub(Qs,e?.LinkDialog??Vq),n.pub(Y3,e?.onClickLinkCallback??null),n.pub(H3,e?.onReadOnlyClickLinkCallback??null)},update(n,e={}){n.pub(j3,e.linkAutocompleteSuggestions??[])}});function U1(n,e){return C.forwardRef((t,r)=>{const i=Me(e.className,t.className);return C.createElement(n,{...e,...t,className:i,ref:r})})}function Xq(n){return({title:e,children:t,...r})=>C.createElement(n,{...r},C.createElement(cc,{title:e},t))}const Wq=({readOnly:n,children:e,className:t})=>C.createElement(HL,{className:Me("mdxeditor-toolbar",H.toolbarRoot,{[H.readOnlyToolbarRoot]:n},t),...n?{tabIndex:-1}:{}},e),qq=U1(P5,{className:H.toolbarButton,"data-toolbar-item":!0}),jq=Xq(qq),U3=U1(GL,{className:H.toolbarToggleItem,"data-toolbar-item":!0});U1(RO,{type:"single",className:H.toolbarToggleSingleGroup});const G3=C.forwardRef(({on:n,title:e,children:t,disabled:r,...i},s)=>C.createElement(RO,{type:"single",className:H.toolbarToggleSingleGroup,...i,value:n?"on":"off",ref:s},C.createElement(U3,{"aria-label":e,value:"on",disabled:r},C.createElement(cc,{title:e},t)))),Yq=({items:n})=>C.createElement("div",{className:H.toolbarGroupOfGroups},n.map((e,t)=>C.createElement(G3,{key:t,title:e.title,on:e.active,onValueChange:r=>{e.onChange(r==="on")},disabled:e.disabled},e.contents))),K3=({value:n,onChange:e,className:t,ggClassName:r,items:i})=>{const s=kn();return C.createElement("div",{className:Me(H.toolbarGroupOfGroups,r)},C.createElement(RO,{"aria-label":s("toolbar.toggleGroup","toggle group"),type:"single",className:Me(H.toolbarToggleSingleGroup,t),onValueChange:e,value:n||"",onFocus:o=>{o.preventDefault()}},i.map((o,l)=>C.createElement(U3,{key:l,"aria-label":o.title,value:o.value},C.createElement(cc,{title:o.title},o.contents)))))},Hc=UL,Jd=oe(()=>null),ep=oe(""),iS=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",Hq=Ln({init(n,e){const t=e?.toolbarPosition==="bottom"?sA:iA;n.pubIn({[Jd]:e?.toolbarContents??iS,[ep]:e?.toolbarClassName??"",[t]:()=>{const[r,i,s]=Wt(Jd,yn,ep);return C.createElement(Wq,{className:s,readOnly:i},r())}})},update(n,e){n.pub(Jd,e?.toolbarContents??iS),n.pub(ep,e?.toolbarClassName??"")}});class ct{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}offset(e,t=e){return new ct(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function _s(n,e,t,r,i,s){if(n==r)return[];let o=K1(n,e,t,r,i,s),l=J1(n,e+o,t,r,i+o,s);e+=o,t-=l,i+=o,s-=l;let a=t-e,c=s-i;if(!a||!c)return[new ct(e,t,i,s)];if(a>c){let h=n.slice(e,t).indexOf(r.slice(i,s));if(h>-1)return[new ct(e,e+h,i,i),new ct(e+h+c,t,s,s)]}else if(c>a){let h=r.slice(i,s).indexOf(n.slice(e,t));if(h>-1)return[new ct(e,e,i,i+h),new ct(t,t,i+h+a,s)]}if(a==1||c==1)return[new ct(e,t,i,s)];let u=tP(n,e,t,r,i,s);if(u){let[h,f,d]=u;return _s(n,e,h,r,i,f).concat(_s(n,h+d,t,r,f+d,s))}return Uq(n,e,t,r,i,s)}let Cl=1e9,Tl=0,G1=!1;function Uq(n,e,t,r,i,s){let o=t-e,l=s-i;if(Cl<1e9&&Math.min(o,l)>Cl*16||Tl>0&&Date.now()>Tl)return Math.min(o,l)>Cl*64?[new ct(e,t,i,s)]:sS(n,e,t,r,i,s);let a=Math.ceil((o+l)/2);tp.reset(a),np.reset(a);let c=(d,p)=>n.charCodeAt(e+d)==r.charCodeAt(i+p),u=(d,p)=>n.charCodeAt(t-d-1)==r.charCodeAt(s-p-1),h=(o-l)%2!=0?np:null,f=h?null:tp;for(let d=0;d<a;d++){if(d>Cl||Tl>0&&!(d&63)&&Date.now()>Tl)return sS(n,e,t,r,i,s);let p=tp.advance(d,o,l,a,h,!1,c)||np.advance(d,o,l,a,f,!0,u);if(p)return Gq(n,e,t,e+p[0],r,i,s,i+p[1])}return[new ct(e,t,i,s)]}class J3{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;t<this.len;t++)this.vec[t]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,r,i,s,o,l){for(let a=-e+this.start;a<=e-this.end;a+=2){let c=i+a,u=a==-e||a!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,h=u-a;for(;u<t&&h<r&&l(u,h);)u++,h++;if(this.vec[c]=u,u>t)this.end+=2;else if(h>r)this.start+=2;else if(s){let f=i+(t-r)-a;if(f>=0&&f<this.len&&s.vec[f]!=-1)if(o){let d=s.vec[f];if(d>=t-u)return[d,i+d-f]}else{let d=t-s.vec[f];if(u>=d)return[u,h]}}}return null}}const tp=new J3,np=new J3;function Gq(n,e,t,r,i,s,o,l){let a=!1;return!Mo(n,r)&&++r==t&&(a=!0),!Mo(i,l)&&++l==o&&(a=!0),a?[new ct(e,t,s,o)]:_s(n,e,r,i,s,l).concat(_s(n,r,t,i,l,o))}function eP(n,e){let t=1,r=Math.min(n,e);for(;t<r;)t=t<<1;return t}function K1(n,e,t,r,i,s){if(e==t||e==s||n.charCodeAt(e)!=r.charCodeAt(i))return 0;let o=eP(t-e,s-i);for(let l=e,a=i;;){let c=l+o,u=a+o;if(c>t||u>s||n.slice(l,c)!=r.slice(a,u)){if(o==1)return l-e-(Mo(n,l)?0:1);o=o>>1}else{if(c==t||u==s)return c-e;l=c,a=u}}}function J1(n,e,t,r,i,s){if(e==t||i==s||n.charCodeAt(t-1)!=r.charCodeAt(s-1))return 0;let o=eP(t-e,s-i);for(let l=t,a=s;;){let c=l-o,u=a-o;if(c<e||u<i||n.slice(c,l)!=r.slice(u,a)){if(o==1)return t-l-(Mo(n,l)?0:1);o=o>>1}else{if(c==e||u==i)return t-c;l=c,a=u}}}function xm(n,e,t,r,i,s,o,l){let a=r.slice(i,s),c=null;for(;;){if(c||o<l)return c;for(let u=e+o;;){Mo(n,u)||u++;let h=u+o;if(Mo(n,h)||(h+=h==u+1?1:-1),h>=t)break;let f=n.slice(u,h),d=-1;for(;(d=a.indexOf(f,d+1))!=-1;){let p=K1(n,h,t,r,i+d+f.length,s),g=J1(n,e,u,r,i,i+d),m=f.length+p+g;(!c||c[2]<m)&&(c=[u-g,i+d-g,m])}u=h}if(l<0)return c;o=o>>1}}function tP(n,e,t,r,i,s){let o=t-e,l=s-i;if(o<l){let a=tP(r,i,s,n,e,t);return a&&[a[1],a[0],a[2]]}return o<4||l*2<o?null:xm(n,e,t,r,i,s,Math.floor(o/4),-1)}function sS(n,e,t,r,i,s){G1=!0;let o=t-e,l=s-i,a;if(o<l){let f=xm(r,i,s,n,e,t,Math.floor(o/6),50);a=f&&[f[1],f[0],f[2]]}else a=xm(n,e,t,r,i,s,Math.floor(l/6),50);if(!a)return[new ct(e,t,i,s)];let[c,u,h]=a;return _s(n,e,c,r,i,u).concat(_s(n,c+h,t,r,u+h,s))}function nP(n,e){for(let t=1;t<n.length;t++){let r=n[t-1],i=n[t];r.toA>i.fromA-e&&r.toB>i.fromB-e&&(n[t-1]=new ct(r.fromA,i.toA,r.fromB,i.toB),n.splice(t--,1))}}function Kq(n,e,t){for(;;){nP(t,1);let r=!1;for(let i=0;i<t.length;i++){let s=t[i],o,l;(o=K1(n,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new ct(s.fromA+o,s.toA,s.fromB+o,s.toB)),(l=J1(n,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new ct(s.fromA,s.toA-l,s.fromB,s.toB-l));let a=s.toA-s.fromA,c=s.toB-s.fromB;if(a&&c)continue;let u=s.fromA-(i?t[i-1].toA:0),h=(i<t.length-1?t[i+1].fromA:n.length)-s.toA;if(!u||!h)continue;let f=a?n.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=f.length&&n.slice(s.fromA-u,s.fromA)==f.slice(f.length-u)?(t[i]=new ct(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),r=!0):h<=f.length&&n.slice(s.toA,s.toA+h)==f.slice(0,h)&&(t[i]=new ct(s.fromA+h,s.toA+h,s.fromB+h,s.toB+h),r=!0)}if(!r)break}return t}function Jq(n,e,t){for(let r=0,i=0;i<n.length;i++){let s=n[i],o=s.toA-s.fromA,l=s.toB-s.fromB;if(o&&l||o>3||l>3){let a=i==n.length-1?e.length:n[i+1].fromA,c=s.fromA-r,u=a-s.toA,h=lS(e,s.fromA,c),f=oS(e,s.toA,u),d=s.fromA-h,p=f-s.toA;if((!o||!l)&&d&&p){let g=Math.max(o,l),[m,O,b]=o?[e,s.fromA,s.toA]:[t,s.fromB,s.toB];g>d&&e.slice(h,s.fromA)==m.slice(b-d,b)?(s=n[i]=new ct(h,h+o,s.fromB-d,s.toB-d),h=s.fromA,f=oS(e,s.toA,a-s.toA)):g>p&&e.slice(s.toA,f)==m.slice(O,O+p)&&(s=n[i]=new ct(f-o,f,s.fromB+p,s.toB+p),f=s.toA,h=lS(e,s.fromA,s.fromA-r)),d=s.fromA-h,p=f-s.toA}if(d||p)s=n[i]=new ct(s.fromA-d,s.toA+p,s.fromB-d,s.toB+p);else if(o){if(!l){let g=cS(e,s.fromA,s.toA),m,O=g<0?-1:aS(e,s.toA,s.fromA);g>-1&&(m=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+m)?s=n[i]=s.offset(m):O>-1&&(m=s.toA-O)<=c&&e.slice(s.fromA-m,s.fromA)==e.slice(O,s.toA)&&(s=n[i]=s.offset(-m))}}else{let g=cS(t,s.fromB,s.toB),m,O=g<0?-1:aS(t,s.toB,s.fromB);g>-1&&(m=g-s.fromB)<=u&&t.slice(s.fromB,g)==t.slice(s.toB,s.toB+m)?s=n[i]=s.offset(m):O>-1&&(m=s.toB-O)<=c&&t.slice(s.fromB-m,s.fromB)==t.slice(O,s.toB)&&(s=n[i]=s.offset(-m))}}r=s.toA}return nP(n,3),n}let fs;try{fs=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function rP(n){return n>48&&n<58||n>64&&n<91||n>96&&n<123}function iP(n,e){if(e==n.length)return 0;let t=n.charCodeAt(e);return t<192?rP(t)?1:0:fs?!lP(t)||e==n.length-1?fs.test(String.fromCharCode(t))?1:0:fs.test(n.slice(e,e+2))?2:0:0}function sP(n,e){if(!e)return 0;let t=n.charCodeAt(e-1);return t<192?rP(t)?1:0:fs?!aP(t)||e==1?fs.test(String.fromCharCode(t))?1:0:fs.test(n.slice(e-2,e))?2:0:0}const oP=8;function oS(n,e,t){if(e==n.length||!sP(n,e))return e;for(let r=e,i=e+t,s=0;s<oP;s++){let o=iP(n,r);if(!o||r+o>i)return r;r+=o}return e}function lS(n,e,t){if(!e||!iP(n,e))return e;for(let r=e,i=e-t,s=0;s<oP;s++){let o=sP(n,r);if(!o||r-o<i)return r;r-=o}return e}function aS(n,e,t){for(;e!=t;e--)if(n.charCodeAt(e-1)==10)return e;return-1}function cS(n,e,t){for(;e!=t;e++)if(n.charCodeAt(e)==10)return e;return-1}const lP=n=>n>=55296&&n<=56319,aP=n=>n>=56320&&n<=57343;function Mo(n,e){return!e||e==n.length||!lP(n.charCodeAt(e-1))||!aP(n.charCodeAt(e))}function ej(n,e,t){var r;return Cl=((r=t?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,Tl=t?.timeout?Date.now()+t.timeout:0,G1=!1,Kq(n,e,_s(n,0,n.length,e,0,e.length))}function cP(){return!G1}function uP(n,e,t){return Jq(ej(n,e,t),n,e)}const Sr=ee.define({combine:n=>n[0]}),bm=ge.define(),tj=ee.define(),Lo=lt.define({create(n){return null},update(n,e){for(let t of e.effects)t.is(bm)&&(n=t.value);for(let t of e.state.facet(tj))n=t(n,e);return n}});class ao{constructor(e,t,r,i,s,o=!0){this.changes=e,this.fromA=t,this.toA=r,this.fromB=i,this.toB=s,this.precise=o}offset(e,t){return e||t?new ao(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,r){let i=uP(e.toString(),t.toString(),r);return hP(i,e,t,0,0,cP())}static updateA(e,t,r,i,s){return pS(dS(e,i,!0,r.length),e,t,r,s)}static updateB(e,t,r,i,s){return pS(dS(e,i,!1,t.length),e,t,r,s)}}function uS(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.to==n&&s.to==e&&n<t.length&&e<r.length?[n+1,e+1]:[i.from,s.from]}function hS(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.from==n&&s.from==e?[n,e]:[i.to+1,s.to+1]}function hP(n,e,t,r,i,s){let o=[];for(let l=0;l<n.length;l++){let a=n[l],[c,u]=uS(a.fromA+r,a.fromB+i,e,t),[h,f]=hS(a.toA+r,a.toB+i,e,t),d=[a.offset(-c+r,-u+i)];for(;l<n.length-1;){let p=n[l+1],[g,m]=uS(p.fromA+r,p.fromB+i,e,t);if(g>h+1&&m>f+1)break;d.push(p.offset(-c+r,-u+i)),[h,f]=hS(p.toA+r,p.toB+i,e,t),l++}o.push(new ao(d,c,Math.max(c,h),u,Math.max(u,f),s))}return o}const Uc=1e3;function fS(n,e,t,r){let i=0,s=n.length;for(;;){if(i==s){let u=0,h=0;i&&({toA:u,toB:h}=n[i-1]);let f=e-(t?u:h);return[u+f,h+f]}let o=i+s>>1,l=n[o],[a,c]=t?[l.fromA,l.toA]:[l.fromB,l.toB];if(a>e)s=o;else if(c<=e)i=o+1;else return r?[l.fromA,l.fromB]:[l.toA,l.toB]}}function dS(n,e,t,r){let i=[];return e.iterChangedRanges((s,o,l,a)=>{let c=0,u=t?e.length:r,h=0,f=t?r:e.length;s>Uc&&([c,h]=fS(n,s-Uc,t,!0)),o<e.length-Uc&&([u,f]=fS(n,o+Uc,t,!1));let d=a-l-(o-s),p,[g,m]=t?[d,0]:[0,d];i.length&&(p=i[i.length-1]).toA>=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:f,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:c,toA:u,fromB:h,toB:f,diffA:g,diffB:m})}),i}function pS(n,e,t,r,i){if(!n.length)return e;let s=[];for(let o=0,l=0,a=0,c=0;;o++){let u=o==n.length?null:n[o],h=u?u.fromA+l:t.length,f=u?u.fromB+a:r.length;for(;c<e.length;){let m=e[c];if(Math.min(t.length,m.toA+l)>h||Math.min(r.length,m.toB+a)>f)break;s.push(m.offset(l,a)),c++}if(!u)break;let d=u.toA+l+u.diffA,p=u.toB+a+u.diffB,g=uP(t.sliceString(h,d),r.sliceString(f,p),i);for(let m of hP(g,t,r,h,f,cP()))s.push(m);for(l+=u.diffA,a+=u.diffB;c<e.length;){let m=e[c];if(m.fromA+l>d&&m.fromB+a>p)break;c++}}return s}const nj={scanLimit:500},fP=ot.fromClass(class{constructor(n){({deco:this.deco,gutter:this.gutter}=OS(n))}update(n){(n.docChanged||n.viewportChanged||rj(n.startState,n.state)||ij(n.startState,n.state))&&({deco:this.deco,gutter:this.gutter}=OS(n.view))}},{decorations:n=>n.deco}),Gc=sr.low(PT({class:"cm-changeGutter",markers:n=>{var e;return((e=n.plugin(fP))===null||e===void 0?void 0:e.gutter)||ve.empty}}));function rj(n,e){return n.field(Lo,!1)!=e.field(Lo,!1)}function ij(n,e){return n.facet(Sr)!=e.facet(Sr)}const gS=se.line({class:"cm-changedLine"}),sj=se.mark({class:"cm-changedText"}),oj=se.mark({tagName:"ins",class:"cm-insertedLine"}),lj=se.mark({tagName:"del",class:"cm-deletedLine"}),mS=new class extends Ir{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function aj(n,e,t,r,i,s){let o=t?n.fromA:n.fromB,l=t?n.toA:n.toB,a=0;if(o!=l){i.add(o,o,gS),i.add(o,l,t?lj:oj),s&&s.add(o,o,mS);for(let c=e.iterRange(o,l-1),u=o;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,gS),s&&s.add(u,u,mS);continue}let h=u+c.value.length;if(r)for(;a<n.changes.length;){let f=n.changes[a],d=o+(t?f.fromA:f.fromB),p=o+(t?f.toA:f.toB),g=Math.max(u,d),m=Math.min(h,p);if(g<m&&i.add(g,m,sj),p<h)a++;else break}u=h}}}function OS(n){let e=n.state.field(Lo),{side:t,highlightChanges:r,markGutter:i,overrideChunk:s}=n.state.facet(Sr),o=t=="a",l=new sn,a=i?new sn:null,{from:c,to:u}=n.viewport;for(let h of e){if((o?h.fromA:h.fromB)>=u)break;(o?h.toA:h.toB)>c&&(!s||!s(n.state,h,l,a))&&aj(h,n.state.doc,o,r,l,a)}return{deco:l.finish(),gutter:a&&a.finish()}}class Kc extends In{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Eh=ge.define({map:(n,e)=>n.map(e)}),_l=lt.define({create:()=>se.none,update:(n,e)=>{for(let t of e.effects)if(t.is(Eh))return t.value;return n.map(e.changes)},provide:n=>j.decorations.from(n)}),Jc=.01;function xS(n,e){if(n.size!=e.size)return!1;let t=n.iter(),r=e.iter();for(;t.value;){if(t.from!=r.from||Math.abs(t.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;t.next(),r.next()}return!0}function cj(n,e,t){let r=new sn,i=new sn,s=n.state.field(_l).iter(),o=e.state.field(_l).iter(),l=0,a=0,c=0,u=0,h=n.viewport,f=e.viewport;for(let m=0;;m++){let O=m<t.length?t[m]:null,b=O?O.fromA:n.state.doc.length,x=O?O.fromB:e.state.doc.length;if(l<b){let y=n.lineBlockAt(l).top+c,w=e.lineBlockAt(a).top+u,k=y-w;k<-Jc?(c-=k,r.add(l,l,se.widget({widget:new Kc(-k),block:!0,side:-1}))):k>Jc&&(u+=k,i.add(a,a,se.widget({widget:new Kc(k),block:!0,side:-1})))}if(b>l+1e3&&l<h.from&&b>h.from&&a<f.from&&x>f.from){let y=Math.min(h.from-l,f.from-a);l+=y,a+=y,m--}else if(O)l=O.toA,a=O.toB;else break;for(;s.value&&s.from<l;)c-=s.value.spec.widget.height,s.next();for(;o.value&&o.from<a;)u-=o.value.spec.widget.height,o.next()}for(;s.value;)c-=s.value.spec.widget.height,s.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let d=n.contentHeight+c-(e.contentHeight+u);d<Jc?r.add(n.state.doc.length,n.state.doc.length,se.widget({widget:new Kc(-d),block:!0,side:1})):d>Jc&&i.add(e.state.doc.length,e.state.doc.length,se.widget({widget:new Kc(d),block:!0,side:1}));let p=r.finish(),g=i.finish();xS(p,n.state.field(_l))||n.dispatch({effects:Eh.of(p)}),xS(g,e.state.field(_l))||e.dispatch({effects:Eh.of(g)})}const ym=ge.define({map:(n,e)=>e.mapPos(n)});class uj extends In{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent=e.state.phrase("$ unchanged lines",this.lines),t.addEventListener("click",r=>{let i=e.posAtDOM(r.target);e.dispatch({effects:ym.of(i)});let{side:s,sibling:o}=e.state.facet(Sr);o&&o().dispatch({effects:ym.of(hj(i,e.state.field(Lo),s=="a"))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function hj(n,e,t){let r=0,i=0;for(let s=0;;s++){let o=s<e.length?e[s]:null;if(!o||(t?o.fromA:o.fromB)>=n)return i+(n-r);[r,i]=t?[o.toA,o.toB]:[o.toB,o.toA]}}const fj=lt.define({create(n){return se.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(ym)&&(n=n.update({filter:r=>r!=t.value}));return n},provide:n=>j.decorations.from(n)});function bS({margin:n=3,minSize:e=4}){return fj.init(t=>dj(t,n,e))}function dj(n,e,t){let r=new sn,i=n.facet(Sr).side=="a",s=n.field(Lo),o=1;for(let l=0;;l++){let a=l<s.length?s[l]:null,c=l?o+e:1,u=a?n.doc.lineAt(i?a.fromA:a.fromB).number-1-e:n.doc.lines,h=u-c+1;if(h>=t&&r.add(n.doc.line(c).from,n.doc.line(u).to,se.replace({widget:new uj(h),block:!0})),!a)break;o=n.doc.lineAt(Math.min(n.doc.length,i?a.toA:a.toB)).number}return r.finish()}const pj=j.styleModule.of(new li({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),gj=j.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),yS=new jo,eu=new jo;class mj{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||nj;let t=[sr.low(fP),gj,pj,_l,j.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(d=>d.is(Eh)))&&this.measure()})],r=[Sr.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(Gc);let i=Se.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],j.editorAttributes.of({class:"cm-merge-a"}),eu.of(r),t]}),s=[Sr.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(Gc);let o=Se.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],j.editorAttributes.of({class:"cm-merge-b"}),eu.of(s),t]});this.chunks=ao.build(i.doc,o.doc,this.diffConf);let l=[Lo.init(()=>this.chunks),yS.of(e.collapseUnchanged?bS(e.collapseUnchanged):[])];i=i.update({effects:ge.appendConfig.of(l)}).state,o=o.update({effects:ge.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(a=="a-b"?c:u),this.editorDOM.appendChild(a=="a-b"?u:c),this.a=new j({state:i,parent:c,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new j({state:o,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(r=>r.docChanged)){let r=e[e.length-1],i=e.reduce((o,l)=>o.compose(l.changes),at.empty(e[0].startState.doc.length));this.chunks=t==this.a?ao.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):ao.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),t.update([...e,r.state.update({effects:bm.of(this.chunks)})]);let s=t==this.a?this.b:this.a;s.update([s.state.update({effects:bm.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,l=this.b.dom.parentNode;o.remove(),l.remove(),this.editorDOM.insertBefore(s?o:l,this.editorDOM.firstChild),this.editorDOM.appendChild(s?l:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,o=this.revertToA,l=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(l=e.renderRevertControl),this.setupRevertControls(s,o,l)}let t="highlightChanges"in e,r="gutter"in e,i="collapseUnchanged"in e;if(t||r||i){let s=[],o=[];if(t||r){let l=this.a.state.facet(Sr),a=r?e.gutter!==!1:l.markGutter,c=t?e.highlightChanges!==!1:l.highlightChanges;s.push(eu.reconfigure([Sr.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:a}),a?Gc:[]])),o.push(eu.reconfigure([Sr.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:a}),a?Gc:[]]))}if(i){let l=yS.reconfigure(e.collapseUnchanged?bS(e.collapseUnchanged):[]);s.push(l),o.push(l)}this.a.dispatch({effects:s}),this.b.dispatch({effects:o})}this.scheduleMeasure()}setupRevertControls(e,t,r){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){cj(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,r=this.a.viewport,i=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let o=this.chunks[s];if(o.fromA>r.to||o.fromB>i.to)break;if(o.fromA<r.from||o.fromB<i.from)continue;let l=this.a.lineBlockAt(o.fromA).top+"px";for(;t&&+t.dataset.chunk<s;)t=kS(t);t&&t.dataset.chunk==String(s)?(t.style.top!=l&&(t.style.top=l),t=t.nextSibling):e.insertBefore(this.renderRevertButton(l,s),t)}for(;t;)t=kS(t)}renderRevertButton(e,t){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",i),r.setAttribute("title",i),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=e,r.setAttribute("data-chunk",String(t)),r}revertClicked(e){let t=e.target,r;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(r=this.chunks[t.dataset.chunk])){let[i,s,o,l,a,c]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],u=i.state.sliceDoc(o,Math.max(o,l-1));o!=l&&c<=s.state.doc.length&&(u+=i.state.lineBreak),s.dispatch({changes:{from:a,to:Math.min(s.state.doc.length,c),insert:u},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function kS(n){let e=n.nextSibling;return n.remove(),e}class Ah{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new Ah(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,l){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=l,this.hashProp=[[be.contextHash,i]]}addChild(e,t){e.prop(be.contextHash)!=this.hash&&(e=new Ee(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Ee(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new Ee(xt.none,i,s,o,this.hashProp)})}}var W;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(W||(W={}));class Oj{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class xj{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 Wl(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,r=0){for(let i=t;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%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 SS(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==W.OrderedList?n0:t0)(t,e,!1);return r>0&&(n.type!=W.BulletList||e0(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const dP={[W.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Pe(W.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Nn(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[W.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[W.OrderedList]:SS,[W.BulletList]:SS,[W.Document](){return!0}};function Nn(n){return n==32||n==9||n==10||n==13}function Wl(n,e=0){for(;e<n.length&&Nn(n.charCodeAt(e));)e++;return e}function wS(n,e,t){for(;e>t&&Nn(n.charCodeAt(e-1));)e--;return e}function pP(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function gP(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function e0(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let i=n.pos+1;i<n.text.length;i++){let s=n.text.charCodeAt(i);if(s==n.next)r++;else if(!Nn(s))return-1}return t&&n.next==45&&xP(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(SP.SetextHeading)>-1||r<3?-1:1}function mP(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function t0(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Nn(n.text.charCodeAt(n.pos+1)))&&(!t||mP(e,W.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function n0(n,e,t){let r=n.pos,i=n.next;for(;i>=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||r<n.text.length-1&&!Nn(n.text.charCodeAt(r+1))||t&&!mP(e,W.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function OP(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function xP(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&Nn(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const km=/^[ \t]*$/,bP=/-->/,yP=/\?>/,Sm=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,bP],[/^\s*<\?/,yP],[/^\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,km],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,km]];function kP(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let i=0,s=Sm.length-(t?1:0);i<s;i++)if(Sm[i][0].test(r))return i;return-1}function vS(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function mi(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==W.CodeText?n[r].to=t:n.push(Pe(W.CodeText,e,t))}const tu={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),i=n.lineStart+r,s=n.lineStart+e.text.length,o=[],l=[];for(mi(o,i,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){mi(l,n.lineStart-1,n.lineStart);for(let a of e.markers)l.push(a)}else{if(e.indent<t)break;{if(l.length){for(let c of l)c.type==W.CodeText?mi(o,c.from,c.to):o.push(c);l=[]}mi(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c);s=n.lineStart+e.text.length;let a=n.lineStart+e.findColumn(e.baseIndent+4);a<s&&mi(o,a,s)}}return l.length&&(l=l.filter(a=>a.type!=W.CodeText),l.length&&(e.markers=l.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-i).finish(W.CodeBlock,s-i),i),!0},FencedCode(n,e){let t=pP(e);if(t<0)return!1;let r=n.lineStart+e.pos,i=e.next,s=t-e.pos,o=e.skipSpace(t),l=wS(e.text,e.text.length,o),a=[Pe(W.CodeMark,r,r+s)];o<l&&a.push(Pe(W.CodeInfo,n.lineStart+o,n.lineStart+l));for(let c=!0,u=!0,h=!1;n.nextLine()&&e.depth>=n.stack.length;c=!1){let f=e.pos;if(e.indent-e.baseIndent<4)for(;f<e.text.length&&e.text.charCodeAt(f)==i;)f++;if(f-e.pos>=s&&e.skipSpace(f)==e.text.length){for(let d of e.markers)a.push(d);u&&h&&mi(a,n.lineStart-1,n.lineStart),a.push(Pe(W.CodeMark,n.lineStart+e.pos,n.lineStart+f)),n.nextLine();break}else{h=!0,c||(mi(a,n.lineStart-1,n.lineStart),u=!1);for(let g of e.markers)a.push(g);let d=n.lineStart+e.basePos,p=n.lineStart+e.text.length;d<p&&(mi(a,d,p),u=!1)}}return n.addNode(n.buffer.writeElements(a,-r).finish(W.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=gP(e);return t<0?!1:(n.startContext(W.Blockquote,e.pos),n.addNode(W.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(e0(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(W.HorizontalRule,t),!0},BulletList(n,e){let t=t0(e,n,!1);if(t<0)return!1;n.block.type!=W.BulletList&&n.startContext(W.BulletList,e.basePos,e.next);let r=vS(e,e.pos+1);return n.startContext(W.ListItem,e.basePos,r-e.baseIndent),n.addNode(W.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=n0(e,n,!1);if(t<0)return!1;n.block.type!=W.OrderedList&&n.startContext(W.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=vS(e,e.pos+t);return n.startContext(W.ListItem,e.basePos,r-e.baseIndent),n.addNode(W.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=OP(e);if(t<0)return!1;let r=e.pos,i=n.lineStart+r,s=wS(e.text,e.text.length,r),o=s;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==r||!Nn(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=n.buffer.write(W.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,o),i+t+1),-i);o<e.text.length&&l.write(W.HeaderMark,o-r,s-r);let a=l.finish(W.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(a,i),!0},HTMLBlock(n,e){let t=kP(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,i=Sm[t][1],s=[],o=i!=km;for(;!i.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let c of e.markers)s.push(c)}o&&n.nextLine();let l=i==bP?W.CommentBlock:i==yP?W.ProcessingInstructionBlock:W.HTMLBlock,a=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-r).finish(l,a-r),r),!0},SetextHeading:void 0};class bj{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
87
|
+
`:r=="r"?"\r":r=="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 uq(this):new lq(this)}getCursor(e,t=0,r){let i=e.doc?e:Se.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Bs(this,i,t,r):Zs(this,i,t,r)}}class A3{constructor(e){this.spec=e}}function sq(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let l=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(l,e,r,i)}}function Zs(n,e,t,r){let i;return n.wholeWord&&(i=oq(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=sq(n.test,e,i)),new Eo(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function oq(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(_h(i,t-s))!=Ge.Word||e(Ph(i,t-s))!=Ge.Word)&&(e(Ph(i,r-s))!=Ge.Word||e(_h(i,r-s))!=Ge.Word))}class lq extends A3{constructor(e){super(e)}nextMatch(e,t,r){let i=Zs(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=Zs(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=Zs(this.spec,e,s,i),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=Zs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=Zs(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function aq(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function Bs(n,e,t,r){let i;return n.wholeWord&&(i=cq(e.charCategorizer(e.selection.main.head))),n.test&&(i=aq(n.test,e,i)),new Q3(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function _h(n,e){return n.slice(Ot(n,e,!1),e)}function Ph(n,e){return n.slice(e,Ot(n,e))}function cq(n){return(e,t,r)=>!r[0].length||(n(_h(r.input,r.index))!=Ge.Word||n(Ph(r.input,r.index))!=Ge.Word)&&(n(Ph(r.input,r.index+r[0].length))!=Ge.Word||n(_h(r.input,r.index+r[0].length))!=Ge.Word)}class uq extends A3{nextMatch(e,t,r){let i=Bs(this.spec,e,r,e.doc.length).next();return i.done&&(i=Bs(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=Bs(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=Bs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=Bs(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Ca=ge.define(),W1=ge.define(),_i=lt.define({create(n){return new Gd(mm(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ca)?n=new Gd(t.value.create(),n.panel):t.is(W1)&&(n=new Gd(n.query,t.value?q1:null));return n},provide:n=>pa.from(n,e=>e.panel)});class Gd{constructor(e,t){this.query=e,this.panel=t}}const hq=se.mark({class:"cm-searchMatch"}),fq=se.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dq=ot.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(_i))}update(n){let e=n.state.field(_i);(e!=n.startState.field(_i)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return se.none;let{view:t}=this,r=new sn;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:l,to:a}=s[i];for(;i<o-1&&a>s[i+1].from-500;)a=s[++i].to;n.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?fq:hq)})}return r.finish()}},{decorations:n=>n.decorations});function ac(n){return e=>{let t=e.state.field(_i,!1);return t&&t.query.spec.valid?n(e,t):I3(e)}}const Qh=ac((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=N.single(r.from,r.to),s=n.state.facet(Ko);return n.dispatch({selection:i,effects:[j1(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),L3(n),!0}),$h=ac((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=N.single(i.from,i.to),o=n.state.facet(Ko);return n.dispatch({selection:s,effects:[j1(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),L3(n),!0}),pq=ac((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:N.create(t.map(r=>N.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),gq=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let l=new Eo(n.doc,n.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(N.range(l.value.from,l.value.to))}return e(n.update({selection:N.create(s,o),userEvent:"select.search.matches"})),!0},Jk=ac((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,l=[],a,c,u=[];o.from==r&&o.to==i&&(c=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),u.push(j.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+".")));let h=n.state.changes(l);return o&&(a=N.single(o.from,o.to).map(h),u.push(j1(n,o)),u.push(t.facet(Ko).scrollToMatch(a.main,n))),n.dispatch({changes:h,selection:a,effects:u,userEvent:"input.replace"}),!0}),mq=ac((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:j.announce.of(r),userEvent:"input.replace.all"}),!0});function q1(n){return n.state.facet(Ko).createPanel(n)}function mm(n,e){var t,r,i,s,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=n.facet(Ko);return new E3({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function M3(n){let e=O1(n,q1);return e&&e.dom.querySelector("[main-field]")}function L3(n){let e=M3(n);e&&e==n.root.activeElement&&e.select()}const I3=n=>{let e=n.state.field(_i,!1);if(e&&e.panel){let t=M3(n);if(t&&t!=n.root.activeElement){let r=mm(n.state,e.query.spec);r.valid&&n.dispatch({effects:Ca.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[W1.of(!0),e?Ca.of(mm(n.state,e.query.spec)):ge.appendConfig.of(yq)]});return!0},R3=n=>{let e=n.state.field(_i,!1);if(!e||!e.panel)return!1;let t=O1(n,q1);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:W1.of(!1)}),!0},Oq=[{key:"Mod-f",run:I3,scope:"editor search-panel"},{key:"F3",run:Qh,shift:$h,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qh,shift:$h,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:R3,scope:"editor search-panel"},{key:"Mod-Shift-l",run:gq},{key:"Mod-Alt-g",run:jW},{key:"Mod-d",run:iq,preventDefault:!0}];class xq{constructor(e){this.view=e;let t=this.query=e.state.field(_i).query.spec;this.commit=this.commit.bind(this),this.searchField=De("input",{value:t.search,placeholder:pn(e,"Find"),"aria-label":pn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=De("input",{value:t.replace,placeholder:pn(e,"Replace"),"aria-label":pn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=De("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=De("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=De("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return De("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=De("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Qh(e),[pn(e,"next")]),r("prev",()=>$h(e),[pn(e,"previous")]),r("select",()=>pq(e),[pn(e,"all")]),De("label",null,[this.caseField,pn(e,"match case")]),De("label",null,[this.reField,pn(e,"regexp")]),De("label",null,[this.wordField,pn(e,"by word")]),...e.state.readOnly?[]:[De("br"),this.replaceField,r("replace",()=>Jk(e),[pn(e,"replace")]),r("replaceAll",()=>mq(e),[pn(e,"replace all")])],De("button",{name:"close",onclick:()=>R3(e),"aria-label":pn(e,"close"),type:"button"},["×"])])}commit(){let e=new E3({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:Ca.of(e)}))}keydown(e){UD(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$h:Qh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Jk(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Ca)&&!r.value.eq(this.query)&&this.setQuery(r.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(Ko).top}}function pn(n,e){return n.state.phrase(e)}const qc=30,jc=/[\s\.,:;?!]/;function j1(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-qc),o=Math.min(i,t+qc),l=n.state.sliceDoc(s,o);if(s!=r.from){for(let a=0;a<qc;a++)if(!jc.test(l[a+1])&&jc.test(l[a])){l=l.slice(a);break}}if(o!=i){for(let a=l.length-1;a>l.length-qc;a--)if(!jc.test(l[a-1])&&jc.test(l[a])){l=l.slice(0,a);break}}return j.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const bq=j.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"}}),yq=[_i,sr.low(dq),bq];class eS{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class ts{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=r.facet(Ta).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new sn,l=[],a=0,c=r.doc.iter(),u=0,h=r.doc.length;for(let d=0;;){let p=d==s.length?null:s[d];if(!p&&!l.length)break;let g,m;if(l.length)g=a,m=l.reduce((x,y)=>Math.min(x,y.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>h)break;m=p.to,l.push(p),d++}for(;d<s.length;){let x=s[d];if(x.from==g&&(x.to>x.from||x.to==g))l.push(x),d++,m=Math.min(x.to,m);else{m=Math.min(x.from,m);break}}m=Math.min(m,h);let O=!1;if(l.some(x=>x.from==g&&(x.to==m||m==h))&&(O=g==m,!O&&m-g<10)){let x=g-(u+c.value.length);x>0&&(c.next(x),u=g);for(let y=g;;){if(y>=m){O=!0;break}if(!c.lineBreak&&u+c.value.length>y)break;y=u+c.value.length,u+=c.value.length,c.next()}}let b=Mq(l);if(O)o.add(g,g,se.widget({widget:new Qq(b),diagnostics:l.slice()}));else{let x=l.reduce((y,w)=>w.markClass?y+" "+w.markClass:y,"");o.add(g,m,se.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:l.slice(),inclusiveEnd:l.some(y=>y.to>m)}))}if(a=m,a==h)break;for(let x=0;x<l.length;x++)l[x].to<=a&&l.splice(x--,1)}let f=o.finish();return new ts(f,t,Ao(f))}}function Ao(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new eS(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new eS(r.from,s,r.diagnostic)}}),r}function kq(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Ta).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(N3))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function Sq(n,e){return n.field(xn,!1)?e:e.concat(ge.appendConfig.of(Lq))}const N3=ge.define(),Y1=ge.define(),D3=ge.define(),xn=lt.define({create(){return new ts(se.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=Ao(t,n.selected.diagnostic,s)||Ao(t,null,s)}!t.size&&i&&e.state.facet(Ta).autoPanel&&(i=null),n=new ts(t,i,r)}for(let t of e.effects)if(t.is(N3)){let r=e.state.facet(Ta).autoPanel?t.value.length?_a.open:null:n.panel;n=ts.init(t.value,r,e.state)}else t.is(Y1)?n=new ts(n.diagnostics,t.value?_a.open:null,n.selected):t.is(D3)&&(n=new ts(n.diagnostics,n.panel,t.value));return n},provide:n=>[pa.from(n,e=>e.panel),j.decorations.from(n,e=>e.diagnostics)]}),wq=se.mark({class:"cm-lintRange cm-lintRange-active"});function vq(n,e,t){let{diagnostics:r}=n.state.field(xn),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||t>0)&&(e<c||t<0)))return i=u.diagnostics,s=a,o=c,!1});let l=n.state.facet(Ta).tooltipFilter;return i&&l&&(i=l(i,n.state)),i?{pos:s,end:o,above:n.state.doc.lineAt(s).to<o,create(){return{dom:Cq(n,i)}}}:null}function Cq(n,e){return De("ul",{class:"cm-tooltip-lint"},e.map(t=>B3(n,t,!1)))}const Tq=n=>{let e=n.state.field(xn,!1);(!e||!e.panel)&&n.dispatch({effects:Sq(n.state,[Y1.of(!0)])});let t=O1(n,_a.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},tS=n=>{let e=n.state.field(xn,!1);return!e||!e.panel?!1:(n.dispatch({effects:Y1.of(!1)}),!0)},_q=n=>{let e=n.state.field(xn,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},Pq=[{key:"Mod-Shift-m",run:Tq,preventDefault:!0},{key:"F8",run:_q}],Ta=ee.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Dr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:nS,tooltipFilter:nS,needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t,hideOn:(e,t)=>e?t?(r,i,s)=>e(r,i,s)||t(r,i,s):e:t,autoPanel:(e,t)=>e||t})}}});function nS(n,e){return n?e?(t,r)=>e(n(t,r),r):n:e}function Z3(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function B3(n,e,t){var r;let i=t?Z3(e.actions):[];return De("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},De("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=Ao(n.state.field(xn).diagnostics,e);p&&s.apply(n,p.from,p.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,h=u<0?c:[c.slice(0,u),De("u",c.slice(u,u+1)),c.slice(u+1)],f=s.markClass?" "+s.markClass:"";return De("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&De("div",{class:"cm-diagnosticSource"},e.source))}class Qq extends In{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return De("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class rS{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=B3(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _a{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)tS(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Z3(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==i.keyCode){let a=Ao(this.view.state.field(xn).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;i.preventDefault()},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=De("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=De("div",{class:"cm-panel-lint"},this.list,De("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>tS(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(xn).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(xn),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let h=-1,f;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==u){h=d;break}h<0?(f=new rS(this.view,u),this.items.splice(r,0,f),i=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),i=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),s=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new rS(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(xn),r=Ao(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:D3.of(r)})}static open(e){return new _a(e)}}function $q(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Yc(n){return $q(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Eq=j.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:Yc("#d11")},".cm-lintRange-warning":{backgroundImage:Yc("orange")},".cm-lintRange-info":{backgroundImage:Yc("#999")},".cm-lintRange-hint":{backgroundImage:Yc("#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}}});function Aq(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function Mq(n){let e="hint",t=1;for(let r of n){let i=Aq(r.severity);i>t&&(t=i,e=r.severity)}return e}const Lq=[xn,j.decorations.compute([xn],n=>{let{selected:e,panel:t}=n.field(xn);return!e||!t||e.from==e.to?se.none:se.set([wq.range(e.from,e.to)])}),RZ(vq,{hideOn:kq}),Eq],Iq=[ET(),UZ(),dZ(),uV(),VB(),nZ(),lZ(),Se.allowMultipleSelections.of(!0),$B(),JT(qB,{fallback:!0}),JB(),Vz(),Jz(),CZ(),PZ(),bZ(),UW(),Ja.of([...qz,...pF,...Oq,...bV,...DB,...p_,...Pq])],cc=C.forwardRef(({title:n,children:e},t)=>{const r=nn(Wa);return C.createElement(iw,{delayDuration:100},C.createElement(sw,null,C.createElement(ow,{ref:t,asChild:!0},C.createElement("span",{className:H.tooltipTrigger},e)),C.createElement(lw,{container:r?.current},C.createElement(aw,{className:Me(H.tooltipContent),sideOffset:10},n))))}),Rq=C.forwardRef(({children:n,className:e,...t},r)=>C.createElement(Q9,{...t,ref:r,className:Me(e,H.selectItem)},C.createElement($9,null,n))),Nq=({title:n,placeholder:e,className:t})=>{const[r,i]=Wt(yn,rr);return C.createElement(cc,{title:n},C.createElement(w9,{"aria-label":e,className:Me(H.selectTrigger,t),"data-toolbar-item":!0,disabled:r},C.createElement(v9,{placeholder:e}),C.createElement(C9,{className:H.selectDropdownArrow},i("arrow_drop_down"))))},Dq=({children:n,className:e=H.selectContainer})=>{const t=nn(Wa);return C.createElement(T9,{container:t?.current},C.createElement(_9,{className:Me(e,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},C.createElement(P9,{"data-editor-dropdown":!0},n)))},Zq=n=>C.createElement(k9,{value:n.value||"",onValueChange:n.onChange,disabled:n.disabled},C.createElement(Nq,{title:n.triggerTitle,placeholder:n.placeholder}),C.createElement(Dq,null,n.items.map((e,t)=>e==="separator"?C.createElement(S9,{key:t}):C.createElement(Rq,{key:t,value:e.value},e.label))));function Bq(n){try{const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?nx(t)?r:i:nx(e)?r:i}catch{return null}}function z3(n){const e=X(),t=window.getSelection(),r=document.activeElement,i=n.getRootElement();if(e!==null&&t!==null&&i!==null&&i.contains(t.anchorNode)&&n.isEditable()){const s=t.getRangeAt(0);let o;if(t.isCollapsed){let l=t.anchorNode;l?.nodeType==3&&(l=l.parentNode),o=l.getBoundingClientRect(),o.width=0}else if(t.anchorNode===i){let l=i;for(;l.firstElementChild!=null;)l=l.firstElementChild;o=l.getBoundingClientRect()}else o=s.getBoundingClientRect();return{top:Math.round(o.top),left:Math.round(o.left),width:Math.round(o.width),height:Math.round(o.height)}}else if(!r||r.className!=="link-input")return null;return null}function zq({url:n,title:e,onSubmit:t,onCancel:r,linkAutocompleteSuggestions:i}){const{register:s,handleSubmit:o,control:l,setValue:a,reset:c}=rw({values:{url:n,title:e}}),u=kn();return C.createElement("form",{onSubmit:h=>{o(t)(h),h.stopPropagation(),h.preventDefault()},onReset:h=>{h.stopPropagation(),r()},className:Me(H.multiFieldForm,H.linkDialogEditForm)},C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"link-url"},u("createLink.url","URL")),C.createElement(U5,{register:s,initialInputValue:n,inputName:"url",suggestions:i,setValue:a,control:l,placeholder:u("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),C.createElement("div",{className:H.formField},C.createElement("label",{htmlFor:"link-title"},u("createLink.title","Title")),C.createElement("input",{id:"link-title",className:H.textInput,size:40,...s("title")})),C.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},C.createElement("button",{type:"submit",title:u("createLink.saveTooltip","Set URL"),"aria-label":u("createLink.saveTooltip","Set URL"),className:Me(H.primaryButton)},u("dialogControls.save","Save")),C.createElement("button",{type:"reset",title:u("createLink.cancelTooltip","Cancel change"),"aria-label":u("createLink.cancelTooltip","Cancel change"),className:Me(H.secondaryButton)},u("dialogControls.cancel","Cancel"))))}const Vq=()=>{const[n,e,t,r,i,s]=Wt(Wa,st,rr,Bt,j3,Y3),o=ut(V3),l=ut(F3),a=ut(X3),c=ut(W3),u=ut(q3);C.useEffect(()=>{const m=()=>{e?.getEditorState().read(()=>{o(!0)})};return window.addEventListener("resize",m),window.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m)}},[e,o]);const[h,f]=C.useState(!1),d=kn();if(r.type==="inactive")return null;const p=r.rectangle,g=r.type==="preview"&&r.url.startsWith("http");return C.createElement(E9,{open:!0},C.createElement(A9,{"data-visible":r.type==="edit",className:H.linkDialogAnchor,style:{top:`${p.top}px`,left:`${p.left}px`,width:`${p.width}px`,height:`${p.height}px`}}),C.createElement(M9,{container:n?.current},C.createElement(L9,{className:Me(H.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:m=>{m.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&C.createElement(zq,{url:r.url,title:r.title,onSubmit:l,onCancel:a.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&C.createElement(C.Fragment,null,C.createElement("a",{className:H.linkDialogPreviewAnchor,href:r.url,...g?{target:"_blank",rel:"noreferrer"}:{},onClick:m=>{s!==null&&(m.preventDefault(),s(r.url))},title:g?d("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},C.createElement("span",null,r.url),g&&t("open_in_new")),C.createElement(Kd,{onClick:()=>{c()},title:d("linkPreview.edit","Edit link URL"),"aria-label":d("linkPreview.edit","Edit link URL")},t("edit")),C.createElement(iw,null,C.createElement(sw,{open:h},C.createElement(ow,{asChild:!0},C.createElement(Kd,{title:d("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":d("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},t(h?"check":"content_copy"))),C.createElement(lw,{container:n?.current},C.createElement(aw,{className:Me(H.tooltipContent),sideOffset:5},d("linkPreview.copied","Copied!"),C.createElement(R9,null))))),C.createElement(Kd,{title:d("linkPreview.remove","Remove link"),"aria-label":d("linkPreview.remove","Remove link"),onClick:()=>{u()}},t("link_off"))),C.createElement(I9,{className:H.popoverArrow}))))},Kd=C.forwardRef(({className:n,...e},t)=>C.createElement("button",{className:Me(H.actionButton,n),ref:t,...e}));function Om(n){if(!n)return null;const e=Bq(n);if(e===null)return null;const t=e.getParent();return xr(t)?t:xr(e)?e:null}const V3=bt(),Bt=oe({type:"inactive"},n=>{n.pub(oa,e=>e.registerCommand(Ma,()=>n.getValue(Bt).type==="preview"?(n.pub(Bt,{type:"inactive"}),!0):!1,Ye)),n.sub(n.pipe(Ei),e=>{e!=="rich-text"&&n.pub(Bt,{type:"inactive"})}),n.pub(oa,e=>e.registerCommand(Rw,t=>{if(t.key==="k"&&(ju?t.metaKey:t.ctrlKey)&&!n.getValue(yn)){const r=X();return z(r)?(n.pub(H1),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},$p)),n.link(n.pipe(W3,Je(Bt),js(([,e])=>{if(e.type==="preview")return{type:"edit",initialUrl:e.url,url:e.url,title:e.title,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),Bt),n.sub(n.pipe(F3,Je(st,Bt,xo)),([e,t,r,i])=>{var s,o;const l=((s=e.url)==null?void 0:s.trim())??"",a=((o=e.title)==null?void 0:o.trim())??"";if(l!==""){if(i?.isCollapsed()){const c=a||l;t?.update(()=>{const u=Om(i);if(u)u.setURL(l),u.setTitle(a);else{const h=Ss(l,{title:a});h.append(He(c)),Do([h]),h.select()}},{discrete:!0})}else t?.dispatchCommand(yo,{url:l,title:a});n.pub(Bt,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:a,url:l})}else r.type==="edit"&&r.initialUrl!==""&&t?.dispatchCommand(yo,null),n.pub(Bt,{type:"inactive"})}),n.link(n.pipe(X3,Je(Bt,st),js(([,e,t])=>{if(e.type==="edit")return t?.focus(),e.initialUrl===""?{type:"inactive"}:{type:"preview",url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),Bt),n.link(n.pipe(n.combine(xo,V3),Je(st,Bt,yn),js(([[e],t,r,i])=>{if(z(e)&&t&&!i){const s=Om(e);if(s){const o=z3(t);return o?{type:"preview",url:s.getURL(),linkNodeKey:s.getKey(),title:s.getTitle(),rectangle:o}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),Bt)}),F3=bt(),X3=Ni();Ni();const W3=Ni(),q3=Ni(n=>{n.sub(n.pipe(q3,Je(st)),([,e])=>{e?.dispatchCommand(yo,null)})}),H1=Ni(n=>{n.sub(n.pipe(H1,Je(xo,st),Ea(([,e])=>z(e))),([,e,t])=>{t?.focus(()=>{setTimeout(()=>{t.getEditorState().read(()=>{const r=Om(e),i=z3(t);r?n.pub(Bt,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):n.pub(Bt,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})})}),j3=oe([]),Y3=oe(null),H3=oe(null,n=>{n.pub(oa,e=>{function t(r){const[i,s]=n.getValues([yn,H3]);!i||s===null||e.update(()=>{const o=Ar(r.target);if(o!==null){const l=Zi(o,a=>a instanceof hi);l!==null&&s(r,l,l.getURL())}})}return e.registerRootListener((r,i)=>{r&&r.addEventListener("click",t),i&&i.removeEventListener("click",t)})})}),Fq=Ln({init(n,e){n.pub(Qs,e?.LinkDialog??Vq),n.pub(Y3,e?.onClickLinkCallback??null),n.pub(H3,e?.onReadOnlyClickLinkCallback??null)},update(n,e={}){n.pub(j3,e.linkAutocompleteSuggestions??[])}});function U1(n,e){return C.forwardRef((t,r)=>{const i=Me(e.className,t.className);return C.createElement(n,{...e,...t,className:i,ref:r})})}function Xq(n){return({title:e,children:t,...r})=>C.createElement(n,{...r},C.createElement(cc,{title:e},t))}const Wq=({readOnly:n,children:e,className:t})=>C.createElement(HL,{className:Me("mdxeditor-toolbar",H.toolbarRoot,{[H.readOnlyToolbarRoot]:n},t),...n?{tabIndex:-1}:{}},e),qq=U1(P5,{className:H.toolbarButton,"data-toolbar-item":!0}),jq=Xq(qq),U3=U1(GL,{className:H.toolbarToggleItem,"data-toolbar-item":!0});U1(RO,{type:"single",className:H.toolbarToggleSingleGroup});const G3=C.forwardRef(({on:n,title:e,children:t,disabled:r,...i},s)=>C.createElement(RO,{type:"single",className:H.toolbarToggleSingleGroup,...i,value:n?"on":"off",ref:s},C.createElement(U3,{"aria-label":e,value:"on",disabled:r},C.createElement(cc,{title:e},t)))),Yq=({items:n})=>C.createElement("div",{className:H.toolbarGroupOfGroups},n.map((e,t)=>C.createElement(G3,{key:t,title:e.title,on:e.active,onValueChange:r=>{e.onChange(r==="on")},disabled:e.disabled},e.contents))),K3=({value:n,onChange:e,className:t,ggClassName:r,items:i})=>{const s=kn();return C.createElement("div",{className:Me(H.toolbarGroupOfGroups,r)},C.createElement(RO,{"aria-label":s("toolbar.toggleGroup","toggle group"),type:"single",className:Me(H.toolbarToggleSingleGroup,t),onValueChange:e,value:n||"",onFocus:o=>{o.preventDefault()}},i.map((o,l)=>C.createElement(U3,{key:l,"aria-label":o.title,value:o.value},C.createElement(cc,{title:o.title},o.contents)))))},Hc=UL,Jd=oe(()=>null),ep=oe(""),iS=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",Hq=Ln({init(n,e){const t=e?.toolbarPosition==="bottom"?sA:iA;n.pubIn({[Jd]:e?.toolbarContents??iS,[ep]:e?.toolbarClassName??"",[t]:()=>{const[r,i,s]=Wt(Jd,yn,ep);return C.createElement(Wq,{className:s,readOnly:i},r())}})},update(n,e){n.pub(Jd,e?.toolbarContents??iS),n.pub(ep,e?.toolbarClassName??"")}});class ct{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}offset(e,t=e){return new ct(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function _s(n,e,t,r,i,s){if(n==r)return[];let o=K1(n,e,t,r,i,s),l=J1(n,e+o,t,r,i+o,s);e+=o,t-=l,i+=o,s-=l;let a=t-e,c=s-i;if(!a||!c)return[new ct(e,t,i,s)];if(a>c){let h=n.slice(e,t).indexOf(r.slice(i,s));if(h>-1)return[new ct(e,e+h,i,i),new ct(e+h+c,t,s,s)]}else if(c>a){let h=r.slice(i,s).indexOf(n.slice(e,t));if(h>-1)return[new ct(e,e,i,i+h),new ct(t,t,i+h+a,s)]}if(a==1||c==1)return[new ct(e,t,i,s)];let u=tP(n,e,t,r,i,s);if(u){let[h,f,d]=u;return _s(n,e,h,r,i,f).concat(_s(n,h+d,t,r,f+d,s))}return Uq(n,e,t,r,i,s)}let Cl=1e9,Tl=0,G1=!1;function Uq(n,e,t,r,i,s){let o=t-e,l=s-i;if(Cl<1e9&&Math.min(o,l)>Cl*16||Tl>0&&Date.now()>Tl)return Math.min(o,l)>Cl*64?[new ct(e,t,i,s)]:sS(n,e,t,r,i,s);let a=Math.ceil((o+l)/2);tp.reset(a),np.reset(a);let c=(d,p)=>n.charCodeAt(e+d)==r.charCodeAt(i+p),u=(d,p)=>n.charCodeAt(t-d-1)==r.charCodeAt(s-p-1),h=(o-l)%2!=0?np:null,f=h?null:tp;for(let d=0;d<a;d++){if(d>Cl||Tl>0&&!(d&63)&&Date.now()>Tl)return sS(n,e,t,r,i,s);let p=tp.advance(d,o,l,a,h,!1,c)||np.advance(d,o,l,a,f,!0,u);if(p)return Gq(n,e,t,e+p[0],r,i,s,i+p[1])}return[new ct(e,t,i,s)]}class J3{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;t<this.len;t++)this.vec[t]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,r,i,s,o,l){for(let a=-e+this.start;a<=e-this.end;a+=2){let c=i+a,u=a==-e||a!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,h=u-a;for(;u<t&&h<r&&l(u,h);)u++,h++;if(this.vec[c]=u,u>t)this.end+=2;else if(h>r)this.start+=2;else if(s){let f=i+(t-r)-a;if(f>=0&&f<this.len&&s.vec[f]!=-1)if(o){let d=s.vec[f];if(d>=t-u)return[d,i+d-f]}else{let d=t-s.vec[f];if(u>=d)return[u,h]}}}return null}}const tp=new J3,np=new J3;function Gq(n,e,t,r,i,s,o,l){let a=!1;return!Mo(n,r)&&++r==t&&(a=!0),!Mo(i,l)&&++l==o&&(a=!0),a?[new ct(e,t,s,o)]:_s(n,e,r,i,s,l).concat(_s(n,r,t,i,l,o))}function eP(n,e){let t=1,r=Math.min(n,e);for(;t<r;)t=t<<1;return t}function K1(n,e,t,r,i,s){if(e==t||e==s||n.charCodeAt(e)!=r.charCodeAt(i))return 0;let o=eP(t-e,s-i);for(let l=e,a=i;;){let c=l+o,u=a+o;if(c>t||u>s||n.slice(l,c)!=r.slice(a,u)){if(o==1)return l-e-(Mo(n,l)?0:1);o=o>>1}else{if(c==t||u==s)return c-e;l=c,a=u}}}function J1(n,e,t,r,i,s){if(e==t||i==s||n.charCodeAt(t-1)!=r.charCodeAt(s-1))return 0;let o=eP(t-e,s-i);for(let l=t,a=s;;){let c=l-o,u=a-o;if(c<e||u<i||n.slice(c,l)!=r.slice(u,a)){if(o==1)return t-l-(Mo(n,l)?0:1);o=o>>1}else{if(c==e||u==i)return t-c;l=c,a=u}}}function xm(n,e,t,r,i,s,o,l){let a=r.slice(i,s),c=null;for(;;){if(c||o<l)return c;for(let u=e+o;;){Mo(n,u)||u++;let h=u+o;if(Mo(n,h)||(h+=h==u+1?1:-1),h>=t)break;let f=n.slice(u,h),d=-1;for(;(d=a.indexOf(f,d+1))!=-1;){let p=K1(n,h,t,r,i+d+f.length,s),g=J1(n,e,u,r,i,i+d),m=f.length+p+g;(!c||c[2]<m)&&(c=[u-g,i+d-g,m])}u=h}if(l<0)return c;o=o>>1}}function tP(n,e,t,r,i,s){let o=t-e,l=s-i;if(o<l){let a=tP(r,i,s,n,e,t);return a&&[a[1],a[0],a[2]]}return o<4||l*2<o?null:xm(n,e,t,r,i,s,Math.floor(o/4),-1)}function sS(n,e,t,r,i,s){G1=!0;let o=t-e,l=s-i,a;if(o<l){let f=xm(r,i,s,n,e,t,Math.floor(o/6),50);a=f&&[f[1],f[0],f[2]]}else a=xm(n,e,t,r,i,s,Math.floor(l/6),50);if(!a)return[new ct(e,t,i,s)];let[c,u,h]=a;return _s(n,e,c,r,i,u).concat(_s(n,c+h,t,r,u+h,s))}function nP(n,e){for(let t=1;t<n.length;t++){let r=n[t-1],i=n[t];r.toA>i.fromA-e&&r.toB>i.fromB-e&&(n[t-1]=new ct(r.fromA,i.toA,r.fromB,i.toB),n.splice(t--,1))}}function Kq(n,e,t){for(;;){nP(t,1);let r=!1;for(let i=0;i<t.length;i++){let s=t[i],o,l;(o=K1(n,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new ct(s.fromA+o,s.toA,s.fromB+o,s.toB)),(l=J1(n,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new ct(s.fromA,s.toA-l,s.fromB,s.toB-l));let a=s.toA-s.fromA,c=s.toB-s.fromB;if(a&&c)continue;let u=s.fromA-(i?t[i-1].toA:0),h=(i<t.length-1?t[i+1].fromA:n.length)-s.toA;if(!u||!h)continue;let f=a?n.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=f.length&&n.slice(s.fromA-u,s.fromA)==f.slice(f.length-u)?(t[i]=new ct(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),r=!0):h<=f.length&&n.slice(s.toA,s.toA+h)==f.slice(0,h)&&(t[i]=new ct(s.fromA+h,s.toA+h,s.fromB+h,s.toB+h),r=!0)}if(!r)break}return t}function Jq(n,e,t){for(let r=0,i=0;i<n.length;i++){let s=n[i],o=s.toA-s.fromA,l=s.toB-s.fromB;if(o&&l||o>3||l>3){let a=i==n.length-1?e.length:n[i+1].fromA,c=s.fromA-r,u=a-s.toA,h=lS(e,s.fromA,c),f=oS(e,s.toA,u),d=s.fromA-h,p=f-s.toA;if((!o||!l)&&d&&p){let g=Math.max(o,l),[m,O,b]=o?[e,s.fromA,s.toA]:[t,s.fromB,s.toB];g>d&&e.slice(h,s.fromA)==m.slice(b-d,b)?(s=n[i]=new ct(h,h+o,s.fromB-d,s.toB-d),h=s.fromA,f=oS(e,s.toA,a-s.toA)):g>p&&e.slice(s.toA,f)==m.slice(O,O+p)&&(s=n[i]=new ct(f-o,f,s.fromB+p,s.toB+p),f=s.toA,h=lS(e,s.fromA,s.fromA-r)),d=s.fromA-h,p=f-s.toA}if(d||p)s=n[i]=new ct(s.fromA-d,s.toA+p,s.fromB-d,s.toB+p);else if(o){if(!l){let g=cS(e,s.fromA,s.toA),m,O=g<0?-1:aS(e,s.toA,s.fromA);g>-1&&(m=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+m)?s=n[i]=s.offset(m):O>-1&&(m=s.toA-O)<=c&&e.slice(s.fromA-m,s.fromA)==e.slice(O,s.toA)&&(s=n[i]=s.offset(-m))}}else{let g=cS(t,s.fromB,s.toB),m,O=g<0?-1:aS(t,s.toB,s.fromB);g>-1&&(m=g-s.fromB)<=u&&t.slice(s.fromB,g)==t.slice(s.toB,s.toB+m)?s=n[i]=s.offset(m):O>-1&&(m=s.toB-O)<=c&&t.slice(s.fromB-m,s.fromB)==t.slice(O,s.toB)&&(s=n[i]=s.offset(-m))}}r=s.toA}return nP(n,3),n}let fs;try{fs=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function rP(n){return n>48&&n<58||n>64&&n<91||n>96&&n<123}function iP(n,e){if(e==n.length)return 0;let t=n.charCodeAt(e);return t<192?rP(t)?1:0:fs?!lP(t)||e==n.length-1?fs.test(String.fromCharCode(t))?1:0:fs.test(n.slice(e,e+2))?2:0:0}function sP(n,e){if(!e)return 0;let t=n.charCodeAt(e-1);return t<192?rP(t)?1:0:fs?!aP(t)||e==1?fs.test(String.fromCharCode(t))?1:0:fs.test(n.slice(e-2,e))?2:0:0}const oP=8;function oS(n,e,t){if(e==n.length||!sP(n,e))return e;for(let r=e,i=e+t,s=0;s<oP;s++){let o=iP(n,r);if(!o||r+o>i)return r;r+=o}return e}function lS(n,e,t){if(!e||!iP(n,e))return e;for(let r=e,i=e-t,s=0;s<oP;s++){let o=sP(n,r);if(!o||r-o<i)return r;r-=o}return e}function aS(n,e,t){for(;e!=t;e--)if(n.charCodeAt(e-1)==10)return e;return-1}function cS(n,e,t){for(;e!=t;e++)if(n.charCodeAt(e)==10)return e;return-1}const lP=n=>n>=55296&&n<=56319,aP=n=>n>=56320&&n<=57343;function Mo(n,e){return!e||e==n.length||!lP(n.charCodeAt(e-1))||!aP(n.charCodeAt(e))}function ej(n,e,t){var r;return Cl=((r=t?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,Tl=t?.timeout?Date.now()+t.timeout:0,G1=!1,Kq(n,e,_s(n,0,n.length,e,0,e.length))}function cP(){return!G1}function uP(n,e,t){return Jq(ej(n,e,t),n,e)}const Sr=ee.define({combine:n=>n[0]}),bm=ge.define(),tj=ee.define(),Lo=lt.define({create(n){return null},update(n,e){for(let t of e.effects)t.is(bm)&&(n=t.value);for(let t of e.state.facet(tj))n=t(n,e);return n}});class ao{constructor(e,t,r,i,s,o=!0){this.changes=e,this.fromA=t,this.toA=r,this.fromB=i,this.toB=s,this.precise=o}offset(e,t){return e||t?new ao(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,r){let i=uP(e.toString(),t.toString(),r);return hP(i,e,t,0,0,cP())}static updateA(e,t,r,i,s){return pS(dS(e,i,!0,r.length),e,t,r,s)}static updateB(e,t,r,i,s){return pS(dS(e,i,!1,t.length),e,t,r,s)}}function uS(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.to==n&&s.to==e&&n<t.length&&e<r.length?[n+1,e+1]:[i.from,s.from]}function hS(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.from==n&&s.from==e?[n,e]:[i.to+1,s.to+1]}function hP(n,e,t,r,i,s){let o=[];for(let l=0;l<n.length;l++){let a=n[l],[c,u]=uS(a.fromA+r,a.fromB+i,e,t),[h,f]=hS(a.toA+r,a.toB+i,e,t),d=[a.offset(-c+r,-u+i)];for(;l<n.length-1;){let p=n[l+1],[g,m]=uS(p.fromA+r,p.fromB+i,e,t);if(g>h+1&&m>f+1)break;d.push(p.offset(-c+r,-u+i)),[h,f]=hS(p.toA+r,p.toB+i,e,t),l++}o.push(new ao(d,c,Math.max(c,h),u,Math.max(u,f),s))}return o}const Uc=1e3;function fS(n,e,t,r){let i=0,s=n.length;for(;;){if(i==s){let u=0,h=0;i&&({toA:u,toB:h}=n[i-1]);let f=e-(t?u:h);return[u+f,h+f]}let o=i+s>>1,l=n[o],[a,c]=t?[l.fromA,l.toA]:[l.fromB,l.toB];if(a>e)s=o;else if(c<=e)i=o+1;else return r?[l.fromA,l.fromB]:[l.toA,l.toB]}}function dS(n,e,t,r){let i=[];return e.iterChangedRanges((s,o,l,a)=>{let c=0,u=t?e.length:r,h=0,f=t?r:e.length;s>Uc&&([c,h]=fS(n,s-Uc,t,!0)),o<e.length-Uc&&([u,f]=fS(n,o+Uc,t,!1));let d=a-l-(o-s),p,[g,m]=t?[d,0]:[0,d];i.length&&(p=i[i.length-1]).toA>=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:f,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:c,toA:u,fromB:h,toB:f,diffA:g,diffB:m})}),i}function pS(n,e,t,r,i){if(!n.length)return e;let s=[];for(let o=0,l=0,a=0,c=0;;o++){let u=o==n.length?null:n[o],h=u?u.fromA+l:t.length,f=u?u.fromB+a:r.length;for(;c<e.length;){let m=e[c];if(Math.min(t.length,m.toA+l)>h||Math.min(r.length,m.toB+a)>f)break;s.push(m.offset(l,a)),c++}if(!u)break;let d=u.toA+l+u.diffA,p=u.toB+a+u.diffB,g=uP(t.sliceString(h,d),r.sliceString(f,p),i);for(let m of hP(g,t,r,h,f,cP()))s.push(m);for(l+=u.diffA,a+=u.diffB;c<e.length;){let m=e[c];if(m.fromA+l>d&&m.fromB+a>p)break;c++}}return s}const nj={scanLimit:500},fP=ot.fromClass(class{constructor(n){({deco:this.deco,gutter:this.gutter}=OS(n))}update(n){(n.docChanged||n.viewportChanged||rj(n.startState,n.state)||ij(n.startState,n.state))&&({deco:this.deco,gutter:this.gutter}=OS(n.view))}},{decorations:n=>n.deco}),Gc=sr.low(PT({class:"cm-changeGutter",markers:n=>{var e;return((e=n.plugin(fP))===null||e===void 0?void 0:e.gutter)||ve.empty}}));function rj(n,e){return n.field(Lo,!1)!=e.field(Lo,!1)}function ij(n,e){return n.facet(Sr)!=e.facet(Sr)}const gS=se.line({class:"cm-changedLine"}),sj=se.mark({class:"cm-changedText"}),oj=se.mark({tagName:"ins",class:"cm-insertedLine"}),lj=se.mark({tagName:"del",class:"cm-deletedLine"}),mS=new class extends Ir{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function aj(n,e,t,r,i,s){let o=t?n.fromA:n.fromB,l=t?n.toA:n.toB,a=0;if(o!=l){i.add(o,o,gS),i.add(o,l,t?lj:oj),s&&s.add(o,o,mS);for(let c=e.iterRange(o,l-1),u=o;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,gS),s&&s.add(u,u,mS);continue}let h=u+c.value.length;if(r)for(;a<n.changes.length;){let f=n.changes[a],d=o+(t?f.fromA:f.fromB),p=o+(t?f.toA:f.toB),g=Math.max(u,d),m=Math.min(h,p);if(g<m&&i.add(g,m,sj),p<h)a++;else break}u=h}}}function OS(n){let e=n.state.field(Lo),{side:t,highlightChanges:r,markGutter:i,overrideChunk:s}=n.state.facet(Sr),o=t=="a",l=new sn,a=i?new sn:null,{from:c,to:u}=n.viewport;for(let h of e){if((o?h.fromA:h.fromB)>=u)break;(o?h.toA:h.toB)>c&&(!s||!s(n.state,h,l,a))&&aj(h,n.state.doc,o,r,l,a)}return{deco:l.finish(),gutter:a&&a.finish()}}class Kc extends In{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Eh=ge.define({map:(n,e)=>n.map(e)}),_l=lt.define({create:()=>se.none,update:(n,e)=>{for(let t of e.effects)if(t.is(Eh))return t.value;return n.map(e.changes)},provide:n=>j.decorations.from(n)}),Jc=.01;function xS(n,e){if(n.size!=e.size)return!1;let t=n.iter(),r=e.iter();for(;t.value;){if(t.from!=r.from||Math.abs(t.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;t.next(),r.next()}return!0}function cj(n,e,t){let r=new sn,i=new sn,s=n.state.field(_l).iter(),o=e.state.field(_l).iter(),l=0,a=0,c=0,u=0,h=n.viewport,f=e.viewport;for(let m=0;;m++){let O=m<t.length?t[m]:null,b=O?O.fromA:n.state.doc.length,x=O?O.fromB:e.state.doc.length;if(l<b){let y=n.lineBlockAt(l).top+c,w=e.lineBlockAt(a).top+u,k=y-w;k<-Jc?(c-=k,r.add(l,l,se.widget({widget:new Kc(-k),block:!0,side:-1}))):k>Jc&&(u+=k,i.add(a,a,se.widget({widget:new Kc(k),block:!0,side:-1})))}if(b>l+1e3&&l<h.from&&b>h.from&&a<f.from&&x>f.from){let y=Math.min(h.from-l,f.from-a);l+=y,a+=y,m--}else if(O)l=O.toA,a=O.toB;else break;for(;s.value&&s.from<l;)c-=s.value.spec.widget.height,s.next();for(;o.value&&o.from<a;)u-=o.value.spec.widget.height,o.next()}for(;s.value;)c-=s.value.spec.widget.height,s.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let d=n.contentHeight+c-(e.contentHeight+u);d<Jc?r.add(n.state.doc.length,n.state.doc.length,se.widget({widget:new Kc(-d),block:!0,side:1})):d>Jc&&i.add(e.state.doc.length,e.state.doc.length,se.widget({widget:new Kc(d),block:!0,side:1}));let p=r.finish(),g=i.finish();xS(p,n.state.field(_l))||n.dispatch({effects:Eh.of(p)}),xS(g,e.state.field(_l))||e.dispatch({effects:Eh.of(g)})}const ym=ge.define({map:(n,e)=>e.mapPos(n)});class uj extends In{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent=e.state.phrase("$ unchanged lines",this.lines),t.addEventListener("click",r=>{let i=e.posAtDOM(r.target);e.dispatch({effects:ym.of(i)});let{side:s,sibling:o}=e.state.facet(Sr);o&&o().dispatch({effects:ym.of(hj(i,e.state.field(Lo),s=="a"))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function hj(n,e,t){let r=0,i=0;for(let s=0;;s++){let o=s<e.length?e[s]:null;if(!o||(t?o.fromA:o.fromB)>=n)return i+(n-r);[r,i]=t?[o.toA,o.toB]:[o.toB,o.toA]}}const fj=lt.define({create(n){return se.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(ym)&&(n=n.update({filter:r=>r!=t.value}));return n},provide:n=>j.decorations.from(n)});function bS({margin:n=3,minSize:e=4}){return fj.init(t=>dj(t,n,e))}function dj(n,e,t){let r=new sn,i=n.facet(Sr).side=="a",s=n.field(Lo),o=1;for(let l=0;;l++){let a=l<s.length?s[l]:null,c=l?o+e:1,u=a?n.doc.lineAt(i?a.fromA:a.fromB).number-1-e:n.doc.lines,h=u-c+1;if(h>=t&&r.add(n.doc.line(c).from,n.doc.line(u).to,se.replace({widget:new uj(h),block:!0})),!a)break;o=n.doc.lineAt(Math.min(n.doc.length,i?a.toA:a.toB)).number}return r.finish()}const pj=j.styleModule.of(new li({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),gj=j.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),yS=new jo,eu=new jo;class mj{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||nj;let t=[sr.low(fP),gj,pj,_l,j.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(d=>d.is(Eh)))&&this.measure()})],r=[Sr.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(Gc);let i=Se.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],j.editorAttributes.of({class:"cm-merge-a"}),eu.of(r),t]}),s=[Sr.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(Gc);let o=Se.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],j.editorAttributes.of({class:"cm-merge-b"}),eu.of(s),t]});this.chunks=ao.build(i.doc,o.doc,this.diffConf);let l=[Lo.init(()=>this.chunks),yS.of(e.collapseUnchanged?bS(e.collapseUnchanged):[])];i=i.update({effects:ge.appendConfig.of(l)}).state,o=o.update({effects:ge.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(a=="a-b"?c:u),this.editorDOM.appendChild(a=="a-b"?u:c),this.a=new j({state:i,parent:c,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new j({state:o,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(r=>r.docChanged)){let r=e[e.length-1],i=e.reduce((o,l)=>o.compose(l.changes),at.empty(e[0].startState.doc.length));this.chunks=t==this.a?ao.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):ao.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),t.update([...e,r.state.update({effects:bm.of(this.chunks)})]);let s=t==this.a?this.b:this.a;s.update([s.state.update({effects:bm.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,l=this.b.dom.parentNode;o.remove(),l.remove(),this.editorDOM.insertBefore(s?o:l,this.editorDOM.firstChild),this.editorDOM.appendChild(s?l:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,o=this.revertToA,l=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(l=e.renderRevertControl),this.setupRevertControls(s,o,l)}let t="highlightChanges"in e,r="gutter"in e,i="collapseUnchanged"in e;if(t||r||i){let s=[],o=[];if(t||r){let l=this.a.state.facet(Sr),a=r?e.gutter!==!1:l.markGutter,c=t?e.highlightChanges!==!1:l.highlightChanges;s.push(eu.reconfigure([Sr.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:a}),a?Gc:[]])),o.push(eu.reconfigure([Sr.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:a}),a?Gc:[]]))}if(i){let l=yS.reconfigure(e.collapseUnchanged?bS(e.collapseUnchanged):[]);s.push(l),o.push(l)}this.a.dispatch({effects:s}),this.b.dispatch({effects:o})}this.scheduleMeasure()}setupRevertControls(e,t,r){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){cj(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,r=this.a.viewport,i=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let o=this.chunks[s];if(o.fromA>r.to||o.fromB>i.to)break;if(o.fromA<r.from||o.fromB<i.from)continue;let l=this.a.lineBlockAt(o.fromA).top+"px";for(;t&&+t.dataset.chunk<s;)t=kS(t);t&&t.dataset.chunk==String(s)?(t.style.top!=l&&(t.style.top=l),t=t.nextSibling):e.insertBefore(this.renderRevertButton(l,s),t)}for(;t;)t=kS(t)}renderRevertButton(e,t){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",i),r.setAttribute("title",i),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=e,r.setAttribute("data-chunk",String(t)),r}revertClicked(e){let t=e.target,r;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(r=this.chunks[t.dataset.chunk])){let[i,s,o,l,a,c]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],u=i.state.sliceDoc(o,Math.max(o,l-1));o!=l&&c<=s.state.doc.length&&(u+=i.state.lineBreak),s.dispatch({changes:{from:a,to:Math.min(s.state.doc.length,c),insert:u},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function kS(n){let e=n.nextSibling;return n.remove(),e}class Ah{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new Ah(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,l){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=l,this.hashProp=[[be.contextHash,i]]}addChild(e,t){e.prop(be.contextHash)!=this.hash&&(e=new Ee(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Ee(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new Ee(xt.none,i,s,o,this.hashProp)})}}var W;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(W||(W={}));class Oj{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class xj{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 Wl(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,r=0){for(let i=t;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%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 SS(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==W.OrderedList?n0:t0)(t,e,!1);return r>0&&(n.type!=W.BulletList||e0(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const dP={[W.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Pe(W.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Nn(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[W.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[W.OrderedList]:SS,[W.BulletList]:SS,[W.Document](){return!0}};function Nn(n){return n==32||n==9||n==10||n==13}function Wl(n,e=0){for(;e<n.length&&Nn(n.charCodeAt(e));)e++;return e}function wS(n,e,t){for(;e>t&&Nn(n.charCodeAt(e-1));)e--;return e}function pP(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function gP(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function e0(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let i=n.pos+1;i<n.text.length;i++){let s=n.text.charCodeAt(i);if(s==n.next)r++;else if(!Nn(s))return-1}return t&&n.next==45&&xP(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(SP.SetextHeading)>-1||r<3?-1:1}function mP(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function t0(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Nn(n.text.charCodeAt(n.pos+1)))&&(!t||mP(e,W.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function n0(n,e,t){let r=n.pos,i=n.next;for(;i>=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||r<n.text.length-1&&!Nn(n.text.charCodeAt(r+1))||t&&!mP(e,W.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function OP(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function xP(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&Nn(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const km=/^[ \t]*$/,bP=/-->/,yP=/\?>/,Sm=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,bP],[/^\s*<\?/,yP],[/^\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,km],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,km]];function kP(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let i=0,s=Sm.length-(t?1:0);i<s;i++)if(Sm[i][0].test(r))return i;return-1}function vS(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function mi(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==W.CodeText?n[r].to=t:n.push(Pe(W.CodeText,e,t))}const tu={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),i=n.lineStart+r,s=n.lineStart+e.text.length,o=[],l=[];for(mi(o,i,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){mi(l,n.lineStart-1,n.lineStart);for(let a of e.markers)l.push(a)}else{if(e.indent<t)break;{if(l.length){for(let c of l)c.type==W.CodeText?mi(o,c.from,c.to):o.push(c);l=[]}mi(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c);s=n.lineStart+e.text.length;let a=n.lineStart+e.findColumn(e.baseIndent+4);a<s&&mi(o,a,s)}}return l.length&&(l=l.filter(a=>a.type!=W.CodeText),l.length&&(e.markers=l.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-i).finish(W.CodeBlock,s-i),i),!0},FencedCode(n,e){let t=pP(e);if(t<0)return!1;let r=n.lineStart+e.pos,i=e.next,s=t-e.pos,o=e.skipSpace(t),l=wS(e.text,e.text.length,o),a=[Pe(W.CodeMark,r,r+s)];o<l&&a.push(Pe(W.CodeInfo,n.lineStart+o,n.lineStart+l));for(let c=!0,u=!0,h=!1;n.nextLine()&&e.depth>=n.stack.length;c=!1){let f=e.pos;if(e.indent-e.baseIndent<4)for(;f<e.text.length&&e.text.charCodeAt(f)==i;)f++;if(f-e.pos>=s&&e.skipSpace(f)==e.text.length){for(let d of e.markers)a.push(d);u&&h&&mi(a,n.lineStart-1,n.lineStart),a.push(Pe(W.CodeMark,n.lineStart+e.pos,n.lineStart+f)),n.nextLine();break}else{h=!0,c||(mi(a,n.lineStart-1,n.lineStart),u=!1);for(let g of e.markers)a.push(g);let d=n.lineStart+e.basePos,p=n.lineStart+e.text.length;d<p&&(mi(a,d,p),u=!1)}}return n.addNode(n.buffer.writeElements(a,-r).finish(W.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=gP(e);return t<0?!1:(n.startContext(W.Blockquote,e.pos),n.addNode(W.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(e0(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(W.HorizontalRule,t),!0},BulletList(n,e){let t=t0(e,n,!1);if(t<0)return!1;n.block.type!=W.BulletList&&n.startContext(W.BulletList,e.basePos,e.next);let r=vS(e,e.pos+1);return n.startContext(W.ListItem,e.basePos,r-e.baseIndent),n.addNode(W.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=n0(e,n,!1);if(t<0)return!1;n.block.type!=W.OrderedList&&n.startContext(W.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=vS(e,e.pos+t);return n.startContext(W.ListItem,e.basePos,r-e.baseIndent),n.addNode(W.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=OP(e);if(t<0)return!1;let r=e.pos,i=n.lineStart+r,s=wS(e.text,e.text.length,r),o=s;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==r||!Nn(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=n.buffer.write(W.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,o),i+t+1),-i);o<e.text.length&&l.write(W.HeaderMark,o-r,s-r);let a=l.finish(W.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(a,i),!0},HTMLBlock(n,e){let t=kP(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,i=Sm[t][1],s=[],o=i!=km;for(;!i.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let c of e.markers)s.push(c)}o&&n.nextLine();let l=i==bP?W.CommentBlock:i==yP?W.ProcessingInstructionBlock:W.HTMLBlock,a=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-r).finish(l,a-r),r),!0},SetextHeading:void 0};class bj{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
88
88
|
`+t.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Wl(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,Pe(W.LinkReference,this.start,this.start+r,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;if(this.stage==0){if(!this.nextStage(EP(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Pe(W.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(QP(e,Wl(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Wl(e,this.pos),r=0;if(t>this.pos){let i=$P(e,t,this.start);if(i){let s=rp(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=rp(e,this.pos)),r>0&&r<e.length?r:-1}else return rp(e,this.pos)}}}function rp(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!Nn(t))return-1}return e}class yj{nextLine(e,t,r){let i=t.depth<e.stack.length?-1:xP(t),s=t.next;if(i<0)return!1;let o=Pe(W.HeaderMark,e.lineStart+t.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,Pe(s==61?W.SetextHeading1:W.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}}const SP={LinkReference(n,e){return e.content.charCodeAt(0)==91?new bj(e):null},SetextHeading(){return new yj}},kj=[(n,e)=>OP(e)>=0,(n,e)=>pP(e)>=0,(n,e)=>gP(e)>=0,(n,e)=>t0(e,n,!0)>=0,(n,e)=>n0(e,n,!0)>=0,(n,e)=>e0(e,n,!0)>=0,(n,e)=>kP(e,n,!0)>=0],Sj={text:"",end:0};class wj{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.line=new xj,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=Ah.create(W.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new Tj(r,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 r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)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;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let t=new Oj(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,t);i&&t.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
|
|
89
89
|
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new 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=AP(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=Sj;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 r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<t.end;){i++;let s=this.ranges[i].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[i-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+W[i.type]);let o=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>o&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
|
|
90
90
|
`?"":t;else{let i=t.indexOf(`
|
|
@@ -97,4 +97,4 @@ import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";i
|
|
|
97
97
|
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
98
98
|
`)},regExp:$Y,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(Zp(s))return s.splice(s.getChildrenSize(),0,[Un(),...e]),s.select(0,0),void n.remove()}const i=Va();i.append(...e),n.replace(i),i.select(0,0)},type:"element"},UP={dependencies:[l0],export:n=>{if(!a0(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
99
99
|
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:AY},regExpStart:EY,replace:(n,e,t,r,i,s)=>{let o,l;if(!e&&i){if(i.length===1)r?(o=ti(),l=t[1]+i[0]):(o=ti(t[1]),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=ti(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
|
|
100
|
-
`)}const a=He(l);o.append(a),n.append(o)}else e&&YP((a=>ti(a?a[1]:void 0)))(n,e,t,s)},type:"multiline-element"},GP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:_Y,replace:c0("bullet"),type:"element"},LY={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:PY,replace:c0("check"),type:"element"},KP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:TY,replace:c0("number"),type:"element"},JP={format:["code"],tag:"`",type:"text-format"},IY={format:["highlight"],tag:"==",type:"text-format"},e9={format:["bold","italic"],tag:"***",type:"text-format"},t9={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},n9={format:["bold"],tag:"**",type:"text-format"},r9={format:["bold"],intraword:!1,tag:"__",type:"text-format"},RY={format:["strikethrough"],tag:"~~",type:"text-format"},i9={format:["italic"],tag:"*",type:"text-format"},s9={format:["italic"],intraword:!1,tag:"_",type:"text-format"},o9={dependencies:[hi],export:(n,e,t)=>{if(!xr(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=Ss(r,{title:i}),o=He(t);return o.setFormat(n.getFormat()),s.append(o),n.replace(s),o},trigger:")",type:"text-match"},NY=[MY,HP,GP,KP],DY=[UP],ZY=[JP,e9,t9,n9,r9,IY,i9,s9,RY],BY=[o9],l9=[...NY,...DY,...ZY,...BY],zY=[{dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...l9];function ew({transformers:n=zY}){const[e]=Nt();return R.useEffect((()=>CY(e,n)),[e,n]),null}const VY=Ln({init(n){const e=n.getValue(QO),t=e.includes("headings")?n.getValue(ff):[],r=WY(e,t);n.pubIn({[Qs]:()=>C.createElement(ew,{transformers:r}),[Dv]:()=>C.createElement(ew,{transformers:r})})}}),FY=n=>(e,t,r)=>{const i=n(r);i.append(...t),e.replace(i),i.select(0,0)},XY={dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"};function WY(n,e){const t=[e9,t9,n9,r9,JP,i9,s9];if(n.includes("headings")){const r=Math.min(...e),i=Math.max(...e),s=new RegExp(`^(#{${r},${i}})\\s`),o={dependencies:[Fa],export:(l,a)=>{if(!of(l))return null;const c=Number(l.getTag().slice(1));return"#".repeat(c)+" "+a(l)},regExp:s,replace:FY(l=>{const a=`h${l[1].length}`;return wr(a)}),type:"element"};t.push(o)}if(n.includes("thematicBreak")&&t.push(XY),n.includes("quote")&&t.push(HP),n.includes("link")&&t.push(o9),n.includes("lists")&&t.push(KP,GP,LY),n.includes("codeblock")){const r={...UP,dependencies:[qo],replace:(i,s,o)=>{const l=Ha({code:"",language:o[1]??"",meta:""});i.replace(l),setTimeout(()=>{l.select()},80)}};t.push(r)}return t}const qY=()=>{const n=ut(qu),e=nn(Zv),t=nn(QO),r=t.includes("quote"),i=t.includes("headings"),s=kn();if(!r&&!i)return null;const o=[{label:s("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&o.push({label:s("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const l=nn(ff);o.push(...l.map(a=>({label:s("toolbar.blockTypes.heading","Heading {{level}}",{level:a}),value:`h${a}`})))}return C.createElement(Zq,{value:e,onChange:l=>{switch(l){case"quote":n(()=>Va());break;case"paragraph":n(()=>Re());break;case"":break;default:if(l.startsWith("h"))n(()=>wr(l));else throw new Error(`Unknown block type: ${l}`)}},triggerTitle:s("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:s("toolbar.blockTypeSelect.placeholder","Block type"),items:o})},hp=({format:n,addTitle:e,removeTitle:t,icon:r,formatName:i})=>{const[s,o]=Wt(Ov,rr),l=ut(xv),a=(s&n)!==0;return C.createElement(G3,{title:a?t:e,on:a,onValueChange:()=>{l(i)}},o(r))},jY=({options:n})=>{const e=kn(),t=typeof n>"u";return C.createElement("div",{className:H.toolbarGroupOfGroups},t||n.includes("Bold")?C.createElement(hp,{format:Ll,addTitle:e("toolbar.bold","Bold"),removeTitle:e("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,t||n.includes("Italic")?C.createElement(hp,{format:Il,addTitle:e("toolbar.italic","Italic"),removeTitle:e("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,t||n.includes("Underline")?C.createElement(hp,{format:Rl,addTitle:e("toolbar.underline","Underline"),removeTitle:e("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},YY=()=>{const n=ut(H1),e=nn(rr),t=kn();return C.createElement(jq,{"aria-label":t("toolbar.link","Create link"),title:t("toolbar.link","Create link"),onClick:r=>{n()}},e("link"))},HY=({children:n,SourceToolbar:e,options:t=["rich-text","diff","source"]})=>{const[r,i]=Wt(Ei,rr),s=ut(Ei),o=kn(),l=[];return t.includes("rich-text")&&l.push({title:o("toolbar.richText","Rich text"),contents:i("rich_text"),value:"rich-text"}),t.includes("diff")&&l.push({title:o("toolbar.diffMode","Diff mode"),contents:i("difference"),value:"diff"}),t.includes("source")&&l.push({title:o("toolbar.source","Source mode"),contents:i("markdown"),value:"source"}),C.createElement(C.Fragment,null,r==="rich-text"?n:r==="diff"?C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.diffMode","Diff mode")):e??C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.source","Source mode")),C.createElement("div",{className:H.diffSourceToggleWrapper},C.createElement(K3,{className:H.diffSourceToggle,ggClassName:H.ggDiffSourceToggle,value:r,items:l,onChange:a=>{s(a===""?"rich-text":a)}})))},UY=C.forwardRef((n,e)=>{const t=ut(G5),[r,i]=Wt(yn,rr),s=kn();return C.createElement(P5,{className:H.toolbarButton,ref:e,disabled:r,onClick:()=>{t()}},C.createElement(cc,{title:s("toolbar.image","Insert image")},i("add_photo")))}),GY={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},KY=({options:n=["bullet","number","check"]})=>{const[e,t]=Wt(cg,rr),r=ut(r5),i=kn(),s={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},o=n.map(l=>({value:l,title:s[l],contents:t(GY[l])}));return C.createElement(K3,{value:e||"",items:o,onChange:r})},tw=()=>{const[n,e]=Wt(rr,st),[t,r]=C.useState(!1),[i,s]=C.useState(!1),o=kn();return C.useEffect(()=>{if(e)return ln(e.registerCommand(Ol,l=>(r(l),!1),si),e.registerCommand(ml,l=>(s(l),!1),si))},[e]),C.createElement(Yq,{items:[{title:o("toolbar.undo","Undo {{shortcut}}",{shortcut:ju?"⌘Z":"Ctrl+Z"}),disabled:!t,contents:n("undo"),active:!1,onChange:()=>e?.dispatchCommand(Vh,void 0)},{title:o("toolbar.redo","Redo {{shortcut}}",{shortcut:ju?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:n("redo"),active:!1,onChange:()=>e?.dispatchCommand(Fh,void 0)}]})},JY="_mdxeditor_fpzxa_2",eH="_fullscreenBackdrop_fpzxa_2",tH="_fullscreenContainer_fpzxa_2",nH="_fullscreen_fpzxa_2",iu={mdxeditor:JY,fullscreenBackdrop:eH,fullscreenContainer:tH,fullscreen:nH},rH={match:(n,e)=>!0,priority:0,Editor:n=>{const e=IR();return G.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:t=>t.nativeEvent.stopImmediatePropagation(),children:[G.jsx("input",{defaultValue:n.language}),G.jsx("textarea",{className:"flex-1",defaultValue:n.code,onChange:t=>e.setCode(t.target.value)})]})}};function iH(n){const e=[];function t(r){for(const i of r)e.push(i),i.children&&t(i.children)}return t(n),e}function
|
|
100
|
+
`)}const a=He(l);o.append(a),n.append(o)}else e&&YP((a=>ti(a?a[1]:void 0)))(n,e,t,s)},type:"multiline-element"},GP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:_Y,replace:c0("bullet"),type:"element"},LY={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:PY,replace:c0("check"),type:"element"},KP={dependencies:[Nr,ir],export:(n,e)=>xe(n)?$f(n,e,0):null,regExp:TY,replace:c0("number"),type:"element"},JP={format:["code"],tag:"`",type:"text-format"},IY={format:["highlight"],tag:"==",type:"text-format"},e9={format:["bold","italic"],tag:"***",type:"text-format"},t9={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},n9={format:["bold"],tag:"**",type:"text-format"},r9={format:["bold"],intraword:!1,tag:"__",type:"text-format"},RY={format:["strikethrough"],tag:"~~",type:"text-format"},i9={format:["italic"],tag:"*",type:"text-format"},s9={format:["italic"],intraword:!1,tag:"_",type:"text-format"},o9={dependencies:[hi],export:(n,e,t)=>{if(!xr(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=Ss(r,{title:i}),o=He(t);return o.setFormat(n.getFormat()),s.append(o),n.replace(s),o},trigger:")",type:"text-match"},NY=[MY,HP,GP,KP],DY=[UP],ZY=[JP,e9,t9,n9,r9,IY,i9,s9,RY],BY=[o9],l9=[...NY,...DY,...ZY,...BY],zY=[{dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...l9];function ew({transformers:n=zY}){const[e]=Nt();return R.useEffect((()=>CY(e,n)),[e,n]),null}const VY=Ln({init(n){const e=n.getValue(QO),t=e.includes("headings")?n.getValue(ff):[],r=WY(e,t);n.pubIn({[Qs]:()=>C.createElement(ew,{transformers:r}),[Dv]:()=>C.createElement(ew,{transformers:r})})}}),FY=n=>(e,t,r)=>{const i=n(r);i.append(...t),e.replace(i),i.select(0,0)},XY={dependencies:[qa],export:n=>df(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Xo();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"};function WY(n,e){const t=[e9,t9,n9,r9,JP,i9,s9];if(n.includes("headings")){const r=Math.min(...e),i=Math.max(...e),s=new RegExp(`^(#{${r},${i}})\\s`),o={dependencies:[Fa],export:(l,a)=>{if(!of(l))return null;const c=Number(l.getTag().slice(1));return"#".repeat(c)+" "+a(l)},regExp:s,replace:FY(l=>{const a=`h${l[1].length}`;return wr(a)}),type:"element"};t.push(o)}if(n.includes("thematicBreak")&&t.push(XY),n.includes("quote")&&t.push(HP),n.includes("link")&&t.push(o9),n.includes("lists")&&t.push(KP,GP,LY),n.includes("codeblock")){const r={...UP,dependencies:[qo],replace:(i,s,o)=>{const l=Ha({code:"",language:o[1]??"",meta:""});i.replace(l),setTimeout(()=>{l.select()},80)}};t.push(r)}return t}const qY=()=>{const n=ut(qu),e=nn(Zv),t=nn(QO),r=t.includes("quote"),i=t.includes("headings"),s=kn();if(!r&&!i)return null;const o=[{label:s("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&o.push({label:s("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const l=nn(ff);o.push(...l.map(a=>({label:s("toolbar.blockTypes.heading","Heading {{level}}",{level:a}),value:`h${a}`})))}return C.createElement(Zq,{value:e,onChange:l=>{switch(l){case"quote":n(()=>Va());break;case"paragraph":n(()=>Re());break;case"":break;default:if(l.startsWith("h"))n(()=>wr(l));else throw new Error(`Unknown block type: ${l}`)}},triggerTitle:s("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:s("toolbar.blockTypeSelect.placeholder","Block type"),items:o})},hp=({format:n,addTitle:e,removeTitle:t,icon:r,formatName:i})=>{const[s,o]=Wt(Ov,rr),l=ut(xv),a=(s&n)!==0;return C.createElement(G3,{title:a?t:e,on:a,onValueChange:()=>{l(i)}},o(r))},jY=({options:n})=>{const e=kn(),t=typeof n>"u";return C.createElement("div",{className:H.toolbarGroupOfGroups},t||n.includes("Bold")?C.createElement(hp,{format:Ll,addTitle:e("toolbar.bold","Bold"),removeTitle:e("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,t||n.includes("Italic")?C.createElement(hp,{format:Il,addTitle:e("toolbar.italic","Italic"),removeTitle:e("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,t||n.includes("Underline")?C.createElement(hp,{format:Rl,addTitle:e("toolbar.underline","Underline"),removeTitle:e("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},YY=()=>{const n=ut(H1),e=nn(rr),t=kn();return C.createElement(jq,{"aria-label":t("toolbar.link","Create link"),title:t("toolbar.link","Create link"),onClick:r=>{n()}},e("link"))},HY=({children:n,SourceToolbar:e,options:t=["rich-text","diff","source"]})=>{const[r,i]=Wt(Ei,rr),s=ut(Ei),o=kn(),l=[];return t.includes("rich-text")&&l.push({title:o("toolbar.richText","Rich text"),contents:i("rich_text"),value:"rich-text"}),t.includes("diff")&&l.push({title:o("toolbar.diffMode","Diff mode"),contents:i("difference"),value:"diff"}),t.includes("source")&&l.push({title:o("toolbar.source","Source mode"),contents:i("markdown"),value:"source"}),C.createElement(C.Fragment,null,r==="rich-text"?n:r==="diff"?C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.diffMode","Diff mode")):e??C.createElement("span",{className:H.toolbarTitleMode},o("toolbar.source","Source mode")),C.createElement("div",{className:H.diffSourceToggleWrapper},C.createElement(K3,{className:H.diffSourceToggle,ggClassName:H.ggDiffSourceToggle,value:r,items:l,onChange:a=>{s(a===""?"rich-text":a)}})))},UY=C.forwardRef((n,e)=>{const t=ut(G5),[r,i]=Wt(yn,rr),s=kn();return C.createElement(P5,{className:H.toolbarButton,ref:e,disabled:r,onClick:()=>{t()}},C.createElement(cc,{title:s("toolbar.image","Insert image")},i("add_photo")))}),GY={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},KY=({options:n=["bullet","number","check"]})=>{const[e,t]=Wt(cg,rr),r=ut(r5),i=kn(),s={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},o=n.map(l=>({value:l,title:s[l],contents:t(GY[l])}));return C.createElement(K3,{value:e||"",items:o,onChange:r})},tw=()=>{const[n,e]=Wt(rr,st),[t,r]=C.useState(!1),[i,s]=C.useState(!1),o=kn();return C.useEffect(()=>{if(e)return ln(e.registerCommand(Ol,l=>(r(l),!1),si),e.registerCommand(ml,l=>(s(l),!1),si))},[e]),C.createElement(Yq,{items:[{title:o("toolbar.undo","Undo {{shortcut}}",{shortcut:ju?"⌘Z":"Ctrl+Z"}),disabled:!t,contents:n("undo"),active:!1,onChange:()=>e?.dispatchCommand(Vh,void 0)},{title:o("toolbar.redo","Redo {{shortcut}}",{shortcut:ju?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:n("redo"),active:!1,onChange:()=>e?.dispatchCommand(Fh,void 0)}]})},JY="_mdxeditor_fpzxa_2",eH="_fullscreenBackdrop_fpzxa_2",tH="_fullscreenContainer_fpzxa_2",nH="_fullscreen_fpzxa_2",iu={mdxeditor:JY,fullscreenBackdrop:eH,fullscreenContainer:tH,fullscreen:nH},rH={match:(n,e)=>!0,priority:0,Editor:n=>{const e=IR();return G.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:t=>t.nativeEvent.stopImmediatePropagation(),children:[G.jsx("input",{defaultValue:n.language}),G.jsx("textarea",{className:"flex-1",defaultValue:n.code,onChange:t=>e.setCode(t.target.value)})]})}};function iH(n){const e=[];function t(r){for(const i of r)e.push(i),i.children&&t(i.children)}return t(n),e}function IH({id:n,className:e,markdown:t,name:r,register:i,onChange:s,fieldDisplayName:o,fullscreenable:l=!0}){const{data:a}=u9(),c=R.useRef(t),[u,h]=R.useState(!1),f=a9(c9);R.useEffect(()=>{const m=O=>{O.key==="Escape"&&u&&h(!1)};return u&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[u]);const d=R.useMemo(()=>a?iH(a):[],[a]),p=()=>G.jsx(G.Fragment,{children:G.jsxs("div",{className:"flex items-center flex-1 gap-1",children:[u&&G.jsxs(G.Fragment,{children:[G.jsx("span",{className:"text-sm font-medium text-gray-600",children:o}),G.jsx(Hc,{})]}),G.jsx(qY,{}),G.jsx(jY,{}),G.jsx(Hc,{}),G.jsx(KY,{options:["bullet","number"]}),G.jsx(Hc,{}),G.jsx(YY,{}),G.jsx(UY,{}),G.jsxs("div",{className:"flex items-center ml-auto gap-1",children:[f?.role==="developer"?G.jsx(HY,{children:G.jsx(tw,{})}):G.jsx(tw,{}),l&&G.jsxs(G.Fragment,{children:[G.jsx(Hc,{}),G.jsx("button",{type:"button",className:"p-1 hover:bg-gray-100 rounded transition-colors",onClick:()=>h(!u),title:u?"Exit fullscreen":"Enter fullscreen","aria-label":u?"Exit fullscreen":"Enter fullscreen",children:u?G.jsx(z9,{size:16}):G.jsx(Z9,{size:16})})]})]})]})}),g=()=>G.jsx("div",{id:n,children:G.jsx(NM,{...i(r),className:uc("flex flex-col w-full rounded-md border border-input bg-transparent text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",iu.mdxeditor,u?iu.fullscreen:e),suppressHtmlProcessing:!0,markdown:t,onChange:s,plugins:[FM(),yL(),pI(),Fq(),$R(),yR({imageAutocompleteSuggestions:d?.filter(m=>m.type!=="directory").map(m=>m.relativePath),imagePreviewHandler:m=>new Promise(O=>O(`/${m}`)),disableImageResize:!0}),UM(),VY(),VR({codeBlockEditorDescriptors:[rH]}),cY({viewMode:"rich-text",diffMarkdown:c.current}),Hq({toolbarClassName:uc("flex flex-row overflow-hidden shrink-0 h-10 border-b bg-white rounded-none",u&&"border-gray-200"),toolbarContents:p})]})});return u?fp.createPortal(G.jsx("div",{className:uc("fixed inset-0 z-50",iu.fullscreenBackdrop),children:G.jsx("div",{className:uc("m-8 h-[calc(100vh-4rem)] flex flex-col bg-white rounded-lg shadow-2xl",iu.fullscreenContainer),children:g()})}),document.body):g()}export{IH as default};
|