@isardsat/editorial-admin 6.4.2 → 6.4.4
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/{dashboard._collection._document-DIZN2iYh.js → dashboard._collection._document-CjPV6DBM.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-CwbH5p80.js → dashboard._collection.new-BJEQdRj5.js} +1 -1
- package/build/client/assets/{dashboard.files-yiR8nzfC.js → dashboard.files-D61rcU4r.js} +1 -1
- package/build/client/assets/files-BkbeSoaZ.js +26 -0
- package/build/client/assets/{itemForm-GgzEy97l.js → itemForm-DeCuor51.js} +6 -6
- package/build/client/assets/{itemForm-Cmaxg87K.css → itemForm-ya4bvPWM.css} +1 -1
- package/build/client/assets/manifest-17a9c848.js +1 -0
- package/build/client/assets/root-DVVVBPEK.css +1 -0
- package/build/client/index.html +3 -3
- package/package.json +2 -2
- package/build/client/assets/files-JeyUc7x_.js +0 -26
- package/build/client/assets/manifest-5e701981.js +0 -1
- package/build/client/assets/root-CB55qcm6.css +0 -1
- /package/build/client/assets/{root-CBzRfVLY.js → root-DwCI6c10.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as _,a as I,p as M,A as Ty,x as Xg,B as Qg,C as Jd}from"./chunk-EF7DTUVF-MlADC7xe.js";import{b as Ms,B as pi}from"./button-D_tNOZW3.js";import{I as mo,g as Iy,u as uc,h as Ny,s as Gr,b as My,l as Ay,o as Oy,F as Py,a as Qa,c as el,d as is,e as tl,f as nl,C as Fy,i as Kd,t as Ly}from"./types-DI1nugUt.js";import{a as he,q as ep,r as Dy,t as Ry}from"./utils-DN8wQ0jG.js";import{c as tp}from"./createLucideIcon-BJQzFwzJ.js";import{h as $y,i as ca,j as np,u as Oo,k as cc,l as rp,m as ip,n as op,o as sp,p as ap,F as lp,q as up,r as cp,s as dp,R as fp,W as By,C as hp,T as gp,D as Hy,a as dc,P as pp,O as mp,t as Vy,X as zy,v as xp,b as Wy,V as jy,c as yp,d as bp,e as vp,f as Cp,g as wp,A as Uy}from"./index-BCIQh_1v.js";import{C as Jy}from"./upload-CopmcV94.js";import{u as Pr,c as Kr,b as _p,P as Ue,a as we,d as or}from"./index-BKOWzfnu.js";import{u as ct,a as As,b as Ky}from"./index-b67bZzAe.js";import{C as kp}from"./calendar-6ih_JEvR.js";import{F as Zy}from"./files-
|
|
1
|
+
import{R as _,a as I,p as M,A as Ty,x as Xg,B as Qg,C as Jd}from"./chunk-EF7DTUVF-MlADC7xe.js";import{b as Ms,B as pi}from"./button-D_tNOZW3.js";import{I as mo,g as Iy,u as uc,h as Ny,s as Gr,b as My,l as Ay,o as Oy,F as Py,a as Qa,c as el,d as is,e as tl,f as nl,C as Fy,i as Kd,t as Ly}from"./types-DI1nugUt.js";import{a as he,q as ep,r as Dy,t as Ry}from"./utils-DN8wQ0jG.js";import{c as tp}from"./createLucideIcon-BJQzFwzJ.js";import{h as $y,i as ca,j as np,u as Oo,k as cc,l as rp,m as ip,n as op,o as sp,p as ap,F as lp,q as up,r as cp,s as dp,R as fp,W as By,C as hp,T as gp,D as Hy,a as dc,P as pp,O as mp,t as Vy,X as zy,v as xp,b as Wy,V as jy,c as yp,d as bp,e as vp,f as Cp,g as wp,A as Uy}from"./index-BCIQh_1v.js";import{C as Jy}from"./upload-CopmcV94.js";import{u as Pr,c as Kr,b as _p,P as Ue,a as we,d as or}from"./index-BKOWzfnu.js";import{u as ct,a as As,b as Ky}from"./index-b67bZzAe.js";import{C as kp}from"./calendar-6ih_JEvR.js";import{F as Zy}from"./files-BkbeSoaZ.js";import{E as Sp}from"./external-link-D1If5twJ.js";import{a as Os}from"./index-xBXWoUIa.js";import{_ as Zd}from"./authSlice-Ck6mjgyY.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -14,7 +14,7 @@ You can add a description to the \`${ai}\` by passing a \`${km}\` component as a
|
|
|
14
14
|
|
|
15
15
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ai}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
16
16
|
|
|
17
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},_C=ym,kC=bm,SC=vm,EC=Cm,TC=Em,IC=Im,NC=_m,MC=Sm;function AC({...e}){return M.jsx(_C,{"data-slot":"alert-dialog",...e})}function OC({...e}){return M.jsx(kC,{"data-slot":"alert-dialog-portal",...e})}function PC({className:e,...t}){return M.jsx(SC,{"data-slot":"alert-dialog-overlay",className:he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function FC({className:e,...t}){return M.jsxs(OC,{children:[M.jsx(PC,{}),M.jsx(EC,{"data-slot":"alert-dialog-content",className:he("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function LC({className:e,...t}){return M.jsx("div",{"data-slot":"alert-dialog-header",className:he("flex flex-col gap-2 text-center sm:text-left",e),...t})}function DC({className:e,...t}){return M.jsx("div",{"data-slot":"alert-dialog-footer",className:he("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function RC({className:e,...t}){return M.jsx(NC,{"data-slot":"alert-dialog-title",className:he("text-lg font-semibold",e),...t})}function $C({className:e,...t}){return M.jsx(MC,{"data-slot":"alert-dialog-description",className:he("text-muted-foreground text-sm",e),...t})}function BC({className:e,...t}){return M.jsx(TC,{className:he(Ms(),e),...t})}function HC({className:e,...t}){return M.jsx(IC,{className:he(Ms({variant:"outline"}),e),...t})}function VC({hasUnsavedChanges:e,title:t="Unsaved Changes",description:n="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:r="Stay on Page",leaveButtonText:i="Leave Page"}){const o=Ty(({currentLocation:c,nextLocation:d})=>e&&c.pathname!==d.pathname),[s,a]=I.useState(!1),l=()=>{o.state==="blocked"&&o.proceed()},u=()=>{o.state==="blocked"&&o.reset()};return I.useEffect(()=>{a(o.state==="blocked")},[o.state,s]),M.jsx(AC,{open:s,onOpenChange:a,children:M.jsxs(FC,{children:[M.jsxs(LC,{children:[M.jsx(RC,{children:t}),M.jsx($C,{children:n})]}),M.jsxs(DC,{children:[M.jsx(HC,{onClick:u,children:r}),M.jsx(BC,{onClick:l,children:i})]})]})})}function zC({value:e,name:t,register:n,onChange:r}){const{isLoading:i}=ep(),[o,s]=I.useState(!1);return i?M.jsx("div",{children:"Loading..."}):M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsxs("div",{className:"relative flex items-center flex-1",children:[M.jsx(mo,{...n(t),type:"text",value:e,readOnly:!0,onClick:()=>{s(!0)},onChange:a=>r(a.target.value),className:"border p-2 rounded"}),M.jsx(Xg,{to:`/${e}`,className:"absolute right-2",target:"_blank",children:M.jsx(Sp,{className:"h-4"})})]}),M.jsx(pi,{type:"button",onClick:()=>r(""),className:"text-white px-4 py-2 rounded",children:"Clear"})]}),o&&M.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:M.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-lg max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[M.jsxs("div",{className:"flex justify-between items-center mb-4",children:[M.jsx("h2",{className:"text-xl font-bold",children:"Select File"}),M.jsx(pi,{onClick:()=>s(!1),children:M.jsx(zy,{})})]}),M.jsx(Zy,{onChange:a=>{s(!1),r(a)}})]})})]})}var WC=Object.defineProperty,jC=(e,t,n)=>t in e?WC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,er=(e,t,n)=>jC(e,typeof t!="symbol"?t+"":t,n);let UC=class Nm{constructor(t=new Map){this.map=t}clone(){return new Nm(new Map(this.map))}increment(t){const n=this.map.get(t)??0;this.map.set(t,n+1)}decrement(t,n){let r=this.map.get(t);r!==void 0&&(r-=1,this.map.set(t,r),r===0&&n())}},os=class{constructor(){er(this,"map",new Map)}getOrCreate(t){let n=this.map.get(t);return n===void 0&&(n=new Set,this.map.set(t,n)),n}get(t){return this.map.get(t)}use(t,n){const r=this.get(t);r!==void 0&&n(r)}delete(t){return this.map.delete(t)}};function Ir(e,t){return t(e),e}function mc(){}const Mm="cell";function lf(e,t){return e===t}const ha=new Map;let JC=class{constructor(t={}){er(this,"subscriptions",new os),er(this,"singletonSubscriptions",new Map),er(this,"graph",new os),er(this,"state",new Map),er(this,"distinctNodes",new Map),er(this,"executionMaps",new Map),er(this,"definitionRegistry",new Set);for(const n of Object.getOwnPropertySymbols(t))this.state.set(n,t[n])}cellInstance(t,n=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,t),n!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,n===!0?lf:n),r}signalInstance(t=!0,n=Symbol()){return t!==!1&&this.distinctNodes.set(n,t===!0?lf:t),n}sub(t,n){this.register(t);const r=this.subscriptions.getOrCreate(t);return r.add(n),()=>r.delete(n)}singletonSub(t,n){return this.register(t),n===void 0?this.singletonSubscriptions.delete(t):this.singletonSubscriptions.set(t,n),()=>this.singletonSubscriptions.delete(t)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(t,n){const r=this.signalInstance();return this.connect({map:i=>(...o)=>{i(o)},sink:r,sources:t}),this.sub(r,n)}pubIn(t){var n;const r=Reflect.ownKeys(t),i=this.getExecutionMap(r),o=i.refCount.clone(),s=i.participatingNodes.slice(),a=new Map(this.state),l=u=>{this.graph.use(u,c=>{for(const{sources:d,sink:f}of c)d.has(u)&&o.decrement(f,()=>{s.splice(s.indexOf(f),1),l(f)})})};for(;;){const u=s.shift();if(u===void 0)break;const c=u;let d=!1;const f=h=>{const g=this.distinctNodes.get(c);if(g!=null&&g(a.get(c),h)){d=!1;return}d=!0,a.set(c,h),this.state.has(c)&&this.state.set(c,h)};if(Object.prototype.hasOwnProperty.call(t,c)?f(t[c]):i.projections.use(c,h=>{for(const g of h){const x=[...Array.from(g.sources),...Array.from(g.pulls)].map(b=>a.get(b));g.map(f)(...x)}}),d){const h=a.get(c);this.inContext(()=>{this.subscriptions.use(c,g=>{for(const x of g)x(h)})}),(n=this.singletonSubscriptions.get(c))==null||n(h)}else l(c)}}connect({sources:t,pulls:n=[],map:r,sink:i}){const o={map:r,pulls:new Set(n),sink:this.register(i),sources:new Set(t)};for(const s of[...t,...n])this.register(s),this.graph.getOrCreate(s).add(o);this.executionMaps.clear()}pub(t,n){this.pubIn({[t]:n})}pipe(t,...n){return this.combineOperators(...n)(t)}transformer(...t){return n=>Ir(this.signalInstance(),r=>(this.link(this.pipe(r,...t),n),r))}link(t,n){this.connect({map:r=>i=>{r(i)},sink:n,sources:[t]})}combine(...t){return Ir(this.signalInstance(),n=>{this.connect({map:r=>(...i)=>{r(i)},sink:n,sources:t})})}combineCells(...t){return Ir(this.cellInstance(t.map(n=>this.getValue(n)),!0),n=>{this.connect({map:r=>(...i)=>{r(i)},sink:n,sources:t})})}getValue(t){return this.register(t),this.state.get(t)}getValues(t){return t.map(n=>this.getValue(n))}register(t){const n=ha.get(t);return n===void 0||this.definitionRegistry.has(t)?t:(this.definitionRegistry.add(t),Ir(n.type===Mm?this.cellInstance(n.initial,n.distinct,t):this.signalInstance(n.distinct,t),r=>{this.inContext(()=>{n.init(this,r)})}))}inContext(t){return t()}changeWith(t,n,r){this.connect({sources:[n],pulls:[t],sink:t,map:i=>(o,s)=>{i(r(s,o))}})}calculateExecutionMap(t){const n=[],r=new Set,i=new os,o=new UC,s=new os,a=(l,u=0)=>{o.increment(l),!r.has(l)&&(this.register(l),i.use(l,c=>{u=Math.max(...Array.from(c).map(d=>n.indexOf(d)))+1}),this.graph.use(l,c=>{for(const d of c)d.sources.has(l)?(s.getOrCreate(d.sink).add(d),a(d.sink,u)):i.getOrCreate(d.sink).add(l)}),r.add(l),n.splice(u,0,l))};return t.forEach(a),{participatingNodes:n,pendingPulls:i,projections:s,refCount:o}}getExecutionMap(t){let n=t;if(t.length===1){n=t[0];const i=this.executionMaps.get(n);if(i!==void 0)return i}else for(const[i,o]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===t.length&&i.every(s=>t.includes(s)))return o;const r=this.calculateExecutionMap(t);return this.executionMaps.set(n,r),r}combineOperators(...t){return n=>{for(const r of t)n=r(n,this);return n}}};function ne(e,t=mc,n=!0){return Ir(Symbol(),r=>{ha.set(r,{type:Mm,distinct:n,initial:e,init:t})})}function it(e=mc,t=!1){return Ir(Symbol(),n=>{ha.set(n,{type:"signal",distinct:t,init:e})})}function cr(e=mc){return Ir(Symbol(),t=>{ha.set(t,{type:"signal",distinct:!1,init:e})})}const Am=I.createContext(null);function ga(){const e=I.useContext(Am);if(e===null)throw new Error("useRealm must be used within a RealmContextProvider");return e}function Ot(e){const t=ga();t.register(e);const n=I.useCallback(r=>t.sub(e,r),[t,e]);return I.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function rn(...e){const t=ga();return Ot(t.combineCells.apply(t,e))}function _t(e){const t=ga();return t.register(e),I.useCallback(n=>{t.pub(e,n)},[t,e])}function li(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{i(e(o))},sink:r,sources:[t]}),r}}function We(...e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>(...o)=>{i(o)},pulls:e,sink:r,sources:[t]}),r}}function Om(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>()=>{i(e)},sink:r,sources:[t]}),r}}function Ro(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{e(o)&&i(o)},sink:r,sources:[t]}),r}}function Pm(e,t){return(n,r)=>{const i=r.signalInstance();return r.connect({map:o=>s=>{o(t=e(t,s))},sink:i,sources:[n]}),i}}function KC(e,t){return t(e),e}function ui(){}function on(e){return function(t){return{init:n=>{var r;return(r=e.init)==null?void 0:r.call(e,n,t)},postInit:n=>{var r;return(r=e.postInit)==null?void 0:r.call(e,n,t)},update:n=>{var r;return(r=e.update)==null?void 0:r.call(e,n,t)}}}}function ZC({children:e,plugins:t}){const n=_.useMemo(()=>KC(new JC,r=>{var i,o;for(const s of t)(i=s.init)==null||i.call(s,r);for(const s of t)(o=s.postInit)==null||o.call(s,r)}),[]);return _.useEffect(()=>{var r;for(const i of t)(r=i.update)==null||r.call(i,n)}),_.createElement(Am.Provider,{value:n},e)}const Fm=I.createContext(null);function qC(e,t){return{getTheme:function(){return t??null}}}function yt(){const e=I.useContext(Fm);return e==null&&function(t,...n){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const o of n)i.append("v",o);throw r.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function W(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const sn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,YC=sn&&"documentMode"in document?document.documentMode:null,Ut=sn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ir=sn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ps=!(!sn||!("InputEvent"in window)||YC)&&"getTargetRanges"in new window.InputEvent("input"),bo=sn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),yi=sn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,GC=sn&&/Android/.test(navigator.userAgent),Lm=sn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),uf=sn&&GC&&Lm,Fs=sn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Lm;function Ls(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const XC=1,QC=3,ew=9,tw=11,Fr=0,Dm=1,bi=2,nw=0,rw=1,iw=2,Ds=4,Rs=8,xc=128,ow=1792|(112|(3|Ds|Rs)|xc),yc=1,bc=2,vc=3,Cc=4,wc=5,_c=6,pa=bo||yi||Fs?" ":"",Vn=`
|
|
17
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},_C=ym,kC=bm,SC=vm,EC=Cm,TC=Em,IC=Im,NC=_m,MC=Sm;function AC({...e}){return M.jsx(_C,{"data-slot":"alert-dialog",...e})}function OC({...e}){return M.jsx(kC,{"data-slot":"alert-dialog-portal",...e})}function PC({className:e,...t}){return M.jsx(SC,{"data-slot":"alert-dialog-overlay",className:he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function FC({className:e,...t}){return M.jsxs(OC,{children:[M.jsx(PC,{}),M.jsx(EC,{"data-slot":"alert-dialog-content",className:he("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function LC({className:e,...t}){return M.jsx("div",{"data-slot":"alert-dialog-header",className:he("flex flex-col gap-2 text-center sm:text-left",e),...t})}function DC({className:e,...t}){return M.jsx("div",{"data-slot":"alert-dialog-footer",className:he("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function RC({className:e,...t}){return M.jsx(NC,{"data-slot":"alert-dialog-title",className:he("text-lg font-semibold",e),...t})}function $C({className:e,...t}){return M.jsx(MC,{"data-slot":"alert-dialog-description",className:he("text-muted-foreground text-sm",e),...t})}function BC({className:e,...t}){return M.jsx(TC,{className:he(Ms(),e),...t})}function HC({className:e,...t}){return M.jsx(IC,{className:he(Ms({variant:"outline"}),e),...t})}function VC({hasUnsavedChanges:e,title:t="Unsaved Changes",description:n="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:r="Stay on Page",leaveButtonText:i="Leave Page"}){const o=Ty(({currentLocation:c,nextLocation:d})=>e&&c.pathname!==d.pathname),[s,a]=I.useState(!1),l=()=>{o.state==="blocked"&&o.proceed()},u=()=>{o.state==="blocked"&&o.reset()};return I.useEffect(()=>{a(o.state==="blocked")},[o.state,s]),I.useEffect(()=>{const c=d=>{e&&(d.preventDefault(),d.returnValue="")};return e&&window.addEventListener("beforeunload",c),()=>{window.removeEventListener("beforeunload",c)}},[e]),M.jsx(AC,{open:s,onOpenChange:a,children:M.jsxs(FC,{children:[M.jsxs(LC,{children:[M.jsx(RC,{children:t}),M.jsx($C,{children:n})]}),M.jsxs(DC,{children:[M.jsx(HC,{onClick:u,children:r}),M.jsx(BC,{onClick:l,children:i})]})]})})}function zC({value:e,name:t,register:n,onChange:r}){const{isLoading:i}=ep(),[o,s]=I.useState(!1);return i?M.jsx("div",{children:"Loading..."}):M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsxs("div",{className:"relative flex items-center flex-1",children:[M.jsx(mo,{...n(t),type:"text",value:e,readOnly:!0,onClick:()=>{s(!0)},onChange:a=>r(a.target.value),className:"border p-2 rounded"}),M.jsx(Xg,{to:`/${e}`,className:"absolute right-2",target:"_blank",children:M.jsx(Sp,{className:"h-4"})})]}),M.jsx(pi,{type:"button",onClick:()=>r(""),className:"text-white px-4 py-2 rounded",children:"Clear"})]}),o&&M.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",children:M.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-lg max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[M.jsxs("div",{className:"flex justify-between items-center mb-4",children:[M.jsx("h2",{className:"text-xl font-bold",children:"Select File"}),M.jsx(pi,{onClick:()=>s(!1),children:M.jsx(zy,{})})]}),M.jsx(Zy,{onChange:a=>{s(!1),r(a)}})]})})]})}var WC=Object.defineProperty,jC=(e,t,n)=>t in e?WC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,er=(e,t,n)=>jC(e,typeof t!="symbol"?t+"":t,n);let UC=class Nm{constructor(t=new Map){this.map=t}clone(){return new Nm(new Map(this.map))}increment(t){const n=this.map.get(t)??0;this.map.set(t,n+1)}decrement(t,n){let r=this.map.get(t);r!==void 0&&(r-=1,this.map.set(t,r),r===0&&n())}},os=class{constructor(){er(this,"map",new Map)}getOrCreate(t){let n=this.map.get(t);return n===void 0&&(n=new Set,this.map.set(t,n)),n}get(t){return this.map.get(t)}use(t,n){const r=this.get(t);r!==void 0&&n(r)}delete(t){return this.map.delete(t)}};function Ir(e,t){return t(e),e}function mc(){}const Mm="cell";function lf(e,t){return e===t}const ha=new Map;let JC=class{constructor(t={}){er(this,"subscriptions",new os),er(this,"singletonSubscriptions",new Map),er(this,"graph",new os),er(this,"state",new Map),er(this,"distinctNodes",new Map),er(this,"executionMaps",new Map),er(this,"definitionRegistry",new Set);for(const n of Object.getOwnPropertySymbols(t))this.state.set(n,t[n])}cellInstance(t,n=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,t),n!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,n===!0?lf:n),r}signalInstance(t=!0,n=Symbol()){return t!==!1&&this.distinctNodes.set(n,t===!0?lf:t),n}sub(t,n){this.register(t);const r=this.subscriptions.getOrCreate(t);return r.add(n),()=>r.delete(n)}singletonSub(t,n){return this.register(t),n===void 0?this.singletonSubscriptions.delete(t):this.singletonSubscriptions.set(t,n),()=>this.singletonSubscriptions.delete(t)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(t,n){const r=this.signalInstance();return this.connect({map:i=>(...o)=>{i(o)},sink:r,sources:t}),this.sub(r,n)}pubIn(t){var n;const r=Reflect.ownKeys(t),i=this.getExecutionMap(r),o=i.refCount.clone(),s=i.participatingNodes.slice(),a=new Map(this.state),l=u=>{this.graph.use(u,c=>{for(const{sources:d,sink:f}of c)d.has(u)&&o.decrement(f,()=>{s.splice(s.indexOf(f),1),l(f)})})};for(;;){const u=s.shift();if(u===void 0)break;const c=u;let d=!1;const f=h=>{const g=this.distinctNodes.get(c);if(g!=null&&g(a.get(c),h)){d=!1;return}d=!0,a.set(c,h),this.state.has(c)&&this.state.set(c,h)};if(Object.prototype.hasOwnProperty.call(t,c)?f(t[c]):i.projections.use(c,h=>{for(const g of h){const x=[...Array.from(g.sources),...Array.from(g.pulls)].map(b=>a.get(b));g.map(f)(...x)}}),d){const h=a.get(c);this.inContext(()=>{this.subscriptions.use(c,g=>{for(const x of g)x(h)})}),(n=this.singletonSubscriptions.get(c))==null||n(h)}else l(c)}}connect({sources:t,pulls:n=[],map:r,sink:i}){const o={map:r,pulls:new Set(n),sink:this.register(i),sources:new Set(t)};for(const s of[...t,...n])this.register(s),this.graph.getOrCreate(s).add(o);this.executionMaps.clear()}pub(t,n){this.pubIn({[t]:n})}pipe(t,...n){return this.combineOperators(...n)(t)}transformer(...t){return n=>Ir(this.signalInstance(),r=>(this.link(this.pipe(r,...t),n),r))}link(t,n){this.connect({map:r=>i=>{r(i)},sink:n,sources:[t]})}combine(...t){return Ir(this.signalInstance(),n=>{this.connect({map:r=>(...i)=>{r(i)},sink:n,sources:t})})}combineCells(...t){return Ir(this.cellInstance(t.map(n=>this.getValue(n)),!0),n=>{this.connect({map:r=>(...i)=>{r(i)},sink:n,sources:t})})}getValue(t){return this.register(t),this.state.get(t)}getValues(t){return t.map(n=>this.getValue(n))}register(t){const n=ha.get(t);return n===void 0||this.definitionRegistry.has(t)?t:(this.definitionRegistry.add(t),Ir(n.type===Mm?this.cellInstance(n.initial,n.distinct,t):this.signalInstance(n.distinct,t),r=>{this.inContext(()=>{n.init(this,r)})}))}inContext(t){return t()}changeWith(t,n,r){this.connect({sources:[n],pulls:[t],sink:t,map:i=>(o,s)=>{i(r(s,o))}})}calculateExecutionMap(t){const n=[],r=new Set,i=new os,o=new UC,s=new os,a=(l,u=0)=>{o.increment(l),!r.has(l)&&(this.register(l),i.use(l,c=>{u=Math.max(...Array.from(c).map(d=>n.indexOf(d)))+1}),this.graph.use(l,c=>{for(const d of c)d.sources.has(l)?(s.getOrCreate(d.sink).add(d),a(d.sink,u)):i.getOrCreate(d.sink).add(l)}),r.add(l),n.splice(u,0,l))};return t.forEach(a),{participatingNodes:n,pendingPulls:i,projections:s,refCount:o}}getExecutionMap(t){let n=t;if(t.length===1){n=t[0];const i=this.executionMaps.get(n);if(i!==void 0)return i}else for(const[i,o]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===t.length&&i.every(s=>t.includes(s)))return o;const r=this.calculateExecutionMap(t);return this.executionMaps.set(n,r),r}combineOperators(...t){return n=>{for(const r of t)n=r(n,this);return n}}};function ne(e,t=mc,n=!0){return Ir(Symbol(),r=>{ha.set(r,{type:Mm,distinct:n,initial:e,init:t})})}function it(e=mc,t=!1){return Ir(Symbol(),n=>{ha.set(n,{type:"signal",distinct:t,init:e})})}function cr(e=mc){return Ir(Symbol(),t=>{ha.set(t,{type:"signal",distinct:!1,init:e})})}const Am=I.createContext(null);function ga(){const e=I.useContext(Am);if(e===null)throw new Error("useRealm must be used within a RealmContextProvider");return e}function Ot(e){const t=ga();t.register(e);const n=I.useCallback(r=>t.sub(e,r),[t,e]);return I.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function rn(...e){const t=ga();return Ot(t.combineCells.apply(t,e))}function _t(e){const t=ga();return t.register(e),I.useCallback(n=>{t.pub(e,n)},[t,e])}function li(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{i(e(o))},sink:r,sources:[t]}),r}}function We(...e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>(...o)=>{i(o)},pulls:e,sink:r,sources:[t]}),r}}function Om(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>()=>{i(e)},sink:r,sources:[t]}),r}}function Ro(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:i=>o=>{e(o)&&i(o)},sink:r,sources:[t]}),r}}function Pm(e,t){return(n,r)=>{const i=r.signalInstance();return r.connect({map:o=>s=>{o(t=e(t,s))},sink:i,sources:[n]}),i}}function KC(e,t){return t(e),e}function ui(){}function on(e){return function(t){return{init:n=>{var r;return(r=e.init)==null?void 0:r.call(e,n,t)},postInit:n=>{var r;return(r=e.postInit)==null?void 0:r.call(e,n,t)},update:n=>{var r;return(r=e.update)==null?void 0:r.call(e,n,t)}}}}function ZC({children:e,plugins:t}){const n=_.useMemo(()=>KC(new JC,r=>{var i,o;for(const s of t)(i=s.init)==null||i.call(s,r);for(const s of t)(o=s.postInit)==null||o.call(s,r)}),[]);return _.useEffect(()=>{var r;for(const i of t)(r=i.update)==null||r.call(i,n)}),_.createElement(Am.Provider,{value:n},e)}const Fm=I.createContext(null);function qC(e,t){return{getTheme:function(){return t??null}}}function yt(){const e=I.useContext(Fm);return e==null&&function(t,...n){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const o of n)i.append("v",o);throw r.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function W(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const sn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,YC=sn&&"documentMode"in document?document.documentMode:null,Ut=sn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ir=sn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ps=!(!sn||!("InputEvent"in window)||YC)&&"getTargetRanges"in new window.InputEvent("input"),bo=sn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),yi=sn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,GC=sn&&/Android/.test(navigator.userAgent),Lm=sn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),uf=sn&&GC&&Lm,Fs=sn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Lm;function Ls(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const XC=1,QC=3,ew=9,tw=11,Fr=0,Dm=1,bi=2,nw=0,rw=1,iw=2,Ds=4,Rs=8,xc=128,ow=1792|(112|(3|Ds|Rs)|xc),yc=1,bc=2,vc=3,Cc=4,wc=5,_c=6,pa=bo||yi||Fs?" ":"",Vn=`
|
|
18
18
|
|
|
19
19
|
`,sw=ir?" ":pa,Rm="֑-߿יִ-﷽ﹰ-ﻼ",$m="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",aw=new RegExp("^[^"+$m+"]*["+Rm+"]"),lw=new RegExp("^[^"+Rm+"]*["+$m+"]"),Lr={bold:1,capitalize:1024,code:16,highlight:xc,italic:2,lowercase:256,strikethrough:Ds,subscript:32,superscript:64,underline:Rs,uppercase:512},uw={directionless:1,unmergeable:2},cf={center:bc,end:_c,justify:Cc,left:yc,right:vc,start:wc},cw={[bc]:"center",[_c]:"end",[Cc]:"justify",[yc]:"left",[vc]:"right",[wc]:"start"},dw={normal:0,segmented:2,token:1},fw={[nw]:"normal",[iw]:"segmented",[rw]:"token"},hw="$";function Bm(e,t,n,r,i,o){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(D(s)&&Bm(s,a,n,r,i,o),n.has(a)||o.delete(a),i.push(a)),s=s.getNextSibling()}}const gw=100;let Zl=!1,kc=0;function pw(e){kc=e.timeStamp}function al(e,t,n){const r=e.nodeName==="BR",i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Ma(e,n)!==void 0}function mw(e,t,n){const r=en($t(n));let i=null,o=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,o=r.focusOffset);const s=e.nodeValue;s!==null&&Kc(t,s,i,o,!1)}function xw(e,t,n){if($(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Kn(t)&&n.isAttached()}function yw(e,t,n,r){for(let i=e;i&&!o_(i);i=Ko(i)){const o=Ma(i,t);if(o!==void 0){const s=ze(o,n);if(s)return ve(s)||!Ke(i)?void 0:[i,s]}else if(i===r)return[r,E1(n)]}}function Hm(e,t,n){Zl=!0;const r=performance.now()-kc>gw;try{Lt(e,()=>{const i=j()||function(f){return f.getEditorState().read(()=>{const h=j();return h!==null?h.clone():null})}(e),o=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let u=!1,c="";for(let f=0;f<t.length;f++){const h=t[f],g=h.type,x=h.target,b=yw(x,e,a,s);if(!b)continue;const[y,m]=b;if(g==="characterData")r&&J(m)&&Kn(x)&&xw(i,x,m)&&mw(x,m,e);else if(g==="childList"){u=!0;const p=h.addedNodes;for(let C=0;C<p.length;C++){const w=p[C],S=k1(w),T=w.parentNode;if(T!=null&&w!==l&&S===null&&!al(w,T,e)){if(ir){const P=(Ke(w)?w.innerText:null)||w.nodeValue;P&&(c+=P)}T.removeChild(w)}}const v=h.removedNodes,k=v.length;if(k>0){let C=0;for(let w=0;w<k;w++){const S=v[w];(al(S,x,e)||l===S)&&(x.appendChild(S),C++)}k!==C&&o.set(y,m)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,e);const d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,x=h.target;for(let b=0;b<g.length;b++){const y=g[b],m=y.parentNode;m==null||y.nodeName!=="BR"||al(y,x,e)||m.removeChild(y)}}n.takeRecords()}i!==null&&(u&&Xe(i),ir&&M1(e)&&i.insertRawText(c))})}finally{Zl=!1}}function Vm(e){const t=e._observer;t!==null&&Hm(e,t.takeRecords(),t)}function zm(e){(function(t){kc===0&&$t(t).addEventListener("textInput",pw,!0)})(e),e._observer=new MutationObserver((t,n)=>{Hm(e,t,n)})}let bw=class Wm{constructor(t,n=new Map,r=void 0,i=new Map,o=void 0){this.node=t,this.sharedConfigMap=n,this.unknownState=r,this.knownState=i;const s=o!==void 0?o:function(a,l,u){let c=u.size;if(l)for(const d in l){const f=a.get(d);f&&u.has(f)||c++}return c}(n,r,i);this.size=s}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const i=this.unknownState[t.key];i!==void 0&&(r=t.parse(i)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState};for(const[n,r]of this.knownState)n.isEqual(r,n.defaultValue)?delete t[n.key]:t[n.key]=n.unparse(r);return ss(t)?{[hw]:t}:{}}getWritable(t){if(this.node===t)return this;const n=new Map(this.knownState),r=ss(i=this.unknownState)&&{...i};var i;if(r)for(const o of n.keys())delete r[o.key];return new Wm(t,this.sharedConfigMap,ss(r),n,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedConfigMap.set(r,t);const{knownState:i,unknownState:o}=this;i.has(t)||o&&r in o||this.size++,i.set(t,n)}updateFromUnknown(t,n){const r=this.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState={},t)for(const[r,i]of Object.entries(t))this.updateFromUnknown(r,i);this.unknownState=ss(this.unknownState)}};function ss(e){if(e)for(const t in e)return e}function vw(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new bw(t);return t.__state=n,n}function df(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style,l=e.__state,u=t.__state;return(n===null||n===o)&&(r===null||r===s)&&(i===null||i===a)&&(e.__state===null||l===u||function(c,d){if(c===d)return!0;if(c&&d&&c.size!==d.size)return!1;const f=new Set,h=(x,b)=>{for(const[y,m]of x.knownState){if(f.has(y.key))continue;f.add(y.key);const p=b?b.getValue(y):y.defaultValue;if(p!==m&&!y.isEqual(p,m))return!0}return!1},g=(x,b)=>{const{unknownState:y}=x,m=b?b.unknownState:void 0;if(y){for(const[p,v]of Object.entries(y))if(!f.has(p)&&(f.add(p),v!==(m?m[p]:void 0)))return!0}return!1};return!(c&&h(c,d)||d&&h(d,c)||c&&g(c,d)||d&&g(d,c))}(l,u))}function ff(e,t){const n=e.mergeWithSibling(t),r=Je()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function hf(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(df(t,r)){r=ff(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(df(r,n)){r=ff(r,n);break}break}n.remove()}}else r.remove()}function Dr(e){return gf(e.anchor),gf(e.focus),e}function gf(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),J(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!D(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let sr,St,vo,ma,ql,Yl,Rr,Gt,Gl,Co,tt="",kt="",hn=null,gn="",Fn="",jm=!1,wo=!1,vs=null;function $s(e,t){const n=Rr.get(e);if(t!==null){const r=eu(e);r.parentNode===t&&t.removeChild(r)}if(Gt.has(e)||St._keyToDOMMap.delete(e),D(n)){const r=Hs(n,Rr);Xl(r,0,r.length-1,null)}n!==void 0&&Zc(Co,vo,ma,n,"destroyed")}function Xl(e,t,n,r){let i=t;for(;i<=n;++i){const o=e[i];o!==void 0&&$s(o,r)}}function wr(e,t){e.setProperty("text-align",t)}const Cw="40px";function Um(e,t){const n=sr.theme.indent;if(typeof n=="string"){const i=e.classList.contains(n);t>0&&!i?e.classList.add(n):t<1&&i&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Cw;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function Jm(e,t){const n=e.style;t===0?wr(n,""):t===yc?wr(n,"left"):t===bc?wr(n,"center"):t===vc?wr(n,"right"):t===Cc?wr(n,"justify"):t===wc?wr(n,"start"):t===_c&&wr(n,"end")}function Bs(e,t){const n=Gt.get(e);n===void 0&&W(60);const r=n.createDOM(sr,St);if(function(i,o,s){const a=s._keyToDOMMap;(function(l,u,c){const d=`__lexicalKey_${u._key}`;l[d]=c})(o,s,i),a.set(i,o)}(e,r,St),J(n)?r.setAttribute("data-lexical-text","true"):ve(n)&&r.setAttribute("data-lexical-decorator","true"),D(n)){const i=n.__indent,o=n.__size;if(i!==0&&Um(r,i),o!==0){const a=o-1;(function(l,u,c,d){const f=kt;kt="",Ql(l,c,0,u,c.getDOMSlot(d)),Zm(c,d),kt=f})(Hs(n,Gt),a,n,r)}const s=n.__format;s!==0&&Jm(r,s),n.isInline()||Km(null,n,r),Aa(n)&&(tt+=Vn,Fn+=Vn)}else{const i=n.getTextContent();if(ve(n)){const o=n.decorate(St,sr);o!==null&&qm(e,o),r.contentEditable="false"}else J(n)&&(n.isDirectionless()||(kt+=i));tt+=i,Fn+=i}return t!==null&&t.insertChild(r),Zc(Co,vo,ma,n,"created"),r}function Ql(e,t,n,r,i){const o=tt;tt="";let s=n;for(;s<=r;++s){Bs(e[s],i);const a=Gt.get(e[s]);a!==null&&J(a)&&(hn===null&&(hn=a.getFormat()),gn===""&&(gn=a.getStyle()))}Aa(t)&&(tt+=Vn),i.element.__lexicalTextContent=tt,tt=o+tt}function pf(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Xt(r)?"line-break":ve(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Km(e,t,n){const r=pf(e,Rr),i=pf(t,Gt);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Zm(e,t){const n=t.__lexicalDirTextContent||"",r=t.__lexicalDir||"";if(n!==kt||r!==vs){const i=kt==="",o=i?vs:function(s){return aw.test(s)?"rtl":lw.test(s)?"ltr":null}(kt);if(o!==r){const s=t.classList,a=sr.theme;let l=r!==null?a[r]:void 0,u=o!==null?a[o]:void 0;if(l!==void 0){if(typeof l=="string"){const c=Ls(l);l=a[r]=c}s.remove(...l)}if(o===null||i&&o==="ltr")t.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const c=Ls(u);u=a[o]=c}u!==void 0&&s.add(...u)}t.dir=o}wo||(e.getWritable().__dir=o)}vs=o,t.__lexicalDirTextContent=kt,t.__lexicalDir=o}}function ww(e,t,n){const r=kt;var i;kt="",hn=null,gn="",function(o,s,a){const l=tt,u=o.__size,c=s.__size;tt="";const d=a.element;if(u===1&&c===1){const f=o.__first,h=s.__first;if(f===h)Yi(f,d);else{const x=eu(f),b=Bs(h,null);try{d.replaceChild(b,x)}catch(y){if(typeof y=="object"&&y!=null){const m=`${y.toString()} Parent: ${d.tagName}, new child: {tag: ${b.tagName} key: ${h}}, old child: {tag: ${x.tagName}, key: ${f}}.`;throw new Error(m)}throw y}$s(f,null)}const g=Gt.get(h);J(g)&&(hn===null&&(hn=g.getFormat()),gn===""&&(gn=g.getStyle()))}else{const f=Hs(o,Rr),h=Hs(s,Gt);if(f.length!==u&&W(227),h.length!==c&&W(228),u===0)c!==0&&Ql(h,s,0,c-1,a);else if(c===0){if(u!==0){const g=a.after==null&&a.before==null&&a.element.__lexicalLineBreak==null;Xl(f,0,u-1,g?null:d),g&&(d.textContent="")}}else(function(g,x,b,y,m,p){const v=y-1,k=m-1;let C,w,S=p.getFirstChild(),T=0,P=0;for(;T<=v&&P<=k;){const O=x[T],B=b[P];if(O===B)S=ll(Yi(B,p.element)),T++,P++;else{C===void 0&&(C=new Set(x)),w===void 0&&(w=new Set(b));const q=w.has(O),Z=C.has(B);if(q)if(Z){const Q=Ci(St,B);Q===S?S=ll(Yi(B,p.element)):(p.withBefore(S).insertChild(Q),Yi(B,p.element)),T++,P++}else Bs(B,p.withBefore(S)),P++;else S=ll(eu(O)),$s(O,p.element),T++}const H=Gt.get(B);H!==null&&J(H)&&(hn===null&&(hn=H.getFormat()),gn===""&&(gn=H.getStyle()))}const F=T>v,L=P>k;if(F&&!L){const O=b[k+1],B=O===void 0?null:St.getElementByKey(O);Ql(b,g,P,k,p.withBefore(B))}else L&&!F&&Xl(x,T,v,p.element)})(s,f,h,u,c,a)}Aa(s)&&(tt+=Vn),d.__lexicalTextContent=tt,tt=l+tt}(e,t,t.getDOMSlot(n)),Zm(t,n),i=t,hn==null||hn===i.__textFormat||wo||i.setTextFormat(hn),function(o){gn===""||gn===o.__textStyle||wo||o.setTextStyle(gn)}(t),kt=r}function Hs(e,t){const n=[];let r=e.__first;for(;r!==null;){const i=t.get(r);i===void 0&&W(101),n.push(r),r=i.__next}return n}function Yi(e,t){const n=Rr.get(e);let r=Gt.get(e);n!==void 0&&r!==void 0||W(61);const i=jm||Yl.has(e)||ql.has(e),o=Ci(St,e);if(n===r&&!i){if(D(n)){const s=o.__lexicalTextContent;s!==void 0&&(tt+=s,Fn+=s);const a=o.__lexicalDirTextContent;a!==void 0&&(kt+=a)}else{const s=n.getTextContent();J(n)&&!n.isDirectionless()&&(kt+=s),Fn+=s,tt+=s}return o}if(n!==r&&i&&Zc(Co,vo,ma,r,"updated"),r.updateDOM(n,o,sr)){const s=Bs(e,null);return t===null&&W(62),t.replaceChild(s,o),$s(e,null),s}if(D(n)&&D(r)){const s=r.__indent;s!==n.__indent&&Um(o,s);const a=r.__format;a!==n.__format&&Jm(o,a),i&&(ww(n,r,o),ut(r)||r.isInline()||Km(n,r,o)),Aa(r)&&(tt+=Vn,Fn+=Vn)}else{const s=r.getTextContent();if(ve(r)){const a=r.decorate(St,sr);a!==null&&qm(e,a)}else J(r)&&!r.isDirectionless()&&(kt+=s);tt+=s,Fn+=s}if(!wo&&ut(r)&&r.__cachedText!==Fn){const s=r.getWritable();s.__cachedText=Fn,r=s}return o}function qm(e,t){let n=St._pendingDecorators;const r=St._decorators;if(n===null){if(r[e]===t)return;n=S1(St)}n[e]=t}function ll(e){let t=e.nextSibling;return t!==null&&t===St._blockCursorElement&&(t=t.nextSibling),t}function _w(e,t,n,r,i,o){tt="",Fn="",kt="",jm=r===bi,vs=null,St=n,sr=n._config,vo=n._nodes,ma=St._listeners.mutation,ql=i,Yl=o,Rr=e._nodeMap,Gt=t._nodeMap,wo=t._readOnly,Gl=new Map(n._keyToDOMMap);const s=new Map;return Co=s,Yi("root",null),St=void 0,vo=void 0,ql=void 0,Yl=void 0,Rr=void 0,Gt=void 0,sr=void 0,Gl=void 0,Co=void 0,s}function eu(e){const t=Gl.get(e);return t===void 0&&W(75,e),t}function Jn(e){return{}}const xa={},kw={},ya={},Nr={},ci={},_o={},di={},$o={},tu={},ko={},So={},$n={},ba={},va={},Ym={},Gm={},Sw={},Sc={},Ew={},Ec={},Tc={},Eo={},Ic={},Ca={},Bo={},wa={},Nc={},Xm={},Vs={},nu={},Mc={},Tw={},_a={},Ac={},Iw={},ka={},Oc={},ru={},Nw={},Mw={},Gi={},Xi={},Qm={},e1={},t1={},Mn=Object.freeze({}),iu=30,ou=[["keydown",function(e,t){if(oo=e.timeStamp,su=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=e;if(!te(t,Ym,e)&&n!=null){if(ul&&Qr(su))return Lt(t,()=>{as(t,cl)}),ul=!1,void(cl="");if(function(a,l,u,c){return zf(a)&&!l&&!c&&!u}(n,i,s,o))te(t,Gm,e);else if(function(a,l,u,c,d){return zf(a)&&!c&&!u&&(l||d)}(n,i,r,s,o))te(t,Sw,e);else if(function(a,l,u,c){return Vf(a)&&!l&&!c&&!u}(n,i,s,o))te(t,Sc,e);else if(function(a,l,u,c,d){return Vf(a)&&!c&&!u&&(l||d)}(n,i,r,s,o))te(t,Ew,e);else if(function(a,l,u){return function(c){return c==="ArrowUp"}(a)&&!l&&!u}(n,i,o))te(t,Ec,e);else if(function(a,l,u){return function(c){return c==="ArrowDown"}(a)&&!l&&!u}(n,i,o))te(t,Tc,e);else if(function(a,l){return Wf(a)&&l}(n,r))so=!0,te(t,Eo,e);else if(function(a){return a===" "}(n))te(t,Ic,e);else if(function(a,l){return Ut&&l&&a.toLowerCase()==="o"}(n,i))e.preventDefault(),so=!0,te(t,ci,!0);else if(function(a,l){return Wf(a)&&!l}(n,r))so=!1,te(t,Eo,e);else if(function(a,l,u,c){return Ut?!l&&!u&&(Qr(a)||a.toLowerCase()==="h"&&c):c||l||u?!1:Qr(a)}(n,s,o,i))Qr(n)?te(t,Ca,e):(e.preventDefault(),te(t,Nr,!0));else if(function(a){return a==="Escape"}(n))te(t,Bo,e);else if(function(a,l,u,c,d){return Ut?!(u||c||d)&&(ji(a)||a.toLowerCase()==="d"&&l):l||c||d?!1:ji(a)}(n,i,r,s,o))ji(n)?te(t,wa,e):(e.preventDefault(),te(t,Nr,!1));else if(function(a,l,u){return Qr(a)&&(Ut?l:u)}(n,s,i))e.preventDefault(),te(t,ko,!0);else if(function(a,l,u){return ji(a)&&(Ut?l:u)}(n,s,i))e.preventDefault(),te(t,ko,!1);else if(function(a,l){return Ut&&l&&Qr(a)}(n,o))e.preventDefault(),te(t,So,!0);else if(function(a,l){return Ut&&l&&ji(a)}(n,o))e.preventDefault(),te(t,So,!1);else if(function(a,l,u,c){return a.toLowerCase()==="b"&&!l&&Qi(u,c)}(n,s,o,i))e.preventDefault(),te(t,$n,"bold");else if(function(a,l,u,c){return a.toLowerCase()==="u"&&!l&&Qi(u,c)}(n,s,o,i))e.preventDefault(),te(t,$n,"underline");else if(function(a,l,u,c){return a.toLowerCase()==="i"&&!l&&Qi(u,c)}(n,s,o,i))e.preventDefault(),te(t,$n,"italic");else if(function(a,l,u,c){return a==="Tab"&&!l&&!u&&!c}(n,s,i,o))te(t,Nc,e);else if(function(a,l,u,c){return a.toLowerCase()==="z"&&!l&&Qi(u,c)}(n,r,o,i))e.preventDefault(),te(t,ba,void 0);else if(function(a,l,u,c){return Ut?a.toLowerCase()==="z"&&u&&l:a.toLowerCase()==="y"&&c||a.toLowerCase()==="z"&&c&&l}(n,r,o,i))e.preventDefault(),te(t,va,void 0);else{const a=t._editorState._selection;a===null||$(a)?!ir&&jf(n,o,i)&&(e.preventDefault(),te(t,ru,e)):function(l,u,c,d){return u?!1:l.toLowerCase()==="c"?Ut?c:d:!1}(n,r,o,i)?(e.preventDefault(),te(t,ka,e)):function(l,u,c,d){return u?!1:l.toLowerCase()==="x"?Ut?c:d:!1}(n,r,o,i)?(e.preventDefault(),te(t,Oc,e)):jf(n,o,i)&&(e.preventDefault(),te(t,ru,e))}(function(a,l,u,c){return a||l||u||c})(i,r,s,o)&&te(t,t1,e)}}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;Pi(n)&&r!=="touch"&&e.button===0&&Lt(t,()=>{ve(kn(n))||(lu=!0)})}],["compositionstart",function(e,t){Lt(t,()=>{const n=j();if($(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();lt(r.key),(e.timeStamp<oo+iu||r.type==="element"||!n.isCollapsed()||i.getFormat()!==n.format||J(i)&&i.getStyle()!==n.style)&&te(t,di,sw)}})}],["compositionend",function(e,t){ir?Wi=!0:yi||!bo&&!Fs?Lt(t,()=>{as(t,e.data)}):(ul=!0,cl=e.data)}],["input",function(e,t){e.stopPropagation(),Lt(t,()=>{const n=j(),r=e.data,i=s1(e);if(r!=null&&$(n)&&i1(n,i,r,e.timeStamp,!1)){Wi&&(as(t,r),Wi=!1);const o=n.anchor.getNode(),s=en($t(t));if(s===null)return;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,u=a?n.focus.offset:n.anchor.offset;Ps&&!n.isCollapsed()&&J(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+u)===N1(s.anchorNode)||te(t,di,r);const c=r.length;ir&&c>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=c),bo||yi||Fs||!t.isComposing()||(oo=0,lt(null))}else Jc(!1,t,r!==null?r:void 0),Wi&&(as(t,r||void 0),Wi=!1);(function(){gt();const o=Je();Vm(o)})()},{event:e}),ri=null}],["click",function(e,t){Lt(t,()=>{const n=j(),r=en($t(t)),i=Mi();if(r){if($(n)){const o=n.anchor,s=o.getNode();if(o.type==="element"&&o.offset===0&&n.isCollapsed()&&!ut(s)&&Le().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=function(l,u){let c=l;for(;c!==Le()&&c!=null;){if(u(c))return c;c=c.getParent()}return null}(s,l=>D(l)&&!l.isInline());D(a)&&a.select(0)}}else if(e.pointerType==="touch"){const o=r.anchorNode;(Ke(o)||Kn(o))&&Xe(Dc(i,r,t,e))}}te(t,ya,e)})}],["cut",Mn],["copy",Mn],["dragstart",Mn],["dragover",Mn],["dragend",Mn],["paste",Mn],["focus",Mn],["blur",Mn],["drop",Mn]];Ps&&ou.push(["beforeinput",(e,t)=>function(n,r){const i=n.inputType,o=s1(n);i==="deleteCompositionText"||ir&&M1(r)||i!=="insertCompositionText"&&Lt(r,()=>{const s=j();if(i==="deleteContentBackward"){if(s===null){const h=Mi();if(!$(h))return;Xe(h.clone())}if($(s)){const h=s.anchor.key===s.focus.key;if(a=n.timeStamp,su==="MediaLast"&&a<oo+iu&&r.isComposing()&&h){if(lt(null),oo=0,setTimeout(()=>{Lt(r,()=>{lt(null)})},iu),$(s)){const g=s.anchor.getNode();g.markDirty(),J(g)||W(142),o1(s,g)}}else{lt(null),n.preventDefault();const g=s.anchor.getNode(),x=g.getTextContent(),b=g.canInsertTextAfter(),y=s.anchor.offset===0&&s.focus.offset===x.length;let m=uf&&h&&!y&&b;if(m&&s.isCollapsed()&&(m=!ve(fu(s.anchor,!0))),!m){te(r,Nr,!0);const p=j();uf&&$(p)&&p.isCollapsed()&&(Er=p,setTimeout(()=>Er=null))}}return}}var a;if(!$(s))return;const l=n.data;ri!==null&&Jc(!1,r,ri),s.dirty&&ri===null||!s.isCollapsed()||ut(s.anchor.getNode())||o===null||s.applyDOMRange(o),ri=null;const u=s.anchor,c=s.focus,d=u.getNode(),f=c.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(n.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":te(r,di,n);break;case"insertFromComposition":lt(null),te(r,di,n);break;case"insertLineBreak":lt(null),te(r,ci,!1);break;case"insertParagraph":lt(null),so&&!yi?(so=!1,te(r,ci,!1)):te(r,_o,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":te(r,$o,n);break;case"deleteByComposition":(function(h,g){return h!==g||D(h)||D(g)||!h.isToken()||!g.isToken()})(d,f)&&te(r,tu,n);break;case"deleteByDrag":case"deleteByCut":te(r,tu,n);break;case"deleteContent":te(r,Nr,!1);break;case"deleteWordBackward":te(r,ko,!0);break;case"deleteWordForward":te(r,ko,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":te(r,So,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":te(r,So,!1);break;case"formatStrikeThrough":te(r,$n,"strikethrough");break;case"formatBold":te(r,$n,"bold");break;case"formatItalic":te(r,$n,"italic");break;case"formatUnderline":te(r,$n,"underline");break;case"historyUndo":te(r,ba,void 0);break;case"historyRedo":te(r,va,void 0)}else{if(l===`
|
|
20
20
|
`)n.preventDefault(),te(r,ci,!1);else if(l===Vn)n.preventDefault(),te(r,_o,void 0);else if(l==null&&n.dataTransfer){const h=n.dataTransfer.getData("text/plain");n.preventDefault(),s.insertRawText(h)}else l!=null&&i1(s,o,l,n.timeStamp,!0)?(n.preventDefault(),te(r,di,l)):ri=l;n1=n.timeStamp}})}(e,t)]);let oo=0,su=null,n1=0,ri=null;const zs=new WeakMap;let au=!1,lu=!1,so=!1,Wi=!1,ul=!1,cl="",Er=null,r1=[0,"",0,"root",0];function i1(e,t,n,r,i){const o=e.anchor,s=e.focus,a=o.getNode(),l=Je(),u=en($t(l)),c=u!==null?u.anchorNode:null,d=o.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!J(a)||(!i&&(!Ps||n1<r+50)||a.isDirty()&&h<2||T1(n))&&o.offset!==s.offset&&!a.isComposing()||ii(a)||a.isDirty()&&h>1||(i||!Ps)&&f!==null&&!a.isComposing()&&c!==vi(f)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(g,x){if(x.isSegmented())return!0;if(!g.isCollapsed())return!1;const b=g.anchor.offset,y=x.getParentOrThrow(),m=x.isToken();return b===0?!x.canInsertTextBefore()||!y.canInsertTextBefore()&&!x.isComposing()||m||function(p){const v=p.getPreviousSibling();return(J(v)||D(v)&&v.isInline())&&!v.canInsertTextAfter()}(x):b===x.getTextContentSize()&&(!x.canInsertTextAfter()||!y.canInsertTextAfter()&&!x.isComposing()||m)}(e,a)}function mf(e,t){return Kn(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function xf(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=e;au&&(au=!1,mf(r,i)&&mf(o,s)&&!Er)||Lt(t,()=>{if(!n)return void Xe(null);if(!Jo(t,r,o))return;let a=j();if(Er&&$(a)&&a.isCollapsed()){const l=a.anchor,u=Er.anchor;(l.key===u.key&&l.offset===u.offset+1||l.offset===1&&u.getNode().is(l.getNode().getPreviousSibling()))&&(a=Er.clone(),Xe(a))}if(Er=null,$(a)){const l=a.anchor,u=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const c=$t(t).event,d=c?c.timeStamp:performance.now(),[f,h,g,x,b]=r1,y=Le(),m=t.isComposing()===!1&&y.getTextContent()==="";if(d<b+200&&l.offset===g&&l.key===x)Cs(a,f,h);else if(l.type==="text")J(u)||W(141),o1(a,u);else if(l.type==="element"&&!m){D(u)||W(259);const p=l.getNode();p.isEmpty()?function(v,k){const C=k.getTextFormat(),w=k.getTextStyle();Cs(v,C,w)}(a,p):Cs(a,0,"")}}else{const c=l.key,d=a.focus.key,f=a.getNodes(),h=f.length,g=a.isBackward(),x=g?s:i,b=g?i:s,y=g?d:c,m=g?c:d;let p=ow,v=!1;for(let k=0;k<h;k++){const C=f[k],w=C.getTextContentSize();if(J(C)&&w!==0&&!(k===0&&C.__key===y&&x===w||k===h-1&&C.__key===m&&b===0)&&(v=!0,p&=C.getFormat(),p===0))break}a.format=v?p:0}}te(t,xa,void 0)})}function Cs(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function o1(e,t){Cs(e,t.getFormat(),t.getStyle())}function s1(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function as(e,t){const n=e._compositionKey;if(lt(null),n!==null&&t!=null){if(t===""){const r=ze(n),i=vi(e.getElementByKey(n));return void(i!==null&&i.nodeValue!==null&&J(r)&&Kc(r,i.nodeValue,null,null,!0))}if(t[t.length-1]===`
|
|
@@ -76,19 +76,19 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
76
76
|
Licensed under the MIT License (MIT), see
|
|
77
77
|
http://jedwatson.github.io/classnames
|
|
78
78
|
*/var Gh;function k8(){return Gh||(Gh=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Ml)),Ml.exports}var S8=k8();const ke=Qg(S8),E8="_editorRoot_sects_53",T8="_editorWrapper_sects_155",I8="_toolbarRoot_sects_162",N8="_readOnlyToolbarRoot_sects_189",M8="_toolbarToggleItem_sects_208",A8="_toolbarGroupOfGroups_sects_219",O8="_toolbarToggleSingleGroup_sects_224",P8="_toolbarButton_sects_239",F8="_selectContainer_sects_288",L8="_selectItem_sects_301",D8="_selectTrigger_sects_308",R8="_selectDropdownArrow_sects_374",$8="_contentEditable_sects_380",B8="_iconButton_sects_457",H8="_primaryButton_sects_507",V8="_secondaryButton_sects_508",z8="_linkDialogEditForm_sects_541",W8="_linkDialogAnchor_sects_587",j8="_linkDialogPopoverContent_sects_601",U8="_dialogContent_sects_603",J8="_popoverArrow_sects_650",K8="_linkDialogPreviewAnchor_sects_654",Z8="_tooltipTrigger_sects_677",q8="_tooltipContent_sects_681",Y8="_actionButton_sects_695",G8="_dialogOverlay_sects_870",X8="_focusedImage_sects_916",Q8="_imageWrapper_sects_920",e6="_editImageToolbar_sects_933",t6="_editImageButton_sects_937",n6="_imageControlWrapperResizing_sects_1032",r6="_imageResizer_sects_1036",i6="_imageResizerN_sects_1045",o6="_imageResizerNe_sects_1051",s6="_imageResizerE_sects_1057",a6="_imageResizerSe_sects_1063",l6="_imageResizerS_sects_1063",u6="_imageResizerSw_sects_1075",c6="_imageResizerW_sects_1081",d6="_imageResizerNw_sects_1087",f6="_imagePlaceholder_sects_1093",h6="_placeholder_sects_1101",g6="_rootContentEditableWrapper_sects_1114",p6="_downshiftInputWrapper_sects_1124",m6="_downshiftInput_sects_1124",x6="_downshiftAutocompleteContainer_sects_1155",y6="_textInput_sects_1201",b6="_multiFieldForm_sects_1209",v6="_formField_sects_1215",C6="_popupContainer_sects_1235",Y={editorRoot:E8,editorWrapper:T8,toolbarRoot:I8,readOnlyToolbarRoot:N8,toolbarToggleItem:M8,toolbarGroupOfGroups:A8,toolbarToggleSingleGroup:O8,toolbarButton:P8,selectContainer:F8,selectItem:L8,selectTrigger:D8,selectDropdownArrow:R8,contentEditable:$8,iconButton:B8,primaryButton:H8,secondaryButton:V8,linkDialogEditForm:z8,linkDialogAnchor:W8,linkDialogPopoverContent:j8,dialogContent:U8,popoverArrow:J8,linkDialogPreviewAnchor:K8,tooltipTrigger:Z8,tooltipContent:q8,actionButton:Y8,dialogOverlay:G8,focusedImage:X8,imageWrapper:Q8,editImageToolbar:e6,editImageButton:t6,imageControlWrapperResizing:n6,imageResizer:r6,imageResizerN:i6,imageResizerNe:o6,imageResizerE:s6,imageResizerSe:a6,imageResizerS:l6,imageResizerSw:u6,imageResizerW:c6,imageResizerNw:d6,imagePlaceholder:f6,placeholder:h6,rootContentEditableWrapper:g6,downshiftInputWrapper:p6,downshiftInput:m6,downshiftAutocompleteContainer:x6,textInput:y6,multiFieldForm:b6,formField:v6,popupContainer:C6},w6={undo:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M4.5 12.75V11.25H19.5V12.75H4.5Z",fill:"currentColor"})),frontmatter:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M4.5 8.75V7.25H8.5V8.75H4.5Z",fill:"currentColor"}),_.createElement("path",{d:"M4.5 14.75V13.25H8.5V14.75H4.5Z",fill:"currentColor"}),_.createElement("path",{d:"M9.5 8.75V7.25H13.5V8.75H9.5Z",fill:"currentColor"}),_.createElement("path",{d:"M9.5 14.75V13.25H13.5V14.75H9.5Z",fill:"currentColor"}),_.createElement("path",{d:"M14.5 8.75V7.25H18.5V8.75H14.5Z",fill:"currentColor"}),_.createElement("path",{d:"M14.5 14.75V13.25H18.5V14.75H14.5Z",fill:"currentColor"})),frame_source:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:"currentColor"})),admonition:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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"}),_.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"}),_.createElement("path",{d:"M12.5 7H17.5V8.25H12.5V7Z",fill:"currentColor"}),_.createElement("path",{d:"M12.5 9.25H17.5V10.5H12.5V9.25Z",fill:"currentColor"})),difference:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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"}),_.createElement("rect",{x:"9",y:"10",width:"5.5",height:"1.5",fill:"currentColor"}),_.createElement("rect",{x:"9",y:"15",width:"5.5",height:"1.5",fill:"currentColor"}),_.createElement("rect",{x:"11",y:"8",width:"1.5",height:"5.5",fill:"currentColor"})),markdown:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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"}),_.createElement("path",{d:"M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z",fill:"currentColor"}),_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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"}),_.createElement("path",{d:"M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z",fill:"currentColor"})),add_column:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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"}),_.createElement("path",{d:"M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z",fill:"currentColor"})),insert_col_left:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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:_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.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 Hu(e,t){return Hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Hu(e,t)}var Xh={error:null},_6=function(e){var t,n;function r(){for(var o,s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return(o=e.call.apply(e,[this].concat(a))||this).state=Xh,o.resetErrorBoundary=function(){for(var u,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];o.props.onReset==null||(u=o.props).onReset.apply(u,d),o.reset()},o}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Hu(t,n),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Xh)},i.componentDidCatch=function(o,s){var a,l;(a=(l=this.props).onError)==null||a.call(l,o,s)},i.componentDidUpdate=function(o,s){var a,l,u,c,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((u=o.resetKeys)===void 0&&(u=[]),(c=f)===void 0&&(c=[]),u.length!==c.length||u.some(function(h,g){return!Object.is(h,c[g])}))&&((a=(l=this.props).onResetKeysChange)==null||a.call(l,o.resetKeys,f),this.reset())},i.render=function(){var o=this.state.error,s=this.props,a=s.fallbackRender,l=s.FallbackComponent,u=s.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(I.isValidElement(u))return u;if(typeof a=="function")return a(c);if(l)return I.createElement(l,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(I.Component);function k6({children:e,onError:t}){return M.jsx(_6,{fallback:M.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const S6=({children:e})=>{const t=Ot(gr),n=_.useMemo(()=>[t,qC(null,dd)],[t]);return _.createElement(Fm.Provider,{value:n},e)},E6=()=>{const e=Bt(),t=_t(r8),n=c=>{t({current:c})},[r,i,o,s,a,l,u]=rn(Nu,Mu,Q0,ex,nx,Au,tx);return _.createElement(_.Fragment,null,s.map((c,d)=>_.createElement(c,{key:d})),_.createElement(ux,{wrappers:a},_.createElement("div",{className:ke(Y.rootContentEditableWrapper,"mdxeditor-root-contenteditable")},_.createElement(w8,{contentEditable:_.createElement("div",{ref:n},_.createElement(p8,{className:ke(Y.contentEditable,r),ariaLabel:e("contentArea.editableMarkdown","editable markdown"),spellCheck:i})),placeholder:_.createElement("div",{className:ke(Y.contentEditable,Y.placeholder,r)},_.createElement("p",null,l)),ErrorBoundary:k6}))),o.map((c,d)=>_.createElement(c,{key:d})),u.map((c,d)=>_.createElement(c,{key:d})))},T6={listItemIndent:"one"},I6=e=>w6[e];function N6(e,t,n={}){let r=t;for(const[i,o]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(o));return r}const ux=({wrappers:e,children:t})=>{if(e.length===0)return _.createElement(_.Fragment,null,t);const n=e[0];return _.createElement(n,null,_.createElement(ux,{wrappers:e.slice(1)},t))},M6=({children:e,className:t,overlayContainer:n})=>{const r=_.useRef(null),i=_t(Go);return _.useEffect(()=>{const o=document.createElement("div");return o.classList.add("mdxeditor-popup-container",Y.editorRoot,Y.popupContainer,...(t??"").trim().split(" ").filter(Boolean)),(n??document.body).appendChild(o),r.current=o,i(r),()=>{o.remove()}},[t,r,n,i]),_.createElement("div",{className:ke("mdxeditor",Y.editorRoot,Y.editorWrapper,t)},e)},A6=({mdxRef:e})=>{const t=ga();return _.useImperativeHandle(e,()=>({getMarkdown:()=>{const n=t.getValue(ea);return n==="source"||n==="diff"?t.getValue(ta):t.getValue(zr)},setMarkdown:n=>{t.pub(hd,n)},insertMarkdown:n=>{t.pub(K0,n)},focus:(n,r)=>{var i;(i=t.getValue(gr))==null||i.focus(n,r)}}),[t]),null},O6=_.forwardRef((e,t)=>_.createElement(ZC,{plugins:[u8({contentEditableClassName:e.contentEditableClassName??"",spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??ui,onBlur:e.onBlur??ui,toMarkdownOptions:e.toMarkdownOptions??T6,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??"",readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??I6,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??ui,translation:e.translation??N6,trim:e.trim??!0,lexicalTheme:e.lexicalTheme}),...e.plugins??[]]},_.createElement(M6,{className:e.className,overlayContainer:e.overlayContainer},_.createElement(S6,null,_.createElement(E6,null))),_.createElement(A6,{mdxRef:t}))),cx=typeof window<"u"&&typeof window.document.createElement<"u",na=cx&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function P6(e,t){return na?e:t}const F6={testLexicalNode:Da,visitLexicalNode:({lexicalNode:e,actions:t})=>{const n=parseInt(e.getTag()[1],10);t.addAndStepInto("heading",{depth:n})}},L6={testNode:"heading",visitNode:function({mdastNode:e,actions:t}){t.addAndStepInto(vn(`h${e.depth}`))}},D6=[48,49,50,51,52,53,54],dx=[1,2,3,4,5,6],R6={49:1,50:2,51:3,52:4,53:5,54:6},za=ne(dx,e=>{e.pub(X0,t=>t.registerCommand(Ym,n=>{const{keyCode:r,ctrlKey:i,metaKey:o,altKey:s}=n;return D6.includes(r)&&P6(o,i)&&s?(n.preventDefault(),t.update(()=>{if(r===48)e.pub(Qs,()=>Ee());else{const a=e.getValue(za),l=R6[r];a.includes(l)||e.pub(Qs,()=>vn(`h${l}`))}}),!0):!1},De))}),$6=on({init(e){e.pubIn({[Di]:"headings",[Wn]:L6,[pr]:qo,[mr]:F6})},update(e,t){e.pub(za,t?.allowedHeadingLevels??dx)}});function Qh(e,t){return e.getEditorState().read(()=>{const n=ze(t);return n!==null&&n.isSelected()})}function fx(e){const[t]=yt(),[n,r]=I.useState(()=>Qh(t,e));return I.useEffect(()=>{let i=!0;const o=t.registerUpdateListener(()=>{i&&r(Qh(t,e))});return()=>{i=!1,o()}},[t,e]),[n,I.useCallback(i=>{t.update(()=>{let o=j();et(o)||(o=Lc(),Xe(o)),et(o)&&(i?o.add(e):o.delete(e))})},[t,e]),I.useCallback(()=>{t.update(()=>{const i=j();et(i)&&i.clear()})},[t])]}const hx=Jn();function B6({nodeKey:e}){const[t]=yt(),[n,r,i]=fx(e),o=I.useCallback(s=>{const a=j();return n&&et(a)&&(s.preventDefault(),a.getNodes().forEach(l=>{Wa(l)&&l.remove()})),!1},[n]);return I.useEffect(()=>Mt(t.registerCommand(ya,s=>{const a=t.getElementByKey(e);return s.target===a&&(s.shiftKey||i(),r(!n),!0)},De),t.registerCommand(wa,o,De),t.registerCommand(Ca,o,De)),[i,t,n,e,o,r]),I.useEffect(()=>{const s=t.getElementByKey(e),a=t._config.theme.hrSelected??"selected";s!==null&&(n?tn(s,a):Fa(s,a))},[t,n,e]),null}let Xo=class gx extends jo{static getType(){return"horizontalrule"}static clone(t){return new gx(t.__key)}static importJSON(t){return Ri().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:H6,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return tn(n,t.theme.hr),n}getTextContent(){return`
|
|
79
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return M.jsx(B6,{nodeKey:this.__key})}};function H6(){return{node:Ri()}}function Ri(){return Nt(new Xo)}function Wa(e){return e instanceof Xo}function V6(){const[e]=yt();return I.useEffect(()=>e.registerCommand(hx,t=>{const n=j();if(!$(n))return!1;if(n.focus.getNode()!==null){const r=Ri();z1(r)}return!0},xe),[e]),null}const z6={testLexicalNode:Wa,visitLexicalNode({actions:e}){e.addAndStepInto("thematicBreak")}},W6={testNode:"thematicBreak",visitNode({actions:e}){e.addAndStepInto(Ri())}},j6=cr(e=>{e.sub(e.pipe(j6,We(qe)),([,t])=>{t?.dispatchCommand(hx,void 0)})}),U6=on({init(e){e.pubIn({[Di]:"thematicBreak",[Wn]:W6,[pr]:Xo,[mr]:z6,[qr]:V6})}});function mn(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Vu(e){let t=1,n=e.getParent();for(;n!=null;){if(be(n)){const r=n.getParent();if(de(r)){t++,n=r.getParent();continue}mn(40)}return t}return t}function zu(e){let t=e.getParent();de(t)||mn(40);let n=t;for(;n!==null;)n=n.getParent(),de(n)&&(t=n);return t}function px(e){let t=[];const n=e.getChildren().filter(be);for(let r=0;r<n.length;r++){const i=n[r],o=i.getFirstChild();de(o)?t=t.concat(px(o)):t.push(i)}return t}function xn(e){return be(e)&&de(e.getFirstChild())}function eg(e){return xt().append(e)}function mx(e,t){return be(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Wu(e){const t=j();if(t!==null){let n=t.getNodes();if($(t)){const i=t.getStartEndPoints();i===null&&mn(143);const[o]=i,s=o.getNode(),a=s.getParent();if(je(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const u=Ee();s.append(u),n=u.select().getNodes()}}else if(mx(s,n)){const l=mt(e);if(je(a)){s.replace(l);const u=xt();D(s)&&(u.setFormat(s.getFormatType()),u.setIndent(s.getIndent())),l.append(u)}else if(be(s)){const u=s.getParentOrThrow();Wr(l,u.getChildren()),u.replace(l)}return}}const r=new Set;for(let i=0;i<n.length;i++){const o=n[i];if(!D(o)||!o.isEmpty()||be(o)||r.has(o.getKey())){if(w1(o)){let s=o.getParent();for(;s!=null;){const a=s.getKey();if(de(s)){if(!r.has(a)){const l=mt(e);Wr(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(je(l)&&!r.has(a)){r.add(a),tg(s,e);break}s=l}}}}else tg(o,e)}}}function Wr(e,t){e.splice(e.getChildrenSize(),0,t)}function tg(e,t){if(de(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=xt();let o;if(Wr(i,e.getChildren()),de(n)&&t===n.getListType())n.append(i),de(r)&&t===r.getListType()&&(Wr(n,r.getChildren()),r.remove()),o=n;else if(de(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const s=mt(t);s.append(i),e.replace(s),o=s}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),o}function md(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&xn(n)&&xn(r)&&(md(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function J6(){const e=j();if($(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(mx(r,n))t.add(zu(r));else for(let i=0;i<n.length;i++){const o=n[i];if(w1(o)){const s=V1(o,ln);s!=null&&t.add(zu(s))}}for(const i of t){let o=i;const s=px(i);for(const a of s){const l=Ee().setTextStyle(e.style).setTextFormat(e.format);Wr(l,a.getChildren()),o.insertAfter(l),o=l,a.__key===e.anchor.key&&Vr(e.anchor,Rt(Sn(l,"next"))),a.__key===e.focus.key&&Vr(e.focus,Rt(Sn(l,"next"))),a.remove()}i.remove()}}}function K6(e){const t=new Set;if(xn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(xn(r)&&xn(i)){const o=i.getFirstChild();if(de(o)){o.append(e);const s=r.getFirstChild();de(s)&&(Wr(o,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(xn(r)){const o=r.getFirstChild();if(de(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(e)}}else if(xn(i)){const o=i.getFirstChild();de(o)&&o.append(e)}else if(de(n)){const o=xt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),s=mt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());o.append(s),s.append(e),i?i.insertAfter(o):r?r.insertBefore(o):n.append(o)}}function Z6(e){if(xn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(de(n?n.getParent():void 0)&&be(n)&&de(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const o=t.getListType(),s=xt(),a=mt(o);s.append(a),e.getPreviousSiblings().forEach(c=>a.append(c));const l=xt(),u=mt(o);l.append(u),Wr(u,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function q6(){const e=j();if(!$(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!be(t)||t.getChildrenSize()!==0)return!1;const n=zu(t),r=t.getParent();de(r)||mn(40);const i=r.getParent();let o;if(je(i))o=Ee(),n.insertAfter(o);else{if(!be(i))return!1;o=xt(),i.insertAfter(o)}o.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=mt(r.getListType());if(be(o)){const l=xt();l.append(a),o.insertAfter(l)}else o.insertAfter(a);a.append(...s)}return function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!be(u)&&!de(u))break;l=u}l.remove()}(t),!0}function ra(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}class ln extends an{static getType(){return"listitem"}static clone(t){return new ln(t.__value,t.__checked,t.__key)}constructor(t,n,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}createDOM(t){const n=document.createElement("li"),r=this.getParent();de(r)&&r.getListType()==="check"&&rg(n,this,null),n.value=this.__value,ng(n,t.theme,this);const i=this.__style||this.__textStyle;return i&&(n.style.cssText=i),n}updateDOM(t,n,r){const i=this.getParent();de(i)&&i.getListType()==="check"&&rg(n,this,t),n.value=this.__value,ng(n,r.theme,this);const o=t.__style||t.__textStyle,s=this.__style||this.__textStyle;return o!==s&&(n.style.cssText=s,s===""&&n.removeAttribute("style")),!1}static transform(){return t=>{if(be(t)||mn(144),t.__checked==null)return;const n=t.getParent();de(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Y6,priority:0})}}static importJSON(t){return xt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config);n.style.textAlign=this.getFormatType();const r=this.getDirection();return r&&(n.dir=r),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(D(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(t,n){if(be(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!de(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const i=mt(r.getListType());let o=this.getNextSibling();for(;o;){const s=o;o=o.getNextSibling(),i.append(s)}r.insertAfter(t),t.insertAfter(i)}return n&&(D(t)||mn(139),this.getChildren().forEach(i=>{t.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(de(r)||mn(39),be(t))return super.insertAfter(t,n);const i=this.getNextSiblings();if(r.insertAfter(t,n),i.length!==0){const o=mt(r.getListType());i.forEach(s=>o.append(s)),t.insertAfter(o,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&xn(n)&&xn(r)&&(md(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=xt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=Ee();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),o=be(i);if(r.getChildrenSize()===1)if(o)r.remove(),i.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return de(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;be(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&mn(117),(t=Math.floor(t))>=0||mn(199);let n=this.getIndent();for(;n!==t;)n<t?(K6(this),n++):(Z6(this),n--);return this}canInsertAfter(t){return be(t)}canReplaceWith(t){return be(t)}canMergeWith(t){return be(t)||Vc(t)}extractWithChild(t,n){if(!$(n))return!1;const r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return mt("bullet")}canMergeWhenEmpty(){return!0}}function ng(e,t,n){const r=[],i=[],o=t.list,s=o?o.listitem:void 0;let a;if(o&&o.nested&&(a=o.nested.listitem),s!==void 0&&r.push(...ra(s)),o){const l=n.getParent(),u=de(l)&&l.getListType()==="check",c=n.getChecked();u&&!c||i.push(o.listitemUnchecked),u&&c||i.push(o.listitemChecked),u&&r.push(c?o.listitemChecked:o.listitemUnchecked)}if(a!==void 0){const l=ra(a);n.getChildren().some(u=>de(u))?r.push(...l):i.push(...l)}i.length>0&&Fa(e,...i),r.length>0&&tn(e,...r)}function rg(e,t,n,r){de(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function Y6(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return G6(n)}const t=e.getAttribute("aria-checked");return{node:xt(t==="true"||t!=="false"&&void 0)}}function G6(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:xt(e.hasAttribute("checked"))}}function xt(e){return Nt(new ln(void 0,e))}function be(e){return e instanceof ln}class Nn extends an{static getType(){return"list"}static clone(t){const n=t.__listType||sg[t.__tag];return new Nn(n,t.__start,t.__key)}constructor(t="number",n=1,r){super(r);const i=sg[t]||t;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=n}getTag(){return this.__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.__listType}getStart(){return this.__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,ig(i,t.theme,this),i}updateDOM(t,n,r){return t.__tag!==this.__tag||(ig(n,r.theme,this),!1)}static transform(){return t=>{de(t)||mn(163),function(n){const r=n.getNextSibling();de(r)&&n.getListType()===r.getListType()&&md(n,r)}(t),function(n){const r=n.getListType()!=="check";let i=n.getStart();for(const o of n.getChildren())be(o)&&(o.getValue()!==i&&o.setValue(i),r&&o.getLatest().__checked!=null&&o.setChecked(void 0),de(o.getFirstChild())||i++)}(t)}}static importDOM(){return{ol:()=>({conversion:og,priority:0}),ul:()=>({conversion:og,priority:0})}}static importJSON(t){return mt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Ke(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(be(r))super.append(r);else{const i=xt();if(de(r))i.append(r);else if(D(r))if(r.isInline())i.append(r);else{const o=Re(r.getTextContent());i.append(o)}else i.append(r);super.append(i)}}return this}extractWithChild(t){return be(t)}}function ig(e,t,n){const r=[],i=[],o=t.list;if(o!==void 0){const s=o[`${n.__tag}Depth`]||[],a=Vu(n)-1,l=a%s.length,u=s[l],c=o[n.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&r.push(c),h!==void 0&&n.__listType==="check"&&r.push(h),u!==void 0){r.push(...ra(u));for(let g=0;g<s.length;g++)g!==l&&i.push(n.__tag+g)}if(d!==void 0){const g=ra(d);a>1?r.push(...g):i.push(...g)}}i.length>0&&Fa(e,...i),r.length>0&&tn(e,...r)}function X6(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(be(r)){t.push(r);const i=r.getChildren();i.length>1&&i.forEach(o=>{de(o)&&t.push(eg(o))})}else t.push(eg(r))}return t}function og(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=mt("number",e.start):t==="ul"&&(n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list"))return!0;for(const i of r.childNodes)if(Ke(i)&&i.hasAttribute("aria-checked"))return!0;return!1}(e)?mt("check"):mt("bullet")),{after:X6,node:n}}const sg={ol:"number",ul:"bullet"};function mt(e="number",t=1){return Nt(new Nn(e,t))}function de(e){return e instanceof Nn}const xx=Jn(),yx=Jn(),bx=Jn(),vx=Jn();function Q6(e){return Mt(e.registerCommand(yx,()=>(Wu("number"),!0),De),e.registerCommand(xx,()=>(Wu("bullet"),!0),De),e.registerCommand(vx,()=>(J6(),!0),De),e.registerCommand(_o,()=>q6(),De),e.registerNodeTransform(ln,t=>{const n=t.getFirstChild();if(n){if(J(n)){const r=n.getStyle(),i=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==i&&t.setTextFormat(i)}}else{const r=j();$(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Tn,t=>{const n=t.getParent();if(be(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),i=t.getFormat();r===n.getTextStyle()&&i===n.getTextFormat()||n.setTextStyle(r).setTextFormat(i)}}))}function e4(e,t){e.update(()=>Wu(t))}const t4={testNode:"list",visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){const r=e.children.some(o=>typeof o.checked=="boolean")?"check":e.ordered?"number":"bullet",i=mt(r);if(be(t)){const o=xt();o.append(i),t.insertAfter(o)}else t.append(i);n.visitChildren(e,i)}},n4={testNode:"listItem",visitNode({mdastNode:e,actions:t,lexicalParent:n}){const r=n.getListType()==="check"?e.checked??!1:void 0;t.addAndStepInto(xt(r))}},r4={testLexicalNode:de,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("list",{ordered:e.getListType()==="number",spread:!1})}},i4={testLexicalNode:be,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{const r=e.getChildren(),i=r[0];if(r.length===1&&de(i)){const o=t.children.at(-1);o?n.visitChildren(e,o):n.visitChildren(i,t)}else{const o=e.getParent(),s=n.appendToParent(t,{type:"listItem",checked:o.getListType()==="check"?!!e.getChecked():void 0,spread:!1,children:[]});let a=null;for(const l of e.getChildren())J(l)||Xt(l)||l.isInline()&&(D(l)||ve(l))?(a||(a=n.appendToParent(s,{type:"paragraph",children:[]})),n.visit(l,a)):(a=null,n.visit(l,s))}}};function o4(e,t){return Mt(e.registerCommand(Nc,n=>{const r=j();if(!$(r))return!1;n.preventDefault();const i=function(o){const s=o.getNodes();if(I_(s,f=>Ws(f)&&f.canIndent()?f:null).length>0)return!0;const a=o.anchor,l=o.focus,u=l.isBefore(a)?l:a,c=u.getNode(),d=xu(c);if(d.canIndent()){const f=d.getKey();let h=zo();if(h.anchor.set(f,0,"element"),h.focus.set(f,0,"element"),h=Dr(h),h.anchor.is(u))return!0}return!1}(r)?n.shiftKey?nu:Vs:Xm;return e.dispatchCommand(i,void 0)},xe),e.registerCommand(Vs,()=>{if(t==null)return!1;const n=j();if(!$(n))return!1;const r=n.getNodes().map(i=>xu(i).getIndent());return Math.max(...r)+1>=t},zn))}function ag({maxIndent:e}){const[t]=yt();return I.useEffect(()=>o4(t,e),[t,e]),null}function lg(){const[e]=yt();return I.useEffect(()=>Mt(e.registerCommand(bx,()=>(e4(e,"check"),!0),De),e.registerCommand(Tc,t=>dg(t,e,!1),De),e.registerCommand(Ec,t=>dg(t,e,!0),De),e.registerCommand(Bo,t=>{if(ju()!=null){const n=e.getRootElement();return n?.focus(),!0}return!1},De),e.registerCommand(Ic,t=>{const n=ju();return!(n==null||!e.isEditable())&&(e.update(()=>{const r=kn(n);be(r)&&(t.preventDefault(),r.toggleChecked())}),!0)},De),e.registerCommand(Sc,t=>e.getEditorState().read(()=>{const n=j();if($(n)&&n.isCollapsed()){const{anchor:r}=n,i=r.type==="element";if(i||r.offset===0){const o=r.getNode(),s=fr(o,a=>D(a)&&!a.isInline());if(be(s)){const a=s.getParent();if(de(a)&&a.getListType()==="check"&&(i||s.getFirstDescendant()===o)){const l=e.getElementByKey(s.__key);if(l!=null&&document.activeElement!==l)return l.focus(),t.preventDefault(),!0}}}}return!1}),De),e.registerRootListener((t,n)=>{t!==null&&(t.addEventListener("click",ug),t.addEventListener("pointerdown",cg)),n!==null&&(n.removeEventListener("click",ug),n.removeEventListener("pointerdown",cg))}))),null}function Cx(e,t){const n=e.target;if(!Ke(n))return;const r=n.firstChild;if(Ke(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=n.parentNode;if(!i||i.__lexicalListType!=="check")return;const o=n.getBoundingClientRect(),s=e.pageX/N_(n);(n.dir==="rtl"?s<o.right&&s>o.right-20:s>o.left&&s<o.left+20)&&t()}function ug(e){Cx(e,()=>{if(Ke(e.target)){const t=e.target,n=jc(t);n!=null&&n.isEditable()&&n.update(()=>{const r=kn(t);be(r)&&(t.focus(),r.toggleChecked())})}})}function cg(e){Cx(e,()=>{e.preventDefault()})}function ju(){const e=document.activeElement;return Ke(e)&&e.tagName==="LI"&&e.parentNode!=null&&e.parentNode.__lexicalListType==="check"?e:null}function dg(e,t,n){const r=ju();return r!=null&&t.update(()=>{const i=kn(r);if(!be(i))return;const o=function(s,a){let l=a?s.getPreviousSibling():s.getNextSibling(),u=s;for(;l==null&&be(u);)u=u.getParentOrThrow().getParent(),u!=null&&(l=a?u.getPreviousSibling():u.getNextSibling());for(;be(l);){const c=a?l.getLastChild():l.getFirstChild();if(!de(c))return l;l=a?c.getLastChild():c.getFirstChild()}return null}(i,n);if(o!=null){o.selectStart();const s=t.getElementByKey(o.__key);s!=null&&(e.preventDefault(),setTimeout(()=>{s.focus()},0))}}),!1}function fg(){const[e]=yt();return I.useEffect(()=>{if(!e.hasNodes([Nn,ln]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),function(t){I.useEffect(()=>Q6(t),[t])}(e),null}const s4={name:"tasklistCheck",tokenize:l4};function a4(){return{text:{91:s4}}}function l4(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Ze(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return re(l)?t(l):ye(l)?e.check({tokenize:u4},t,n)(l):n(l)}}function u4(e,t,n){return Se(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function c4(){return{exit:{taskListCheckValueChecked:hg,taskListCheckValueUnchecked:hg,paragraph:f4}}}function d4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:h4}}}function hg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function f4(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function h4(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=x0.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+s}}const g4=new Map([["number",yx],["bullet",xx],["check",bx],["",vx]]),Uu=ne("",e=>{e.sub(e.pipe(Ei,We(qe)),([t,n])=>{if(!t||!n)return;const r=t.anchor.getNode();let i=r.getKey()==="root"?r:fr(r,a=>{const l=a.getParent();return l!==null&&je(l)});i===null&&(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null)if(de(i)){const a=V1(r,Nn),l=a?a.getListType():i.getListType();e.pub(Uu,l)}else e.pub(Uu,"")})}),wx=it(e=>{e.sub(e.pipe(wx,We(qe)),([t,n])=>{n?.dispatchCommand(g4.get(t),void 0)})}),p4=on({init(e){var t;(t=e.getValue(gr))==null||t.registerCommand(Vs,()=>!x4(7),zn),e.pubIn({[Di]:"lists",[Du]:c4(),[Lu]:a4(),[Wn]:[t4,n4],[pr]:[ln,Nn],[mr]:[r4,i4],[J0]:d4(),[qr]:[ag,fg,lg],[rx]:[ag,fg,lg]})}});function m4(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>D(n)?n:n.getParentOrThrow()))}function x4(e){const t=j();if(!$(t))return!1;const n=m4(t);let r=0;for(const i of n)if(de(i))r=Math.max(Vu(i)+1,r);else if(be(i)){const o=i.getParent();if(o?.getChildren().length===1){const s=o.getParent();if(be(s)&&s.getChildren().length===1)return!1}if(!de(o))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(Vu(o)+1,r)}return r<=e}function _x(e){const t=e+"CollectionProvider",[n,r]=Kr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=x=>{const{scope:b,children:y}=x,m=_.useRef(null),p=_.useRef(new Map).current;return M.jsx(i,{scope:b,itemMap:p,collectionRef:m,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=As(a),u=_.forwardRef((x,b)=>{const{scope:y,children:m}=x,p=o(a,y),v=ct(b,p.collectionRef);return M.jsx(l,{ref:v,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=As(c),h=_.forwardRef((x,b)=>{const{scope:y,children:m,...p}=x,v=_.useRef(null),k=ct(b,v),C=o(c,y);return _.useEffect(()=>(C.itemMap.set(v,{ref:v,...p}),()=>void C.itemMap.delete(v))),M.jsx(f,{[d]:"",ref:k,children:m})});h.displayName=c;function g(x){const b=o(e+"CollectionConsumer",x);return _.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,w)=>p.indexOf(C.ref.current)-p.indexOf(w.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},g,r]}var y4=I.createContext(void 0);function ja(e){const t=I.useContext(y4);return e||t||"ltr"}var Al="rovingFocusGroup.onEntryFocus",b4={bubbles:!1,cancelable:!0},Qo="RovingFocusGroup",[Ju,kx,v4]=_x(Qo),[C4,Ua]=Kr(Qo,[v4]),[w4,_4]=C4(Qo),Sx=I.forwardRef((e,t)=>M.jsx(Ju.Provider,{scope:e.__scopeRovingFocusGroup,children:M.jsx(Ju.Slot,{scope:e.__scopeRovingFocusGroup,children:M.jsx(k4,{...e,ref:t})})}));Sx.displayName=Qo;var k4=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=I.useRef(null),h=ct(t,f),g=ja(o),[x,b]=Pr({prop:s,defaultProp:a??null,onChange:l,caller:Qo}),[y,m]=I.useState(!1),p=xp(u),v=kx(n),k=I.useRef(!1),[C,w]=I.useState(0);return I.useEffect(()=>{const S=f.current;if(S)return S.addEventListener(Al,p),()=>S.removeEventListener(Al,p)},[p]),M.jsx(w4,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:x,onItemFocus:I.useCallback(S=>b(S),[b]),onItemShiftTab:I.useCallback(()=>m(!0),[]),onFocusableItemAdd:I.useCallback(()=>w(S=>S+1),[]),onFocusableItemRemove:I.useCallback(()=>w(S=>S-1),[]),children:M.jsx(Ue.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{k.current=!0}),onFocus:we(e.onFocus,S=>{const T=!k.current;if(S.target===S.currentTarget&&T&&!y){const P=new CustomEvent(Al,b4);if(S.currentTarget.dispatchEvent(P),!P.defaultPrevented){const F=v().filter(q=>q.focusable),L=F.find(q=>q.active),O=F.find(q=>q.id===x),H=[L,O,...F].filter(Boolean).map(q=>q.ref.current);Ix(H,c)}}k.current=!1}),onBlur:we(e.onBlur,()=>m(!1))})})}),Ex="RovingFocusGroupItem",Tx=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,l=Oo(),u=o||l,c=_4(Ex,n),d=c.currentTabStopId===u,f=kx(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:x}=c;return I.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),M.jsx(Ju.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:M.jsx(Ue.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:we(e.onMouseDown,b=>{r?c.onItemFocus(u):b.preventDefault()}),onFocus:we(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=T4(b,c.orientation,c.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let p=f().filter(v=>v.focusable).map(v=>v.ref.current);if(y==="last")p.reverse();else if(y==="prev"||y==="next"){y==="prev"&&p.reverse();const v=p.indexOf(b.currentTarget);p=c.loop?I4(p,v+1):p.slice(v+1)}setTimeout(()=>Ix(p))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:x!=null}):s})})});Tx.displayName=Ex;var S4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function T4(e,t,n){const r=E4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return S4[r]}function Ix(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function I4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Nx=Sx,xd=Tx,Mx="Toggle",Ax=I.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[s,a]=Pr({prop:n,onChange:i,defaultProp:r??!1,caller:Mx});return M.jsx(Ue.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:we(e.onClick,()=>{e.disabled||a(!s)})})});Ax.displayName=Mx;var xr="ToggleGroup",[Ox,Px]=Kr(xr,[Ua]),Fx=Ua(),yd=_.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return M.jsx(N4,{...i,ref:t})}if(n==="multiple"){const i=r;return M.jsx(M4,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${xr}\``)});yd.displayName=xr;var[Lx,Dx]=Ox(xr),N4=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s,a]=Pr({prop:n,defaultProp:r??"",onChange:i,caller:xr});return M.jsx(Lx,{scope:e.__scopeToggleGroup,type:"single",value:_.useMemo(()=>s?[s]:[],[s]),onItemActivate:a,onItemDeactivate:_.useCallback(()=>a(""),[a]),children:M.jsx(Rx,{...o,ref:t})})}),M4=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s,a]=Pr({prop:n,defaultProp:r??[],onChange:i,caller:xr}),l=_.useCallback(c=>a((d=[])=>[...d,c]),[a]),u=_.useCallback(c=>a((d=[])=>d.filter(f=>f!==c)),[a]);return M.jsx(Lx,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:l,onItemDeactivate:u,children:M.jsx(Rx,{...o,ref:t})})});yd.displayName=xr;var[A4,O4]=Ox(xr),Rx=_.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:s,loop:a=!0,...l}=e,u=Fx(n),c=ja(s),d={role:"group",dir:c,...l};return M.jsx(A4,{scope:n,rovingFocus:i,disabled:r,children:i?M.jsx(Nx,{asChild:!0,...u,orientation:o,dir:c,loop:a,children:M.jsx(Ue.div,{...d,ref:t})}):M.jsx(Ue.div,{...d,ref:t})})}),ia="ToggleGroupItem",$x=_.forwardRef((e,t)=>{const n=Dx(ia,e.__scopeToggleGroup),r=O4(ia,e.__scopeToggleGroup),i=Fx(e.__scopeToggleGroup),o=n.value.includes(e.value),s=r.disabled||e.disabled,a={...e,pressed:o,disabled:s},l=_.useRef(null);return r.rovingFocus?M.jsx(xd,{asChild:!0,...i,focusable:!s,active:o,ref:l,children:M.jsx(gg,{...a,ref:t})}):M.jsx(gg,{...a,ref:t})});$x.displayName=ia;var gg=_.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=Dx(ia,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=o.type==="single"?s:void 0;return M.jsx(Ax,{...a,...i,ref:t,onPressedChange:l=>{l?o.onItemActivate(r):o.onItemDeactivate(r)}})}),P4=yd,F4=$x,bd="Toolbar",[L4,UN]=Kr(bd,[Ua,Px]),vd=Ua(),Bx=Px(),[D4,Hx]=L4(bd),Vx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:i,loop:o=!0,...s}=e,a=vd(n),l=ja(i);return M.jsx(D4,{scope:n,orientation:r,dir:l,children:M.jsx(Nx,{asChild:!0,...a,orientation:r,dir:l,loop:o,children:M.jsx(Ue.div,{role:"toolbar","aria-orientation":r,dir:l,...s,ref:t})})})});Vx.displayName=bd;var zx="ToolbarSeparator",Wx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Hx(zx,n);return M.jsx(Wy,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:t})});Wx.displayName=zx;var R4="ToolbarButton",Cd=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=vd(n);return M.jsx(xd,{asChild:!0,...i,focusable:!e.disabled,children:M.jsx(Ue.button,{type:"button",...r,ref:t})})});Cd.displayName=R4;var $4="ToolbarLink",B4=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=vd(n);return M.jsx(xd,{asChild:!0,...i,focusable:!0,children:M.jsx(Ue.a,{...r,ref:t,onKeyDown:we(e.onKeyDown,o=>{o.key===" "&&o.currentTarget.click()})})})});B4.displayName=$4;var jx="ToolbarToggleGroup",Ux=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Hx(jx,n),o=Bx(n);return M.jsx(P4,{"data-orientation":i.orientation,dir:i.dir,...o,...r,ref:t,rovingFocus:!1})});Ux.displayName=jx;var H4="ToolbarToggleItem",Jx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Bx(n),o={__scopeToolbar:e.__scopeToolbar};return M.jsx(Cd,{asChild:!0,...o,children:M.jsx(F4,{...i,...r,ref:t})})});Jx.displayName=H4;var V4=Vx,z4=Wx,Kx=Cd,wd=Ux,W4=Jx;const j4=new Set(["http:","https:","mailto:","sms:","tel:"]);class Zn extends an{static getType(){return"link"}static clone(t){return new Zn(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=n;this.__url=t,this.__target=i,this.__rel=o,this.__title=s}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),tn(n,t.theme.link),n}updateDOM(t,n,r){if(O1(n)){const i=this.__url,o=this.__target,s=this.__rel,a=this.__title;i!==t.__url&&(n.href=i),o!==t.__target&&(o?n.target=o:n.removeAttribute("target")),s!==t.__rel&&(s?n.rel=s:n.removeAttribute("rel")),a!==t.__title&&(a?n.title=a:n.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:U4,priority:1})}}static importJSON(t){return jr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){try{const n=new URL(t);if(!j4.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=jr(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!$(n))return!1;const i=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function U4(e){let t=null;if(O1(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=jr(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function jr(e="",t){return Nt(new Zn(e,t))}function yn(e){return e instanceof Zn}class $i extends Zn{constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new $i(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Ku().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(D(r)){const i=Ku(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function Ku(e="",t){return Nt(new $i(e,t))}function Tr(e){return e instanceof $i}const Ti=Jn();function pg(e,t){if(e.type==="element"){const n=e.getNode();return D(n)||function(r,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of i)s.append("v",a);throw o.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Ol(e,t={}){const{target:n,title:r}=t,i=t.rel===void 0?"noreferrer":t.rel,o=j();if(!$(o))return;const s=o.extract();if(e===null)return void s.forEach(u=>{const c=fr(u,d=>!Tr(d)&&yn(d));if(c){const d=c.getChildren();for(let f=0;f<d.length;f++)c.insertBefore(d[f]);c.remove()}});const a=new Set,l=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(e),n!==void 0&&u.setTarget(n),i!==void 0&&u.setRel(i),r!==void 0&&u.setTitle(r))};if(s.length===1){const u=mg(s[0],yn);if(u!==null)return l(u)}(function(u){const c=j();if(!$(c))return u();const d=Dr(c),f=d.isBackward(),h=pg(d.anchor,f?-1:0),g=pg(d.focus,f?0:-1);if(u(),h||g){const x=j();if($(x)){const b=x.clone();if(h){const y=h.getParent();y&&b.anchor.set(y.getKey(),h.getIndexWithinParent()+(f?1:0),"element")}if(g){const y=g.getParent();y&&b.focus.set(y.getKey(),g.getIndexWithinParent()+(f?0:1),"element")}Xe(Dr(b))}}})(()=>{let u=null;for(const c of s){if(!c.isAttached())continue;const d=mg(c,yn);if(d){l(d);continue}if(D(c)){if(!c.isInline())continue;if(yn(c)){if(!(Tr(c)||u!==null&&u.getParentOrThrow().isParentOf(c))){l(c),u=c;continue}for(const h of c.getChildren())c.insertBefore(h);c.remove();continue}}const f=c.getPreviousSibling();yn(f)&&f.is(u)?f.append(c):(u=jr(e,{rel:i,target:n,title:r}),c.insertAfter(u),u.append(c))}})}function mg(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const J4={testNode:"link",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(jr(e.url,{title:e.title}))}},K4={testLexicalNode:yn,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("link",{url:e.getURL(),title:e.getTitle()})}};function Z4({validateUrl:e,attributes:t}){const[n]=yt();return I.useEffect(()=>{if(!n.hasNodes([Zn]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Mt(n.registerCommand(Ti,r=>{if(r===null)return Ol(r),!0;if(typeof r=="string")return!(e!==void 0&&!e(r))&&(Ol(r,t),!0);{const{url:i,target:o,rel:s,title:a}=r;return Ol(i,{...t,rel:s,target:o,title:a}),!0}},De),e!==void 0?n.registerCommand($o,r=>{const i=j();if(!$(i)||i.isCollapsed()||!nr(r,ClipboardEvent))return!1;const o=r;if(o.clipboardData===null)return!1;const s=o.clipboardData.getData("text");return!!e(s)&&!i.getNodes().some(a=>D(a))&&(n.dispatchCommand(Ti,{...t,url:s}),r.preventDefault(),!0)},De):()=>{})},[n,e,t]),null}function xg(e,t=n=>n){return n=>{const r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function Zx(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}const q4=/[.,;\s]/;function oa(e){return q4.test(e)}function qx(e){return oa(e[e.length-1])}function Zu(e){return oa(e[0])}function Yx(e){let t=e.getPreviousSibling();return D(t)&&(t=t.getLastDescendant()),t===null||Xt(t)||J(t)&&qx(t.getTextContent())}function Gx(e){let t=e.getNextSibling();return D(t)&&(t=t.getFirstDescendant()),t===null||Xt(t)||J(t)&&Zu(t.getTextContent())}function Y4(e,t,n,r){return(e>0?oa(n[e-1]):Yx(r[0]))?t<n.length?oa(n[t]):Gx(r[r.length-1]):!1}function G4(e,t,n){const r=[],i=[],o=[];let s=0,a=0;const l=[...e];for(;l.length>0;){const u=l[0],c=u.getTextContent().length,d=a;a+c<=t?(r.push(u),s+=c):d>=n?o.push(u):i.push(u),a+=c,l.shift()}return[s,r,i,o]}function X4(e,t,n,r){const i=Ku(r.url,r.attributes);if(e.length===1){let o,s=e[0];t===0?[o,s]=s.splitText(n):[,o,s]=s.splitText(t,n);const a=Re(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),i.append(a),o.replace(i),s}if(e.length>1){const o=e[0];let s,a=o.getTextContent().length;t===0?s=o:[,s]=o.splitText(t);const l=[];let u;for(let h=1;h<e.length;h++){const g=e[h],x=g.getTextContent().length,b=a;if(b<n)if(a+x<=n)l.push(g);else{const[y,m]=g.splitText(n-b);l.push(y),u=m}a+=x}const c=j(),d=c?c.getNodes().find(J):void 0,f=Re(s.getTextContent());return f.setFormat(s.getFormat()),f.setDetail(s.getDetail()),f.setStyle(s.getStyle()),i.append(f,...l),d&&d===s&&($(c)?f.select(c.anchor.offset,c.focus.offset):et(c)&&f.select(0,f.getTextContent().length)),s.replace(i),u}}function Pl(e,t,n){const r=e.getChildren(),i=r.length;for(let l=0;l<i;l++){const u=r[l];if(!J(u)||!u.isSimpleText())return Ns(e),void n(null,e.getURL())}const o=e.getTextContent(),s=Zx(o,t);if(s===null||s.text!==o||!Yx(e)||!Gx(e))return Ns(e),void n(null,e.getURL());const a=e.getURL();if(a!==s.url&&(e.setURL(s.url),n(s.url,a)),s.attributes){const l=e.getRel();l!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,l));const u=e.getTarget();u!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,u))}}function Ns(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(n=>n.getLatest())}function Q4(e,t,n){I.useEffect(()=>{e.hasNodes([$i])||function(i,...o){const s=new URL("https://lexical.dev/docs/error"),a=new URLSearchParams;a.append("code",i);for(const l of o)a.append("v",l);throw s.search=a.toString(),Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const r=(i,o)=>{n&&n(i,o)};return Mt(e.registerNodeTransform(Tn,i=>{const o=i.getParentOrThrow(),s=i.getPreviousSibling();if(Tr(o)&&!o.getIsUnlinked())Pl(o,t,r);else if(!yn(o)){if(i.isSimpleText()&&(Zu(i.getTextContent())||!Tr(s))){const a=function(l){const u=[l];let c=l.getNextSibling();for(;c!==null&&J(c)&&c.isSimpleText()&&(u.push(c),!/[\s]/.test(c.getTextContent()));)c=c.getNextSibling();return u}(i);(function(l,u,c){let d=[...l];const f=d.map(b=>b.getTextContent()).join("");let h,g=f,x=0;for(;(h=Zx(g,u))&&h!==null;){const b=h.index,y=b+h.length;if(Y4(x+b,x+y,f,d)){const[m,,p,v]=G4(d,x+b,x+y),k=X4(p,x+b-m,x+y-m,h);d=k?[k,...v]:v,c(h.url,null),x=0}else x+=y;g=g.substring(y)}})(a,t,r)}(function(a,l,u){const c=a.getPreviousSibling(),d=a.getNextSibling(),f=a.getTextContent();var h;!Tr(c)||c.getIsUnlinked()||Zu(f)&&(h=f,!(c.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(h):/^\.[a-zA-Z0-9]{1,}/.test(h)))||(c.append(a),Pl(c,l,u),u(null,c.getURL())),!Tr(d)||d.getIsUnlinked()||qx(f)||(Ns(d),Pl(d,l,u),u(null,d.getURL()))})(i,t,r)}}),e.registerCommand(Ti,i=>{const o=j();return i!==null||!$(o)||o.extract().forEach(s=>{const a=s.getParent();if(Tr(a))return a.setIsUnlinked(!a.getIsUnlinked()),a.markDirty(),!0}),!1},De))},[e,t,n])}function eE({matchers:e,onChange:t}){const[n]=yt();return Q4(n,e,t),null}const tE=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,nE=/(([^<>()[\]\\.,;:\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,}))/,rE=[xg(tE,e=>e.startsWith("http")?e:`https://${e}`),xg(nE,e=>`mailto:${e}`)],iE=()=>_.createElement(eE,{matchers:rE}),oE=ne(!1),sE=on({init(e,t){const n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{};e.pubIn({[Di]:"link",[Wn]:J4,[pr]:[Zn,$i],[mr]:K4,[oE]:n,[qr]:()=>_.createElement(_.Fragment,null,_.createElement(Z4,{...r}),n?null:_.createElement(iE,null))})}});function aE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var lE=["color"],uE=I.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=aE(e,lE);return I.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),I.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 yg=()=>_.createElement("div",{className:Y.imagePlaceholder},_.createElement(uE,null));function qu({nodeKey:e,imageSource:t,initialImagePath:n,title:r,alt:i}){const[o,s,a]=rn(b5,In,nn),[l]=yt(),u=_t(x5),c=Bt();return _.createElement("div",{className:Y.editImageToolbar},_.createElement("button",{className:Y.iconButton,type:"button",title:c("imageEditor.deleteImage","Delete image"),disabled:a,onClick:d=>{d.preventDefault(),l.update(()=>{var f;(f=ze(e))==null||f.remove()})}},s("delete_small")),!o&&_.createElement("button",{type:"button",className:ke(Y.iconButton,Y.editImageButton),title:c("imageEditor.editImage","Edit image"),disabled:a,onClick:()=>{u({nodeKey:e,initialValues:{src:n||t,title:r,altText:i}})}},s("settings")))}function eo(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(null,arguments)}var Fl={exports:{}},Ll,bg;function cE(){if(bg)return Ll;bg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ll=e,Ll}var Dl,vg;function dE(){if(vg)return Dl;vg=1;var e=cE();function t(){}function n(){}return n.resetWarningCache=t,Dl=function(){function r(s,a,l,u,c,d){if(d!==e){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 o={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:n,resetWarningCache:t};return o.PropTypes=o,o},Dl}var Cg;function fE(){return Cg||(Cg=1,Fl.exports=dE()()),Fl.exports}var hE=fE();const K=Qg(hE);var Rl={exports:{}},Me={};/** @license React v17.0.2
|
|
79
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return M.jsx(B6,{nodeKey:this.__key})}};function H6(){return{node:Ri()}}function Ri(){return Nt(new Xo)}function Wa(e){return e instanceof Xo}function V6(){const[e]=yt();return I.useEffect(()=>e.registerCommand(hx,t=>{const n=j();if(!$(n))return!1;if(n.focus.getNode()!==null){const r=Ri();z1(r)}return!0},xe),[e]),null}const z6={testLexicalNode:Wa,visitLexicalNode({actions:e}){e.addAndStepInto("thematicBreak")}},W6={testNode:"thematicBreak",visitNode({actions:e}){e.addAndStepInto(Ri())}},j6=cr(e=>{e.sub(e.pipe(j6,We(qe)),([,t])=>{t?.dispatchCommand(hx,void 0)})}),U6=on({init(e){e.pubIn({[Di]:"thematicBreak",[Wn]:W6,[pr]:Xo,[mr]:z6,[qr]:V6})}});function mn(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Vu(e){let t=1,n=e.getParent();for(;n!=null;){if(be(n)){const r=n.getParent();if(de(r)){t++,n=r.getParent();continue}mn(40)}return t}return t}function zu(e){let t=e.getParent();de(t)||mn(40);let n=t;for(;n!==null;)n=n.getParent(),de(n)&&(t=n);return t}function px(e){let t=[];const n=e.getChildren().filter(be);for(let r=0;r<n.length;r++){const i=n[r],o=i.getFirstChild();de(o)?t=t.concat(px(o)):t.push(i)}return t}function xn(e){return be(e)&&de(e.getFirstChild())}function eg(e){return xt().append(e)}function mx(e,t){return be(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Wu(e){const t=j();if(t!==null){let n=t.getNodes();if($(t)){const i=t.getStartEndPoints();i===null&&mn(143);const[o]=i,s=o.getNode(),a=s.getParent();if(je(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const u=Ee();s.append(u),n=u.select().getNodes()}}else if(mx(s,n)){const l=mt(e);if(je(a)){s.replace(l);const u=xt();D(s)&&(u.setFormat(s.getFormatType()),u.setIndent(s.getIndent())),l.append(u)}else if(be(s)){const u=s.getParentOrThrow();Wr(l,u.getChildren()),u.replace(l)}return}}const r=new Set;for(let i=0;i<n.length;i++){const o=n[i];if(!D(o)||!o.isEmpty()||be(o)||r.has(o.getKey())){if(w1(o)){let s=o.getParent();for(;s!=null;){const a=s.getKey();if(de(s)){if(!r.has(a)){const l=mt(e);Wr(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(je(l)&&!r.has(a)){r.add(a),tg(s,e);break}s=l}}}}else tg(o,e)}}}function Wr(e,t){e.splice(e.getChildrenSize(),0,t)}function tg(e,t){if(de(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=xt();let o;if(Wr(i,e.getChildren()),de(n)&&t===n.getListType())n.append(i),de(r)&&t===r.getListType()&&(Wr(n,r.getChildren()),r.remove()),o=n;else if(de(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const s=mt(t);s.append(i),e.replace(s),o=s}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),o}function md(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&xn(n)&&xn(r)&&(md(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function J6(){const e=j();if($(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(mx(r,n))t.add(zu(r));else for(let i=0;i<n.length;i++){const o=n[i];if(w1(o)){const s=V1(o,ln);s!=null&&t.add(zu(s))}}for(const i of t){let o=i;const s=px(i);for(const a of s){const l=Ee().setTextStyle(e.style).setTextFormat(e.format);Wr(l,a.getChildren()),o.insertAfter(l),o=l,a.__key===e.anchor.key&&Vr(e.anchor,Rt(Sn(l,"next"))),a.__key===e.focus.key&&Vr(e.focus,Rt(Sn(l,"next"))),a.remove()}i.remove()}}}function K6(e){const t=new Set;if(xn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(xn(r)&&xn(i)){const o=i.getFirstChild();if(de(o)){o.append(e);const s=r.getFirstChild();de(s)&&(Wr(o,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(xn(r)){const o=r.getFirstChild();if(de(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(e)}}else if(xn(i)){const o=i.getFirstChild();de(o)&&o.append(e)}else if(de(n)){const o=xt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),s=mt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());o.append(s),s.append(e),i?i.insertAfter(o):r?r.insertBefore(o):n.append(o)}}function Z6(e){if(xn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(de(n?n.getParent():void 0)&&be(n)&&de(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const o=t.getListType(),s=xt(),a=mt(o);s.append(a),e.getPreviousSiblings().forEach(c=>a.append(c));const l=xt(),u=mt(o);l.append(u),Wr(u,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function q6(){const e=j();if(!$(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!be(t)||t.getChildrenSize()!==0)return!1;const n=zu(t),r=t.getParent();de(r)||mn(40);const i=r.getParent();let o;if(je(i))o=Ee(),n.insertAfter(o);else{if(!be(i))return!1;o=xt(),i.insertAfter(o)}o.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=mt(r.getListType());if(be(o)){const l=xt();l.append(a),o.insertAfter(l)}else o.insertAfter(a);a.append(...s)}return function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!be(u)&&!de(u))break;l=u}l.remove()}(t),!0}function ra(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}class ln extends an{static getType(){return"listitem"}static clone(t){return new ln(t.__value,t.__checked,t.__key)}constructor(t,n,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}createDOM(t){const n=document.createElement("li"),r=this.getParent();de(r)&&r.getListType()==="check"&&rg(n,this,null),n.value=this.__value,ng(n,t.theme,this);const i=this.__style||this.__textStyle;return i&&(n.style.cssText=i),n}updateDOM(t,n,r){const i=this.getParent();de(i)&&i.getListType()==="check"&&rg(n,this,t),n.value=this.__value,ng(n,r.theme,this);const o=t.__style||t.__textStyle,s=this.__style||this.__textStyle;return o!==s&&(n.style.cssText=s,s===""&&n.removeAttribute("style")),!1}static transform(){return t=>{if(be(t)||mn(144),t.__checked==null)return;const n=t.getParent();de(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Y6,priority:0})}}static importJSON(t){return xt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config);n.style.textAlign=this.getFormatType();const r=this.getDirection();return r&&(n.dir=r),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(D(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(t,n){if(be(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!de(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const i=mt(r.getListType());let o=this.getNextSibling();for(;o;){const s=o;o=o.getNextSibling(),i.append(s)}r.insertAfter(t),t.insertAfter(i)}return n&&(D(t)||mn(139),this.getChildren().forEach(i=>{t.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(de(r)||mn(39),be(t))return super.insertAfter(t,n);const i=this.getNextSiblings();if(r.insertAfter(t,n),i.length!==0){const o=mt(r.getListType());i.forEach(s=>o.append(s)),t.insertAfter(o,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&xn(n)&&xn(r)&&(md(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=xt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=Ee();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),o=be(i);if(r.getChildrenSize()===1)if(o)r.remove(),i.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return de(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;be(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&mn(117),(t=Math.floor(t))>=0||mn(199);let n=this.getIndent();for(;n!==t;)n<t?(K6(this),n++):(Z6(this),n--);return this}canInsertAfter(t){return be(t)}canReplaceWith(t){return be(t)}canMergeWith(t){return be(t)||Vc(t)}extractWithChild(t,n){if(!$(n))return!1;const r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return mt("bullet")}canMergeWhenEmpty(){return!0}}function ng(e,t,n){const r=[],i=[],o=t.list,s=o?o.listitem:void 0;let a;if(o&&o.nested&&(a=o.nested.listitem),s!==void 0&&r.push(...ra(s)),o){const l=n.getParent(),u=de(l)&&l.getListType()==="check",c=n.getChecked();u&&!c||i.push(o.listitemUnchecked),u&&c||i.push(o.listitemChecked),u&&r.push(c?o.listitemChecked:o.listitemUnchecked)}if(a!==void 0){const l=ra(a);n.getChildren().some(u=>de(u))?r.push(...l):i.push(...l)}i.length>0&&Fa(e,...i),r.length>0&&tn(e,...r)}function rg(e,t,n,r){de(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function Y6(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return G6(n)}const t=e.getAttribute("aria-checked");return{node:xt(t==="true"||t!=="false"&&void 0)}}function G6(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:xt(e.hasAttribute("checked"))}}function xt(e){return Nt(new ln(void 0,e))}function be(e){return e instanceof ln}class Nn extends an{static getType(){return"list"}static clone(t){const n=t.__listType||sg[t.__tag];return new Nn(n,t.__start,t.__key)}constructor(t="number",n=1,r){super(r);const i=sg[t]||t;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=n}getTag(){return this.__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.__listType}getStart(){return this.__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,ig(i,t.theme,this),i}updateDOM(t,n,r){return t.__tag!==this.__tag||(ig(n,r.theme,this),!1)}static transform(){return t=>{de(t)||mn(163),function(n){const r=n.getNextSibling();de(r)&&n.getListType()===r.getListType()&&md(n,r)}(t),function(n){const r=n.getListType()!=="check";let i=n.getStart();for(const o of n.getChildren())be(o)&&(o.getValue()!==i&&o.setValue(i),r&&o.getLatest().__checked!=null&&o.setChecked(void 0),de(o.getFirstChild())||i++)}(t)}}static importDOM(){return{ol:()=>({conversion:og,priority:0}),ul:()=>({conversion:og,priority:0})}}static importJSON(t){return mt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Ke(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(be(r))super.append(r);else{const i=xt();if(de(r))i.append(r);else if(D(r))if(r.isInline())i.append(r);else{const o=Re(r.getTextContent());i.append(o)}else i.append(r);super.append(i)}}return this}extractWithChild(t){return be(t)}}function ig(e,t,n){const r=[],i=[],o=t.list;if(o!==void 0){const s=o[`${n.__tag}Depth`]||[],a=Vu(n)-1,l=a%s.length,u=s[l],c=o[n.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&r.push(c),h!==void 0&&n.__listType==="check"&&r.push(h),u!==void 0){r.push(...ra(u));for(let g=0;g<s.length;g++)g!==l&&i.push(n.__tag+g)}if(d!==void 0){const g=ra(d);a>1?r.push(...g):i.push(...g)}}i.length>0&&Fa(e,...i),r.length>0&&tn(e,...r)}function X6(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(be(r)){t.push(r);const i=r.getChildren();i.length>1&&i.forEach(o=>{de(o)&&t.push(eg(o))})}else t.push(eg(r))}return t}function og(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=mt("number",e.start):t==="ul"&&(n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list"))return!0;for(const i of r.childNodes)if(Ke(i)&&i.hasAttribute("aria-checked"))return!0;return!1}(e)?mt("check"):mt("bullet")),{after:X6,node:n}}const sg={ol:"number",ul:"bullet"};function mt(e="number",t=1){return Nt(new Nn(e,t))}function de(e){return e instanceof Nn}const xx=Jn(),yx=Jn(),bx=Jn(),vx=Jn();function Q6(e){return Mt(e.registerCommand(yx,()=>(Wu("number"),!0),De),e.registerCommand(xx,()=>(Wu("bullet"),!0),De),e.registerCommand(vx,()=>(J6(),!0),De),e.registerCommand(_o,()=>q6(),De),e.registerNodeTransform(ln,t=>{const n=t.getFirstChild();if(n){if(J(n)){const r=n.getStyle(),i=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==i&&t.setTextFormat(i)}}else{const r=j();$(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Tn,t=>{const n=t.getParent();if(be(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),i=t.getFormat();r===n.getTextStyle()&&i===n.getTextFormat()||n.setTextStyle(r).setTextFormat(i)}}))}function eE(e,t){e.update(()=>Wu(t))}const tE={testNode:"list",visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){const r=e.children.some(o=>typeof o.checked=="boolean")?"check":e.ordered?"number":"bullet",i=mt(r);if(be(t)){const o=xt();o.append(i),t.insertAfter(o)}else t.append(i);n.visitChildren(e,i)}},nE={testNode:"listItem",visitNode({mdastNode:e,actions:t,lexicalParent:n}){const r=n.getListType()==="check"?e.checked??!1:void 0;t.addAndStepInto(xt(r))}},rE={testLexicalNode:de,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("list",{ordered:e.getListType()==="number",spread:!1})}},iE={testLexicalNode:be,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{const r=e.getChildren(),i=r[0];if(r.length===1&&de(i)){const o=t.children.at(-1);o?n.visitChildren(e,o):n.visitChildren(i,t)}else{const o=e.getParent(),s=n.appendToParent(t,{type:"listItem",checked:o.getListType()==="check"?!!e.getChecked():void 0,spread:!1,children:[]});let a=null;for(const l of e.getChildren())J(l)||Xt(l)||l.isInline()&&(D(l)||ve(l))?(a||(a=n.appendToParent(s,{type:"paragraph",children:[]})),n.visit(l,a)):(a=null,n.visit(l,s))}}};function oE(e,t){return Mt(e.registerCommand(Nc,n=>{const r=j();if(!$(r))return!1;n.preventDefault();const i=function(o){const s=o.getNodes();if(I_(s,f=>Ws(f)&&f.canIndent()?f:null).length>0)return!0;const a=o.anchor,l=o.focus,u=l.isBefore(a)?l:a,c=u.getNode(),d=xu(c);if(d.canIndent()){const f=d.getKey();let h=zo();if(h.anchor.set(f,0,"element"),h.focus.set(f,0,"element"),h=Dr(h),h.anchor.is(u))return!0}return!1}(r)?n.shiftKey?nu:Vs:Xm;return e.dispatchCommand(i,void 0)},xe),e.registerCommand(Vs,()=>{if(t==null)return!1;const n=j();if(!$(n))return!1;const r=n.getNodes().map(i=>xu(i).getIndent());return Math.max(...r)+1>=t},zn))}function ag({maxIndent:e}){const[t]=yt();return I.useEffect(()=>oE(t,e),[t,e]),null}function lg(){const[e]=yt();return I.useEffect(()=>Mt(e.registerCommand(bx,()=>(eE(e,"check"),!0),De),e.registerCommand(Tc,t=>dg(t,e,!1),De),e.registerCommand(Ec,t=>dg(t,e,!0),De),e.registerCommand(Bo,t=>{if(ju()!=null){const n=e.getRootElement();return n?.focus(),!0}return!1},De),e.registerCommand(Ic,t=>{const n=ju();return!(n==null||!e.isEditable())&&(e.update(()=>{const r=kn(n);be(r)&&(t.preventDefault(),r.toggleChecked())}),!0)},De),e.registerCommand(Sc,t=>e.getEditorState().read(()=>{const n=j();if($(n)&&n.isCollapsed()){const{anchor:r}=n,i=r.type==="element";if(i||r.offset===0){const o=r.getNode(),s=fr(o,a=>D(a)&&!a.isInline());if(be(s)){const a=s.getParent();if(de(a)&&a.getListType()==="check"&&(i||s.getFirstDescendant()===o)){const l=e.getElementByKey(s.__key);if(l!=null&&document.activeElement!==l)return l.focus(),t.preventDefault(),!0}}}}return!1}),De),e.registerRootListener((t,n)=>{t!==null&&(t.addEventListener("click",ug),t.addEventListener("pointerdown",cg)),n!==null&&(n.removeEventListener("click",ug),n.removeEventListener("pointerdown",cg))}))),null}function Cx(e,t){const n=e.target;if(!Ke(n))return;const r=n.firstChild;if(Ke(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=n.parentNode;if(!i||i.__lexicalListType!=="check")return;const o=n.getBoundingClientRect(),s=e.pageX/N_(n);(n.dir==="rtl"?s<o.right&&s>o.right-20:s>o.left&&s<o.left+20)&&t()}function ug(e){Cx(e,()=>{if(Ke(e.target)){const t=e.target,n=jc(t);n!=null&&n.isEditable()&&n.update(()=>{const r=kn(t);be(r)&&(t.focus(),r.toggleChecked())})}})}function cg(e){Cx(e,()=>{e.preventDefault()})}function ju(){const e=document.activeElement;return Ke(e)&&e.tagName==="LI"&&e.parentNode!=null&&e.parentNode.__lexicalListType==="check"?e:null}function dg(e,t,n){const r=ju();return r!=null&&t.update(()=>{const i=kn(r);if(!be(i))return;const o=function(s,a){let l=a?s.getPreviousSibling():s.getNextSibling(),u=s;for(;l==null&&be(u);)u=u.getParentOrThrow().getParent(),u!=null&&(l=a?u.getPreviousSibling():u.getNextSibling());for(;be(l);){const c=a?l.getLastChild():l.getFirstChild();if(!de(c))return l;l=a?c.getLastChild():c.getFirstChild()}return null}(i,n);if(o!=null){o.selectStart();const s=t.getElementByKey(o.__key);s!=null&&(e.preventDefault(),setTimeout(()=>{s.focus()},0))}}),!1}function fg(){const[e]=yt();return I.useEffect(()=>{if(!e.hasNodes([Nn,ln]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),function(t){I.useEffect(()=>Q6(t),[t])}(e),null}const sE={name:"tasklistCheck",tokenize:lE};function aE(){return{text:{91:sE}}}function lE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Ze(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return re(l)?t(l):ye(l)?e.check({tokenize:uE},t,n)(l):n(l)}}function uE(e,t,n){return Se(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function cE(){return{exit:{taskListCheckValueChecked:hg,taskListCheckValueUnchecked:hg,paragraph:fE}}}function dE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hE}}}function hg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fE(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function hE(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=x0.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+s}}const gE=new Map([["number",yx],["bullet",xx],["check",bx],["",vx]]),Uu=ne("",e=>{e.sub(e.pipe(Ei,We(qe)),([t,n])=>{if(!t||!n)return;const r=t.anchor.getNode();let i=r.getKey()==="root"?r:fr(r,a=>{const l=a.getParent();return l!==null&&je(l)});i===null&&(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null)if(de(i)){const a=V1(r,Nn),l=a?a.getListType():i.getListType();e.pub(Uu,l)}else e.pub(Uu,"")})}),wx=it(e=>{e.sub(e.pipe(wx,We(qe)),([t,n])=>{n?.dispatchCommand(gE.get(t),void 0)})}),pE=on({init(e){var t;(t=e.getValue(gr))==null||t.registerCommand(Vs,()=>!xE(7),zn),e.pubIn({[Di]:"lists",[Du]:cE(),[Lu]:aE(),[Wn]:[tE,nE],[pr]:[ln,Nn],[mr]:[rE,iE],[J0]:dE(),[qr]:[ag,fg,lg],[rx]:[ag,fg,lg]})}});function mE(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>D(n)?n:n.getParentOrThrow()))}function xE(e){const t=j();if(!$(t))return!1;const n=mE(t);let r=0;for(const i of n)if(de(i))r=Math.max(Vu(i)+1,r);else if(be(i)){const o=i.getParent();if(o?.getChildren().length===1){const s=o.getParent();if(be(s)&&s.getChildren().length===1)return!1}if(!de(o))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(Vu(o)+1,r)}return r<=e}function _x(e){const t=e+"CollectionProvider",[n,r]=Kr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=x=>{const{scope:b,children:y}=x,m=_.useRef(null),p=_.useRef(new Map).current;return M.jsx(i,{scope:b,itemMap:p,collectionRef:m,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=As(a),u=_.forwardRef((x,b)=>{const{scope:y,children:m}=x,p=o(a,y),v=ct(b,p.collectionRef);return M.jsx(l,{ref:v,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=As(c),h=_.forwardRef((x,b)=>{const{scope:y,children:m,...p}=x,v=_.useRef(null),k=ct(b,v),C=o(c,y);return _.useEffect(()=>(C.itemMap.set(v,{ref:v,...p}),()=>void C.itemMap.delete(v))),M.jsx(f,{[d]:"",ref:k,children:m})});h.displayName=c;function g(x){const b=o(e+"CollectionConsumer",x);return _.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,w)=>p.indexOf(C.ref.current)-p.indexOf(w.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},g,r]}var yE=I.createContext(void 0);function ja(e){const t=I.useContext(yE);return e||t||"ltr"}var Al="rovingFocusGroup.onEntryFocus",bE={bubbles:!1,cancelable:!0},Qo="RovingFocusGroup",[Ju,kx,vE]=_x(Qo),[CE,Ua]=Kr(Qo,[vE]),[wE,_E]=CE(Qo),Sx=I.forwardRef((e,t)=>M.jsx(Ju.Provider,{scope:e.__scopeRovingFocusGroup,children:M.jsx(Ju.Slot,{scope:e.__scopeRovingFocusGroup,children:M.jsx(kE,{...e,ref:t})})}));Sx.displayName=Qo;var kE=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=I.useRef(null),h=ct(t,f),g=ja(o),[x,b]=Pr({prop:s,defaultProp:a??null,onChange:l,caller:Qo}),[y,m]=I.useState(!1),p=xp(u),v=kx(n),k=I.useRef(!1),[C,w]=I.useState(0);return I.useEffect(()=>{const S=f.current;if(S)return S.addEventListener(Al,p),()=>S.removeEventListener(Al,p)},[p]),M.jsx(wE,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:x,onItemFocus:I.useCallback(S=>b(S),[b]),onItemShiftTab:I.useCallback(()=>m(!0),[]),onFocusableItemAdd:I.useCallback(()=>w(S=>S+1),[]),onFocusableItemRemove:I.useCallback(()=>w(S=>S-1),[]),children:M.jsx(Ue.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{k.current=!0}),onFocus:we(e.onFocus,S=>{const T=!k.current;if(S.target===S.currentTarget&&T&&!y){const P=new CustomEvent(Al,bE);if(S.currentTarget.dispatchEvent(P),!P.defaultPrevented){const F=v().filter(q=>q.focusable),L=F.find(q=>q.active),O=F.find(q=>q.id===x),H=[L,O,...F].filter(Boolean).map(q=>q.ref.current);Ix(H,c)}}k.current=!1}),onBlur:we(e.onBlur,()=>m(!1))})})}),Ex="RovingFocusGroupItem",Tx=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,l=Oo(),u=o||l,c=_E(Ex,n),d=c.currentTabStopId===u,f=kx(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:x}=c;return I.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),M.jsx(Ju.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:M.jsx(Ue.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:we(e.onMouseDown,b=>{r?c.onItemFocus(u):b.preventDefault()}),onFocus:we(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=TE(b,c.orientation,c.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let p=f().filter(v=>v.focusable).map(v=>v.ref.current);if(y==="last")p.reverse();else if(y==="prev"||y==="next"){y==="prev"&&p.reverse();const v=p.indexOf(b.currentTarget);p=c.loop?IE(p,v+1):p.slice(v+1)}setTimeout(()=>Ix(p))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:x!=null}):s})})});Tx.displayName=Ex;var SE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TE(e,t,n){const r=EE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SE[r]}function Ix(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function IE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Nx=Sx,xd=Tx,Mx="Toggle",Ax=I.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[s,a]=Pr({prop:n,onChange:i,defaultProp:r??!1,caller:Mx});return M.jsx(Ue.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:we(e.onClick,()=>{e.disabled||a(!s)})})});Ax.displayName=Mx;var xr="ToggleGroup",[Ox,Px]=Kr(xr,[Ua]),Fx=Ua(),yd=_.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return M.jsx(NE,{...i,ref:t})}if(n==="multiple"){const i=r;return M.jsx(ME,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${xr}\``)});yd.displayName=xr;var[Lx,Dx]=Ox(xr),NE=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s,a]=Pr({prop:n,defaultProp:r??"",onChange:i,caller:xr});return M.jsx(Lx,{scope:e.__scopeToggleGroup,type:"single",value:_.useMemo(()=>s?[s]:[],[s]),onItemActivate:a,onItemDeactivate:_.useCallback(()=>a(""),[a]),children:M.jsx(Rx,{...o,ref:t})})}),ME=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s,a]=Pr({prop:n,defaultProp:r??[],onChange:i,caller:xr}),l=_.useCallback(c=>a((d=[])=>[...d,c]),[a]),u=_.useCallback(c=>a((d=[])=>d.filter(f=>f!==c)),[a]);return M.jsx(Lx,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:l,onItemDeactivate:u,children:M.jsx(Rx,{...o,ref:t})})});yd.displayName=xr;var[AE,OE]=Ox(xr),Rx=_.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:s,loop:a=!0,...l}=e,u=Fx(n),c=ja(s),d={role:"group",dir:c,...l};return M.jsx(AE,{scope:n,rovingFocus:i,disabled:r,children:i?M.jsx(Nx,{asChild:!0,...u,orientation:o,dir:c,loop:a,children:M.jsx(Ue.div,{...d,ref:t})}):M.jsx(Ue.div,{...d,ref:t})})}),ia="ToggleGroupItem",$x=_.forwardRef((e,t)=>{const n=Dx(ia,e.__scopeToggleGroup),r=OE(ia,e.__scopeToggleGroup),i=Fx(e.__scopeToggleGroup),o=n.value.includes(e.value),s=r.disabled||e.disabled,a={...e,pressed:o,disabled:s},l=_.useRef(null);return r.rovingFocus?M.jsx(xd,{asChild:!0,...i,focusable:!s,active:o,ref:l,children:M.jsx(gg,{...a,ref:t})}):M.jsx(gg,{...a,ref:t})});$x.displayName=ia;var gg=_.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=Dx(ia,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=o.type==="single"?s:void 0;return M.jsx(Ax,{...a,...i,ref:t,onPressedChange:l=>{l?o.onItemActivate(r):o.onItemDeactivate(r)}})}),PE=yd,FE=$x,bd="Toolbar",[LE,UN]=Kr(bd,[Ua,Px]),vd=Ua(),Bx=Px(),[DE,Hx]=LE(bd),Vx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:i,loop:o=!0,...s}=e,a=vd(n),l=ja(i);return M.jsx(DE,{scope:n,orientation:r,dir:l,children:M.jsx(Nx,{asChild:!0,...a,orientation:r,dir:l,loop:o,children:M.jsx(Ue.div,{role:"toolbar","aria-orientation":r,dir:l,...s,ref:t})})})});Vx.displayName=bd;var zx="ToolbarSeparator",Wx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Hx(zx,n);return M.jsx(Wy,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:t})});Wx.displayName=zx;var RE="ToolbarButton",Cd=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=vd(n);return M.jsx(xd,{asChild:!0,...i,focusable:!e.disabled,children:M.jsx(Ue.button,{type:"button",...r,ref:t})})});Cd.displayName=RE;var $E="ToolbarLink",BE=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=vd(n);return M.jsx(xd,{asChild:!0,...i,focusable:!0,children:M.jsx(Ue.a,{...r,ref:t,onKeyDown:we(e.onKeyDown,o=>{o.key===" "&&o.currentTarget.click()})})})});BE.displayName=$E;var jx="ToolbarToggleGroup",Ux=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Hx(jx,n),o=Bx(n);return M.jsx(PE,{"data-orientation":i.orientation,dir:i.dir,...o,...r,ref:t,rovingFocus:!1})});Ux.displayName=jx;var HE="ToolbarToggleItem",Jx=I.forwardRef((e,t)=>{const{__scopeToolbar:n,...r}=e,i=Bx(n),o={__scopeToolbar:e.__scopeToolbar};return M.jsx(Cd,{asChild:!0,...o,children:M.jsx(FE,{...i,...r,ref:t})})});Jx.displayName=HE;var VE=Vx,zE=Wx,Kx=Cd,wd=Ux,WE=Jx;const jE=new Set(["http:","https:","mailto:","sms:","tel:"]);class Zn extends an{static getType(){return"link"}static clone(t){return new Zn(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=n;this.__url=t,this.__target=i,this.__rel=o,this.__title=s}createDOM(t){const n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),tn(n,t.theme.link),n}updateDOM(t,n,r){if(O1(n)){const i=this.__url,o=this.__target,s=this.__rel,a=this.__title;i!==t.__url&&(n.href=i),o!==t.__target&&(o?n.target=o:n.removeAttribute("target")),s!==t.__rel&&(s?n.rel=s:n.removeAttribute("rel")),a!==t.__title&&(a?n.title=a:n.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:UE,priority:1})}}static importJSON(t){return jr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){try{const n=new URL(t);if(!jE.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=jr(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!$(n))return!1;const i=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function UE(e){let t=null;if(O1(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=jr(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function jr(e="",t){return Nt(new Zn(e,t))}function yn(e){return e instanceof Zn}class $i extends Zn{constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new $i(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Ku().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(D(r)){const i=Ku(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function Ku(e="",t){return Nt(new $i(e,t))}function Tr(e){return e instanceof $i}const Ti=Jn();function pg(e,t){if(e.type==="element"){const n=e.getNode();return D(n)||function(r,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of i)s.append("v",a);throw o.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Ol(e,t={}){const{target:n,title:r}=t,i=t.rel===void 0?"noreferrer":t.rel,o=j();if(!$(o))return;const s=o.extract();if(e===null)return void s.forEach(u=>{const c=fr(u,d=>!Tr(d)&&yn(d));if(c){const d=c.getChildren();for(let f=0;f<d.length;f++)c.insertBefore(d[f]);c.remove()}});const a=new Set,l=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(e),n!==void 0&&u.setTarget(n),i!==void 0&&u.setRel(i),r!==void 0&&u.setTitle(r))};if(s.length===1){const u=mg(s[0],yn);if(u!==null)return l(u)}(function(u){const c=j();if(!$(c))return u();const d=Dr(c),f=d.isBackward(),h=pg(d.anchor,f?-1:0),g=pg(d.focus,f?0:-1);if(u(),h||g){const x=j();if($(x)){const b=x.clone();if(h){const y=h.getParent();y&&b.anchor.set(y.getKey(),h.getIndexWithinParent()+(f?1:0),"element")}if(g){const y=g.getParent();y&&b.focus.set(y.getKey(),g.getIndexWithinParent()+(f?0:1),"element")}Xe(Dr(b))}}})(()=>{let u=null;for(const c of s){if(!c.isAttached())continue;const d=mg(c,yn);if(d){l(d);continue}if(D(c)){if(!c.isInline())continue;if(yn(c)){if(!(Tr(c)||u!==null&&u.getParentOrThrow().isParentOf(c))){l(c),u=c;continue}for(const h of c.getChildren())c.insertBefore(h);c.remove();continue}}const f=c.getPreviousSibling();yn(f)&&f.is(u)?f.append(c):(u=jr(e,{rel:i,target:n,title:r}),c.insertAfter(u),u.append(c))}})}function mg(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const JE={testNode:"link",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(jr(e.url,{title:e.title}))}},KE={testLexicalNode:yn,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("link",{url:e.getURL(),title:e.getTitle()})}};function ZE({validateUrl:e,attributes:t}){const[n]=yt();return I.useEffect(()=>{if(!n.hasNodes([Zn]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Mt(n.registerCommand(Ti,r=>{if(r===null)return Ol(r),!0;if(typeof r=="string")return!(e!==void 0&&!e(r))&&(Ol(r,t),!0);{const{url:i,target:o,rel:s,title:a}=r;return Ol(i,{...t,rel:s,target:o,title:a}),!0}},De),e!==void 0?n.registerCommand($o,r=>{const i=j();if(!$(i)||i.isCollapsed()||!nr(r,ClipboardEvent))return!1;const o=r;if(o.clipboardData===null)return!1;const s=o.clipboardData.getData("text");return!!e(s)&&!i.getNodes().some(a=>D(a))&&(n.dispatchCommand(Ti,{...t,url:s}),r.preventDefault(),!0)},De):()=>{})},[n,e,t]),null}function xg(e,t=n=>n){return n=>{const r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function Zx(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}const qE=/[.,;\s]/;function oa(e){return qE.test(e)}function qx(e){return oa(e[e.length-1])}function Zu(e){return oa(e[0])}function Yx(e){let t=e.getPreviousSibling();return D(t)&&(t=t.getLastDescendant()),t===null||Xt(t)||J(t)&&qx(t.getTextContent())}function Gx(e){let t=e.getNextSibling();return D(t)&&(t=t.getFirstDescendant()),t===null||Xt(t)||J(t)&&Zu(t.getTextContent())}function YE(e,t,n,r){return(e>0?oa(n[e-1]):Yx(r[0]))?t<n.length?oa(n[t]):Gx(r[r.length-1]):!1}function GE(e,t,n){const r=[],i=[],o=[];let s=0,a=0;const l=[...e];for(;l.length>0;){const u=l[0],c=u.getTextContent().length,d=a;a+c<=t?(r.push(u),s+=c):d>=n?o.push(u):i.push(u),a+=c,l.shift()}return[s,r,i,o]}function XE(e,t,n,r){const i=Ku(r.url,r.attributes);if(e.length===1){let o,s=e[0];t===0?[o,s]=s.splitText(n):[,o,s]=s.splitText(t,n);const a=Re(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),i.append(a),o.replace(i),s}if(e.length>1){const o=e[0];let s,a=o.getTextContent().length;t===0?s=o:[,s]=o.splitText(t);const l=[];let u;for(let h=1;h<e.length;h++){const g=e[h],x=g.getTextContent().length,b=a;if(b<n)if(a+x<=n)l.push(g);else{const[y,m]=g.splitText(n-b);l.push(y),u=m}a+=x}const c=j(),d=c?c.getNodes().find(J):void 0,f=Re(s.getTextContent());return f.setFormat(s.getFormat()),f.setDetail(s.getDetail()),f.setStyle(s.getStyle()),i.append(f,...l),d&&d===s&&($(c)?f.select(c.anchor.offset,c.focus.offset):et(c)&&f.select(0,f.getTextContent().length)),s.replace(i),u}}function Pl(e,t,n){const r=e.getChildren(),i=r.length;for(let l=0;l<i;l++){const u=r[l];if(!J(u)||!u.isSimpleText())return Ns(e),void n(null,e.getURL())}const o=e.getTextContent(),s=Zx(o,t);if(s===null||s.text!==o||!Yx(e)||!Gx(e))return Ns(e),void n(null,e.getURL());const a=e.getURL();if(a!==s.url&&(e.setURL(s.url),n(s.url,a)),s.attributes){const l=e.getRel();l!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,l));const u=e.getTarget();u!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,u))}}function Ns(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(n=>n.getLatest())}function QE(e,t,n){I.useEffect(()=>{e.hasNodes([$i])||function(i,...o){const s=new URL("https://lexical.dev/docs/error"),a=new URLSearchParams;a.append("code",i);for(const l of o)a.append("v",l);throw s.search=a.toString(),Error(`Minified Lexical error #${i}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const r=(i,o)=>{n&&n(i,o)};return Mt(e.registerNodeTransform(Tn,i=>{const o=i.getParentOrThrow(),s=i.getPreviousSibling();if(Tr(o)&&!o.getIsUnlinked())Pl(o,t,r);else if(!yn(o)){if(i.isSimpleText()&&(Zu(i.getTextContent())||!Tr(s))){const a=function(l){const u=[l];let c=l.getNextSibling();for(;c!==null&&J(c)&&c.isSimpleText()&&(u.push(c),!/[\s]/.test(c.getTextContent()));)c=c.getNextSibling();return u}(i);(function(l,u,c){let d=[...l];const f=d.map(b=>b.getTextContent()).join("");let h,g=f,x=0;for(;(h=Zx(g,u))&&h!==null;){const b=h.index,y=b+h.length;if(YE(x+b,x+y,f,d)){const[m,,p,v]=GE(d,x+b,x+y),k=XE(p,x+b-m,x+y-m,h);d=k?[k,...v]:v,c(h.url,null),x=0}else x+=y;g=g.substring(y)}})(a,t,r)}(function(a,l,u){const c=a.getPreviousSibling(),d=a.getNextSibling(),f=a.getTextContent();var h;!Tr(c)||c.getIsUnlinked()||Zu(f)&&(h=f,!(c.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(h):/^\.[a-zA-Z0-9]{1,}/.test(h)))||(c.append(a),Pl(c,l,u),u(null,c.getURL())),!Tr(d)||d.getIsUnlinked()||qx(f)||(Ns(d),Pl(d,l,u),u(null,d.getURL()))})(i,t,r)}}),e.registerCommand(Ti,i=>{const o=j();return i!==null||!$(o)||o.extract().forEach(s=>{const a=s.getParent();if(Tr(a))return a.setIsUnlinked(!a.getIsUnlinked()),a.markDirty(),!0}),!1},De))},[e,t,n])}function e4({matchers:e,onChange:t}){const[n]=yt();return QE(n,e,t),null}const t4=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,n4=/(([^<>()[\]\\.,;:\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,}))/,r4=[xg(t4,e=>e.startsWith("http")?e:`https://${e}`),xg(n4,e=>`mailto:${e}`)],i4=()=>_.createElement(e4,{matchers:r4}),o4=ne(!1),s4=on({init(e,t){const n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{};e.pubIn({[Di]:"link",[Wn]:JE,[pr]:[Zn,$i],[mr]:KE,[o4]:n,[qr]:()=>_.createElement(_.Fragment,null,_.createElement(ZE,{...r}),n?null:_.createElement(i4,null))})}});function a4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var l4=["color"],u4=I.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=a4(e,l4);return I.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),I.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 yg=()=>_.createElement("div",{className:Y.imagePlaceholder},_.createElement(u4,null));function qu({nodeKey:e,imageSource:t,initialImagePath:n,title:r,alt:i}){const[o,s,a]=rn(b5,In,nn),[l]=yt(),u=_t(x5),c=Bt();return _.createElement("div",{className:Y.editImageToolbar},_.createElement("button",{className:Y.iconButton,type:"button",title:c("imageEditor.deleteImage","Delete image"),disabled:a,onClick:d=>{d.preventDefault(),l.update(()=>{var f;(f=ze(e))==null||f.remove()})}},s("delete_small")),!o&&_.createElement("button",{type:"button",className:ke(Y.iconButton,Y.editImageButton),title:c("imageEditor.editImage","Edit image"),disabled:a,onClick:()=>{u({nodeKey:e,initialValues:{src:n||t,title:r,altText:i}})}},s("settings")))}function eo(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(null,arguments)}var Fl={exports:{}},Ll,bg;function c4(){if(bg)return Ll;bg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ll=e,Ll}var Dl,vg;function d4(){if(vg)return Dl;vg=1;var e=c4();function t(){}function n(){}return n.resetWarningCache=t,Dl=function(){function r(s,a,l,u,c,d){if(d!==e){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 o={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:n,resetWarningCache:t};return o.PropTypes=o,o},Dl}var Cg;function f4(){return Cg||(Cg=1,Fl.exports=d4()()),Fl.exports}var h4=f4();const K=Qg(h4);var Rl={exports:{}},Me={};/** @license React v17.0.2
|
|
80
80
|
* react-is.production.min.js
|
|
81
81
|
*
|
|
82
82
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the MIT license found in the
|
|
85
85
|
* LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var wg;function gE(){if(wg)return Me;wg=1;var e=60103,t=60106,n=60107,r=60108,i=60114,o=60109,s=60110,a=60112,l=60113,u=60120,c=60115,d=60116,f=60121,h=60122,g=60117,x=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;e=y("react.element"),t=y("react.portal"),n=y("react.fragment"),r=y("react.strict_mode"),i=y("react.profiler"),o=y("react.provider"),s=y("react.context"),a=y("react.forward_ref"),l=y("react.suspense"),u=y("react.suspense_list"),c=y("react.memo"),d=y("react.lazy"),f=y("react.block"),h=y("react.server.block"),g=y("react.fundamental"),x=y("react.debug_trace_mode"),b=y("react.legacy_hidden")}function m(O){if(typeof O=="object"&&O!==null){var B=O.$$typeof;switch(B){case e:switch(O=O.type,O){case n:case i:case r:case l:case u:return O;default:switch(O=O&&O.$$typeof,O){case s:case a:case d:case c:case o:return O;default:return B}}case t:return B}}}var p=o,v=e,k=a,C=n,w=d,S=c,T=t,P=i,F=r,L=l;return Me.ContextConsumer=s,Me.ContextProvider=p,Me.Element=v,Me.ForwardRef=k,Me.Fragment=C,Me.Lazy=w,Me.Memo=S,Me.Portal=T,Me.Profiler=P,Me.StrictMode=F,Me.Suspense=L,Me.isAsyncMode=function(){return!1},Me.isConcurrentMode=function(){return!1},Me.isContextConsumer=function(O){return m(O)===s},Me.isContextProvider=function(O){return m(O)===o},Me.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===e},Me.isForwardRef=function(O){return m(O)===a},Me.isFragment=function(O){return m(O)===n},Me.isLazy=function(O){return m(O)===d},Me.isMemo=function(O){return m(O)===c},Me.isPortal=function(O){return m(O)===t},Me.isProfiler=function(O){return m(O)===i},Me.isStrictMode=function(O){return m(O)===r},Me.isSuspense=function(O){return m(O)===l},Me.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===n||O===i||O===x||O===r||O===l||O===u||O===b||typeof O=="object"&&O!==null&&(O.$$typeof===d||O.$$typeof===c||O.$$typeof===o||O.$$typeof===s||O.$$typeof===a||O.$$typeof===g||O.$$typeof===f||O[0]===h)},Me.typeOf=m,Me}var _g;function pE(){return _g||(_g=1,Rl.exports=gE()),Rl.exports}pE();let kg=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Sg=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$l=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Sg(n.overflowY,t)||Sg(n.overflowX,t)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},ps=(e,t,n,r,i,o,s,a)=>o<e&&s>t||o>e&&s<t?0:o<=e&&a<=n||s>=t&&a>=n?o-e-r:s>t&&a<n||o<e&&a>n?s-t+i:0,mE=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var xE=(e,t)=>{var n,r,i,o,s,a;if(typeof document>"u")return[];let{inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d=typeof u=="function"?u:L=>L!==u;if(!kg(e))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,h=[],g=e;for(;kg(g)&&d(g);){if(g=mE(g),g===f){h.push(g);break}g!=null&&g===document.body&&$l(g)&&!$l(document.documentElement)||g!=null&&$l(g,c)&&h.push(g)}let x=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,y=(s=window.scrollX)!=null?s:pageXOffset,m=(a=window.scrollY)!=null?a:pageYOffset,{height:p,width:v,top:k,right:C,bottom:w,left:S}=e.getBoundingClientRect(),T=k,P=l==="center"?S+v/2:l==="end"?C:S,F=[];for(let L=0;L<h.length;L++){let O=h[L],{height:B,width:H,top:q,right:Z,bottom:Q,left:X}=O.getBoundingClientRect();if(k>=0&&S>=0&&w<=b&&C<=x&&k>=q&&w<=Q&&S>=X&&C<=Z)return F;let N=getComputedStyle(O),oe=parseInt(N.borderLeftWidth,10),ce=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),fe=parseInt(N.borderBottomWidth,10),ge=0,ae=0,z="offsetWidth"in O?O.offsetWidth-O.clientWidth-oe-A:0,U="offsetHeight"in O?O.offsetHeight-O.clientHeight-ce-fe:0,G="offsetWidth"in O?O.offsetWidth===0?0:H/O.offsetWidth:0,ee="offsetHeight"in O?O.offsetHeight===0?0:B/O.offsetHeight:0;if(f===O)ge=ps(m,m+b,b,ce,fe,m+T,m+T+p,p),ae=l==="start"?P:l==="center"?P-x/2:l==="end"?P-x:ps(y,y+x,x,oe,A,y+P,y+P+v,v),ge=Math.max(0,ge+m),ae=Math.max(0,ae+y);else{ge=ps(q,Q,B,ce,fe+U,T,T+p,p),ae=l==="start"?P-X-oe:l==="center"?P-(X+H/2)+z/2:l==="end"?P-Z+A+z:ps(X,Z,H,oe,A+z,P,P+v,v);let{scrollLeft:se,scrollTop:me}=O;ge=Math.max(0,Math.min(me+ge/ee,O.scrollHeight-B/ee+U)),ae=Math.max(0,Math.min(se+ae/G,O.scrollWidth-H/G+z)),T+=me-ge,P+=se-ae}F.push({el:O,top:ge,left:ae})}return F},yE=0;function Xx(){}function bE(e,t){if(e){var n=xE(e,{boundary:t});n.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scrollTop=o,i.scrollLeft=s})}}function Eg(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function Qx(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,s)},t)}return i.cancel=r,i}function On(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return a&&a.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ms(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function vE(){return String(yE++)}function CE(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Yu(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=e5(t,r)?t[r]:e[r],n},{})}function e5(e,t){return e[t]!==void 0}function wE(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function xs(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:o+1);var s=t+e;s<0?s=i?o:0:s>o&&(s=i?0:o);var a=Ao(e,s,n,r,i);return a===-1?t>=n?-1:t:a}function Ao(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var s=t+1;s<n;s++)if(!r(s).hasAttribute("disabled"))return s}else for(var a=t-1;a>=0;a--)if(!r(a).hasAttribute("disabled"))return a;return i?e>0?Ao(1,0,n,r,!1):Ao(-1,n-1,n,r,!1):-1}function Tg(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(Eg(i,e,n)||r&&Eg(i,n.document.activeElement,n))})}var _E=Qx(function(e){t5(e).textContent=""},500);function kE(e,t){var n=t5(t);e&&(n.textContent=e,_E(t))}function t5(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var SE=["isInitialMount","highlightedIndex","items","environment"],n5={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function EE(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(s){TE(s,e,t,n),n[s]!==t[s]&&(o[s]=n[s])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Be({type:i},o))}function TE(e,t,n,r){var i=t.props,o=t.type,s="on"+_d(e)+"Change";i[s]&&r[e]!==void 0&&r[e]!==n[e]&&i[s](Be({type:o},r))}function IE(e,t){return t.changes}function NE(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var ME=Qx(function(e,t){kE(e(),t)},200),AE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect;function OE(e){var t=e.id,n=t===void 0?"downshift-"+vE():t,r=e.labelId,i=e.menuId,o=e.getItemId,s=e.toggleButtonId,a=e.inputId,l=I.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(u){return n+"-item-"+u},toggleButtonId:s||n+"-toggle-button",inputId:a||n+"-input"});return l.current}function PE(e,t,n,r){var i,o;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],o=t}else o=t===void 0?n.indexOf(e):t,i=e;return[i,o]}function FE(e){return e?String(e):""}function _d(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function r5(e){var t=I.useRef(e);return t.current=e,t}function LE(e,t,n){var r=I.useRef(),i=I.useRef(),o=I.useCallback(function(f,h){i.current=h,f=Yu(f,h.props);var g=e(f,h),x=h.props.stateReducer(f,Be({},h,{changes:g}));return x},[e]),s=I.useReducer(o,t),a=s[0],l=s[1],u=r5(n),c=I.useCallback(function(f){return l(Be({props:u.current},f))},[u]),d=i.current;return I.useEffect(function(){d&&r.current&&r.current!==a&&EE(d,Yu(r.current,d.props),a),r.current=a},[a,n,d]),[a,c]}var go={itemToString:FE,stateReducer:IE,getA11ySelectionMessage:NE,scrollIntoView:bE,environment:typeof window>"u"?{}:window};function Cn(e,t,n){n===void 0&&(n=n5);var r=e["default"+_d(t)];return r!==void 0?r:n[t]}function ys(e,t,n){n===void 0&&(n=n5);var r=e[t];if(r!==void 0)return r;var i=e["initial"+_d(t)];return i!==void 0?i:Cn(e,t,n)}function DE(e){var t=ys(e,"selectedItem"),n=ys(e,"isOpen"),r=ys(e,"highlightedIndex"),i=ys(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function po(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,a=t.highlightedIndex;return r.length===0?-1:i!==void 0&&a===i?i:o!==void 0?o:s?r.indexOf(s):n===0?-1:n<0?r.length-1:0}function RE(e,t,n,r){var i=I.useRef({isMouseDown:!1,isTouchMove:!1});return I.useEffect(function(){if(n?.addEventListener!=null){var o=function(){i.current.isMouseDown=!0},s=function(d){i.current.isMouseDown=!1,e&&!Tg(d.target,t.map(function(f){return f.current}),n)&&r()},a=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},u=function(d){e&&!i.current.isTouchMove&&!Tg(d.target,t.map(function(f){return f.current}),n,!1)&&r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",s),n.addEventListener("touchstart",a),n.addEventListener("touchmove",l),n.addEventListener("touchend",u),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",s),n.removeEventListener("touchstart",a),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",u)}}},[e,n]),i}var $E=function(){return Xx};function Ig(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,s=n.environment,a=eo(n,SE);I.useEffect(function(){r||ME(function(){return e(Be({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},a))},s.document)},t)}function BE(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,s=e.scrollIntoView,a=I.useRef(!0);return AE(function(){t<0||!n||!Object.keys(r.current).length||(a.current===!1?a.current=!0:s(i(t),o))},[t]),a}var HE=Xx;function Ng(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return Be({isOpen:!1,highlightedIndex:-1},i&&Be({selectedItem:e.items[t],isOpen:Cn(e,"isOpen"),highlightedIndex:Cn(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function VE(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:po(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:po(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:Cn(i,"highlightedIndex"),isOpen:Cn(i,"isOpen"),selectedItem:Cn(i,"selectedItem"),inputValue:Cn(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Be({},e,o)}K.array.isRequired,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.func,K.string,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});function zE(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===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.":""}Zd(Zd({},go),{getA11yStatusMessage:zE});var kd=0,Sd=1,Ed=2,Td=3,Id=4,Nd=5,Md=6,Ad=7,Od=8,sa=9,Pd=10,i5=11,o5=12,Fd=13,s5=14,a5=15,l5=16,u5=17,c5=18,Ld=19,d5=20,f5=21,Dd=22,h5=Object.freeze({__proto__:null,InputKeyDownArrowDown:kd,InputKeyDownArrowUp:Sd,InputKeyDownEscape:Ed,InputKeyDownHome:Td,InputKeyDownEnd:Id,InputKeyDownPageUp:Nd,InputKeyDownPageDown:Md,InputKeyDownEnter:Ad,InputChange:Od,InputBlur:sa,InputFocus:Pd,MenuMouseLeave:i5,ItemMouseMove:o5,ItemClick:Fd,ToggleButtonClick:s5,FunctionToggleMenu:a5,FunctionOpenMenu:l5,FunctionCloseMenu:u5,FunctionSetHighlightedIndex:c5,FunctionSelectItem:Ld,FunctionSetInputValue:d5,FunctionReset:f5,ControlledPropUpdatedSelectedItem:Dd});function WE(e){var t=DE(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),Be({},t,{inputValue:r})}K.array.isRequired,K.func,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.string,K.string,K.string,K.func,K.string,K.string,K.func,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});function jE(e,t,n){var r=I.useRef(),i=LE(e,t,n),o=i[0],s=i[1];return I.useEffect(function(){e5(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&s({type:Dd,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)},[o.selectedItem,n.selectedItem]),[Yu(o,n),s]}var UE=Be({},go,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:CE});function JE(e,t){var n,r=t.type,i=t.props,o=t.altKey,s;switch(r){case Fd:s={isOpen:Cn(i,"isOpen"),highlightedIndex:Cn(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case kd:e.isOpen?s={highlightedIndex:xs(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:s={highlightedIndex:o&&e.selectedItem==null?-1:po(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case Sd:e.isOpen?o?s=Ng(i,e.highlightedIndex):s={highlightedIndex:xs(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:s={highlightedIndex:po(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case Ad:s=Ng(i,e.highlightedIndex);break;case Ed:s=Be({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Nd:s={highlightedIndex:xs(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Md:s={highlightedIndex:xs(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Td:s={highlightedIndex:Ao(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case Id:s={highlightedIndex:Ao(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case sa:s=Be({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case Od:s={isOpen:!0,highlightedIndex:Cn(i,"highlightedIndex"),inputValue:t.inputValue};break;case Pd:s={isOpen:!0,highlightedIndex:po(i,e,0)};break;case Ld:s={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case Dd:s={inputValue:t.inputValue};break;default:return VE(e,t,h5)}return Be({},e,s)}var KE=["onMouseLeave","refKey","ref"],ZE=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],qE=["onClick","onPress","refKey","ref"],YE=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];g5.stateChangeTypes=h5;function g5(e){e===void 0&&(e={});var t=Be({},UE,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,o=t.scrollIntoView,s=t.environment,a=t.getA11yStatusMessage,l=t.getA11ySelectionMessage,u=t.itemToString,c=WE(t),d=jE(JE,c,t),f=d[0],h=d[1],g=f.isOpen,x=f.highlightedIndex,b=f.selectedItem,y=f.inputValue,m=I.useRef(null),p=I.useRef({}),v=I.useRef(null),k=I.useRef(null),C=I.useRef(!0),w=OE(t),S=I.useRef(),T=r5({state:f,props:t}),P=I.useCallback(function(z){return p.current[w.getItemId(z)]},[w]);Ig(a,[g,x,y,i],Be({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:u},f)),Ig(l,[b],Be({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:u},f));var F=BE({menuElement:m.current,highlightedIndex:x,isOpen:g,itemRefs:p,scrollIntoView:o,getItemNodeFromIndex:P});HE({isInitialMount:C.current}),I.useEffect(function(){var z=n||r||g;z&&v.current&&v.current.focus()},[]),I.useEffect(function(){C.current||(S.current=i.length)});var L=RE(g,[v,m,k],s,function(){h({type:sa,selectItem:!1})}),O=$E();I.useEffect(function(){return C.current=!1,function(){C.current=!0}},[]),I.useEffect(function(){var z;if(!g)p.current={};else if(((z=s.document)==null?void 0:z.activeElement)!==v.current){var U;v==null||(U=v.current)==null||U.focus()}},[g,s]);var B=I.useMemo(function(){return{ArrowDown:function(U){U.preventDefault(),h({type:kd,altKey:U.altKey,getItemNodeFromIndex:P})},ArrowUp:function(U){U.preventDefault(),h({type:Sd,altKey:U.altKey,getItemNodeFromIndex:P})},Home:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Td,getItemNodeFromIndex:P}))},End:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Id,getItemNodeFromIndex:P}))},Escape:function(U){var G=T.current.state;(G.isOpen||G.inputValue||G.selectedItem||G.highlightedIndex>-1)&&(U.preventDefault(),h({type:Ed}))},Enter:function(U){var G=T.current.state;!G.isOpen||U.which===229||(U.preventDefault(),h({type:Ad,getItemNodeFromIndex:P}))},PageUp:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Nd,getItemNodeFromIndex:P}))},PageDown:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Md,getItemNodeFromIndex:P}))}}},[h,T,P]),H=I.useCallback(function(z){return Be({id:w.labelId,htmlFor:w.inputId},z)},[w]),q=I.useCallback(function(z,U){var G,ee=z===void 0?{}:z,se=ee.onMouseLeave,me=ee.refKey,Pe=me===void 0?"ref":me,He=ee.ref,Ye=eo(ee,KE),Ge=U===void 0?{}:U;return Ge.suppressRefError,Be((G={},G[Pe]=ms(He,function(Qe){m.current=Qe}),G.id=w.menuId,G.role="listbox",G["aria-labelledby"]=Ye&&Ye["aria-label"]?void 0:""+w.labelId,G.onMouseLeave=On(se,function(){h({type:i5})}),G),Ye)},[h,O,w]),Z=I.useCallback(function(z){var U,G,ee=z===void 0?{}:z,se=ee.item,me=ee.index,Pe=ee.refKey,He=Pe===void 0?"ref":Pe,Ye=ee.ref,Ge=ee.onMouseMove,Qe=ee.onMouseDown,un=ee.onClick;ee.onPress;var bt=ee.disabled,Ft=eo(ee,ZE),st=T.current,cn=st.props,vt=st.state,Ce=PE(se,me,cn.items,"Pass either item or index to getItemProps!"),Ct=Ce[1],R="onClick",V=un,E=function(){Ct!==vt.highlightedIndex&&(F.current=!1,h({type:o5,index:Ct,disabled:bt}))},le=function(){h({type:Fd,index:Ct})},pe=function(Ht){return Ht.preventDefault()};return Be((U={},U[He]=ms(Ye,function(Ne){Ne&&(p.current[w.getItemId(Ct)]=Ne)}),U.disabled=bt,U.role="option",U["aria-selected"]=""+(Ct===vt.highlightedIndex),U.id=w.getItemId(Ct),U),!bt&&(G={},G[R]=On(V,le),G),{onMouseMove:On(Ge,E),onMouseDown:On(Qe,pe)},Ft)},[h,T,F,w]),Q=I.useCallback(function(z){var U,G=z===void 0?{}:z,ee=G.onClick;G.onPress;var se=G.refKey,me=se===void 0?"ref":se,Pe=G.ref,He=eo(G,qE),Ye=T.current.state,Ge=function(){h({type:s5})};return Be((U={},U[me]=ms(Pe,function(Qe){k.current=Qe}),U["aria-controls"]=w.menuId,U["aria-expanded"]=Ye.isOpen,U.id=w.toggleButtonId,U.tabIndex=-1,U),!He.disabled&&Be({},{onClick:On(ee,Ge)}),He)},[h,T,w]),X=I.useCallback(function(z,U){var G,ee=z===void 0?{}:z,se=ee.onKeyDown,me=ee.onChange,Pe=ee.onInput,He=ee.onFocus,Ye=ee.onBlur;ee.onChangeText;var Ge=ee.refKey,Qe=Ge===void 0?"ref":Ge,un=ee.ref,bt=eo(ee,YE),Ft=U===void 0?{}:U;Ft.suppressRefError;var st=T.current.state,cn=function(pe){var Ne=wE(pe);Ne&&B[Ne]&&B[Ne](pe)},vt=function(pe){h({type:Od,inputValue:pe.target.value})},Ce=function(pe){if(st.isOpen&&!L.current.isMouseDown){var Ne=pe.relatedTarget===null&&s.document.activeElement!==s.document.body;h({type:sa,selectItem:!Ne})}},Ct=function(){st.isOpen||h({type:Pd})},R="onChange",V={};if(!bt.disabled){var E;V=(E={},E[R]=On(me,Pe,vt),E.onKeyDown=On(se,cn),E.onBlur=On(Ye,Ce),E.onFocus=On(He,Ct),E)}return Be((G={},G[Qe]=ms(un,function(le){v.current=le}),G["aria-activedescendant"]=st.isOpen&&st.highlightedIndex>-1?w.getItemId(st.highlightedIndex):"",G["aria-autocomplete"]="list",G["aria-controls"]=w.menuId,G["aria-expanded"]=st.isOpen,G["aria-labelledby"]=bt&&bt["aria-label"]?void 0:""+w.labelId,G.autoComplete="off",G.id=w.inputId,G.role="combobox",G.value=st.inputValue,G),V,bt)},[O,T,w,B,h,L,s]),N=I.useCallback(function(){h({type:a5})},[h]),oe=I.useCallback(function(){h({type:u5})},[h]),ce=I.useCallback(function(){h({type:l5})},[h]),A=I.useCallback(function(z){h({type:c5,highlightedIndex:z})},[h]),fe=I.useCallback(function(z){h({type:Ld,selectedItem:z})},[h]),ge=I.useCallback(function(z){h({type:d5,inputValue:z})},[h]),ae=I.useCallback(function(){h({type:f5})},[h]);return{getItemProps:Z,getLabelProps:H,getMenuProps:q,getInputProps:X,getToggleButtonProps:Q,toggleMenu:N,openMenu:ce,closeMenu:oe,setHighlightedIndex:A,setInputValue:ge,selectItem:fe,reset:ae,highlightedIndex:x,isOpen:g,selectedItem:b,inputValue:y}}K.array,K.array,K.array,K.func,K.func,K.func,K.number,K.number,K.number,K.func,K.func,K.string,K.string,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});go.itemToString,go.stateReducer,go.environment;const Mg=20,p5=e=>e.suggestions.length>0?_.createElement(GE,{...e}):_.createElement("input",{className:Y.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),GE=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:o,setValue:s})=>{const[a,l]=_.useState(t.slice(0,Mg)),u=Ot(In),c=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:h,getInputProps:g,highlightedIndex:x,getItemProps:b,selectedItem:y}=g5({initialInputValue:o,onInputValueChange({inputValue:p=""}){s(r,p),p=p.toLowerCase()||"";const v=[];for(const k of t)if(k.toLowerCase().includes(p)&&(v.push(k),v.length>=Mg))break;l(v)},items:a,itemToString(p){return p??""}}),m=d&&a.length>0;return _.createElement("div",{className:Y.downshiftAutocompleteContainer},_.createElement("div",{"data-visible-dropdown":m,className:Y.downshiftInputWrapper},_.createElement(Iy,{name:r,control:n,render:({field:p})=>{const v=g();return _.createElement("input",{...v,name:p.name,placeholder:i,className:Y.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),c&&_.createElement("button",{"aria-label":"toggle menu",type:"button",...f()},u("arrow_drop_down"))),_.createElement("div",{className:Y.downshiftAutocompleteContainer},_.createElement("ul",{...h(),"data-visible":m},a.map((p,v)=>_.createElement("li",{"data-selected":y===p,"data-highlighted":x===v,key:`${p}${v}`,...b({item:p,index:v})},p)))))},XE=()=>{const[e,t,n,r]=rn(Gu,Or,Go,rr),i=_t(v5),o=_t(y5),s=Bt(),{register:a,handleSubmit:l,control:u,setValue:c,reset:d}=uc({values:t.type==="editing"?t.initialValues:{}});return t.type==="inactive"?null:_.createElement(fp,{open:!0,onOpenChange:f=>{f||(o(),d({src:"",title:"",altText:""}))}},_.createElement(pp,{container:n?.current},_.createElement(mp,{className:Y.dialogOverlay}),_.createElement(hp,{className:Y.dialogContent,onOpenAutoFocus:f=>{f.preventDefault()}},_.createElement(gp,null,s("uploadImage.dialogTitle","Upload an image")),_.createElement("form",{onSubmit:async f=>{f.preventDefault(),f.stopPropagation(),await l(i)(f),d({src:"",title:"",altText:""})},className:Y.multiFieldForm},r===null?_.createElement("input",{type:"hidden",accept:"image/*",...a("file")}):_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"file"},s("uploadImage.uploadInstructions","Upload an image from your device:")),_.createElement("input",{type:"file",accept:"image/*",...a("file")})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"src"},r!==null?s("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):s("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),_.createElement(p5,{register:a,initialInputValue:t.type==="editing"?t.initialValues.src??"":"",inputName:"src",suggestions:e,setValue:c,control:u,placeholder:s("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"alt"},s("uploadImage.alt","Alt:")),_.createElement("input",{type:"text",...a("altText"),className:Y.textInput})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"title"},s("uploadImage.title","Title:")),_.createElement("input",{type:"text",...a("title"),className:Y.textInput})),_.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},_.createElement("button",{type:"submit",title:s("dialogControls.save","Save"),"aria-label":s("dialogControls.save","Save"),className:ke(Y.primaryButton)},s("dialogControls.save","Save")),_.createElement(dc,{asChild:!0},_.createElement("button",{type:"reset",title:s("dialogControls.cancel","Cancel"),"aria-label":s("dialogControls.cancel","Cancel"),className:ke(Y.secondaryButton)},s("dialogControls.cancel","Cancel"))))))))};function Bl(e,t,n){return Math.min(Math.max(e,t),n)}const Fe={east:1,north:8,south:2,west:4};function QE({onResizeStart:e,onResizeEnd:t,imageRef:n,maxWidth:r,editor:i}){const o=I.useRef(null),s=I.useRef({priority:"",value:"default"}),a=I.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),l=i.getRootElement(),u=r||(l!==null?l.getBoundingClientRect().width-20:100),c=l!==null?l.getBoundingClientRect().height-20:100,d=100,f=100,h=m=>{const p=m===Fe.east||m===Fe.west,v=m===Fe.north||m===Fe.south,k=m&Fe.north&&m&Fe.west||m&Fe.south&&m&Fe.east,C=p?"ew":v?"ns":k?"nwse":"nesw";l!==null&&l.style.setProperty("cursor",`${C}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${C}-resize`,"important"),s.current.value=document.body.style.getPropertyValue("-webkit-user-select"),s.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},g=()=>{l!==null&&l.style.setProperty("cursor","text"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",s.current.value,s.current.priority))},x=(m,p)=>{if(!i.isEditable())return;const v=n.current,k=o.current;if(v!==null&&k!==null){m.preventDefault();const{width:C,height:w}=v.getBoundingClientRect(),S=a.current;S.startWidth=C,S.startHeight=w,S.ratio=C/w,S.currentWidth=C,S.currentHeight=w,S.startX=m.clientX,S.startY=m.clientY,S.isResizing=!0,S.direction=p,h(p),e(),k.classList.add(Y.imageControlWrapperResizing),v.style.height=`${w}px`,v.style.width=`${C}px`,document.addEventListener("pointermove",b),document.addEventListener("pointerup",y)}},b=m=>{const p=n.current,v=a.current,k=v.direction&(Fe.east|Fe.west),C=v.direction&(Fe.south|Fe.north);if(p!==null&&v.isResizing)if(k&&C){let w=Math.floor(v.startX-m.clientX);w=v.direction&Fe.east?-w:w;const S=Bl(v.startWidth+w,d,u),T=S/v.ratio;p.style.width=`${S}px`,p.style.height=`${T}px`,v.currentHeight=T,v.currentWidth=S}else if(C){let w=Math.floor(v.startY-m.clientY);w=v.direction&Fe.south?-w:w;const S=Bl(v.startHeight+w,f,c);p.style.height=`${S}px`,v.currentHeight=S}else{let w=Math.floor(v.startX-m.clientX);w=v.direction&Fe.east?-w:w;const S=Bl(v.startWidth+w,d,u);p.style.width=`${S}px`,v.currentWidth=S}},y=()=>{const m=n.current,p=a.current,v=o.current;if(m!==null&&v!==null&&p.isResizing){const k=p.currentWidth,C=p.currentHeight;p.startWidth=0,p.startHeight=0,p.ratio=0,p.startX=0,p.startY=0,p.currentWidth=0,p.currentHeight=0,p.isResizing=!1,v.classList.remove(Y.imageControlWrapperResizing),g(),t(k,C),document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",y)}};return I.createElement("div",{ref:o},I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerN),onPointerDown:m=>{x(m,Fe.north)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerNe),onPointerDown:m=>{x(m,Fe.north|Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerE),onPointerDown:m=>{x(m,Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerSe),onPointerDown:m=>{x(m,Fe.south|Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerS),onPointerDown:m=>{x(m,Fe.south)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerSw),onPointerDown:m=>{x(m,Fe.south|Fe.west)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerW),onPointerDown:m=>{x(m,Fe.west)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerNw),onPointerDown:m=>{x(m,Fe.north|Fe.west)}}))}const eT="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
|
|
86
|
+
*/var wg;function g4(){if(wg)return Me;wg=1;var e=60103,t=60106,n=60107,r=60108,i=60114,o=60109,s=60110,a=60112,l=60113,u=60120,c=60115,d=60116,f=60121,h=60122,g=60117,x=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;e=y("react.element"),t=y("react.portal"),n=y("react.fragment"),r=y("react.strict_mode"),i=y("react.profiler"),o=y("react.provider"),s=y("react.context"),a=y("react.forward_ref"),l=y("react.suspense"),u=y("react.suspense_list"),c=y("react.memo"),d=y("react.lazy"),f=y("react.block"),h=y("react.server.block"),g=y("react.fundamental"),x=y("react.debug_trace_mode"),b=y("react.legacy_hidden")}function m(O){if(typeof O=="object"&&O!==null){var B=O.$$typeof;switch(B){case e:switch(O=O.type,O){case n:case i:case r:case l:case u:return O;default:switch(O=O&&O.$$typeof,O){case s:case a:case d:case c:case o:return O;default:return B}}case t:return B}}}var p=o,v=e,k=a,C=n,w=d,S=c,T=t,P=i,F=r,L=l;return Me.ContextConsumer=s,Me.ContextProvider=p,Me.Element=v,Me.ForwardRef=k,Me.Fragment=C,Me.Lazy=w,Me.Memo=S,Me.Portal=T,Me.Profiler=P,Me.StrictMode=F,Me.Suspense=L,Me.isAsyncMode=function(){return!1},Me.isConcurrentMode=function(){return!1},Me.isContextConsumer=function(O){return m(O)===s},Me.isContextProvider=function(O){return m(O)===o},Me.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===e},Me.isForwardRef=function(O){return m(O)===a},Me.isFragment=function(O){return m(O)===n},Me.isLazy=function(O){return m(O)===d},Me.isMemo=function(O){return m(O)===c},Me.isPortal=function(O){return m(O)===t},Me.isProfiler=function(O){return m(O)===i},Me.isStrictMode=function(O){return m(O)===r},Me.isSuspense=function(O){return m(O)===l},Me.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===n||O===i||O===x||O===r||O===l||O===u||O===b||typeof O=="object"&&O!==null&&(O.$$typeof===d||O.$$typeof===c||O.$$typeof===o||O.$$typeof===s||O.$$typeof===a||O.$$typeof===g||O.$$typeof===f||O[0]===h)},Me.typeOf=m,Me}var _g;function p4(){return _g||(_g=1,Rl.exports=g4()),Rl.exports}p4();let kg=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Sg=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$l=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Sg(n.overflowY,t)||Sg(n.overflowX,t)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},ps=(e,t,n,r,i,o,s,a)=>o<e&&s>t||o>e&&s<t?0:o<=e&&a<=n||s>=t&&a>=n?o-e-r:s>t&&a<n||o<e&&a>n?s-t+i:0,m4=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var x4=(e,t)=>{var n,r,i,o,s,a;if(typeof document>"u")return[];let{inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d=typeof u=="function"?u:L=>L!==u;if(!kg(e))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,h=[],g=e;for(;kg(g)&&d(g);){if(g=m4(g),g===f){h.push(g);break}g!=null&&g===document.body&&$l(g)&&!$l(document.documentElement)||g!=null&&$l(g,c)&&h.push(g)}let x=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,y=(s=window.scrollX)!=null?s:pageXOffset,m=(a=window.scrollY)!=null?a:pageYOffset,{height:p,width:v,top:k,right:C,bottom:w,left:S}=e.getBoundingClientRect(),T=k,P=l==="center"?S+v/2:l==="end"?C:S,F=[];for(let L=0;L<h.length;L++){let O=h[L],{height:B,width:H,top:q,right:Z,bottom:Q,left:X}=O.getBoundingClientRect();if(k>=0&&S>=0&&w<=b&&C<=x&&k>=q&&w<=Q&&S>=X&&C<=Z)return F;let N=getComputedStyle(O),oe=parseInt(N.borderLeftWidth,10),ce=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),fe=parseInt(N.borderBottomWidth,10),ge=0,ae=0,z="offsetWidth"in O?O.offsetWidth-O.clientWidth-oe-A:0,U="offsetHeight"in O?O.offsetHeight-O.clientHeight-ce-fe:0,G="offsetWidth"in O?O.offsetWidth===0?0:H/O.offsetWidth:0,ee="offsetHeight"in O?O.offsetHeight===0?0:B/O.offsetHeight:0;if(f===O)ge=ps(m,m+b,b,ce,fe,m+T,m+T+p,p),ae=l==="start"?P:l==="center"?P-x/2:l==="end"?P-x:ps(y,y+x,x,oe,A,y+P,y+P+v,v),ge=Math.max(0,ge+m),ae=Math.max(0,ae+y);else{ge=ps(q,Q,B,ce,fe+U,T,T+p,p),ae=l==="start"?P-X-oe:l==="center"?P-(X+H/2)+z/2:l==="end"?P-Z+A+z:ps(X,Z,H,oe,A+z,P,P+v,v);let{scrollLeft:se,scrollTop:me}=O;ge=Math.max(0,Math.min(me+ge/ee,O.scrollHeight-B/ee+U)),ae=Math.max(0,Math.min(se+ae/G,O.scrollWidth-H/G+z)),T+=me-ge,P+=se-ae}F.push({el:O,top:ge,left:ae})}return F},y4=0;function Xx(){}function b4(e,t){if(e){var n=x4(e,{boundary:t});n.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scrollTop=o,i.scrollLeft=s})}}function Eg(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function Qx(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,s)},t)}return i.cancel=r,i}function On(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return a&&a.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ms(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function v4(){return String(y4++)}function C4(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Yu(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=e5(t,r)?t[r]:e[r],n},{})}function e5(e,t){return e[t]!==void 0}function w4(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function xs(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:o+1);var s=t+e;s<0?s=i?o:0:s>o&&(s=i?0:o);var a=Ao(e,s,n,r,i);return a===-1?t>=n?-1:t:a}function Ao(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var s=t+1;s<n;s++)if(!r(s).hasAttribute("disabled"))return s}else for(var a=t-1;a>=0;a--)if(!r(a).hasAttribute("disabled"))return a;return i?e>0?Ao(1,0,n,r,!1):Ao(-1,n-1,n,r,!1):-1}function Tg(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(Eg(i,e,n)||r&&Eg(i,n.document.activeElement,n))})}var _4=Qx(function(e){t5(e).textContent=""},500);function k4(e,t){var n=t5(t);e&&(n.textContent=e,_4(t))}function t5(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var S4=["isInitialMount","highlightedIndex","items","environment"],n5={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function E4(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(s){T4(s,e,t,n),n[s]!==t[s]&&(o[s]=n[s])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Be({type:i},o))}function T4(e,t,n,r){var i=t.props,o=t.type,s="on"+_d(e)+"Change";i[s]&&r[e]!==void 0&&r[e]!==n[e]&&i[s](Be({type:o},r))}function I4(e,t){return t.changes}function N4(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var M4=Qx(function(e,t){k4(e(),t)},200),A4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect;function O4(e){var t=e.id,n=t===void 0?"downshift-"+v4():t,r=e.labelId,i=e.menuId,o=e.getItemId,s=e.toggleButtonId,a=e.inputId,l=I.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(u){return n+"-item-"+u},toggleButtonId:s||n+"-toggle-button",inputId:a||n+"-input"});return l.current}function P4(e,t,n,r){var i,o;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],o=t}else o=t===void 0?n.indexOf(e):t,i=e;return[i,o]}function F4(e){return e?String(e):""}function _d(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function r5(e){var t=I.useRef(e);return t.current=e,t}function L4(e,t,n){var r=I.useRef(),i=I.useRef(),o=I.useCallback(function(f,h){i.current=h,f=Yu(f,h.props);var g=e(f,h),x=h.props.stateReducer(f,Be({},h,{changes:g}));return x},[e]),s=I.useReducer(o,t),a=s[0],l=s[1],u=r5(n),c=I.useCallback(function(f){return l(Be({props:u.current},f))},[u]),d=i.current;return I.useEffect(function(){d&&r.current&&r.current!==a&&E4(d,Yu(r.current,d.props),a),r.current=a},[a,n,d]),[a,c]}var go={itemToString:F4,stateReducer:I4,getA11ySelectionMessage:N4,scrollIntoView:b4,environment:typeof window>"u"?{}:window};function Cn(e,t,n){n===void 0&&(n=n5);var r=e["default"+_d(t)];return r!==void 0?r:n[t]}function ys(e,t,n){n===void 0&&(n=n5);var r=e[t];if(r!==void 0)return r;var i=e["initial"+_d(t)];return i!==void 0?i:Cn(e,t,n)}function D4(e){var t=ys(e,"selectedItem"),n=ys(e,"isOpen"),r=ys(e,"highlightedIndex"),i=ys(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function po(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,a=t.highlightedIndex;return r.length===0?-1:i!==void 0&&a===i?i:o!==void 0?o:s?r.indexOf(s):n===0?-1:n<0?r.length-1:0}function R4(e,t,n,r){var i=I.useRef({isMouseDown:!1,isTouchMove:!1});return I.useEffect(function(){if(n?.addEventListener!=null){var o=function(){i.current.isMouseDown=!0},s=function(d){i.current.isMouseDown=!1,e&&!Tg(d.target,t.map(function(f){return f.current}),n)&&r()},a=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},u=function(d){e&&!i.current.isTouchMove&&!Tg(d.target,t.map(function(f){return f.current}),n,!1)&&r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",s),n.addEventListener("touchstart",a),n.addEventListener("touchmove",l),n.addEventListener("touchend",u),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",s),n.removeEventListener("touchstart",a),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",u)}}},[e,n]),i}var $4=function(){return Xx};function Ig(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,s=n.environment,a=eo(n,S4);I.useEffect(function(){r||M4(function(){return e(Be({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},a))},s.document)},t)}function B4(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,s=e.scrollIntoView,a=I.useRef(!0);return A4(function(){t<0||!n||!Object.keys(r.current).length||(a.current===!1?a.current=!0:s(i(t),o))},[t]),a}var H4=Xx;function Ng(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return Be({isOpen:!1,highlightedIndex:-1},i&&Be({selectedItem:e.items[t],isOpen:Cn(e,"isOpen"),highlightedIndex:Cn(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function V4(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:po(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:po(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:Cn(i,"highlightedIndex"),isOpen:Cn(i,"isOpen"),selectedItem:Cn(i,"selectedItem"),inputValue:Cn(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Be({},e,o)}K.array.isRequired,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.func,K.string,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});function z4(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===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.":""}Zd(Zd({},go),{getA11yStatusMessage:z4});var kd=0,Sd=1,Ed=2,Td=3,Id=4,Nd=5,Md=6,Ad=7,Od=8,sa=9,Pd=10,i5=11,o5=12,Fd=13,s5=14,a5=15,l5=16,u5=17,c5=18,Ld=19,d5=20,f5=21,Dd=22,h5=Object.freeze({__proto__:null,InputKeyDownArrowDown:kd,InputKeyDownArrowUp:Sd,InputKeyDownEscape:Ed,InputKeyDownHome:Td,InputKeyDownEnd:Id,InputKeyDownPageUp:Nd,InputKeyDownPageDown:Md,InputKeyDownEnter:Ad,InputChange:Od,InputBlur:sa,InputFocus:Pd,MenuMouseLeave:i5,ItemMouseMove:o5,ItemClick:Fd,ToggleButtonClick:s5,FunctionToggleMenu:a5,FunctionOpenMenu:l5,FunctionCloseMenu:u5,FunctionSetHighlightedIndex:c5,FunctionSelectItem:Ld,FunctionSetInputValue:d5,FunctionReset:f5,ControlledPropUpdatedSelectedItem:Dd});function W4(e){var t=D4(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),Be({},t,{inputValue:r})}K.array.isRequired,K.func,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.string,K.string,K.string,K.func,K.string,K.string,K.func,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});function j4(e,t,n){var r=I.useRef(),i=L4(e,t,n),o=i[0],s=i[1];return I.useEffect(function(){e5(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&s({type:Dd,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)},[o.selectedItem,n.selectedItem]),[Yu(o,n),s]}var U4=Be({},go,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:C4});function J4(e,t){var n,r=t.type,i=t.props,o=t.altKey,s;switch(r){case Fd:s={isOpen:Cn(i,"isOpen"),highlightedIndex:Cn(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case kd:e.isOpen?s={highlightedIndex:xs(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:s={highlightedIndex:o&&e.selectedItem==null?-1:po(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case Sd:e.isOpen?o?s=Ng(i,e.highlightedIndex):s={highlightedIndex:xs(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:s={highlightedIndex:po(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case Ad:s=Ng(i,e.highlightedIndex);break;case Ed:s=Be({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Nd:s={highlightedIndex:xs(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Md:s={highlightedIndex:xs(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Td:s={highlightedIndex:Ao(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case Id:s={highlightedIndex:Ao(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case sa:s=Be({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case Od:s={isOpen:!0,highlightedIndex:Cn(i,"highlightedIndex"),inputValue:t.inputValue};break;case Pd:s={isOpen:!0,highlightedIndex:po(i,e,0)};break;case Ld:s={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case Dd:s={inputValue:t.inputValue};break;default:return V4(e,t,h5)}return Be({},e,s)}var K4=["onMouseLeave","refKey","ref"],Z4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],q4=["onClick","onPress","refKey","ref"],Y4=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];g5.stateChangeTypes=h5;function g5(e){e===void 0&&(e={});var t=Be({},U4,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,o=t.scrollIntoView,s=t.environment,a=t.getA11yStatusMessage,l=t.getA11ySelectionMessage,u=t.itemToString,c=W4(t),d=j4(J4,c,t),f=d[0],h=d[1],g=f.isOpen,x=f.highlightedIndex,b=f.selectedItem,y=f.inputValue,m=I.useRef(null),p=I.useRef({}),v=I.useRef(null),k=I.useRef(null),C=I.useRef(!0),w=O4(t),S=I.useRef(),T=r5({state:f,props:t}),P=I.useCallback(function(z){return p.current[w.getItemId(z)]},[w]);Ig(a,[g,x,y,i],Be({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:u},f)),Ig(l,[b],Be({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:u},f));var F=B4({menuElement:m.current,highlightedIndex:x,isOpen:g,itemRefs:p,scrollIntoView:o,getItemNodeFromIndex:P});H4({isInitialMount:C.current}),I.useEffect(function(){var z=n||r||g;z&&v.current&&v.current.focus()},[]),I.useEffect(function(){C.current||(S.current=i.length)});var L=R4(g,[v,m,k],s,function(){h({type:sa,selectItem:!1})}),O=$4();I.useEffect(function(){return C.current=!1,function(){C.current=!0}},[]),I.useEffect(function(){var z;if(!g)p.current={};else if(((z=s.document)==null?void 0:z.activeElement)!==v.current){var U;v==null||(U=v.current)==null||U.focus()}},[g,s]);var B=I.useMemo(function(){return{ArrowDown:function(U){U.preventDefault(),h({type:kd,altKey:U.altKey,getItemNodeFromIndex:P})},ArrowUp:function(U){U.preventDefault(),h({type:Sd,altKey:U.altKey,getItemNodeFromIndex:P})},Home:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Td,getItemNodeFromIndex:P}))},End:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Id,getItemNodeFromIndex:P}))},Escape:function(U){var G=T.current.state;(G.isOpen||G.inputValue||G.selectedItem||G.highlightedIndex>-1)&&(U.preventDefault(),h({type:Ed}))},Enter:function(U){var G=T.current.state;!G.isOpen||U.which===229||(U.preventDefault(),h({type:Ad,getItemNodeFromIndex:P}))},PageUp:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Nd,getItemNodeFromIndex:P}))},PageDown:function(U){T.current.state.isOpen&&(U.preventDefault(),h({type:Md,getItemNodeFromIndex:P}))}}},[h,T,P]),H=I.useCallback(function(z){return Be({id:w.labelId,htmlFor:w.inputId},z)},[w]),q=I.useCallback(function(z,U){var G,ee=z===void 0?{}:z,se=ee.onMouseLeave,me=ee.refKey,Pe=me===void 0?"ref":me,He=ee.ref,Ye=eo(ee,K4),Ge=U===void 0?{}:U;return Ge.suppressRefError,Be((G={},G[Pe]=ms(He,function(Qe){m.current=Qe}),G.id=w.menuId,G.role="listbox",G["aria-labelledby"]=Ye&&Ye["aria-label"]?void 0:""+w.labelId,G.onMouseLeave=On(se,function(){h({type:i5})}),G),Ye)},[h,O,w]),Z=I.useCallback(function(z){var U,G,ee=z===void 0?{}:z,se=ee.item,me=ee.index,Pe=ee.refKey,He=Pe===void 0?"ref":Pe,Ye=ee.ref,Ge=ee.onMouseMove,Qe=ee.onMouseDown,un=ee.onClick;ee.onPress;var bt=ee.disabled,Ft=eo(ee,Z4),st=T.current,cn=st.props,vt=st.state,Ce=P4(se,me,cn.items,"Pass either item or index to getItemProps!"),Ct=Ce[1],R="onClick",V=un,E=function(){Ct!==vt.highlightedIndex&&(F.current=!1,h({type:o5,index:Ct,disabled:bt}))},le=function(){h({type:Fd,index:Ct})},pe=function(Ht){return Ht.preventDefault()};return Be((U={},U[He]=ms(Ye,function(Ne){Ne&&(p.current[w.getItemId(Ct)]=Ne)}),U.disabled=bt,U.role="option",U["aria-selected"]=""+(Ct===vt.highlightedIndex),U.id=w.getItemId(Ct),U),!bt&&(G={},G[R]=On(V,le),G),{onMouseMove:On(Ge,E),onMouseDown:On(Qe,pe)},Ft)},[h,T,F,w]),Q=I.useCallback(function(z){var U,G=z===void 0?{}:z,ee=G.onClick;G.onPress;var se=G.refKey,me=se===void 0?"ref":se,Pe=G.ref,He=eo(G,q4),Ye=T.current.state,Ge=function(){h({type:s5})};return Be((U={},U[me]=ms(Pe,function(Qe){k.current=Qe}),U["aria-controls"]=w.menuId,U["aria-expanded"]=Ye.isOpen,U.id=w.toggleButtonId,U.tabIndex=-1,U),!He.disabled&&Be({},{onClick:On(ee,Ge)}),He)},[h,T,w]),X=I.useCallback(function(z,U){var G,ee=z===void 0?{}:z,se=ee.onKeyDown,me=ee.onChange,Pe=ee.onInput,He=ee.onFocus,Ye=ee.onBlur;ee.onChangeText;var Ge=ee.refKey,Qe=Ge===void 0?"ref":Ge,un=ee.ref,bt=eo(ee,Y4),Ft=U===void 0?{}:U;Ft.suppressRefError;var st=T.current.state,cn=function(pe){var Ne=w4(pe);Ne&&B[Ne]&&B[Ne](pe)},vt=function(pe){h({type:Od,inputValue:pe.target.value})},Ce=function(pe){if(st.isOpen&&!L.current.isMouseDown){var Ne=pe.relatedTarget===null&&s.document.activeElement!==s.document.body;h({type:sa,selectItem:!Ne})}},Ct=function(){st.isOpen||h({type:Pd})},R="onChange",V={};if(!bt.disabled){var E;V=(E={},E[R]=On(me,Pe,vt),E.onKeyDown=On(se,cn),E.onBlur=On(Ye,Ce),E.onFocus=On(He,Ct),E)}return Be((G={},G[Qe]=ms(un,function(le){v.current=le}),G["aria-activedescendant"]=st.isOpen&&st.highlightedIndex>-1?w.getItemId(st.highlightedIndex):"",G["aria-autocomplete"]="list",G["aria-controls"]=w.menuId,G["aria-expanded"]=st.isOpen,G["aria-labelledby"]=bt&&bt["aria-label"]?void 0:""+w.labelId,G.autoComplete="off",G.id=w.inputId,G.role="combobox",G.value=st.inputValue,G),V,bt)},[O,T,w,B,h,L,s]),N=I.useCallback(function(){h({type:a5})},[h]),oe=I.useCallback(function(){h({type:u5})},[h]),ce=I.useCallback(function(){h({type:l5})},[h]),A=I.useCallback(function(z){h({type:c5,highlightedIndex:z})},[h]),fe=I.useCallback(function(z){h({type:Ld,selectedItem:z})},[h]),ge=I.useCallback(function(z){h({type:d5,inputValue:z})},[h]),ae=I.useCallback(function(){h({type:f5})},[h]);return{getItemProps:Z,getLabelProps:H,getMenuProps:q,getInputProps:X,getToggleButtonProps:Q,toggleMenu:N,openMenu:ce,closeMenu:oe,setHighlightedIndex:A,setInputValue:ge,selectItem:fe,reset:ae,highlightedIndex:x,isOpen:g,selectedItem:b,inputValue:y}}K.array,K.array,K.array,K.func,K.func,K.func,K.number,K.number,K.number,K.func,K.func,K.string,K.string,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});go.itemToString,go.stateReducer,go.environment;const Mg=20,p5=e=>e.suggestions.length>0?_.createElement(G4,{...e}):_.createElement("input",{className:Y.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),G4=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:o,setValue:s})=>{const[a,l]=_.useState(t.slice(0,Mg)),u=Ot(In),c=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:h,getInputProps:g,highlightedIndex:x,getItemProps:b,selectedItem:y}=g5({initialInputValue:o,onInputValueChange({inputValue:p=""}){s(r,p),p=p.toLowerCase()||"";const v=[];for(const k of t)if(k.toLowerCase().includes(p)&&(v.push(k),v.length>=Mg))break;l(v)},items:a,itemToString(p){return p??""}}),m=d&&a.length>0;return _.createElement("div",{className:Y.downshiftAutocompleteContainer},_.createElement("div",{"data-visible-dropdown":m,className:Y.downshiftInputWrapper},_.createElement(Iy,{name:r,control:n,render:({field:p})=>{const v=g();return _.createElement("input",{...v,name:p.name,placeholder:i,className:Y.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),c&&_.createElement("button",{"aria-label":"toggle menu",type:"button",...f()},u("arrow_drop_down"))),_.createElement("div",{className:Y.downshiftAutocompleteContainer},_.createElement("ul",{...h(),"data-visible":m},a.map((p,v)=>_.createElement("li",{"data-selected":y===p,"data-highlighted":x===v,key:`${p}${v}`,...b({item:p,index:v})},p)))))},X4=()=>{const[e,t,n,r]=rn(Gu,Or,Go,rr),i=_t(v5),o=_t(y5),s=Bt(),{register:a,handleSubmit:l,control:u,setValue:c,reset:d}=uc({values:t.type==="editing"?t.initialValues:{}});return t.type==="inactive"?null:_.createElement(fp,{open:!0,onOpenChange:f=>{f||(o(),d({src:"",title:"",altText:""}))}},_.createElement(pp,{container:n?.current},_.createElement(mp,{className:Y.dialogOverlay}),_.createElement(hp,{className:Y.dialogContent,onOpenAutoFocus:f=>{f.preventDefault()}},_.createElement(gp,null,s("uploadImage.dialogTitle","Upload an image")),_.createElement("form",{onSubmit:async f=>{f.preventDefault(),f.stopPropagation(),await l(i)(f),d({src:"",title:"",altText:""})},className:Y.multiFieldForm},r===null?_.createElement("input",{type:"hidden",accept:"image/*",...a("file")}):_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"file"},s("uploadImage.uploadInstructions","Upload an image from your device:")),_.createElement("input",{type:"file",accept:"image/*",...a("file")})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"src"},r!==null?s("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):s("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),_.createElement(p5,{register:a,initialInputValue:t.type==="editing"?t.initialValues.src??"":"",inputName:"src",suggestions:e,setValue:c,control:u,placeholder:s("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"alt"},s("uploadImage.alt","Alt:")),_.createElement("input",{type:"text",...a("altText"),className:Y.textInput})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"title"},s("uploadImage.title","Title:")),_.createElement("input",{type:"text",...a("title"),className:Y.textInput})),_.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},_.createElement("button",{type:"submit",title:s("dialogControls.save","Save"),"aria-label":s("dialogControls.save","Save"),className:ke(Y.primaryButton)},s("dialogControls.save","Save")),_.createElement(dc,{asChild:!0},_.createElement("button",{type:"reset",title:s("dialogControls.cancel","Cancel"),"aria-label":s("dialogControls.cancel","Cancel"),className:ke(Y.secondaryButton)},s("dialogControls.cancel","Cancel"))))))))};function Bl(e,t,n){return Math.min(Math.max(e,t),n)}const Fe={east:1,north:8,south:2,west:4};function Q4({onResizeStart:e,onResizeEnd:t,imageRef:n,maxWidth:r,editor:i}){const o=I.useRef(null),s=I.useRef({priority:"",value:"default"}),a=I.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),l=i.getRootElement(),u=r||(l!==null?l.getBoundingClientRect().width-20:100),c=l!==null?l.getBoundingClientRect().height-20:100,d=100,f=100,h=m=>{const p=m===Fe.east||m===Fe.west,v=m===Fe.north||m===Fe.south,k=m&Fe.north&&m&Fe.west||m&Fe.south&&m&Fe.east,C=p?"ew":v?"ns":k?"nwse":"nesw";l!==null&&l.style.setProperty("cursor",`${C}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${C}-resize`,"important"),s.current.value=document.body.style.getPropertyValue("-webkit-user-select"),s.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},g=()=>{l!==null&&l.style.setProperty("cursor","text"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",s.current.value,s.current.priority))},x=(m,p)=>{if(!i.isEditable())return;const v=n.current,k=o.current;if(v!==null&&k!==null){m.preventDefault();const{width:C,height:w}=v.getBoundingClientRect(),S=a.current;S.startWidth=C,S.startHeight=w,S.ratio=C/w,S.currentWidth=C,S.currentHeight=w,S.startX=m.clientX,S.startY=m.clientY,S.isResizing=!0,S.direction=p,h(p),e(),k.classList.add(Y.imageControlWrapperResizing),v.style.height=`${w}px`,v.style.width=`${C}px`,document.addEventListener("pointermove",b),document.addEventListener("pointerup",y)}},b=m=>{const p=n.current,v=a.current,k=v.direction&(Fe.east|Fe.west),C=v.direction&(Fe.south|Fe.north);if(p!==null&&v.isResizing)if(k&&C){let w=Math.floor(v.startX-m.clientX);w=v.direction&Fe.east?-w:w;const S=Bl(v.startWidth+w,d,u),T=S/v.ratio;p.style.width=`${S}px`,p.style.height=`${T}px`,v.currentHeight=T,v.currentWidth=S}else if(C){let w=Math.floor(v.startY-m.clientY);w=v.direction&Fe.south?-w:w;const S=Bl(v.startHeight+w,f,c);p.style.height=`${S}px`,v.currentHeight=S}else{let w=Math.floor(v.startX-m.clientX);w=v.direction&Fe.east?-w:w;const S=Bl(v.startWidth+w,d,u);p.style.width=`${S}px`,v.currentWidth=S}},y=()=>{const m=n.current,p=a.current,v=o.current;if(m!==null&&v!==null&&p.isResizing){const k=p.currentWidth,C=p.currentHeight;p.startWidth=0,p.startHeight=0,p.ratio=0,p.startX=0,p.startY=0,p.currentWidth=0,p.currentHeight=0,p.isResizing=!1,v.classList.remove(Y.imageControlWrapperResizing),g(),t(k,C),document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",y)}};return I.createElement("div",{ref:o},I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerN),onPointerDown:m=>{x(m,Fe.north)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerNe),onPointerDown:m=>{x(m,Fe.north|Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerE),onPointerDown:m=>{x(m,Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerSe),onPointerDown:m=>{x(m,Fe.south|Fe.east)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerS),onPointerDown:m=>{x(m,Fe.south)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerSw),onPointerDown:m=>{x(m,Fe.south|Fe.west)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerW),onPointerDown:m=>{x(m,Fe.west)}}),I.createElement("div",{className:ke(Y.imageResizer,Y.imageResizerNw),onPointerDown:m=>{x(m,Fe.north|Fe.west)}}))}const eT="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
|
|
87
87
|
<svg id="imgLoadError" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
|
88
88
|
<rect x="0" y="0" width="100" height="100" fill="none" stroke="red" stroke-width="4" stroke-dasharray="4" />
|
|
89
89
|
<text x="50" y="55" text-anchor="middle" font-size="20" fill="red">⚠️</text>
|
|
90
90
|
</svg>
|
|
91
|
-
`),tT={__cache:{},read(e){if(this.__cache[e]||(this.__cache[e]=new Promise(t=>{const n=new Image;n.onerror=()=>{this.__cache[e]=eT,t()},n.onload=()=>{this.__cache[e]=e,t()},n.src=e})),this.__cache[e]instanceof Promise)throw this.__cache[e];return this.__cache[e]}};function nT({title:e,alt:t,className:n,imageRef:r,src:i,width:o,height:s}){return _.createElement("img",{className:n??void 0,alt:t,src:tT.read(i),title:e,ref:r,draggable:"false",width:o,height:s})}function rT({src:e,title:t,alt:n,nodeKey:r,width:i,height:o,rest:s}){const[a,l,u,c,d]=rn(ec,Xu,Qu,nn,tc),f=_.useRef(null),h=_.useRef(null),[g,x,b]=fx(r),[y]=yt(),[m,p]=_.useState(null),v=_.useRef(null),[k,C]=_.useState(!1),[w,S]=_.useState(null),[T,P]=_.useState(null),F=_.useCallback(X=>{if(g&&et(j())){X.preventDefault();const oe=ze(r);aa(oe)&&oe.remove()}return!1},[g,r]),L=_.useCallback(X=>{const N=j(),oe=h.current;return g&&et(N)&&N.getNodes().length===1&&oe!==null&&oe!==document.activeElement?(X.preventDefault(),oe.focus(),!0):!1},[g]),O=_.useCallback(X=>h.current===X.target?(Xe(null),y.update(()=>{x(!0);const N=y.getRootElement();N!==null&&N.focus()}),!0):!1,[y,x]);_.useEffect(()=>{u?(async()=>{T||P(e);const N=await u(e);S(N)})().catch(N=>{console.error(N)}):S(e)},[e,u,T]),_.useEffect(()=>{let X=!0;const N=Mt(y.registerUpdateListener(({editorState:oe})=>{X&&p(oe.read(()=>j()))}),y.registerCommand(xa,(oe,ce)=>(v.current=ce,!1),De),y.registerCommand(ya,oe=>{const ce=oe;return k?!0:ce.target===f.current?(ce.shiftKey?x(!g):(b(),x(!0)),!0):!1},De),y.registerCommand(_a,oe=>oe.target===f.current?(oe.preventDefault(),!0):!1,De),y.registerCommand(wa,F,De),y.registerCommand(Ca,F,De),y.registerCommand(Eo,L,De),y.registerCommand(Bo,O,De));return()=>{X=!1,N()}},[b,y,k,g,r,F,L,O,x]);const B=(X,N)=>{setTimeout(()=>{C(!1)},200),y.update(()=>{const oe=ze(r);aa(oe)&&oe.setWidthAndHeight(X,N)})},H=()=>{C(!0)},q=et(m),Z=g,Q=_.useMemo(()=>{if(s.length===0)return null;const X=s.find(N=>N.type==="mdxJsxAttribute"&&(N.name==="class"||N.name==="className"));return X?X.value:null},[s]);return w!==null?_.createElement(_.Suspense,{fallback:a?_.createElement(a,null):null},_.createElement("div",{className:Y.imageWrapper,"data-editor-block-type":"image"},_.createElement("div",{draggable:q},_.createElement(nT,{width:i,height:o,className:ke({[Y.focusedImage]:Z},Q),src:w,title:t??"",alt:n??"",imageRef:f})),q&&Z&&!l&&_.createElement(QE,{editor:y,imageRef:f,onResizeStart:H,onResizeEnd:B}),c||_.createElement(d,{nodeKey:r,imageSource:w,initialImagePath:T,title:t??"",alt:n??""}))):null}var iT=Object.defineProperty,oT=(e,t,n)=>t in e?iT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ni=(e,t,n)=>(oT(e,typeof t!="symbol"?t+"":t,n),n);function sT(e){if(e instanceof HTMLImageElement){const{alt:t,src:n,title:r,width:i,height:o}=e;return{node:Yr({altText:t,src:n,title:r,width:i,height:o})}}return null}class es extends jo{constructor(t,n,r,i,o,s,a){super(a),ni(this,"__src"),ni(this,"__altText"),ni(this,"__title"),ni(this,"__width"),ni(this,"__height"),ni(this,"__rest"),this.__src=t,this.__title=r,this.__altText=n,this.__width=i||"inherit",this.__height=o||"inherit",this.__rest=s??[]}static getType(){return"image"}static clone(t){return new es(t.__src,t.__altText,t.__title,t.__width,t.__height,t.__rest,t.__key)}static importJSON(t){const{altText:n,title:r,src:i,width:o,rest:s,height:a}=t;return Yr({altText:n,title:r,src:i,height:a,width:o,rest:s})}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__altText),this.__title&&t.setAttribute("title",this.__title),this.__width&&t.setAttribute("width",this.__width.toString()),this.__height&&t.setAttribute("height",this.__height.toString()),{element:t}}static importDOM(){return{img:()=>({conversion:sT,priority:0})}}exportJSON(){return{altText:this.getAltText(),title:this.getTitle(),height:this.__height==="inherit"?0:this.__height,width:this.__width==="inherit"?0:this.__width,src:this.getSrc(),rest:this.__rest,type:"image",version:1}}setWidthAndHeight(t,n){const r=this.getWritable();r.__width=t,r.__height=n}createDOM(t){const n=document.createElement("span"),i=t.theme.image;return i!==void 0&&(n.className=i),n}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}getTitle(){return this.__title}getHeight(){return this.__height}getWidth(){return this.__width}getRest(){return this.__rest}setTitle(t){this.getWritable().__title=t}setSrc(t){this.getWritable().__src=t}setAltText(t){this.getWritable().__altText=t??""}shouldBeSerializedAsElement(){return this.__width!=="inherit"||this.__height!=="inherit"||this.__rest.length>0}decorate(t){return _.createElement(rT,{src:this.getSrc(),title:this.getTitle(),nodeKey:this.getKey(),width:this.__width,height:this.__height,alt:this.__altText,rest:this.__rest})}}function Yr(e){const{altText:t,title:n,src:r,key:i,width:o,height:s,rest:a}=e;return new es(r,t,n,o,s,a,i)}function aa(e){return e instanceof es}const aT={testLexicalNode:aa,visitLexicalNode({mdastParent:e,lexicalNode:t,actions:n}){if(t.shouldBeSerializedAsElement()){const r=new Image;t.getHeight()!=="inherit"&&(r.height=t.getHeight()),t.getWidth()!=="inherit"&&(r.width=t.getWidth()),t.getAltText()&&(r.alt=t.getAltText()),t.getTitle()&&(r.title=t.getTitle());for(const i of t.getRest())i.type==="mdxJsxAttribute"&&typeof i.value=="string"&&r.setAttribute(i.name,i.value);n.appendToParent(e,{type:"html",value:r.outerHTML.replace(/>$/,` src="${t.getSrc()}" />`)})}else n.appendToParent(e,{type:"image",url:t.getSrc(),alt:t.getAltText(),title:t.getTitle()})}},lT={testNode:"image",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Yr({src:e.url,altText:e.alt??"",title:e.title??""}))}},uT={testNode:e=>e.type==="html"&&e.value.trim().startsWith("<img"),visitNode({mdastNode:e,lexicalParent:t}){const n=document.createElement("div");n.innerHTML=e.value;const r=n.querySelector("img");if(!r)throw new Error("Invalid HTML image");const i=r.src,o=r.alt,s=r.title,a=r.width,l=r.height,u=Yr({src:i||"",altText:o,title:s,width:a,height:l});if(t.getType()==="root"){const c=Ee();c.append(u),t.append(c)}else t.append(u)}};function Zi(e,t){const n=e.attributes.find(r=>r.type==="mdxJsxAttribute"&&r.name===t);if(n)return n.value}const cT={testNode:e=>(e.type==="mdxJsxTextElement"||e.type==="mdxJsxFlowElement")&&e.name==="img",visitNode({mdastNode:e,lexicalParent:t}){const n=Zi(e,"src");if(!n)return;const r=Zi(e,"alt")??"",i=Zi(e,"title"),o=Zi(e,"height"),s=Zi(e,"width"),a=e.attributes.filter(u=>u.type==="mdxJsxAttribute"&&!["src","alt","title","height","width"].includes(u.name)),l=Yr({src:n,altText:r,title:i,width:s?parseInt(s,10):void 0,height:o?parseInt(o,10):void 0,rest:a});if(t.getType()==="root"){const u=Ee();u.append(l),t.append(u)}else t.append(l)}},Rd=it(e=>{e.sub(e.pipe(Rd,We(qe)),([t,n])=>{n?.update(()=>{const r=Yr({altText:t.altText??"",src:t.src,title:t.title??""});Ai([r]),je(r.getParentOrThrow())&&id(r,Ee).selectEnd()})})}),dT=it(e=>{e.sub(e.pipe(dT,We(rr)),([t,n])=>{const r=i=>{e.pub(Rd,{...t,src:i})};"file"in t?n?.(t.file).then(r).catch(i=>{throw i}):r(t.src)})}),Gu=ne([]),Xu=ne(!1),rr=ne(null),Qu=ne(null),ec=ne(null),Or=ne({type:"inactive"},e=>{e.sub(e.pipe(v5,We(qe,rr,Or)),([t,n,r,i])=>{const o=i.type==="editing"?s=>{n?.update(()=>{const{nodeKey:a}=i,l=ze(a);l.setTitle(t.title),l.setAltText(t.altText),l.setSrc(s)}),e.pub(Or,{type:"inactive"})}:s=>{e.pub(Rd,{...t,src:s}),e.pub(Or,{type:"inactive"})};t.file&&t.file.length>0?r?.(t.file.item(0)).then(o).catch(s=>{throw s}):t.src&&o(t.src)}),e.pub(Mo,t=>{const n=e.getValue(rr);return Mt(t.registerCommand(la,r=>{const i=Yr(r);return Ai([i]),je(i.getParentOrThrow())&&id(i,Ee).selectEnd(),!0},xe),t.registerCommand(_a,r=>pT(r),du),t.registerCommand(Ac,r=>mT(r,!!n),De),t.registerCommand(Mc,r=>xT(r,t,e.getValue(rr)),du),t.registerCommand($o,r=>{var i,o;if(!n){let u=Array.from(((i=r.clipboardData)==null?void 0:i.items)??[]);return u=u.filter(c=>c.type.includes("text")),!u.length||u.length===0}const s=Array.from(((o=r.clipboardData)==null?void 0:o.items)??[]);if(s.some(u=>!u.type.includes("image"))||!s.length||s.length===0)return!1;const l=e.getValue(rr);return Promise.all(s.map(u=>l(u.getAsFile()))).then(u=>{u.forEach(c=>{t.dispatchCommand(la,{src:c,altText:""})})}).catch(u=>{throw u}),!0},zn))})}),m5=cr(e=>{e.link(e.pipe(m5,Om({type:"new"})),Or)}),x5=it(e=>{e.link(e.pipe(x5,li(t=>({type:"editing",...t}))),Or)}),y5=cr(e=>{e.link(e.pipe(y5,Om({type:"inactive"})),Or)}),b5=ne(!1),v5=it(),tc=ne(qu),fT=on({init(e,t){e.pubIn({[Wn]:[lT,uT,cT],[pr]:es,[mr]:aT,[qr]:t?.ImageDialog??XE,[rr]:t?.imageUploadHandler??null,[Gu]:t?.imageAutocompleteSuggestions??[],[Xu]:!!t?.disableImageResize,[b5]:!!t?.disableImageSettingsButton,[Qu]:t?.imagePreviewHandler??null,[tc]:t?.EditImageToolbar??qu,[ec]:t?.imagePlaceholder??yg})},update(e,t){e.pubIn({[rr]:t?.imageUploadHandler??null,[Gu]:t?.imageAutocompleteSuggestions??[],[Xu]:!!t?.disableImageResize,[Qu]:t?.imagePreviewHandler??null,[tc]:t?.EditImageToolbar??qu,[ec]:t?.imagePlaceholder??yg})}}),hT=e=>cx?(e??window).getSelection():null,la=Jn(),gT="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function pT(e){const t=$d();if(!t)return!1;const n=e.dataTransfer;if(!n)return!1;n.setData("text/plain","_");const r=document.createElement("img");return r.src=gT,n.setDragImage(r,0,0),n.setData("application/x-lexical-drag",JSON.stringify({data:{altText:t.__altText,title:t.__title,key:t.getKey(),src:t.__src},type:"image"})),!0}function mT(e,t){var n;if(t){let i=Array.from(((n=e.dataTransfer)==null?void 0:n.items)??[]);if(i=i.filter(o=>o.type.includes("image")),i.length>0)return e.preventDefault(),!0}return $d()?(C5(e)||e.preventDefault(),!0):!1}function xT(e,t,n){var r;let i=Array.from(((r=e.dataTransfer)==null?void 0:r.items)??[]);if(i=i.filter(a=>a.type.includes("image")),i.length>0&&n!==null)return e.preventDefault(),Promise.all(i.map(a=>a.kind==="string"?new Promise(l=>{a.getAsString(l)}):n(a.getAsFile()))).then(a=>{a.forEach(l=>{t.dispatchCommand(la,{src:l,altText:""})})}).catch(a=>{throw a}),!0;const o=$d();if(!o)return!1;const s=yT(e);if(!s)return!1;if(e.preventDefault(),C5(e)){const a=bT(e);o.remove();const l=zo();a!=null&&l.applyDOMRange(a),Xe(l),t.dispatchCommand(la,s)}return!0}function $d(){const e=j();if(!et(e))return null;const n=e.getNodes()[0];return aa(n)?n:null}function yT(e){var t;const n=(t=e.dataTransfer)==null?void 0:t.getData("application/x-lexical-drag");if(!n)return null;const{type:r,data:i}=JSON.parse(n);return r!=="image"?null:i}function C5(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&t.parentElement)}function bT(e){let t;const n=e.target,r=n==null?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,i=hT(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset??0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}const vT={testNode:"blockquote",visitNode({actions:e}){e.addAndStepInto(Zo())}},CT={testLexicalNode:vu,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{const r={type:"paragraph",children:[]};n.appendToParent(t,{type:"blockquote",children:[r]}),n.visitChildren(e,r)}},wT=on({init(e){e.pubIn({[Di]:"quote",[Wn]:vT,[pr]:La,[mr]:CT})}});function _T(){let e=ui;return{publish:()=>{e()},subscribe:t=>{e=t}}}var kT=Object.defineProperty,ST=(e,t,n)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qn=(e,t,n)=>(ST(e,typeof t!="symbol"?t+"":t,n),n);class Bi extends jo{constructor(t,n,r,i){super(i),Qn(this,"__code"),Qn(this,"__meta"),Qn(this,"__language"),Qn(this,"__focusEmitter",_T()),Qn(this,"setCode",o=>{o!==this.__code&&(this.getWritable().__code=o)}),Qn(this,"setMeta",o=>{o!==this.__meta&&(this.getWritable().__meta=o)}),Qn(this,"setLanguage",o=>{o!==this.__language&&(this.getWritable().__language=o)}),Qn(this,"select",()=>{this.__focusEmitter.publish()}),this.__code=t,this.__meta=r,this.__language=n}static getType(){return"codeblock"}static clone(t){return new Bi(t.__code,t.__language,t.__meta,t.__key)}static importJSON(t){const{code:n,meta:r,language:i}=t;return ts({code:n,language:i,meta:r})}static importDOM(){return{pre:()=>({conversion:MT,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:"codeblock",version:1}}createDOM(t){return document.createElement("div")}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(t){return _.createElement(IT,{parentEditor:t,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}}const w5=_.createContext(null),ET=({parentEditor:e,lexicalNode:t,children:n})=>{const r=_.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:i=>{e.update(()=>{t.setCode(i),setTimeout(()=>{e.dispatchCommand(fd,void 0)},0)})},setLanguage:i=>{e.update(()=>{t.setLanguage(i)})},setMeta:i=>{e.update(()=>{t.setMeta(i)})}}),[t,e]);return _.createElement(w5.Provider,{value:r},n)};function TT(){const e=_.useContext(w5);if(!e)throw new Error("useCodeBlockEditor must be used within a CodeBlockEditor");return e}const IT=e=>{const t=Ot(Va),n=Ot(Bd);let r=t.sort((l,u)=>u.priority-l.priority).find(l=>l.match(e.language||"",e.meta||""));if(r||(r=t.find(l=>l.match(n||"",e.meta||""))),!r)throw new Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);const i=r.Editor,{codeBlockNode:o,parentEditor:s,...a}=e;return _.createElement(ET,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},_.createElement(i,{...a}))};function ts(e){const{code:t="",language:n="",meta:r=""}=e;return new Bi(t,n,r)}function NT(e){return e instanceof Bi}function MT(e){const t=e,n=t.textContent??"",r=e.getAttribute("class")??"",i=e.getAttribute("data-language")??"",o=r.match(/language-(\w+)/),s=o?o[1]:i,a=t.getAttribute("data-meta")??"";return{node:ts({code:n,language:s,meta:a})}}const AT={testLexicalNode:NT,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("code",{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},OT={testNode:(e,{codeBlockEditorDescriptors:t})=>e.type==="code"?t.find(r=>r.match(e.lang,e.meta))!==void 0:!1,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(ts({code:e.value,language:e.lang,meta:e.meta}))}},Bd=ne(""),PT=it(e=>{e.link(e.pipe(PT,We(Bd),li(([t,n])=>()=>ts({language:n,...t}))),ox)});Et(Va);const FT=on({update(e,t){e.pub(Bd,t?.defaultCodeBlockLanguage??"")},init(e,t){e.pubIn({[Di]:"codeblock",[Va]:t?.codeBlockEditorDescriptors??[],[Wn]:OT,[pr]:Bi,[mr]:AT})}});function Ag(e,[t,n]){return Math.min(n,Math.max(t,e))}var LT=[" ","Enter","ArrowUp","ArrowDown"],DT=[" ","Enter"],Ur="Select",[Ja,Ka,RT]=_x(Ur),[Hi,JN]=Kr(Ur,[RT,ca]),Za=ca(),[$T,yr]=Hi(Ur),[BT,HT]=Hi(Ur),_5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:f,required:h,form:g}=e,x=Za(t),[b,y]=I.useState(null),[m,p]=I.useState(null),[v,k]=I.useState(!1),C=ja(u),[w,S]=Pr({prop:r,defaultProp:i??!1,onChange:o,caller:Ur}),[T,P]=Pr({prop:s,defaultProp:a,onChange:l,caller:Ur}),F=I.useRef(null),L=b?g||!!b.closest("form"):!0,[O,B]=I.useState(new Set),H=Array.from(O).map(q=>q.props.value).join(";");return M.jsx(np,{...x,children:M.jsxs($T,{required:h,scope:t,trigger:b,onTriggerChange:y,valueNode:m,onValueNodeChange:p,valueNodeHasChildren:v,onValueNodeHasChildrenChange:k,contentId:Oo(),value:T,onValueChange:P,open:w,onOpenChange:S,dir:C,triggerPointerDownPosRef:F,disabled:f,children:[M.jsx(Ja.Provider,{scope:t,children:M.jsx(BT,{scope:e.__scopeSelect,onNativeOptionAdd:I.useCallback(q=>{B(Z=>new Set(Z).add(q))},[]),onNativeOptionRemove:I.useCallback(q=>{B(Z=>{const Q=new Set(Z);return Q.delete(q),Q})},[]),children:n})}),L?M.jsxs(W5,{"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:T,onChange:q=>P(q.target.value),disabled:f,form:g,children:[T===void 0?M.jsx("option",{value:""}):null,Array.from(O)]},H):null]})})};_5.displayName=Ur;var k5="SelectTrigger",S5=I.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Za(n),s=yr(k5,n),a=s.disabled||r,l=ct(t,s.onTriggerChange),u=Ka(n),c=I.useRef("touch"),[d,f,h]=U5(x=>{const b=u().filter(p=>!p.disabled),y=b.find(p=>p.value===s.value),m=J5(b,x,y);m!==void 0&&s.onValueChange(m.value)}),g=x=>{a||(s.onOpenChange(!0),h()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return M.jsx(cc,{asChild:!0,...o,children:M.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":j5(s.value)?"":void 0,...i,ref:l,onClick:we(i.onClick,x=>{x.currentTarget.focus(),c.current!=="mouse"&&g(x)}),onPointerDown:we(i.onPointerDown,x=>{c.current=x.pointerType;const b=x.target;b.hasPointerCapture(x.pointerId)&&b.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(g(x),x.preventDefault())}),onKeyDown:we(i.onKeyDown,x=>{const b=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(b&&x.key===" ")&<.includes(x.key)&&(g(),x.preventDefault())})})})});S5.displayName=k5;var E5="SelectValue",T5=I.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=yr(E5,n),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,d=ct(t,l.onValueNodeChange);return or(()=>{u(c)},[u,c]),M.jsx(Ue.span,{...a,ref:d,style:{pointerEvents:"none"},children:j5(l.value)?M.jsx(M.Fragment,{children:s}):o})});T5.displayName=E5;var VT="SelectIcon",I5=I.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return M.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});I5.displayName=VT;var zT="SelectPortal",N5=e=>M.jsx(rp,{asChild:!0,...e});N5.displayName=zT;var Jr="SelectContent",M5=I.forwardRef((e,t)=>{const n=yr(Jr,e.__scopeSelect),[r,i]=I.useState();if(or(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Os.createPortal(M.jsx(A5,{scope:e.__scopeSelect,children:M.jsx(Ja.Slot,{scope:e.__scopeSelect,children:M.jsx("div",{children:e.children})})}),o):null}return M.jsx(O5,{...e,ref:t})});M5.displayName=Jr;var Jt=10,[A5,br]=Hi(Jr),WT="SelectContentImpl",jT=As("SelectContent.RemoveScroll"),O5=I.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:b,...y}=e,m=yr(Jr,n),[p,v]=I.useState(null),[k,C]=I.useState(null),w=ct(t,z=>v(z)),[S,T]=I.useState(null),[P,F]=I.useState(null),L=Ka(n),[O,B]=I.useState(!1),H=I.useRef(!1);I.useEffect(()=>{if(p)return op(p)},[p]),ap();const q=I.useCallback(z=>{const[U,...G]=L().map(me=>me.ref.current),[ee]=G.slice(-1),se=document.activeElement;for(const me of z)if(me===se||(me?.scrollIntoView({block:"nearest"}),me===U&&k&&(k.scrollTop=0),me===ee&&k&&(k.scrollTop=k.scrollHeight),me?.focus(),document.activeElement!==se))return},[L,k]),Z=I.useCallback(()=>q([S,p]),[q,S,p]);I.useEffect(()=>{O&&Z()},[O,Z]);const{onOpenChange:Q,triggerPointerDownPosRef:X}=m;I.useEffect(()=>{if(p){let z={x:0,y:0};const U=ee=>{z={x:Math.abs(Math.round(ee.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(X.current?.y??0))}},G=ee=>{z.x<=10&&z.y<=10?ee.preventDefault():p.contains(ee.target)||Q(!1),document.removeEventListener("pointermove",U),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[p,Q,X]),I.useEffect(()=>{const z=()=>Q(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[Q]);const[N,oe]=U5(z=>{const U=L().filter(se=>!se.disabled),G=U.find(se=>se.ref.current===document.activeElement),ee=J5(U,z,G);ee&&setTimeout(()=>ee.ref.current.focus())}),ce=I.useCallback((z,U,G)=>{const ee=!H.current&&!G;(m.value!==void 0&&m.value===U||ee)&&(T(z),ee&&(H.current=!0))},[m.value]),A=I.useCallback(()=>p?.focus(),[p]),fe=I.useCallback((z,U,G)=>{const ee=!H.current&&!G;(m.value!==void 0&&m.value===U||ee)&&F(z)},[m.value]),ge=r==="popper"?nc:P5,ae=ge===nc?{side:a,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:b}:{};return M.jsx(A5,{scope:n,content:p,viewport:k,onViewportChange:C,itemRefCallback:ce,selectedItem:S,onItemLeave:A,itemTextRefCallback:fe,focusSelectedItem:Z,selectedItemText:P,position:r,isPositioned:O,searchRef:N,children:M.jsx(sp,{as:jT,allowPinchZoom:!0,children:M.jsx(lp,{asChild:!0,trapped:m.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:we(i,z=>{m.trigger?.focus({preventScroll:!0}),z.preventDefault()}),children:M.jsx(up,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:M.jsx(ge,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:z=>z.preventDefault(),...y,...ae,onPlaced:()=>B(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:we(y.onKeyDown,z=>{const U=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!U&&z.key.length===1&&oe(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let ee=L().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(z.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const se=z.target,me=ee.indexOf(se);ee=ee.slice(me+1)}setTimeout(()=>q(ee)),z.preventDefault()}})})})})})})});O5.displayName=WT;var UT="SelectItemAlignedPosition",P5=I.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=yr(Jr,n),s=br(Jr,n),[a,l]=I.useState(null),[u,c]=I.useState(null),d=ct(t,w=>c(w)),f=Ka(n),h=I.useRef(!1),g=I.useRef(!0),{viewport:x,selectedItem:b,selectedItemText:y,focusSelectedItem:m}=s,p=I.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&x&&b&&y){const w=o.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),P=y.getBoundingClientRect();if(o.dir!=="rtl"){const se=P.left-S.left,me=T.left-se,Pe=w.left-me,He=w.width+Pe,Ye=Math.max(He,S.width),Ge=window.innerWidth-Jt,Qe=Ag(me,[Jt,Math.max(Jt,Ge-Ye)]);a.style.minWidth=He+"px",a.style.left=Qe+"px"}else{const se=S.right-P.right,me=window.innerWidth-T.right-se,Pe=window.innerWidth-w.right-me,He=w.width+Pe,Ye=Math.max(He,S.width),Ge=window.innerWidth-Jt,Qe=Ag(me,[Jt,Math.max(Jt,Ge-Ye)]);a.style.minWidth=He+"px",a.style.right=Qe+"px"}const F=f(),L=window.innerHeight-Jt*2,O=x.scrollHeight,B=window.getComputedStyle(u),H=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),Q=parseInt(B.paddingBottom,10),X=H+q+O+Q+Z,N=Math.min(b.offsetHeight*5,X),oe=window.getComputedStyle(x),ce=parseInt(oe.paddingTop,10),A=parseInt(oe.paddingBottom,10),fe=w.top+w.height/2-Jt,ge=L-fe,ae=b.offsetHeight/2,z=b.offsetTop+ae,U=H+q+z,G=X-U;if(U<=fe){const se=F.length>0&&b===F[F.length-1].ref.current;a.style.bottom="0px";const me=u.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(ge,ae+(se?A:0)+me+Z),He=U+Pe;a.style.height=He+"px"}else{const se=F.length>0&&b===F[0].ref.current;a.style.top="0px";const Pe=Math.max(fe,H+x.offsetTop+(se?ce:0)+ae)+G;a.style.height=Pe+"px",x.scrollTop=U-fe+x.offsetTop}a.style.margin=`${Jt}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,u,x,b,y,o.dir,r]);or(()=>p(),[p]);const[v,k]=I.useState();or(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=I.useCallback(w=>{w&&g.current===!0&&(p(),m?.(),g.current=!1)},[p,m]);return M.jsx(KT,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:M.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:v},children:M.jsx(Ue.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});P5.displayName=UT;var JT="SelectPopperPosition",nc=I.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Jt,...o}=e,s=Za(n);return M.jsx(cp,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nc.displayName=JT;var[KT,Hd]=Hi(Jr,{}),rc="SelectViewport",F5=I.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=br(rc,n),s=Hd(rc,n),a=ct(t,o.onViewportChange),l=I.useRef(0);return M.jsxs(M.Fragment,{children:[M.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),M.jsx(Ja.Slot,{scope:n,children:M.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:we(i.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=s;if(f?.current&&d){const h=Math.abs(l.current-c.scrollTop);if(h>0){const g=window.innerHeight-Jt*2,x=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(x,b);if(y<g){const m=y+h,p=Math.min(g,m),v=m-p;d.style.height=p+"px",d.style.bottom==="0px"&&(c.scrollTop=v>0?v:0,d.style.justifyContent="flex-end")}}}l.current=c.scrollTop})})})]})});F5.displayName=rc;var L5="SelectGroup",[ZT,qT]=Hi(L5),YT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Oo();return M.jsx(ZT,{scope:n,id:i,children:M.jsx(Ue.div,{role:"group","aria-labelledby":i,...r,ref:t})})});YT.displayName=L5;var D5="SelectLabel",GT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qT(D5,n);return M.jsx(Ue.div,{id:i.id,...r,ref:t})});GT.displayName=D5;var ua="SelectItem",[XT,R5]=Hi(ua),$5=I.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=yr(ua,n),l=br(ua,n),u=a.value===r,[c,d]=I.useState(o??""),[f,h]=I.useState(!1),g=ct(t,m=>l.itemRefCallback?.(m,r,i)),x=Oo(),b=I.useRef("touch"),y=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return M.jsx(XT,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:I.useCallback(m=>{d(p=>p||(m?.textContent??"").trim())},[]),children:M.jsx(Ja.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:M.jsx(Ue.div,{role:"option","aria-labelledby":x,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:we(s.onFocus,()=>h(!0)),onBlur:we(s.onBlur,()=>h(!1)),onClick:we(s.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:we(s.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:we(s.onPointerDown,m=>{b.current=m.pointerType}),onPointerMove:we(s.onPointerMove,m=>{b.current=m.pointerType,i?l.onItemLeave?.():b.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:we(s.onKeyDown,m=>{l.searchRef?.current!==""&&m.key===" "||(DT.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});$5.displayName=ua;var to="SelectItemText",B5=I.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=yr(to,n),a=br(to,n),l=R5(to,n),u=HT(to,n),[c,d]=I.useState(null),f=ct(t,y=>d(y),l.onItemTextChange,y=>a.itemTextRefCallback?.(y,l.value,l.disabled)),h=c?.textContent,g=I.useMemo(()=>M.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:x,onNativeOptionRemove:b}=u;return or(()=>(x(g),()=>b(g)),[x,b,g]),M.jsxs(M.Fragment,{children:[M.jsx(Ue.span,{id:l.textId,...o,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Os.createPortal(o.children,s.valueNode):null]})});B5.displayName=to;var H5="SelectItemIndicator",QT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return R5(H5,n).isSelected?M.jsx(Ue.span,{"aria-hidden":!0,...r,ref:t}):null});QT.displayName=H5;var ic="SelectScrollUpButton",eI=I.forwardRef((e,t)=>{const n=br(ic,e.__scopeSelect),r=Hd(ic,e.__scopeSelect),[i,o]=I.useState(!1),s=ct(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?M.jsx(V5,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});eI.displayName=ic;var oc="SelectScrollDownButton",tI=I.forwardRef((e,t)=>{const n=br(oc,e.__scopeSelect),r=Hd(oc,e.__scopeSelect),[i,o]=I.useState(!1),s=ct(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,c=Math.ceil(l.scrollTop)<u;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?M.jsx(V5,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});tI.displayName=oc;var V5=I.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=br("SelectScrollButton",n),s=I.useRef(null),a=Ka(n),l=I.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return I.useEffect(()=>()=>l(),[l]),or(()=>{a().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),M.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:we(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(i.onPointerLeave,()=>{l()})})}),nI="SelectSeparator",z5=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return M.jsx(Ue.div,{"aria-hidden":!0,...r,ref:t})});z5.displayName=nI;var sc="SelectArrow",rI=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Za(n),o=yr(sc,n),s=br(sc,n);return o.open&&s.position==="popper"?M.jsx(ip,{...i,...r,ref:t}):null});rI.displayName=sc;var iI="SelectBubbleInput",W5=I.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=I.useRef(null),o=ct(r,i),s=Ny(t);return I.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&c){const d=new Event("change",{bubbles:!0});c.call(a,t),a.dispatchEvent(d)}},[s,t]),M.jsx(Ue.select,{...n,style:{...jy,...n.style},ref:o,defaultValue:t})});W5.displayName=iI;function j5(e){return e===""||e===void 0}function U5(e){const t=xp(e),n=I.useRef(""),r=I.useRef(0),i=I.useCallback(s=>{const a=n.current+s;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=I.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function J5(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=oI(e,Math.max(o,0));i.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function oI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sI=_5,aI=S5,lI=T5,uI=I5,cI=N5,dI=M5,fI=F5,hI=$5,gI=B5,pI=z5;const ns=_.forwardRef(({title:e,children:t},n)=>{const r=Ot(Go);return _.createElement(yp,{delayDuration:100},_.createElement(bp,null,_.createElement(vp,{ref:n,asChild:!0},_.createElement("span",{className:Y.tooltipTrigger},t)),_.createElement(Cp,{container:r?.current},_.createElement(wp,{className:ke(Y.tooltipContent),sideOffset:10},e))))}),mI=_.forwardRef(({children:e,className:t,...n},r)=>_.createElement(hI,{...n,ref:r,className:ke(t,Y.selectItem)},_.createElement(gI,null,e))),xI=({title:e,placeholder:t,className:n})=>{const[r,i]=rn(nn,In);return _.createElement(ns,{title:e},_.createElement(aI,{"aria-label":t,className:ke(Y.selectTrigger,n),"data-toolbar-item":!0,disabled:r},_.createElement(lI,{placeholder:t}),_.createElement(uI,{className:Y.selectDropdownArrow},i("arrow_drop_down"))))},yI=({children:e,className:t=Y.selectContainer})=>{const n=Ot(Go);return _.createElement(cI,{container:n?.current},_.createElement(dI,{className:ke(t,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},_.createElement(fI,{"data-editor-dropdown":!0},e)))},bI=e=>_.createElement(sI,{value:e.value||"",onValueChange:e.onChange,disabled:e.disabled},_.createElement(xI,{title:e.triggerTitle,placeholder:e.placeholder}),_.createElement(yI,null,e.items.map((t,n)=>t==="separator"?_.createElement(pI,{key:n}):_.createElement(mI,{key:n,value:t.value},t.label))));function vI(e){try{const t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?Xf(n)?r:i:Xf(t)?r:i}catch{return null}}function K5(e){const t=j(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){const o=n.getRangeAt(0);let s;if(n.isCollapsed){let a=n.anchorNode;a?.nodeType==3&&(a=a.parentNode),s=a.getBoundingClientRect(),s.width=0}else if(n.anchorNode===i){let a=i;for(;a.firstElementChild!=null;)a=a.firstElementChild;s=a.getBoundingClientRect()}else s=o.getBoundingClientRect();return{top:Math.round(s.top),left:Math.round(s.left),width:Math.round(s.width),height:Math.round(s.height)}}else if(!r||r.className!=="link-input")return null;return null}function CI({url:e,title:t,onSubmit:n,onCancel:r,linkAutocompleteSuggestions:i}){const{register:o,handleSubmit:s,control:a,setValue:l,reset:u}=uc({values:{url:e,title:t}}),c=Bt();return _.createElement("form",{onSubmit:d=>{s(n)(d),d.stopPropagation(),d.preventDefault()},onReset:d=>{d.stopPropagation(),r()},className:ke(Y.multiFieldForm,Y.linkDialogEditForm)},_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"link-url"},c("createLink.url","URL")),_.createElement(p5,{register:o,initialInputValue:e,inputName:"url",suggestions:i,setValue:l,control:a,placeholder:c("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"link-title"},c("createLink.title","Title")),_.createElement("input",{id:"link-title",className:Y.textInput,size:40,...o("title")})),_.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},_.createElement("button",{type:"submit",title:c("createLink.saveTooltip","Set URL"),"aria-label":c("createLink.saveTooltip","Set URL"),className:ke(Y.primaryButton)},c("dialogControls.save","Save")),_.createElement("button",{type:"reset",title:c("createLink.cancelTooltip","Cancel change"),"aria-label":c("createLink.cancelTooltip","Cancel change"),className:ke(Y.secondaryButton)},c("dialogControls.cancel","Cancel"))))}const wI=()=>{const[e,t,n,r,i,o]=rn(Go,qe,In,wt,Q5,ey),s=_t(Z5),a=_t(q5),l=_t(Y5),u=_t(G5),c=_t(X5);_.useEffect(()=>{const b=()=>{t?.getEditorState().read(()=>{s(!0)})};return window.addEventListener("resize",b),window.addEventListener("scroll",b),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b)}},[t,s]);const[d,f]=_.useState(!1),h=Bt();if(r.type==="inactive")return null;const g=r.rectangle,x=r.type==="preview"&&r.url.startsWith("http");return _.createElement(dm,{open:!0},_.createElement(uC,{"data-visible":r.type==="edit",className:Y.linkDialogAnchor,style:{top:`${g.top}px`,left:`${g.left}px`,width:`${g.width}px`,height:`${g.height}px`}}),_.createElement(fm,{container:e?.current},_.createElement(hm,{className:ke(Y.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:b=>{b.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&_.createElement(CI,{url:r.url,title:r.title,onSubmit:a,onCancel:l.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&_.createElement(_.Fragment,null,_.createElement("a",{className:Y.linkDialogPreviewAnchor,href:r.url,...x?{target:"_blank",rel:"noreferrer"}:{},onClick:b=>{o!==null&&(b.preventDefault(),o(r.url))},title:x?h("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},_.createElement("span",null,r.url),x&&n("open_in_new")),_.createElement(Hl,{onClick:()=>{u()},title:h("linkPreview.edit","Edit link URL"),"aria-label":h("linkPreview.edit","Edit link URL")},n("edit")),_.createElement(yp,null,_.createElement(bp,{open:d},_.createElement(vp,{asChild:!0},_.createElement(Hl,{title:h("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":h("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},n(d?"check":"content_copy"))),_.createElement(Cp,{container:e?.current},_.createElement(wp,{className:ke(Y.tooltipContent),sideOffset:5},h("linkPreview.copied","Copied!"),_.createElement(Uy,null))))),_.createElement(Hl,{title:h("linkPreview.remove","Remove link"),"aria-label":h("linkPreview.remove","Remove link"),onClick:()=>{c()}},n("link_off"))),_.createElement(dC,{className:Y.popoverArrow}))))},Hl=_.forwardRef(({className:e,...t},n)=>_.createElement("button",{className:ke(Y.actionButton,e),ref:n,...t}));function ac(e){if(!e)return null;const t=vI(e);if(t===null)return null;const n=t.getParent();return yn(n)?n:yn(t)?t:null}const Z5=it(),wt=ne({type:"inactive"},e=>{e.pub(Mo,t=>t.registerCommand(Bo,()=>e.getValue(wt).type==="preview"?(e.pub(wt,{type:"inactive"}),!0):!1,De)),e.sub(e.pipe(ea),t=>{t!=="rich-text"&&e.pub(wt,{type:"inactive"})}),e.pub(Mo,t=>t.registerCommand(t1,n=>{if(n.key==="k"&&(na?n.metaKey:n.ctrlKey)&&!e.getValue(nn)){const r=j();return $(r)?(e.pub(Vd),n.stopPropagation(),n.preventDefault(),!0):!1}return!1},du)),e.link(e.pipe(G5,We(wt),li(([,t])=>{if(t.type==="preview")return{type:"edit",initialUrl:t.url,url:t.url,title:t.title,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),wt),e.sub(e.pipe(q5,We(qe,wt,Ei)),([t,n,r,i])=>{var o,s;const a=((o=t.url)==null?void 0:o.trim())??"",l=((s=t.title)==null?void 0:s.trim())??"";if(a!==""){if(i?.isCollapsed()){const u=l||a;n?.update(()=>{const c=ac(i);if(c)c.setURL(a),c.setTitle(l);else{const d=jr(a,{title:l});d.append(Re(u)),Ai([d]),d.select()}},{discrete:!0})}else n?.dispatchCommand(Ti,{url:a,title:l});e.pub(wt,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:l,url:a})}else r.type==="edit"&&r.initialUrl!==""&&n?.dispatchCommand(Ti,null),e.pub(wt,{type:"inactive"})}),e.link(e.pipe(Y5,We(wt,qe),li(([,t,n])=>{if(t.type==="edit")return n?.focus(),t.initialUrl===""?{type:"inactive"}:{type:"preview",url:t.initialUrl,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),wt),e.link(e.pipe(e.combine(Ei,Z5),We(qe,wt,nn),li(([[t],n,r,i])=>{if($(t)&&n&&!i){const o=ac(t);if(o){const s=K5(n);return s?{type:"preview",url:o.getURL(),linkNodeKey:o.getKey(),title:o.getTitle(),rectangle:s}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),wt)}),q5=it(),Y5=cr();cr();const G5=cr(),X5=cr(e=>{e.sub(e.pipe(X5,We(qe)),([,t])=>{t?.dispatchCommand(Ti,null)})}),Vd=cr(e=>{e.sub(e.pipe(Vd,We(Ei,qe),Ro(([,t])=>$(t))),([,t,n])=>{n?.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{const r=ac(t),i=K5(n);r?e.pub(wt,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):e.pub(wt,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})})}),Q5=ne([]),ey=ne(null),ty=ne(null,e=>{e.pub(Mo,t=>{function n(r){const[i,o]=e.getValues([nn,ty]);!i||o===null||t.update(()=>{const s=kn(r.target);if(s!==null){const a=fr(s,l=>l instanceof Zn);a!==null&&o(r,a,a.getURL())}})}return t.registerRootListener((r,i)=>{r&&r.addEventListener("click",n),i&&i.removeEventListener("click",n)})})}),_I=on({init(e,t){e.pub(qr,t?.LinkDialog??wI),e.pub(ey,t?.onClickLinkCallback??null),e.pub(ty,t?.onReadOnlyClickLinkCallback??null)},update(e,t={}){e.pub(Q5,t.linkAutocompleteSuggestions??[])}});function zd(e,t){return _.forwardRef((n,r)=>{const i=ke(t.className,n.className);return _.createElement(e,{...t,...n,className:i,ref:r})})}function kI(e){return({title:t,children:n,...r})=>_.createElement(e,{...r},_.createElement(ns,{title:t},n))}const SI=({readOnly:e,children:t,className:n})=>_.createElement(V4,{className:ke("mdxeditor-toolbar",Y.toolbarRoot,{[Y.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),EI=zd(Kx,{className:Y.toolbarButton,"data-toolbar-item":!0}),TI=kI(EI),ny=zd(W4,{className:Y.toolbarToggleItem,"data-toolbar-item":!0});zd(wd,{type:"single",className:Y.toolbarToggleSingleGroup});const ry=_.forwardRef(({on:e,title:t,children:n,disabled:r,...i},o)=>_.createElement(wd,{type:"single",className:Y.toolbarToggleSingleGroup,...i,value:e?"on":"off",ref:o},_.createElement(ny,{"aria-label":t,value:"on",disabled:r},_.createElement(ns,{title:t},n)))),II=({items:e})=>_.createElement("div",{className:Y.toolbarGroupOfGroups},e.map((t,n)=>_.createElement(ry,{key:n,title:t.title,on:t.active,onValueChange:r=>{t.onChange(r==="on")},disabled:t.disabled},t.contents))),NI=({value:e,onChange:t,className:n,ggClassName:r,items:i})=>{const o=Bt();return _.createElement("div",{className:ke(Y.toolbarGroupOfGroups,r)},_.createElement(wd,{"aria-label":o("toolbar.toggleGroup","toggle group"),type:"single",className:ke(Y.toolbarToggleSingleGroup,n),onValueChange:t,value:e||"",onFocus:s=>{s.preventDefault()}},i.map((s,a)=>_.createElement(ny,{key:a,"aria-label":s.title,value:s.value},_.createElement(ns,{title:s.title},s.contents)))))},Og=z4,Vl=ne(()=>null),zl=ne(""),Pg=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",MI=on({init(e,t){const n=t?.toolbarPosition==="bottom"?s8:o8;e.pubIn({[Vl]:t?.toolbarContents??Pg,[zl]:t?.toolbarClassName??"",[n]:()=>{const[r,i,o]=rn(Vl,nn,zl);return _.createElement(SI,{className:o,readOnly:i},r())}})},update(e,t){e.pub(Vl,t?.toolbarContents??Pg),e.pub(zl,t?.toolbarClassName??"")}});var Wl={exports:{}},Fg;function AI(){return Fg||(Fg=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
91
|
+
`),tT={__cache:{},read(e){if(this.__cache[e]||(this.__cache[e]=new Promise(t=>{const n=new Image;n.onerror=()=>{this.__cache[e]=eT,t()},n.onload=()=>{this.__cache[e]=e,t()},n.src=e})),this.__cache[e]instanceof Promise)throw this.__cache[e];return this.__cache[e]}};function nT({title:e,alt:t,className:n,imageRef:r,src:i,width:o,height:s}){return _.createElement("img",{className:n??void 0,alt:t,src:tT.read(i),title:e,ref:r,draggable:"false",width:o,height:s})}function rT({src:e,title:t,alt:n,nodeKey:r,width:i,height:o,rest:s}){const[a,l,u,c,d]=rn(ec,Xu,Qu,nn,tc),f=_.useRef(null),h=_.useRef(null),[g,x,b]=fx(r),[y]=yt(),[m,p]=_.useState(null),v=_.useRef(null),[k,C]=_.useState(!1),[w,S]=_.useState(null),[T,P]=_.useState(null),F=_.useCallback(X=>{if(g&&et(j())){X.preventDefault();const oe=ze(r);aa(oe)&&oe.remove()}return!1},[g,r]),L=_.useCallback(X=>{const N=j(),oe=h.current;return g&&et(N)&&N.getNodes().length===1&&oe!==null&&oe!==document.activeElement?(X.preventDefault(),oe.focus(),!0):!1},[g]),O=_.useCallback(X=>h.current===X.target?(Xe(null),y.update(()=>{x(!0);const N=y.getRootElement();N!==null&&N.focus()}),!0):!1,[y,x]);_.useEffect(()=>{u?(async()=>{T||P(e);const N=await u(e);S(N)})().catch(N=>{console.error(N)}):S(e)},[e,u,T]),_.useEffect(()=>{let X=!0;const N=Mt(y.registerUpdateListener(({editorState:oe})=>{X&&p(oe.read(()=>j()))}),y.registerCommand(xa,(oe,ce)=>(v.current=ce,!1),De),y.registerCommand(ya,oe=>{const ce=oe;return k?!0:ce.target===f.current?(ce.shiftKey?x(!g):(b(),x(!0)),!0):!1},De),y.registerCommand(_a,oe=>oe.target===f.current?(oe.preventDefault(),!0):!1,De),y.registerCommand(wa,F,De),y.registerCommand(Ca,F,De),y.registerCommand(Eo,L,De),y.registerCommand(Bo,O,De));return()=>{X=!1,N()}},[b,y,k,g,r,F,L,O,x]);const B=(X,N)=>{setTimeout(()=>{C(!1)},200),y.update(()=>{const oe=ze(r);aa(oe)&&oe.setWidthAndHeight(X,N)})},H=()=>{C(!0)},q=et(m),Z=g,Q=_.useMemo(()=>{if(s.length===0)return null;const X=s.find(N=>N.type==="mdxJsxAttribute"&&(N.name==="class"||N.name==="className"));return X?X.value:null},[s]);return w!==null?_.createElement(_.Suspense,{fallback:a?_.createElement(a,null):null},_.createElement("div",{className:Y.imageWrapper,"data-editor-block-type":"image"},_.createElement("div",{draggable:q},_.createElement(nT,{width:i,height:o,className:ke({[Y.focusedImage]:Z},Q),src:w,title:t??"",alt:n??"",imageRef:f})),q&&Z&&!l&&_.createElement(Q4,{editor:y,imageRef:f,onResizeStart:H,onResizeEnd:B}),c||_.createElement(d,{nodeKey:r,imageSource:w,initialImagePath:T,title:t??"",alt:n??""}))):null}var iT=Object.defineProperty,oT=(e,t,n)=>t in e?iT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ni=(e,t,n)=>(oT(e,typeof t!="symbol"?t+"":t,n),n);function sT(e){if(e instanceof HTMLImageElement){const{alt:t,src:n,title:r,width:i,height:o}=e;return{node:Yr({altText:t,src:n,title:r,width:i,height:o})}}return null}class es extends jo{constructor(t,n,r,i,o,s,a){super(a),ni(this,"__src"),ni(this,"__altText"),ni(this,"__title"),ni(this,"__width"),ni(this,"__height"),ni(this,"__rest"),this.__src=t,this.__title=r,this.__altText=n,this.__width=i||"inherit",this.__height=o||"inherit",this.__rest=s??[]}static getType(){return"image"}static clone(t){return new es(t.__src,t.__altText,t.__title,t.__width,t.__height,t.__rest,t.__key)}static importJSON(t){const{altText:n,title:r,src:i,width:o,rest:s,height:a}=t;return Yr({altText:n,title:r,src:i,height:a,width:o,rest:s})}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__altText),this.__title&&t.setAttribute("title",this.__title),this.__width&&t.setAttribute("width",this.__width.toString()),this.__height&&t.setAttribute("height",this.__height.toString()),{element:t}}static importDOM(){return{img:()=>({conversion:sT,priority:0})}}exportJSON(){return{altText:this.getAltText(),title:this.getTitle(),height:this.__height==="inherit"?0:this.__height,width:this.__width==="inherit"?0:this.__width,src:this.getSrc(),rest:this.__rest,type:"image",version:1}}setWidthAndHeight(t,n){const r=this.getWritable();r.__width=t,r.__height=n}createDOM(t){const n=document.createElement("span"),i=t.theme.image;return i!==void 0&&(n.className=i),n}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}getTitle(){return this.__title}getHeight(){return this.__height}getWidth(){return this.__width}getRest(){return this.__rest}setTitle(t){this.getWritable().__title=t}setSrc(t){this.getWritable().__src=t}setAltText(t){this.getWritable().__altText=t??""}shouldBeSerializedAsElement(){return this.__width!=="inherit"||this.__height!=="inherit"||this.__rest.length>0}decorate(t){return _.createElement(rT,{src:this.getSrc(),title:this.getTitle(),nodeKey:this.getKey(),width:this.__width,height:this.__height,alt:this.__altText,rest:this.__rest})}}function Yr(e){const{altText:t,title:n,src:r,key:i,width:o,height:s,rest:a}=e;return new es(r,t,n,o,s,a,i)}function aa(e){return e instanceof es}const aT={testLexicalNode:aa,visitLexicalNode({mdastParent:e,lexicalNode:t,actions:n}){if(t.shouldBeSerializedAsElement()){const r=new Image;t.getHeight()!=="inherit"&&(r.height=t.getHeight()),t.getWidth()!=="inherit"&&(r.width=t.getWidth()),t.getAltText()&&(r.alt=t.getAltText()),t.getTitle()&&(r.title=t.getTitle());for(const i of t.getRest())i.type==="mdxJsxAttribute"&&typeof i.value=="string"&&r.setAttribute(i.name,i.value);n.appendToParent(e,{type:"html",value:r.outerHTML.replace(/>$/,` src="${t.getSrc()}" />`)})}else n.appendToParent(e,{type:"image",url:t.getSrc(),alt:t.getAltText(),title:t.getTitle()})}},lT={testNode:"image",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Yr({src:e.url,altText:e.alt??"",title:e.title??""}))}},uT={testNode:e=>e.type==="html"&&e.value.trim().startsWith("<img"),visitNode({mdastNode:e,lexicalParent:t}){const n=document.createElement("div");n.innerHTML=e.value;const r=n.querySelector("img");if(!r)throw new Error("Invalid HTML image");const i=r.src,o=r.alt,s=r.title,a=r.width,l=r.height,u=Yr({src:i||"",altText:o,title:s,width:a,height:l});if(t.getType()==="root"){const c=Ee();c.append(u),t.append(c)}else t.append(u)}};function Zi(e,t){const n=e.attributes.find(r=>r.type==="mdxJsxAttribute"&&r.name===t);if(n)return n.value}const cT={testNode:e=>(e.type==="mdxJsxTextElement"||e.type==="mdxJsxFlowElement")&&e.name==="img",visitNode({mdastNode:e,lexicalParent:t}){const n=Zi(e,"src");if(!n)return;const r=Zi(e,"alt")??"",i=Zi(e,"title"),o=Zi(e,"height"),s=Zi(e,"width"),a=e.attributes.filter(u=>u.type==="mdxJsxAttribute"&&!["src","alt","title","height","width"].includes(u.name)),l=Yr({src:n,altText:r,title:i,width:s?parseInt(s,10):void 0,height:o?parseInt(o,10):void 0,rest:a});if(t.getType()==="root"){const u=Ee();u.append(l),t.append(u)}else t.append(l)}},Rd=it(e=>{e.sub(e.pipe(Rd,We(qe)),([t,n])=>{n?.update(()=>{const r=Yr({altText:t.altText??"",src:t.src,title:t.title??""});Ai([r]),je(r.getParentOrThrow())&&id(r,Ee).selectEnd()})})}),dT=it(e=>{e.sub(e.pipe(dT,We(rr)),([t,n])=>{const r=i=>{e.pub(Rd,{...t,src:i})};"file"in t?n?.(t.file).then(r).catch(i=>{throw i}):r(t.src)})}),Gu=ne([]),Xu=ne(!1),rr=ne(null),Qu=ne(null),ec=ne(null),Or=ne({type:"inactive"},e=>{e.sub(e.pipe(v5,We(qe,rr,Or)),([t,n,r,i])=>{const o=i.type==="editing"?s=>{n?.update(()=>{const{nodeKey:a}=i,l=ze(a);l.setTitle(t.title),l.setAltText(t.altText),l.setSrc(s)}),e.pub(Or,{type:"inactive"})}:s=>{e.pub(Rd,{...t,src:s}),e.pub(Or,{type:"inactive"})};t.file&&t.file.length>0?r?.(t.file.item(0)).then(o).catch(s=>{throw s}):t.src&&o(t.src)}),e.pub(Mo,t=>{const n=e.getValue(rr);return Mt(t.registerCommand(la,r=>{const i=Yr(r);return Ai([i]),je(i.getParentOrThrow())&&id(i,Ee).selectEnd(),!0},xe),t.registerCommand(_a,r=>pT(r),du),t.registerCommand(Ac,r=>mT(r,!!n),De),t.registerCommand(Mc,r=>xT(r,t,e.getValue(rr)),du),t.registerCommand($o,r=>{var i,o;if(!n){let u=Array.from(((i=r.clipboardData)==null?void 0:i.items)??[]);return u=u.filter(c=>c.type.includes("text")),!u.length||u.length===0}const s=Array.from(((o=r.clipboardData)==null?void 0:o.items)??[]);if(s.some(u=>!u.type.includes("image"))||!s.length||s.length===0)return!1;const l=e.getValue(rr);return Promise.all(s.map(u=>l(u.getAsFile()))).then(u=>{u.forEach(c=>{t.dispatchCommand(la,{src:c,altText:""})})}).catch(u=>{throw u}),!0},zn))})}),m5=cr(e=>{e.link(e.pipe(m5,Om({type:"new"})),Or)}),x5=it(e=>{e.link(e.pipe(x5,li(t=>({type:"editing",...t}))),Or)}),y5=cr(e=>{e.link(e.pipe(y5,Om({type:"inactive"})),Or)}),b5=ne(!1),v5=it(),tc=ne(qu),fT=on({init(e,t){e.pubIn({[Wn]:[lT,uT,cT],[pr]:es,[mr]:aT,[qr]:t?.ImageDialog??X4,[rr]:t?.imageUploadHandler??null,[Gu]:t?.imageAutocompleteSuggestions??[],[Xu]:!!t?.disableImageResize,[b5]:!!t?.disableImageSettingsButton,[Qu]:t?.imagePreviewHandler??null,[tc]:t?.EditImageToolbar??qu,[ec]:t?.imagePlaceholder??yg})},update(e,t){e.pubIn({[rr]:t?.imageUploadHandler??null,[Gu]:t?.imageAutocompleteSuggestions??[],[Xu]:!!t?.disableImageResize,[Qu]:t?.imagePreviewHandler??null,[tc]:t?.EditImageToolbar??qu,[ec]:t?.imagePlaceholder??yg})}}),hT=e=>cx?(e??window).getSelection():null,la=Jn(),gT="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function pT(e){const t=$d();if(!t)return!1;const n=e.dataTransfer;if(!n)return!1;n.setData("text/plain","_");const r=document.createElement("img");return r.src=gT,n.setDragImage(r,0,0),n.setData("application/x-lexical-drag",JSON.stringify({data:{altText:t.__altText,title:t.__title,key:t.getKey(),src:t.__src},type:"image"})),!0}function mT(e,t){var n;if(t){let i=Array.from(((n=e.dataTransfer)==null?void 0:n.items)??[]);if(i=i.filter(o=>o.type.includes("image")),i.length>0)return e.preventDefault(),!0}return $d()?(C5(e)||e.preventDefault(),!0):!1}function xT(e,t,n){var r;let i=Array.from(((r=e.dataTransfer)==null?void 0:r.items)??[]);if(i=i.filter(a=>a.type.includes("image")),i.length>0&&n!==null)return e.preventDefault(),Promise.all(i.map(a=>a.kind==="string"?new Promise(l=>{a.getAsString(l)}):n(a.getAsFile()))).then(a=>{a.forEach(l=>{t.dispatchCommand(la,{src:l,altText:""})})}).catch(a=>{throw a}),!0;const o=$d();if(!o)return!1;const s=yT(e);if(!s)return!1;if(e.preventDefault(),C5(e)){const a=bT(e);o.remove();const l=zo();a!=null&&l.applyDOMRange(a),Xe(l),t.dispatchCommand(la,s)}return!0}function $d(){const e=j();if(!et(e))return null;const n=e.getNodes()[0];return aa(n)?n:null}function yT(e){var t;const n=(t=e.dataTransfer)==null?void 0:t.getData("application/x-lexical-drag");if(!n)return null;const{type:r,data:i}=JSON.parse(n);return r!=="image"?null:i}function C5(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&t.parentElement)}function bT(e){let t;const n=e.target,r=n==null?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,i=hT(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset??0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}const vT={testNode:"blockquote",visitNode({actions:e}){e.addAndStepInto(Zo())}},CT={testLexicalNode:vu,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{const r={type:"paragraph",children:[]};n.appendToParent(t,{type:"blockquote",children:[r]}),n.visitChildren(e,r)}},wT=on({init(e){e.pubIn({[Di]:"quote",[Wn]:vT,[pr]:La,[mr]:CT})}});function _T(){let e=ui;return{publish:()=>{e()},subscribe:t=>{e=t}}}var kT=Object.defineProperty,ST=(e,t,n)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qn=(e,t,n)=>(ST(e,typeof t!="symbol"?t+"":t,n),n);class Bi extends jo{constructor(t,n,r,i){super(i),Qn(this,"__code"),Qn(this,"__meta"),Qn(this,"__language"),Qn(this,"__focusEmitter",_T()),Qn(this,"setCode",o=>{o!==this.__code&&(this.getWritable().__code=o)}),Qn(this,"setMeta",o=>{o!==this.__meta&&(this.getWritable().__meta=o)}),Qn(this,"setLanguage",o=>{o!==this.__language&&(this.getWritable().__language=o)}),Qn(this,"select",()=>{this.__focusEmitter.publish()}),this.__code=t,this.__meta=r,this.__language=n}static getType(){return"codeblock"}static clone(t){return new Bi(t.__code,t.__language,t.__meta,t.__key)}static importJSON(t){const{code:n,meta:r,language:i}=t;return ts({code:n,language:i,meta:r})}static importDOM(){return{pre:()=>({conversion:MT,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:"codeblock",version:1}}createDOM(t){return document.createElement("div")}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(t){return _.createElement(IT,{parentEditor:t,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}}const w5=_.createContext(null),ET=({parentEditor:e,lexicalNode:t,children:n})=>{const r=_.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:i=>{e.update(()=>{t.setCode(i),setTimeout(()=>{e.dispatchCommand(fd,void 0)},0)})},setLanguage:i=>{e.update(()=>{t.setLanguage(i)})},setMeta:i=>{e.update(()=>{t.setMeta(i)})}}),[t,e]);return _.createElement(w5.Provider,{value:r},n)};function TT(){const e=_.useContext(w5);if(!e)throw new Error("useCodeBlockEditor must be used within a CodeBlockEditor");return e}const IT=e=>{const t=Ot(Va),n=Ot(Bd);let r=t.sort((l,u)=>u.priority-l.priority).find(l=>l.match(e.language||"",e.meta||""));if(r||(r=t.find(l=>l.match(n||"",e.meta||""))),!r)throw new Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);const i=r.Editor,{codeBlockNode:o,parentEditor:s,...a}=e;return _.createElement(ET,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},_.createElement(i,{...a}))};function ts(e){const{code:t="",language:n="",meta:r=""}=e;return new Bi(t,n,r)}function NT(e){return e instanceof Bi}function MT(e){const t=e,n=t.textContent??"",r=e.getAttribute("class")??"",i=e.getAttribute("data-language")??"",o=r.match(/language-(\w+)/),s=o?o[1]:i,a=t.getAttribute("data-meta")??"";return{node:ts({code:n,language:s,meta:a})}}const AT={testLexicalNode:NT,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto("code",{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},OT={testNode:(e,{codeBlockEditorDescriptors:t})=>e.type==="code"?t.find(r=>r.match(e.lang,e.meta))!==void 0:!1,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(ts({code:e.value,language:e.lang,meta:e.meta}))}},Bd=ne(""),PT=it(e=>{e.link(e.pipe(PT,We(Bd),li(([t,n])=>()=>ts({language:n,...t}))),ox)});Et(Va);const FT=on({update(e,t){e.pub(Bd,t?.defaultCodeBlockLanguage??"")},init(e,t){e.pubIn({[Di]:"codeblock",[Va]:t?.codeBlockEditorDescriptors??[],[Wn]:OT,[pr]:Bi,[mr]:AT})}});function Ag(e,[t,n]){return Math.min(n,Math.max(t,e))}var LT=[" ","Enter","ArrowUp","ArrowDown"],DT=[" ","Enter"],Ur="Select",[Ja,Ka,RT]=_x(Ur),[Hi,JN]=Kr(Ur,[RT,ca]),Za=ca(),[$T,yr]=Hi(Ur),[BT,HT]=Hi(Ur),_5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:f,required:h,form:g}=e,x=Za(t),[b,y]=I.useState(null),[m,p]=I.useState(null),[v,k]=I.useState(!1),C=ja(u),[w,S]=Pr({prop:r,defaultProp:i??!1,onChange:o,caller:Ur}),[T,P]=Pr({prop:s,defaultProp:a,onChange:l,caller:Ur}),F=I.useRef(null),L=b?g||!!b.closest("form"):!0,[O,B]=I.useState(new Set),H=Array.from(O).map(q=>q.props.value).join(";");return M.jsx(np,{...x,children:M.jsxs($T,{required:h,scope:t,trigger:b,onTriggerChange:y,valueNode:m,onValueNodeChange:p,valueNodeHasChildren:v,onValueNodeHasChildrenChange:k,contentId:Oo(),value:T,onValueChange:P,open:w,onOpenChange:S,dir:C,triggerPointerDownPosRef:F,disabled:f,children:[M.jsx(Ja.Provider,{scope:t,children:M.jsx(BT,{scope:e.__scopeSelect,onNativeOptionAdd:I.useCallback(q=>{B(Z=>new Set(Z).add(q))},[]),onNativeOptionRemove:I.useCallback(q=>{B(Z=>{const Q=new Set(Z);return Q.delete(q),Q})},[]),children:n})}),L?M.jsxs(W5,{"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:T,onChange:q=>P(q.target.value),disabled:f,form:g,children:[T===void 0?M.jsx("option",{value:""}):null,Array.from(O)]},H):null]})})};_5.displayName=Ur;var k5="SelectTrigger",S5=I.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Za(n),s=yr(k5,n),a=s.disabled||r,l=ct(t,s.onTriggerChange),u=Ka(n),c=I.useRef("touch"),[d,f,h]=U5(x=>{const b=u().filter(p=>!p.disabled),y=b.find(p=>p.value===s.value),m=J5(b,x,y);m!==void 0&&s.onValueChange(m.value)}),g=x=>{a||(s.onOpenChange(!0),h()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return M.jsx(cc,{asChild:!0,...o,children:M.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":j5(s.value)?"":void 0,...i,ref:l,onClick:we(i.onClick,x=>{x.currentTarget.focus(),c.current!=="mouse"&&g(x)}),onPointerDown:we(i.onPointerDown,x=>{c.current=x.pointerType;const b=x.target;b.hasPointerCapture(x.pointerId)&&b.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(g(x),x.preventDefault())}),onKeyDown:we(i.onKeyDown,x=>{const b=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(b&&x.key===" ")&<.includes(x.key)&&(g(),x.preventDefault())})})})});S5.displayName=k5;var E5="SelectValue",T5=I.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=yr(E5,n),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,d=ct(t,l.onValueNodeChange);return or(()=>{u(c)},[u,c]),M.jsx(Ue.span,{...a,ref:d,style:{pointerEvents:"none"},children:j5(l.value)?M.jsx(M.Fragment,{children:s}):o})});T5.displayName=E5;var VT="SelectIcon",I5=I.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return M.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});I5.displayName=VT;var zT="SelectPortal",N5=e=>M.jsx(rp,{asChild:!0,...e});N5.displayName=zT;var Jr="SelectContent",M5=I.forwardRef((e,t)=>{const n=yr(Jr,e.__scopeSelect),[r,i]=I.useState();if(or(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Os.createPortal(M.jsx(A5,{scope:e.__scopeSelect,children:M.jsx(Ja.Slot,{scope:e.__scopeSelect,children:M.jsx("div",{children:e.children})})}),o):null}return M.jsx(O5,{...e,ref:t})});M5.displayName=Jr;var Jt=10,[A5,br]=Hi(Jr),WT="SelectContentImpl",jT=As("SelectContent.RemoveScroll"),O5=I.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:b,...y}=e,m=yr(Jr,n),[p,v]=I.useState(null),[k,C]=I.useState(null),w=ct(t,z=>v(z)),[S,T]=I.useState(null),[P,F]=I.useState(null),L=Ka(n),[O,B]=I.useState(!1),H=I.useRef(!1);I.useEffect(()=>{if(p)return op(p)},[p]),ap();const q=I.useCallback(z=>{const[U,...G]=L().map(me=>me.ref.current),[ee]=G.slice(-1),se=document.activeElement;for(const me of z)if(me===se||(me?.scrollIntoView({block:"nearest"}),me===U&&k&&(k.scrollTop=0),me===ee&&k&&(k.scrollTop=k.scrollHeight),me?.focus(),document.activeElement!==se))return},[L,k]),Z=I.useCallback(()=>q([S,p]),[q,S,p]);I.useEffect(()=>{O&&Z()},[O,Z]);const{onOpenChange:Q,triggerPointerDownPosRef:X}=m;I.useEffect(()=>{if(p){let z={x:0,y:0};const U=ee=>{z={x:Math.abs(Math.round(ee.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(X.current?.y??0))}},G=ee=>{z.x<=10&&z.y<=10?ee.preventDefault():p.contains(ee.target)||Q(!1),document.removeEventListener("pointermove",U),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[p,Q,X]),I.useEffect(()=>{const z=()=>Q(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[Q]);const[N,oe]=U5(z=>{const U=L().filter(se=>!se.disabled),G=U.find(se=>se.ref.current===document.activeElement),ee=J5(U,z,G);ee&&setTimeout(()=>ee.ref.current.focus())}),ce=I.useCallback((z,U,G)=>{const ee=!H.current&&!G;(m.value!==void 0&&m.value===U||ee)&&(T(z),ee&&(H.current=!0))},[m.value]),A=I.useCallback(()=>p?.focus(),[p]),fe=I.useCallback((z,U,G)=>{const ee=!H.current&&!G;(m.value!==void 0&&m.value===U||ee)&&F(z)},[m.value]),ge=r==="popper"?nc:P5,ae=ge===nc?{side:a,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:b}:{};return M.jsx(A5,{scope:n,content:p,viewport:k,onViewportChange:C,itemRefCallback:ce,selectedItem:S,onItemLeave:A,itemTextRefCallback:fe,focusSelectedItem:Z,selectedItemText:P,position:r,isPositioned:O,searchRef:N,children:M.jsx(sp,{as:jT,allowPinchZoom:!0,children:M.jsx(lp,{asChild:!0,trapped:m.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:we(i,z=>{m.trigger?.focus({preventScroll:!0}),z.preventDefault()}),children:M.jsx(up,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:M.jsx(ge,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:z=>z.preventDefault(),...y,...ae,onPlaced:()=>B(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:we(y.onKeyDown,z=>{const U=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!U&&z.key.length===1&&oe(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let ee=L().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(z.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const se=z.target,me=ee.indexOf(se);ee=ee.slice(me+1)}setTimeout(()=>q(ee)),z.preventDefault()}})})})})})})});O5.displayName=WT;var UT="SelectItemAlignedPosition",P5=I.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=yr(Jr,n),s=br(Jr,n),[a,l]=I.useState(null),[u,c]=I.useState(null),d=ct(t,w=>c(w)),f=Ka(n),h=I.useRef(!1),g=I.useRef(!0),{viewport:x,selectedItem:b,selectedItemText:y,focusSelectedItem:m}=s,p=I.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&x&&b&&y){const w=o.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),P=y.getBoundingClientRect();if(o.dir!=="rtl"){const se=P.left-S.left,me=T.left-se,Pe=w.left-me,He=w.width+Pe,Ye=Math.max(He,S.width),Ge=window.innerWidth-Jt,Qe=Ag(me,[Jt,Math.max(Jt,Ge-Ye)]);a.style.minWidth=He+"px",a.style.left=Qe+"px"}else{const se=S.right-P.right,me=window.innerWidth-T.right-se,Pe=window.innerWidth-w.right-me,He=w.width+Pe,Ye=Math.max(He,S.width),Ge=window.innerWidth-Jt,Qe=Ag(me,[Jt,Math.max(Jt,Ge-Ye)]);a.style.minWidth=He+"px",a.style.right=Qe+"px"}const F=f(),L=window.innerHeight-Jt*2,O=x.scrollHeight,B=window.getComputedStyle(u),H=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),Q=parseInt(B.paddingBottom,10),X=H+q+O+Q+Z,N=Math.min(b.offsetHeight*5,X),oe=window.getComputedStyle(x),ce=parseInt(oe.paddingTop,10),A=parseInt(oe.paddingBottom,10),fe=w.top+w.height/2-Jt,ge=L-fe,ae=b.offsetHeight/2,z=b.offsetTop+ae,U=H+q+z,G=X-U;if(U<=fe){const se=F.length>0&&b===F[F.length-1].ref.current;a.style.bottom="0px";const me=u.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(ge,ae+(se?A:0)+me+Z),He=U+Pe;a.style.height=He+"px"}else{const se=F.length>0&&b===F[0].ref.current;a.style.top="0px";const Pe=Math.max(fe,H+x.offsetTop+(se?ce:0)+ae)+G;a.style.height=Pe+"px",x.scrollTop=U-fe+x.offsetTop}a.style.margin=`${Jt}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,u,x,b,y,o.dir,r]);or(()=>p(),[p]);const[v,k]=I.useState();or(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=I.useCallback(w=>{w&&g.current===!0&&(p(),m?.(),g.current=!1)},[p,m]);return M.jsx(KT,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:M.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:v},children:M.jsx(Ue.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});P5.displayName=UT;var JT="SelectPopperPosition",nc=I.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Jt,...o}=e,s=Za(n);return M.jsx(cp,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nc.displayName=JT;var[KT,Hd]=Hi(Jr,{}),rc="SelectViewport",F5=I.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=br(rc,n),s=Hd(rc,n),a=ct(t,o.onViewportChange),l=I.useRef(0);return M.jsxs(M.Fragment,{children:[M.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),M.jsx(Ja.Slot,{scope:n,children:M.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:we(i.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=s;if(f?.current&&d){const h=Math.abs(l.current-c.scrollTop);if(h>0){const g=window.innerHeight-Jt*2,x=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(x,b);if(y<g){const m=y+h,p=Math.min(g,m),v=m-p;d.style.height=p+"px",d.style.bottom==="0px"&&(c.scrollTop=v>0?v:0,d.style.justifyContent="flex-end")}}}l.current=c.scrollTop})})})]})});F5.displayName=rc;var L5="SelectGroup",[ZT,qT]=Hi(L5),YT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Oo();return M.jsx(ZT,{scope:n,id:i,children:M.jsx(Ue.div,{role:"group","aria-labelledby":i,...r,ref:t})})});YT.displayName=L5;var D5="SelectLabel",GT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qT(D5,n);return M.jsx(Ue.div,{id:i.id,...r,ref:t})});GT.displayName=D5;var ua="SelectItem",[XT,R5]=Hi(ua),$5=I.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=yr(ua,n),l=br(ua,n),u=a.value===r,[c,d]=I.useState(o??""),[f,h]=I.useState(!1),g=ct(t,m=>l.itemRefCallback?.(m,r,i)),x=Oo(),b=I.useRef("touch"),y=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return M.jsx(XT,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:I.useCallback(m=>{d(p=>p||(m?.textContent??"").trim())},[]),children:M.jsx(Ja.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:M.jsx(Ue.div,{role:"option","aria-labelledby":x,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:we(s.onFocus,()=>h(!0)),onBlur:we(s.onBlur,()=>h(!1)),onClick:we(s.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:we(s.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:we(s.onPointerDown,m=>{b.current=m.pointerType}),onPointerMove:we(s.onPointerMove,m=>{b.current=m.pointerType,i?l.onItemLeave?.():b.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:we(s.onKeyDown,m=>{l.searchRef?.current!==""&&m.key===" "||(DT.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});$5.displayName=ua;var to="SelectItemText",B5=I.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=yr(to,n),a=br(to,n),l=R5(to,n),u=HT(to,n),[c,d]=I.useState(null),f=ct(t,y=>d(y),l.onItemTextChange,y=>a.itemTextRefCallback?.(y,l.value,l.disabled)),h=c?.textContent,g=I.useMemo(()=>M.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:x,onNativeOptionRemove:b}=u;return or(()=>(x(g),()=>b(g)),[x,b,g]),M.jsxs(M.Fragment,{children:[M.jsx(Ue.span,{id:l.textId,...o,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Os.createPortal(o.children,s.valueNode):null]})});B5.displayName=to;var H5="SelectItemIndicator",QT=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return R5(H5,n).isSelected?M.jsx(Ue.span,{"aria-hidden":!0,...r,ref:t}):null});QT.displayName=H5;var ic="SelectScrollUpButton",eI=I.forwardRef((e,t)=>{const n=br(ic,e.__scopeSelect),r=Hd(ic,e.__scopeSelect),[i,o]=I.useState(!1),s=ct(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?M.jsx(V5,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});eI.displayName=ic;var oc="SelectScrollDownButton",tI=I.forwardRef((e,t)=>{const n=br(oc,e.__scopeSelect),r=Hd(oc,e.__scopeSelect),[i,o]=I.useState(!1),s=ct(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,c=Math.ceil(l.scrollTop)<u;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?M.jsx(V5,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});tI.displayName=oc;var V5=I.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=br("SelectScrollButton",n),s=I.useRef(null),a=Ka(n),l=I.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return I.useEffect(()=>()=>l(),[l]),or(()=>{a().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),M.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:we(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(i.onPointerLeave,()=>{l()})})}),nI="SelectSeparator",z5=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return M.jsx(Ue.div,{"aria-hidden":!0,...r,ref:t})});z5.displayName=nI;var sc="SelectArrow",rI=I.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Za(n),o=yr(sc,n),s=br(sc,n);return o.open&&s.position==="popper"?M.jsx(ip,{...i,...r,ref:t}):null});rI.displayName=sc;var iI="SelectBubbleInput",W5=I.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=I.useRef(null),o=ct(r,i),s=Ny(t);return I.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&c){const d=new Event("change",{bubbles:!0});c.call(a,t),a.dispatchEvent(d)}},[s,t]),M.jsx(Ue.select,{...n,style:{...jy,...n.style},ref:o,defaultValue:t})});W5.displayName=iI;function j5(e){return e===""||e===void 0}function U5(e){const t=xp(e),n=I.useRef(""),r=I.useRef(0),i=I.useCallback(s=>{const a=n.current+s;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=I.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function J5(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=oI(e,Math.max(o,0));i.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function oI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sI=_5,aI=S5,lI=T5,uI=I5,cI=N5,dI=M5,fI=F5,hI=$5,gI=B5,pI=z5;const ns=_.forwardRef(({title:e,children:t},n)=>{const r=Ot(Go);return _.createElement(yp,{delayDuration:100},_.createElement(bp,null,_.createElement(vp,{ref:n,asChild:!0},_.createElement("span",{className:Y.tooltipTrigger},t)),_.createElement(Cp,{container:r?.current},_.createElement(wp,{className:ke(Y.tooltipContent),sideOffset:10},e))))}),mI=_.forwardRef(({children:e,className:t,...n},r)=>_.createElement(hI,{...n,ref:r,className:ke(t,Y.selectItem)},_.createElement(gI,null,e))),xI=({title:e,placeholder:t,className:n})=>{const[r,i]=rn(nn,In);return _.createElement(ns,{title:e},_.createElement(aI,{"aria-label":t,className:ke(Y.selectTrigger,n),"data-toolbar-item":!0,disabled:r},_.createElement(lI,{placeholder:t}),_.createElement(uI,{className:Y.selectDropdownArrow},i("arrow_drop_down"))))},yI=({children:e,className:t=Y.selectContainer})=>{const n=Ot(Go);return _.createElement(cI,{container:n?.current},_.createElement(dI,{className:ke(t,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},_.createElement(fI,{"data-editor-dropdown":!0},e)))},bI=e=>_.createElement(sI,{value:e.value||"",onValueChange:e.onChange,disabled:e.disabled},_.createElement(xI,{title:e.triggerTitle,placeholder:e.placeholder}),_.createElement(yI,null,e.items.map((t,n)=>t==="separator"?_.createElement(pI,{key:n}):_.createElement(mI,{key:n,value:t.value},t.label))));function vI(e){try{const t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?Xf(n)?r:i:Xf(t)?r:i}catch{return null}}function K5(e){const t=j(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){const o=n.getRangeAt(0);let s;if(n.isCollapsed){let a=n.anchorNode;a?.nodeType==3&&(a=a.parentNode),s=a.getBoundingClientRect(),s.width=0}else if(n.anchorNode===i){let a=i;for(;a.firstElementChild!=null;)a=a.firstElementChild;s=a.getBoundingClientRect()}else s=o.getBoundingClientRect();return{top:Math.round(s.top),left:Math.round(s.left),width:Math.round(s.width),height:Math.round(s.height)}}else if(!r||r.className!=="link-input")return null;return null}function CI({url:e,title:t,onSubmit:n,onCancel:r,linkAutocompleteSuggestions:i}){const{register:o,handleSubmit:s,control:a,setValue:l,reset:u}=uc({values:{url:e,title:t}}),c=Bt();return _.createElement("form",{onSubmit:d=>{s(n)(d),d.stopPropagation(),d.preventDefault()},onReset:d=>{d.stopPropagation(),r()},className:ke(Y.multiFieldForm,Y.linkDialogEditForm)},_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"link-url"},c("createLink.url","URL")),_.createElement(p5,{register:o,initialInputValue:e,inputName:"url",suggestions:i,setValue:l,control:a,placeholder:c("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),_.createElement("div",{className:Y.formField},_.createElement("label",{htmlFor:"link-title"},c("createLink.title","Title")),_.createElement("input",{id:"link-title",className:Y.textInput,size:40,...o("title")})),_.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},_.createElement("button",{type:"submit",title:c("createLink.saveTooltip","Set URL"),"aria-label":c("createLink.saveTooltip","Set URL"),className:ke(Y.primaryButton)},c("dialogControls.save","Save")),_.createElement("button",{type:"reset",title:c("createLink.cancelTooltip","Cancel change"),"aria-label":c("createLink.cancelTooltip","Cancel change"),className:ke(Y.secondaryButton)},c("dialogControls.cancel","Cancel"))))}const wI=()=>{const[e,t,n,r,i,o]=rn(Go,qe,In,wt,Q5,ey),s=_t(Z5),a=_t(q5),l=_t(Y5),u=_t(G5),c=_t(X5);_.useEffect(()=>{const b=()=>{t?.getEditorState().read(()=>{s(!0)})};return window.addEventListener("resize",b),window.addEventListener("scroll",b),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b)}},[t,s]);const[d,f]=_.useState(!1),h=Bt();if(r.type==="inactive")return null;const g=r.rectangle,x=r.type==="preview"&&r.url.startsWith("http");return _.createElement(dm,{open:!0},_.createElement(uC,{"data-visible":r.type==="edit",className:Y.linkDialogAnchor,style:{top:`${g.top}px`,left:`${g.left}px`,width:`${g.width}px`,height:`${g.height}px`}}),_.createElement(fm,{container:e?.current},_.createElement(hm,{className:ke(Y.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:b=>{b.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&_.createElement(CI,{url:r.url,title:r.title,onSubmit:a,onCancel:l.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&_.createElement(_.Fragment,null,_.createElement("a",{className:Y.linkDialogPreviewAnchor,href:r.url,...x?{target:"_blank",rel:"noreferrer"}:{},onClick:b=>{o!==null&&(b.preventDefault(),o(r.url))},title:x?h("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},_.createElement("span",null,r.url),x&&n("open_in_new")),_.createElement(Hl,{onClick:()=>{u()},title:h("linkPreview.edit","Edit link URL"),"aria-label":h("linkPreview.edit","Edit link URL")},n("edit")),_.createElement(yp,null,_.createElement(bp,{open:d},_.createElement(vp,{asChild:!0},_.createElement(Hl,{title:h("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":h("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},n(d?"check":"content_copy"))),_.createElement(Cp,{container:e?.current},_.createElement(wp,{className:ke(Y.tooltipContent),sideOffset:5},h("linkPreview.copied","Copied!"),_.createElement(Uy,null))))),_.createElement(Hl,{title:h("linkPreview.remove","Remove link"),"aria-label":h("linkPreview.remove","Remove link"),onClick:()=>{c()}},n("link_off"))),_.createElement(dC,{className:Y.popoverArrow}))))},Hl=_.forwardRef(({className:e,...t},n)=>_.createElement("button",{className:ke(Y.actionButton,e),ref:n,...t}));function ac(e){if(!e)return null;const t=vI(e);if(t===null)return null;const n=t.getParent();return yn(n)?n:yn(t)?t:null}const Z5=it(),wt=ne({type:"inactive"},e=>{e.pub(Mo,t=>t.registerCommand(Bo,()=>e.getValue(wt).type==="preview"?(e.pub(wt,{type:"inactive"}),!0):!1,De)),e.sub(e.pipe(ea),t=>{t!=="rich-text"&&e.pub(wt,{type:"inactive"})}),e.pub(Mo,t=>t.registerCommand(t1,n=>{if(n.key==="k"&&(na?n.metaKey:n.ctrlKey)&&!e.getValue(nn)){const r=j();return $(r)?(e.pub(Vd),n.stopPropagation(),n.preventDefault(),!0):!1}return!1},du)),e.link(e.pipe(G5,We(wt),li(([,t])=>{if(t.type==="preview")return{type:"edit",initialUrl:t.url,url:t.url,title:t.title,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),wt),e.sub(e.pipe(q5,We(qe,wt,Ei)),([t,n,r,i])=>{var o,s;const a=((o=t.url)==null?void 0:o.trim())??"",l=((s=t.title)==null?void 0:s.trim())??"";if(a!==""){if(i?.isCollapsed()){const u=l||a;n?.update(()=>{const c=ac(i);if(c)c.setURL(a),c.setTitle(l);else{const d=jr(a,{title:l});d.append(Re(u)),Ai([d]),d.select()}},{discrete:!0})}else n?.dispatchCommand(Ti,{url:a,title:l});e.pub(wt,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:l,url:a})}else r.type==="edit"&&r.initialUrl!==""&&n?.dispatchCommand(Ti,null),e.pub(wt,{type:"inactive"})}),e.link(e.pipe(Y5,We(wt,qe),li(([,t,n])=>{if(t.type==="edit")return n?.focus(),t.initialUrl===""?{type:"inactive"}:{type:"preview",url:t.initialUrl,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),wt),e.link(e.pipe(e.combine(Ei,Z5),We(qe,wt,nn),li(([[t],n,r,i])=>{if($(t)&&n&&!i){const o=ac(t);if(o){const s=K5(n);return s?{type:"preview",url:o.getURL(),linkNodeKey:o.getKey(),title:o.getTitle(),rectangle:s}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),wt)}),q5=it(),Y5=cr();cr();const G5=cr(),X5=cr(e=>{e.sub(e.pipe(X5,We(qe)),([,t])=>{t?.dispatchCommand(Ti,null)})}),Vd=cr(e=>{e.sub(e.pipe(Vd,We(Ei,qe),Ro(([,t])=>$(t))),([,t,n])=>{n?.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{const r=ac(t),i=K5(n);r?e.pub(wt,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):e.pub(wt,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})})}),Q5=ne([]),ey=ne(null),ty=ne(null,e=>{e.pub(Mo,t=>{function n(r){const[i,o]=e.getValues([nn,ty]);!i||o===null||t.update(()=>{const s=kn(r.target);if(s!==null){const a=fr(s,l=>l instanceof Zn);a!==null&&o(r,a,a.getURL())}})}return t.registerRootListener((r,i)=>{r&&r.addEventListener("click",n),i&&i.removeEventListener("click",n)})})}),_I=on({init(e,t){e.pub(qr,t?.LinkDialog??wI),e.pub(ey,t?.onClickLinkCallback??null),e.pub(ty,t?.onReadOnlyClickLinkCallback??null)},update(e,t={}){e.pub(Q5,t.linkAutocompleteSuggestions??[])}});function zd(e,t){return _.forwardRef((n,r)=>{const i=ke(t.className,n.className);return _.createElement(e,{...t,...n,className:i,ref:r})})}function kI(e){return({title:t,children:n,...r})=>_.createElement(e,{...r},_.createElement(ns,{title:t},n))}const SI=({readOnly:e,children:t,className:n})=>_.createElement(VE,{className:ke("mdxeditor-toolbar",Y.toolbarRoot,{[Y.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),EI=zd(Kx,{className:Y.toolbarButton,"data-toolbar-item":!0}),TI=kI(EI),ny=zd(WE,{className:Y.toolbarToggleItem,"data-toolbar-item":!0});zd(wd,{type:"single",className:Y.toolbarToggleSingleGroup});const ry=_.forwardRef(({on:e,title:t,children:n,disabled:r,...i},o)=>_.createElement(wd,{type:"single",className:Y.toolbarToggleSingleGroup,...i,value:e?"on":"off",ref:o},_.createElement(ny,{"aria-label":t,value:"on",disabled:r},_.createElement(ns,{title:t},n)))),II=({items:e})=>_.createElement("div",{className:Y.toolbarGroupOfGroups},e.map((t,n)=>_.createElement(ry,{key:n,title:t.title,on:t.active,onValueChange:r=>{t.onChange(r==="on")},disabled:t.disabled},t.contents))),NI=({value:e,onChange:t,className:n,ggClassName:r,items:i})=>{const o=Bt();return _.createElement("div",{className:ke(Y.toolbarGroupOfGroups,r)},_.createElement(wd,{"aria-label":o("toolbar.toggleGroup","toggle group"),type:"single",className:ke(Y.toolbarToggleSingleGroup,n),onValueChange:t,value:e||"",onFocus:s=>{s.preventDefault()}},i.map((s,a)=>_.createElement(ny,{key:a,"aria-label":s.title,value:s.value},_.createElement(ns,{title:s.title},s.contents)))))},Og=zE,Vl=ne(()=>null),zl=ne(""),Pg=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",MI=on({init(e,t){const n=t?.toolbarPosition==="bottom"?s8:o8;e.pubIn({[Vl]:t?.toolbarContents??Pg,[zl]:t?.toolbarClassName??"",[n]:()=>{const[r,i,o]=rn(Vl,nn,zl);return _.createElement(SI,{className:o,readOnly:i},r())}})},update(e,t){e.pub(Vl,t?.toolbarContents??Pg),e.pub(zl,t?.toolbarClassName??"")}});var Wl={exports:{}},Fg;function AI(){return Fg||(Fg=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
92
92
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
93
93
|
*
|
|
94
94
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
@@ -103,4 +103,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
103
103
|
`),r=[];for(const i of n)r.push("> "+i);return r.join(`
|
|
104
104
|
`)},regExp:GI,replace:(e,t,n,r)=>{if(r){const o=e.getPreviousSibling();if(vu(o))return o.splice(o.getChildrenSize(),0,[Qt(),...t]),o.select(0,0),void e.remove()}const i=Zo();i.append(...t),e.replace(i),i.select(0,0)},type:"element"},fy={dependencies:[Wd],export:e=>{if(!jd(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
|
|
105
105
|
`+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:QI},regExpStart:XI,replace:(e,t,n,r,i,o)=>{let s,a;if(!t&&i){if(i.length===1)r?(s=Hn(),a=n[1]+i[0]):(s=Hn(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(s=Hn(n[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();a=i.join(`
|
|
106
|
-
`)}const l=Re(a);s.append(l),e.append(s)}else t&&cy(l=>Hn(l?l[1]:void 0))(e,t,n,o)},type:"multiline-element"},hy={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:ZI,replace:Ud("bullet"),type:"element"},tN={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:qI,replace:Ud("check"),type:"element"},gy={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:KI,replace:Ud("number"),type:"element"},py={format:["code"],tag:"`",type:"text-format"},nN={format:["highlight"],tag:"==",type:"text-format"},my={format:["bold","italic"],tag:"***",type:"text-format"},xy={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},yy={format:["bold"],tag:"**",type:"text-format"},by={format:["bold"],intraword:!1,tag:"__",type:"text-format"},rN={format:["strikethrough"],tag:"~~",type:"text-format"},vy={format:["italic"],tag:"*",type:"text-format"},Cy={format:["italic"],intraword:!1,tag:"_",type:"text-format"},wy={dependencies:[Zn],export:(e,t,n)=>{if(!yn(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,o=jr(r,{title:i}),s=Re(n);return s.setFormat(e.getFormat()),o.append(s),e.replace(o),s},trigger:")",type:"text-match"},iN=[eN,dy,hy,gy],oN=[fy],sN=[py,my,xy,yy,by,nN,vy,Cy,rN],aN=[wy],_y=[...iN,...oN,...sN,...aN],lN=[{dependencies:[Xo],export:e=>Wa(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=Ri();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},..._y];function Gg({transformers:e=lN}){const[t]=yt();return I.useEffect(()=>JI(t,e),[t,e]),null}const uN=on({init(e){const t=e.getValue(pd),n=t.includes("headings")?e.getValue(za):[],r=fN(t,n);e.pubIn({[qr]:()=>_.createElement(Gg,{transformers:r}),[rx]:()=>_.createElement(Gg,{transformers:r})})}}),cN=e=>(t,n,r)=>{const i=e(r);i.append(...n),t.replace(i),i.select(0,0)},dN={dependencies:[Xo],export:e=>Wa(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=Ri();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"};function fN(e,t){const n=[my,xy,yy,by,py,vy,Cy];if(e.includes("headings")){const r=Math.min(...t),i=Math.max(...t),o=new RegExp(`^(#{${r},${i}})\\s`),s={dependencies:[qo],export:(a,l)=>{if(!Da(a))return null;const u=Number(a.getTag().slice(1));return"#".repeat(u)+" "+l(a)},regExp:o,replace:cN(a=>{const l=`h${a[1].length}`;return vn(l)}),type:"element"};n.push(s)}if(e.includes("thematicBreak")&&n.push(dN),e.includes("quote")&&n.push(dy),e.includes("link")&&n.push(wy),e.includes("lists")&&n.push(gy,hy,tN),e.includes("codeblock")){const r={...fy,dependencies:[Bi],replace:(i,o,s)=>{const a=ts({code:"",language:s[1]??"",meta:""});i.replace(a),setTimeout(()=>{a.select()},80)}};n.push(r)}return n}const hN=()=>{const e=_t(Qs),t=Ot(ix),n=Ot(pd),r=n.includes("quote"),i=n.includes("headings"),o=Bt();if(!r&&!i)return null;const s=[{label:o("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&s.push({label:o("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const a=Ot(za);s.push(...a.map(l=>({label:o("toolbar.blockTypes.heading","Heading {{level}}",{level:l}),value:`h${l}`})))}return _.createElement(bI,{value:t,onChange:a=>{switch(a){case"quote":e(()=>Zo());break;case"paragraph":e(()=>Ee());break;case"":break;default:if(a.startsWith("h"))e(()=>vn(a));else throw new Error(`Unknown block type: ${a}`)}},triggerTitle:o("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:o("toolbar.blockTypeSelect.placeholder","Block type"),items:s})},Jl=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{const[o,s]=rn(D0,In),a=_t(R0),l=(o&e)!==0;return _.createElement(ry,{title:l?n:t,on:l,onValueChange:()=>{a(i)}},s(r))},gN=({options:e})=>{const t=Bt(),n=typeof e>"u";return _.createElement("div",{className:Y.toolbarGroupOfGroups},n||e.includes("Bold")?_.createElement(Jl,{format:co,addTitle:t("toolbar.bold","Bold"),removeTitle:t("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,n||e.includes("Italic")?_.createElement(Jl,{format:fo,addTitle:t("toolbar.italic","Italic"),removeTitle:t("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,n||e.includes("Underline")?_.createElement(Jl,{format:ho,addTitle:t("toolbar.underline","Underline"),removeTitle:t("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},pN=()=>{const e=_t(Vd),t=Ot(In),n=Bt();return _.createElement(TI,{"aria-label":n("toolbar.link","Create link"),title:n("toolbar.link","Create link"),onClick:r=>{e()}},t("link"))},mN=_.forwardRef((e,t)=>{const n=_t(m5),[r,i]=rn(nn,In),o=Bt();return _.createElement(Kx,{className:Y.toolbarButton,ref:t,disabled:r,onClick:()=>{n()}},_.createElement(ns,{title:o("toolbar.image","Insert image")},i("add_photo")))}),xN={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},yN=({options:e=["bullet","number","check"]})=>{const[t,n]=rn(Uu,In),r=_t(wx),i=Bt(),o={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},s=e.map(a=>({value:a,title:o[a],contents:n(xN[a])}));return _.createElement(NI,{value:t||"",items:s,onChange:r})},bN=()=>{const[e,t]=rn(In,qe),[n,r]=_.useState(!1),[i,o]=_.useState(!1),s=Bt();return _.useEffect(()=>{if(t)return Mt(t.registerCommand(Xi,a=>(r(a),!1),zn),t.registerCommand(Gi,a=>(o(a),!1),zn))},[t]),_.createElement(II,{items:[{title:s("toolbar.undo","Undo {{shortcut}}",{shortcut:na?"⌘Z":"Ctrl+Z"}),disabled:!n,contents:e("undo"),active:!1,onChange:()=>t?.dispatchCommand(ba,void 0)},{title:s("toolbar.redo","Redo {{shortcut}}",{shortcut:na?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:e("redo"),active:!1,onChange:()=>t?.dispatchCommand(va,void 0)}]})},vN="_mdxeditor_1hpme_2",CN={mdxeditor:vN},wN={match:(e,t)=>!0,priority:0,Editor:e=>{const t=TT();return M.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:n=>n.nativeEvent.stopImmediatePropagation(),children:[M.jsx("input",{defaultValue:e.language}),M.jsx("textarea",{className:"flex-1",defaultValue:e.code,onChange:n=>t.setCode(n.target.value)})]})}};function _N(e){const t=[];function n(r){for(const i of r)t.push(i),i.children&&n(i.children)}return n(e),t}function kN({className:e,markdown:t,name:n,register:r,onChange:i}){const{data:o}=ep(),s=I.useMemo(()=>o?_N(o):[],[o]);return M.jsx(O6,{...r(n),className:he("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",CN.mdxeditor,e),suppressHtmlProcessing:!0,markdown:t,onChange:i,plugins:[$6(),p4(),sE(),_I(),wT(),fT({imageAutocompleteSuggestions:s?.filter(a=>a.type!=="directory").map(a=>a.relativePath),imagePreviewHandler:a=>new Promise(l=>l(`http://localhost:3001/${a}`)),disableImageResize:!0,disableImageSettingsButton:!1}),U6(),uN(),FT({codeBlockEditorDescriptors:[wN]}),MI({toolbarClassName:"flex flex-row overflow-hidden shrink-0 h-10 border-b bg-white rounded-none",toolbarContents:()=>M.jsx(M.Fragment,{children:M.jsxs("div",{className:"flex items-center flex-1 gap-1",children:[M.jsx(hN,{}),M.jsx(gN,{}),M.jsx(Og,{}),M.jsx(yN,{options:["bullet","number"]}),M.jsx(Og,{}),M.jsx(pN,{}),M.jsx(mN,{}),M.jsx("div",{className:"ml-auto",children:M.jsx(bN,{})})]})})})]})}function SN({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:i}){return M.jsxs(gm,{children:[M.jsx(pm,{asChild:!0,children:M.jsxs(pi,{variant:"outline",className:he("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",i),disabled:r,children:[M.jsx(kp,{className:"mr-2 h-4 w-4"}),e?io(e,"PPP"):M.jsx("span",{children:n})]})}),M.jsx(mm,{className:"w-auto p-0",children:M.jsx(Xp,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function EN({...e}){return M.jsxs("div",{className:"relative flex justify-center items-center",children:[M.jsx(mo,{...e}),e.value&&M.jsx(Xg,{to:e.value,className:"flex items-center absolute right-0 mr-3",children:M.jsx(Sp,{className:"h-4"})})]})}function KN({itemType:e,fields:t,data:n,isNew:r}){const[i]=Dy(),[o]=Ry(),s=I.useCallback(d=>({id:n?.id??"",...Object.fromEntries(Object.keys(d).map(f=>[f,n?.[f]??(d[f].type==="boolean"?!1:"")]))}),[n,t]),a=I.useMemo(()=>{const d={id:Gr().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers")};return Object.entries(t).forEach(([f,h])=>{let g;switch(h.type){case"boolean":g=My();break;case"number":g=Gr().refine(x=>!isNaN(Number(x)),"Must be a valid number");break;case"url":g=Gr().url("Must be a valid URL");break;case"date":g=Gr();break;case"datetime":g=Gr();break;default:g=Gr()}h.isRequired?h.type!=="boolean"&&(g=g.min(1,`${h.displayName} is required`)):g=g.optional().or(Ay("")),d[f]=g}),Oy(d)},[t]),l=uc({resolver:Ly(a),defaultValues:s(t)});I.useEffect(()=>{if(!l)return;const d=window.location.hash;d&&l.setFocus(d.substring(1))},[l]),I.useEffect(()=>{const d=f=>{(f.ctrlKey||f.metaKey)&&f.key==="s"&&(f.preventDefault(),(l.formState.isDirty||r)&&l.handleSubmit(u)())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r,u]);async function u(d){r?i({...d,type:e}):o({...d,type:e})}const c=I.useMemo(()=>Object.entries(t).filter(([,d])=>d.type==="boolean"),[t]);return M.jsxs(Py,{...l,children:[M.jsxs("form",{onSubmit:l.handleSubmit(u),className:"space-y-4 max-w-[800px] w-[800px]",children:[M.jsx(Qa,{name:"id",control:l.control,disabled:n?.id==="default",rules:{required:!0},render:({field:d})=>n?.id==="default"?M.jsx(M.Fragment,{}):M.jsxs(el,{children:[M.jsx(is,{className:"flex gap-1 items-baseline",children:"ID"}),M.jsx(tl,{children:M.jsx(mo,{placeholder:"my-item-id",...l.register("id"),...d,onChange:f=>{const h=f.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");d.onChange(h)},onBlur:f=>{const h=f.target.value.trim().replace(/^-+|-+$/g,"");d.onChange(h)}})}),M.jsx(nl,{})]})}),c.length>0&&M.jsxs("div",{className:"flex flex-col gap-3",children:[M.jsx(is,{children:"Flags"}),M.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:c.map(([d,f])=>M.jsx(Qa,{name:d,control:l.control,render:({field:h})=>M.jsxs(el,{className:"flex flex-col items-start",children:[M.jsxs("div",{className:"flex flex-row space-x-2",children:[M.jsx(tl,{children:M.jsx(Fy,{...l.register(d),checked:h.value==="true",onCheckedChange:g=>{h.onChange(g===!0?"true":"false")}})}),M.jsx(is,{className:"flex gap-1 items-baseline",children:f.displayName})]}),f.displayExtra&&M.jsx(Kd,{children:f.displayExtra}),M.jsx(nl,{})]})},d))})]}),Object.entries(t).filter(([,d])=>d.type!=="boolean").map(([d,f])=>M.jsx(Qa,{name:d,control:l.control,rules:{required:f.isRequired},render:({field:h})=>M.jsxs(el,{children:[M.jsxs(is,{className:"flex gap-1 items-baseline",children:[f.displayName,!f.isRequired&&M.jsx("span",{className:"text-gray-400",children:"(optional)"})]}),M.jsx(tl,{children:f.type==="markdown"?M.jsx(kN,{name:d,register:l.register,className:"h-52",markdown:h.value,onChange:(g,x)=>{x||h.onChange(g)},placeholder:f.placeholder}):f.type==="url"?M.jsx(EN,{...l.register(d),placeholder:f.placeholder??"https://",...h}):f.type==="string"&&f.isUploadedFile?M.jsx(zC,{name:d,register:l.register,value:h.value,onChange:h.onChange}):f.type==="date"?M.jsx(SN,{...l.register(d),date:h.value?new Date(h.value):void 0,onDateChange:g=>{h.onChange(g?g.toISOString():void 0)},placeholder:f.placeholder??"Select date"}):f.type==="datetime"?M.jsx(fC,{...l.register(d),date:h.value?new Date(h.value):void 0,onDateTimeChange:g=>{h.onChange(g?g.toISOString():void 0)},placeholder:f.placeholder??"Select date and time"}):M.jsx(mo,{...l.register(d),placeholder:f.placeholder,...h})}),f.displayExtra&&M.jsx(Kd,{children:f.displayExtra}),M.jsx(nl,{})]})},d)),M.jsxs(pi,{disabled:!l.formState.isDirty&&!r,type:"submit",children:[M.jsx(Xy,{})," Save"]})]}),M.jsx(VC,{hasUnsavedChanges:l.formState.isDirty})]})}export{KN as I};
|
|
106
|
+
`)}const l=Re(a);s.append(l),e.append(s)}else t&&cy(l=>Hn(l?l[1]:void 0))(e,t,n,o)},type:"multiline-element"},hy={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:ZI,replace:Ud("bullet"),type:"element"},tN={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:qI,replace:Ud("check"),type:"element"},gy={dependencies:[Nn,ln],export:(e,t)=>de(e)?Ya(e,t,0):null,regExp:KI,replace:Ud("number"),type:"element"},py={format:["code"],tag:"`",type:"text-format"},nN={format:["highlight"],tag:"==",type:"text-format"},my={format:["bold","italic"],tag:"***",type:"text-format"},xy={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},yy={format:["bold"],tag:"**",type:"text-format"},by={format:["bold"],intraword:!1,tag:"__",type:"text-format"},rN={format:["strikethrough"],tag:"~~",type:"text-format"},vy={format:["italic"],tag:"*",type:"text-format"},Cy={format:["italic"],intraword:!1,tag:"_",type:"text-format"},wy={dependencies:[Zn],export:(e,t,n)=>{if(!yn(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,o=jr(r,{title:i}),s=Re(n);return s.setFormat(e.getFormat()),o.append(s),e.replace(o),s},trigger:")",type:"text-match"},iN=[eN,dy,hy,gy],oN=[fy],sN=[py,my,xy,yy,by,nN,vy,Cy,rN],aN=[wy],_y=[...iN,...oN,...sN,...aN],lN=[{dependencies:[Xo],export:e=>Wa(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=Ri();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},..._y];function Gg({transformers:e=lN}){const[t]=yt();return I.useEffect(()=>JI(t,e),[t,e]),null}const uN=on({init(e){const t=e.getValue(pd),n=t.includes("headings")?e.getValue(za):[],r=fN(t,n);e.pubIn({[qr]:()=>_.createElement(Gg,{transformers:r}),[rx]:()=>_.createElement(Gg,{transformers:r})})}}),cN=e=>(t,n,r)=>{const i=e(r);i.append(...n),t.replace(i),i.select(0,0)},dN={dependencies:[Xo],export:e=>Wa(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=Ri();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"};function fN(e,t){const n=[my,xy,yy,by,py,vy,Cy];if(e.includes("headings")){const r=Math.min(...t),i=Math.max(...t),o=new RegExp(`^(#{${r},${i}})\\s`),s={dependencies:[qo],export:(a,l)=>{if(!Da(a))return null;const u=Number(a.getTag().slice(1));return"#".repeat(u)+" "+l(a)},regExp:o,replace:cN(a=>{const l=`h${a[1].length}`;return vn(l)}),type:"element"};n.push(s)}if(e.includes("thematicBreak")&&n.push(dN),e.includes("quote")&&n.push(dy),e.includes("link")&&n.push(wy),e.includes("lists")&&n.push(gy,hy,tN),e.includes("codeblock")){const r={...fy,dependencies:[Bi],replace:(i,o,s)=>{const a=ts({code:"",language:s[1]??"",meta:""});i.replace(a),setTimeout(()=>{a.select()},80)}};n.push(r)}return n}const hN=()=>{const e=_t(Qs),t=Ot(ix),n=Ot(pd),r=n.includes("quote"),i=n.includes("headings"),o=Bt();if(!r&&!i)return null;const s=[{label:o("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(r&&s.push({label:o("toolbar.blockTypes.quote","Quote"),value:"quote"}),i){const a=Ot(za);s.push(...a.map(l=>({label:o("toolbar.blockTypes.heading","Heading {{level}}",{level:l}),value:`h${l}`})))}return _.createElement(bI,{value:t,onChange:a=>{switch(a){case"quote":e(()=>Zo());break;case"paragraph":e(()=>Ee());break;case"":break;default:if(a.startsWith("h"))e(()=>vn(a));else throw new Error(`Unknown block type: ${a}`)}},triggerTitle:o("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:o("toolbar.blockTypeSelect.placeholder","Block type"),items:s})},Jl=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{const[o,s]=rn(D0,In),a=_t(R0),l=(o&e)!==0;return _.createElement(ry,{title:l?n:t,on:l,onValueChange:()=>{a(i)}},s(r))},gN=({options:e})=>{const t=Bt(),n=typeof e>"u";return _.createElement("div",{className:Y.toolbarGroupOfGroups},n||e.includes("Bold")?_.createElement(Jl,{format:co,addTitle:t("toolbar.bold","Bold"),removeTitle:t("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,n||e.includes("Italic")?_.createElement(Jl,{format:fo,addTitle:t("toolbar.italic","Italic"),removeTitle:t("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,n||e.includes("Underline")?_.createElement(Jl,{format:ho,addTitle:t("toolbar.underline","Underline"),removeTitle:t("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},pN=()=>{const e=_t(Vd),t=Ot(In),n=Bt();return _.createElement(TI,{"aria-label":n("toolbar.link","Create link"),title:n("toolbar.link","Create link"),onClick:r=>{e()}},t("link"))},mN=_.forwardRef((e,t)=>{const n=_t(m5),[r,i]=rn(nn,In),o=Bt();return _.createElement(Kx,{className:Y.toolbarButton,ref:t,disabled:r,onClick:()=>{n()}},_.createElement(ns,{title:o("toolbar.image","Insert image")},i("add_photo")))}),xN={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},yN=({options:e=["bullet","number","check"]})=>{const[t,n]=rn(Uu,In),r=_t(wx),i=Bt(),o={bullet:i("toolbar.bulletedList","Bulleted list"),number:i("toolbar.numberedList","Numbered list"),check:i("toolbar.checkList","Check list")},s=e.map(a=>({value:a,title:o[a],contents:n(xN[a])}));return _.createElement(NI,{value:t||"",items:s,onChange:r})},bN=()=>{const[e,t]=rn(In,qe),[n,r]=_.useState(!1),[i,o]=_.useState(!1),s=Bt();return _.useEffect(()=>{if(t)return Mt(t.registerCommand(Xi,a=>(r(a),!1),zn),t.registerCommand(Gi,a=>(o(a),!1),zn))},[t]),_.createElement(II,{items:[{title:s("toolbar.undo","Undo {{shortcut}}",{shortcut:na?"⌘Z":"Ctrl+Z"}),disabled:!n,contents:e("undo"),active:!1,onChange:()=>t?.dispatchCommand(ba,void 0)},{title:s("toolbar.redo","Redo {{shortcut}}",{shortcut:na?"⌘Y":"Ctrl+Y"}),disabled:!i,contents:e("redo"),active:!1,onChange:()=>t?.dispatchCommand(va,void 0)}]})},vN="_mdxeditor_x49hi_2",CN={mdxeditor:vN},wN={match:(e,t)=>!0,priority:0,Editor:e=>{const t=TT();return M.jsxs("div",{className:"flex flex-col bg-gray-100 my-4",onKeyDown:n=>n.nativeEvent.stopImmediatePropagation(),children:[M.jsx("input",{defaultValue:e.language}),M.jsx("textarea",{className:"flex-1",defaultValue:e.code,onChange:n=>t.setCode(n.target.value)})]})}};function _N(e){const t=[];function n(r){for(const i of r)t.push(i),i.children&&n(i.children)}return n(e),t}function kN({className:e,markdown:t,name:n,register:r,onChange:i}){const{data:o}=ep(),s=I.useMemo(()=>o?_N(o):[],[o]);return M.jsx(O6,{...r(n),className:he("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",CN.mdxeditor,e),suppressHtmlProcessing:!0,markdown:t,onChange:i,plugins:[$6(),pE(),s4(),_I(),wT(),fT({imageAutocompleteSuggestions:s?.filter(a=>a.type!=="directory").map(a=>a.relativePath),imagePreviewHandler:a=>new Promise(l=>l(`/${a}`)),disableImageResize:!0,disableImageSettingsButton:!1}),U6(),uN(),FT({codeBlockEditorDescriptors:[wN]}),MI({toolbarClassName:"flex flex-row overflow-hidden shrink-0 h-10 border-b bg-white rounded-none",toolbarContents:()=>M.jsx(M.Fragment,{children:M.jsxs("div",{className:"flex items-center flex-1 gap-1",children:[M.jsx(hN,{}),M.jsx(gN,{}),M.jsx(Og,{}),M.jsx(yN,{options:["bullet","number"]}),M.jsx(Og,{}),M.jsx(pN,{}),M.jsx(mN,{}),M.jsx("div",{className:"ml-auto",children:M.jsx(bN,{})})]})})})]})}function SN({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:i}){return M.jsxs(gm,{children:[M.jsx(pm,{asChild:!0,children:M.jsxs(pi,{variant:"outline",className:he("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",i),disabled:r,children:[M.jsx(kp,{className:"mr-2 h-4 w-4"}),e?io(e,"PPP"):M.jsx("span",{children:n})]})}),M.jsx(mm,{className:"w-auto p-0",children:M.jsx(Xp,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function EN({...e}){return M.jsxs("div",{className:"relative flex justify-center items-center",children:[M.jsx(mo,{...e}),e.value&&M.jsx(Xg,{to:e.value,className:"flex items-center absolute right-0 mr-3",children:M.jsx(Sp,{className:"h-4"})})]})}function KN({itemType:e,fields:t,data:n,isNew:r}){const[i]=Dy(),[o]=Ry(),s=I.useCallback(d=>({id:n?.id??"",...Object.fromEntries(Object.keys(d).map(f=>[f,n?.[f]??(d[f].type==="boolean"?!1:"")]))}),[n,t]),a=I.useMemo(()=>{const d={id:Gr().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers")};return Object.entries(t).forEach(([f,h])=>{let g;switch(h.type){case"boolean":g=My();break;case"number":g=Gr().refine(x=>!isNaN(Number(x)),"Must be a valid number");break;case"url":g=Gr().url("Must be a valid URL");break;case"date":g=Gr();break;case"datetime":g=Gr();break;default:g=Gr()}h.isRequired?h.type!=="boolean"&&(g=g.min(1,`${h.displayName} is required`)):g=g.optional().or(Ay("")),d[f]=g}),Oy(d)},[t]),l=uc({resolver:Ly(a),defaultValues:s(t)});I.useEffect(()=>{if(!l)return;const d=window.location.hash;d&&l.setFocus(d.substring(1))},[l]),I.useEffect(()=>{const d=f=>{(f.ctrlKey||f.metaKey)&&f.key==="s"&&(f.preventDefault(),(l.formState.isDirty||r)&&l.handleSubmit(u)())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r,u]);async function u(d){r?i({...d,type:e}):o({...d,type:e})}const c=I.useMemo(()=>Object.entries(t).filter(([,d])=>d.type==="boolean"),[t]);return M.jsxs(Py,{...l,children:[M.jsxs("form",{onSubmit:l.handleSubmit(u),className:"space-y-4 max-w-[800px] w-[800px]",children:[M.jsx(Qa,{name:"id",control:l.control,disabled:n?.id==="default",rules:{required:!0},render:({field:d})=>n?.id==="default"?M.jsx(M.Fragment,{}):M.jsxs(el,{children:[M.jsx(is,{className:"flex gap-1 items-baseline",children:"ID"}),M.jsx(tl,{children:M.jsx(mo,{placeholder:"my-item-id",...l.register("id"),...d,onChange:f=>{const h=f.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");d.onChange(h)},onBlur:f=>{const h=f.target.value.trim().replace(/^-+|-+$/g,"");d.onChange(h)}})}),M.jsx(nl,{})]})}),c.length>0&&M.jsxs("div",{className:"flex flex-col gap-3",children:[M.jsx(is,{children:"Flags"}),M.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:c.map(([d,f])=>M.jsx(Qa,{name:d,control:l.control,render:({field:h})=>M.jsxs(el,{className:"flex flex-col items-start",children:[M.jsxs("div",{className:"flex flex-row space-x-2",children:[M.jsx(tl,{children:M.jsx(Fy,{...l.register(d),checked:h.value==="true",onCheckedChange:g=>{h.onChange(g===!0?"true":"false")}})}),M.jsx(is,{className:"flex gap-1 items-baseline",children:f.displayName})]}),f.displayExtra&&M.jsx(Kd,{children:f.displayExtra}),M.jsx(nl,{})]})},d))})]}),Object.entries(t).filter(([,d])=>d.type!=="boolean").map(([d,f])=>M.jsx(Qa,{name:d,control:l.control,rules:{required:f.isRequired},render:({field:h})=>M.jsxs(el,{children:[M.jsxs(is,{className:"flex gap-1 items-baseline",children:[f.displayName,!f.isRequired&&M.jsx("span",{className:"text-gray-400",children:"(optional)"})]}),M.jsx(tl,{children:f.type==="markdown"?M.jsx(kN,{name:d,register:l.register,className:"h-52",markdown:h.value,onChange:(g,x)=>{x||h.onChange(g)},placeholder:f.placeholder}):f.type==="url"?M.jsx(EN,{...l.register(d),placeholder:f.placeholder??"https://",...h}):f.type==="string"&&f.isUploadedFile?M.jsx(zC,{name:d,register:l.register,value:h.value,onChange:h.onChange}):f.type==="date"?M.jsx(SN,{...l.register(d),date:h.value?new Date(h.value):void 0,onDateChange:g=>{h.onChange(g?g.toISOString():void 0)},placeholder:f.placeholder??"Select date"}):f.type==="datetime"?M.jsx(fC,{...l.register(d),date:h.value?new Date(h.value):void 0,onDateTimeChange:g=>{h.onChange(g?g.toISOString():void 0)},placeholder:f.placeholder??"Select date and time"}):M.jsx(mo,{...l.register(d),placeholder:f.placeholder,...h})}),f.displayExtra&&M.jsx(Kd,{children:f.displayExtra}),M.jsx(nl,{})]})},d)),M.jsxs(pi,{disabled:!l.formState.isDirty&&!r,type:"submit",children:[M.jsx(Xy,{})," Save"]})]}),M.jsx(VC,{hasUnsavedChanges:l.formState.isDirty})]})}export{KN as I};
|