@llmops/app 0.1.8 → 0.1.9-beta.1
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/dist/.vite/manifest.json +285 -366
- package/dist/assets/Form-DHA5ZPmK.js +1 -0
- package/dist/assets/_environment-Bj632BW3.js +1 -0
- package/dist/assets/_observability-Bsw31e8i.js +1 -0
- package/dist/assets/_settings-MuCcKpRb.js +1 -0
- package/dist/assets/{_tabs-DaucGqpx.js → _tabs-DR5WY23M.js} +1 -1
- package/dist/assets/{_tabs-D9USU0yw.js → _tabs-Osf37WI9.js} +1 -1
- package/dist/assets/_variant-DGrwitKk.js +30 -0
- package/dist/assets/{_variants-Bjp8ZEvO.js → _variants-C7fc4T8_.js} +1 -1
- package/dist/assets/{area.css-CSjofvHM.js → area.css-ByjMFuMe.js} +1 -1
- package/dist/assets/auth-BkNQi67-.css +1 -0
- package/dist/assets/auth.css-CbKu-iME.js +1 -0
- package/dist/assets/button-J5fxAIyE.js +1 -0
- package/dist/assets/check-BdOT-uCr.js +1 -0
- package/dist/assets/{chevron-right-fMWRsRLZ.js → chevron-right-CcvZen9O.js} +1 -1
- package/dist/assets/combobox-BKEpKROu.js +1 -0
- package/dist/assets/configs-BEKTOPIS.js +1 -0
- package/dist/assets/{copy-DADLeZ69.js → copy-Btrg1ewH.js} +1 -1
- package/dist/assets/{costs-Fh0OPnEw.js → costs-C0sD1amq.js} +1 -1
- package/dist/assets/environments-CZ6PX9PA.js +1 -0
- package/dist/assets/index-C1Qc7Z7W.js +27 -0
- package/dist/assets/index-C8Gwa2Ui.js +1 -0
- package/dist/assets/{index-DeuSY0Yv.js → index-CAScpK2G.js} +1 -1
- package/dist/assets/{index-DW-cTzEh.js → index-CPQ3xdGh.js} +1 -1
- package/dist/assets/index-CPokRl9v.js +1 -0
- package/dist/assets/index-CQALuvff.js +1 -0
- package/dist/assets/{index-BFe2NM3q.css → index-CgbnU9Zg.css} +1 -1
- package/dist/assets/{index-Cns5MLjo.js → index-ChLdrp-m.js} +1 -1
- package/dist/assets/{index.esm-oCSEvUVx.js → index.esm-BVbruXk6.js} +1 -1
- package/dist/assets/info-box.css-BzqwxgQm.js +1 -0
- package/dist/assets/logo-D4ybjOzp.css +1 -0
- package/dist/assets/logo.css-BHDDnlVa.js +1 -0
- package/dist/assets/new-config-state-B8sMe-TC.css +1 -0
- package/dist/assets/new-config-state.css-DccH1TI0.js +1 -0
- package/dist/assets/{observability.css-wgjHtY3p.js → observability.css-D5kKsJ4z.js} +1 -1
- package/dist/assets/{overview-D1QIYPBL.js → overview-Czui5UTZ.js} +5 -5
- package/dist/assets/plus-DqiZvCBU.js +1 -0
- package/dist/assets/popover-BndR7yWD.js +1 -0
- package/dist/assets/requests-DrSJLtrE.js +1 -0
- package/dist/assets/{route-Df57lqxl.js → route-22shZRiS.js} +1 -1
- package/dist/assets/route-7Tn2yELm.js +1 -0
- package/dist/assets/{route-CjAw8hSU.js → route-CqIm0KnA.js} +1 -1
- package/dist/assets/{route-timDYxX2.js → route-D_QnUz7-.js} +1 -1
- package/dist/assets/{route-DmWZbVk6.js → route-DwYQMwtZ.js} +1 -1
- package/dist/assets/secrets-DnWQ2F0V.js +1 -0
- package/dist/assets/settings-c6c9IYPa.js +1 -0
- package/dist/assets/settings-sisslKb5.js +1 -0
- package/dist/assets/setup-G_oS-RU-.js +1 -0
- package/dist/assets/signin-B-qadLup.js +1 -0
- package/dist/assets/table-jMzD3FNy.js +1 -0
- package/dist/assets/{tabs.css-CG5ugi0p.js → tabs.css-CkcP1Ksc.js} +1 -1
- package/dist/assets/targeting-CaE84Lx8.js +1 -0
- package/dist/assets/tooltip-BiUUXiGj.js +1 -0
- package/dist/assets/{update-or-create-name-B-M46wHl.js → update-or-create-name-DGt2MGEI.js} +1 -1
- package/dist/assets/useAnalytics-CHDelHQa.js +1 -0
- package/dist/assets/useConfigList-Bx9xKceA.js +1 -0
- package/dist/assets/{useConfigVariants-CLc_hPw1.js → useConfigVariants-CB0S5gfJ.js} +1 -1
- package/dist/assets/useEnvironments-DILRhv_b.js +1 -0
- package/dist/assets/{useMutation-D4JglXWk.js → useMutation-CNzYa4ST.js} +1 -1
- package/dist/assets/usePopupAutoResize-CaO9EPHk.js +1 -0
- package/dist/assets/{useSetTargeting-bk0Ixhqq.js → useSetTargeting-DY3jI95T.js} +1 -1
- package/dist/assets/useTargetingRules-D10mXxut.js +1 -0
- package/dist/assets/useValueChanged-8LsiEynk.js +1 -0
- package/dist/assets/{user-profile-BB3dPOc5.js → user-profile-8xq1f7_D.js} +1 -1
- package/dist/assets/variants-rQQlpgeF.js +1 -0
- package/dist/assets/variants.css-Dzb38Nu1.js +1 -0
- package/dist/assets/{workspace-general-DYXfOF9H.js → workspace-general-dH65Sm8D.js} +1 -1
- package/dist/index.cjs +136 -59
- package/dist/index.d.cts +8 -5
- package/dist/index.d.mts +8 -5
- package/dist/index.mjs +138 -61
- package/package.json +4 -3
- package/dist/assets/Form-Bh6BPtQ_.js +0 -1
- package/dist/assets/InternalBackdrop-Za9lpJi7.js +0 -12
- package/dist/assets/_environment-COxSWJ9w.js +0 -1
- package/dist/assets/_observability-C8wSXZk2.js +0 -1
- package/dist/assets/_settings-DOmj1R7I.js +0 -1
- package/dist/assets/_variant-DxME2BL0.js +0 -30
- package/dist/assets/button-CMZqhyXB.js +0 -1
- package/dist/assets/check-D9E8RKB4.js +0 -1
- package/dist/assets/chevron-down-BJFxhYkh.js +0 -1
- package/dist/assets/combobox-iSbUYz0A.js +0 -1
- package/dist/assets/configs-BflhBVlY.js +0 -1
- package/dist/assets/environments-ChldQPyq.js +0 -1
- package/dist/assets/getDisabledMountTransitionStyles-TZFYxPIU.js +0 -1
- package/dist/assets/index-BDsrc1Q7.js +0 -1
- package/dist/assets/index-BWU02PnY.js +0 -1
- package/dist/assets/index-DYoud8po.js +0 -1
- package/dist/assets/index-FrTQ7TcS.js +0 -16
- package/dist/assets/info-box.css-DuVI9M9-.js +0 -1
- package/dist/assets/llmops-B3IIte87.css +0 -1
- package/dist/assets/llmops-CdOQq40D.js +0 -1
- package/dist/assets/plus-JQ0TORpd.js +0 -1
- package/dist/assets/popover-DXj4s-ni.js +0 -1
- package/dist/assets/popupStateMapping-DolkyTT3.js +0 -1
- package/dist/assets/requests-CzvYwfwV.js +0 -1
- package/dist/assets/reselect-DVmmTZGf.js +0 -1
- package/dist/assets/secrets-BxFGEuKj.js +0 -1
- package/dist/assets/settings-DpSRw7LL.js +0 -1
- package/dist/assets/settings-pgWZnVf6.js +0 -1
- package/dist/assets/table-DggTSlPh.js +0 -1
- package/dist/assets/targeting-CkqRTjnZ.js +0 -1
- package/dist/assets/tooltip-BuSsMQ8P.js +0 -1
- package/dist/assets/useAnalytics-DTf81POS.js +0 -1
- package/dist/assets/useButton-CsZ8hBM8.js +0 -1
- package/dist/assets/useConfigList-CAf01_dV.js +0 -1
- package/dist/assets/useEnvironments-Bu_0SIUj.js +0 -1
- package/dist/assets/useFocus-9TCY0h5x.js +0 -1
- package/dist/assets/usePopupAutoResize-D6RSlB-m.js +0 -1
- package/dist/assets/useRole-CiSaVva3.js +0 -1
- package/dist/assets/useSyncedFloatingRootContext-BKbVh8Gq.js +0 -1
- package/dist/assets/useTargetingRules-BrgaEdxR.js +0 -1
- package/dist/assets/useValueChanged-CTjBqaGs.js +0 -1
- package/dist/assets/variants-BH682hHM.js +0 -1
- package/dist/assets/variants.css-rCWHZycz.js +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{b3 as Af,r as A,b4 as kc,j as T,b5 as Ff,b6 as Nc,b7 as Ac,b8 as Pf,ao as si,b9 as Of,ba as If,a5 as Fc,bb as Rf,aq as $f,ar as Mf,a$ as Lf,am as Df,as as Gn,at as Bf,$ as We,bc as Pc,X as dr,Y as jf,b2 as Oc,V as ws,bd as Ic,be as or,bf as zf,bg as Uf,bh as Kf,az as Rc,bi as Yi,bj as Wf,bk as da,bl as Vf,a3 as qf,bm as $c,bn as fa,bo as Hf,aW as Jf,bp as Mc,bq as Lc,br as Dc,bs as Bc,bt as jc,bu as zc,bv as Gf,s as Zf,c as ze,h as Yf,I as Uc,H as ga,bw as ha,u as Xf,k as _o,bx as pa,by as ma,bz as ya,bA as Qf,z as Kc,bB as eg,n as Wc,bC as tg,g as ng,bD as rg}from"./index-C1Qc7Z7W.js";import{u as Vc,a as ig,b as sg,c as og,d as ag,e as vo}from"./combobox-BKEpKROu.js";import{e as qc,i as Ut,u as lg}from"./index.esm-BVbruXk6.js";import{S as cg,v as _a,a as ug,b as dg,m as fg,c as gg,d as hg,g as pg,u as mg,e as yg,f as _g,h as vg,i as xg}from"./useSetTargeting-DY3jI95T.js";import{a as Hc,b as Jc,P as Gc}from"./popover-BndR7yWD.js";import{a as bg,u as Sg}from"./useValueChanged-8LsiEynk.js";import{C as Cg}from"./chevron-right-CcvZen9O.js";import{C as Zc}from"./check-BdOT-uCr.js";import{u as Yc}from"./useMutation-CNzYa4ST.js";import{g as Eg,u as wg}from"./useConfigVariants-CB0S5gfJ.js";import{u as Tg}from"./useTargetingRules-D10mXxut.js";import{B as Xi}from"./button-J5fxAIyE.js";import{u as kg}from"./useEnvironments-DILRhv_b.js";/* empty css *//* empty css */import"./usePopupAutoResize-CaO9EPHk.js";function Ng(n,e){if(n===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in n)return n;if(typeof n=="function")return{shouldBlockFn:async()=>await n(),enableBeforeUnload:!0,withResolver:!1};const t=!!(n.condition??!0),r=n.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function Ag(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:s=!1}=Ng(n),o=Af(),{history:a}=o,[l,u]=A.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return A.useEffect(()=>{const c=async f=>{function d(p){const _=o.parseLocation(p),S=o.getMatchedRoutes(_.pathname);return S.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:S.routeParams,search:o.options.parseSearch(p.search)}:{routeId:S.foundRoute.id,fullPath:S.foundRoute.fullPath,pathname:_.pathname,params:S.routeParams,search:o.options.parseSearch(p.search)}}const h=d(f.currentLocation),g=d(f.nextLocation);if(h.routeId==="__notFound__"&&g.routeId!=="__notFound__")return!1;const m=await t({action:f.action,current:h,next:g});if(!s)return m;if(!m)return!1;const x=await new Promise(p=>{u({status:"blocked",current:h,next:g,action:f.action,proceed:()=>p(!1),reset:()=>p(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),x};return i?void 0:a.block({blockerFn:c,enableBeforeUnload:r})},[t,r,i,s,a,o]),l}function Xc(n,e,t=(r,i)=>r===i){return n.length===e.length&&n.every((r,i)=>t(r,e[i]))}function Fg(n){const e=kc().store,t=A.useMemo(()=>({parentMenu:e}),[e]);return T.jsx(Ff.Provider,{value:t,children:T.jsx(Nc,{...n})})}const Pg=A.forwardRef(function(e,t){const{render:r,className:i,label:s,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:u=100,closeDelay:c=0,disabled:f=!1,...d}=e,h=Ac(),g=Pf(),{store:m}=kc(),y=si(o),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),S=Of(y,m),C=A.useCallback(re=>{const Z=S(re);return re!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:re,closeDelay:c}),Z},[S,c,m,y]),v=A.useRef(null),b=A.useCallback(re=>{v.current=re,m.set("activeTriggerElement",re)},[m]),w=If();if(!w?.parentMenu)throw new Error(Fc(37));m.useSyncedValue("closeDelay",c);const E=w.parentMenu,k=E.useState("itemProps"),F=E.useState("isActive",h.index),L=A.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),O=f||R,{getItemProps:B,itemRef:K}=Rf({closeOnClick:!1,disabled:O,highlighted:F,id:y,store:m,nativeButton:a,itemMetadata:L,nodeId:g?.nodeId}),D=m.useState("hoverEnabled"),U=m.useState("allowMouseEnter"),j=$f(p,{enabled:D&&l&&!O&&U,handleClose:Mf({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:c},triggerElementRef:v,externalTree:_}),X=Lf(p,{enabled:!O,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),te=Df([X]),J=m.useState("triggerProps",!0);delete J.id;const le=A.useMemo(()=>({disabled:O,highlighted:F,open:x}),[O,F,x]);return Gn("div",e,{state:le,stateAttributesMapping:Bf,props:[te.getReferenceProps(),j,J,k,{tabIndex:x||F?0:-1,onBlur(){F&&E.set("activeIndex",null)}},d,B],ref:[t,h.ref,K,C,b]})}),va=new Map;function Og(n,e){const t=JSON.stringify({locale:n,options:e}),r=va.get(t);if(r)return r;const i=new Intl.NumberFormat(n,e);return va.set(t,i),i}function Yr(n,e,t){return n==null?"":Og(e,t).format(n)}function Ts(n,e,t){return(n-e)*100/(t-e)}function ut(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}function Qc(n,e){return n-e}function Ig(n,e,t){const r=n.slice();return r[e]=t,r.sort(Qc)}function eu(n,e,t,r,i,s){let o=n;return o=ut(o,t,r),i&&(o=Ig(s,e,ut(o,s[e-1]||-1/0,s[e+1]||1/0))),o}function tu(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((i,s,o,a)=>(o===a.length-1||i.push(Math.abs(s-a[o+1])),i),[]);return Math.min(...r)>=e*t}const Cr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},nu=A.createContext(void 0);function Ti(){const n=A.useContext(nu);if(n===void 0)throw new Error(Fc(62));return n}function Rg(n){return"key"in n?Uf:Kf}function $g(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?Xc(n,e):!1}const Mg=A.forwardRef(function(e,t){const{"aria-labelledby":r,className:i,defaultValue:s,disabled:o=!1,id:a,format:l,largeStep:u=10,locale:c,render:f,max:d=100,min:h=0,minStepsBetweenValues:g=0,name:m,onValueChange:y,onValueCommitted:x,orientation:p="horizontal",step:_=1,thumbCollisionBehavior:S="push",thumbAlignment:C="center",value:v,...b}=e,w=si(a),E=We(y),k=We(x),{clearErrors:F}=bg(),{state:L,disabled:R,name:O,setTouched:B,setDirty:K,validityData:D,shouldValidateOnChange:U,validation:j}=Vc(),{labelId:X}=ig(),te=r??X,J=R||o,le=O??m,[V,re]=sg({controlled:v,default:s??h,name:"Slider"}),Z=A.useRef(null),ce=A.useRef(null),G=A.useRef([]),Q=A.useRef(null),ve=A.useRef(null),Y=A.useRef(-1),ue=A.useRef(null),he=A.useRef(null),Le=A.useRef("none"),W=Pc(l),[oe,ie]=A.useState(-1),[fe,se]=A.useState(-1),[De,mt]=A.useState(!1),[Ze,Pt]=A.useState(()=>new Map),[An,Qt]=A.useState([void 0,void 0]),ye=We(pe=>{ie(pe),pe!==-1&&se(pe)});og({id:w,commit:j.commit,value:V,controlRef:ce,name:le,getValue:()=>V}),Sg(V,()=>{F(le),U()?j.commit(V):j.commit(V,!0);const pe=D.initialValue;let yt;Array.isArray(V)&&Array.isArray(pe)?yt=!Xc(V,pe):yt=V!==pe,K(yt)});const en=We(pe=>{pe&&(ce.current=pe)}),Ye=Array.isArray(V),Xe=A.useMemo(()=>Ye?V.slice().sort(Qc):[ut(V,h,d)],[d,h,Ye,V]),He=We((pe,yt)=>{if(Number.isNaN(pe)||$g(pe,V))return;const lt=yt??dr(jf,void 0,void 0,{activeThumbIndex:-1});Le.current=lt.reason;const zt=new event.constructor(event.type,event);Object.defineProperty(zt,"target",{writable:!0,value:{value:pe,name:le}}),lt.event=zt,he.current=pe,E(pe,lt),!lt.isCanceled&&re(pe)}),tn=We((pe,yt,lt)=>{const zt=eu(pe,yt,h,d,Ye,Xe);if(tu(zt,_,g)){const Mr=Rg(lt);He(zt,dr(Mr,lt.nativeEvent,void 0,{activeThumbIndex:yt})),B(!0);const ua=he.current??zt;k(ua,Oc(Mr,lt.nativeEvent))}});ws(()=>{const pe=Ic(or(Z.current));J&&pe&&Z.current?.contains(pe)&&pe.blur()},[J]),J&&oe!==-1&&ye(-1);const nt=A.useMemo(()=>({...L,activeThumbIndex:oe,disabled:J,dragging:De,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:Xe}),[L,oe,J,De,d,h,g,p,_,Xe]),Ji=A.useMemo(()=>({active:oe,controlRef:ce,disabled:J,dragging:De,validation:j,formatOptionsRef:W,handleInputChange:tn,indicatorPosition:An,inset:C!=="center",labelId:te,largeStep:u,lastUsedThumbIndex:fe,lastChangedValueRef:he,lastChangeReasonRef:Le,locale:c,max:d,min:h,minStepsBetweenValues:g,name:le,onValueCommitted:k,orientation:p,pressedInputRef:Q,pressedThumbCenterOffsetRef:ve,pressedThumbIndexRef:Y,pressedValuesRef:ue,registerFieldControlRef:en,renderBeforeHydration:C==="edge",setActive:ye,setDragging:mt,setIndicatorPosition:Qt,setValue:He,state:nt,step:_,thumbCollisionBehavior:S,thumbMap:Ze,thumbRefs:G,values:Xe}),[oe,ce,te,J,De,j,W,tn,An,u,fe,he,Le,c,d,h,g,le,k,p,Q,ve,Y,ue,en,ye,mt,Qt,He,nt,_,S,C,Ze,G,Xe]),$r=Gn("div",e,{state:nt,ref:[t,Z],props:[{"aria-labelledby":te,id:w,role:"group"},j.getValidationProps,b],stateAttributesMapping:Cr});return T.jsx(nu.Provider,{value:Ji,children:T.jsx(zf,{elementsRef:G,onMapChange:Pt,children:$r})})});function ru(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Lg(n){if(Math.abs(n)<1){const t=n.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const e=n.toString().split(".")[1];return e?e.length:0}function iu(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(Lg(e)))}function xa({values:n,index:e,nextValue:t,min:r,max:i,step:s,minStepsBetweenValues:o,initialValues:a}){if(n.length===0)return[];const l=n.slice(),u=s*o,c=l.length-1,f=a??n,d=r+e*u,h=i-(c-e)*u;l[e]=ut(t,d,h);for(let g=e+1;g<=c;g+=1){const m=l[g-1]+u,y=i-(c-g)*u,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=ut(p,m,y)}for(let g=e-1;g>=0;g-=1){const m=l[g+1]-u,y=r+g*u,x=f[g]??l[g];let p=Math.min(l[g],m);x>p&&(p=Math.min(x,m)),l[g]=ut(p,y,m)}for(let g=0;g<=c;g+=1)l[g]=Number(l[g].toFixed(12));return l}function Dg({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:i,nextValue:s,min:o,max:a,step:l,minStepsBetweenValues:u}){const c=t??e,f=r??e;if(!(c.length>1))return{value:s,thumbIndex:0,didSwap:!1};const h=l*u;switch(n){case"swap":{const g=c[i],m=1e-7,y=c.slice(),x=y[i-1],p=y[i+1],_=x!=null?x+h:o,S=p!=null?p-h:a,C=ut(s,_,S),v=Number(C.toFixed(12));y[i]=v;const b=s>g,w=s<g,E=b&&p!=null&&s>=p-m,k=w&&x!=null&&s<=x+m;if(!E&&!k)return{value:y,thumbIndex:i,didSwap:!1};const F=E?i+1:i-1,L=y.map((K,D)=>{if(D===i)return v;const U=f[D];return U??c[D]});let R=s;E?R=Math.max(s,y[F]):R=Math.min(s,y[F]);const O=xa({values:y,index:F,nextValue:R,min:o,max:a,step:l,minStepsBetweenValues:u,initialValues:L}),B=E?F-1:F+1;if(B>=0&&B<O.length){const K=O[B-1],D=O[B+1];let U=K!=null?K+h:o;U=Math.max(U,o+B*h);let j=D!=null?D-h:a;j=Math.min(j,a-(O.length-1-B)*h);const X=ut(v,U,j);O[B]=Number(X.toFixed(12))}return{value:O,thumbIndex:F,didSwap:!0}}case"push":return{value:xa({values:c,index:i,nextValue:s,min:o,max:a,step:l,minStepsBetweenValues:u}),thumbIndex:i,didSwap:!1};case"none":default:{const g=c.slice(),m=g[i-1],y=g[i+1],x=m!=null?m+h:o,p=y!=null?y-h:a,_=ut(s,x,p);return g[i]=Number(_.toFixed(12)),{value:g,thumbIndex:i,didSwap:!1}}}}const Bg=2;function jg(n,e){if(!n)return{start:0,end:0};function t(s){const o=s!=null?parseFloat(s):0;return Number.isNaN(o)?0:o}const r=e?"Top":"InlineStart",i=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${i}Width`])+t(n[`padding${i}`])}}function Br(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const i=t.changedTouches[r];if(i.identifier===e.current)return{x:i.clientX,y:i.clientY}}return null}return{x:n.clientX,y:n.clientY}}const zg=A.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{disabled:o,dragging:a,validation:l,inset:u,lastChangedValueRef:c,lastChangeReasonRef:f,max:d,min:h,minStepsBetweenValues:g,onValueCommitted:m,orientation:y,pressedInputRef:x,pressedThumbCenterOffsetRef:p,pressedThumbIndexRef:_,pressedValuesRef:S,registerFieldControlRef:C,renderBeforeHydration:v,setActive:b,setDragging:w,setValue:E,state:k,step:F,thumbCollisionBehavior:L,thumbRefs:R,values:O}=Ti(),B=Rc(),K=O.length>1,D=y==="vertical",U=A.useRef(null),j=A.useRef(null),X=We(W=>{W&&j.current==null&&j.current==null&&(j.current=getComputedStyle(W))}),te=A.useRef(null),J=A.useRef(0),le=A.useRef(0),V=Pc(O),re=We(W=>{_.current!==W&&(_.current=W);const oe=R.current[W];if(!oe){p.current=null,x.current=null;return}x.current=oe.querySelector('input[type="range"]')}),Z=We(W=>{const oe=U.current;if(!oe)return null;const{width:ie,height:fe,bottom:se,left:De,right:mt}=oe.getBoundingClientRect(),Ze=jg(j.current,D),Pt=le.current,An=(D?fe:ie)-Ze.start-Ze.end-Pt*2,Qt=p.current??0,ye=W.x-Qt,en=W.y-Qt,Ye=D?se-en-Ze.end:(B==="rtl"?mt-ye:ye-De)-Ze.start,Xe=ut((Ye-Pt)/An,0,1);let He=(d-h)*Xe+h;if(He=iu(He,F,h),He=ut(He,h,d),!K)return{value:He,thumbIndex:0,didSwap:!1};const tn=_.current;if(tn<0)return null;const nt=Dg({behavior:L,values:O,currentValues:V.current??O,initialValues:S.current,pressedIndex:tn,nextValue:He,min:h,max:d,step:F,minStepsBetweenValues:g});return L==="swap"&&nt.didSwap?re(nt.thumbIndex):_.current=nt.thumbIndex,nt}),ce=We(W=>{S.current=K?O.slice():null,V.current=O;const oe=_.current;let ie=oe;if(oe>-1&&oe<O.length){if(O[oe]===d){let fe=oe;for(;fe>0&&O[fe-1]===d;)fe-=1;ie=fe}}else{const fe=D?"y":"x";let se;ie=-1;for(let De=0;De<R.current.length;De+=1){const mt=R.current[De];if(Yi(mt)){const Ze=ru(mt),Pt=Math.abs(W[fe]-Ze[fe]);(se===void 0||Pt<=se)&&(ie=De,se=Pt)}}}if(ie>-1&&ie!==oe&&re(ie),u){const fe=R.current[ie];if(Yi(fe)){const se=fe.getBoundingClientRect(),De=D?"height":"width";le.current=se[De]/2}}}),G=We(W=>{R.current?.[W]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),Q=We(W=>{const oe=Br(W,te);if(oe==null)return;if(J.current+=1,W.type==="pointermove"&&W.buttons===0){ve(W);return}const ie=Z(oe);ie!=null&&tu(ie.value,F,g)&&(!a&&J.current>Bg&&w(!0),E(ie.value,dr(Wf,W,void 0,{activeThumbIndex:ie.thumbIndex})),V.current=Array.isArray(ie.value)?ie.value:[ie.value],ie.didSwap&&G(ie.thumbIndex))});function ve(W){b(-1),w(!1),x.current=null,p.current=null,_.current=-1;const oe=Br(W,te),ie=oe!=null?Z(oe):null;if(ie!=null){const fe=f.current;l.commit(c.current??ie.value),m(c.current??ie.value,Oc(fe,W))}"pointerType"in W&&U.current?.hasPointerCapture(W.pointerId)&&U.current?.releasePointerCapture(W.pointerId),te.current=null,S.current=null,ue()}const Y=We(W=>{if(o)return;const oe=W.changedTouches[0];oe!=null&&(te.current=oe.identifier);const ie=Br(W,te);if(ie!=null){ce(ie);const se=Z(ie);if(se==null)return;G(se.thumbIndex),E(se.value,dr(da,W,void 0,{activeThumbIndex:se.thumbIndex})),V.current=Array.isArray(se.value)?se.value:[se.value],se.didSwap&&G(se.thumbIndex)}J.current=0;const fe=or(U.current);fe.addEventListener("touchmove",Q,{passive:!0}),fe.addEventListener("touchend",ve,{passive:!0})}),ue=We(()=>{const W=or(U.current);W.removeEventListener("pointermove",Q),W.removeEventListener("pointerup",ve),W.removeEventListener("touchmove",Q),W.removeEventListener("touchend",ve),S.current=null}),he=Vf();return A.useEffect(()=>{const W=U.current;return W?(W.addEventListener("touchstart",Y,{passive:!0}),()=>{W.removeEventListener("touchstart",Y),he.cancel(),ue()}):()=>ue()},[ue,Y,U,he]),A.useEffect(()=>{o&&ue()},[o,ue]),Gn("div",e,{state:k,ref:[t,C,U,X],props:[{"data-base-ui-slider-control":v?"":void 0,onPointerDown(W){const oe=U.current;if(!oe||o||W.defaultPrevented||!Yi(W.target)||W.button!==0)return;const ie=Br(W,te);if(ie!=null){ce(ie);const se=Z(ie);if(se==null)return;qf(R.current[se.thumbIndex],Ic(or(oe)))?W.preventDefault():he.request(()=>{G(se.thumbIndex)}),w(!0),p.current!=null||(E(se.value,dr(da,W.nativeEvent,void 0,{activeThumbIndex:se.thumbIndex})),V.current=Array.isArray(se.value)?se.value:[se.value],se.didSwap&&G(se.thumbIndex))}W.nativeEvent.pointerId&&oe.setPointerCapture(W.nativeEvent.pointerId),J.current=0;const fe=or(U.current);fe.addEventListener("pointermove",Q,{passive:!0}),fe.addEventListener("pointerup",ve,{once:!0})},tabIndex:-1},s],stateAttributesMapping:Cr})}),Ug=A.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{state:o}=Ti();return Gn("div",e,{state:o,ref:t,props:[{style:{position:"relative"}},s],stateAttributesMapping:Cr})});let Kg=(function(n){return n.index="data-index",n.dragging="data-dragging",n.orientation="data-orientation",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.focused="data-focused",n})({});const Wg='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();',su="PageUp",ou="PageDown",Vg=new Set([zc,Bc,Dc,jc,Mc,Lc,su,ou]);function qg(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${Yr(n[e],r,t)} start range`:`${Yr(n[e],r,t)} end range`:t?Yr(n[e],r,t):void 0}function Fn(n,e,t,r,i){return t===1?Math.min(n+e,i):Math.max(n-e,r)}const Hg=A.forwardRef(function(e,t){const{render:r,children:i,className:s,"aria-describedby":o,"aria-label":a,"aria-labelledby":l,disabled:u=!1,getAriaLabel:c,getAriaValueText:f,id:d,index:h,inputRef:g,onBlur:m,onFocus:y,onKeyDown:x,tabIndex:p,..._}=e,S=si(d),{active:C,lastUsedThumbIndex:v,controlRef:b,disabled:w,validation:E,formatOptionsRef:k,handleInputChange:F,inset:L,labelId:R,largeStep:O,locale:B,max:K,min:D,minStepsBetweenValues:U,name:j,orientation:X,pressedInputRef:te,pressedThumbCenterOffsetRef:J,pressedThumbIndexRef:le,renderBeforeHydration:V,setActive:re,setIndicatorPosition:Z,state:ce,step:G,values:Q}=Ti(),ve=Rc(),Y=u||w,ue=Q.length>1,he=X==="vertical",Le=ve==="rtl",{setTouched:W,setFocused:oe,validationMode:ie}=Vc(),fe=A.useRef(null),se=A.useRef(null),De=si(),mt=ag(),Ze=ue?De:mt,Pt=A.useMemo(()=>({inputId:Ze}),[Ze]),{ref:An,index:Qt}=Ac({metadata:Pt}),ye=ue?h??Qt:0,en=ye===Q.length-1,Ye=Q[ye],Xe=Ts(Ye,D,K),[He,tn]=A.useState(!1),[nt,Ji]=A.useState();$c(()=>tn(!0));const $r=v>=0&&v<Q.length?v:-1,pe=We(()=>{const Ee=b.current,we=fe.current;if(!Ee||!we)return;const Re=we.getBoundingClientRect(),Lr=Ee.getBoundingClientRect(),Dr=he?"height":"width",Nf=Lr[Dr]-Re[Dr],Gi=(Re[Dr]/2+Nf*Xe/100)/Lr[Dr]*100;Ji(Gi),ye===0?Z(Zi=>[Gi,Zi[1]]):en&&Z(Zi=>[Zi[0],Gi])});ws(()=>{L&&queueMicrotask(pe)},[pe,L]),ws(()=>{L&&pe()},[pe,L,Xe]);const yt=A.useCallback(()=>{const Ee=he?"bottom":"insetInlineStart",we=he?"left":"top";let Re;return ue?C===ye?Re=2:$r===ye&&(Re=1):C===ye&&(Re=1),L?{"--position":`${nt}%`,visibility:V&&!He||nt===void 0?"hidden":void 0,position:"absolute",[Ee]:"var(--position)",[we]:"50%",translate:`${(he||!Le?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Re}:Number.isFinite(Xe)?{position:"absolute",[Ee]:`${Xe}%`,[we]:"50%",translate:`${(he||!Le?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Re}:fa},[C,ye,L,He,nt,ue,V,Le,$r,Xe,he]);let lt;X==="vertical"&&(lt=Le?"vertical-rl":"vertical-lr");const zt=Hf({"aria-label":typeof c=="function"?c(ye):a,"aria-labelledby":l??R,"aria-describedby":o,"aria-orientation":X,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(Yr(Ye,B,k.current??void 0),Ye,ye):qg(Q,ye,k.current??void 0,B),disabled:Y,id:Ze,max:K,min:D,name:j,onChange(Ee){F(Ee.target.valueAsNumber,ye,Ee)},onFocus(){re(ye),oe(!0)},onBlur(){fe.current&&(re(-1),W(!0),oe(!1),ie==="onBlur"&&E.commit(eu(Ye,ye,D,K,ue,Q)))},onKeyDown(Ee){if(!Vg.has(Ee.key))return;Jf.has(Ee.key)&&Ee.stopPropagation();let we=null;const Re=iu(Ye,G,D);switch(Ee.key){case zc:we=Fn(Re,Ee.shiftKey?O:G,1,D,K);break;case jc:we=Fn(Re,Ee.shiftKey?O:G,Le?-1:1,D,K);break;case Bc:we=Fn(Re,Ee.shiftKey?O:G,-1,D,K);break;case Dc:we=Fn(Re,Ee.shiftKey?O:G,Le?1:-1,D,K);break;case su:we=Fn(Re,O,1,D,K);break;case ou:we=Fn(Re,O,-1,D,K);break;case Lc:we=K,ue&&(we=Number.isFinite(Q[ye+1])?Q[ye+1]-G*U:K);break;case Mc:we=D,ue&&(we=Number.isFinite(Q[ye-1])?Q[ye-1]+G*U:D);break}we!==null&&(F(we,ye,Ee),Ee.preventDefault())},step:G,style:{...fa,width:"100%",height:"100%",writingMode:lt},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),Mr=Gf(se,E.inputRef,g);return Gn("div",e,{state:ce,ref:[t,An,fe],props:[{[Kg.index]:ye,children:T.jsxs(A.Fragment,{children:[i,T.jsx("input",{ref:Mr,...zt}),L&&!He&&V&&en&&T.jsx("script",{dangerouslySetInnerHTML:{__html:Wg},suppressHydrationWarning:!0})]}),id:S,onBlur:m,onFocus:y,onPointerDown(Ee){if(le.current=ye,fe.current!=null){const we=X==="horizontal"?"x":"y",Re=ru(fe.current),Lr=(X==="horizontal"?Ee.clientX:Ee.clientY)-Re[we];J.current=Lr}se.current!=null&&te.current!==se.current&&(te.current=se.current)},style:yt(),suppressHydrationWarning:V||void 0,tabIndex:-1},_],stateAttributesMapping:Cr})});function Jg(n,e,t,r,i,s){const o=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",c={visibility:i&&!s?"hidden":o,position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};return c["--start-position"]=`${t??0}%`,e?(c["--relative-size"]=`${(r??0)-(t??0)}%`,c[a]="var(--start-position)",c[l]="var(--relative-size)",c):(c[a]=0,c[l]="var(--start-position)",c)}function Gg(n,e,t,r){const i=n?"bottom":"insetInlineStart",s=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[i]=0,a[s]=`${t}%`,a;const l=r-t;return a[i]=`${t}%`,a[s]=`${l}%`,a}const Zg=A.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{indicatorPosition:o,inset:a,max:l,min:u,orientation:c,renderBeforeHydration:f,state:d,values:h}=Ti(),[g,m]=A.useState(!1);$c(()=>m(!0));const y=c==="vertical",x=h.length>1,p=a?Jg(y,x,o[0],o[1],f,g):Gg(y,x,Ts(h[0],u,l),Ts(h[h.length-1],u,l));return Gn("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},s],stateAttributesMapping:Cr})});const Yg=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Xg=Zf("brain-circuit",Yg);var Qg="vpj4en0",eh="vpj4en1",th="vpj4en2",nh="vpj4en3",rh="vpj4en4",ih="vpj4en5",sh="vpj4en6";function jr(n){const e=ze.c(25),{label:t,value:r,defaultValue:i,min:s,max:o,step:a,onValueChange:l,onValueCommitted:u,disabled:c,className:f,showValue:d,formatValue:h}=n,g=s===void 0?0:s,m=o===void 0?100:o,y=a===void 0?1:a,x=c===void 0?!1:c,p=d===void 0?!0:d;let _;e[0]!==l?(_=O=>{typeof O=="number"?l?.(O):Array.isArray(O)&&l?.(O[0])},e[0]=l,e[1]=_):_=e[1];const S=_;let C;e[2]!==u?(C=O=>{typeof O=="number"?u?.(O):Array.isArray(O)&&u?.(O[0])},e[2]=u,e[3]=C):C=e[3];const v=C,b=r??i??g;let w;e[4]!==b||e[5]!==h?(w=h?h(b):String(b),e[4]=b,e[5]=h,e[6]=w):w=e[6];const E=w;let k;e[7]!==f?(k=Yf(Qg,f),e[7]=f,e[8]=k):k=e[8];let F;e[9]!==E||e[10]!==t||e[11]!==p?(F=(t||p)&&T.jsxs("div",{className:eh,children:[t&&T.jsx("span",{children:t}),p&&T.jsx("span",{className:th,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=F):F=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=T.jsx(zg,{className:nh,children:T.jsxs(Ug,{className:rh,children:[T.jsx(Zg,{className:ih}),T.jsx(Hg,{className:sh})]})}),e[13]=L):L=e[13];let R;return e[14]!==i||e[15]!==x||e[16]!==S||e[17]!==v||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==F||e[22]!==k||e[23]!==r?(R=T.jsxs(Mg,{value:r,defaultValue:i,min:g,max:m,step:y,onValueChange:S,onValueCommitted:v,disabled:x,className:k,children:[F,L]}),e[14]=i,e[15]=x,e[16]=S,e[17]=v,e[18]=m,e[19]=g,e[20]=y,e[21]=F,e[22]=k,e[23]=r,e[24]=R):R=e[24],R}var oh="_7ucatj0",ah="_7ucatj1",lh="_7ucatj2",ba="_7ucatj3",Sa="_7ucatj4",Ca="_7ucatj5",Ea="_7ucatj6",wa="_7ucatj7",Ta="_7ucatj8",ka="_7ucatj9",Na="_7ucatja",ch="_7ucatjb",uh="_7ucatjc",dh="_7ucatjd",fh="_7ucatje",gh="_7ucatjf",hh="_7ucatjg",ph="_7ucatjh",mh="_7ucatji";function yh(n){const e=ze.c(69),{isNewVariant:t,onSave:r,isSaving:i}=n,s=i===void 0?!1:i,[o,a]=A.useState(!1),[l,u]=A.useState(t?"new_variant":"new_version"),[c,f]=A.useState(!1),[d,h]=A.useState(null),{data:g}=kg();let m;e[0]!==g?(m=g===void 0?[]:g,e[0]=g,e[1]=m):m=e[1];const y=m;let x;e[2]!==c||e[3]!==l||e[4]!==r||e[5]!==d?.id?(x=()=>{r({mode:l,deployToEnvironment:c,environmentId:c?d?.id??null:null}),a(!1)},e[2]=c,e[3]=l,e[4]=r,e[5]=d?.id,e[6]=x):x=e[6];const p=x;let _;e[7]!==t?(_=W=>{a(W),W&&(u(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const S=_;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=T.jsx(Uc,{icon:cg,size:"xs"}),e[9]=C):C=e[9];const v=s?"Saving...":"Save";let b;e[10]!==s||e[11]!==v?(b=T.jsx(Hc,{asChild:!0,children:T.jsxs(Xi,{variant:"primary",size:"default",type:"button",disabled:s,children:[C,v]})}),e[10]=s,e[11]=v,e[12]=b):b=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=T.jsx("div",{className:ah,children:"Save Options"}),e[13]=w):w=e[13];const E=`${ba} ${l==="new_variant"?Sa:""}`;let k,F;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=()=>u("new_variant"),F=W=>W.key==="Enter"&&u("new_variant"),e[14]=k,e[15]=F):(k=e[14],F=e[15]);const L=l==="new_variant",R=`${Ca} ${l==="new_variant"?Ea:""}`;let O;e[16]!==l?(O=l==="new_variant"&&T.jsx("div",{className:wa}),e[16]=l,e[17]=O):O=e[17];let B;e[18]!==R||e[19]!==O?(B=T.jsx("div",{className:R,children:O}),e[18]=R,e[19]=O,e[20]=B):B=e[20];let K;e[21]===Symbol.for("react.memo_cache_sentinel")?(K=T.jsxs("div",{className:Ta,children:[T.jsx("span",{className:ka,children:"Save as new variant"}),T.jsx("span",{className:Na,children:"Creates a new variant with version 1"})]}),e[21]=K):K=e[21];let D;e[22]!==E||e[23]!==L||e[24]!==B?(D=T.jsxs("div",{className:E,onClick:k,onKeyDown:F,role:"radio","aria-checked":L,tabIndex:0,children:[B,K]}),e[22]=E,e[23]=L,e[24]=B,e[25]=D):D=e[25];let U;e[26]!==t||e[27]!==l?(U=!t&&T.jsxs("div",{className:`${ba} ${l==="new_version"?Sa:""}`,onClick:()=>u("new_version"),onKeyDown:W=>W.key==="Enter"&&u("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[T.jsx("div",{className:`${Ca} ${l==="new_version"?Ea:""}`,children:l==="new_version"&&T.jsx("div",{className:wa})}),T.jsxs("div",{className:Ta,children:[T.jsx("span",{className:ka,children:"Update as new version"}),T.jsx("span",{className:Na,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=U):U=e[28];let j;e[29]!==D||e[30]!==U?(j=T.jsxs("div",{className:lh,children:[D,U]}),e[29]=D,e[30]=U,e[31]=j):j=e[31];const X=`${dh} ${c?fh:""}`;let te,J;e[32]!==c?(te=()=>f(!c),J=W=>W.key==="Enter"&&f(!c),e[32]=c,e[33]=te,e[34]=J):(te=e[33],J=e[34]);let le;e[35]!==c?(le=c&&T.jsx(Zc,{className:gh}),e[35]=c,e[36]=le):le=e[36];let V;e[37]!==c||e[38]!==X||e[39]!==te||e[40]!==J||e[41]!==le?(V=T.jsx("div",{className:X,onClick:te,onKeyDown:J,role:"checkbox","aria-checked":c,tabIndex:0,children:le}),e[37]=c,e[38]=X,e[39]=te,e[40]=J,e[41]=le,e[42]=V):V=e[42];let re;e[43]!==c?(re=T.jsx("span",{className:hh,onClick:()=>f(!c),children:"Deploy to environment"}),e[43]=c,e[44]=re):re=e[44];let Z;e[45]!==V||e[46]!==re?(Z=T.jsxs("div",{className:uh,children:[V,re]}),e[45]=V,e[46]=re,e[47]=Z):Z=e[47];let ce;e[48]!==c||e[49]!==y||e[50]!==d?(ce=c&&T.jsx("div",{className:ph,children:T.jsx(vo,{items:y,value:d,onValueChange:h,itemToString:_h,placeholder:"Select environment"})}),e[48]=c,e[49]=y,e[50]=d,e[51]=ce):ce=e[51];let G;e[52]!==Z||e[53]!==ce?(G=T.jsxs("div",{className:ch,children:[Z,ce]}),e[52]=Z,e[53]=ce,e[54]=G):G=e[54];let Q;e[55]===Symbol.for("react.memo_cache_sentinel")?(Q=T.jsx(Xi,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=Q):Q=e[55];const ve=s||c&&!d,Y=s?"Saving...":"Confirm";let ue;e[56]!==p||e[57]!==ve||e[58]!==Y?(ue=T.jsxs("div",{className:mh,children:[Q,T.jsx(Xi,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:ve,children:Y})]}),e[56]=p,e[57]=ve,e[58]=Y,e[59]=ue):ue=e[59];let he;e[60]!==j||e[61]!==G||e[62]!==ue?(he=T.jsx(Jc,{side:"bottom",align:"end",sideOffset:4,children:T.jsxs("div",{className:oh,children:[w,j,G,ue]})}),e[60]=j,e[61]=G,e[62]=ue,e[63]=he):he=e[63];let Le;return e[64]!==S||e[65]!==o||e[66]!==he||e[67]!==b?(Le=T.jsxs(Gc,{open:o,onOpenChange:S,children:[b,he]}),e[64]=S,e[65]=o,e[66]=he,e[67]=b,e[68]=Le):Le=e[68],Le}function _h(n){return n?.name||""}const au=A.createContext(null);function vh(n,e){return{getTheme:function(){return e??null}}}function Ue(){const n=A.useContext(au);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function I(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lu(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ht=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,xh=ht&&"documentMode"in document?document.documentMode:null,ct=ht&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),fn=ht&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),oi=!(!ht||!("InputEvent"in window)||xh)&&"getTargetRanges"in new window.InputEvent("input"),Er=ht&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Zn=ht&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,bh=ht&&/Android/.test(navigator.userAgent),cu=ht&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Aa=ht&&bh&&cu,wr=ht&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ct&&!cu;function uu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Sh=0,Ch=1,Eh=2,du=128,wh=1,Th=2,kh=3,Nh=4,Ah=5,Fh=6,ki=Er||Zn||wr?" ":"",Jt=`
|
|
2
|
+
|
|
3
|
+
`,Ph=fn?" ":ki,gn={bold:1,capitalize:1024,code:16,highlight:du,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Oh={directionless:1,unmergeable:2},Fa={center:2,end:6,justify:4,left:1,right:3,start:5},Ih={[Th]:"center",[Fh]:"end",[Nh]:"justify",[wh]:"left",[kh]:"right",[Ah]:"start"},Rh={normal:0,segmented:2,token:1},$h={[Sh]:"normal",[Eh]:"segmented",[Ch]:"token"},Pa="$config";function fu(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(N(o)&&fu(o,a,t,r,i,s),t.has(a)||s.delete(a),i.push(a)),o=o.getNextSibling()}}let ks=!1,xo=0;function Mh(n){xo=n.timeStamp}function Qi(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Li(n,t)!==void 0}function Lh(n,e,t){const r=pt(ot(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Uo(e,o,i,s,!1)}function Dh(n,e,t){if(P(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return jt(e)&&t.isAttached()}function Bh(n,e,t,r){for(let i=n;i&&!zp(i);i=Fr(i)){const s=Li(i,e);if(s!==void 0){const o=Te(s,t);if(o)return ae(o)||!Ce(i)?void 0:[i,o]}else if(i===r)return[r,md(t)]}}function gu(n,e,t){ks=!0;const r=performance.now()-xo>100;try{Et(n,()=>{const i=M()||(function(d){return d.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),a=n._editorState,l=n._blockCursorElement;let u=!1,c="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target,y=Bh(m,n,a,o);if(!y)continue;const[x,p]=y;if(g==="characterData")r&&$(p)&&jt(m)&&Dh(i,m,p)&&Lh(m,p,n);else if(g==="childList"){u=!0;const _=h.addedNodes;for(let v=0;v<_.length;v++){const b=_[v],w=hd(b),E=b.parentNode;if(E!=null&&b!==l&&w===null&&!Qi(b,E,n)){if(fn){const k=(Ce(b)?b.innerText:null)||b.nodeValue;k&&(c+=k)}E.removeChild(b)}}const S=h.removedNodes,C=S.length;if(C>0){let v=0;for(let b=0;b<C;b++){const w=S[b];(Qi(w,m,n)||l===w)&&(m.appendChild(w),v++)}C!==v&&s.set(x,p)}}}if(s.size>0)for(const[d,h]of s)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const x=g[y],p=x.parentNode;p==null||x.nodeName!=="BR"||Qi(x,m,n)||p.removeChild(x)}}t.takeRecords()}i!==null&&(u&&Me(i),fn&&xd(n)&&i.insertRawText(c))})}finally{ks=!1}}function hu(n){const e=n._observer;e!==null&&gu(n,e.takeRecords(),e)}function pu(n){(function(e){xo===0&&ot(e).addEventListener("textInput",Mh,!0)})(n),n._observer=new MutationObserver((e,t)=>{gu(n,e,t)})}let jh=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Wh).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function zh(n,e){return new jh(n,e)}function mu(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function es(n,e,t){let r;if(Pe(),typeof t=="function"){const s=n.getLatest(),o=mu(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return _u(i).updateFromKnown(e,r),i}function Uh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=ji(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let Kh=class yu{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,a=s!==void 0?s:(function(l,u,c){let f=c.size;if(u)for(const d in u){const h=l.get(d);h&&c.has(h)||f++}return f})(o,r,i);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return Oa(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new yu(e,t,(function(s,o,a){let l;if(a)for(const[u,c]of Object.entries(a)){const f=s.get(u);f?o.has(f)||o.set(f,f.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=Oa(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function _u(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Kh(e,vu(e));return e.__state=t,t}function vu(n){return n.__state?n.__state.sharedNodeState:cd(Bi(),n.getType()).sharedNodeState}function Oa(n){if(n)for(const e in n)return n}function Wh(n){return n}function Ia(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function Ra(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function $a(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Ma(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===a)&&(n.__state===null||l===u||(function(c,f){if(c===f)return!0;if(c&&f&&c.size!==f.size)return!1;const d=new Set;return!(c&&Ia(d,c,f)||f&&Ia(d,f,c)||c&&Ra(d,c,f)||f&&Ra(d,f,c))})(l,u))}function La(n,e){const t=n.mergeWithSibling(e),r=me()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Da(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&$(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ma(e,r)){r=La(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&$(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ma(r,t)){r=La(r,t);break}break}t.remove()}}else r.remove()}function hn(n){return Ba(n.anchor),Ba(n.focus),n}function Ba(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),$(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!N(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let pn,Be,mr,Ni,Ns,As,mn,dt,Fs,yr,Ae="",_t=null,rn=null,Mt="",$n=!1,ai=!1;function li(n,e){const t=mn.get(n);if(e!==null){const r=Rs(n);r.parentNode===e&&e.removeChild(r)}if(dt.has(n)||Be._keyToDOMMap.delete(n),N(t)){const r=ui(t,mn);Ps(r,0,r.length-1,null)}t!==void 0&&Ko(yr,mr,Ni,t,"destroyed")}function Ps(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&li(s,r)}}function nn(n,e){n.setProperty("text-align",e)}const Vh="40px";function xu(n,e){const t=pn.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Vh;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function bu(n,e){const t=n.style;e===0?nn(t,""):e===1?nn(t,"left"):e===2?nn(t,"center"):e===3?nn(t,"right"):e===4?nn(t,"justify"):e===5?nn(t,"start"):e===6&&nn(t,"end")}function Os(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(Fe(r))return null;const s=r.getParentOrThrow();return Fe(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ci(n,e){const t=dt.get(n);t===void 0&&I(60);const r=t.createDOM(pn,Be);if((function(i,s,o){const a=o._keyToDOMMap;(function(l,u,c){const f=`__lexicalKey_${u._key}`;l[f]=c})(s,o,i),a.set(i,s)})(n,r,Be),$(t)?r.setAttribute("data-lexical-text","true"):ae(t)&&r.setAttribute("data-lexical-decorator","true"),N(t)){const i=t.__indent,s=t.__size;if(Os(r,t),i!==0&&xu(r,i),s!==0){const a=s-1;Is(ui(t,dt),t,0,a,t.getDOMSlot(r))}const o=t.__format;o!==0&&bu(r,o),t.isInline()||Su(null,t,r),Di(t)&&(Ae+=Jt,Mt+=Jt)}else{const i=t.getTextContent();if(ae(t)){const s=t.decorate(Be,pn);s!==null&&Cu(n,s),r.contentEditable="false"}Ae+=i,Mt+=i}return e!==null&&e.insertChild(r),Ko(yr,mr,Ni,t,"created"),r}function Is(n,e,t,r,i){const s=Ae;Ae="";let o=t;for(;o<=r;++o){ci(n[o],i);const a=dt.get(n[o]);a!==null&&$(a)&&_t===null&&(_t=a.getFormat(),rn=a.getStyle())}Di(e)&&(Ae+=Jt),i.element.__lexicalTextContent=Ae,Ae=s+Ae}function ja(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Ct(r)?"line-break":ae(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Su(n,e,t){const r=ja(n,mn),i=ja(e,dt);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function qh(n,e,t){var r;_t=null,rn=null,(function(i,s,o){const a=Ae,l=i.__size,u=s.__size;Ae="";const c=o.element;if(l===1&&u===1){const f=i.__first,d=s.__first;if(f===d)ar(f,c);else{const g=Rs(f),m=ci(d,null);try{c.replaceChild(m,g)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${c.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw y}li(f,null)}const h=dt.get(d);$(h)&&_t===null&&(_t=h.getFormat(),rn=h.getStyle())}else{const f=ui(i,mn),d=ui(s,dt);if(f.length!==l&&I(227),d.length!==u&&I(228),l===0)u!==0&&Is(d,s,0,u-1,o);else if(u===0){if(l!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Ps(f,0,l-1,h?null:c),h&&(c.textContent="")}}else(function(h,g,m,y,x,p){const _=y-1,S=x-1;let C,v,b=p.getFirstChild(),w=0,E=0;for(;w<=_&&E<=S;){const L=g[w],R=m[E];if(L===R)b=ts(ar(R,p.element)),w++,E++;else{C===void 0&&(C=new Set(g)),v===void 0&&(v=new Set(m));const B=v.has(L),K=C.has(R);if(B)if(K){const D=yn(Be,R);D===b?b=ts(ar(R,p.element)):(p.withBefore(b).insertChild(D),ar(R,p.element)),w++,E++}else ci(R,p.withBefore(b)),E++;else b=ts(Rs(L)),li(L,p.element),w++}const O=dt.get(R);O!==null&&$(O)&&_t===null&&(_t=O.getFormat(),rn=O.getStyle())}const k=w>_,F=E>S;if(k&&!F){const L=m[S+1],R=L===void 0?null:Be.getElementByKey(L);Is(m,h,E,S,p.withBefore(R))}else F&&!k&&Ps(g,w,_,p.element)})(s,f,d,l,u,o)}Di(s)&&(Ae+=Jt),c.__lexicalTextContent=Ae,Ae=a+Ae})(n,e,e.getDOMSlot(t)),r=e,_t==null||_t===r.__textFormat||ai||r.setTextFormat(_t),(function(i){rn==null||rn===i.__textStyle||ai||i.setTextStyle(rn)})(e)}function ui(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&I(101),t.push(r),r=i.__next}return t}function ar(n,e){const t=mn.get(n);let r=dt.get(n);t!==void 0&&r!==void 0||I(61);const i=$n||As.has(n)||Ns.has(n),s=yn(Be,n);if(t===r&&!i){if(N(t)){const o=s.__lexicalTextContent;o!==void 0&&(Ae+=o,Mt+=o)}else{const o=t.getTextContent();Mt+=o,Ae+=o}return s}if(t!==r&&i&&Ko(yr,mr,Ni,r,"updated"),r.updateDOM(t,s,pn)){const o=ci(n,null);return e===null&&I(62),e.replaceChild(o,s),li(n,null),o}if(N(t)&&N(r)){const o=r.__indent;($n||o!==t.__indent)&&xu(s,o);const a=r.__format;if(($n||a!==t.__format)&&bu(s,a),i&&(qh(t,r,s),Fe(r)||r.isInline()||Su(t,r,s)),Di(r)&&(Ae+=Jt,Mt+=Jt),($n||r.__dir!==t.__dir)&&(Os(s,r),Fe(r)&&!$n))for(const l of r.getChildren())N(l)&&Os(yn(Be,l.getKey()),l)}else{const o=r.getTextContent();if(ae(r)){const a=r.decorate(Be,pn);a!==null&&Cu(n,a)}Ae+=o,Mt+=o}if(!ai&&Fe(r)&&r.__cachedText!==Mt){const o=r.getWritable();o.__cachedText=Mt,r=o}return s}function Cu(n,e){let t=Be._pendingDecorators;const r=Be._decorators;if(t===null){if(r[n]===e)return;t=pd(Be)}t[n]=e}function ts(n){let e=n.nextSibling;return e!==null&&e===Be._blockCursorElement&&(e=e.nextSibling),e}function Hh(n,e,t,r,i,s){Ae="",Mt="",$n=r===2,Be=t,pn=t._config,mr=t._nodes,Ni=Be._listeners.mutation,Ns=i,As=s,mn=n._nodeMap,dt=e._nodeMap,ai=e._readOnly,Fs=new Map(t._keyToDOMMap);const o=new Map;return yr=o,ar("root",null),Be=void 0,mr=void 0,Ns=void 0,As=void 0,mn=void 0,dt=void 0,pn=void 0,Fs=void 0,yr=void 0,o}function Rs(n){const e=Fs.get(n);return e===void 0&&I(75,n),e}function q(n){return{type:n}}const Eu=q("SELECTION_CHANGE_COMMAND"),Jh=q("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),bo=q("CLICK_COMMAND"),wu=q("BEFORE_INPUT_COMMAND"),Tu=q("INPUT_COMMAND"),ku=q("COMPOSITION_START_COMMAND"),Nu=q("COMPOSITION_END_COMMAND"),ln=q("DELETE_CHARACTER_COMMAND"),jn=q("INSERT_LINE_BREAK_COMMAND"),_r=q("INSERT_PARAGRAPH_COMMAND"),zn=q("CONTROLLED_TEXT_INSERTION_COMMAND"),Ai=q("PASTE_COMMAND"),$s=q("REMOVE_TEXT_COMMAND"),vr=q("DELETE_WORD_COMMAND"),xr=q("DELETE_LINE_COMMAND"),Wt=q("FORMAT_TEXT_COMMAND"),Au=q("UNDO_COMMAND"),Fu=q("REDO_COMMAND"),Pu=q("KEYDOWN_COMMAND"),Ou=q("KEY_ARROW_RIGHT_COMMAND"),Gh=q("MOVE_TO_END"),So=q("KEY_ARROW_LEFT_COMMAND"),Zh=q("MOVE_TO_START"),Co=q("KEY_ARROW_UP_COMMAND"),Eo=q("KEY_ARROW_DOWN_COMMAND"),di=q("KEY_ENTER_COMMAND"),wo=q("KEY_SPACE_COMMAND"),Iu=q("KEY_BACKSPACE_COMMAND"),To=q("KEY_ESCAPE_COMMAND"),Ru=q("KEY_DELETE_COMMAND"),ko=q("KEY_TAB_COMMAND"),$u=q("INSERT_TAB_COMMAND"),Ms=q("INDENT_CONTENT_COMMAND"),Ls=q("OUTDENT_CONTENT_COMMAND"),Mu=q("DROP_COMMAND"),Yh=q("FORMAT_ELEMENT_COMMAND"),Lu=q("DRAGSTART_COMMAND"),Du=q("DRAGOVER_COMMAND"),Xh=q("DRAGEND_COMMAND"),Fi=q("COPY_COMMAND"),No=q("CUT_COMMAND"),Ds=q("SELECT_ALL_COMMAND"),Qh=q("FOCUS_COMMAND"),ep=q("BLUR_COMMAND"),tp=q("KEY_MODIFIER_COMMAND"),Ot=Object.freeze({}),Bs=[["keydown",function(n,e){br=n.timeStamp,Bu=n.key,!e.isComposing()&&z(e,Pu,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;wn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Et(e,()=>{ud(t)||(Us=!0)})}],["compositionstart",function(n,e){z(e,ku,n)}],["compositionend",function(n,e){fn?lr=!0:Zn||!Er&&!wr?z(e,Nu,n):(Ks=!0,Ws=n.data)}],["input",function(n,e){n.stopPropagation(),Et(e,()=>{e.dispatchCommand(Tu,n)},{event:n}),Mn=null}],["click",function(n,e){Et(e,()=>{const t=M(),r=pt(ot(e)),i=En();if(r){if(P(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Fe(o)&&Se().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const a=qe(o,l=>N(l)&&!l.isInline());N(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(Ce(s)||jt(s))&&Me(Po(i,r,e,n))}}z(e,bo,n)})}],["cut",Ot],["copy",Ot],["dragstart",Ot],["dragover",Ot],["dragend",Ot],["paste",Ot],["focus",Ot],["blur",Ot],["drop",Ot]];oi&&Bs.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||fn&&xd(r)||i!=="insertCompositionText"&&z(r,wu,t)})(n,e)]);let br=0,Bu=null,ju=0,Mn=null;const js=new WeakMap,fi=new WeakMap;let zs=!1,Us=!1,fr=!1,lr=!1,Ks=!1,Ws="",an=null,zu=[0,"",0,"root",0];function Uu(n,e,t,r,i){const s=n.anchor,o=n.focus,a=s.getNode(),l=me(),u=pt(ot(l)),c=u!==null?u.anchorNode:null,f=s.key,d=l.getElementByKey(f),h=t.length;return f!==o.key||!$(a)||(!i&&(!oi||ju<r+50)||a.isDirty()&&h<2||yd(t))&&s.offset!==o.offset&&!a.isComposing()||$t(a)||a.isDirty()&&h>1||(i||!oi)&&d!==null&&!a.isComposing()&&c!==Hn(d)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(g,m){if(m.isSegmented())return!0;if(!g.isCollapsed())return!1;const y=g.anchor.offset,x=m.getParentOrThrow(),p=cn(m);return y===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||p||(function(_){const S=_.getPreviousSibling();return($(S)||N(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):y===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||p)})(n,a)}function za(n,e){return jt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Ua(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;zs&&(zs=!1,za(r,i)&&za(s,o)&&!an)||Et(e,()=>{if(!t)return void Me(null);if(!Ar(e,r,s))return;let a=M();if(an&&P(a)&&a.isCollapsed()){const l=a.anchor,u=an.anchor;(l.key===u.key&&l.offset===u.offset+1||l.offset===1&&u.getNode().is(l.getNode().getPreviousSibling()))&&(a=an.clone(),Me(a))}if(an=null,P(a)){const l=a.anchor,u=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const c=ot(e).event,f=c?c.timeStamp:performance.now(),[d,h,g,m,y]=zu,x=Se(),p=e.isComposing()===!1&&x.getTextContent()==="";if(f<y+200&&l.offset===g&&l.key===m)Xr(a,d,h);else if(l.type==="text")$(u)||I(141),Ku(a,u);else if(l.type==="element"&&!p){N(u)||I(259);const _=l.getNode();_.isEmpty()?(function(S,C){const v=C.getTextFormat(),b=C.getTextStyle();Xr(S,v,b)})(a,_):Xr(a,0,"")}}else{const c=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),m=g?o:i,y=g?i:o,x=g?f:c,p=g?c:f;let _=2047,S=!1;for(let C=0;C<h;C++){const v=d[C],b=v.getTextContentSize();if($(v)&&b!==0&&!(C===0&&v.__key===x&&m===b||C===h-1&&v.__key===p&&y===0)&&(S=!0,_&=v.getFormat(),_===0))break}a.format=S?_:0}}z(e,Eu,void 0)})}function Xr(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Ku(n,e){Xr(n,e.getFormat(),e.getStyle())}function Wu(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function np(n){const e=n.inputType,t=Wu(n),r=me(),i=M();if(e==="deleteContentBackward"){if(i===null){const f=En();if(!P(f))return!0;Me(f.clone())}if(P(i)){const f=i.anchor.key===i.focus.key;if(s=n.timeStamp,Bu==="MediaLast"&&s<br+30&&r.isComposing()&&f){if($e(null),br=0,setTimeout(()=>{Et(r,()=>{$e(null)})},30),P(i)){const d=i.anchor.getNode();d.markDirty(),$(d)||I(142),Ku(i,d)}}else{$e(null),n.preventDefault();const d=i.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),m=i.anchor.offset===0&&i.focus.offset===h.length;let y=Aa&&f&&!m&&g;if(y&&i.isCollapsed()&&(y=!ae(Js(i.anchor,!0))),!y){z(r,ln,!0);const x=M();Aa&&P(x)&&x.isCollapsed()&&(an=x,setTimeout(()=>an=null))}}return!0}}var s;if(!P(i))return!0;const o=n.data;Mn!==null&&zo(!1,r,Mn),i.dirty&&Mn===null||!i.isCollapsed()||Fe(i.anchor.getNode())||t===null||i.applyDOMRange(t),Mn=null;const a=i.anchor,l=i.focus,u=a.getNode(),c=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
|
|
4
|
+
`)n.preventDefault(),z(r,jn,!1);else if(o===Jt)n.preventDefault(),z(r,_r,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else o!=null&&Uu(i,t,o,n.timeStamp,!0)?(n.preventDefault(),z(r,zn,o)):Mn=o;return ju=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":z(r,zn,n);break;case"insertFromComposition":$e(null),z(r,zn,n);break;case"insertLineBreak":$e(null),z(r,jn,!1);break;case"insertParagraph":$e(null),fr&&!Zn?(fr=!1,z(r,jn,!1)):z(r,_r,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":z(r,Ai,n);break;case"deleteByComposition":(function(f,d){return f!==d||N(f)||N(d)||!cn(f)||!cn(d)})(u,c)&&z(r,$s,n);break;case"deleteByDrag":case"deleteByCut":z(r,$s,n);break;case"deleteContent":z(r,ln,!1);break;case"deleteWordBackward":z(r,vr,!0);break;case"deleteWordForward":z(r,vr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":z(r,xr,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":z(r,xr,!1);break;case"formatStrikeThrough":z(r,Wt,"strikethrough");break;case"formatBold":z(r,Wt,"bold");break;case"formatItalic":z(r,Wt,"italic");break;case"formatUnderline":z(r,Wt,"underline");break;case"historyUndo":z(r,Au,void 0);break;case"historyRedo":z(r,Fu,void 0)}return!0}function rp(n){if(Ce(n.target)&&ud(n.target))return!0;const e=me(),t=M(),r=n.data,i=Wu(n);if(r!=null&&P(t)&&Uu(t,i,r,n.timeStamp,!1)){lr&&(gi(e,r),lr=!1);const s=t.anchor.getNode(),o=pt(ot(e));if(o===null)return!0;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,u=a?t.focus.offset:t.anchor.offset;oi&&!t.isCollapsed()&&$(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,l)+r+s.getTextContent().slice(l+u)===vd(o.anchorNode)||z(e,zn,r);const c=r.length;fn&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),Er||Zn||wr||!e.isComposing()||(br=0,$e(null))}else zo(!1,e,r!==null?r:void 0),lr&&(gi(e,r||void 0),lr=!1);return(function(){Pe();const s=me();hu(s)})(),!0}function ip(n){const e=me(),t=M();if(P(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();$e(r.key),(n.timeStamp<br+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||$(i)&&i.getStyle()!==t.style)&&z(e,zn,Ph)}return!0}function sp(n){return gi(me(),n.data),!0}function gi(n,e){const t=n._compositionKey;if($e(null),t!==null&&e!=null){if(e===""){const r=Te(t),i=Hn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&$(r)&&Uo(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
5
|
+
`){const r=M();if(P(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void z(n,di,null)}}}zo(!0,n,e)}function op(n){const e=me();if(n.key==null)return!0;if(Ks&&gl(n))return Et(e,()=>{gi(e,Ws)}),Ks=!1,Ws="",!0;if((function(t){return ge(t,"ArrowRight",{shiftKey:"any"})})(n))z(e,Ou,n);else if((function(t){return ge(t,"ArrowRight",Rt)})(n))z(e,Gh,n);else if((function(t){return ge(t,"ArrowLeft",{shiftKey:"any"})})(n))z(e,So,n);else if((function(t){return ge(t,"ArrowLeft",Rt)})(n))z(e,Zh,n);else if((function(t){return ge(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))z(e,Co,n);else if((function(t){return ge(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))z(e,Eo,n);else if((function(t){return ge(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))fr=!0,z(e,di,n);else if((function(t){return t.key===" "})(n))z(e,wo,n);else if((function(t){return ct&&ge(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),fr=!0,z(e,jn,!0);else if((function(t){return ge(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))fr=!1,z(e,di,n);else if((function(t){return ge(t,"Backspace",{shiftKey:"any"})||ct&&ge(t,"h",{ctrlKey:!0})})(n))gl(n)?z(e,Iu,n):(n.preventDefault(),z(e,ln,!0));else if((function(t){return t.key==="Escape"})(n))z(e,To,n);else if((function(t){return ge(t,"Delete",{})||ct&&ge(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?z(e,Ru,n):(n.preventDefault(),z(e,ln,!1));else if((function(t){return ge(t,"Backspace",fl)})(n))n.preventDefault(),z(e,vr,!0);else if((function(t){return ge(t,"Delete",fl)})(n))n.preventDefault(),z(e,vr,!1);else if((function(t){return ct&&ge(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),z(e,xr,!0);else if((function(t){return ct&&(ge(t,"Delete",{metaKey:!0})||ge(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),z(e,xr,!1);else if((function(t){return ge(t,"b",Rt)})(n))n.preventDefault(),z(e,Wt,"bold");else if((function(t){return ge(t,"u",Rt)})(n))n.preventDefault(),z(e,Wt,"underline");else if((function(t){return ge(t,"i",Rt)})(n))n.preventDefault(),z(e,Wt,"italic");else if((function(t){return ge(t,"Tab",{shiftKey:"any"})})(n))z(e,ko,n);else if((function(t){return ge(t,"z",Rt)})(n))n.preventDefault(),z(e,Au,void 0);else if((function(t){return ct?ge(t,"z",{metaKey:!0,shiftKey:!0}):ge(t,"y",{ctrlKey:!0})||ge(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),z(e,Fu,void 0);else{const t=e._editorState._selection;t===null||P(t)?hl(n)&&(n.preventDefault(),z(e,Ds,n)):(function(r){return ge(r,"c",Rt)})(n)?(n.preventDefault(),z(e,Fi,n)):(function(r){return ge(r,"x",Rt)})(n)?(n.preventDefault(),z(e,No,n)):hl(n)&&(n.preventDefault(),z(e,Ds,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(tp,n),!0}function Vu(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Un=new Map;function qu(n){const e=Dp(n.target);if(e===null)return;const t=$i(e.anchorNode);if(t===null)return;Us&&(Us=!1,Et(t,()=>{const l=En(),u=e.anchorNode;(Ce(u)||jt(u))&&Me(Po(l,e,t,n))}));const r=jo(t),i=r[r.length-1],s=i._key,o=Un.get(s),a=o||i;a!==t&&Ua(e,a,!1),Ua(e,t,!0),t!==i?Un.set(s,t):o&&Un.delete(s)}function Ka(n){n._lexicalHandled=!0}function Wa(n){return n._lexicalHandled===!0}function ap(n){const e=js.get(n);if(e===void 0)return;const t=fi.get(e);if(t===void 0)return;const r=t-1;r>=0||I(164),js.delete(n),fi.set(e,r),r===0&&e.removeEventListener("selectionchange",qu);const i=Mi(n);Bo(i)?((function(o){if(o._parentEditor!==null){const a=jo(o),l=a[a.length-1]._key;Un.get(l)===o&&Un.delete(l)}else Un.delete(o._key)})(i),n.__lexicalEditor=null):i&&I(198);const s=Vu(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function Vs(n,e,t){Pe();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(a){const l=M();if(!P(l)||!N(a))return l;const{anchor:u,focus:c}=l,f=u.getNode(),d=c.getNode();return Gs(f,a)&&u.set(a.__key,0,"element"),Gs(d,a)&&c.set(a.__key,0,"element"),l})(n);let o=!1;if(P(s)&&e){const a=s.anchor,l=s.focus;a.key===r&&(yi(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),l.key===r&&(yi(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else Ne(s)&&e&&n.isSelected()&&n.selectPrevious();if(P(s)&&e&&!o){const a=n.getIndexWithinParent();un(n),mi(s,i,a,-1)}else un(n);t||je(i)||i.canBeEmpty()||!i.isEmpty()||Vs(i,e),e&&s&&Fe(i)&&i.isEmpty()&&i.selectEnd()}const Hu=Symbol.for("ephemeral");function hi(n){return n[Hu]||!1}class St{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=ji(this);return e===void 0&&I(64,this.name),e}static clone(e){I(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),gd(this,e)}getType(){return this.__type}isInline(){I(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Te(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||M();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if($(this))return r;if(P(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(ae(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Te(e)}getParentOrThrow(){const e=this.getParent();return e===null&&I(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(je(t))return N(e)||e===this&&ae(e)||I(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&I(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Te(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Te(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=N(this)?this:this.getParent(),r=N(e)?e:e.getParent(),i=t&&r?ei(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=ei(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?kd(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&I(279),!1)))}isParentOf(e){const t=ei(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const a=N(s)?t?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}const l=t?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}const u=s.getParentOrThrow();if(i.has(u.__key)||r.push(u),u===e)break;let c=null,f=u;do{if(f===null&&I(68),c=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;c!==null||i.has(f.__key)||r.push(f)}while(c===null);s=c}return t||r.reverse(),r}isDirty(){const e=me()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(hi(this))return this;const e=Te(this.__key);return e===null&&I(113),e}getWritable(){if(hi(this))return this;Pe();const e=Zt(),t=me(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,a=M();if(a!==null&&a.setCachedNodes(null),o.has(i))return vi(s),s;const l=Sd(s);return o.add(i),vi(l),r.set(i,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){I(70)}updateDOM(e,t,r){I(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){I(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const a of vu(i).flatKeys)a in r&&(o!==void 0&&o!==s||(o={...s}),o[a]=r[a]);return(i.__state||o)&&_u(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){Vs(this,!0,e)}replace(e,t){Pe();let r=M();r!==null&&(r=r.clone()),as(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),u=l.__size;un(a);const c=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(Vs(i,!1,!0),c===null?l.__first=o:c.getWritable().__next=o,a.__prev=d,f===null?l.__last=o:f.getWritable().__prev=o,a.__next=h,a.__parent=g,l.__size=u,t&&(N(this)&&N(a)||I(139),this.getChildren().forEach(m=>{a.append(m)})),P(r)){Me(r);const m=r.anchor,y=r.focus;m.key===s&&Ja(m,a),y.key===s&&Ja(y,a)}return Vt()===s&&$e(o),a}insertAfter(e,t=!0){Pe(),as(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=M();let a=!1,l=!1;if(s!==null){const h=e.getIndexWithinParent();if(un(i),P(o)){const g=s.__key,m=o.anchor,y=o.focus;a=m.type==="element"&&m.key===g&&m.offset===h+1,l=y.type==="element"&&y.key===g&&y.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(u===null?c.__last=f:u.getWritable().__prev=f,c.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&P(o)){const h=this.getIndexWithinParent();mi(o,c,h+1);const g=c.__key;a&&o.anchor.set(g,h+2,"element"),l&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Pe(),as(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;un(i);const o=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,u=this.getIndexWithinParent();o===null?a.__first=s:o.getWritable().__next=s,a.__size++,r.__prev=s,i.__prev=l,i.__next=r.__key,i.__parent=r.__parent;const c=M();return t&&P(c)&&mi(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return xe()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Pe();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(N(r))return r.select();if(!$(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){Pe();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(N(r))return r.select(0,0);if(!$(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const lp="historic",Kn="history-merge",cp="paste",Ju="collaboration",up="skip-scroll-into-view",dp="skip-dom-selection",fp="skip-selection-focus";class Yn extends St{static getType(){return"linebreak"}static clone(e){return new Yn(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
6
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&xi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zr(i)){const s=r.lastChild;if(s===t||s.previousSibling===t&&zr(s))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&xi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zr(i))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&zr(s))return!0}return!1})(e)?null:{conversion:gp,priority:0}}}static importJSON(e){return ft().updateFromJSON(e)}}function gp(n){return{node:ft()}}function ft(){return at(new Yn)}function Ct(n){return n instanceof Yn}function zr(n){return jt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ns(n,e){return 16&e?"code":e&du?"mark":32&e?"sub":64&e?"sup":null}function rs(n,e){return 1&e?"strong":2&e?"em":"span"}function Gu(n,e,t,r,i){const s=r.classList;let o=Wn(i,"base");o!==void 0&&s.add(...o),o=Wn(i,"underlineStrikethrough");let a=!1;const l=8&e&&4&e;o!==void 0&&(8&t&&4&t?(a=!0,l||s.add(...o)):l&&s.remove(...o));for(const u in gn){const c=gn[u];if(o=Wn(i,u),o!==void 0)if(t&c){if(a&&(u==="underline"||u==="strikethrough")){e&c&&s.remove(...o);continue}((e&c)===0||l&&u==="underline"||u==="strikethrough")&&s.add(...o)}else e&c&&s.remove(...o)}}function Zu(n,e,t){const r=e.firstChild,i=t.isComposing(),s=n+(i?ki:"");if(r==null)e.textContent=s;else{const o=r.nodeValue;if(o!==s)if(i||fn){const[a,l,u]=(function(c,f){const d=c.length,h=f.length;let g=0,m=0;for(;g<d&&g<h&&c[g]===f[g];)g++;for(;m+g<d&&m+g<h&&c[d-m-1]===f[h-m-1];)m++;return[g,d-g-m,f.slice(g,h-m)]})(o,s);l!==0&&r.deleteData(a,l),r.insertData(a,u)}else r.nodeValue=s}}function Va(n,e,t,r,i,s){Zu(i,n,e);const o=s.theme.text;o!==void 0&&Gu(0,0,r,n,o)}function Ur(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Ft extends St{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Ft(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return $h[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Vt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=gn[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return _i(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=ns(0,r),s=rs(0,r),o=i===null?s:i,a=document.createElement(o);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(l=document.createElement(s),a.appendChild(l)),Va(l,this,0,r,this.__text,e);const u=this.__style;return u!==""&&(a.style.cssText=u),a}updateDOM(e,t,r){const i=this.__text,s=e.__format,o=this.__format,a=ns(0,s),l=ns(0,o),u=rs(0,s),c=rs(0,o);if((a===null?u:a)!==(l===null?c:l))return!0;if(a===l&&u!==c){const m=t.firstChild;m==null&&I(48);const y=document.createElement(c);return Va(y,this,0,o,i,r),t.replaceChild(y,m),!1}let f=t;l!==null&&a!==null&&(f=t.firstChild,f==null&&I(49)),Zu(i,f,this);const d=r.theme.text;d!==void 0&&s!==o&&Gu(0,s,o,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:yp,priority:0}),b:()=>({conversion:pp,priority:0}),code:()=>({conversion:It,priority:0}),em:()=>({conversion:It,priority:0}),i:()=>({conversion:It,priority:0}),mark:()=>({conversion:It,priority:0}),s:()=>({conversion:It,priority:0}),span:()=>({conversion:hp,priority:0}),strong:()=>({conversion:It,priority:0}),sub:()=>({conversion:It,priority:0}),sup:()=>({conversion:It,priority:0}),u:()=>({conversion:It,priority:0})}}static importJSON(e){return be().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ce(t)||I(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=Ur(t,"b")),this.hasFormat("italic")&&(t=Ur(t,"i")),this.hasFormat("strikethrough")&&(t=Ur(t,"s")),this.hasFormat("underline")&&(t=Ur(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?gn[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Oh[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=_i(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Rh[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Pe();let r=e,i=t;const s=M(),o=this.getTextContent(),a=this.__key;if(typeof o=="string"){const l=o.length;r===void 0&&(r=l),i===void 0&&(i=l)}else r=0,i=0;if(!P(s))return Qu(a,r,a,i,"text","text");{const l=Vt();l!==s.anchor.key&&l!==s.focus.key||$e(a),s.setTextNodeRange(this,r,this,i)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const s=this.getWritable(),o=s.__text,a=r.length;let l=e;l<0&&(l=a+l,l<0&&(l=0));const u=M();if(i&&P(u)){const f=e+a;u.setTextNodeRange(s,f,s,f)}const c=o.slice(0,l)+r+o.slice(l+t);return s.__text=c,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Pe();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,s=Vt(),o=r.length;e.sort((w,E)=>w-E),e.push(o);const a=[],l=e.length;for(let w=0,E=0;w<o&&E<=l;E++){const k=e[E];k>w&&(a.push(r.slice(w,k)),w=k)}const u=a.length;if(u===1)return[t];const c=a[0],f=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),m=t.__detail;let y=!1,x=null,p=null;const _=M();if(P(_)){const[w,E]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];w.type==="text"&&w.key===i&&(x=w),E.type==="text"&&E.key===i&&(p=E)}t.isSegmented()?(d=be(c),d.__format=h,d.__style=g,d.__detail=m,d.__state=$a(t,d),y=!0):d=t.setTextContent(c);const S=[d];for(let w=1;w<u;w++){const E=be(a[w]);E.__format=h,E.__style=g,E.__detail=m,E.__state=$a(t,E);const k=E.__key;s===i&&$e(k),S.push(E)}const C=x?x.offset:null,v=p?p.offset:null;let b=0;for(const w of S){if(!x&&!p)break;const E=b+w.getTextContentSize();if(x!==null&&C!==null&&C<=E&&C>=b&&(x.set(w.getKey(),C-b,"text"),C<E&&(x=null)),p!==null&&v!==null&&v<=E&&v>=b){p.set(w.getKey(),v-b,"text");break}b=E}if(f!==null){(function(k){const F=k.getPreviousSibling(),L=k.getNextSibling();F!==null&&vi(F),L!==null&&vi(L)})(this);const w=f.getWritable(),E=this.getIndexWithinParent();y?(w.splice(E,0,S),this.remove()):w.splice(E,1,S),P(_)&&mi(_,f,E,u-1)}return S}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||I(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;Vt()===i&&$e(r);const a=M();if(P(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===i&&tl(f,t,r,e,o),d!==null&&d.key===i&&tl(d,t,r,e,o)}const l=e.__text,u=t?l+s:s+l;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function hp(n){return{forChild:Ao(n.style),node:null}}function pp(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Ao(e.style,t?void 0:"bold"),node:null}}const qa=new WeakMap;function mp(n){if(!Ce(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function yp(n){const e=n;n.parentElement===null&&I(129);let t=e.textContent||"";if((function(r){let i,s=r.parentNode;const o=[r];for(;s!==null&&(i=qa.get(s))===void 0&&!mp(s);)o.push(s),s=s.parentNode;const a=i===void 0?s:i;for(let l=0;l<o.length;l++)qa.set(o[l],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],s=r.length;for(let o=0;o<s;o++){const a=r[o];a===`
|
|
7
|
+
`||a===`\r
|
|
8
|
+
`?i.push(ft()):a===" "?i.push(Qn()):a!==""&&i.push(be(a))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Ha(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Ha(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:be(t)}}function Ha(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,Ce(t)){const s=t.style.display;if(s===""&&!Xs(t)||s!==""&&!s.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(jt(t))return t;if(t.nodeName==="BR")return null}}const _p={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function It(n){const e=_p[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ao(n.style,e),node:null}}function be(n=""){return at(new Ft(n))}function $(n){return n instanceof Ft}function Ao(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",s=r.includes("line-through"),o=n.fontStyle==="italic",a=r.includes("underline"),l=n.verticalAlign;return u=>($(u)&&(i&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),o&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),l!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),l!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class Xn extends Ft{static getType(){return"tab"}static clone(e){return new Xn(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Wn(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return Qn().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&lu(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||I(286),this}setDetail(e){return e!==2&&I(127),this}setMode(e){return e!=="normal"&&I(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Qn(){return at(new Xn)}function Pi(n){return n instanceof Xn}class vp{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Td(Qe(At(this,"next")),Qe(At(e,"next")))<0}getNode(){const e=Te(this.key);return e===null&&I(20),e}set(e,t,r,i){const s=this._selection,o=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,Tr()||(Vt()===o&&$e(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}}function kt(n,e,t){return new vp(n,e,t)}function is(n,e){let t=e.__key,r=n.offset,i="element";if($(e)){i="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!N(e)){const s=e.getNextSibling();if($(s))t=s.__key,r=0,i="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Ja(n,e){if(N(e)){const t=e.getLastDescendant();N(t)||$(t)?is(n,t):is(n,e)}else is(n,e)}class Oi{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ne(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Oi(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let s;if($(i))s=i.select();else{const o=i.getIndexWithinParent()+1;s=i.getParentOrThrow().select(o,o)}s.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const s=Te(i);s!==null&&r.push(s)}return Tr()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((M()||En())===this&&e[0]){const t=ke(e[0],"next");Nd(Gt(t,t))}for(const t of e)t.remove()}}function P(n){return n instanceof Cn}class Cn{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!P(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const i=[],[s,o]=r.getTextSlices();s&&i.push(s.caret.origin);const a=new Set,l=new Set;for(const u of r)if(rt(u)){const{origin:c}=u;i.length===0?a.add(c):(l.add(c),i.push(c))}else{const{origin:c}=u;N(c)&&l.has(c)||i.push(c)}if(o&&i.push(o.caret.origin),Jn(r.focus)&&N(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=it(r.focus.origin,"previous");rt(u)&&a.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(i[i.length-1]);u=zi(u))a.delete(u.origin),i.pop();for(;i.length>1;){const u=i[i.length-1];if(!N(u)||l.has(u)||u.isEmpty()||a.has(u))break;i.pop()}if(i.length===0&&r.isCollapsed()){const u=Qe(r.anchor),c=Qe(r.anchor.getFlipped()),f=h=>wt(h)?h.origin:h.getNodeAtCaret(),d=f(u)||f(c)||(r.anchor.getNodeAtCaret()?u.origin:c.origin);i.push(d)}return i})(Fd(xl(this),"next"));return Tr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,s=this.focus,o=i.isBefore(s),[a,l]=qs(this);let u="",c=!0;for(let f=0;f<e.length;f++){const d=e[f];if(N(d)&&!d.isInline())c||(u+=`
|
|
9
|
+
`),c=!d.isEmpty();else if(c=!1,$(d)){let h=d.getTextContent();d===t?d===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=o?h.slice(a):h.slice(l):d===r&&(h=o?h.slice(0,l):h.slice(0,a)),u+=h}else!ae(d)&&!Ct(d)||d===r&&this.isCollapsed()||(u+=d.getTextContent())}return u}applyDOMRange(e){const t=me(),r=t.getEditorState()._selection,i=Xu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[s,o]=i;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(o.key,o.offset,o.type,!0),hn(this)}clone(){const e=this.anchor,t=this.focus;return new Cn(kt(e.key,e.offset,e.type),kt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=_i(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=gn[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];o===`
|
|
10
|
+
`||o===`\r
|
|
11
|
+
`?r.push(ft()):o===" "?r.push(Qn()):r.push(be(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,a=t),o.type==="element"&&(function(y,x,p,_){const S=y.getNode(),C=S.getChildAtIndex(y.offset),v=be();if(v.setFormat(p),v.setStyle(_),Nr(C))C.splice(0,0,[v]);else{const b=Fe(S)?xe().append(v):v;C===null?S.append(b):C.insertBefore(b)}y.is(x)&&x.set(v.__key,0,"text"),y.set(v.__key,0,"text")})(o,a,i,s),a.type==="element"&&bn(a,Qe(At(a,"next")));const l=o.offset;let u=a.offset;const c=this.getNodes(),f=c.length;let d=c[0];$(d)||I(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=c[f-1];if(f===1&&a.type==="element"&&(u=h,a.set(o.key,u,"text")),this.isCollapsed()&&l===h&&($t(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let y=d.getNextSibling();if($(y)&&y.canInsertTextBefore()&&!$t(y)||(y=be(),y.setFormat(i),y.setStyle(s),g.canInsertTextAfter()?d.insertAfter(y):g.insertAfter(y)),y.select(0,0),d=y,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&($t(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let y=d.getPreviousSibling();if($(y)&&!$t(y)||(y=be(),y.setFormat(i),g.canInsertTextBefore()?d.insertBefore(y):g.insertBefore(y)),y.select(),d=y,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const y=be(d.getTextContent());y.setFormat(i),d.replace(y),d=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||N(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),Yu(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(cn(d)){const _=be(e);return _.select(),void d.replace(_)}const y=d.getFormat(),x=d.getStyle();if(l!==u||y===i&&x===s){if(Pi(d)){const _=be(e);return _.setFormat(i),_.setStyle(s),_.select(),void d.replace(_)}}else{if(d.getTextContent()!==""){const _=be(e);if(_.setFormat(i),_.setStyle(s),_.select(),l===0)d.insertBefore(_,!1);else{const[S]=d.splitText(l);S.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(s)}const p=u-l;d=d.spliceText(l,p,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=y,this.style=x))}else{const y=new Set([...d.getParentKeys(),...m.getParentKeys()]),x=N(d)?d:d.getParentOrThrow();let p=N(m)?m:m.getParentOrThrow(),_=m;if(!x.is(p)&&p.isInline())do _=p,p=p.getParentOrThrow();while(p.isInline());if(a.type==="text"&&(u!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<u)if($(m)&&!cn(m)&&u!==m.getTextContentSize()){if(m.isSegmented()){const w=be(m.getTextContent());m.replace(w),m=w}Fe(a.getNode())||a.type!=="text"||(m=m.spliceText(0,u,"")),y.add(m.__key)}else{const w=m.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?m.remove():w.remove()}else y.add(m.__key);const S=p.getChildren(),C=new Set(c),v=x.is(p),b=x.isInline()&&d.getNextSibling()===null?x:d;for(let w=S.length-1;w>=0;w--){const E=S[w];if(E.is(d)||N(E)&&E.isParentOf(d))break;E.isAttached()&&(!C.has(E)||E.is(_)?v||b.insertAfter(E,!1):E.remove())}if(!v){let w=p,E=null;for(;w!==null;){const k=w.getChildren(),F=k.length;(F===0||k[F-1].is(E))&&(y.delete(w.__key),E=w),w=w.getParent()}}if(cn(d))if(l===h)d.select();else{const w=be(e);w.select(),d.replace(w)}else d=d.spliceText(l,h-l,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let w=1;w<f;w++){const E=c[w],k=E.__key;y.has(k)||E.remove()}}}removeText(){const e=M()===this;ti(this,Gp(xl(this))),e&&M()!==this&&Me(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void $e(null);const r=this.getNodes(),i=[];for(const S of r)$(S)&&i.push(S);const s=S=>{r.forEach(C=>{if(N(C)){const v=C.getFormatFlags(e,S);C.setTextFormat(v)}})},o=i.length;if(o===0)return this.toggleFormat(e),$e(null),void s(t);const a=this.anchor,l=this.focus,u=this.isBackward(),c=u?l:a,f=u?a:l;let d=0,h=i[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(d=1,h=i[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);s(m);const y=o-1;let x=i[y];const p=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===p)return;if($t(h)||g===0&&p===h.getTextContentSize())h.setFormat(m);else{const S=h.splitText(g,p),C=g===0?S[0]:S[1];C.setFormat(m),c.type==="text"&&c.set(C.__key,0,"text"),f.type==="text"&&f.set(C.__key,p-g,"text")}return void(this.format=m)}g===0||$t(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const _=x.getFormatFlags(e,m);p>0&&(p===x.getTextContentSize()||$t(x)||([x]=x.splitText(p)),x.setFormat(_));for(let S=d+1;S<y;S++){const C=i[S],v=C.getFormatFlags(e,_);C.setFormat(v)}c.type==="text"&&c.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,p,"text"),this.format=m|_}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=M();return P(g)||I(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=qe(t,Kt),i=e[e.length-1];if(N(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=ss(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(N(g)||ae(g))&&!g.isInline())){N(r)||I(211,t.constructor.name,t.getType());const g=ss(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const m=xe();let y=null;for(let x=0;x<g.length;x++){const p=g[x],_=Ct(p);if(_||ae(p)&&p.isInline()||N(p)&&p.isInline()||$(p)||p.isParentRequired()){if(y===null&&(y=p.createParentElementNode(),m.append(y),_))continue;y!==null&&y.append(p)}else m.append(p),y=null}return m})(e),o=s.getLastDescendant(),a=s.getChildren(),l=!N(r)||!r.isEmpty()?this.insertParagraph():null,u=a[a.length-1];let c=a[0];var f;N(f=c)&&Kt(f)&&!f.isEmpty()&&N(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(N(r)||I(211,t.constructor.name,t.getType()),r.append(...c.getChildren()),c=a[1]),c&&(r===null&&I(212,t.constructor.name,t.getType()),(function(g,m){const y=m.getParentOrThrow().getLastChild();let x=m;const p=[m];for(;x!==y;)x.getNextSibling()||I(140),x=x.getNextSibling(),p.push(x);let _=g;for(const S of p)_=_.insertAfter(S)})(r,c));const d=qe(o,Kt);l&&N(d)&&(l.canMergeWhenEmpty()||Kt(u))&&(d.append(...l.getChildren()),l.remove()),N(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=N(r)?r.getLastChild():null;Ct(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=xe();return Se().splice(this.anchor.offset,0,[o]),o.select(),o}const e=ss(this),t=qe(this.anchor.getNode(),Kt);N(t)||I(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const t=ft();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=qs(this),a=this.isBackward(),[l,u]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[c,f]=a?[o,s]:[s,o];if(t===0)return[];if(t===1){if($(r)&&!this.isCollapsed()){const d=r.splitText(c,f),h=c===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),u.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if($(r)&&(c===r.getTextContentSize()?e.shift():c!==0&&([,r]=r.splitText(c),e[0]=r,l.set(r.getKey(),0,"text"))),$(i)){const d=i.getTextContent().length;f===0?e.pop():f!==d&&([i]=i.splitText(f),e[e.length-1]=i,u.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(nl(this,e,t,r))return;const i=e==="move",s=me(),o=pt(ot(s));if(!o)return;const a=s._blockCursorElement,l=s._rootElement,u=this.focus.getNode();if(l===null||a===null||!N(u)||u.isInline()||u.canBeEmpty()||Zs(a,s,l),this.dirty){let c=yn(s,this.anchor.key),f=yn(s,this.focus.key);this.anchor.type==="text"&&(c=Hn(c)),this.focus.type==="text"&&(f=Hn(f)),c&&f&&ed(o,c,this.anchor.offset,f,this.focus.offset)}if((function(c,f,d,h){c.modify(f,d,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const c=o.getRangeAt(0),f=this.anchor.getNode(),d=Fe(f)?f:$p(f);if(this.applyDOMRange(c),this.dirty=!0,!i){const h=this.getNodes(),g=[];let m=!1;for(let y=0;y<h.length;y++){const x=h[y];Gs(x,d)?g.push(x):m=!0}if(m&&g.length>0)if(t){const y=g[0];N(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=g[g.length-1];N(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}o.anchorNode===c.startContainer&&o.anchorOffset===c.startOffset||(function(y){const x=y.focus,p=y.anchor,_=p.key,S=p.offset,C=p.type;p.set(x.key,x.offset,x.type,!0),x.set(_,S,C,!0)})(this)}}r==="lineboundary"&&nl(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&N(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),s=t.getNextSibling()||(i===null?null:i.getNextSibling());if(N(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const s=Zo(At(r,e?"previous":"next"));if(s.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of s.iterNodeCarets("shadowRoot"))if(rt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(N(s.anchor.origin)&&s.anchor.origin.isEmpty()){const u=Qe(l);ti(this,Gt(u,u)),s.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Jn(l)){if(N(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(s.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(ae(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&N(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const u=Fo();u.add(l.origin.getKey()),Me(u)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:u}=a;return ti(this,Gt(!l.origin.isEmpty()&&u.isEmpty()?Pr(ke(u,l.direction)):s.anchor,l)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Za(this,r.getNode()))return}else{const a=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=o.offset,u=a.getTextContentSize();if(a.is(i)||e&&l!==u||!e&&l!==0)return void Ya(a,e,l)}else if(i!==null&&i.isSegmented()){const l=r.offset,u=i.getTextContentSize();if(i.is(a)||e&&l!==0||!e&&l!==u)return void Ya(i,e,l)}(function(l,u){const c=l.anchor,f=l.focus,d=c.getNode(),h=f.getNode();if(d===h&&c.type==="text"&&f.type==="text"){const g=c.offset,m=f.offset,y=g<m,x=y?g:m,p=y?m:g,_=p-1;x!==_&&(function(S){return!(yd(S)||xp(S))})(d.getTextContent().slice(x,p))&&(u?f.set(f.key,_,f.type):c.set(c.key,_,c.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Fe(r.getParent())&&r.getPreviousSibling()===null&&Za(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ne(n){return n instanceof Oi}function Ga(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function qs(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Ga(t),Ga(r)]}function Za(n,e){for(let t=e;t;t=t.getParent()){if(N(t)){if(t.collapseAtStart(n))return!0;if(je(t))break}if(t.getPreviousSibling())break}return!1}const xp=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Ya(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,a=0;for(let u=0;u<s;u++){const c=u===s-1;if(a=o,o+=i[u].length,e&&o===t||o>t||c){i.splice(u,1),c&&(a=void 0);break}}const l=i.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Xa(n,e,t,r){let i,s=e;if(Ce(n)){let o=!1;const a=n.childNodes,l=a.length,u=r._blockCursorElement;s===l&&(o=!0,s=l-1);let c=a[s],f=!1;if(c===u)c=a[s+1],f=!0;else if(u!==null){const d=u.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,u)&&s--}if(i=Dn(c),$(i))s=Tt(i,o?"next":"previous");else{let d=Dn(n);if(d===null)return null;if(N(d)){const h=r.getElementByKey(d.getKey());h===null&&I(214),[d,s]=d.getDOMSlot(h).resolveChildIndex(d,h,n,e),N(d)||I(215),o&&s>=d.getChildrenSize()&&(s=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(s);if(N(m)&&(function(y,x,p){const _=y.getParent();return p===null||_===null||!_.canBeEmpty()||_!==p.getNode()})(m,0,t)){const y=o?m.getLastDescendant():m.getFirstDescendant();y===null?d=m:(m=y,d=N(m)?m:m.getParentOrThrow()),s=0}$(m)?(i=m,d=null,s=Tt(m,o?"next":"previous")):m!==d&&o&&!f&&(N(d)||I(216),s=Math.min(d.getChildrenSize(),s+1))}else{const h=d.getIndexWithinParent();s=e===0&&ae(d)&&Dn(n)===d?h:h+1,d=d.getParentOrThrow()}if(N(d))return kt(d.__key,s,"element")}}else i=Dn(n);return $(i)?kt(i.__key,Tt(i,s,"clamp"),"text"):null}function Qa(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const s=i.getPreviousSibling(),o=i.getParent();if(e){if((t||!e)&&s===null&&N(o)&&o.isInline()){const a=o.getPreviousSibling();$(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else N(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):$(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&N(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&N(o)&&o.isInline()&&!o.canInsertTextAfter()){const a=o.getNextSibling();$(a)&&n.set(a.__key,0,"text")}}}function Yu(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Qa(n,r,i),Qa(e,!r,i),i&&e.set(n.key,n.offset,n.type);const s=me();if(s.isComposing()&&s._compositionKey!==n.key&&P(t)){const o=t.anchor,a=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function Xu(n,e,t,r,i,s){if(n===null||t===null||!Ar(i,n,t))return null;const o=Xa(n,e,P(s)?s.anchor:null,i);if(o===null)return null;const a=Xa(t,r,P(s)?s.focus:null,i);if(a===null)return null;if(o.type==="element"&&a.type==="element"){const l=Dn(n),u=Dn(t);if(ae(l)&&ae(u))return null}return Yu(o,a,s),[o,a]}function pi(n){return N(n)&&!n.isInline()}function Qu(n,e,t,r,i,s){const o=Zt(),a=new Cn(kt(n,e,i),kt(t,r,s),0,"");return a.dirty=!0,o._selection=a,a}function Ii(){const n=kt("root",0,"element"),e=kt("root",0,"element");return new Cn(n,e,0,"")}function Fo(){return new Oi(new Set)}function Po(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,a=o==="selectionchange",l=!ks&&(a||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let u,c,f,d;if(P(n)&&!l)return n.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,(a||o===void 0)&&P(n)&&!Ar(t,u,c))return n.clone();const h=Xu(u,f,c,d,t,n);if(h===null)return null;const[g,m]=h;return new Cn(g,m,P(n)?n.format:0,P(n)?n.style:"")}function M(){return Zt()._selection}function En(){return me()._editorState._selection}function mi(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),a=s.getNode();if(!e.is(o)&&!e.is(a))return;const l=e.__key;if(n.isCollapsed()){const u=i.offset;if(t<=u&&r>0||t<u&&r<0){const c=Math.max(0,u+r);i.set(l,c,"element"),s.set(l,c,"element"),el(n)}}else{const u=n.isBackward(),c=u?s:i,f=c.getNode(),d=u?i:s,h=d.getNode();if(e.is(f)){const g=c.offset;(t<=g&&r>0||t<g&&r<0)&&c.set(l,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}el(n)}function el(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!N(s))return;const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if($(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}return}if(N(s)){const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if($(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(N(o)){const a=o.getChildrenSize(),l=i>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(i);if($(u)){let c=0;l&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}function yi(n,e,t,r,i){let s=null,o=0,a=null;r!==null?(s=r.__key,$(r)?(o=r.getTextContentSize(),a="text"):N(r)&&(o=r.getChildrenSize(),a="element")):i!==null&&(s=i.__key,$(i)?a="text":N(i)&&(a="element")),s!==null&&a!==null?n.set(s,o,a):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function tl(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function ed(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function bp(n,e,t,r,i,s,o){const a=r.anchorNode,l=r.focusNode,u=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(i.has(Ju)&&f!==s||f!==null&&Do(f))return;if(!P(e))return void(n!==null&&Ar(t,a,l)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,y=yn(t,g),x=yn(t,m),p=d.offset,_=h.offset,S=e.format,C=e.style,v=e.isCollapsed();let b=y,w=x,E=!1;if(d.type==="text"){b=Hn(y);const B=d.getNode();E=B.getFormat()!==S||B.getStyle()!==C}else P(n)&&n.anchor.type==="text"&&(E=!0);var k,F,L,R,O;if(h.type==="text"&&(w=Hn(x)),b!==null&&w!==null&&(v&&(n===null||E||P(n)&&(n.format!==S||n.style!==C))&&(k=S,F=C,L=p,R=g,O=performance.now(),zu=[k,F,L,R,O]),u!==p||c!==_||a!==b||l!==w||r.type==="Range"&&v||(f!==null&&s.contains(f)||i.has(fp)||s.focus({preventScroll:!0}),d.type==="element"))){if(ed(r,b,p,w,_),!i.has(up)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const B=P(e)&&e.anchor.type==="element"?b.childNodes[p]||null:r.rangeCount>0?r.getRangeAt(0):null;if(B!==null){let K;if(B instanceof Text){const D=document.createRange();D.selectNode(B),K=D.getBoundingClientRect()}else K=B.getBoundingClientRect();(function(D,U,j){const X=bd(j),te=Wo(X);if(X===null||te===null)return;let{top:J,bottom:le}=U,V=0,re=0,Z=j;for(;Z!==null;){const ce=Z===X.body;if(ce)V=0,re=ot(D).innerHeight;else{const Q=Z.getBoundingClientRect();V=Q.top,re=Q.bottom}let G=0;if(J<V?G=-(V-J):le>re&&(G=le-re),G!==0)if(ce)te.scrollBy(0,G);else{const Q=Z.scrollTop;Z.scrollTop+=G;const ve=Z.scrollTop-Q;J-=ve,le-=ve}if(ce)break;Z=Fr(Z)}})(t,K,s)}}zs=!0}}function Sp(n){let e=M()||En();e===null&&(e=Se().selectEnd()),e.insertNodes(n)}function ss(n){let e=n;n.isCollapsed()||e.removeText();const t=M();P(t)&&(e=t),P(e)||I(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!Kt(i);){const o=i;if([i,s]=Cp(i,s),o.is(i))break}return s}function Cp(n,e){const t=n.getParent();if(!t){const i=xe();return Se().append(i),i.select(),[Se(),0]}if($(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,i[0].getIndexWithinParent()+s]}if(!N(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Cn(kt(n.__key,e,"element"),kt(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function nl(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[c,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(c.key,c.offset,c.type),!0}const s=At(n.focus,t?"previous":"next"),o=r==="lineboundary",a=e==="move";let l=s,u=i==="decorators-and-blocks";if(!Ad(l)){for(const c of l){u=!1;const{origin:f}=c;if(!ae(f)||f.isIsolated()||(l=c,!o||!f.isInline()))break}if(u)for(const c of Zo(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(rt(c))c.origin.isInline()||(l=c);else{if(N(c.origin))continue;ae(c.origin)&&!c.origin.isInline()&&(l=c)}break}}if(l===s)return!1;if(a&&!o&&ae(l.origin)&&l.origin.isKeyboardSelectable()){const c=Fo();return c.add(l.origin.getKey()),Me(c),!0}return l=Qe(l),a&&bn(n.anchor,l),bn(n.focus,l),u||!o}let Oe=null,Ie=null,Je=!1,os=!1,Qr=0;const rl={characterData:!0,childList:!0,subtree:!0};function Tr(){return Je||Oe!==null&&Oe._readOnly}function Pe(){Je&&I(13)}function td(){Qr>99&&I(14)}function Zt(){return Oe===null&&I(195,nd()),Oe}function me(){return Ie===null&&I(196,nd()),Ie}function nd(){let n=0;const e=new Set,t=qn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=Mi(i);if(Bo(s))n++;else if(s){let o=String(s.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Ep(){return Ie}function il(n,e,t){const r=e.__type,i=cd(n,r);let s=t.get(r);s===void 0&&(s=Array.from(i.transforms),t.set(r,s));const o=s.length;for(let a=0;a<o&&(s[a](e),e.isAttached());a++);}function sl(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function rd(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function wp(n){return Oo(n,me()._nodes)}function Oo(n,e){const t=n.type,r=e.get(t);r===void 0&&I(17,t);const i=r.klass;n.type!==i.getType()&&I(18,i.name);const s=i.importJSON(n),o=n.children;if(N(s)&&Array.isArray(o))for(let a=0;a<o.length;a++){const l=Oo(o[a],e);s.append(l)}return s}function ol(n,e,t){const r=Oe,i=Je,s=Ie;Oe=e,Je=!0,Ie=n;try{return t()}finally{Oe=r,Je=i,Ie=s}}function Lt(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const s=n._editorState,o=s._selection,a=t._selection,l=n._dirtyType!==0,u=Oe,c=Je,f=Ie,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&l&&h!==null){Ie=n,Oe=t,Je=!1,n._updating=!0;try{const v=n._dirtyType,b=n._dirtyElements,w=n._dirtyLeaves;h.disconnect(),g=Hh(s,t,n,v,b,w)}catch(v){if(v instanceof Error&&n._onError(v),os)throw v;return ad(n,null,r,t),pu(n),n._dirtyType=2,os=!0,Lt(n,s),void(os=!1)}finally{h.observe(r,rl),n._updating=d,Oe=u,Je=c,Ie=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,y=n._dirtyElements,x=n._normalizedNodes,p=n._updateTags,_=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(v,b){const w=v._decorators;let E=v._pendingDecorators||w;const k=b._nodeMap;let F;for(F in E)k.has(F)||(E===w&&(E=pd(v)),delete E[F])})(n,t);const S=i?null:pt(ot(n));if(n._editable&&S!==null&&(l||a===null||a.dirty||!a.is(o))&&r!==null&&!p.has(dp)){Ie=n,Oe=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const v=n._blockCursorElement;v!==null&&Zs(v,n,r),bp(o,a,n,S,p,r)}(function(v,b,w){let E=v._blockCursorElement;if(P(w)&&w.isCollapsed()&&w.anchor.type==="element"&&b.contains(document.activeElement)){const k=w.anchor,F=k.getNode(),L=k.offset;let R=!1,O=null;if(L===F.getChildrenSize())ls(F.getChildAtIndex(L-1))&&(R=!0);else{const B=F.getChildAtIndex(L);if(B!==null&&ls(B)){const K=B.getPreviousSibling();(K===null||ls(K))&&(R=!0,O=v.getElementByKey(B.__key))}}if(R){const B=v.getElementByKey(F.__key);return E===null&&(v._blockCursorElement=E=(function(K){const D=K.theme,U=document.createElement("div");U.contentEditable="false",U.setAttribute("data-lexical-cursor","true");let j=D.blockCursor;if(j!==void 0){if(typeof j=="string"){const X=uu(j);j=D.blockCursor=X}j!==void 0&&U.classList.add(...j)}return U})(v._config)),b.style.caretColor="transparent",void(O===null?B.appendChild(E):B.insertBefore(E,O))}}E!==null&&Zs(E,v,b)})(n,r,a)}finally{h!==null&&h.observe(r,rl),Ie=f,Oe=u}}g!==null&&(function(v,b,w,E,k){const F=Array.from(v._listeners.mutation),L=F.length;for(let R=0;R<L;R++){const[O,B]=F[R];for(const K of B){const D=b.get(K);D!==void 0&&O(D,{dirtyLeaves:E,prevEditorState:k,updateTags:w})}}})(n,g,p,m,s),P(a)||a===null||o!==null&&o.is(a)||n.dispatchCommand(Eu,void 0);const C=n._pendingDecorators;C!==null&&(n._decorators=C,n._pendingDecorators=null,gr("decorator",n,!0,C)),(function(v,b,w){const E=ul(b),k=ul(w);E!==k&&gr("textcontent",v,!0,k)})(n,e||s,t),gr("update",n,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||s,tags:p}),(function(v,b){if(v._deferred=[],b.length!==0){const w=v._updating;v._updating=!0;try{for(let E=0;E<b.length;E++)b[E]()}finally{v._updating=w}}})(n,_),(function(v){const b=v._updates;if(b.length!==0){const w=b.shift();if(w){const[E,k]=w;Ri(v,E,k)}}})(n)}function gr(n,e,t,...r){const i=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let o=0;o<s.length;o++)s[o].apply(null,r)}finally{e._updating=i}}function al(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,a=n._pendingEditorState;let l;o!==void 0&&(l=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(a===null&&I(191),a._flushSync=!0),l&&n._deferred.push(l),rd(n,o.tag)),a==null?Ri(n,s,o):s()}}return r}function Ri(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,rd(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let l=n._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=id(l||a),u=!0),l._flushSync=o;const c=Oe,f=Je,d=Ie,h=n._updating;Oe=l,Je=!1,n._updating=!0,Ie=n;const g=n._headless||n.getRootElement()===null;Mo(null);try{u&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(p,_){const S=p.getEditorState()._selection,C=pt(ot(p));return P(S)||S==null?Po(S,C,p,_):S.clone()})(n,t&&t.event||null));const y=n._compositionKey;e(),s=al(n,s),(function(p,_){const S=_.getEditorState()._selection,C=p._selection;if(P(C)){const v=C.anchor,b=C.focus;let w;if(v.type==="text"&&(w=v.getNode(),w.selectionTransform(S,C)),b.type==="text"){const E=b.getNode();w!==E&&E.selectionTransform(S,C)}}})(l,n),n._dirtyType!==0&&(s?(function(p,_){const S=_._dirtyLeaves,C=p._nodeMap;for(const v of S){const b=C.get(v);$(b)&&b.isAttached()&&b.isSimpleText()&&!b.isUnmergeable()&&Da(b)}})(l,n):(function(p,_){const S=_._dirtyLeaves,C=_._dirtyElements,v=p._nodeMap,b=Vt(),w=new Map;let E=S,k=E.size,F=C,L=F.size;for(;k>0||L>0;){if(k>0){_._dirtyLeaves=new Set;for(const R of E){const O=v.get(R);$(O)&&O.isAttached()&&O.isSimpleText()&&!O.isUnmergeable()&&Da(O),O!==void 0&&sl(O,b)&&il(_,O,w),S.add(R)}if(E=_._dirtyLeaves,k=E.size,k>0){Qr++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(const R of F){const O=R[0],B=R[1];if(C.set(O,B),!B)continue;const K=v.get(O);K!==void 0&&sl(K,b)&&il(_,K,w)}E=_._dirtyLeaves,k=E.size,F=_._dirtyElements,L=F.size,Qr++}_._dirtyLeaves=S,_._dirtyElements=C})(l,n),al(n),(function(p,_,S,C){const v=p._nodeMap,b=_._nodeMap,w=[];for(const[E]of C){const k=b.get(E);k!==void 0&&(k.isAttached()||(N(k)&&fu(k,E,v,b,w,C),v.has(E)||C.delete(E),w.push(E)))}for(const E of w)b.delete(E);for(const E of S){const k=b.get(E);k===void 0||k.isAttached()||(v.has(E)||S.delete(E),b.delete(E))}})(a,l,n._dirtyLeaves,n._dirtyElements)),y!==n._compositionKey&&(l._flushSync=!0);const x=l._selection;if(P(x)){const p=l._nodeMap,_=x.anchor.key,S=x.focus.key;p.get(_)!==void 0&&p.get(S)!==void 0||I(19)}else Ne(x)&&x._nodes.size===0&&(l._selection=null)}catch(y){return y instanceof Error&&n._onError(y),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Lt(n)}finally{Oe=c,Je=f,Ie=d,n._updating=h,Qr=0}n._dirtyType!==0||n._deferred.length>0||(function(y,x){const p=x.getEditorState()._selection,_=y._selection;if(_!==null){if(_.dirty||!_.is(p))return!0}else if(p!==null)return!0;return!1})(l,n)?l._flushSync?(l._flushSync=!1,Lt(n)):u&&Fp(()=>{Lt(n)}):(l._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Et(n,e,t){Ie===n&&t===void 0?e():Ri(n,e,t)}class hr{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new hr(this.element,e,this.after)}withAfter(e){return new hr(this.element,this.before,e)}withElement(e){return this.element===e?this:new hr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&I(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&I(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&I(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(wr||Zn||Er);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,i))]}const s=ll(t,r);s.push(i);const o=ll(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<o.length;l++){const u=s[l],c=o[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}}function ll(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&I(225),t.reverse()}class et extends St{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ih[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=me()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if($(t)&&e.push(t),N(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;N(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;N(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return N(s)&&s.getLastDescendant()||s||null}const i=t[e];return N(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Te(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&I(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Te(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&I(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContent(),N(s)&&i!==r-1&&!s.isInline()&&(e+=Jt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContentSize(),N(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Fa[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=gn[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return _i(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Pe();const r=M();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if($(l)||N(l))return l.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const l=this.getLastChild();if($(l)||N(l))return l.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const a=this.__key;return P(r)?(r.anchor.set(a,i,"element"),r.focus.set(a,s,"element"),r.dirty=!0,r):Qu(a,i,a,s,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Fa[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){hi(this)&&I(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||I(226,String(e),String(t),String(i));const o=s.__key,a=[],l=[],u=this.getChildAtIndex(e+t);let c=null,f=i-t+r.length;if(e!==0)if(e===i)c=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(t>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let g=0;g<t;g++){h===null&&I(100);const m=h.getNextSibling(),y=h.__key;un(h.getWritable()),l.push(y),h=m}}let d=c;for(const h of r){d!==null&&h.is(d)&&(c=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===o&&f--,un(g);const m=h.__key;if(d===null)s.__first=m,g.__prev=null;else{const y=d.getWritable();y.__next=m,g.__prev=y.__key}h.__key===o&&I(76),g.__parent=o,a.push(m),d=h}if(e+t===i)d!==null&&(d.getWritable().__next=null,s.__last=d.__key);else if(u!==null){const h=u.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=u.__key}else h.__prev=null}if(s.__size=f,l.length){const h=M();if(P(h)){const g=new Set(l),m=new Set(a),{anchor:y,focus:x}=h;cl(y,g,m)&&yi(y,y.getNode(),this,c,u),cl(x,g,m)&&yi(x,x.getNode(),this,c,u),f!==0||this.canBeEmpty()||je(this)||this.remove()}}return s}getDOMSlot(e){return new hr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ce(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||je(this)||this.getChildren().some($)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function N(n){return n instanceof et}function cl(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class Io extends St{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ae(n){return n instanceof Io}class er extends et{__cachedText;static getType(){return"root"}static clone(){return new er}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){I(51)}getTextContent(){const e=this.__cachedText;return!Tr()&&me()._dirtyType!==0||e===null?super.getTextContent():e}remove(){I(52)}replace(e){I(53)}insertBefore(e){I(54)}insertAfter(e){I(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)N(i)||ae(i)||I(282);return super.splice(e,t,r)}static importJSON(e){return Se().updateFromJSON(e)}collapseAtStart(){return!0}}function Fe(n){return n instanceof er}function id(n){return new kr(new Map(n._nodeMap))}function Ro(){return new kr(new Map([["root",new er]]))}function sd(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&I(130,t.name),N(n)){const r=e.children;Array.isArray(r)||I(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=sd(i[s]);r.push(o)}}return e}function Tp(n){return n instanceof kr}class kr{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ol(t&&t.editor||null,this,e)}clone(e){const t=new kr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return ol(null,this,()=>({root:sd(Se())}))}}class $o extends et{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class tr extends et{static getType(){return"paragraph"}static clone(e){return new tr(e.__key)}createDOM(e){const t=document.createElement("p"),r=Wn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:kp,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return xe().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find($);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=xe();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||$(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function kp(n){const e=xe();return n.style&&(e.setFormat(n.style.textAlign),qo(n,e)),{node:e}}function xe(){return at(new tr)}function Nr(n){return n instanceof tr}const ne=0,Ve=1,od=4;function ad(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Ro(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Np(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=ji(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof St&&o!==St?o:void 0}}return e}function ld(n){const e=n||{},t=Ep(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=Ro(),a=e.namespace||(i!==null?i._config.namespace:_d()),l=e.editorState,u=[er,Ft,Yn,Xn,tr,$o,...e.nodes||[]],{onError:c,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let y=u[m],x=null,p=null;if(typeof y!="function"){const C=y;y=C.replace,x=C.with,p=C.withKlass||null}ji(y);const _=y.getType(),S=Np(y);h.set(_,{exportDOM:f&&f.export?f.export.get(y):void 0,klass:y,replace:x,replaceWithKlass:p,sharedNodeState:Uh(u[m]),transforms:S})}}const g=new qn(o,i,h,{disableEvents:s,namespace:a,theme:r},c||console.error,(function(m,y){const x=new Map,p=new Set,_=S=>{Object.keys(S).forEach(C=>{let v=x.get(C);v===void 0&&(v=[],x.set(C,v)),v.push(S[C])})};return m.forEach(S=>{const C=S.klass.importDOM;if(C==null||p.has(C))return;p.add(C);const v=C.call(S.klass);v!==null&&_(v)}),y&&_(y),x})(h,f?f.import:void 0),d,n);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(m){m.registerCommand(wu,np,ne),m.registerCommand(Tu,rp,ne),m.registerCommand(ku,ip,ne),m.registerCommand(Nu,sp,ne),m.registerCommand(Pu,op,ne)})(g),g}class qn{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,s,o,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=_d(),this._onError=s,this._htmlConversions=o,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&I(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);s===void 0&&I(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&I(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=yl(r).get(t.getType());if(!i)return;const s=new Map;for(const o of i.keys())s.set(o,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],s=r.replaceWithKlass;if(s!=null){const o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,a){const l=yl(o.getEditorState()),u=[];for(const c of a){const f=l.get(c);f&&u.push(f)}u.length!==0&&o.update(()=>{for(const c of u)for(const f of c.keys()){const d=Te(f);d&&d.markDirty()}},o._pendingEditorState===null?{tag:Kn}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return z(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Wn(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,ad(this,t,e,i),t!==null&&(this._config.disableEvents||ap(t),r!=null&&t.classList.remove(...r)),e!==null){const s=Wo(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,pu(this),this._updateTags.add(Kn),Lt(this),this._config.disableEvents||(function(a,l){const u=a.ownerDocument;js.set(a,u);const c=fi.get(u)??0;c<1&&u.addEventListener("selectionchange",qu),fi.set(u,c+1),a.__lexicalEditor=l;const f=Vu(a);for(let d=0;d<Bs.length;d++){const[h,g]=Bs[d],m=typeof g=="function"?y=>{Wa(y)||(Ka(y),(l.isEditable()||h==="click")&&g(y,l))}:y=>{if(Wa(y))return;Ka(y);const x=l.isEditable();switch(h){case"cut":return x&&z(l,No,y);case"copy":return z(l,Fi,y);case"paste":return x&&z(l,Ai,y);case"dragstart":return x&&z(l,Lu,y);case"dragover":return x&&z(l,Du,y);case"dragend":return x&&z(l,Xh,y);case"focus":return x&&z(l,Qh,y);case"blur":return x&&z(l,ep,y);case"drop":return x&&z(l,Mu,y)}};a.addEventListener(h,m),f.push(()=>{a.removeEventListener(h,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Kn),Lt(this);gr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&I(38);let r=e;r._readOnly&&(r=id(e),r._selection=e._selection?e._selection.clone():null),hu(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),Lt(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||Lt(this)}parseEditorState(e,t){return(function(r,i,s){const o=Ro(),a=Oe,l=Je,u=Ie,c=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,Oe=o,Je=!1,Ie=i,Mo(null);try{const g=i._nodes;Oo(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=c,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=h,Oe=a,Je=l,Ie=u}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Lt(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):Ri(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Et(this,()=>{const i=M(),s=Se();i!==null?i.dirty||Me(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Ip("focus"),Rp(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=pt(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,gr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qn.version="0.39.0+prod.esm";let Hs=null;function Mo(n){Hs=n}let Ap=1;function cd(n,e){const t=Lo(n,e);return t===void 0&&I(30,e),t}function Lo(n,e){return n._nodes.get(e)}const Fp=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function ud(n){return ae(Nt(n))}function Do(n){const e=document.activeElement;if(!Ce(e))return!1;const t=e.nodeName;return ae(Nt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Mi(e)==null)}function Ar(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Do(e)&&$i(e)===n}catch{return!1}}function Bo(n){return n instanceof qn}function $i(n){let e=n;for(;e!=null;){const t=Mi(e);if(Bo(t))return t;e=Fr(e)}return null}function Mi(n){return n?n.__lexicalEditor:null}function cn(n){return Pi(n)||n.isToken()}function $t(n){return cn(n)||n.isSegmented()}function jt(n){return wn(n)&&n.nodeType===3}function dd(n){return wn(n)&&n.nodeType===9}function Hn(n){let e=n;for(;e!=null;){if(jt(e))return e;e=e.firstChild}return null}function _i(n,e,t){const r=gn[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function fd(n){return $(n)||Ct(n)||ae(n)}function gd(n,e){const t=(function(){const o=Hs;return Hs=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Pe(),td();const r=me(),i=Zt(),s=""+Ap++;i._nodeMap.set(s,n),N(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function un(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,a=i!==null?i.__key:null,l=i!==null?i.getWritable():null,u=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=a),l!==null&&(l.__next=o),u!==null&&(u.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function vi(n){td(),hi(n)&&I(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=Zt(),i=me(),s=r._nodeMap,o=i._dirtyElements;t!==null&&(function(l,u,c){let f=l;for(;f!==null;){if(c.has(f))return;const d=u.get(f);if(d===void 0)break;c.set(f,!1),f=d.__parent}})(t,s,o);const a=e.__key;i._dirtyType=1,N(n)?o.set(a,!0):i._dirtyLeaves.add(a)}function $e(n){Pe();const e=me(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Te(t);r!==null&&r.getWritable()}if(n!==null){const r=Te(n);r!==null&&r.getWritable()}}}function Vt(){return Tr()?null:me()._compositionKey}function Te(n,e){const t=(e||Zt())._nodeMap.get(n);return t===void 0?null:t}function hd(n,e){const t=Li(n,me());return t!==void 0?Te(t,e):null}function Li(n,e){return n[`__lexicalKey_${e._key}`]}function Nt(n,e){let t=n;for(;t!=null;){const r=hd(t,e);if(r!==null)return r;t=Fr(t)}return null}function pd(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function ul(n){return n.read(()=>Se().getTextContent())}function Se(){return md(Zt())}function md(n){return n._nodeMap.get("root")}function Me(n){Pe();const e=Zt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Dn(n){const e=me(),t=(function(r,i){let s=r;for(;s!=null;){const o=Li(s,i);if(o!==void 0)return o;s=Fr(s)}return null})(n,e);return t===null?n===e.getRootElement()?Te("root"):null:Te(t)}function yd(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function jo(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function _d(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function vd(n){return jt(n)?n.nodeValue:null}function zo(n,e,t){const r=pt(ot(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let a=vd(i);const l=Nt(i);if(a!==null&&$(l)){if(a===ki&&t){const u=t.length;a=t,s=u,o=u}a!==null&&Uo(l,a,s,o,n)}}}function Uo(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let a=e;(o||i)&&e[e.length-1]===ki&&(a=e.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(a===""){if($e(null),Er||Zn||wr)s.remove();else{const m=me();setTimeout(()=>{m.update(()=>{s.isAttached()&&s.remove()})},20)}return}const u=s.getParent(),c=En(),f=s.getTextContentSize(),d=Vt(),h=s.getKey();if(s.isToken()||d!==null&&h===d&&!o||P(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===n.__key&&c.anchor.offset===0&&!s.canInsertTextBefore()&&!o||c.focus.key===n.__key&&c.focus.offset===f&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=M();if(!P(g)||t===null||r===null)return void dl(s,a,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const m=be(s.getTextContent());s.replace(m),s=m}dl(s,a,g)}}}function dl(n,e,t){if(n.setTextContent(e),P(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=Tt(n,s.offset,"clamp"))}}}function Kr(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Pp(n,e){return Kr(n,e,"altKey")&&Kr(n,e,"ctrlKey")&&Kr(n,e,"shiftKey")&&Kr(n,e,"metaKey")}function ge(n,e,t){return Pp(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const Rt={ctrlKey:!ct,metaKey:ct},fl={altKey:ct,ctrlKey:!ct};function gl(n){return n.key==="Backspace"}function hl(n){return ge(n,"a",Rt)}function Op(n){const e=Se();if(P(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),hn(n),n}{const t=e.select(0,e.getChildrenSize());return Me(hn(t)),t}}function Wn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=uu(i);return t[e]=s,s}return i}function Ko(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,a=e.get(s);a===void 0&&I(33,s);const l=a.klass;let u=n.get(l);u===void 0&&(u=new Map,n.set(l,u));const c=u.get(o),f=c==="destroyed"&&i==="created";(c===void 0||f)&&u.set(o,f?"updated":i)}function pl(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function Js(n,e){const t=n.offset;if(n.type==="element")return pl(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?pl(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function xd(n){const e=ot(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function z(n,e,t){return(function(r,i,s){const o=jo(r);for(let a=4;a>=0;a--)for(let l=0;l<o.length;l++){const u=o[l],c=u._commands.get(i);if(c!==void 0){const f=c[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Et(u,()=>{for(let m=0;m<h;m++)if(d[m](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function Di(n){return!Fe(n)&&!n.isLastChild()&&!n.isInline()}function yn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&I(75,e),t}function Fr(n){const e=n.assignedSlot||n.parentElement;return Ys(e)?e.host:e}function bd(n){return dd(n)?n:Ce(n)?n.ownerDocument:null}function Ip(n){Pe(),me()._updateTags.add(n)}function Rp(n){Pe(),me()._deferred.push(n)}function Gs(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Wo(n){const e=bd(n);return e?e.defaultView:null}function ot(n){const e=n._window;return e===null&&I(78),e}function $p(n){let e=n.getParentOrThrow();for(;e!==null;){if(je(e))return e;e=e.getParentOrThrow()}return e}function je(n){return Fe(n)||N(n)&&n.isShadowRoot()}function Mp(n){const e=n.constructor.clone(n);return gd(e,null),e.afterCloneFrom(n),e}function at(n){const e=me(),t=n.getType(),r=Lo(e,t);r===void 0&&I(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),a=o.constructor;return s!==null?o instanceof s||I(201,s.name,s.getType(),a.name,a.getType(),n.constructor.name,t):o instanceof n.constructor&&a!==n.constructor||I(202,a.name,a.getType(),n.constructor.name,t),o.__key===n.__key&&I(203,n.constructor.name,t,a.name,a.getType()),o}return n}function as(n,e){!Fe(n.getParent())||N(e)||ae(e)||I(99)}function Lp(n){const e=Te(n);return e===null&&I(63,n),e}function ls(n){return(ae(n)||N(n)&&!n.canBeEmpty())&&!n.isInline()}function Zs(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function pt(n){return ht?(n||window).getSelection():null}function Dp(n){const e=Wo(n);return e?e.getSelection():null}function Vo(n){return Ce(n)&&n.tagName==="A"}function Ce(n){return wn(n)&&n.nodeType===1}function wn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Ys(n){return wn(n)&&n.nodeType===11}function Xs(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function xi(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function Kt(n){if(ae(n)&&!n.isInline())return!0;if(!N(n)||je(n))return!1;const e=n.getFirstChild(),t=e===null||Ct(e)||$(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Bi(){return me()}const ml=new WeakMap,Bp=new Map;function yl(n){if(!n._readOnly&&n.isEmpty())return Bp;n._readOnly||I(192);let e=ml.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let a=r.get(o);a||(a=new Map,r.set(o,a)),a.set(i,s)}return r})(n),ml.set(n,e)),e}function Sd(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function jp(n){return(e=Sd(n))[Hu]=!0,e;var e}function qo(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function zp(n){return n.__lexicalUnmanaged===!0}function rr(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==St[e]}function ji(n){const e=Pa in n.prototype?n.prototype[Pa]():void 0,t=(function(o){if(!(o===St||o.prototype instanceof St)){let a="<unknown>",l="<unknown>";try{a=o.getType()}catch{}try{qn.version&&(l=JSON.parse(qn.version))}catch{}I(290,o.name,a,l)}return o===Io||o===et||o===St})(n),r=!t&&rr(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,a]of Object.entries(e))s=o,i=a;if(!t&&s&&(rr(n,"getType")||(n.getType=()=>s),rr(n,"clone")||(n.clone=o=>(Mo(o),new n)),rr(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!rr(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Cd(n){const e=Bi();return Pe(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const qe=(n,e)=>{let t=n;for(;t!=null&&!Fe(t);){if(e(t))return t;t=t.getParent()}return null},Up={next:"previous",previous:"next"};class Ho{origin;constructor(e){this.origin=e}[Symbol.iterator](){return wd({hasNext:Jn,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ke(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ke(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){const u=l.origin.getWritable();a.set(u.getKey(),u)}for(const l of i){if(a.size>0){const u=s.getNodeAtCaret();if(u){if(a.delete(u.getKey()),a.delete(l.getKey()),!(u.is(l)||s.origin.is(l))){const c=l.getParent();c&&c.is(o)&&l.remove(),u.replace(l)}}else u===null&&I(263,Array.from(a).join(" "))}else s.insert(l);s=ke(l,this.direction)}for(const l of a.values())l.remove();return this}}class Sr extends Ho{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:it(e,this.direction)}getParentCaret(e="root"){return ke(Jo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Tn(this.direction);return ke(this.getNodeAtCaret(),e)||it(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Sr&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Kp={root:Fe,shadowRoot:je};function Tn(n){return Up[n]}function Jo(n,e="root"){return Kp[e](n)?null:n}class _n extends Ho{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ke(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return N(this.origin)?it(this.origin,this.direction):null}getParentCaret(e="root"){return ke(Jo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Tn(this.direction);return ke(this.getNodeAtCaret(),e)||it(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof _n&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof _n||e instanceof vn)&&this.direction===e.direction&&this.origin.is(e.origin)}}class vn extends Ho{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:xn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ke(Jo(this.getParentAtCaret(),e),this.direction)}getFlipped(){return xn(this.origin,Tn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof vn&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof _n||e instanceof vn)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ke(this.origin,this.direction)}}function wt(n){return n instanceof vn}function Jn(n){return n instanceof _n}function rt(n){return n instanceof Sr}const Wp={next:class extends vn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends vn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Vp={next:class extends _n{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends _n{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},qp={next:class extends Sr{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Sr{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function ke(n,e){return n?new Vp[e](n):null}function xn(n,e,t){return n?new Wp[e](n,Tt(n,t)):null}function Tt(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&lu(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function _l(n,e){return new Jp(n,e)}function it(n,e){return N(n)?new qp[e](n):null}function Hp(n){return n&&n.getChildCaret()||n}function zi(n){return n&&Hp(n.getAdjacentCaret())}class Go{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Go(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return wt(s)?(function(o,a){const{direction:l,origin:u}=o,c=Tt(u,a==="focus"?Tn(l):l);return _l(o,c-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[_l(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=wt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=wt(r),s=o=>o.isSameNodeCaret(r)?null:zi(o)||o.getParentCaret(e);return wd({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Jp{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),s=e.getTextContent();return xn(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function Zo(n){return Gt(n,ke(Se(),n.direction))}function Ed(n){return Gt(n,n)}function Gt(n,e){return n.direction!==e.direction&&I(265),new Go(n,e,n.direction)}function wd(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function Td(n,e){const t=ei(n.origin,e.origin);switch(t===null&&I(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return kd(t)}}function kd(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function Wr(n,e){return e.is(n)}function vl(n){return N(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function ei(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=vl(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=vl(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?(Wr(n,r)||I(276),{commonAncestor:r,type:"ancestor"}):i===null?(Wr(e,r)||I(277),{commonAncestor:r,type:"descendant"}):((N(s)||Wr(n,s))&&(N(i)||Wr(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||I(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function At(n,e){const{type:t,key:r,offset:i}=n,s=Lp(n.key);return t==="text"?($(s)||I(266,s.getType(),r),xn(s,e,i)):(N(s)||I(267,s.getType(),r),Zp(s,n.offset,e))}function bn(n,e){const{origin:t,direction:r}=e,i=r==="next";wt(e)?n.set(t.getKey(),e.offset,"text"):Jn(e)?$(t)?n.set(t.getKey(),Tt(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(rt(e)&&N(t)||I(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function Nd(n){const e=M(),t=P(e)?e:Ii();return ti(t,n),Me(t),t}function ti(n,e){bn(n.anchor,e.anchor),bn(n.focus,e.focus)}function xl(n){const{anchor:e,focus:t}=n,r=At(e,"next"),i=At(t,"next"),s=Td(r,i)<=0?"next":"previous";return Gt(Bt(r,s),Bt(i,s))}function Pr(n){const{direction:e,origin:t}=n,r=ke(t,Tn(e)).getNodeAtCaret();return r?ke(r,e):it(t.getParentOrThrow(),e)}function bl(n,e="root"){const t=[n];for(let r=rt(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Pr(r));return t}function cs(n){return!!n&&n.origin.isAttached()}function Gp(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=Fd(n,r),o=bl(s.anchor,t),a=bl(s.focus.getFlipped(),t),l=new Set,u=[];for(const g of s.iterNodeCarets(t))if(rt(g))l.add(g.origin.getKey());else if(Jn(g)){const{origin:m}=g;N(m)&&!l.has(m.getKey())||u.push(m)}for(const g of u)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:m}=g.caret,y=m.getTextContentSize(),x=Pr(ke(m,r)),p=m.getMode();if(Math.abs(g.distance)===y&&i==="removeEmptySlices"||p==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){i="removeEmptySlices";let _=g.removeTextSlice();const S=g.caret.origin;if(p==="segmented"){const C=_.origin,v=be(C.getTextContent()).setStyle(C.getStyle()).setFormat(C.getFormat());x.replaceOrInsert(v),_=xn(v,r,_.offset)}S.is(o[0].origin)&&(o[0]=_),S.is(a[0].origin)&&(a[0]=_.getFlipped())}}let c,f;for(const g of o)if(cs(g)){c=Qe(g);break}for(const g of a)if(cs(g)){f=Qe(g);break}const d=(function(g,m,y){if(!g||!m)return null;const x=g.getParentAtCaret(),p=m.getParentAtCaret();if(!x||!p)return null;const _=x.getParents().reverse();_.push(x);const S=p.getParents().reverse();S.push(p);const C=Math.min(_.length,S.length);let v;for(v=0;v<C&&_[v]===S[v];v++);const b=(k,F)=>{let L;for(let R=v;R<k.length;R++){const O=k[R];if(je(O))return;!L&&F(O)&&(L=O)}return L},w=b(_,Kt),E=w&&b(S,k=>y.has(k.getKey())&&Kt(k));return w&&E?[w,E]:null})(c,f,l);if(d){const[g,m]=d;it(g,"previous").splice(0,m.getChildren()),m.remove()}const h=[c,f,...o,...a].find(cs);if(h)return Ed(Bt(Qe(h),n.direction));I(269,JSON.stringify(o.map(g=>g.origin.__key)))}function Qe(n){const e=(function(i){let s=i;for(;rt(s);){const o=zi(s);if(!rt(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if($(e.origin))return wt(e)?e:xn(e.origin,t,t);const r=e.getAdjacentCaret();return Jn(r)&&$(r.origin)?xn(r.origin,t,Tn(t)):e}function Ad(n){return wt(n)&&n.offset!==Tt(n.origin,n.direction)}function Bt(n,e){return n.direction===e?n:n.getFlipped()}function Fd(n,e){return n.direction===e?n:Gt(Bt(n.focus,e),Bt(n.anchor,e))}function Zp(n,e,t){let r=it(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Bt(r,t)}function Yp(n){const{origin:e,offset:t,direction:r}=n;if(t===Tt(e,r))return n.getSiblingCaret();if(t===Tt(e,Tn(r)))return Pr(n.getSiblingCaret());const[i]=e.splitText(t);return $(i)||I(281),Bt(ke(i,"next"),r)}function Xp(n,e){return!0}function Qp(n,{$copyElementNode:e=Mp,$splitTextPointCaretNext:t=Yp,rootMode:r="shadowRoot",$shouldSplit:i=Xp}={}){if(wt(n))return t(n);const s=n.getParentCaret(r);if(s){const{origin:o}=s;if(rt(n)&&(!o.canBeEmpty()||!i(o,"first")))return Pr(s);const a=(function(l){const u=[];for(let c=l.getAdjacentCaret();c;c=c.getAdjacentCaret())u.push(c.origin);return u})(n);(a.length>0||o.canBeEmpty()&&i(o,"last"))&&s.insert(e(o).splice(0,0,a))}return s}function em(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}const Pd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,tm=Pd?A.useLayoutEffect:A.useEffect,Vr={tag:Kn};function nm({initialConfig:n,children:e}){const t=A.useMemo(()=>{const{theme:r,namespace:i,nodes:s,onError:o,editorState:a,html:l}=n,u=vh(null,r),c=ld({editable:n.editable,html:l,namespace:i,nodes:s,onError:f=>o(f,c),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=Se();if(h.isEmpty()){const g=xe();h.append(g);const m=Pd?document.activeElement:null;(M()!==null||m!==null&&m===f.getRootElement())&&g.select()}},Vr);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Vr);break}case"object":f.setEditorState(d,Vr);break;case"function":f.update(()=>{Se().isEmpty()&&d(f)},Vr)}}})(c,a),[c,u]},[]);return tm(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),T.jsx(au.Provider,{value:t,children:e})}const rm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function im(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function sm(){return(function(n){const[e]=Ue(),t=A.useMemo(()=>n(e),[e,n]),[r,i]=A.useState(()=>t.initialValueFn()),s=A.useRef(r);return rm(()=>{const{initialValueFn:o,subscribe:a}=t,l=o();return s.current!==l&&(s.current=l,i(l)),a(u=>{s.current=u,i(u)})},[t,n]),r})(im)}const Qs=new Map;function Od(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,s]=r.split(/:([^]+)/);i&&s&&(e[i.trim()]=s.trim())}return e}function Sl(n){let e=Qs.get(n);return e===void 0&&(e=Od(n),Qs.set(n,e)),e}function Id(n){const e=Bi().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function Rd(n){return Id(Fe(n)?n:n.getParentOrThrow())}function Cl(n){const e=Rd(n);return e!==null&&e.direction==="rtl"}function $d(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!$t(e)&&r!==null){const[i,s]=r,o=n.isBackward(),a=i.getNode(),l=s.getNode(),u=e.is(a),c=e.is(l);if(u||c){const[f,d]=qs(n),h=a.is(l),g=e.is(o?l:a),m=e.is(o?a:l);let y,x=0;h?(x=f>d?d:f,y=f>d?f:d):g?(x=o?d:f,y=void 0):m&&(x=0,y=o?f:d);const p=e.__text.slice(x,y);p!==e.__text&&(t==="clone"&&(e=jp(e)),e.__text=p)}}return e}function om(n){const e=n.getStyle(),t=Od(e);Qs.set(e,t)}function Md(n){const e=Ld(n);return e!==null&&e.writingMode==="vertical-rl"}function Ld(n){const e=n.anchor.getNode();return N(e)?Id(e):Rd(e)}function El(n,e){let t=Md(n)?!e:e;Dd(n)&&(t=!t);const r=At(n.focus,t?"previous":"next");if(Ad(r))return!1;for(const i of Zo(r)){if(rt(i))return!i.origin.isInline();if(!N(i.origin)){if(ae(i.origin))return!0;break}}return!1}function am(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Dd(n){const e=Ld(n);return e!==null&&e.direction==="rtl"}function wl(n,e,t){const r=Dd(n);let i;i=Md(n)||r?!t:t,am(n,e,i,"character")}function Bd(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ui=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lm=Ui&&"documentMode"in document?document.documentMode:null,cm=Ui&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Ui||!("InputEvent"in window)||lm)&&"getTargetRanges"in new window.InputEvent("input");function jd(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function st(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const um=Ui,dm=cm;function gt(n,...e){const t=jd(...e);t.length>0&&n.classList.add(...t)}function Ki(n,...e){const t=jd(...e);t.length>0&&n.classList.remove(...t)}function fm(n){return n?n.getAdjacentCaret():null}function gm(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function eo(n){const e=qe(n,t=>N(t)&&!t.isInline());return N(e)||Bd(4,n.__key),e}function hm(n){const e=M()||En();let t;if(P(e))t=At(e.focus,"next");else{if(e!=null){const o=e.getNodes(),a=o[o.length-1];a&&(t=ke(a,"next"))}t=t||it(Se(),"previous").getFlipped().insert(xe())}const r=pm(n,t),i=zi(r),s=rt(i)?Qe(i):r;return Nd(Ed(s)),n.getLatest()}function pm(n,e,t){let r=Bt(e,"next");for(let i=r;i;i=Qp(i,t))r=i;return wt(r)&&Bd(283),r.insert(n.isInline()?xe().append(n):n),Bt(ke(n.getLatest(),"next"),e.direction)}function qt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function mm(n,e){const t=[];for(let r=0;r<n.length;r++){const i=e(n[r]);i!==null&&t.push(i)}return t}let us=!(dm||!um)&&void 0;function ym(n){let e=1;if((function(){if(us===void 0){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const r=t.getBoundingClientRect();t.style.setProperty("zoom","2"),us=t.getBoundingClientRect().width===r.width,document.body.removeChild(t)}return us})())for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}const _m=Symbol.for("preact-signals");function Yo(){if(Vn>1)return void Vn--;let n,e=!1;for(;pr!==void 0;){let t=pr;for(pr=void 0,to++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&zd(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(to=0,Vn--,e)throw n}let de,pr;function Tl(n){const e=de;de=void 0;try{return n()}finally{de=e}}let Vn=0,to=0,ni=0;function kl(n){if(de===void 0)return;let e=n.n;return e===void 0||e.t!==de?(e={i:0,S:n,p:de.s,n:void 0,t:de,e:void 0,x:void 0,r:e},de.s!==void 0&&(de.s.n=e),de.s=e,n.n=e,32&de.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=de.s,e.n=void 0,de.s.n=e,de.s=e),e):void 0}function Ke(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function vm(n,e){return new Ke(n,e)}function zd(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Nl(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Ud(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Pn(n,e){Ke.call(this,void 0),this.x=n,this.s=void 0,this.g=ni-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Kd(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Vn++;const t=de;de=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Xo(n),r}finally{de=t,Yo()}}}function Xo(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Kd(n)}function xm(n){if(de!==this)throw new Error("Out-of-order effect");Ud(this),de=n,this.f&=-2,8&this.f&&Xo(this),Yo()}function Ln(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function no(n,e){const t=new Ln(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Wd(n,e={}){const t={};for(const r in n){const i=e[r],s=vm(i===void 0?n[r]:i);t[r]=s}return t}Ke.prototype.brand=_m,Ke.prototype.h=function(){return!0},Ke.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:Tl(()=>{var t;(t=this.W)==null||t.call(this)}))},Ke.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&Tl(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Ke.prototype.subscribe=function(n){return no(()=>{const e=this.value,t=de;de=void 0;try{n(e)}finally{de=t}},{name:"sub"})},Ke.prototype.valueOf=function(){return this.value},Ke.prototype.toString=function(){return this.value+""},Ke.prototype.toJSON=function(){return this.value},Ke.prototype.peek=function(){const n=de;de=void 0;try{return this.value}finally{de=n}},Object.defineProperty(Ke.prototype,"value",{get(){const n=kl(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(to>100)throw new Error("Cycle detected");this.v=n,this.i++,ni++,Vn++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Yo()}}}}),Pn.prototype=new Ke,Pn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ni))return!0;if(this.g=ni,this.f|=1,this.i>0&&!zd(this))return this.f&=-2,!0;const n=de;try{Nl(this),de=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return de=n,Ud(this),this.f&=-2,!0},Pn.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Ke.prototype.S.call(this,n)},Pn.prototype.U=function(n){if(this.t!==void 0&&(Ke.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Pn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Pn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=kl(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Ln.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Ln.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Kd(this),Nl(this),Vn++;const n=de;return de=this,xm.bind(this,n)},Ln.prototype.N=function(){2&this.f||(this.f|=2,this.o=pr,pr=this)},Ln.prototype.d=function(){this.f|=8,1&this.f||Xo(this)},Ln.prototype.dispose=function(){this.d()};function bm(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function _e(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Vd(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=Vd(t[i],r[i]);return n}return e}const Qo=0,ro=1,qd=2,ds=3,qr=4,On=5,fs=6,ir=7;function gs(n){return n.id===Qo}function Hd(n){return n.id===qd}function Sm(n){return(function(e){return e.id===ro})(n)||_e(305,String(n.id),String(ro)),Object.assign(n,{id:qd})}const Cm=new Set;let Em=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Qo}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):em;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Hd(t)||_e(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,u){return Object.assign(a,{config:l,id:ds,registerState:u})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(a,l,u){return Object.assign(a,{id:qr,initResult:l,registerState:u})})(s,o,i)}build(e){const t=this.state;let r;t.id!==qr&&_e(307,String(t.id),String(On)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,a){return Object.assign(s,{id:On,output:o,registerState:a})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==On&&_e(308,String(r.id),String(On));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:fs})})(r),()=>{const s=this.state;s.id!==ir&&_e(309,String(r.id),String(ir)),this.state=(function(o){return Object.assign(o,{id:On})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==fs&&_e(310,String(t.id),String(fs)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:ir})})(t),r}getSignal(){return this._signal===void 0&&_e(311),this._signal}getInitResult(){this.extension.init===void 0&&_e(312,this.extension.name);const e=this.state;return(function(t){return t.id>=qr})(e)||_e(313,String(e.id),String(qr)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=ds})(e)||_e(314,String(e.id),String(ds)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&_e(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&_e(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=ir})(e)||_e(316,String(e.id),String(ir)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Cm}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=On})(e)||_e(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const Al={tag:Kn};function wm(){const n=Se();n.isEmpty()&&n.append(xe())}const Tm={config:{setOptions:Al,updateOptions:Al},init:({$initialEditorState:n=wm})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(Tp(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[er,Ft,Yn,Xn,tr]},Fl=Symbol.for("@lexical/extension/LexicalBuilder");function Pl(){}function km(n){throw n}function Hr(n){return Array.isArray(n)?n:[n]}const hs="0.39.0+prod.esm";let Nm=class ri{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=hs,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Hr(Tm)];for(const r of e)t.push(Hr(r));return new ri(t)}static maybeFromEditor(e){const t=e[Fl];return t&&(t.PACKAGE_VERSION!==hs&&_e(292,t.PACKAGE_VERSION,hs),t instanceof ri||_e(293)),t}static fromEditor(e){const t=ri.maybeFromEditor(e);return t===void 0&&_e(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(ld({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[Fl]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Pl;function t(){try{e()}finally{e=Pl}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=st(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&_e(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&_e(296);const t=Hr(e),[r]=t;typeof r.name!="string"&&_e(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&_e(298,r.name),!i){i=new Em(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&_e(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&_e(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const a=Hr(o);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[o,a]of r.peerDependencies||[])this.addEdge(r.name,o,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(Hd(s))return;const o=r.extension.name;var a;gs(s)||_e(300,o,i||"[unknown]"),gs(a=s)||_e(304,String(a.id),String(Qo)),s=Object.assign(a,{id:ro}),r.state=s;const l=this.outgoingConfigEdges.get(o);if(l)for(const u of l.keys()){const c=this.extensionNameMap.get(u);c&&t(c,o)}s=Sm(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())gs(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const a of s)o.configs.add(a)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&_e(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const a=o.register(e,s);a&&i.push(a)}for(const o of t){const a=o.afterRegistration(e);a&&i.push(a)}return st(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},a=this.sortedExtensionReps();for(const c of a){const{extension:f}=c;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of bm(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&_e(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,c)}t.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())i.set(d,h);f.html.import&&Object.assign(s,f.html.import)}f.theme&&Vd(o,f.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const l=Object.keys(s).length>0,u=i.size>0;(l||u)&&(e.html={},l&&(e.html.import=s),u&&(e.html.export=i));for(const c of a)c.init(e);return e.onError||(e.onError=km),e}};const Am=q("INSERT_HORIZONTAL_RULE_COMMAND");class Or extends Io{static getType(){return"horizontalrule"}static clone(e){return new Or(e.__key)}static importJSON(e){return Jd().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Fm,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return gt(t,e.theme.hr),t}getTextContent(){return`
|
|
12
|
+
`}isInline(){return!1}updateDOM(){return!1}}function Fm(){return{node:Jd()}}function Jd(){return Cd(Or)}function Pm(n){return n instanceof Or}function Om(n,e){return st(n.registerCommand(ko,t=>{const r=M();if(!P(r))return!1;t.preventDefault();const i=(function(s){const o=s.getNodes();if(mm(o,d=>pi(d)&&d.canIndent()?d:null).length>0)return!0;const a=s.anchor,l=s.focus,u=l.isBefore(a)?l:a,c=u.getNode(),f=eo(c);if(f.canIndent()){const d=f.getKey();let h=Ii();if(h.anchor.set(d,0,"element"),h.focus.set(d,0,"element"),h=hn(h),h.anchor.is(u))return!0}return!1})(r)?t.shiftKey?Ls:Ms:$u;return n.dispatchCommand(i,void 0)},ne),n.registerCommand(Ms,()=>{const t=typeof e=="number"?e:e?e.peek():null;if(t==null)return!1;const r=M();if(!P(r))return!1;const i=r.getNodes().map(s=>eo(s).getIndent());return Math.max(...i)+1>=t},od))}const Im={name:"@lexical/react/ReactProvider"};function Rm(){return Se().getTextContent()}function $m(n,e=!0){if(n)return!1;let t=Rm();return e&&(t=t.trim()),t===""}function Mm(n){if(!$m(n,!1))return!1;const e=Se().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(ae(i))return!1;if(N(i)){if(!Nr(i)||i.__indent!==0)return!1;const s=i.getChildren(),o=s.length;for(let a=0;a<o;a++){const l=s[r];if(!$(l))return!1}}}return!0}function Gd(n){return()=>Mm(n)}function Lm(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const s=r.data;if(typeof s=="string"){let o;try{o=JSON.parse(s)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const a=o.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[u,c,f,d,h]=l;n.update(()=>{const g=M();if(P(g)){const m=g.anchor;let y=m.getNode(),x=0,p=0;if($(y)&&u>=0&&c>=0&&(x=u,p=u+c,g.setTextNodeRange(y,x,y,p)),x===p&&f===""||(g.insertRawText(f),y=m.getNode()),$(y)){x=d,p=d+h;const _=y.getTextContentSize();x=x>_?_:x,p=p>_?_:p,g.setTextNodeRange(y,x,y,p)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Dm(n,e){const t=dd(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!Yd.has(s.nodeName)){const o=Xd(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof $o&&o.insertAfter(ft());for(const o of s){const a=o.getChildren();for(const l of a)o.insertBefore(l);o.remove()}})(i),r}function Bm(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Se().getChildren();for(let i=0;i<r.length;i++)Zd(n,r[i],t,e);return t.innerHTML}function Zd(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=N(e)&&e.excludeFromCopy("html");let o=e;r!==null&&$(e)&&(o=$d(r,e,"clone"));const a=N(o)?o.getChildren():[],l=Lo(n,o.getType());let u;u=l&&l.exportDOM!==void 0?l.exportDOM(n,o):o.exportDOM(n);const{element:c,after:f}=u;if(!c)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],m=Zd(n,g,d,r);!i&&N(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((Ce(c)||Ys(c))&&c.append(d),t.append(c),f){const h=f.call(o,c);h&&(Ys(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(d);return i}const Yd=new Set(["STYLE","SCRIPT"]);function Xd(n,e,t,r,i=new Map,s){let o=[];if(Yd.has(n.nodeName))return o;let a=null;const l=(function(g,m){const{nodeName:y}=g,x=m._htmlConversions.get(y.toLowerCase());let p=null;if(x!==void 0)for(const _ of x){const S=_(g);S!==null&&(p===null||(p.priority||0)<=(S.priority||0))&&(p=S)}return p!==null?p.conversion:null})(n,e),u=l?l(n):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,m]of i)if(a=m(a,s),!a)break;a&&o.push(...Array.isArray(g)?g:[a])}u.forChild!=null&&i.set(n.nodeName,u.forChild)}const f=n.childNodes;let d=[];const h=(a==null||!je(a))&&(a!=null&&pi(a)||r);for(let g=0;g<f.length;g++)d.push(...Xd(f[g],e,t,h,new Map(i),a));return c!=null&&(d=c(d)),xi(n)&&(d=jm(n,d,h?()=>{const g=new $o;return t.push(g),g}:xe)),a==null?d.length>0?o=o.concat(d):xi(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Xs(g.nextSibling)&&Xs(g.previousSibling)})(n)&&(o=o.concat(ft())):N(a)&&a.append(...d),o}function jm(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const a=e[o];if(pi(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(s.push(a),o===e.length-1||o<e.length-1&&pi(e[o+1])){const l=t();l.setFormat(r),l.append(...s),i.push(l),s=[]}}return i}function bi(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function zm(n,e=M()){return e==null&&bi(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?"":Bm(n,e)}function Um(n,e=M()){return e==null&&bi(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Km(n,e))}function Ol(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return Il(t,Wm(a.nodes),e)}catch(a){console.error(a)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:u=>u}).createHTML(l):l})(i),"text/html");return Il(t,Dm(t,a),e)}catch(a){console.error(a)}const o=s||n.getData("text/uri-list");if(o!=null)if(P(e)){const a=o.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const u=M();if(P(u)){const c=a[l];c===`
|
|
13
|
+
`||c===`\r
|
|
14
|
+
`?u.insertParagraph():c===" "?u.insertNodes([Qn()]):u.insertText(c)}}}else e.insertRawText(o)}function Il(n,e,t){n.dispatchCommand(Jh,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(P(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=At(i,"previous");if(o)if(wt(o))s=o.origin;else{const a=Gt(o,it(Se(),"next").getFlipped());for(const l of a){if($(l.origin)){s=l.origin;break}if(N(l.origin)&&!l.origin.isInline())break}}if(s&&$(s)){const a=s.getFormat(),l=s.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(t))}function Qd(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=N(t)&&t.excludeFromCopy("html");let o=t;e!==null&&$(o)&&(o=$d(e,o,"clone"));const a=N(o)?o.getChildren():[],l=(function(u){const c=u.exportJSON(),f=u.constructor;if(c.type!==f.getType()&&bi(58,f.name),N(u)){const d=c.children;Array.isArray(d)||bi(59,f.name)}return c})(o);$(o)&&o.getTextContentSize()===0&&(i=!1);for(let u=0;u<a.length;u++){const c=a[u],f=Qd(n,e,c,l.children);!i&&N(t)&&f&&t.extractWithChild(c,e,"clone")&&(i=!0)}if(i&&!s)r.push(l);else if(Array.isArray(l.children))for(let u=0;u<l.children.length;u++){const c=l.children[u];r.push(c)}return i}function Km(n,e){const t=[],r=Se().getChildren();for(let i=0;i<r.length;i++)Qd(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Wm(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=wp(r);$(i)&&om(i),e.push(i)}return e}let In=null;async function Rl(n,e,t){if(In!==null)return!1;if(e!==null)return new Promise((u,c)=>{n.update(()=>{u($l(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=pt(i);if(r===null||o===null)return!1;const a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),o.removeAllRanges(),o.addRange(l),new Promise((u,c)=>{const f=n.registerCommand(Fi,d=>(qt(d,ClipboardEvent)&&(f(),In!==null&&(i.clearTimeout(In),In=null),u($l(n,d,t))),!0),od);In=i.setTimeout(()=>{f(),In=null,u(!1)},50),s.execCommand("copy"),a.remove()})}function $l(n,e,t){if(t===void 0){const i=pt(n._window),s=M();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,a=i.focusNode;if(o!==null&&a!==null&&!Ar(n,o,a))return!1;t=Vm(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(qm(r,t),!0)}const ef=[["text/html",zm],["application/x-lexical-editor",Um]];function Vm(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Bi();for(const[r,i]of ef){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function qm(n,e){for(const[t]of ef)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ml(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const kn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Hm=kn&&"documentMode"in document?document.documentMode:null,Jm=kn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Gm=!(!kn||!("InputEvent"in window)||Hm)&&"getTargetRanges"in new window.InputEvent("input"),Zm=kn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ll=kn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ym=kn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Xm=kn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Jm&&!Ym,Dl=q("DRAG_DROP_PASTE_FILE");let Wi=class tf extends et{static getType(){return"quote"}static clone(e){return new tf(e.__key)}createDOM(e){const t=document.createElement("blockquote");return gt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Qm,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return ea().updateFromJSON(e)}insertNewAfter(e,t){const r=xe(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=xe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function ea(){return at(new Wi)}function io(n){return n instanceof Wi}let Vi=class nf extends et{__tag;static getType(){return"heading"}static clone(e){return new nf(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];gt(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Rn,priority:0}),h2:e=>({conversion:Rn,priority:0}),h3:e=>({conversion:Rn,priority:0}),h4:e=>({conversion:Rn,priority:0}),h5:e=>({conversion:Rn,priority:0}),h6:e=>({conversion:Rn,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Bl(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Bl(e)?{conversion:t=>({node:Bn("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Bn(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?xe():Bn(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const a=xe();a.select(),this.replace(a,!0)}return s}collapseAtStart(){const e=this.isEmpty()?xe():Bn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Bl(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Rn(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Bn(e),n.style!==null&&(qo(n,t),t.setFormat(n.style.textAlign))),{node:t}}function Qm(n){const e=ea();return n.style!==null&&(e.setFormat(n.style.textAlign),qo(n,e)),{node:e}}function Bn(n="h1"){return at(new Vi(n))}function ey(n){return n instanceof Vi}function Jr(n){let e=null;if(qt(n,DragEvent)?e=n.dataTransfer:qt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function jl(n){const e=M();if(!P(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const s=r[i],o=s.getKey();if(t.has(o))continue;const a=qe(s,u=>N(u)&&!u.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function zl(n){const e=Nt(n);return ae(e)}function ps(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function ty(n){return st(n.registerCommand(bo,e=>{const t=M();return!!Ne(t)&&(t.clear(),!0)},ne),n.registerCommand(ln,e=>{const t=M();return P(t)?(t.deleteCharacter(e),!0):!!Ne(t)&&(t.deleteNodes(),!0)},ne),n.registerCommand(vr,e=>{const t=M();return!!P(t)&&(t.deleteWord(e),!0)},ne),n.registerCommand(xr,e=>{const t=M();return!!P(t)&&(t.deleteLine(e),!0)},ne),n.registerCommand(zn,e=>{const t=M();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ol(r,t,n);else if(P(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},ne),n.registerCommand($s,()=>{const e=M();return!!P(e)&&(e.removeText(),!0)},ne),n.registerCommand(Wt,e=>{const t=M();return!!P(t)&&(t.formatText(e),!0)},ne),n.registerCommand(Yh,e=>{const t=M();if(!P(t)&&!Ne(t))return!1;const r=t.getNodes();for(const i of r){const s=qe(i,o=>N(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},ne),n.registerCommand(jn,e=>{const t=M();return!!P(t)&&(t.insertLineBreak(e),!0)},ne),n.registerCommand(_r,()=>{const e=M();return!!P(e)&&(e.insertParagraph(),!0)},ne),n.registerCommand($u,()=>(Sp([Qn()]),!0),ne),n.registerCommand(Ms,()=>jl(e=>{const t=e.getIndent();e.setIndent(t+1)}),ne),n.registerCommand(Ls,()=>jl(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),ne),n.registerCommand(Co,e=>{const t=M();if(Ne(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(P(t)){const r=Js(t.focus,!0);if(!e.shiftKey&&ae(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},ne),n.registerCommand(Eo,e=>{const t=M();if(Ne(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(P(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===Se().getChildrenSize()})(t))return e.preventDefault(),!0;const r=Js(t.focus,!1);if(!e.shiftKey&&ae(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},ne),n.registerCommand(So,e=>{const t=M();if(Ne(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),Cl(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!P(t))return!1;if(El(t,!0)){const r=e.shiftKey;return e.preventDefault(),wl(t,r,!0),!0}return!1},ne),n.registerCommand(Ou,e=>{const t=M();if(Ne(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),Cl(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!P(t))return!1;const r=e.shiftKey;return!!El(t,!1)&&(e.preventDefault(),wl(t,r,!1),!0)},ne),n.registerCommand(Iu,e=>{if(zl(e.target))return!1;const t=M();if(P(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(Fe(s))return!1;const o=eo(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Ls,void 0);if(Ll&&navigator.language==="ko-KR")return!1}else if(!Ne(t))return!1;return e.preventDefault(),n.dispatchCommand(ln,!0)},ne),n.registerCommand(Ru,e=>{if(zl(e.target))return!1;const t=M();return!(!P(t)&&!Ne(t))&&(e.preventDefault(),n.dispatchCommand(ln,!1))},ne),n.registerCommand(di,e=>{const t=M();if(!P(t))return!1;if(ps(t),e!==null){if((Ll||Zm||Xm)&&Gm)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(jn,!1)}return n.dispatchCommand(_r,void 0)},ne),n.registerCommand(To,()=>{const e=M();return!!P(e)&&(n.blur(),!0)},ne),n.registerCommand(Mu,e=>{const[,t]=Jr(e);if(t.length>0){const i=Ml(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,a=Nt(o);if(a!==null){const l=Ii();if($(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"text");else{const c=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(c,f,"element"),l.focus.set(c,f,"element")}const u=hn(l);Me(u)}n.dispatchCommand(Dl,t)}return e.preventDefault(),!0}const r=M();return!!P(r)},ne),n.registerCommand(Lu,e=>{const[t]=Jr(e),r=M();return!(t&&!P(r))},ne),n.registerCommand(Du,e=>{const[t]=Jr(e),r=M();if(t&&!P(r))return!1;const i=Ml(e.clientX,e.clientY);if(i!==null){const s=Nt(i.node);ae(s)&&e.preventDefault()}return!0},ne),n.registerCommand(Ds,()=>(Op(),!0),ne),n.registerCommand(Fi,e=>(Rl(n,qt(e,ClipboardEvent)?e:null),!0),ne),n.registerCommand(No,e=>((async function(t,r){await Rl(r,qt(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();P(i)?i.removeText():Ne(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),ne),n.registerCommand(Ai,e=>{const[,t,r]=Jr(e);return t.length>0&&!r?(n.dispatchCommand(Dl,t),!0):wn(e.target)&&Do(e.target)?!1:M()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=M(),a=qt(i,InputEvent)||qt(i,KeyboardEvent)?null:i.clipboardData;a!=null&&o!==null&&Ol(a,o,s)},{tag:cp})})(e,n),!0)},ne),n.registerCommand(wo,e=>{const t=M();return P(t)&&ps(t),!1},ne),n.registerCommand(ko,e=>{const t=M();return P(t)&&ps(t),!1},ne))}function ny(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ta=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function ry({editor:n,ErrorBoundary:e}){return(function(t,r){const[i,s]=A.useState(()=>t.getDecorators());return ta(()=>t.registerDecoratorListener(o=>{ga.flushSync(()=>{s(o)})}),[t]),A.useEffect(()=>{s(t.getDecorators())},[t]),A.useMemo(()=>{const o=[],a=Object.keys(i);for(let l=0;l<a.length;l++){const u=a[l],c=T.jsx(r,{onError:d=>t._onError(d),children:T.jsx(A.Suspense,{fallback:null,children:i[u]})}),f=t.getElementByKey(u);f!==null&&o.push(ga.createPortal(c,f,u))}return o},[r,i,t])})(n,e)}function iy({editor:n,ErrorBoundary:e}){return(function(t){const r=Nm.maybeFromEditor(t);if(r&&r.hasExtensionByName(Im.name)){for(const i of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(i)&&ny(320,i);return!0}return!1})(n)?null:T.jsx(ry,{editor:n,ErrorBoundary:e})}function Ul(n){return n.getEditorState().read(Gd(n.isComposing()))}function sy({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Ue();return(function(i){ta(()=>st(ty(i),Lm(i)),[i])})(r),T.jsxs(T.Fragment,{children:[n,T.jsx(oy,{content:e}),T.jsx(iy,{editor:r,ErrorBoundary:t})]})}function oy({content:n}){const[e]=Ue(),t=(function(i){const[s,o]=A.useState(()=>Ul(i));return ta(()=>{function a(){const l=Ul(i);o(l)}return a(),st(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),s})(e),r=sm();return t?typeof n=="function"?n(r):n:null}const rf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function ay({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:s,ariaExpanded:o,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:m,role:y="textbox",spellCheck:x=!0,style:p,tabIndex:_,"data-testid":S,...C},v){const[b,w]=A.useState(n.isEditable()),E=A.useCallback(F=>{F&&F.ownerDocument&&F.ownerDocument.defaultView?n.setRootElement(F):n.setRootElement(null)},[n]),k=A.useMemo(()=>(function(...F){return L=>{for(const R of F)typeof R=="function"?R(L):R!=null&&(R.current=L)}})(v,E),[E,v]);return rf(()=>(w(n.isEditable()),n.registerEditableListener(F=>{w(F)})),[n]),T.jsx("div",{"aria-activedescendant":b?e:void 0,"aria-autocomplete":b?t:"none","aria-controls":b?r:void 0,"aria-describedby":i,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":b&&y==="combobox"?!!o:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":u,"aria-multiline":c,"aria-owns":b?f:void 0,"aria-readonly":!b||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:b,"data-testid":S,id:m,ref:k,role:y,spellCheck:x,style:p,tabIndex:_,...C})}const ly=A.forwardRef(ay);function Kl(n){return n.getEditorState().read(Gd(n.isComposing()))}const cy=A.forwardRef(uy);function uy(n,e){const{placeholder:t,...r}=n,[i]=Ue();return T.jsxs(T.Fragment,{children:[T.jsx(ly,{editor:i,...r,ref:e}),t!=null&&T.jsx(dy,{editor:i,content:t})]})}function dy({content:n,editor:e}){const t=(function(o){const[a,l]=A.useState(()=>Kl(o));return rf(()=>{function u(){const c=Kl(o);l(c)}return u(),st(o.registerUpdateListener(()=>{u()}),o.registerEditableListener(()=>{u()}))},[o]),a})(e),[r,i]=A.useState(e.isEditable());if(A.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(o=>{i(o)})),[e]),!t)return null;let s=null;return typeof n=="function"?s=n(r):n!==null&&(s=n),s===null?null:T.jsx("div",{"aria-hidden":!0,children:s})}const fy=A.createContext(null),ms={didCatch:!1,error:null};class gy extends A.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ms}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:s,reason:"imperative-api"}),this.setState(ms)}}componentDidCatch(e,t){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&t.error!==null&&hy(e.resetKeys,i)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(ms)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:o}=this.state;let a=e;if(s){const l={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=A.createElement(r,l);else if(i!==void 0)a=i;else throw o}return A.createElement(fy.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},a)}}function hy(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return n.length!==e.length||n.some((t,r)=>!Object.is(t,e[r]))}function py({children:n,onError:e}){return T.jsx(gy,{fallback:T.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}function Ht(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function so(n){let e=1,t=n.getParent();for(;t!=null;){if(ee(t)){const r=t.getParent();if(H(r)){e++,t=r.getParent();continue}Ht(40)}return e}return e}function oo(n){let e=n.getParent();H(e)||Ht(40);let t=e;for(;t!==null;)t=t.getParent(),H(t)&&(e=t);return e}function sf(n){let e=[];const t=n.getChildren().filter(ee);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();H(s)?e=e.concat(sf(s)):e.push(i)}return e}function xt(n){return ee(n)&&H(n.getFirstChild())}function Wl(n){return tt().append(n)}function of(n,e){return ee(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function ao(n){const e=M();if(e!==null){let t=e.getNodes();if(P(e)){const i=e.getStartEndPoints();i===null&&Ht(143);const[s]=i,o=s.getNode(),a=o.getParent();if(je(o)){const l=o.getFirstChild();if(l)t=l.selectStart().getNodes();else{const u=xe();o.append(u),t=u.select().getNodes()}}else if(of(o,t)){const l=Ge(n);if(je(a)){o.replace(l);const u=tt();N(o)&&(u.setFormat(o.getFormatType()),u.setIndent(o.getIndent())),l.append(u)}else if(ee(o)){const u=o.getParentOrThrow();Sn(l,u.getChildren()),u.replace(l)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(N(s)&&s.isEmpty()&&!ee(s)&&!r.has(s.getKey())){Vl(s,n);continue}let o=fd(s)?s.getParent():ee(s)&&s.isEmpty()?s:null;for(;o!=null;){const a=o.getKey();if(H(o)){if(!r.has(a)){const l=Ge(n);Sn(l,o.getChildren()),o.replace(l),r.add(a)}break}{const l=o.getParent();if(je(l)&&!r.has(a)){r.add(a),Vl(o,n);break}o=l}}}}}function Sn(n,e){n.splice(n.getChildrenSize(),0,e)}function Vl(n,e){if(H(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=tt();let s;if(Sn(i,n.getChildren()),H(t)&&e===t.getListType())t.append(i),H(r)&&e===r.getListType()&&(Sn(t,r.getChildren()),r.remove()),s=t;else if(H(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const o=Ge(e);o.append(i),n.replace(o),s=o}return i.setFormat(n.getFormatType()),i.setIndent(n.getIndent()),n.remove(),s}function na(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&xt(t)&&xt(r)&&(na(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function my(){const n=M();if(P(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(of(r,t))e.add(oo(r));else for(let i=0;i<t.length;i++){const s=t[i];if(fd(s)){const o=gm(s,Yt);o!=null&&e.add(oo(o))}}for(const i of e){let s=i;const o=sf(i);for(const a of o){const l=xe().setTextStyle(n.style).setTextFormat(n.format);Sn(l,a.getChildren()),s.insertAfter(l),s=l,a.__key===n.anchor.key&&bn(n.anchor,Qe(it(l,"next"))),a.__key===n.focus.key&&bn(n.focus,Qe(it(l,"next"))),a.remove()}i.remove()}}}function af(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())ee(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),H(r.getFirstChild())||t++)}function yy(n){const e=new Set;if(xt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(xt(r)&&xt(i)){const s=i.getFirstChild();if(H(s)){s.append(n);const o=r.getFirstChild();H(o)&&(Sn(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(xt(r)){const s=r.getFirstChild();if(H(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(xt(i)){const s=i.getFirstChild();H(s)&&s.append(n)}else if(H(t)){const s=tt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=Ge(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function _y(n){if(xt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(H(t?t.getParent():void 0)&&ee(t)&&H(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=tt(),a=Ge(s);o.append(a),n.getPreviousSiblings().forEach(c=>a.append(c));const l=tt(),u=Ge(s);l.append(u),Sn(u,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(l),t.replace(n)}}}function vy(){const n=M();if(!P(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!ee(e)||e.getChildrenSize()!==0)return!1;const t=oo(e),r=e.getParent();H(r)||Ht(40);const i=r.getParent();let s;if(je(i))s=xe(),t.insertAfter(s);else{if(!ee(i))return!1;s=tt(),i.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const o=e.getNextSiblings();if(o.length>0){const a=Ge(r.getListType());if(ee(s)){const l=tt();l.append(a),s.insertAfter(l)}else s.insertAfter(a);a.append(...o)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!ee(u)&&!H(u))break;l=u}l.remove()})(e),!0}function Si(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}let Yt=class extends et{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();H(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:et,importDOM:{li:()=>({conversion:xy,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,a,l){const u=a.getParent();!H(u)||u.getListType()!=="check"||H(a.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||o.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,a,l){const u=[],c=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&u.push(...Si(d)),f){const g=l.getParent(),m=H(g)&&g.getListType()==="check",y=l.getChecked();m&&!y||c.push(f.listitemUnchecked),m&&y||c.push(f.listitemChecked),m&&u.push(y?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Si(h);l.getChildren().some(m=>H(m))?u.push(...g):c.push(...g)}c.length>0&&Ki(o,...c),u.length>0&>(o,...u)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,a,l){const u=Sl(a.__textStyle);for(const c in u)o.style.setProperty(`--listitem-marker-${c}`,u[c]);if(l)for(const c in Sl(l.__textStyle))c in u||o.style.removeProperty(`--listitem-marker-${c}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(N(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(ee(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!H(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=Ge(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(N(e)||Ht(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(H(r)||Ht(39),ee(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=Ge(r.getListType());i.forEach(o=>s.append(o)),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&xt(t)&&xt(r)&&(na(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=tt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=xe();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=ee(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,a=e.focus,l=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(l,o.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return H(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;ee(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Ht(117),(e=Math.floor(e))>=0||Ht(199);let t=this.getIndent();for(;t!==e;)t<e?(yy(this),t++):(_y(this),t--);return this}canInsertAfter(e){return ee(e)}canReplaceWith(e){return ee(e)}canMergeWith(e){return ee(e)||Nr(e)}extractWithChild(e,t){if(!P(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ge("bullet")}canMergeWhenEmpty(){return!0}};function xy(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return ql(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return ql(t.children[0])}const e=n.getAttribute("aria-checked");return{node:tt(e==="true"||e!=="false"&&void 0)}}function ql(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:tt(n.hasAttribute("checked"))}}function tt(n){return at(new Yt(void 0,n))}function ee(n){return n instanceof Yt}let Nn=class extends et{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();H(r)&&t.getListType()===r.getListType()&&na(t,r)})(e),af(e)},extends:et,importDOM:{ol:()=>({conversion:Jl,priority:0}),ul:()=>({conversion:Jl,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=Sy[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Hl(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Hl(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ce(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let s=0;s<r.length;s++){const o=r[s];ee(o)||(i===r&&(i=[...r]),i[s]=tt().append(!N(o)||H(o)||o.isInline()?o:be(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return ee(e)}};function Hl(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],a=so(t)-1,l=a%o.length,u=o[l],c=s[t.__tag];let f;const d=s.nested,h=s.checklist;if(d!==void 0&&d.list&&(f=d.list),c!==void 0&&r.push(c),h!==void 0&&t.__listType==="check"&&r.push(h),u!==void 0){r.push(...Si(u));for(let g=0;g<o.length;g++)g!==l&&i.push(t.__tag+g)}if(f!==void 0){const g=Si(f);a>1?r.push(...g):i.push(...g)}}i.length>0&&Ki(n,...i),r.length>0&>(n,...r)}function by(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(ee(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{H(s)&&e.push(Wl(s))})}else e.push(Wl(r))}return e}function Jl(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=Ge("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(Ce(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?Ge("check"):Ge("bullet")),{after:by,node:t}}const Sy={ol:"number",ul:"bullet"};function Ge(n="number",e=1){return at(new Nn(n,e))}function H(n){return n instanceof Nn}const Cy=q("INSERT_CHECK_LIST_COMMAND");function Ey(n){return st(n.registerCommand(Cy,()=>(ao("check"),!0),Ve),n.registerCommand(Eo,e=>Yl(e,n,!1),Ve),n.registerCommand(Co,e=>Yl(e,n,!0),Ve),n.registerCommand(To,()=>{if(lo()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},Ve),n.registerCommand(wo,e=>{const t=lo();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=Nt(t);ee(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},Ve),n.registerCommand(So,e=>n.getEditorState().read(()=>{const t=M();if(P(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=qe(s,a=>N(a)&&!a.isInline());if(ee(o)){const a=o.getParent();if(H(a)&&a.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const l=n.getElementByKey(o.__key);if(l!=null&&document.activeElement!==l)return l.focus(),e.preventDefault(),!0}}}}return!1}),Ve),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",Gl),e.addEventListener("pointerdown",Zl)),t!==null&&(t.removeEventListener("click",Gl),t.removeEventListener("pointerdown",Zl))}))}function lf(n,e){const t=n.target;if(!Ce(t))return;const r=t.firstChild;if(Ce(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=ym(t),a=n.clientX/o,l=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},u=parseFloat(l.width),c=n.pointerType==="touch"?32:0;(t.dir==="rtl"?a<s.right+c&&a>s.right-u-c:a>s.left-c&&a<s.left+u+c)&&e()}function Gl(n){lf(n,()=>{if(Ce(n.target)){const e=n.target,t=$i(e);t!=null&&t.isEditable()&&t.update(()=>{const r=Nt(e);ee(r)&&(e.focus(),r.toggleChecked())})}})}function Zl(n){lf(n,()=>{n.preventDefault()})}function lo(){const n=document.activeElement;return Ce(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Yl(n,e,t){const r=lo();return r!=null&&e.update(()=>{const i=Nt(r);if(!ee(i))return;const s=(function(o,a){let l=a?o.getPreviousSibling():o.getNextSibling(),u=o;for(;l==null&&ee(u);)u=u.getParentOrThrow().getParent(),u!=null&&(l=a?u.getPreviousSibling():u.getNextSibling());for(;ee(l);){const c=a?l.getLastChild():l.getFirstChild();if(!H(c))return l;l=a?c.getLastChild():c.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const wy=q("UPDATE_LIST_START_COMMAND"),Ty=q("INSERT_UNORDERED_LIST_COMMAND"),ky=q("INSERT_ORDERED_LIST_COMMAND"),Ny=q("REMOVE_LIST_COMMAND");function Ay(n){return st(n.registerCommand(ky,()=>(ao("number"),!0),Ve),n.registerCommand(wy,e=>{const{listNodeKey:t,newStart:r}=e,i=Te(t);return!!H(i)&&(i.getListType()==="number"&&(i.setStart(r),af(i)),!0)},Ve),n.registerCommand(Ty,()=>(ao("bullet"),!0),Ve),n.registerCommand(Ny,()=>(my(),!0),Ve),n.registerCommand(_r,()=>vy(),Ve),n.registerNodeTransform(Yt,e=>{const t=e.getFirstChild();if(t){if($(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=M();P(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Ft,e=>{const t=e.getParent();if(ee(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function Fy(n){const e=t=>{const r=t.getParent();if(H(t.getFirstChild())||!H(r))return;const i=qe(t,s=>ee(s)&&H(s.getParent())&&ee(s.getPreviousSibling()));if(i===null&&t.getIndent()>0)t.setIndent(0);else if(ee(i)){const s=i.getPreviousSibling();if(ee(s)){const o=(function(l){let u=l,c=u.getFirstChild();for(;H(c);){const f=c.getLastChild();if(!ee(f))break;u=f,c=u.getFirstChild()}return u})(s),a=o.getParent();if(H(a)){const l=so(a);l+1<so(r)&&t.setIndent(l)}}}};return n.registerNodeTransform(Nn,t=>{const r=[t];for(;r.length>0;){const i=r.shift();if(H(i)){for(const s of i.getChildren())if(ee(s)){e(s);const o=s.getFirstChild();H(o)&&r.push(o)}}}})}var ys={exports:{}},Xl;function Py(){return Xl||(Xl=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function p(_){return _ instanceof l?new l(_.type,p(_.content),_.alias):Array.isArray(_)?_.map(p):_.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++s}),p.__id},clone:function p(_,S){S=S||{};var C,v;switch(a.util.type(_)){case"Object":if(v=a.util.objId(_),S[v])return S[v];C={},S[v]=C;for(var b in _)_.hasOwnProperty(b)&&(C[b]=p(_[b],S));return C;case"Array":return v=a.util.objId(_),S[v]?S[v]:(C=[],S[v]=C,_.forEach(function(w,E){C[E]=p(w,S)}),C);default:return _}},getLanguage:function(p){for(;p;){var _=i.exec(p.className);if(_)return _[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,_){p.className=p.className.replace(RegExp(i,"gi"),""),p.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(C){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(p){var _=document.getElementsByTagName("script");for(var S in _)if(_[S].src==p)return _[S]}return null}},isActive:function(p,_,S){for(var C="no-"+_;p;){var v=p.classList;if(v.contains(_))return!0;if(v.contains(C))return!1;p=p.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,_){var S=a.util.clone(a.languages[p]);for(var C in _)S[C]=_[C];return S},insertBefore:function(p,_,S,C){C=C||a.languages;var v=C[p],b={};for(var w in v)if(v.hasOwnProperty(w)){if(w==_)for(var E in S)S.hasOwnProperty(E)&&(b[E]=S[E]);S.hasOwnProperty(w)||(b[w]=v[w])}var k=C[p];return C[p]=b,a.languages.DFS(a.languages,function(F,L){L===k&&F!=p&&(this[F]=b)}),b},DFS:function p(_,S,C,v){v=v||{};var b=a.util.objId;for(var w in _)if(_.hasOwnProperty(w)){S.call(_,w,_[w],C||w);var E=_[w],k=a.util.type(E);k==="Object"&&!v[b(E)]?(v[b(E)]=!0,p(E,S,null,v)):k==="Array"&&!v[b(E)]&&(v[b(E)]=!0,p(E,S,w,v))}}},plugins:{},highlightAll:function(p,_){a.highlightAllUnder(document,p,_)},highlightAllUnder:function(p,_,S){var C={callback:S,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),a.hooks.run("before-all-elements-highlight",C);for(var v=0,b;b=C.elements[v++];)a.highlightElement(b,_===!0,C.callback)},highlightElement:function(p,_,S){var C=a.util.getLanguage(p),v=a.languages[C];a.util.setLanguage(p,C);var b=p.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(b,C);var w=p.textContent,E={element:p,language:C,grammar:v,code:w};function k(L){E.highlightedCode=L,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),S&&S.call(E.element)}if(a.hooks.run("before-sanity-check",E),b=E.element.parentElement,b&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),S&&S.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){k(a.util.encode(E.code));return}if(_&&r.Worker){var F=new Worker(a.filename);F.onmessage=function(L){k(L.data)},F.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else k(a.highlight(E.code,E.grammar,E.language))},highlight:function(p,_,S){var C={code:p,grammar:_,language:S};if(a.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=a.tokenize(C.code,C.grammar),a.hooks.run("after-tokenize",C),l.stringify(a.util.encode(C.tokens),C.language)},tokenize:function(p,_){var S=_.rest;if(S){for(var C in S)_[C]=S[C];delete _.rest}var v=new f;return d(v,v.head,p),c(p,v,_,v.head,0),g(v)},hooks:{all:{},add:function(p,_){var S=a.hooks.all;S[p]=S[p]||[],S[p].push(_)},run:function(p,_){var S=a.hooks.all[p];if(!(!S||!S.length))for(var C=0,v;v=S[C++];)v(_)}},Token:l};r.Prism=a;function l(p,_,S,C){this.type=p,this.content=_,this.alias=S,this.length=(C||"").length|0}l.stringify=function p(_,S){if(typeof _=="string")return _;if(Array.isArray(_)){var C="";return _.forEach(function(k){C+=p(k,S)}),C}var v={type:_.type,content:p(_.content,S),tag:"span",classes:["token",_.type],attributes:{},language:S},b=_.alias;b&&(Array.isArray(b)?Array.prototype.push.apply(v.classes,b):v.classes.push(b)),a.hooks.run("wrap",v);var w="";for(var E in v.attributes)w+=" "+E+'="'+(v.attributes[E]||"").replace(/"/g,""")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+w+">"+v.content+"</"+v.tag+">"};function u(p,_,S,C){p.lastIndex=_;var v=p.exec(S);if(v&&C&&v[1]){var b=v[1].length;v.index+=b,v[0]=v[0].slice(b)}return v}function c(p,_,S,C,v,b){for(var w in S)if(!(!S.hasOwnProperty(w)||!S[w])){var E=S[w];E=Array.isArray(E)?E:[E];for(var k=0;k<E.length;++k){if(b&&b.cause==w+","+k)return;var F=E[k],L=F.inside,R=!!F.lookbehind,O=!!F.greedy,B=F.alias;if(O&&!F.pattern.global){var K=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,K+"g")}for(var D=F.pattern||F,U=C.next,j=v;U!==_.tail&&!(b&&j>=b.reach);j+=U.value.length,U=U.next){var X=U.value;if(_.length>p.length)return;if(!(X instanceof l)){var te=1,J;if(O){if(J=u(D,j,p,R),!J||J.index>=p.length)break;var Z=J.index,le=J.index+J[0].length,V=j;for(V+=U.value.length;Z>=V;)U=U.next,V+=U.value.length;if(V-=U.value.length,j=V,U.value instanceof l)continue;for(var re=U;re!==_.tail&&(V<le||typeof re.value=="string");re=re.next)te++,V+=re.value.length;te--,X=p.slice(j,V),J.index-=j}else if(J=u(D,0,X,R),!J)continue;var Z=J.index,ce=J[0],G=X.slice(0,Z),Q=X.slice(Z+ce.length),ve=j+X.length;b&&ve>b.reach&&(b.reach=ve);var Y=U.prev;G&&(Y=d(_,Y,G),j+=G.length),h(_,Y,te);var ue=new l(w,L?a.tokenize(ce,L):ce,B,ce);if(U=d(_,Y,ue),Q&&d(_,U,Q),te>1){var he={cause:w+","+k,reach:ve};c(p,_,S,U.prev,j,he),b&&he.reach>b.reach&&(b.reach=he.reach)}}}}}}function f(){var p={value:null,prev:null,next:null},_={value:null,prev:p,next:null};p.next=_,this.head=p,this.tail=_,this.length=0}function d(p,_,S){var C=_.next,v={value:S,prev:_,next:C};return _.next=v,C.prev=v,p.length++,v}function h(p,_,S){for(var C=_.next,v=0;v<S&&C!==p.tail;v++)C=C.next;_.next=C,C.prev=_,p.length-=v}function g(p){for(var _=[],S=p.head.next;S!==p.tail;)_.push(S.value),S=S.next;return _}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(p){var _=JSON.parse(p.data),S=_.language,C=_.code,v=_.immediateClose;r.postMessage(a.highlight(C,a.languages[S],S)),v&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function y(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",y):window.requestAnimationFrame?window.requestAnimationFrame(y):window.setTimeout(y,16)}return a})(e);n.exports&&(n.exports=t),typeof ha<"u"&&(ha.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,s){var o={};o["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};a["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var l={};l[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(m,y){return"✖ Error "+m+" while fetching file: "+y},s="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",u="loaded",c="failed",f="pre[data-src]:not(["+a+'="'+u+'"]):not(['+a+'="'+l+'"])';function d(m,y,x){var p=new XMLHttpRequest;p.open("GET",m,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?y(p.responseText):p.status>=400?x(i(p.status,p.statusText)):x(s))},p.send(null)}function h(m){var y=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(y){var x=Number(y[1]),p=y[2],_=y[3];return p?_?[x,Number(_)]:[x,void 0]:[x,x]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var y=m.element;if(y.matches(f)){m.code="",y.setAttribute(a,l);var x=y.appendChild(document.createElement("CODE"));x.textContent=r;var p=y.getAttribute("data-src"),_=m.language;if(_==="none"){var S=(/\.(\w+)$/.exec(p)||[,"none"])[1];_=o[S]||S}t.util.setLanguage(x,_),t.util.setLanguage(y,_);var C=t.plugins.autoloader;C&&C.loadLanguages(_),d(p,function(v){y.setAttribute(a,u);var b=h(y.getAttribute("data-range"));if(b){var w=v.split(/\r\n?|\n/g),E=b[0],k=b[1]==null?w.length:b[1];E<0&&(E+=w.length),E=Math.max(0,Math.min(E-1,w.length)),k<0&&(k+=w.length),k=Math.max(0,Math.min(k,w.length)),v=w.slice(E,k).join(`
|
|
15
|
+
`),y.hasAttribute("data-start")||y.setAttribute("data-start",String(E+1))}x.textContent=v,t.highlightElement(x)},function(v){y.setAttribute(a,c),x.textContent=v})}}),t.plugins.fileHighlight={highlight:function(y){for(var x=(y||document).querySelectorAll(f),p=0,_;_=x[p++];)t.highlightElement(_)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(ys)),ys.exports}Py();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(c){return c=c.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(n.languages.markdown[c].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var m=d[h];if(m.type!=="code"){f(m.content);continue}var y=m.content[1],x=m.content[3];if(y&&x&&y.type==="code-language"&&x.type==="code-block"&&typeof y.content=="string"){var p=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase();var _="language-"+p;x.alias?typeof x.alias=="string"?x.alias=[x.alias,_]:x.alias.push(_):x.alias=[_]}}}f(c.tokens)}),n.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",d=0,h=c.classes.length;d<h;d++){var g=c.classes[d],m=/language-(.+)/.exec(g);if(m){f=m[1];break}}var y=n.languages[f];if(y)c.content=n.highlight(u(c.content),y,f);else if(f&&f!=="none"&&n.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);c.attributes.id=x,n.plugins.autoloader.loadLanguages(f,function(){var p=document.getElementById(x);p&&(p.innerHTML=n.highlight(p.textContent,n.languages[f],f))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function u(c){var f=c.replace(o,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var m=a[h];return m||d}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var Ql={},ec;function Oy(){return ec||(ec=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Ql}Oy();var tc={},nc;function Iy(){return nc||(nc=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),tc}Iy();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var rc={},ic;function Ry(){return ic||(ic=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),rc}Ry();var sc={},oc;function $y(){return oc||(oc=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),sc}$y();var ac={},lc;function My(){return lc||(lc=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),ac}My();function cf(n,e){for(const t of n.childNodes){if(Ce(t)&&t.tagName===e)return!0;cf(t,e)}return!1}const cr="data-language",sr="data-highlight-language",Gr="data-theme";let qi=class uf extends et{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new uf(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");gt(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(cr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sr,r));const i=this.getTheme();i&&t.setAttribute(Gr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute(cr,i):s&&t.removeAttribute(cr);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute(sr,i):t.removeAttribute(sr):o&&i&&t.setAttribute(sr,i);const a=this.__theme,l=e.__theme;a?a!==l&&t.setAttribute(Gr,a):l&&t.removeAttribute(Gr);const u=this.__style,c=e.__style;return u?u!==c&&t.setAttribute("style",u):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");gt(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(cr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sr,r));const i=this.getTheme();i&&t.setAttribute(Gr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||cf(e,"BR"))?{conversion:cc,priority:1}:null,div:()=>({conversion:Ly,priority:1}),pre:()=>({conversion:cc,priority:0}),table:e=>_s(e)?{conversion:Dy,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&_s(r)?{conversion:uc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&_s(t)?{conversion:uc,priority:3}:null}}}static importJSON(e){return Dt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
16
|
+
`&&r[i-2].getTextContent()===`
|
|
17
|
+
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const l=xe();return this.insertAfter(l,t),l}const{anchor:s,focus:o}=e,a=(s.isBefore(o)?s:o).getNode();if($(a)){let l=jy(a);const u=[];for(;;)if(Pi(l))u.push(Qn()),l=l.getNextSibling();else{if(!gf(l))break;{let y=0;const x=l.getTextContent(),p=l.getTextContentSize();for(;y<p&&x[y]===" ";)y++;if(y!==0&&u.push(ff(" ".repeat(y))),y!==p)break;l=l.getNextSibling()}}const c=a.splitText(s.offset)[0],f=s.offset===0?0:1,d=c.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[ft(),...u];h.splice(d,0,g);const m=u[u.length-1];m?m.select():s.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(ra(a)){const{offset:l}=e.anchor;a.splice(l,0,[ft()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const e=xe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function Dt(n,e){return Cd(qi).setLanguage(n).setTheme(e)}function ra(n){return n instanceof qi}function cc(n){return{node:Dt(n.getAttribute(cr))}}function Ly(n){const e=n,t=dc(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(dc(i))return!0;i=i.parentElement}return!1})(e)?{node:t?Dt():null}:{node:null}}function Dy(){return{node:Dt()}}function uc(){return{node:null}}function dc(n){return n.style.fontFamily.match("monospace")!==null}function _s(n){return n.classList.contains("js-file-line-container")}let ia=class df extends Ft{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new df(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=vs(e.theme,this.__highlightType);return gt(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=vs(r.theme,e.__highlightType),o=vs(r.theme,this.__highlightType);return s!==o&&(s&&Ki(t,s),o&>(t,o)),i}static importJSON(e){return ff().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Dt()}};function vs(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function ff(n="",e){return at(new ia(n,e))}function gf(n){return n instanceof ia}function By(n,e){let t=n;for(let r=ke(n,e);r&&(gf(r.origin)||Pi(r.origin));r=fm(r))t=r.origin;return t}function jy(n){return By(n,"previous")}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
18
|
+
?|
|
|
19
|
+
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const zy=new Set(["http:","https:","mailto:","sms:","tel:"]);class Xt extends et{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Xt(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),gt(t,e.theme.link),t}updateLinkDOM(e,t,r){if(Vo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Uy,priority:1})}}static importJSON(e){return dn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=gc(e);try{const t=new URL(gc(e));if(!zy.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=dn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!P(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Uy(n){let e=null;if(Vo(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=dn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function dn(n="",e){return at(new Xt(n,e))}function vt(n){return n instanceof Xt}class nr extends Xt{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new nr(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return co().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(N(r)){const i=co(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function co(n="",e){return at(new nr(n,e))}function bt(n){return n instanceof nr}const uo=q("TOGGLE_LINK_COMMAND");function fc(n,e){if(n.type==="element"){const t=n.getNode();return N(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of i)o.append("v",a);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function xs(n,e={}){let t;if(n&&typeof n=="object"){const{url:c,...f}=n;t=c,e={...f,...e}}else t=n;const{target:r,title:i}=e,s=e.rel===void 0?"noreferrer":e.rel,o=M();if(o===null||!P(o)&&!Ne(o))return;if(Ne(o)){const c=o.getNodes();return c.length===0?void 0:void c.forEach(f=>{if(t===null){const d=qe(f,h=>!bt(h)&&vt(h));d&&(d.insertBefore(f),d.getChildren().length===0&&d.remove())}else{const d=qe(f,h=>!bt(h)&&vt(h));if(d)d.setURL(t),r!==void 0&&d.setTarget(r),s!==void 0&&d.setRel(s);else{const h=dn(t,{rel:s,target:r});f.insertBefore(h),h.append(f)}}})}const a=o.extract();if(t===null){const c=new Set;return void a.forEach(f=>{const d=f.getParent();if(vt(d)&&!bt(d)){const h=d.getKey();if(c.has(h))return;(function(g,m){const y=new Set(m.filter(b=>g.isParentOf(b)).map(b=>b.getKey())),x=g.getChildren(),p=x.filter(b=>y.has(b.getKey()));if(p.length===x.length)return x.forEach(b=>g.insertBefore(b)),void g.remove();const _=x.findIndex(b=>y.has(b.getKey())),S=x.findLastIndex(b=>y.has(b.getKey())),C=_===0,v=S===x.length-1;if(C)p.forEach(b=>g.insertBefore(b));else if(v)for(let b=p.length-1;b>=0;b--)g.insertAfter(p[b]);else{for(let w=p.length-1;w>=0;w--)g.insertAfter(p[w]);const b=x.slice(S+1);if(b.length>0){const w=dn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});p[p.length-1].insertAfter(w),b.forEach(E=>w.append(E))}}})(d,a),c.add(h)}})}const l=new Set,u=c=>{l.has(c.getKey())||(l.add(c.getKey()),c.setURL(t),r!==void 0&&c.setTarget(r),s!==void 0&&c.setRel(s),i!==void 0&&c.setTitle(i))};if(a.length===1){const c=a[0],f=qe(c,vt);if(f!==null)return u(f)}(function(c){const f=M();if(!P(f))return c();const d=hn(f),h=d.isBackward(),g=fc(d.anchor,h?-1:0),m=fc(d.focus,h?0:-1);if(c(),g||m){const y=M();if(P(y)){const x=y.clone();if(g){const p=g.getParent();p&&x.anchor.set(p.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(m){const p=m.getParent();p&&x.focus.set(p.getKey(),m.getIndexWithinParent()+(h?0:1),"element")}Me(hn(x))}}})(()=>{let c=null;for(const f of a){if(!f.isAttached())continue;const d=qe(f,vt);if(d){u(d);continue}if(N(f)){if(!f.isInline())continue;if(vt(f)){if(!(bt(f)||c!==null&&c.getParentOrThrow().isParentOf(f))){u(f),c=f;continue}for(const g of f.getChildren())f.insertBefore(g);f.remove();continue}}const h=f.getPreviousSibling();vt(h)&&h.is(c)?h.append(f):(c=dn(t,{rel:s,target:r,title:i}),f.insertAfter(c),c.append(f))}})}const Ky=/^\+?[0-9\s()-]{5,}$/;function gc(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Ky.test(n)?`tel:${n}`:`https://${n}`}function Wy(n,e){return st(no(()=>n.registerCommand(uo,t=>{const r=e.validateUrl.peek(),i=e.attributes.peek();if(t===null)return xs(null),!0;if(typeof t=="string")return!(r!==void 0&&!r(t))&&(xs(t,i),!0);{const{url:s,target:o,rel:a,title:l}=t;return xs(s,{...i,rel:a,target:o,title:l}),!0}},Ve)),no(()=>{const t=e.validateUrl.value;if(!t)return;const r=e.attributes.value;return n.registerCommand(Ai,i=>{const s=M();if(!P(s)||s.isCollapsed()||!qt(i,ClipboardEvent)||i.clipboardData===null)return!1;const o=i.clipboardData.getData("text");return!!t(o)&&!s.getNodes().some(a=>N(a))&&(n.dispatchCommand(uo,{...r,url:o}),i.preventDefault(),!0)},Ve)}))}function Vy(n,e,t={}){const r=s=>{const o=s.target;if(!wn(o))return;const a=$i(o);if(a===null)return;let l=null,u=null;if(a.update(()=>{const d=Nt(o);if(d!==null){const h=qe(d,N);if(!e.disabled.peek())if(vt(h))l=h.sanitizeUrl(h.getURL()),u=h.getTarget();else{const g=(function(m,y){let x=m;for(;x!=null;){if(y(x))return x;x=x.parentNode}return null})(o,Vo);g!==null&&(l=g.href,u=g.target)}}}),l===null||l==="")return;const c=n.getEditorState().read(M);if(P(c)&&!c.isCollapsed())return void s.preventDefault();const f=s.type==="auxclick"&&s.button===1;window.open(l,e.newTab.peek()||f||s.metaKey||s.ctrlKey||u==="_blank"?"_blank":"_self"),s.preventDefault()},i=s=>{s.button===1&&r(s)};return n.registerRootListener((s,o)=>{o!==null&&(o.removeEventListener("click",r),o.removeEventListener("mouseup",i)),s!==null&&(s.addEventListener("click",r,t),s.addEventListener("mouseup",i,t))})}function hc(n,e=t=>t){return t=>{const r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function hf(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const qy=/[.,;\s]/;function Ci(n){return qy.test(n)}function pf(n){return Ci(n[n.length-1])}function fo(n){return Ci(n[0])}function mf(n){let e=n.getPreviousSibling();return N(e)&&(e=e.getLastDescendant()),e===null||Ct(e)||$(e)&&pf(e.getTextContent())}function yf(n){let e=n.getNextSibling();return N(e)&&(e=e.getFirstDescendant()),e===null||Ct(e)||$(e)&&fo(e.getTextContent())}function Hy(n,e,t,r){return(n>0?Ci(t[n-1]):mf(r[0]))?e<t.length?Ci(t[e]):yf(r[r.length-1]):!1}function Jy(n,e,t){const r=[],i=[],s=[];let o=0,a=0;const l=[...n];for(;l.length>0;){const u=l[0],c=u.getTextContent().length,f=a;a+c<=e?(r.push(u),o+=c):f>=t?s.push(u):i.push(u),a+=c,l.shift()}return[o,r,i,s]}function Gy(n,e,t,r){const i=co(r.url,r.attributes);if(n.length===1){let s,o=n[0];e===0?[s,o]=o.splitText(t):[,s,o]=o.splitText(e,t);const a=be(r.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),i.append(a),s.replace(i),o}if(n.length>1){const s=n[0];let o,a=s.getTextContent().length;e===0?o=s:[,o]=s.splitText(e);const l=[];let u;for(let h=1;h<n.length;h++){const g=n[h],m=g.getTextContent().length,y=a;if(y<t)if(a+m<=t)l.push(g);else{const[x,p]=g.splitText(t-y);l.push(x),u=p}a+=m}const c=M(),f=c?c.getNodes().find($):void 0,d=be(o.getTextContent());return d.setFormat(o.getFormat()),d.setDetail(o.getDetail()),d.setStyle(o.getStyle()),i.append(d,...l),f&&f===o&&(P(c)?d.select(c.anchor.offset,c.focus.offset):Ne(c)&&d.select(0,d.getTextContent().length)),o.replace(i),u}}function bs(n,e,t){const r=n.getChildren(),i=r.length;for(let l=0;l<i;l++){const u=r[l];if(!$(u)||!u.isSimpleText())return ii(n),void t(null,n.getURL())}const s=n.getTextContent(),o=hf(s,e);if(o===null||o.text!==s||!mf(n)||!yf(n))return ii(n),void t(null,n.getURL());const a=n.getURL();if(a!==o.url&&(n.setURL(o.url),t(o.url,a)),o.attributes){const l=n.getRel();l!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,l));const u=n.getTarget();u!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,u))}}function ii(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}const Zy={changeHandlers:[],matchers:[]};function Yy(n,e=Zy){const{matchers:t,changeHandlers:r}=e,i=(s,o)=>{for(const a of r)a(s,o)};return st(n.registerNodeTransform(Ft,s=>{const o=s.getParentOrThrow(),a=s.getPreviousSibling();if(bt(o)&&!o.getIsUnlinked())bs(o,t,i);else if(!vt(o)){if(s.isSimpleText()&&(fo(s.getTextContent())||!bt(a))){const l=(function(u){const c=[u];let f=u.getNextSibling();for(;f!==null&&$(f)&&f.isSimpleText()&&(c.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return c})(s);(function(u,c,f){let d=[...u];const h=d.map(x=>x.getTextContent()).join("");let g,m=h,y=0;for(;(g=hf(m,c))&&g!==null;){const x=g.index,p=x+g.length;if(Hy(y+x,y+p,h,d)){const[_,,S,C]=Jy(d,y+x,y+p),v=Gy(S,y+x-_,y+p-_,g);d=v?[v,...C]:C,f(g.url,null),y=0}else y+=p;m=m.substring(p)}})(l,t,i)}(function(l,u,c){const f=l.getPreviousSibling(),d=l.getNextSibling(),h=l.getTextContent();var g;!bt(f)||f.getIsUnlinked()||fo(h)&&(g=h,!(f.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(g):/^\.[a-zA-Z0-9]{1,}/.test(g)))||(f.append(l),bs(f,u,c),c(null,f.getURL())),!bt(d)||d.getIsUnlinked()||pf(h)||(ii(d),bs(d,u,c),c(null,d.getURL()))})(s,t,i)}}),n.registerCommand(uo,s=>{const o=M();return s!==null||!P(o)||o.extract().forEach(a=>{const l=a.getParent();bt(l)&&(l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty())}),!1},Ve))}function go(n,e){const t={};for(const r of n){const i=e(r);i&&(t[i]?t[i].push(r):t[i]=[r])}return t}function sa(n){const e=go(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Ei=/[!-/:-@[-`{-~\s]/,Xy=/^\s{0,3}$/;function ho(n){if(!Nr(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&$(e)&&Xy.test(e.getTextContent())}function Qy(n,e,t,r){for(const i of e){if(!i.export)continue;const s=i.export(n,o=>wi(o,t,r));if(s!=null)return s}return N(n)?wi(n,t,r):ae(n)?n.getTextContent():null}function wi(n,e,t,r,i){const s=[],o=n.getChildren();r||(r=[]),i||(i=[]);e:for(const a of o){for(const l of t){if(!l.export)continue;const u=l.export(a,c=>wi(c,e,t,r,[...i,...r]),(c,f)=>pc(c,f,e,r,i));if(u!=null){s.push(u);continue e}}Ct(a)?s.push(`
|
|
20
|
+
`):$(a)?s.push(pc(a,a.getTextContent(),e,r,i)):N(a)?s.push(wi(a,e,t,r,i)):ae(a)&&s.push(a.getTextContent())}return s.join("")}function pc(n,e,t,r,i){let s=n.getFormat()===0?e:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let o="",a="",l="";const u=mc(n,!0),c=mc(n,!1),f=new Set;for(const d of t){const h=d.format[0],g=d.tag;Zr(n,h)&&!f.has(h)&&(f.add(h),Zr(u,h)&&r.find(m=>m.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let d=0;d<r.length;d++){const h=Zr(n,r[d].format),g=Zr(c,r[d].format);if(h&&g)continue;const m=[...r];for(;m.length>d;){const y=m.pop();i&&y&&i.find(x=>x.tag===y.tag)||(y&&typeof y.tag=="string"&&(h?g||(l+=y.tag):a+=y.tag),r.pop())}break}return s=o+s+l,a+s}function mc(n,e){let t=e?n.getPreviousSibling():n.getNextSibling();if(!t){const r=n.getParentOrThrow();r.isInline()&&(t=e?r.getPreviousSibling():r.getNextSibling())}for(;t;){if(N(t)){if(!t.isInline())break;const r=e?t.getLastDescendant():t.getFirstDescendant();if($(r))return r;t=e?t.getPreviousSibling():t.getNextSibling()}if($(t))return t;if(!N(t))return null}return null}function Zr(n,e){return $(n)&&n.hasFormat(e)}function e_(n,e){const t=(function(i,s){const o=i.match(s.openTagsRegExp);if(o==null)return null;for(const a of o){const l=a.replace(/^\s/,""),u=s.fullMatchRegExpByTag[l];if(u==null)continue;const c=i.match(u),f=s.transformersByTag[l];if(c!=null&&f!=null){if(f.intraword!==!1)return c;const{index:d=0}=c,h=i[d-1],g=i[d+c[0].length];if((!h||Ei.test(h))&&(!g||Ei.test(g)))return c}}return null})(n.getTextContent(),e);if(!t)return null;const r=t.index||0;return{endIndex:r+t[0].length,match:t,startIndex:r,transformer:e.transformersByTag[t[1]]}}function sn(n){return $(n)&&!n.hasFormat("code")}function on(n,e,t){let r=e_(n,e),i=(function(o,a){const l=o;let u,c,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const m=g.index||0,y=h.getEndIndex?h.getEndIndex(l,g):m+g[0].length;y!==!1&&(u===void 0||c===void 0||m<u&&(y>c||y<=u))&&(u=m,c=y,f=h,d=g)}return u===void 0||c===void 0||f===void 0||d===void 0?null:{endIndex:c,match:d,startIndex:u,transformer:f}})(n,t);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const o=(function(a,l,u,c,f){const d=a.getTextContent();let h,g,m;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(u):[m,h,g]=a.splitText(l,u),h.setTextContent(f[2]),c)for(const y of c.format)h.hasFormat(y)||h.toggleFormat(y);return{nodeAfter:g,nodeBefore:m,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);sn(o.nodeAfter)&&on(o.nodeAfter,e,t),sn(o.nodeBefore)&&on(o.nodeBefore,e,t),sn(o.transformedNode)&&on(o.transformedNode,e,t)}else if(i){const o=(function(a,l,u,c,f){let d,h,g;return l===0?[d,h]=a.splitText(u):[g,d,h]=a.splitText(l,u),c.replace?{nodeAfter:h,nodeBefore:g,transformedNode:c.replace(d,f)||void 0}:null})(n,i.startIndex,i.endIndex,i.transformer,i.match);if(!o)return;sn(o.nodeAfter)&&on(o.nodeAfter,e,t),sn(o.nodeBefore)&&on(o.nodeBefore,e,t),sn(o.transformedNode)&&on(o.transformedNode,e,t)}const s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,a)=>String.fromCodePoint(a));n.setTextContent(s)}function t_(n,e=!1){const t=sa(n),r=(function(i){const s={},o={},a=[],l="(?<![\\\\])";for(const u of i){const{tag:c}=u;s[c]=u;const f=c.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),c.length===1?o[c]=c==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):o[c]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:s}})(t.textFormat);return(i,s)=>{const o=i.split(`
|
|
21
|
+
`),a=o.length,l=s||Se();l.clear();for(let c=0;c<a;c++){const f=o[c],[d,h]=n_(o,c,t.multilineElement,l);d?c=h:r_(f,l,t.element,r,t.textMatch,e)}const u=l.getChildren();for(const c of u)!e&&ho(c)&&l.getChildrenSize()>1&&c.remove();M()!==null&&l.selectStart()}}function n_(n,e,t,r){for(const i of t){const{handleImportAfterStartMatch:s,regExpEnd:o,regExpStart:a,replace:l}=i,u=n[e].match(a);if(!u)continue;if(s){const g=s({lines:n,rootNode:r,startLineIndex:e,startMatch:u,transformer:i});if(g===null)continue;if(g)return g}const c=typeof o=="object"&&"regExp"in o?o.regExp:o,f=o&&typeof o=="object"&&"optional"in o?o.optional:!o;let d=e;const h=n.length;for(;d<h;){const g=c?n[d].match(c):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&e===d&&g.index===u.index){d++;continue}const m=[];if(g&&e===d)m.push(n[e].slice(u[0].length,-g[0].length));else for(let y=e;y<=d;y++)if(y===e){const x=n[y].slice(u[0].length);m.push(x)}else if(y===d&&g){const x=n[y].slice(0,-g[0].length);m.push(x)}else m.push(n[y]);if(l(r,null,u,g,m,!0)!==!1)return[!0,d];break}}return[!1,e]}function r_(n,e,t,r,i,s){const o=be(n),a=xe();a.append(o),e.append(a);for(const{regExp:l,replace:u}of t){const c=n.match(l);if(c&&(o.setTextContent(n.slice(c[0].length)),u(a,[o],c,!0)!==!1))break}if(on(o,r,i),a.isAttached()&&n.length>0){const l=a.getPreviousSibling();if(!s&&(Nr(l)||io(l)||H(l))){let u=l;if(H(l)){const c=l.getLastDescendant();u=c==null?null:qe(c,ee)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[ft(),...a.getChildren()]),a.remove())}}}function i_(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const _f=/^(\s*)(\d{1,})\.\s/,vf=/^(\s*)[-*+]\s/,s_=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,po=/^(#{1,6})\s/,xf=/^>\s/,bf=/^[ \t]*```([\w-]+)?/,mo=/[ \t]*```$/,o_=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,a_=/^(?:\|)(.+)(?:\|)\s?$/,l_=/^(\| ?:?-*:? ?)+\|\s?$/,yc=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,_c=/^<\/[a-z_][\w-]*\s*>/i,vc=n=>new RegExp(`(?:${n.source})$`,n.flags),ur=zh("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),Sf=n=>(e,t,r,i)=>{const s=n(r);s.append(...t),e.replace(s),i||s.select(0,0)},Cf=n=>(e,t,r,i)=>{const s=e.getPreviousSibling(),o=e.getNextSibling(),a=tt(n==="check"?r[3]==="x":void 0),l=r[0].trim()[0],u=n!=="bullet"&&n!=="check"||l!==ur.parse(l)?void 0:l;if(H(o)&&o.getListType()===n){u&&es(o,ur,u);const f=o.getFirstChild();f!==null?f.insertBefore(a):o.append(a),e.remove()}else if(H(s)&&s.getListType()===n)u&&es(s,ur,u),s.append(a),e.remove();else{const f=Ge(n,n==="number"?Number(r[2]):void 0);u&&es(f,ur,u),f.append(a),e.replace(f)}a.append(...t),i||a.select(0,0);const c=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);c&&a.setIndent(c)},oa=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(ee(o)){if(o.getChildrenSize()===1){const f=o.getFirstChild();if(H(f)){r.push(oa(f,e,t+1));continue}}const a=" ".repeat(4*t),l=n.getListType(),u=mu(n,ur),c=l==="number"?`${n.getStart()+s}. `:l==="check"?`${u} [${o.getChecked()?"x":" "}] `:u+" ";r.push(a+c+e(o)),s++}return r.join(`
|
|
22
|
+
`)},c_={dependencies:[Vi],export:(n,e)=>{if(!ey(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:po,replace:Sf(n=>{const e="h"+n[1].length;return Bn(e)}),type:"element"},u_={dependencies:[Wi],export:(n,e)=>{if(!io(n))return null;const t=e(n).split(`
|
|
23
|
+
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
24
|
+
`)},regExp:xf,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(io(s))return s.splice(s.getChildrenSize(),0,[ft(),...e]),void n.remove()}const i=ea();i.append(...e),n.replace(i),r||i.select(0,0)},type:"element"},d_={dependencies:[qi],export:n=>{if(!ra(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
25
|
+
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:mo},regExpStart:bf,replace:(n,e,t,r,i,s)=>{let o,a;if(!e&&i){if(i.length===1)r?(o=Dt(),a=t[1]+i[0]):(o=Dt(t[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=Dt(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join(`
|
|
26
|
+
`)}const l=be(a);o.append(l),n.append(o)}else e&&Sf(l=>Dt(l?l[1]:void 0))(n,e,t,s)},type:"multiline-element"},f_={dependencies:[Nn,Yt],export:(n,e)=>H(n)?oa(n,e,0):null,regExp:vf,replace:Cf("bullet"),type:"element"},g_={dependencies:[Nn,Yt],export:(n,e)=>H(n)?oa(n,e,0):null,regExp:_f,replace:Cf("number"),type:"element"},h_={format:["code"],tag:"`",type:"text-format"},p_={format:["highlight"],tag:"==",type:"text-format"},m_={format:["bold","italic"],tag:"***",type:"text-format"},y_={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},__={format:["bold"],tag:"**",type:"text-format"},v_={format:["bold"],intraword:!1,tag:"__",type:"text-format"},x_={format:["strikethrough"],tag:"~~",type:"text-format"},b_={format:["italic"],tag:"*",type:"text-format"},S_={format:["italic"],intraword:!1,tag:"_",type:"text-format"},aa={dependencies:[Xt],export:(n,e,t)=>{if(!vt(n)||bt(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=dn(r,{title:i}),o=t.split("[").length-1,a=t.split("]").length-1;let l=t,u="";if(o<a)return;if(o>a){const f=t.split("[");u="["+f[0],l=f.slice(1).join("[")}const c=be(l);return c.setFormat(n.getFormat()),s.append(c),n.replace(s),u&&s.insertBefore(be(u)),c},trigger:")",type:"text-match"},C_=[c_,u_,f_,g_],E_=[d_],w_=[h_,m_,y_,__,v_,p_,b_,S_,x_],T_=[aa],Ir=[...C_,...E_,...w_,...T_];function xc(n,e,t){const r=t.length;for(let i=e;i>=r;i--){const s=i-r;if(Ef(n,s,t,0,r)&&n[s+r]!==" ")return s}return-1}function Ef(n,e,t,r,i){for(let s=0;s<i;s++)if(n[e+s]!==t[r+s])return!1;return!0}function k_(n,e=Ir){const t=sa(e),r=go(t.textFormat,({tag:o})=>o[o.length-1]),i=go(t.textMatch,({trigger:o})=>o);for(const o of e){const a=o.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=o.dependencies;for(const u of l)n.hasNode(u)||i_(173,u.getType())}}const s=(o,a,l)=>{(function(u,c,f,d){const h=u.getParent();if(!je(h)||u.getFirstChild()!==c)return!1;const g=c.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:m,replace:y}of d){const x=g.match(m);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const p=c.getNextSiblings(),[_,S]=c.splitText(f);if(y(u,S?[S,...p]:p,x,!1)!==!1)return _.remove(),!0}}return!1})(o,a,l,t.element)||(function(u,c,f,d){const h=u.getParent();if(!je(h)||u.getFirstChild()!==c)return!1;const g=c.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:m,replace:y,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const p=g.match(m);if(p&&p[0].length===(p[0].endsWith(" ")?f:f-1)){const _=c.getNextSiblings(),[S,C]=c.splitText(f);if(y(u,C?[C,..._]:_,p,null,null,!1)!==!1)return S.remove(),!0}}return!1})(o,a,l,t.multilineElement)||(function(u,c,f){let d=u.getTextContent();const h=f[d[c-1]];if(h==null)return!1;c<d.length&&(d=d.slice(0,c));for(const g of h){if(!g.replace||!g.regExp)continue;const m=d.match(g.regExp);if(m===null)continue;const y=m.index||0,x=y+m[0].length;let p;return y===0?[p]=u.splitText(x):[,p]=u.splitText(y,x),p.selectNext(0,0),g.replace(p,m),!0}return!1})(a,l,i)||(function(u,c,f){const d=u.getTextContent(),h=c-1,g=d[h],m=f[g];if(!m)return!1;for(const y of m){const{tag:x}=y,p=x.length,_=h-p+1;if(p>1&&!Ef(d,_,x,0,p)||d[_-1]===" ")continue;const S=d[h+1];if(y.intraword===!1&&S&&!Ei.test(S))continue;const C=u;let v=C,b=xc(d,_,x),w=v;for(;b<0&&(w=w.getPreviousSibling())&&!Ct(w);)if($(w)){if(w.hasFormat("code"))continue;const D=w.getTextContent();v=w,b=xc(D,D.length,x)}if(b<0||v===C&&b+p===_)continue;const E=v.getTextContent();if(b>0&&E[b-1]===g)continue;const k=E[b-1];if(y.intraword===!1&&k&&!Ei.test(k))continue;const F=C.getTextContent(),L=F.slice(0,_)+F.slice(h+1);C.setTextContent(L);const R=v===C?L:E;v.setTextContent(R.slice(0,b)+R.slice(b+p));const O=M(),B=Ii();Me(B);const K=h-p*(v===C?2:1)+1;B.anchor.set(v.__key,b,"text"),B.focus.set(C.__key,K,"text");for(const D of y.format)B.hasFormat(D)||B.formatText(D);B.anchor.set(B.focus.key,B.focus.offset,B.focus.type);for(const D of y.format)B.hasFormat(D)&&B.toggleFormat(D);return P(O)&&(B.format=O.format),!0}})(a,l,r)};return n.registerUpdateListener(({tags:o,dirtyLeaves:a,editorState:l,prevEditorState:u})=>{if(o.has(Ju)||o.has(lp)||n.isComposing())return;const c=l.read(M),f=u.read(M);if(!P(f)||!P(c)||!c.isCollapsed()||c.is(f))return;const d=c.anchor.key,h=c.anchor.offset,g=l._nodeMap.get(d);!$(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||n.update(()=>{if(!sn(g))return;const m=g.getParent();m===null||ra(m)||s(m,g,c.anchor.offset)})})}function N_(n,e=Ir,t,r=!1,i=!1){const s=r?n:(function(o,a=!1){const l=o.split(`
|
|
27
|
+
`);let u=!1;const c=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=c[c.length-1];o_.test(d)?c.push(d):bf.test(d)||mo.test(d)?(u=!u,c.push(d)):u||d===""||h===""||!h||po.test(h)||po.test(d)||xf.test(d)||_f.test(d)||vf.test(d)||s_.test(d)||a_.test(d)||l_.test(d)||!a||yc.test(d)||_c.test(d)||vc(_c).test(h)||vc(yc).test(h)||mo.test(h)?c.push(d):c[c.length-1]=h+" "+d.trimStart()}return c.join(`
|
|
28
|
+
`)})(n,i);return t_(e,r)(s,t)}function A_(n=Ir,e,t=!1){return(function(i,s=!1){const o=sa(i),a=[...o.multilineElement,...o.element],l=!s,u=o.textFormat.filter(c=>c.format.length===1).sort((c,f)=>Number(c.format.includes("code"))-Number(f.format.includes("code")));return c=>{const f=[],d=(c||Se()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],m=Qy(g,a,u,o.textMatch);m!=null&&f.push(l&&h>0&&!ho(g)&&!ho(d[h-1])?`
|
|
29
|
+
`.concat(m):m)}return f.join(`
|
|
30
|
+
`)}})(n,t)(e)}function bc(n,e){return n.getEditorState().read(()=>{const t=Te(e);return t!==null&&t.isSelected()})}function F_(n){const[e]=Ue(),[t,r]=A.useState(()=>bc(e,n));return A.useEffect(()=>{let i=!0;const s=e.registerUpdateListener(()=>{i&&r(bc(e,n))});return()=>{i=!1,s()}},[e,n]),[t,A.useCallback(i=>{e.update(()=>{let s=M();Ne(s)||(s=Fo(),Me(s)),Ne(s)&&(i?s.add(n):s.delete(n))})},[e,n]),A.useCallback(()=>{e.update(()=>{const i=M();Ne(i)&&i.clear()})},[e])]}function P_({nodeKey:n}){const[e]=Ue(),[t,r,i]=F_(n);return A.useEffect(()=>st(e.registerCommand(bo,s=>{const o=e.getElementByKey(n);return s.target===o&&(s.shiftKey||i(),r(!t),!0)},Ve)),[i,e,t,n,r]),A.useEffect(()=>{const s=e.getElementByKey(n),o=e._config.theme.hrSelected??"selected";s!==null&&(t?gt(s,o):Ki(s,o))},[e,t,n]),null}class Rr extends Or{static getType(){return"horizontalrule"}static clone(e){return new Rr(e.__key)}static importJSON(e){return Hi().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:O_,priority:0})}}decorate(){return T.jsx(P_,{nodeKey:this.__key})}}function O_(){return{node:Hi()}}function Hi(){return at(new Rr)}const I_=[{dependencies:[Rr],export:n=>Pm(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Hi();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...Ir];function R_({transformers:n=I_}){const[e]=Ue();return A.useEffect(()=>k_(e,n),[e,n]),null}function $_({hasStrictIndent:n=!1}){const[e]=Ue();return A.useEffect(()=>{if(!e.hasNodes([Nn,Yt]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),A.useEffect(()=>{if(n)return Fy(e)},[e,n]),(function(t){A.useEffect(()=>Ay(t),[t])})(e),null}var M_="uf0wxx0",L_="uf0wxx1",D_="uf0wxx2";function B_(n,e,t){A.useEffect(()=>{n.hasNodes([nr])||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of i)o.append("v",a);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),A.useEffect(()=>Yy(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function j_({matchers:n,onChange:e}){const[t]=Ue();return B_(t,n,e),null}function z_(){const[n]=Ue();return A.useEffect(()=>Ey(n),[n]),null}function U_({newTab:n=!0,disabled:e=!1}){const[t]=Ue();return A.useEffect(()=>Vy(t,Wd({disabled:e,newTab:n})),[t,n,e]),null}function K_(){const[n]=Ue();return A.useEffect(()=>n.registerCommand(Am,e=>{const t=M();if(!P(t))return!1;if(t.focus.getNode()!==null){const r=Hi();hm(r)}return!0},ne),[n]),null}function W_({validateUrl:n,attributes:e}){const[t]=Ue();return A.useEffect(()=>{if(!t.hasNodes([Xt]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),A.useEffect(()=>Wy(t,Wd({attributes:e,validateUrl:n})),[t,n,e]),null}function V_({maxIndent:n}){const[e]=Ue();return A.useEffect(()=>Om(e,n),[e,n]),null}const q_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function H_({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Ue();return q_(()=>{if(t)return r.registerUpdateListener(({editorState:i,dirtyElements:s,dirtyLeaves:o,prevEditorState:a,tags:l})=>{e&&s.size===0&&o.size===0||n&&l.has(Kn)||a.isEmpty()||t(i,r,l)})},[r,n,e,t]),null}const J_=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function G_(n){return n==="https://"||J_.test(n)}function Z_(n){const e=ze.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let i;e[0]!==r?(i=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==i?(s=T.jsx(W_,{validateUrl:G_,attributes:i}),e[2]=i,e[3]=s):s=e[3],s}const Y_=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),X_=/(([^<>()[\]\\.,;:\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,}))/,Q_=[hc(Y_,n=>n.startsWith("http")?n:`https://${n}`),hc(X_,n=>`mailto:${n}`)];function ev(){const n=ze.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=T.jsx(j_,{matchers:Q_}),n[0]=e):e=n[0],e}const tv={...aa,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},la=Ir.map(n=>n===aa?tv:n),nv={paragraph:"editor-paragraph",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",code:"editor-text-code"},list:{ul:"editor-list-ul",ol:"editor-list-ol",listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"}},quote:"editor-quote",code:"editor-code",codeHighlight:{},link:"editor-link",horizontalRule:"editor-hr"},rv=[Vi,Wi,Nn,Yt,qi,ia,Xt,nr,Rr];function iv(n){const e=ze.c(2),{text:t}=n;let r;return e[0]!==t?(r=T.jsx("div",{className:D_,children:t}),e[0]=t,e[1]=r):r=e[1],r}function sv(n){const e=ze.c(4),{value:t}=n,[r]=Ue();let i;e[0]!==r||e[1]!==t?(i=()=>{t!==void 0&&r.update(()=>{N_(t,la)})},e[0]=r,e[1]=t,e[2]=i):i=e[2];let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[3]=s):s=e[3],A.useEffect(i,s),null}function ov(n){const e=ze.c(4),{onChange:t}=n;let r;e[0]!==t?(r=o=>{t&&o.read(()=>{const a=A_(la);t(a)})},e[0]=t,e[1]=r):r=e[1];const i=r;let s;return e[2]!==i?(s=T.jsx(H_,{onChange:i}),e[2]=i,e[3]=s):s=e[3],s}function av(n){const e=ze.c(20),{placeholder:t,value:r,onChange:i}=n,s=t===void 0?"Write your content here...":t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={namespace:"MarkdownEditor",theme:nv,nodes:rv,onError:lv},e[0]=o):o=e[0];const a=o;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=T.jsx(cy,{className:L_}),e[1]=l):l=e[1];let u;e[2]!==s?(u=T.jsx(sy,{contentEditable:l,placeholder:T.jsx(iv,{text:s}),ErrorBoundary:py}),e[2]=s,e[3]=u):u=e[3];let c,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=T.jsx(R_,{transformers:la}),g=T.jsx($_,{}),m=T.jsx(z_,{}),y=T.jsx(V_,{}),x=T.jsx(U_,{}),c=T.jsx(K_,{}),f=T.jsx(Z_,{}),d=T.jsx(ev,{}),e[4]=c,e[5]=f,e[6]=d,e[7]=h,e[8]=g,e[9]=m,e[10]=y,e[11]=x):(c=e[4],f=e[5],d=e[6],h=e[7],g=e[8],m=e[9],y=e[10],x=e[11]);let p;e[12]!==r?(p=T.jsx(sv,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==i?(_=T.jsx(ov,{onChange:i}),e[14]=i,e[15]=_):_=e[15];let S;return e[16]!==p||e[17]!==_||e[18]!==u?(S=T.jsx("div",{className:M_,children:T.jsxs(nm,{initialConfig:a,children:[u,h,g,m,y,x,c,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=u,e[19]=S):S=e[19],S}function lv(n){console.error("Lexical error:",n)}const cv=n=>{const e=ze.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=T.jsx("title",{children:"Markdown"}),r=T.jsx("path",{fill:"currentColor",d:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z"}),e[0]=t,e[1]=r):(t=e[0],r=e[1]);let i;return e[2]!==n?(i=T.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n,children:[t,r]}),e[2]=n,e[3]=i):i=e[3],i},uv=n=>{const e=ze.c(7),t=!!(n&&n.length>0);let r,i;e[0]!==n?(r=["provider-models",n],i=async()=>{if(!n)return[];const a=await(await _o.v1.providers[":providerId"].models.$get({param:{providerId:n}})).json();return"data"in a&&a.data?a.data:[]},e[0]=n,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let s;return e[3]!==t||e[4]!==r||e[5]!==i?(s={queryKey:r,queryFn:i,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=i,e[6]=s):s=e[6],Xf(s)};var dv="_1nagll30",wf="_1nagll31",Sc="_1nagll32",fv="_1nagll33",gv="_1nagll34",Ss="_1nagll35",Cs="_1nagll36",hv="_1nagll37",pv="_1nagll38",mv="_1nagll39",yv="_1nagll3d",Tf="_1nagll3e",Cc="_1nagll3f",Ec="_1nagll3g",_v="_1nagll3h",vv="_1nagll3i",Es="_1nagll3k",wc="_1nagll3l",xv="_1nagll3o",bv="_1nagll3p",Sv="_1nagll3q",ca="_1nagll3r";const Tc=window.bootstrapData?.llmProviders?.map(n=>({label:n.name,icon:n.imageURI,value:n.key}));function Cv(n){const e=ze.c(2),{className:t}=n;let r;return e[0]!==t?(r=T.jsx(Kc,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function Ev(n,e){const t=n.split("/");return t.length>1&&t[0].length>0?t[0].charAt(0).toUpperCase()+t[0].slice(1):"Other"}function kf(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function yo(n){return`https://models.dev/logos/${n}.svg`}function wv(n){const e=ze.c(47),{models:t,isLoading:r,selectedModelName:i,onSelect:s}=n;let o,a,l,u,c,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==s||e[3]!==i){const w=t?.reduce(Tv,{}),E=w?Object.keys(w).sort():[];let k;e[18]!==t||e[19]!==i?(k=t?.find(B=>B.id===i),e[18]=t,e[19]=i,e[20]=k):k=e[20];const L=k?.name||i||"Select a model";u=Nc,_=!1;let R;e[21]!==L?(R=T.jsx("span",{className:Es,children:L}),e[21]=L,e[22]=R):R=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=T.jsx(Kc,{className:wc}),e[23]=O):O=e[23],e[24]!==R?(f=T.jsxs(eg,{className:Tf,children:[R,O]}),e[24]=R,e[25]=f):f=e[25],l=pa,a=ma,h=Cc,g="bottom",m=4,y="start",x="fixed",p=!0,o=ya,c=Ec,d=r?T.jsx("div",{className:bv,children:"Loading models..."}):E.length===0?T.jsx("div",{className:xv,children:"No models available"}):E.map(B=>{const K=w?.[B],D=K?.providerId,U=K?.models;return T.jsxs(Fg,{children:[T.jsxs(Pg,{className:vv,openOnHover:!0,delay:100,children:[D&&T.jsx("img",{src:yo(D),alt:"",className:ca}),T.jsx("span",{className:Es,children:B}),T.jsx(Cg,{className:wc})]}),T.jsx(pa,{children:T.jsx(ma,{className:Cc,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:T.jsx(ya,{className:Ec,children:U?.map(j=>{const X=i===j.id;return T.jsxs(Qf,{className:_v,onClick:()=>s(j.id),children:[T.jsx("span",{className:Es,children:j.name.split(":")[1]||j.id}),X&&T.jsx(Zc,{className:Sv})]},j.id)})})})})]},B)}),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=o,e[5]=a,e[6]=l,e[7]=u,e[8]=c,e[9]=f,e[10]=d,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=x,e[16]=p,e[17]=_}else o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],h=e[11],g=e[12],m=e[13],y=e[14],x=e[15],p=e[16],_=e[17];let S;e[26]!==o||e[27]!==c||e[28]!==d?(S=T.jsx(o,{className:c,children:d}),e[26]=o,e[27]=c,e[28]=d,e[29]=S):S=e[29];let C;e[30]!==a||e[31]!==S||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(C=T.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:S}),e[30]=a,e[31]=S,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=C):C=e[38];let v;e[39]!==l||e[40]!==C?(v=T.jsx(l,{children:C}),e[39]=l,e[40]=C,e[41]=v):v=e[41];let b;return e[42]!==u||e[43]!==f||e[44]!==v||e[45]!==_?(b=T.jsxs(u,{modal:_,children:[f,v]}),e[42]=u,e[43]=f,e[44]=v,e[45]=_,e[46]=b):b=e[46],b}function Tv(n,e){const t=Ev(e.id),r=kf(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function kv(n){const e=ze.c(76),{value:t,onChange:r}=n,{data:i,isLoading:s}=uv(t.provider);let o;e[0]!==t.provider?(o=Tc?.find(Y=>Y.value===t.provider)||null,e[0]=t.provider,e[1]=o):o=e[1];const a=o,l=t.modelName?t.modelName:(t.provider,"Select model");let u;e[2]!==r||e[3]!==t?(u=Y=>{Y&&r({...t,provider:Y.value,modelName:""})},e[2]=r,e[3]=t,e[4]=u):u=e[4];const c=u;let f;e[5]!==r||e[6]!==t?(f=Y=>{r({...t,modelName:Y})},e[5]=r,e[6]=t,e[7]=f):f=e[7];const d=f;let h;e[8]!==r||e[9]!==t?(h=(Y,ue)=>{r({...t,[Y]:ue})},e[8]=r,e[9]=t,e[10]=h):h=e[10];const g=h;let m;if(e[11]!==t.modelName||e[12]!==t.provider){const Y=kf(t.modelName);m=Y?yo(Y):t.provider?yo(t.provider):null,e[11]=t.modelName,e[12]=t.provider,e[13]=m}else m=e[13];const y=m;let x;e[14]!==y?(x=y?T.jsx("img",{src:y,alt:"",className:ca}):T.jsx("span",{className:wf,children:"?"}),e[14]=y,e[15]=x):x=e[15];const p=t.modelName?Sc:`${Sc} ${fv}`;let _;e[16]!==l||e[17]!==p?(_=T.jsx("span",{className:p,children:l}),e[16]=l,e[17]=p,e[18]=_):_=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=T.jsx(Cv,{className:yv}),e[19]=S):S=e[19];let C;e[20]!==x||e[21]!==_?(C=T.jsxs(Hc,{className:dv,children:[x,_,S]}),e[20]=x,e[21]=_,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=T.jsx("span",{className:Cs,children:"Provider"}),e[23]=v):v=e[23];let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=Tc||[],e[24]=b):b=e[24];let w;e[25]!==c||e[26]!==a?(w=T.jsxs("div",{className:Ss,children:[v,T.jsx(vo,{items:b,value:a,onValueChange:c,itemToString:Iv,itemToIcon:Ov,placeholder:"Select provider"})]}),e[25]=c,e[26]=a,e[27]=w):w=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=T.jsx("span",{className:Cs,children:"Model"}),e[28]=E):E=e[28];let k;e[29]!==d||e[30]!==s||e[31]!==i||e[32]!==t.modelName||e[33]!==t.provider?(k=T.jsxs("div",{className:Ss,children:[E,t.provider?T.jsx(wv,{models:i,isLoading:s,selectedModelName:t.modelName,onSelect:d}):T.jsx("div",{className:Tf,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[29]=d,e[30]=s,e[31]=i,e[32]=t.modelName,e[33]=t.provider,e[34]=k):k=e[34];let F;e[35]===Symbol.for("react.memo_cache_sentinel")?(F=T.jsx("span",{className:Cs,children:"Parameters"}),e[35]=F):F=e[35];const L=t.temperature??1;let R;e[36]!==g?(R=Y=>g("temperature",Y),e[36]=g,e[37]=R):R=e[37];let O;e[38]!==L||e[39]!==R?(O=T.jsx(jr,{label:"Temperature",value:L,min:0,max:2,step:.1,onValueChange:R,formatValue:Pv}),e[38]=L,e[39]=R,e[40]=O):O=e[40];let B;e[41]===Symbol.for("react.memo_cache_sentinel")?(B=T.jsx("label",{className:mv,children:"Max Tokens"}),e[41]=B):B=e[41];const K=t.maxTokens??"";let D;e[42]!==r||e[43]!==t?(D=Y=>{const ue=Y.target.value?parseInt(Y.target.value,10):void 0;r({...t,maxTokens:ue})},e[42]=r,e[43]=t,e[44]=D):D=e[44];let U;e[45]!==K||e[46]!==D?(U=T.jsxs("div",{className:pv,children:[B,T.jsx("input",{type:"number",className:qc,value:K,placeholder:"Default",min:1,onChange:D})]}),e[45]=K,e[46]=D,e[47]=U):U=e[47];const j=t.topP??1;let X;e[48]!==g?(X=Y=>g("topP",Y),e[48]=g,e[49]=X):X=e[49];let te;e[50]!==j||e[51]!==X?(te=T.jsx(jr,{label:"Top P",value:j,min:0,max:1,step:.05,onValueChange:X,formatValue:Fv}),e[50]=j,e[51]=X,e[52]=te):te=e[52];const J=t.frequencyPenalty??0;let le;e[53]!==g?(le=Y=>g("frequencyPenalty",Y),e[53]=g,e[54]=le):le=e[54];let V;e[55]!==J||e[56]!==le?(V=T.jsx(jr,{label:"Frequency Penalty",value:J,min:-2,max:2,step:.1,onValueChange:le,formatValue:Av}),e[55]=J,e[56]=le,e[57]=V):V=e[57];const re=t.presencePenalty??0;let Z;e[58]!==g?(Z=Y=>g("presencePenalty",Y),e[58]=g,e[59]=Z):Z=e[59];let ce;e[60]!==re||e[61]!==Z?(ce=T.jsx(jr,{label:"Presence Penalty",value:re,min:-2,max:2,step:.1,onValueChange:Z,formatValue:Nv}),e[60]=re,e[61]=Z,e[62]=ce):ce=e[62];let G;e[63]!==O||e[64]!==U||e[65]!==te||e[66]!==V||e[67]!==ce?(G=T.jsxs("div",{className:Ss,children:[F,T.jsxs("div",{className:hv,children:[O,U,te,V,ce]})]}),e[63]=O,e[64]=U,e[65]=te,e[66]=V,e[67]=ce,e[68]=G):G=e[68];let Q;e[69]!==w||e[70]!==k||e[71]!==G?(Q=T.jsx(Jc,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:T.jsxs("div",{className:gv,children:[w,k,G]})}),e[69]=w,e[70]=k,e[71]=G,e[72]=Q):Q=e[72];let ve;return e[73]!==C||e[74]!==Q?(ve=T.jsxs(Gc,{children:[C,Q]}),e[73]=C,e[74]=Q,e[75]=ve):ve=e[75],ve}function Nv(n){return n.toFixed(1)}function Av(n){return n.toFixed(1)}function Fv(n){return n.toFixed(2)}function Pv(n){return n.toFixed(1)}function Ov(n){return n?.icon?T.jsx("img",{src:n.icon,alt:"",className:ca}):T.jsx("span",{className:wf,children:n?.label?.charAt(0).toUpperCase()||"?"})}function Iv(n){return n?.label||""}const Rv=n=>{const e=ze.c(48),{form:t,editorKey:r}=n,{setValue:i,control:s}=t;let o;e[0]!==t.control?(o={control:t.control,name:"provider"},e[0]=t.control,e[1]=o):o=e[1];const a=Ut(o);let l;e[2]!==s?(l={control:s,name:"modelName"},e[2]=s,e[3]=l):l=e[3];const u=Ut(l);let c;e[4]!==s?(c={control:s,name:"system_prompt"},e[4]=s,e[5]=c):c=e[5];const f=Ut(c);let d;e[6]!==s?(d={control:s,name:"temperature"},e[6]=s,e[7]=d):d=e[7];const h=Ut(d);let g;e[8]!==s?(g={control:s,name:"maxTokens"},e[8]=s,e[9]=g):g=e[9];const m=Ut(g);let y;e[10]!==s?(y={control:s,name:"topP"},e[10]=s,e[11]=y):y=e[11];const x=Ut(y);let p;e[12]!==s?(p={control:s,name:"frequencyPenalty"},e[12]=s,e[13]=p):p=e[13];const _=Ut(p);let S;e[14]!==s?(S={control:s,name:"presencePenalty"},e[14]=s,e[15]=S):S=e[15];const C=Ut(S),v=a||"",b=u||"";let w;e[16]!==_||e[17]!==m||e[18]!==C||e[19]!==b||e[20]!==v||e[21]!==h||e[22]!==x?(w={provider:v,modelName:b,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:C},e[16]=_,e[17]=m,e[18]=C,e[19]=b,e[20]=v,e[21]=h,e[22]=x,e[23]=w):w=e[23];const E=w;let k;e[24]!==_||e[25]!==m||e[26]!==C||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==h||e[31]!==x?(k=j=>{j.provider!==a&&i("provider",j.provider,{shouldValidate:!0,shouldDirty:!0}),j.modelName!==u&&i("modelName",j.modelName,{shouldValidate:!0,shouldDirty:!0}),j.temperature!==h&&i("temperature",j.temperature,{shouldValidate:!0,shouldDirty:!0}),j.maxTokens!==m&&i("maxTokens",j.maxTokens,{shouldValidate:!0,shouldDirty:!0}),j.topP!==x&&i("topP",j.topP,{shouldValidate:!0,shouldDirty:!0}),j.frequencyPenalty!==_&&i("frequencyPenalty",j.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),j.presencePenalty!==C&&i("presencePenalty",j.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=C,e[27]=u,e[28]=a,e[29]=i,e[30]=h,e[31]=x,e[32]=k):k=e[32];const F=k;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=T.jsxs("div",{className:_a,children:[T.jsx(Uc,{icon:Xg,size:"xs"}),T.jsx("span",{children:"Model"})]}),e[33]=L):L=e[33];let R;e[34]!==F||e[35]!==E?(R=T.jsxs("div",{className:ug,children:[L,T.jsx("div",{className:dg,children:T.jsx(kv,{value:E,onChange:F})})]}),e[34]=F,e[35]=E,e[36]=R):R=e[36];let O;e[37]===Symbol.for("react.memo_cache_sentinel")?(O=T.jsx("span",{children:"System"}),e[37]=O):O=e[37];let B;e[38]===Symbol.for("react.memo_cache_sentinel")?(B=T.jsxs("div",{className:_a,children:[O,T.jsxs("div",{className:fg,children:[T.jsx(cv,{width:14,height:14}),T.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=B):B=e[38];let K;e[39]!==i?(K=j=>i("system_prompt",j,{shouldValidate:!0,shouldDirty:!0}),e[39]=i,e[40]=K):K=e[40];let D;e[41]!==r||e[42]!==f||e[43]!==K?(D=T.jsxs("div",{className:gg,children:[B,T.jsx(av,{value:f,onChange:K},r)]}),e[41]=r,e[42]=f,e[43]=K,e[44]=D):D=e[44];let U;return e[45]!==R||e[46]!==D?(U=T.jsxs("div",{className:hg,children:[R,D]}),e[45]=R,e[46]=D,e[47]=U):U=e[47],U},$v=["variants-list"],Mv=()=>{const n=ze.c(2),e=Wc();let t;return n[0]!==e?(t={mutationFn:Lv,onSuccess:(r,i)=>{e.invalidateQueries({queryKey:$v}),e.invalidateQueries({queryKey:Eg(i.configId)})}},n[0]=e,n[1]=t):t=n[1],Yc(t)};async function Lv(n){const t=await(await _o.v1.configs[":configId"].variants.$post({param:{configId:n.configId},json:{name:n.name,provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}})).json();if("data"in t&&t.data)return t.data}const Dv=()=>{const n=ze.c(2),e=Wc();let t;return n[0]!==e?(t={mutationFn:Bv,onSuccess:(r,i)=>{e.invalidateQueries({queryKey:pg(i.variantId)}),e.invalidateQueries({queryKey:["variant",i.variantId]})}},n[0]=e,n[1]=t):t=n[1],Yc(t)};async function Bv(n){const e=await _o.v1.variants[":id"].versions.$post({param:{id:n.variantId},json:{provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}}),t=await e.json();if(!e.ok||!("data"in t))throw new Error("message"in t?t.message:"Failed to create variant version");return t.data}function ax(){const{id:n,variant:e}=tg.useParams(),t=ng(),r=Mv(),i=Dv(),s=mg(),{data:o}=rg(e==="new"?"":e),{data:a}=wg(n),{data:l}=yg(e==="new"?"":e),{data:u}=Tg(n),[c,f]=A.useState("new"),[d,h]=A.useState(null),g=e==="new",m=lg({defaultValues:{variant_name:"",provider:"",modelName:"",system_prompt:"",temperature:void 0,maxTokens:void 0,topP:void 0,frequencyPenalty:void 0,presencePenalty:void 0}}),y=m.formState.isDirty,x=r.isPending||i.isPending||s.isPending,p=l?[...l].sort((v,b)=>b.version-v.version):[];A.useEffect(()=>{if(l&&l.length>0&&!d){const v=a?.find(w=>w.variantId===e),b=u?.find(w=>v&&w.configVariantId===v.id&&w.variantVersionId);if(b?.variantVersionId)h(b.variantVersionId);else{const w=l.reduce((E,k)=>k.version>E.version?k:E);h(w.id)}}},[l,d,a,u,e]),Ag({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),A.useEffect(()=>{if(o&&d&&l){const v=l.find(w=>w.id===d);if(!v)return;const b=typeof v.jsonData=="string"?JSON.parse(v.jsonData):v.jsonData;m.reset({variant_name:o.name||"",provider:v.provider||"",modelName:b?.model||v.modelName||"",system_prompt:b?.system_prompt||"",temperature:b?.temperature,maxTokens:b?.max_tokens,topP:b?.top_p,frequencyPenalty:b?.frequency_penalty,presencePenalty:b?.presence_penalty},{keepDirty:!1}),f(`${o.id}-${d}`)}},[o,d,l]);const _=v=>{const b={system_prompt:v.system_prompt,model:v.modelName};return v.temperature!==void 0&&(b.temperature=v.temperature),v.maxTokens!==void 0&&(b.max_tokens=v.maxTokens),v.topP!==void 0&&(b.top_p=v.topP),v.frequencyPenalty!==void 0&&(b.frequency_penalty=v.frequencyPenalty),v.presencePenalty!==void 0&&(b.presence_penalty=v.presencePenalty),b},S=v=>{if(!a||a.length===0)return v;const b=new Set(a.map(k=>k.name));if(!b.has(v))return v;let w=2,E=`${v} (${w})`;for(;b.has(E);)w++,E=`${v} (${w})`;return E},C=async v=>{const b=m.getValues();if(!(!b.variant_name.trim()||!b.provider||!b.modelName))try{const w=_(b);if(v.mode==="new_variant"||g){const E=v.mode==="new_variant"&&!g?S(b.variant_name):b.variant_name,k=await r.mutateAsync({configId:n,name:E,provider:b.provider,modelName:b.modelName,jsonData:w});v.deployToEnvironment&&v.environmentId&&k&&await s.mutateAsync({environmentId:v.environmentId,configId:n,configVariantId:k.configVariant.id,variantVersionId:k.version.id})}else{const E=await i.mutateAsync({variantId:e,provider:b.provider,modelName:b.modelName,jsonData:w});if(v.deployToEnvironment&&v.environmentId){const k=a?.find(F=>F.variantId===e);k&&E&&await s.mutateAsync({environmentId:v.environmentId,configId:n,configVariantId:k.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(w){console.error("Error saving variant:",w)}};return T.jsxs("div",{children:[T.jsxs("div",{className:_g,children:[T.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:qc,...m.register("variant_name")}),T.jsxs("div",{className:vg,children:[!g&&p.length>0&&T.jsx(vo,{items:p,value:p.find(v=>v.id===d)??null,onValueChange:v=>{(v&&!y||v&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(v.id)},placeholder:"Select version...",itemToString:v=>v?`Version ${v.version}`:""}),T.jsx(yh,{isNewVariant:g,onSave:C,isSaving:x})]})]}),T.jsx("div",{className:xg,children:T.jsx(Rv,{form:m,editorKey:c})})]})}export{ax as component};
|