@ycodium-ai/plugin-conversation 0.2.3470 → 0.2.3474
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/assets/ui.js +9 -9
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/assets/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var HB=Object.create;var pp=Object.defineProperty;var UB=Object.getOwnPropertyDescriptor;var KB=Object.getOwnPropertyNames;var $B=Object.getPrototypeOf,qB=Object.prototype.hasOwnProperty;var VB=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var fp=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},cn=(e,t)=>{for(var n in t)pp(e,n,{get:t[n],enumerable:!0})},xS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of KB(t))!qB.call(e,r)&&r!==n&&pp(e,r,{get:()=>t[r],enumerable:!(o=UB(t,r))||o.enumerable});return e};var Fd=(e,t,n)=>(n=e!=null?HB($B(e)):{},xS(t||!e||!e.__esModule?pp(n,"default",{value:e,enumerable:!0}):n,e)),bS=e=>xS(pp({},"__esModule",{value:!0}),e);var gp={};cn(gp,{Activity:()=>GB,Children:()=>Lh,Component:()=>ra,Fragment:()=>Ns,Profiler:()=>jB,PureComponent:()=>QB,StrictMode:()=>YB,Suspense:()=>Rh,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>XB,__COMPILER_RUNTIME:()=>JB,act:()=>ZB,cache:()=>ez,cacheSignal:()=>tz,captureOwnerStack:()=>nz,cloneElement:()=>mp,createContext:()=>ut,createElement:()=>Fe,createRef:()=>oz,default:()=>wn,forwardRef:()=>Tn,isValidElement:()=>Eh,lazy:()=>rz,memo:()=>le,startTransition:()=>az,unstable_useCacheRefresh:()=>sz,use:()=>Ge,useActionState:()=>iz,useCallback:()=>M,useContext:()=>Nt,useDebugValue:()=>lz,useDeferredValue:()=>dz,useEffect:()=>$,useEffectEvent:()=>Mh,useId:()=>un,useImperativeHandle:()=>Wo,useInsertionEffect:()=>Bd,useLayoutEffect:()=>ue,useMemo:()=>K,useOptimistic:()=>cz,useReducer:()=>dr,useRef:()=>N,useState:()=>G,useSyncExternalStore:()=>Ao,useTransition:()=>uz,version:()=>pz});var IS,wn,GB,Lh,ra,Ns,jB,QB,YB,Rh,XB,JB,ZB,ez,tz,nz,mp,ut,Fe,oz,Tn,Eh,rz,le,az,sz,Ge,iz,M,Nt,lz,dz,$,Mh,un,Wo,Bd,ue,K,cz,dr,N,G,Ao,uz,pz,W=VB(()=>{IS=window.__ycodiumPluginHost.react,wn=IS,{Activity:GB,Children:Lh,Component:ra,Fragment:Ns,Profiler:jB,PureComponent:QB,StrictMode:YB,Suspense:Rh,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:XB,__COMPILER_RUNTIME:JB,act:ZB,cache:ez,cacheSignal:tz,captureOwnerStack:nz,cloneElement:mp,createContext:ut,createElement:Fe,createRef:oz,forwardRef:Tn,isValidElement:Eh,lazy:rz,memo:le,startTransition:az,unstable_useCacheRefresh:sz,use:Ge,useActionState:iz,useCallback:M,useContext:Nt,useDebugValue:lz,useDeferredValue:dz,useEffect:$,useEffectEvent:Mh,useId:un,useImperativeHandle:Wo,useInsertionEffect:Bd,useLayoutEffect:ue,useMemo:K,useOptimistic:cz,useReducer:dr,useRef:N,useState:G,useSyncExternalStore:Ao,useTransition:uz,version:pz}=IS});var fP=fp(to=>{"use strict";var L$=(W(),bS(gp));function pP(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function as(){}var eo={d:{f:as,r:function(){throw Error(pP(522))},D:as,C:as,L:as,m:as,X:as,S:as,M:as},p:0,findDOMNode:null},R$=Symbol.for("react.portal");function E$(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R$,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}var Kc=L$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Mf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}to.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=eo;to.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(pP(299));return E$(e,t,null,n)};to.flushSync=function(e){var t=Kc.T,n=eo.p;try{if(Kc.T=null,eo.p=2,e)return e()}finally{Kc.T=t,eo.p=n,eo.d.f()}};to.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,eo.d.C(e,t))};to.prefetchDNS=function(e){typeof e=="string"&&eo.d.D(e)};to.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,o=Mf(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?eo.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&eo.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};to.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Mf(t.as,t.crossOrigin);eo.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&eo.d.M(e)};to.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,o=Mf(n,t.crossOrigin);eo.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};to.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Mf(t.as,t.crossOrigin);eo.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else eo.d.m(e)};to.requestFormReset=function(e){eo.d.r(e)};to.unstable_batchedUpdates=function(e,t){return e(t)};to.useFormState=function(e,t,n){return Kc.H.useFormState(e,t,n)};to.useFormStatus=function(){return Kc.H.useHostTransitionStatus()};to.version="19.2.6"});var $c=fp((
|
|
1
|
+
var HB=Object.create;var pp=Object.defineProperty;var UB=Object.getOwnPropertyDescriptor;var KB=Object.getOwnPropertyNames;var $B=Object.getPrototypeOf,qB=Object.prototype.hasOwnProperty;var VB=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var fp=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},cn=(e,t)=>{for(var n in t)pp(e,n,{get:t[n],enumerable:!0})},xS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of KB(t))!qB.call(e,r)&&r!==n&&pp(e,r,{get:()=>t[r],enumerable:!(o=UB(t,r))||o.enumerable});return e};var Fd=(e,t,n)=>(n=e!=null?HB($B(e)):{},xS(t||!e||!e.__esModule?pp(n,"default",{value:e,enumerable:!0}):n,e)),bS=e=>xS(pp({},"__esModule",{value:!0}),e);var gp={};cn(gp,{Activity:()=>GB,Children:()=>Lh,Component:()=>ra,Fragment:()=>Ns,Profiler:()=>jB,PureComponent:()=>QB,StrictMode:()=>YB,Suspense:()=>Rh,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>XB,__COMPILER_RUNTIME:()=>JB,act:()=>ZB,cache:()=>ez,cacheSignal:()=>tz,captureOwnerStack:()=>nz,cloneElement:()=>mp,createContext:()=>ut,createElement:()=>Fe,createRef:()=>oz,default:()=>wn,forwardRef:()=>Tn,isValidElement:()=>Eh,lazy:()=>rz,memo:()=>le,startTransition:()=>az,unstable_useCacheRefresh:()=>sz,use:()=>Ge,useActionState:()=>iz,useCallback:()=>M,useContext:()=>Nt,useDebugValue:()=>lz,useDeferredValue:()=>dz,useEffect:()=>$,useEffectEvent:()=>Mh,useId:()=>un,useImperativeHandle:()=>Wo,useInsertionEffect:()=>Bd,useLayoutEffect:()=>ue,useMemo:()=>K,useOptimistic:()=>cz,useReducer:()=>dr,useRef:()=>N,useState:()=>G,useSyncExternalStore:()=>Ao,useTransition:()=>uz,version:()=>pz});var IS,wn,GB,Lh,ra,Ns,jB,QB,YB,Rh,XB,JB,ZB,ez,tz,nz,mp,ut,Fe,oz,Tn,Eh,rz,le,az,sz,Ge,iz,M,Nt,lz,dz,$,Mh,un,Wo,Bd,ue,K,cz,dr,N,G,Ao,uz,pz,W=VB(()=>{IS=window.__ycodiumPluginHost.react,wn=IS,{Activity:GB,Children:Lh,Component:ra,Fragment:Ns,Profiler:jB,PureComponent:QB,StrictMode:YB,Suspense:Rh,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:XB,__COMPILER_RUNTIME:JB,act:ZB,cache:ez,cacheSignal:tz,captureOwnerStack:nz,cloneElement:mp,createContext:ut,createElement:Fe,createRef:oz,forwardRef:Tn,isValidElement:Eh,lazy:rz,memo:le,startTransition:az,unstable_useCacheRefresh:sz,use:Ge,useActionState:iz,useCallback:M,useContext:Nt,useDebugValue:lz,useDeferredValue:dz,useEffect:$,useEffectEvent:Mh,useId:un,useImperativeHandle:Wo,useInsertionEffect:Bd,useLayoutEffect:ue,useMemo:K,useOptimistic:cz,useReducer:dr,useRef:N,useState:G,useSyncExternalStore:Ao,useTransition:uz,version:pz}=IS});var fP=fp(to=>{"use strict";var L$=(W(),bS(gp));function pP(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function as(){}var eo={d:{f:as,r:function(){throw Error(pP(522))},D:as,C:as,L:as,m:as,X:as,S:as,M:as},p:0,findDOMNode:null},R$=Symbol.for("react.portal");function E$(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R$,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}var Kc=L$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Mf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}to.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=eo;to.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(pP(299));return E$(e,t,null,n)};to.flushSync=function(e){var t=Kc.T,n=eo.p;try{if(Kc.T=null,eo.p=2,e)return e()}finally{Kc.T=t,eo.p=n,eo.d.f()}};to.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,eo.d.C(e,t))};to.prefetchDNS=function(e){typeof e=="string"&&eo.d.D(e)};to.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,o=Mf(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?eo.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&eo.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};to.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Mf(t.as,t.crossOrigin);eo.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&eo.d.M(e)};to.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,o=Mf(n,t.crossOrigin);eo.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};to.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Mf(t.as,t.crossOrigin);eo.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else eo.d.m(e)};to.requestFormReset=function(e){eo.d.r(e)};to.unstable_batchedUpdates=function(e,t){return e(t)};to.useFormState=function(e,t,n){return Kc.H.useFormState(e,t,n)};to.useFormStatus=function(){return Kc.H.useHostTransitionStatus()};to.version="19.2.6"});var $c=fp((Ome,gP)=>{"use strict";function mP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mP)}catch(e){console.error(e)}}mP(),gP.exports=fP()});var OD=fp(DD=>{"use strict";var Sd=(W(),bS(gp));function n8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var o8=typeof Object.is=="function"?Object.is:n8,r8=Sd.useState,a8=Sd.useEffect,s8=Sd.useLayoutEffect,i8=Sd.useDebugValue;function l8(e,t){var n=t(),o=r8({inst:{value:n,getSnapshot:t}}),r=o[0].inst,a=o[1];return s8(function(){r.value=n,r.getSnapshot=t,tb(r)&&a({inst:r})},[e,n,t]),a8(function(){return tb(r)&&a({inst:r}),e(function(){tb(r)&&a({inst:r})})},[e]),i8(n),n}function tb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o8(e,n)}catch{return!0}}function d8(e,t){return t()}var c8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d8:l8;DD.useSyncExternalStore=Sd.useSyncExternalStore!==void 0?Sd.useSyncExternalStore:c8});var BD=fp((dke,FD)=>{"use strict";FD.exports=OD()});var SS=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties, theme, base, components, utilities;
|
|
3
3
|
@layer properties;
|
|
4
4
|
:root, :host {
|
|
@@ -3758,10 +3758,10 @@ var HB=Object.create;var pp=Object.defineProperty;var UB=Object.getOwnPropertyDe
|
|
|
3758
3758
|
}
|
|
3759
3759
|
}
|
|
3760
3760
|
}
|
|
3761
|
-
`;W();W();var wS=ut(null),zd=wS.Provider,TS=ut(""),Ah=TS.Provider;function hp(){return Nt(TS)}function pn(){let e=Nt(wS);if(e===null)throw new Error("Conversation UI has not been registered.");return e}var vp="ycodium:assistant-quote-open",Ji="ycodium:thread-reference-open";var yp="conversation",Nh="conversation.prompt-preview";var Cp="__ycodiumConversationBridge",_h="ycodium.conversation.rebindable-bridge.v1";var Hd=17,PS=`ycodium.conversation.host-data.v${Hd}`,aa="\uFFFC";W();function kS(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=kS(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function LS(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=kS(e))&&(o&&(o+=" "),o+=t);return o}var RS=LS;var fz=(e,t)=>{let n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},mz=(e,t)=>({classGroupId:e,validator:t}),FS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n});var ES=[],gz="arbitrary..",hz=e=>{let t=yz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return vz(s);let i=s.split("-"),l=i[0]===""&&i.length>1?1:0;return BS(i,l,t)},getConflictingClassGroupIds:(s,i)=>{if(i){let l=o[s],d=n[s];return l?d?fz(d,l):l:d||ES}return n[s]||ES}}},BS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let d=BS(e,t+1,a);if(d)return d}let s=n.validators;if(s===null)return;let i=t===0?e.join("-"):e.slice(t).join("-"),l=s.length;for(let d=0;d<l;d++){let u=s[d];if(u.validator(i))return u.classGroupId}},vz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?gz+o:void 0})(),yz=e=>{let{theme:t,classGroups:n}=e;return Cz(n,t)},Cz=(e,t)=>{let n=FS();for(let o in e){let r=e[o];Fh(r,n,o,t)}return n},Fh=(e,t,n,o)=>{let r=e.length;for(let a=0;a<r;a++){let s=e[a];xz(s,t,n,o)}},xz=(e,t,n,o)=>{if(typeof e=="string"){bz(e,t,n);return}if(typeof e=="function"){Sz(e,t,n,o);return}Iz(e,t,n,o)},bz=(e,t,n)=>{let o=e===""?t:zS(t,e);o.classGroupId=n},Sz=(e,t,n,o)=>{if(wz(e)){Fh(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(mz(n,e))},Iz=(e,t,n,o)=>{let r=Object.entries(e),a=r.length;for(let s=0;s<a;s++){let[i,l]=r[s];Fh(l,zS(t,i),n,o)}},zS=(e,t)=>{let n=e,o=t.split("-"),r=o.length;for(let a=0;a<r;a++){let s=o[a],i=n.nextPart.get(s);i||(i=FS(),n.nextPart.set(s,i)),n=i}return n},wz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Tz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null),r=(a,s)=>{n[a]=s,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=o[a])!==void 0)return r(a,s),s},set(a,s){a in n?n[a]=s:r(a,s)}}};var Pz=[],MS=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),kz=e=>{let{prefix:t,experimentalParseClassName:n}=e,o=r=>{let a=[],s=0,i=0,l=0,d,u=r.length;for(let h=0;h<u;h++){let v=r[h];if(s===0&&i===0){if(v===":"){a.push(r.slice(l,h)),l=h+1;continue}if(v==="/"){d=h;continue}}v==="["?s++:v==="]"?s--:v==="("?i++:v===")"&&i--}let p=a.length===0?r:r.slice(l),f=p,m=!1;p.endsWith("!")?(f=p.slice(0,-1),m=!0):p.startsWith("!")&&(f=p.slice(1),m=!0);let g=d&&d>l?d-l:void 0;return MS(a,m,f,g)};if(t){let r=t+":",a=o;o=s=>s.startsWith(r)?a(s.slice(r.length)):MS(Pz,!1,s,void 0,!0)}if(n){let r=o;o=a=>n({className:a,parseClassName:r})}return o},Lz=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{let o=[],r=[];for(let a=0;a<n.length;a++){let s=n[a],i=s[0]==="[",l=t.has(s);i||l?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(s)):r.push(s)}return r.length>0&&(r.sort(),o.push(...r)),o}},Rz=e=>({cache:Tz(e.cacheSize),parseClassName:kz(e),sortModifiers:Lz(e),postfixLookupClassGroupIds:Ez(e),...hz(e)}),Ez=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let o=0;o<n.length;o++)t[n[o]]=!0;return t},Mz=/\s+/,Az=(e,t)=>{let{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a,postfixLookupClassGroupIds:s}=t,i=[],l=e.trim().split(Mz),d="";for(let u=l.length-1;u>=0;u-=1){let p=l[u],{isExternal:f,modifiers:m,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}=n(p);if(f){d=p+(d.length>0?" "+d:d);continue}let C=!!v,y;if(C){let k=h.substring(0,v);y=o(k);let P=y&&s[y]?o(h):void 0;P&&P!==y&&(y=P,C=!1)}else y=o(h);if(!y){if(!C){d=p+(d.length>0?" "+d:d);continue}if(y=o(h),!y){d=p+(d.length>0?" "+d:d);continue}C=!1}let b=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=g?b+"!":b,S=w+y;if(i.indexOf(S)>-1)continue;i.push(S);let I=r(y,C);for(let k=0;k<I.length;++k){let P=I[k];i.push(w+P)}d=p+(d.length>0?" "+d:d)}return d},Nz=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=HS(n))&&(r&&(r+=" "),r+=o);return r},HS=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=HS(e[o]))&&(n&&(n+=" "),n+=t);return n},AS=(e,...t)=>{let n,o,r,a,s=l=>{let d=t.reduce((u,p)=>p(u),e());return n=Rz(d),o=n.cache.get,r=n.cache.set,a=i,i(l)},i=l=>{let d=o(l);if(d)return d;let u=Az(l,n);return r(l,u),u};return a=s,(...l)=>a(Nz(...l))},_z=[],yn=e=>{let t=n=>n[e]||_z;return t.isThemeGetter=!0,t},US=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ka=e=>Dz.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),Fr=e=>!!e&&Number.isInteger(Number(e)),Dh=e=>e.endsWith("%")&&mt(e.slice(0,-1)),sa=e=>Oz.test(e),$S=()=>!0,Uz=e=>Fz.test(e)&&!Bz.test(e),Bh=()=>!1,Kz=e=>zz.test(e),$z=e=>Hz.test(e),qz=e=>!Be(e)&&!ze(e),Vz=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Wz=e=>$a(e,WS,Bh),Be=e=>US.test(e),_s=e=>$a(e,GS,Uz),NS=e=>$a(e,eH,mt),Gz=e=>$a(e,QS,$S),jz=e=>$a(e,jS,Bh),_S=e=>$a(e,qS,Bh),Qz=e=>$a(e,VS,$z),xp=e=>$a(e,YS,Kz),ze=e=>KS.test(e),Ud=e=>Ds(e,GS),Yz=e=>Ds(e,jS),DS=e=>Ds(e,qS),Xz=e=>Ds(e,WS),Jz=e=>Ds(e,VS),bp=e=>Ds(e,YS,!0),Zz=e=>Ds(e,QS,!0),$a=(e,t,n)=>{let o=US.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},Ds=(e,t,n=!1)=>{let o=KS.exec(e);return o?o[1]?t(o[1]):n:!1},qS=e=>e==="position"||e==="percentage",VS=e=>e==="image"||e==="url",WS=e=>e==="length"||e==="size"||e==="bg-size",GS=e=>e==="length",eH=e=>e==="number",jS=e=>e==="family-name",QS=e=>e==="number"||e==="weight",YS=e=>e==="shadow";var OS=()=>{let e=yn("color"),t=yn("font"),n=yn("text"),o=yn("font-weight"),r=yn("tracking"),a=yn("leading"),s=yn("breakpoint"),i=yn("container"),l=yn("spacing"),d=yn("radius"),u=yn("shadow"),p=yn("inset-shadow"),f=yn("text-shadow"),m=yn("drop-shadow"),g=yn("blur"),h=yn("perspective"),v=yn("aspect"),C=yn("ease"),y=yn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),ze,Be],I=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],P=()=>[ze,Be,l],T=()=>[Ka,"full","auto",...P()],L=()=>[Fr,"none","subgrid",ze,Be],E=()=>["auto",{span:["full",Fr,ze,Be]},Fr,ze,Be],A=()=>[Fr,"auto",ze,Be],R=()=>["auto","min","max","fr",ze,Be],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...P()],_=()=>[Ka,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],Q=()=>[Ka,"screen","full","dvw","lvw","svw","min","max","fit",...P()],D=()=>[Ka,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],O=()=>[e,ze,Be],re=()=>[...w(),DS,_S,{position:[ze,Be]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",Xz,Wz,{size:[ze,Be]}],X=()=>[Dh,Ud,_s],q=()=>["","none","full",d,ze,Be],V=()=>["",mt,Ud,_s],Z=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[mt,Dh,DS,_S],oe=()=>["","none",g,ze,Be],se=()=>["none",mt,ze,Be],Ce=()=>["none",mt,ze,Be],xe=()=>[mt,ze,Be],Le=()=>[Ka,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sa],breakpoint:[sa],color:[$S],container:[sa],"drop-shadow":[sa],ease:["in","out","in-out"],font:[qz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sa],shadow:[sa],spacing:["px",mt],text:[sa],"text-shadow":[sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ka,Be,ze,v]}],container:["container"],"container-type":[{"@container":["","normal","size",ze,Be]}],"container-named":[Vz],columns:[{columns:[mt,Be,ze,i]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Fr,"auto",ze,Be]}],basis:[{basis:[Ka,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,Ka,"auto","initial","none",Be]}],grow:[{grow:["",mt,ze,Be]}],shrink:[{shrink:["",mt,ze,Be]}],order:[{order:[Fr,"first","last","none",ze,Be]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[i,"screen",..._()]}],"min-w":[{"min-w":[i,"screen","none",..._()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",n,Ud,_s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Zz,Gz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dh,Be]}],"font-family":[{font:[Yz,jz,t]}],"font-features":[{"font-features":[Be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ze,Be]}],"line-clamp":[{"line-clamp":[mt,"none",ze,NS]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",ze,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",ze,_s]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[mt,"auto",ze,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Fr,ze,Be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fr,ze,Be],radial:["",ze,Be],conic:[Fr,ze,Be]},Jz,Qz]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,ze,Be]}],"outline-w":[{outline:["",mt,Ud,_s]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,bp,xp]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",p,bp,xp]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[mt,_s]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,bp,xp]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[mt,ze,Be]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[ze,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ze,Be]}],filter:[{filter:["","none",ze,Be]}],blur:[{blur:oe()}],brightness:[{brightness:[mt,ze,Be]}],contrast:[{contrast:[mt,ze,Be]}],"drop-shadow":[{"drop-shadow":["","none",m,bp,xp]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",mt,ze,Be]}],"hue-rotate":[{"hue-rotate":[mt,ze,Be]}],invert:[{invert:["",mt,ze,Be]}],saturate:[{saturate:[mt,ze,Be]}],sepia:[{sepia:["",mt,ze,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Be]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[mt,ze,Be]}],"backdrop-contrast":[{"backdrop-contrast":[mt,ze,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,ze,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,ze,Be]}],"backdrop-invert":[{"backdrop-invert":["",mt,ze,Be]}],"backdrop-opacity":[{"backdrop-opacity":[mt,ze,Be]}],"backdrop-saturate":[{"backdrop-saturate":[mt,ze,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,ze,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",ze,Be]}],ease:[{ease:["linear","initial",C,ze,Be]}],delay:[{delay:[mt,ze,Be]}],animate:[{animate:["none",y,ze,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ze,Be]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[ze,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[Fr,ze,Be]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze,Be]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[mt,Ud,_s,NS]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tH=(e,{cacheSize:t,prefix:n,experimentalParseClassName:o,extend:r={},override:a={}})=>(Zi(e,"cacheSize",t),Zi(e,"prefix",n),Zi(e,"experimentalParseClassName",o),Sp(e.theme,a.theme),Sp(e.classGroups,a.classGroups),Sp(e.conflictingClassGroups,a.conflictingClassGroups),Sp(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Zi(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Zi(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Ip(e.theme,r.theme),Ip(e.classGroups,r.classGroups),Ip(e.conflictingClassGroups,r.conflictingClassGroups),Ip(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),Oh(e,r,"postfixLookupClassGroups"),Oh(e,r,"orderSensitiveModifiers"),e),Zi=(e,t,n)=>{n!==void 0&&(e[t]=n)},Sp=(e,t)=>{if(t)for(let n in t)Zi(e,n,t[n])},Ip=(e,t)=>{if(t)for(let n in t)Oh(e,t,n)},Oh=(e,t,n)=>{let o=t[n];o!==void 0&&(e[n]=e[n]?e[n].concat(o):o)},XS=(e,...t)=>typeof e=="function"?AS(OS,e,...t):AS(()=>tH(OS(),e),...t);var nH=XS({extend:{classGroups:{"font-size":[{text:["chat","chat-row","chat-code","chat-dense","chat-meta","control-1","control-2","control-3","control-4","control-5"]}]}}});function j(...e){return nH(RS(e))}W();var wp=ut(!0);function JS(){return Ge(wp)}var zh=ut(void 0);function No(){let e=Ge(wp);return Ge(zh)??e}W();var Tp=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();var ZS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var eI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());var Hh=e=>{let t=eI(e);return t.charAt(0).toUpperCase()+t.slice(1)};W();var tI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var nI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var oI=Tn(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:s,...i},l)=>Fe("svg",{ref:l,...tI,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Tp("lucide",r),...!a&&!nI(i)&&{"aria-hidden":"true"},...i},[...s.map(([d,u])=>Fe(d,u)),...Array.isArray(a)?a:[a]]));var te=(e,t)=>{let n=Tn(({className:o,...r},a)=>Fe(oI,{ref:a,iconNode:t,className:Tp(`lucide-${ZS(Hh(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Hh(e),n};var oH=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Os=te("archive",oH);var rH=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Kd=te("arrow-down",rH);var aH=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],$d=te("arrow-up-to-line",aH);var sH=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],qd=te("arrow-up-right",sH);var iH=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Vd=te("arrow-up",iH);var lH=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Wd=te("blocks",lH);var dH=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Gd=te("book-open",dH);var cH=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],el=te("bookmark",cH);var uH=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Fs=te("bot",uH);var pH=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dn=te("check",pH);var fH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qt=te("chevron-down",fH);var mH=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Bs=te("chevron-left",mH);var gH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cn=te("chevron-right",gH);var hH=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],jd=te("chevrons-left",hH);var vH=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Qd=te("chevrons-right",vH);var yH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Zt=te("circle-alert",yH);var CH=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zs=te("copy",CH);var xH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],co=te("ellipsis",xH);var bH=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Yd=te("eye-off",bH);var SH=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xd=te("eye",SH);var IH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Jd=te("file-code",IH);var wH=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],cr=te("file-headphone",wH);var TH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],qa=te("file-play",TH);var PH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Zd=te("file-text",PH);var kH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],ec=te("file-type",kH);var LH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],tc=te("file",LH);var RH=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Va=te("folder",RH);var EH=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],nc=te("frame",EH);var MH=[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],oc=te("git-branch-plus",MH);var AH=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],rc=te("git-branch",AH);var NH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ac=te("globe",NH);var _H=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],sc=te("grip-vertical",_H);var DH=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],ic=te("hammer",DH);var OH=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],lc=te("image",OH);var FH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],dc=te("info",FH);var BH=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Wa=te("layers",BH);var zH=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],cc=te("list-ordered",zH);var HH=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Hs=te("list-todo",HH);var UH=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],uc=te("list",UH);var KH=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ga=te("loader-circle",KH);var $H=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],ja=te("lock-open",$H);var qH=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],pc=te("lock",qH);var VH=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],tl=te("maximize",VH);var WH=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=te("message-circle-question-mark",WH);var GH=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Us=te("message-circle",GH);var jH=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ks=te("message-square",jH);var QH=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],ia=te("messages-square",QH);var YH=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],fc=te("minimize-2",YH);var XH=[["path",{d:"M5 12h14",key:"1ays0h"}]],$s=te("minus",XH);var JH=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Br=te("mouse-pointer-click",JH);var ZH=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],mc=te("package",ZH);var eU=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],qs=te("paintbrush",eU);var tU=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],_o=te("paperclip",tU);var nU=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],zr=te("pen-line",nU);var oU=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gc=te("pencil-ruler",oU);var rU=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],hc=te("pencil",rU);var aU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vc=te("plus",aU);var sU=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Vs=te("puzzle",sU);var iU=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ws=te("rotate-ccw",iU);var lU=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gs=te("search",lU);var dU=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],yc=te("send",dU);var cU=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cc=te("settings",cU);var uU=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],nl=te("skip-forward",uU);var pU=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ol=te("sliders-horizontal",pU);var fU=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ya=te("sparkles",fU);var mU=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],uo=te("square-pen",mU);var gU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],xc=te("square",gU);var hU=[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bc=te("star-off",hU);var vU=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],js=te("star",vU);var yU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Do=te("terminal",yU);var CU=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],la=te("text-quote",CU);var xU=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Xa=te("user-round",xU);var bU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Sc=te("wrench",bU);var SU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ht=te("x",SU);var IU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qs=te("zap",IU);W();function de(){return{t:pn().i18n.usePluginTranslation()}}W();W();var Ja=ut(null),Ic=ut(null);function rl(e,t){let n=Ge(Ic);ue(()=>{if(!(!t||e===null||n===null))return n(e)},[n,t,e])}function wc(){let e=new Map;return{rows:()=>[...e.keys()],acquire:(t,n)=>{e.set(t,(e.get(t)??0)+1),n();let o=!0;return()=>{if(!o)return;o=!1;let r=e.get(t)??0;r>1?e.set(t,r-1):e.delete(t),n()}}}}var rI=new Set(["Select","AlertDialog","Dialog","Menu","Popover","Tooltip","Combobox"]);function be(e){let t=rI.has(e),n=o=>{let r=pn(),a=hp(),s=No(),i=r.ui[e],l={};if(t){let d=Ge(Ja),[u,p]=G(o.defaultOpen===!0),f=typeof o.open=="boolean"?o.open:u;rl(d,s&&f),ue(()=>{s||p(!1)},[s]),l={open:s&&f,onOpenChange:(m,...g)=>{p(m),typeof o.onOpenChange=="function"&&o.onOpenChange(m,...g)}}}return Fe(i,{...o,...l,...rI.has(e)&&!s?{open:!1}:{},className:`${a} ${typeof o.className=="string"?o.className:""}`})};return n.displayName=e,n}var kne=be("useLinkContextMenu"),ur=be("ProviderInstanceIcon"),aI=be("UserAvatar"),Go=be("Badge"),Lne=be("InlineTag"),Uh=be("Meter"),J=be("Button"),Pp=be("Label"),al=be("Input"),sI=be("SearchInput"),Za=be("EmptyInline"),iI=be("Textarea"),kp=be("Switch"),Rne=be("Separator"),Kh=be("Skeleton"),Hr=be("Spinner"),Ene=be("ScrollArea"),Mne=be("Card"),Ane=be("CardAction"),Nne=be("CardPanel"),_ne=be("CardDescription"),Dne=be("CardFooter"),One=be("CardHeader"),Fne=be("CardTitle"),Bne=be("Empty"),zne=be("EmptyContent"),Hne=be("EmptyDescription"),Une=be("EmptyHeader"),Kne=be("EmptyMedia"),$ne=be("EmptyTitle"),qne=be("InputGroup"),Vne=be("InputGroupAddon"),Wne=be("InputGroupInput"),Gne=be("DocumentPanel"),jne=be("MasterDetail"),Lp=be("Select"),Rp=be("SelectItem"),Ep=be("SelectPopup"),lI=be("SelectTrigger"),Mp=be("SelectValue"),Tc=be("Toggle"),dI=be("ToggleGroup"),sl=be("Dialog"),Qne=be("DialogClose"),il=be("DialogDescription"),Ap=be("DialogFooter"),Np=be("DialogHeader"),ll=be("DialogPopup"),cI=be("DialogPanel"),dl=be("DialogTitle"),Yne=be("DialogTrigger"),Un=be("Menu"),cl=be("MenuGroup"),uI=be("MenuGroupLabel"),Kn=be("MenuItem"),$n=be("MenuPopup"),pr=be("MenuRadioGroup"),Oo=be("MenuRadioItem"),da=be("MenuSeparator"),qn=be("MenuTrigger"),po=be("Popover"),fo=be("PopoverPopup"),mo=be("PopoverTrigger"),pI=be("Table"),fI=be("TableBody"),fr=be("TableCell"),Ys=be("TableHead"),mI=be("TableHeader"),es=be("TableRow"),Me=be("Tooltip"),Ae=be("TooltipPopup"),Ne=be("TooltipTrigger"),Pc=be("Alert"),kc=be("AlertAction"),_p=be("AlertDescription"),$h=be("AlertTitle"),ul=be("Kbd"),Dp=be("DecisionCard"),gI=be("ChoiceList"),Op=be("Command"),Fp=be("CommandGroup"),Bp=be("CommandItem"),zp=be("CommandList"),hI=be("Combobox"),vI=be("ComboboxEmpty"),yI=be("ComboboxInput"),ts=be("ComboboxItem"),CI=be("ComboboxListVirtualized"),xI=be("TooltipProvider"),bI=be("StyledDiffCodeView"),SI=be("DevBackdropArt"),Zn=be("Markdown"),II=be("DiffView"),wI=be("MediaPlayer");var{jsx:c,jsxs:x,Fragment:ge}=window.__ycodiumPluginHost.jsxRuntime;var wU="sr-only @min-[30rem]/composer-first-row:not-sr-only";function PI({mode:e,onModeChange:t}){let{t:n}=de();return c("div",{className:"flex shrink-0 items-center gap-1",children:x(dI,{className:"shrink-0","data-view-mode-toggle":!0,size:"xs","aria-label":n("trajectory.toggleLabel"),variant:"segmented",value:[e],onValueChange:o=>{let r=o[0];(r==="chat"||r==="trajectory")&&t(r)},children:[c(TI,{value:"chat",label:n("trajectory.toggleChat"),icon:c(Ks,{"aria-hidden":!0})}),c(TI,{value:"trajectory",label:n("trajectory.toggleTrajectory"),icon:c(cc,{"aria-hidden":!0})})]})})}function TI({value:e,label:t,icon:n}){return x(Me,{children:[x(Ne,{render:c(Tc,{value:e,"aria-label":t}),children:[n,c("span",{className:wU,children:t})]}),c(Ae,{side:"top",children:t})]})}function kI({mode:e,visible:t,chat:n,trajectory:o}){return c("div",{className:"relative flex min-h-0 flex-1 flex-col","aria-hidden":t?void 0:!0,inert:t?void 0:!0,"data-chat-view-pane":e,"data-pane-visible":t?"true":"false",children:c(zh,{value:t,children:e==="chat"?n:o})})}W();function it(){return{t:pn().i18n.usePluginTranslation()}}function LI(e){if(e.cacheDisjoint!==!0)return null;let t=e.cachedInputTokens,n=e.inputTokens;if(t===void 0||n===void 0)return null;let o=t+n;if(o<=0)return null;if(t>=o)return"100%";let r=t/o*100;for(let a=0;a<=3;a+=1){let s=r.toFixed(a);if(Number.parseFloat(s)<100)return`${s}%`}return"99.9%"}function RI(e){let t,n,o,r=!0,a=!1;for(let s of e)s!==void 0&&(a=!0,s.cacheDisjoint!==!0&&(r=!1),s.outputTokens!==void 0&&(t=(t??0)+s.outputTokens),s.inputTokens!==void 0&&(n=(n??0)+s.inputTokens),s.cachedInputTokens!==void 0&&(o=(o??0)+s.cachedInputTokens));if(!(t===void 0&&n===void 0&&o===void 0))return{...a&&r?{cacheDisjoint:!0}:{},...t!==void 0?{outputTokens:t}:{},...n!==void 0?{inputTokens:n}:{},...o!==void 0?{cachedInputTokens:o}:{}}}W();W();var EI=ut(null);function MI({data:e,target:t,children:n}){let o=M(r=>e.readTurnChanges(t,r),[e,t.environmentId,t.threadId]);return c(EI,{value:e.readTurnChanges?o:null,children:n})}function AI({turnId:e,filePath:t,onClose:n}){let o=Ge(EI),r=N(o),a=N(n);a.current=n;let{t:s}=it(),[i,l]=G(0),[d,u]=G(0),[p,f]=G(null),[m,g]=G("loading");return $(()=>{if(o!==r.current){a.current();return}let h=!0;if(g("loading"),!o){g("ready");return}return o({turnId:e,filePath:t,textOffset:i}).then(v=>{h&&(f(C=>({...v,text:i===0?v.text:(C?.text??"")+v.text})),g("ready"))},()=>{h&&g("failed")}),()=>{h=!1}},[o,e,t,i,d]),c(sl,{open:!0,onOpenChange:h=>{h||n()},children:x(ll,{className:"flex max-h-[80vh] w-[min(90vw,60rem)] flex-col gap-3",children:[c(dl,{children:s("turnOverview.recordedChanges")}),c(il,{children:t}),c("p",{className:"text-xs text-muted-foreground",children:p||m==="ready"?s(p?.machineUpdateRequired?"turnOverview.changesUpgradeMachine":`turnOverview.changesSource.${p?.source??"unavailable"}`):null}),m==="loading"?c("p",{role:"status",children:s("turnOverview.changesLoading")}):null,m==="failed"?c(J,{onClick:()=>u(h=>h+1),children:s("turnOverview.changesRetry")}):null,p?.text?c("pre",{className:"min-h-0 overflow-auto whitespace-pre-wrap break-all text-xs",tabIndex:0,children:p.text}):null,p?.truncated?c("p",{children:s("turnOverview.changesTruncated")}):null,p?.textWindow?.nextOffset!=null?c(J,{disabled:m==="loading",onClick:()=>l(p.textWindow.nextOffset),children:s("turnOverview.changesMore")}):null,c(J,{onClick:n,children:s("turnOverview.changesClose")})]})})}W();W();function Lc(e,t){if(!Number.isFinite(e)||e<0)return t.milliseconds("0");if(e<1e3)return t.milliseconds(String(Math.max(1,Math.round(e))));if(e<1e4){let i=Math.round(e/100)/10;return t.seconds(i>=10?"10":i.toFixed(1))}if(e<6e4)return t.seconds(String(Math.round(e/1e3)));let n=Math.round(e/1e3),o=Math.floor(n/3600),r=Math.floor(n%3600/60),a=n%60,s=[];return o>0&&s.push(t.hours(String(o))),r>0&&s.push(t.minutes(String(r))),a>0&&s.push(t.seconds(String(a))),s.reduce((i,l)=>t.pair(i,l))}function NI(e,t){return!Number.isFinite(e)||e<=0?t.seconds("0"):Lc(e,t)}function go(){let{t:e}=it();return K(()=>{let t={milliseconds:n=>e("duration.milliseconds",{value:n}),seconds:n=>e("duration.seconds",{value:n}),minutes:n=>e("duration.minutes",{value:n}),hours:n=>e("duration.hours",{value:n}),pair:(n,o)=>e("duration.pair",{left:n,right:o})};return{units:t,formatDuration:n=>Lc(n,t),formatCountedDuration:n=>NI(n,t)}},[e])}function TU({fact:e,ownerId:t,onLocate:n,turnId:o}){let{t:r}=it(),{formatDuration:a}=go(),[s,i]=G(!1),[l,d]=G(null);rl(t,s||l!==null);let u=r(`turnOverview.${e.kind}`,{count:e.value,duration:a(e.value)}),p=e.targets[0];return e.targets.length===1&&p?.filePath===void 0?c(J,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs",title:r("turnOverview.locate"),onClick:()=>p&&n(p.rowId),disabled:!p,children:u}):x(ge,{children:[x(po,{open:s,onOpenChange:i,children:[c(mo,{render:c(J,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs"}),children:u}),x(fo,{className:"flex max-h-72 w-80 flex-col gap-1 overflow-auto p-2",children:[e.partial?c("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:r("turnOverview.loadedFacts")}):null,e.targets.map((f,m)=>x("div",{className:"flex min-w-0 items-center gap-1",children:[f.filePath?c(J,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start whitespace-normal break-all text-left",title:r("turnOverview.recordedChanges"),onClick:()=>{i(!1),d(f.filePath)},children:f.filePath}):c("span",{className:"min-w-0 flex-1 px-2 text-xs",children:r("turnOverview.step",{index:m+1})}),c(J,{size:"xs",variant:"outline",onClick:()=>{i(!1),n(f.rowId)},children:r("turnOverview.locate")})]},`${f.rowId}:${f.filePath??m}`))]})]}),l!==null?c(AI,{turnId:o,filePath:l,onClose:()=>d(null)},`${o}:${l}`):null]})}function Hp({summary:e,...t}){let{t:n}=it();return x("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 text-muted-foreground","data-turn-facts":e.turnId,children:[e.facts.map(o=>c(TU,{fact:o,turnId:e.turnId,ownerId:`turn:${e.turnId}`,...t},o.kind)),e.facts.some(o=>o.partial)?c(qh,{className:"px-1 text-ui-2xs",detail:n("turnOverview.loadedFacts"),children:n("turnOverview.loaded")}):null]})}function Up({summary:e}){let{t}=it();return e.modelSummary?x("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[c("span",{className:"min-w-0 break-words",children:e.modelSummary.text}),c(qh,{className:"shrink-0 rounded border border-border px-1 text-ui-2xs font-normal text-muted-foreground",detail:e.modelSummary.modelSelection.model,children:t("turnOverview.modelSummary")})]}):null}function Kp({summary:e}){let{t}=it();return e.hasCompaction?x(qh,{className:"inline-flex shrink-0 items-center text-muted-foreground",detail:t("turnOverview.compaction"),children:[c(Os,{className:"size-3","aria-hidden":!0}),c("span",{className:"sr-only",children:t("turnOverview.compaction")})]}):null}function qh({children:e,detail:t,className:n}){return x(Me,{children:[c(Ne,{render:c("span",{className:n}),children:e}),c(Ae,{children:t})]})}W();var DI=100,PU=new Map,_I=new Map,$p=e=>typeof e=="function"?e():e,OI=(e,t)=>typeof t=="function"?t(e):t;function kU(e,t,n){let o=e.get(t);return o===void 0&&(o={values:new Map,limit:Math.max(1,n)},e.set(t,o)),o}function LU(e,t){let n=_I.get(e);return n===void 0&&(n={values:new Map,limit:Math.max(1,t)},_I.set(e,n)),n}function RU(e,t){if(!(e.values.size<=e.limit)){for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.committed||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}}}function Vh(e,t,n){e.values.get(t)===n&&(e.values.delete(t),e.values.set(t,n))}function FI(e,t,n){let o=e.values.get(t);return o===void 0&&(o={value:$p(n),subscribers:new Set,leases:0,alive:!0,committed:!1},e.values.set(t,o)),o}function Rc(e){queueMicrotask(()=>RU(e))}function vt(e,t,n,o=DI){let r=Math.max(1,o),a=kU(PU,e,r),s=FI(a,t,n),i=M(p=>s.alive?(a.limit=r,s.committed=!0,Vh(a,t,s),s.leases+=1,s.subscribers.add(p),Rc(a),()=>{s.subscribers.delete(p),s.leases=Math.max(0,s.leases-1),Rc(a)}):()=>{},[r,s,a,t]),l=M(()=>s.value,[s]),d=Ao(i,l,l),u=M(p=>{if(!s.alive||a.values.get(t)!==s)return;let f=s.value,m=OI(f,p);if(!Object.is(m,f)){s.value=m,Vh(a,t,s);for(let g of s.subscribers)g();Rc(a)}},[s,a,t]);return[d,u]}function BI(e,t){let n=N(null);(n.current===null||n.current.key!==e)&&(n.current={key:e,value:$p(t)});let[,o]=dr(a=>a+1,0),r=M(a=>{let s=n.current;if(s===null||s.key!==e)return;let i=OI(s.value,a);Object.is(i,s.value)||(s.value=i,o())},[e]);return[n.current.value,r]}function lt(e,t,n,o=DI){let r=Math.max(1,o),a=LU(e,r),s=FI(a,t,()=>({current:$p(n)}));return $(()=>{if(!(!s.alive||a.values.get(t)!==s))return a.limit=r,s.committed=!0,Vh(a,t,s),s.leases+=1,Rc(a),()=>{s.leases=Math.max(0,s.leases-1),Rc(a)}},[r,s,a,t]),s.value}function Fo(e,t){let n=N(null);return(n.current===null||n.current.key!==e)&&(n.current={key:e,ref:{current:$p(t)}}),n.current.ref}W();var Wh="trajectory-summary-reveal";function zI({inputKey:e,rows:t,groupRows:n,paneVisible:o,resetFilter:r}){let[a,s]=vt("trajectory-turn-disclosure",e,{}),[i,l]=vt("trajectory-routine-disclosure",e,()=>new Set),[d,u]=vt("trajectory-expand-all",e,!1),[p,f]=vt(Wh,e,null),[m,g]=vt("trajectory-summary-highlight",e,null),h=lt("trajectory-default-open",e,()=>new Set),v=K(()=>n?.(t,d)??null,[n,t,d]),C=K(()=>{let k=new Map,P=new Map;if(v===null)return{rows:t,headers:k,routines:P};let T=v.findLast(A=>A.turnId!==null),L=new Set(v.map(A=>A.id));if(h.current.size>200)for(let A of h.current)L.has(A)||h.current.delete(A);o&&T&&h.current.add(T.id);let E=[];for(let A of v){let R=A.items[0],F=R?.kind==="step"?R.row:R?.rows[0];if(!F)continue;let H=d||(a[A.id]??(A.turnId===null||h.current.has(A.id)||A.summary?.state==="running"));if(k.set(A.id,{group:A,expanded:H}),E.push({...F,id:A.id,kind:"turn-header",turnId:A.turnId,createdAt:A.summary?.startedAt??F.createdAt}),!!H)for(let z of A.items){if(z.kind==="step"){E.push(z.row);continue}let _=i.has(z.id);P.set(z.id,{count:z.rows.length,expanded:_}),E.push({...z.rows[0],id:z.id,kind:"routine-header"}),_&&E.push(...z.rows)}}return{rows:E,headers:k,routines:P}},[v,t,o,h,d,a,i]),y=N(C.headers);y.current=C.headers;let b=M(k=>{u(!1),s(P=>({...P,[k]:!y.current.get(k)?.expanded}))},[u,s]),w=M(k=>l(P=>{let T=new Set(P);return T.has(k)?T.delete(k):T.add(k),T}),[l]),S=M(k=>f(P=>({rowId:k,nonce:(P?.nonce??0)+1})),[f]);ue(()=>{if(!o||p===null)return;r();let k=v?.find(T=>T.id===p.rowId||T.items.some(L=>L.kind==="step"?L.row.id===p.rowId:L.rows.some(E=>E.id===p.rowId)));if(!k||k.id===p.rowId)return;C.headers.get(k.id)?.expanded||s(T=>({...T,[k.id]:!0}));let P=k.items.find(T=>T.kind==="routine"&&T.rows.some(L=>L.id===p.rowId));P&&!i.has(P.id)&&l(T=>new Set([...T,P.id]))},[o,p,r,v,C.headers,i,s,l]);let I=M(k=>{g(k.rowId),f(P=>P===k?null:P)},[g,f]);return{...C,expandAll:d,setExpandAll:u,toggleTurn:b,toggleRoutine:w,locate:S,request:p,completeReveal:I,highlighted:m}}function pl(e){return e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function HI({rows:e,usageByTurnId:t,onSelect:n,summaries:o,actions:r}){let{t:a}=it();return e.map(({item:s,ordinal:i})=>{let l=s.attachmentPreview,d=s.isSystemMessage?a("turnNavigator.systemWake"):l===void 0?s.userText:l.count===1?l.name:a("forkRelations.attachmentPreview",l),u=s.turnId===null?void 0:o.get(s.turnId),p=s.turnId===null?void 0:t.get(s.turnId);return x("div",{className:"rounded-md hover:bg-accent/50",children:[x("button",{type:"button","data-turn-navigator-row":s.sectionKey,onClick:()=>n(s),className:"flex w-full cursor-[var(--control-cursor)] items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[c("span",{className:"shrink-0 pt-px font-mono text-ui-2xs text-muted-foreground tabular-nums",children:i}),x("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[x("span",{className:"flex items-start gap-1",children:[c("span",{className:"line-clamp-2 min-w-0 flex-1 font-medium text-chat leading-snug",children:d}),u?c(Kp,{summary:u}):null]}),u?.modelSummary?c(Up,{summary:u}):s.assistantText?c("span",{className:"line-clamp-1 text-ui-xs text-muted-foreground leading-snug",children:s.assistantText}):null,p?.outputTokens!==void 0?c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:pl(p.outputTokens)}):null]})]}),u&&r?c("div",{className:"pb-1 pl-7 pr-2",children:c(Hp,{summary:u,...r})}):null]},s.sectionKey)})}function EU({context:e,useSummaries:t,...n}){let o=t(e.target),r=K(()=>new Map(o.map(s=>[s.turnId,s])),[o]),[,a]=vt(Wh,e.threadKey,null);return c(HI,{...n,summaries:r,actions:{onLocate:s=>{a(i=>({rowId:s,nonce:(i?.nonce??0)+1})),n.onClose(),e.openTrajectory()},onOpenFileDiff:e.onOpenFileDiff}})}var MU=new Map;function UI(e){let t=e.summaryContext;return t?.data.useTurnSummaries?c(EU,{...e,context:t,useSummaries:t.data.useTurnSummaries}):c(HI,{...e,summaries:MU})}function AU({totals:e}){let{t}=it();if(!e)return null;let n=LI(e),o=[e.outputTokens===void 0?null:{label:t("turnNavigator.usageOutput"),value:pl(e.outputTokens)},e.inputTokens===void 0?null:{label:t("turnNavigator.usageInput"),value:pl(e.inputTokens)},e.cachedInputTokens===void 0?null:{label:t("turnNavigator.usageCacheRead"),value:n===null?pl(e.cachedInputTokens):`${pl(e.cachedInputTokens)} (${n})`}].filter(r=>r!==null);return o.length===0?null:x("div",{className:"flex items-baseline gap-2 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:t("turnNavigator.usage")}),o.map(r=>x("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums",children:[r.label," ",r.value]},r.label))]})}var NU=le(function({getText:t,size:n="xs",variant:o="outline",className:r}){let{t:a}=it(),s=pn().writeClipboard,[i,l]=G(!1),d=a("turnNavigator.copyMarkdown");return x(Me,{children:[c(Ne,{render:c(J,{"aria-label":d,disabled:i,onClick:()=>{s(t()).then(()=>{l(!0),window.setTimeout(()=>l(!1),1e3)})},type:"button",size:n,variant:o,className:j("text-muted-foreground hover:text-foreground",r)}),children:i?c(Dn,{className:"size-3 text-primary"}):c(zs,{className:"size-3"})}),c(Ae,{children:c("p",{children:d})})]})});function KI({items:e,totalTurnCount:t,bottomInset:n,usageByTurnId:o,onSelect:r,exportMarkdown:a,onDownload:s,placement:i="float",summaryContext:l}){let{t:d}=it(),[u,p]=G(!1),f=K(()=>e.map((v,C)=>({item:v,ordinal:C+1})).reverse(),[e]),m=K(()=>RI(f.map(({item:v})=>v.turnId===null?void 0:o.get(v.turnId))),[f,o]);if(e.length===0)return null;let g=t??e.length,h=d("turnNavigator.open",{count:g});return x(po,{onOpenChange:p,open:u,children:[x(mo,{render:c(J,{"aria-label":h,className:j("gap-1.5 rounded-full px-3",i==="float"&&"absolute right-3 z-40"),"data-testid":"turn-navigator-pill",size:"xs",style:i==="float"?{bottom:n+12}:void 0,title:h,variant:"glass"}),children:[c(uc,{"aria-hidden":!0}),c("span",{className:"font-mono font-semibold text-[11px] tabular-nums",children:g})]}),c(fo,{align:"end",className:"w-80 flex-col",side:"top",children:x("div",{className:"flex max-h-[min(60vh,26rem)] flex-col",children:[x("div",{className:"flex items-center gap-1.5 border-b px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.title")}),c("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:g})]}),c("div",{className:j("min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1"),children:c(UI,{rows:f,usageByTurnId:o,summaryContext:l,onSelect:v=>{p(!1),r(v)},onClose:()=>p(!1)})}),c(AU,{totals:m}),x("div",{className:"flex items-center gap-1 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.export")}),c(NU,{size:"icon-xs",getText:a,variant:"ghost"}),c(J,{"aria-label":d("turnNavigator.downloadMarkdown"),onClick:()=>s("md"),size:"xs",title:d("turnNavigator.downloadMarkdown"),variant:"ghost",children:c("span",{className:"font-mono text-[10px]",children:".md"})}),c(J,{"aria-label":d("turnNavigator.downloadJson"),onClick:()=>s("json"),size:"xs",title:d("turnNavigator.downloadJson"),variant:"ghost",children:c("span",{className:"font-mono text-[10px]",children:".json"})})]})]})})]})}W();function Ec(e){return e.replace(/\s+/g," ")}function _U(e,t){let n=e.slice(Math.max(0,e.length-t));return/^[\uDC00-\uDFFF]/.test(n)&&(n=n.slice(1)),n}function DU(e,t){let n=e.slice(0,t);return/[\uD800-\uDBFF]$/.test(n)&&(n=n.slice(0,-1)),n}function qp(e){let n=(e instanceof Element?e:e?.parentElement??null)?.closest("[data-assistant-quote-body]")??null;return n?.closest('[data-message-role="assistant"]')?n:null}function $I(e){if(!e||e.isCollapsed||e.rangeCount===0)return null;let t=e.getRangeAt(0),n=qp(t.startContainer);if(n===null||qp(t.endContainer)!==n)return null;let o=n.closest("[data-message-id]")?.dataset.messageId;if(!o)return null;let r=e.toString().trim();if(r.length===0)return null;let a=document.createRange();a.selectNodeContents(n),a.setEnd(t.startContainer,t.startOffset);let s=document.createRange();s.selectNodeContents(n),s.setStart(t.endContainer,t.endOffset);let i=Ec(t.toString()),l=i.length>i.trimStart().length?" ":"",d=i.length>i.trimEnd().length?" ":"",u=Ec(a.toString()+l),p=Ec(d+s.toString()),f=u.length,m=f+i.trim().length,g=t.getClientRects(),h=g[0]??t.getBoundingClientRect(),v=g[g.length-1]??h;return{messageId:o,text:r,start:f,end:m,prefix:_U(u,32),suffix:DU(p,32),anchor:{x:v.right,top:h.top,bottom:v.bottom}}}var Vp="assistant-quote-inserter",Wp="assistant-quote-open-comment";var OU=300;function qI(e){let{data:t,target:n,threadKey:o,surfaceRef:r}=e,{t:a}=de(),s=lt(Vp,o,null),[,i]=vt(Wp,o,null),[l,d]=G(null),u=N(null);if($(()=>{let h,v=()=>{let I=r.current,k=document.getSelection(),P=k&&k.rangeCount>0?k.getRangeAt(0):null;if(!I||!P||!I.contains(P.commonAncestorContainer)){d(null);return}let T=$I(k);if(T===null){d(null);return}let L=t.assistantQuotes.serialize({version:1,environmentId:n.environmentId,threadId:n.threadId,messageId:T.messageId,text:T.text,start:T.start,end:T.end,prefix:T.prefix,suffix:T.suffix});d({source:L,...T.anchor})},C=I=>{u.current?.contains(I.target)||(clearTimeout(h),h=setTimeout(v,OU))},y=I=>{u.current?.contains(I.target)||(clearTimeout(h),d(null))},b=()=>d(null),w=I=>{I.key==="Escape"&&d(null)},S=()=>{(document.getSelection()?.isCollapsed??!0)&&d(null)};return document.addEventListener("pointerup",C,!0),document.addEventListener("keyup",C,!0),document.addEventListener("pointerdown",y,!0),document.addEventListener("keydown",w,!0),document.addEventListener("selectionchange",S),window.addEventListener("scroll",b,!0),()=>{clearTimeout(h),document.removeEventListener("pointerup",C,!0),document.removeEventListener("keyup",C,!0),document.removeEventListener("pointerdown",y,!0),document.removeEventListener("keydown",w,!0),document.removeEventListener("selectionchange",S),window.removeEventListener("scroll",b,!0)}},[t,r,n.environmentId,n.threadId]),l===null)return null;let p=l.source,f=Math.max(8,Math.min(window.innerWidth-200,l.x-12)),m=l.bottom+6,g=m+40<=window.innerHeight?m:Math.max(8,l.top-40);return c("div",{ref:u,className:"fixed z-50 rounded-control-3 bg-background",style:{left:f,top:g},"data-assistant-quote-toolbar":"",children:x(J,{size:"sm",variant:"outline",className:"shadow-md",disabled:p===null,title:p===null?a("timeline.quote.tooLong"):void 0,onMouseDown:h=>h.preventDefault(),onClick:()=>{p!==null&&s.current?.(p)===!0&&(i(p),document.getSelection()?.removeAllRanges(),d(null))},children:[c(la,{"aria-hidden":"true"}),a("timeline.quote.cite")]})})}W();W();function VI(e){let t=e.map(o=>({key:o.key,turnId:o.turnId,firstRowIndex:o.firstRowIndex,endRowIndex:o.firstRowIndex+o.rowIds.length})),n=new Map;for(let o of e)for(let[r,a]of o.rowIds.entries())n.set(a,{turnId:o.turnId,index:o.firstRowIndex+r});return{sections:t,bySectionKey:new Map(t.map(o=>[o.key,o])),byRowId:n}}function Gp({index:e,visibleSectionKeys:t,protectedRowIds:n,selectionRows:o}){let r=t.flatMap(d=>{let u=e.bySectionKey.get(d)?.turnId;return u==null?[]:[u]}),a=n.flatMap(d=>{let u=e.byRowId.get(d)?.turnId;return u==null?[]:[u]}),s=o?e.byRowId.get(o.firstRowId)?.index:void 0,i=o?e.byRowId.get(o.lastRowId)?.index:void 0,l=s===void 0||i===void 0?[]:e.sections.flatMap(d=>d.turnId!==null&&d.endRowIndex>Math.min(s,i)&&d.firstRowIndex<=Math.max(s,i)?[d.turnId]:[]);return{firstTurnId:r[0]??null,lastTurnId:r.at(-1)??null,protectedTurnIds:[...new Set(a)],selectionTurnRange:l.length>0?{firstTurnId:l[0],lastTurnId:l.at(-1)}:null}}function WI(e,t,n,o){if(!o)return n;let r=e.findIndex(a=>t.has(a));return r<0?n:Math.max(n,e.length-r)}W();W();function Gh(e,t){for(let n of e.querySelectorAll("[data-timeline-row-id]"))if(n.dataset.timelineRowId===t)return n;return null}function Xs(e,t){let n=0,o=e.length,r=-1;for(;n<o;){let a=Math.floor((n+o)/2),i=e[a].getBoundingClientRect();Math.max(i.bottom,i.top+1)>t?(r=a,o=a):n=a+1}return r}function FU(e){let t=e.getBoundingClientRect().top,n=e.querySelectorAll("[data-timeline-turn-section]"),o=a=>{let s=a.querySelectorAll("[data-timeline-row-id]"),i=Xs(s,t),l=i<0?void 0:s[i],d=l?.dataset.timelineRowId;return!l||d===void 0?null:{rowId:d,offsetPx:Math.round(t-l.getBoundingClientRect().top)}};if(n.length===0)return o(e);let r=Xs(n,t);if(r<0)return null;for(let a=r;a<n.length;a+=1){let s=o(n[a]);if(s)return s}return null}function GI(e,t){let n=0,o=e;for(;o&&o!==t;)n+=o.offsetTop,o=o.offsetParent;return n}var jh=class extends ra{getSnapshotBeforeUpdate(t){return t.inputKey!==this.props.inputKey&&t.onBeforeInputChange(),null}componentDidUpdate(){}componentWillUnmount(){this.props.onBeforeInputChange()}render(){return this.props.children}};function jI({inputKey:e,onBeforeInputChange:t,handleRef:n,onAttach:o,className:r,children:a,onScroll:s,onInteractionRowsChange:i}){let l=N(null),d=N({inputKey:e,store:wc()});d.current.inputKey!==e&&(d.current={inputKey:e,store:wc()});let u=N(i);u.current=i;let p=M(m=>{let g=d.current;return g.store.acquire(m,()=>{d.current===g&&u.current?.(g.store.rows())})},[]);ue(()=>{i?.(d.current.store.rows())},[e,i]),Wo(n,()=>({get node(){return l.current},measure:()=>{let m=l.current;return m?{scroll:m.scrollTop,scrollLength:m.clientHeight,contentLength:m.scrollHeight,topOf:g=>{let h=Gh(m,g);return h===null?null:GI(h,m)},heightOf:g=>{let h=Gh(m,g);return h===null?null:h.offsetHeight},rowAtScroll:()=>FU(m)}:null},scrollToEnd:m=>{let g=l.current;if(g){if(m?.animated){g.scrollTo({top:g.scrollHeight,behavior:"smooth"});return}g.scrollTop=g.scrollHeight-g.clientHeight}},scrollToRow:(m,g)=>{let h=l.current;if(!h)return!1;let v=Gh(h,m);return v?(h.scrollTop=Math.max(0,GI(v,h)-(g?.viewOffset??0)),!0):!1},scrollToOffset:m=>{let g=l.current;g&&(g.scrollTop=Math.max(0,m))}}),[]);let f=M(m=>{l.current=m,o(m)},[o]);return c(jh,{inputKey:e,onBeforeInputChange:t,children:c(Ic,{value:p,children:c("div",{ref:f,className:r,style:{position:"relative"},onScroll:s,children:a})})})}function ml(e){if(!e)return!1;let t=e.tagName?.toLowerCase(),n=e.getAttribute?.("contenteditable");if(t==="textarea"||n==="true"||n===""||n==="plaintext-only"||"isContentEditable"in e&&e.isContentEditable===!0)return!0;if(t==="input"){let o=e.getAttribute?.("type")?.toLowerCase()??"text";if(!["button","submit","reset","image","checkbox","radio"].includes(o))return!0}return e.matches?.(":focus-visible")??!1}function fl(e,t){let o=(e?.nodeType===1?e:e?.parentElement)?.closest("[data-timeline-row-id]");return o&&t.contains(o)?o.dataset.timelineRowId??null:null}function jp(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return null;let n=null,o=null;for(let d=0;d<t.rangeCount;d+=1){let u=t.getRangeAt(d);u.intersectsNode(e)&&(n??=u,o=u)}if(!n||!o)return null;let r=fl(n.startContainer,e),a=fl(o.endContainer,e);if(r&&a)return{firstRowId:r,lastRowId:a};let s=e.querySelectorAll("[data-timeline-row-id]"),i=s[0]?.dataset.timelineRowId,l=s[s.length-1]?.dataset.timelineRowId;return i&&l?{firstRowId:r??i,lastRowId:a??l}:null}function Mc(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return!1;for(let n=0;n<t.rangeCount;n+=1)if(t.getRangeAt(n).intersectsNode(e))return!0;return!1}W();function ns(e){let t=N(e);t.current=e;let n=N(!1),o=N(null),r=N(null),a=N(0),s=M(()=>{a.current+=1,r.current!==null&&cancelAnimationFrame(r.current),r.current=null},[]),i=M(()=>{if(!n.current||!t.current||r.current!==null||o.current===null)return;let u=++a.current;r.current=requestAnimationFrame(p=>{if(u!==a.current||(r.current=null,!n.current||!t.current))return;let f=o.current;o.current=null,f?.(p)})},[]),l=M(u=>{o.current=u,i()},[i]),d=M(()=>{o.current=null,s()},[s]);return ue(()=>(n.current=!0,i(),()=>{n.current=!1,s()}),[e,s,i]),K(()=>({request:l,cancel:d}),[l,d])}function QI({root:e,inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l}){let d=N({inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l});d.current={inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l};let u=ns(n),p=N(null),f=M(()=>{let g=d.current;if(!e||!g.visible||e.clientHeight<=0)return;let h=e.getBoundingClientRect();if(h.height<=0)return;let v=h.top+g.topInset,C=h.bottom-g.bottomInset,y=e.querySelectorAll("[data-timeline-turn-section]"),b=Xs(y,v),w=[];if(b>=0)for(let T=b;T<y.length;T+=1){let L=y[T];if(L.getBoundingClientRect().top>=C)break;L.dataset.timelineTurnSection!==void 0&&w.push(L.dataset.timelineTurnSection)}let S=[...g.interactionRows()],I=e.ownerDocument.activeElement;if(ml(I)){let T=fl(I,e);T&&S.push(T)}let k=Gp({index:g.index,visibleSectionKeys:w,protectedRowIds:S,selectionRows:jp(e)}),P=`${g.inputKey}:${JSON.stringify(k)}`;P!==p.current&&(p.current=P,g.onRangeChange?.(k))},[e]),m=M(()=>u.request(f),[u,f]);return ue(()=>{if(p.current=null,!n||!e)return;let g=t,h=!0,v=()=>{!h||d.current.inputKey!==g||!d.current.visible||(d.current.onSelectionChange(Mc(e)),m())};e.addEventListener("scroll",v,{passive:!0}),e.addEventListener("focusin",v),e.addEventListener("focusout",v),e.ownerDocument.addEventListener("selectionchange",v);let C=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return C?.observe(e),e.firstElementChild&&C?.observe(e.firstElementChild),v(),()=>{h=!1,u.cancel(),C?.disconnect(),e.removeEventListener("scroll",v),e.removeEventListener("focusin",v),e.removeEventListener("focusout",v),e.ownerDocument.removeEventListener("selectionchange",v),i?.(null)}},[u,t,i,m,e,n]),ue(()=>{n&&m()},[o,m,n]),m}W();var YI=le(function({sectionKey:t,rowKeyPrefix:n,rowIds:o,renderRow:r,sectionRef:a}){return c("div",{className:"session-turn","data-timeline-turn-section":t,ref:a,children:o.map(s=>c("div",{className:"transcript-col min-w-0 overflow-x-clip",children:r(s)},`${n}:${s}`))})});var BU=400;function XI({root:e,minimumCount:t,keepAbovePx:n=0,canCompact:o,onCompact:r}){let a=e.ownerDocument,s=new Set,i,l=!1,d=()=>e.scrollHeight-e.clientHeight-e.scrollTop<=2,u=()=>{if(i=void 0,a.hidden||s.size>0||!o()||e.clientHeight<=0||!d()||Mc(e))return;let w=e.querySelectorAll("[data-timeline-turn-section]"),S=e.getBoundingClientRect().top-32-n,I=0,k=Math.max(0,w.length-t);for(;I<k;){let T=Math.floor((I+k)/2),L=w[T].getBoundingClientRect().bottom;if(!Number.isFinite(L))return;L<=S?I=T+1:k=T}if(I===0)return;let P=a.activeElement;if(P&&ml(P)){for(let T=0;T<I;T+=1)if(w[T].contains(P))return}r(w.length-I)},p=!1,f=()=>{if(a.hidden||s.size>0||!o()||p){clearTimeout(i),i=void 0;return}i===void 0&&(i=setTimeout(u,BU))},m=()=>{clearTimeout(i),i=void 0,f()},g=()=>{let w=d();!w||!l?m():f(),l=w},h=w=>{s.add(w.pointerId),m()},v=w=>{s.delete(w.pointerId),m()},C=()=>{p=Mc(e),m()},y=()=>{s.clear(),m()},b=["wheel","keydown","focusin","focusout"];for(let w of b)e.addEventListener(w,m,{passive:!0});return e.addEventListener("scroll",g,{passive:!0}),e.addEventListener("pointerdown",h,!0),a.addEventListener("pointerup",v,!0),a.addEventListener("pointercancel",v,!0),a.addEventListener("selectionchange",C),a.addEventListener("visibilitychange",f),a.defaultView?.addEventListener("blur",y),f(),{schedule:f,disconnect:()=>{clearTimeout(i);for(let w of b)e.removeEventListener(w,m);e.removeEventListener("scroll",g),e.removeEventListener("pointerdown",h,!0),a.removeEventListener("pointerup",v,!0),a.removeEventListener("pointercancel",v,!0),a.removeEventListener("selectionchange",C),a.removeEventListener("visibilitychange",f),a.defaultView?.removeEventListener("blur",y)}}}W();function JI({root:e,topInsetPx:t,onActiveSectionChange:n,onActiveStartHiddenChange:o,active:r}){let a=N(r);a.current=r;let s=ns(r),i=N(new Map),l=N(null),d=N(null),u=N(n);u.current=n;let p=N(o);p.current=o;let f=N(null),m=N(null),g=M(()=>{if(!a.current||!e)return;let b=e.scrollTop+t,w=null,S=Number.NEGATIVE_INFINITY,I=null,k=Number.POSITIVE_INFINITY;for(let[E,A]of i.current){if(!A.isConnected)continue;let R=A.offsetTop;R<k&&(k=R,I=E),R<=b&&R>=S&&(S=R,w=E)}let P=w??I;P!==d.current&&(d.current=P,u.current(P));let T=P===null?null:i.current.get(P)?.firstElementChild??null,L=T!==null&&T.getBoundingClientRect().bottom<=e.getBoundingClientRect().top+1;L!==f.current&&(f.current=L,p.current?.(L))},[e,t]),h=M(()=>{a.current&&s.request(g)},[s,g]);$(()=>{if(!r||!e||typeof IntersectionObserver>"u")return;let b=!0,w=new IntersectionObserver(()=>{!b||!a.current||h()},{root:e,rootMargin:`-${t}px 0px 0px 0px`,threshold:0});l.current=w;for(let I of i.current.values())w.observe(I);let S=new IntersectionObserver(()=>{!b||!a.current||h()},{root:e,threshold:0});m.current=S;for(let I of i.current.values())I.firstElementChild&&S.observe(I.firstElementChild);return h(),()=>{b=!1,w.disconnect(),l.current=null,S.disconnect(),m.current=null,s.cancel()}},[r,s,h,e,t]);let v=N(new Map),C=M(b=>{let w=v.current.get(b);if(w)return w;let S=I=>{let k=i.current.get(b);k&&k!==I&&(l.current?.unobserve(k),k.firstElementChild&&m.current?.unobserve(k.firstElementChild),i.current.delete(b)),I?(i.current.set(b,I),l.current?.observe(I),I.firstElementChild&&m.current?.observe(I.firstElementChild)):v.current.get(b)===S&&v.current.delete(b)};return v.current.set(b,S),S},[]),y=M(()=>{a.current&&(d.current=null,f.current=null,h())},[h]);return K(()=>({observeSection:C,refresh:y}),[C,y])}function Qp(e,t){return e===t?!0:!e||!t?!1:e.identity===t.identity&&e.instanceId===t.instanceId&&e.driverKind===t.driverKind&&e.providerDisplayName===t.providerDisplayName&&e.accentColor===t.accentColor&&e.modelLabel===t.modelLabel&&e.effortLabel===t.effortLabel&&e.effortLevel===t.effortLevel}function ZI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ew(e,t){return e.turnId===t.turnId&&e.createdAt===t.createdAt&&Qp(e.badge,t.badge)}function tw(e,t){if(e===t)return!0;if(e.kind!==t.kind||e.id!==t.id)return!1;switch(e.kind){case"turn-identity":return ew(e,t);case"turn-summary":{let n=t;return e.createdAt===n.createdAt&&e.copyText===n.copyText&&e.cardAnchor===n.cardAnchor&&e.footer===n.footer&&(e.identity===void 0?n.identity===void 0:n.identity!==void 0&&ew(e.identity,n.identity))}case"tool-group":{let n=t;return e.createdAt===n.createdAt&&e.groupId===n.groupId&&ZI(e.entries,n.entries)}case"working":{let n=t;return e.createdAt===n.createdAt&&e.turnId===n.turnId&&e.compacting===n.compacting&&Qp(e.modelBadge,n.modelBadge)}case"model-switch":{let n=t;return e.createdAt===n.createdAt&&e.pending===n.pending&&Qp(e.badge,n.badge)}case"proposed-plan":return e.proposedPlan===t.proposedPlan;case"turn-plan":{let n=t;return e.createdAt===n.createdAt&&e.turnPlan.plan===n.turnPlan.plan}case"work":{let n=t;return e.isExpandedToolGroupEntry===n.isExpandedToolGroupEntry&&e.isLastExpandedToolGroupEntry===n.isLastExpandedToolGroupEntry&&ZI(e.groupedEntries,n.groupedEntries)}case"message":{let n=t;return e.message===n.message&&e.presentation===n.presentation&&e.textTone===n.textTone&&e.durationStart===n.durationStart&&e.showAssistantMeta===n.showAssistantMeta&&e.showAssistantCopyButton===n.showAssistantCopyButton&&e.copyInFooter===n.copyInFooter&&e.assistantCopyStreaming===n.assistantCopyStreaming&&Qp(e.modelBadge,n.modelBadge)}}}function zU(e,t,n){for(let o=t;o<n;o+=1){let r=e[o];switch(r.kind){case"turn-identity":return r.turnId;case"working":if(r.turnId!=null)return r.turnId;break;case"message":if(r.message.role==="assistant")return r.message.turnId;break;case"tool-group":if(r.entries[0]?.turnId!=null)return r.entries[0].turnId;break;case"work":if(r.groupedEntries[0]?.turnId!=null)return r.groupedEntries[0].turnId;break;case"turn-plan":return r.turnPlan.turnId;case"proposed-plan":return r.proposedPlan.turnId;case"turn-summary":return r.footer.turnId}}return null}function nw(e,t,n=[]){let o=new Map(n.map(a=>[a.key,a])),r=[];for(let a of t){if(a.end<=a.start)continue;let s=zU(e,a.start,a.end),i=o.get(a.key);if(i!==void 0&&i.turnId===s&&HU(i,e,a.start,a.end)){r.push(i);continue}r.push({key:a.key,turnId:s,firstRowIndex:a.start,rowIds:e.slice(a.start,a.end).map(l=>l.id)})}return r}function HU(e,t,n,o){if(e.firstRowIndex!==n||e.rowIds.length!==o-n)return!1;for(let r=0;r<e.rowIds.length;r+=1)if(e.rowIds[r]!==t[n+r].id)return!1;return!0}function ow(e,t){let n=Math.max(0,Math.min(t,e)),o=e-n;return{startIndex:o,hasHiddenOlder:o>0}}function Js(e,t,n){let o=e.findIndex(r=>r.rowIds.includes(t));return o<0?n:Math.max(n,e.length-o)}function UU(e,t){let n=t.historyWindow,{status:o}=t,r={activities:t.activities,timelineEntries:t.timelineEntries,turnSummaries:t.turnSummaries,latestTurn:n?null:o.latestTurn,runningTurnId:n?null:o.runningTurnId,expandedTurnIds:t.expandedTurnIds,isWorking:!n&&o.isWorking,activeTurnStartedAt:n?null:o.activeTurnStartedAt,resolveModelBadge:t.resolveModelBadge,pendingModelSelection:n?null:o.pendingModelSelection},a=e.deriveGroups(r),s=o.latestTurn;if(n&&s&&s.completedAt!==null){let i=s.turnId;if(a.rows.some(d=>d.kind==="message"?d.message.role==="assistant"&&d.message.turnId===i:d.kind==="work"?d.groupedEntries.some(u=>u.turnId===i):d.kind==="tool-group"&&d.entries.some(u=>u.turnId===i)))return e.deriveGroups({...r,latestTurn:s})}return a}var KU=new Map,$U={markdown:()=>"",download(){}},qU=[],VU={latestTurn:null,latestAssistantMessageId:null,runningTurnId:null,isWorking:!1,workingStepLabel:null,stall:null,retry:null,activeTurnStartedAt:null,totalTurnCount:null,pendingModelSelection:null,scheduledWakes:qU},WU={inputs:null,structure:{rowIds:[],sections:[]},indexById:new Map,rows:[],meta:{status:VU,usageByTurnId:KU,exportApi:$U,finalAssistantMessageReceived:!1},version:0};function GU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function jU(e,t,n,o){let r=UU(n,e),a=QU(t.structure.rowIds,r.rows),s=a?t.indexById:new Map(r.rows.map((g,h)=>[g.id,h])),i=r.rows.map((g,h)=>{let v=a?t.rows[h]:t.rows[t.indexById.get(g.id)??-1],C=v!==void 0&&tw(v,g)?v:g;return C!==v&&o.add(g.id),C});if(!a)for(let g of t.indexById.keys())s.has(g)||o.add(g);let l=nw(i,r.turnGroups,t.structure.sections),d=a?t.structure.rowIds:i.map(g=>g.id),u=a&&GU(t.structure.sections,l)?t.structure:{rowIds:d,sections:l},p=e.derive.hasSettledAssistantMessage(e.timelineEntries,e.status.latestAssistantMessageId),f=t.meta.status===e.status&&t.meta.usageByTurnId===e.usageByTurnId&&t.meta.exportApi===e.exportApi&&t.meta.finalAssistantMessageReceived===p?t.meta:{status:e.status,usageByTurnId:e.usageByTurnId,exportApi:e.exportApi,finalAssistantMessageReceived:p},m=o.size>0||u!==t.structure||f!==t.meta;return{inputs:e,structure:u,indexById:s,rows:i,meta:f,version:m?t.version+1:t.version}}function QU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n].id)return!1;return!0}function gl(e){return e.getStructure().rowIds.some(t=>e.getRow(t)?.kind==="message")}function rw(){let e=null,t=null,n=WU,o=new Set,r=0,a=new Set,s=new Map,i=()=>{if(e===null||n.inputs===e)return n;t??=e.derive.createRowsCache();let l=new Set;n=jU(e,n,t,l);for(let d of l)o.add(d);return n};return{setInputs(l){e=l},hasInputs:()=>e!==null,flush(){if(a.size===0&&s.size===0||e===null)return;let{version:l}=i();if(l===r&&o.size===0)return;r=l;let d=[...o];o.clear();for(let u of d){let p=s.get(u);if(p!==void 0)for(let f of Array.from(p))f()}for(let u of Array.from(a))u()},subscribe(l){return a.add(l),()=>{a.delete(l)}},subscribeRow(l,d){let u=s.get(l);return u===void 0&&(u=new Set,s.set(l,u)),u.add(d),()=>{u.delete(d),u.size===0&&s.get(l)===u&&s.delete(l)}},getStructure:()=>i().structure,getRow(l){let{indexById:d,rows:u}=i(),p=d.get(l);return p===void 0?void 0:u[p]},getRows:()=>i().rows,getMeta:()=>i().meta,getVersion:()=>i().version}}W();function Yp(e){return Ao(e.subscribe,e.getStructure,e.getStructure)}function aw(e,t){let n=M(r=>e.subscribeRow(t,r),[e,t]),o=M(()=>e.getRow(t),[e,t]);return Ao(n,o,o)}function Pn(e,t,n=Object.is){let o=N(null),r=M(()=>{let a=e.getVersion(),s=o.current;if(s!==null&&s.store===e&&s.select===t&&s.version===a)return s.value;let i=t(e),l=s!==null&&s.store===e&&n(s.value,i)?s.value:i;return o.current={store:e,select:t,version:a,value:l},l},[e,t,n]);return Ao(e.subscribe,r,r)}W();W();function sw(e,t){return e.getFullYear()!==new Date(t).getFullYear()}function Qh(e,t){return{month:e,day:"numeric",...t?{year:"numeric"}:{}}}function iw(e){let t=new Intl.DateTimeFormat(e,Qh("numeric",!1)),n=new Intl.DateTimeFormat(e,Qh("numeric",!0)),o=(r,a)=>(sw(r,a)?n:t).format(r);return{ofDate:o,ofIso:(r,a)=>{let s=new Date(r);return Number.isNaN(s.getTime())?"":o(s,a)}}}function lw(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?null:{date:n,formatParams:{date:Qh("short",sw(n,t))}}}function cw(e,t){let n={hour:"numeric",minute:"2-digit",...t?{second:"2-digit"}:{}};return e==="locale"?n:{...n,hour12:e==="12-hour"}}function YU(e){let t=e?.trim();if(t)try{return Intl.DateTimeFormat.supportedLocalesOf([t]),t}catch{return}}function XU(){return typeof window>"u"?null:window.desktopBridge?.getSystemLocale?.()??null}var uw=YU(XU()),dw=new Map;function pw(e,t){let n=`${e}:${t?"seconds":"minutes"}`,o=dw.get(n);if(o)return o;let r=new Intl.DateTimeFormat(uw,cw(e,t));return dw.set(n,r),r}function Yh(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Ur(e,t,n){let o=Yh(e);return o?n("timeline.timestampTooltip",{date:o,formatParams:{date:{...cw(t,!1),...t==="locale"?{hourCycle:pw(t,!1).resolvedOptions().hourCycle}:{},year:"numeric",month:"long",day:"numeric"}}}):""}var fw=iw(uw);function ca(e,t,n,o=Date.now()){let r=Yh(e);if(!r)return"";let a=pw(t,!1).format(r),s=new Date(o),i=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),d=Math.round((i-l)/864e5);return d<=0?a:d===1?n("relativeTime.yesterdayAt",{time:a}):`${fw.ofDate(r,o)} ${a}`}function mw(e,t=Date.now()){return fw.ofIso(e,t)}function gw(e){let t=Yh(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:""}W();var gt=ut(null),Xp=ut(null);W();var hl=new Map,hw=24,JU=4e3,ZU=1024,vw=16384;function Xh(e){let t=hl.get(e);if(t)return t;let n={values:new Map,listeners:new Set,stringLength:0};if(hl.set(e,n),hl.size>hw){for(let[o,r]of hl)if(r.listeners.size===0&&o!==e&&(hl.delete(o),hl.size<=hw))break}return n}function Jh(e,t,n){return Xh(e).values.get(t)??n}function Ac(e,t,n,o=!0){let r=Xh(e);if(typeof n=="string"&&(n=n.slice(0,ZU)),r.values.get(t)===n)return;let a=r.values.get(t);if(typeof a=="string"&&(r.stringLength-=a.length),r.values.delete(t),r.values.set(t,n),typeof n=="string"&&(r.stringLength+=n.length),r.stringLength>vw){for(let[s,i]of r.values)if(!(typeof i!="string"||s===t)&&(r.values.delete(s),r.stringLength-=i.length,r.stringLength<=vw))break}if(r.values.size>JU){let s=r.values.keys().next().value;if(s!==void 0){let i=r.values.get(s);typeof i=="string"&&(r.stringLength-=i.length),r.values.delete(s)}}o&&r.listeners.forEach(s=>s())}function kn(e,t,n){let o=M(i=>{let l=Xh(e);return l.listeners.add(i),()=>l.listeners.delete(i)},[e]),r=M(()=>Jh(e,t,n),[e,t,n]),a=Ao(o,r,r),s=M(i=>Ac(e,t,i),[e,t]);return[a,s]}function Ye(){let e=pn().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var yw=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api"];if(!yw)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{COMMUNICATION_RECORDS_READ_LIMIT:Gre,MAX_PLUGIN_SESSION_PROJECTION_BYTES:jre,MAX_PLUGIN_SKILL_COMPANION_FILE_BYTES:Qre,MAX_PLUGIN_SKILL_COMPANION_TOTAL_BYTES:Yre,MAX_PLUGIN_STREAM_BUFFER:Xre,MAX_PLUGIN_TOOL_PRESENTATION_BYTES:Jre,MAX_PLUGIN_WORKSPACE_WRITE_BYTES:Zre,MIN_PLUGIN_INTERVAL_MS:eae,PLUGIN_API_MIN_VERSION:tae,PLUGIN_API_VERSION:nae,PLUGIN_PROXY_DIRECT:oae,REASONING_OPTION_LABEL:rae,REQUEST_RESOLVED_TRIGGER_KIND:aae,THREAD_ACTIVITIES_LIST_LIMIT:sae,THREAD_MESSAGES_LIST_LIMIT:iae,TOOL_LIFECYCLE_ACTIVITY_KINDS:lae,TURN_PROGRESS_TRIGGER_KIND:dae,USER_INPUT_PENDING_TRIGGER_KIND:cae,acceptPluginToolPresentation:uae,definePlugin:pae,effortText:Cw,isThreadNotFound:fae,knownEffortLevel:mae,mergeLaunchEnv:gae,modelOptionLabelKind:xw,modelSelectionStringOption:hae,parseRetryAfterMs:vae,pluginJsonByteLength:yae,projectOrNull:Cae,readRequestResolved:xae,readThreadFailed:bae,readTurnProgress:Sae,readUserInputPending:Iae,reasoningEffortLevel:wae,reasoningEffortShortLabel:Tae,relabelModelOptionDescriptors:bw,threadMessagesNewestFirst:Pae,threadOrNull:kae}=yw;function Jp(e,t,n){if(e!=="opencode"||t.length===0)return!1;let o=n?.trim();return o?!t.some(r=>r.slug===o):!1}function Zp(e,t){if(e)return t?e:e.filter(n=>n.id!=="agent"||n.value!=="plan")}var Sw={effort:"traits.savedOption.effort",reasoningEffort:"traits.savedOption.reasoningEffort",variant:"traits.savedOption.variant"},Iw=e=>`traits.optionValue.${e}`;function e5(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function ww(e,t){if(t==="agent")return e("traits.savedOption.agent");let n=xw(t);return n===void 0?e5(t):e(Sw[n])}function Zh(e,t){return bw(t,{kind:n=>e(Sw[n]),level:n=>e(Iw(n))})}function ev(e,t){return Cw(t,n=>e(Iw(n)))}function Tw(e,t){return(e??[]).map(n=>typeof n.value=="boolean"?{id:n.id,label:t(n.id),type:"boolean",currentValue:n.value}:{id:n.id,label:t(n.id),type:"select",options:[{id:n.value,label:n.value}],currentValue:n.value})}function Pw(e){return e==="failed"?"failed":e==="running"?"running":"idle"}function kw(e){return e.includes("failed")?"failed":e.includes("running")?"running":"idle"}var ef="chat-process-row flex w-full min-w-0 select-none items-center gap-1.5 px-2 text-left";function Nc({children:e}){return c("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:e})}function _c({status:e}){return c("span",{"aria-hidden":!0,className:"flex size-2 shrink-0 items-center justify-center",children:e===null?null:c("span",{className:j("block size-2 rounded-full",e==="failed"?"bg-destructive":e==="success"?"bg-success":"border border-muted-foreground/60")})})}function tf({state:e,variant:t="inline",className:n,children:o}){return x("div",{"data-process-state":e,"data-process-kind":t,className:j("chat-process-shell relative min-w-0 overflow-hidden",t==="tool"?"rounded-lg bg-card":"rounded-md",n),children:[e==="running"?c("span",{"aria-hidden":!0,className:"chat-process-shell-pulse animate-status-pulse"}):null,o]})}W();W();var vl=class extends Error{reason;constructor(t,n,o){super(n,o),this.reason=t}};function t5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.fontSize="16px";let n=document.activeElement;document.body.appendChild(t);try{return t.focus({preventScroll:!0}),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{t.remove();let o=n?.focus;typeof o=="function"&&o.call(n)}}async function n5(e,t){let n=()=>new vl("unavailable",`Clipboard API is unavailable while copying ${t}.`);if(typeof window>"u")throw n();if(!e)return!1;if(typeof navigator>"u"||!navigator.clipboard?.writeText){if(t5(e))return!0;throw n()}try{return await navigator.clipboard.writeText(e),!0}catch(o){throw new vl("write-failed",`Failed to copy ${t} to the clipboard.`,{cause:o})}}function nf({timeout:e=2e3,target:t="text",onCopy:n,onError:o}={}){let[r,a]=G(!1),s=N(null),i=N(n),l=N(o),d=N(t),u=N(e);i.current=n,l.current=o,d.current=t,u.current=e;let p=M((f,m)=>{n5(f,d.current).then(g=>{g&&(s.current&&clearTimeout(s.current),a(!0),i.current?.(m),u.current!==0&&(s.current=setTimeout(()=>{a(!1),s.current=null},u.current)))},g=>{l.current?.(g instanceof Error?g:new Error(String(g)),m)})},[]);return $(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:r}}var Lw=1e3,o5={unavailable:"copyButton.clipboardUnavailable","write-failed":"copyButton.copyFailedDetail"},os=le(function({text:t,size:n="xs",variant:o="outline",className:r,toastAnchor:a="above",label:s}){let{t:i}=Ye(),l=s??i("copyButton.copyToClipboard"),[d,u]=G(!1),[p,f]=G(null),m=N(null),g=(C,y)=>{m.current&&clearTimeout(m.current),f({title:C,description:y}),m.current=setTimeout(()=>{f(null),u(!1)},Lw)};$(()=>()=>{m.current&&clearTimeout(m.current)},[]);let{copyToClipboard:h,isCopied:v}=nf({onCopy:()=>g(i("copyButton.copied")),onError:C=>g(i("copyButton.failedToCopy"),C instanceof vl?i(o5[C.reason]):C.message),timeout:Lw});return x(Me,{open:p!==null||d,onOpenChange:u,children:[c(Ne,{render:c(J,{"aria-label":l,softDisabled:v,onClick:()=>h(t),type:"button",size:n,variant:o,className:j("text-muted-foreground hover:text-foreground",r)}),children:v?c(Dn,{className:"size-3 text-primary"}):c(zs,{className:"size-3"})}),x(Ae,{side:a==="above"?"top":"bottom",className:"max-w-72",role:p?"status":void 0,children:[c("span",{children:p?.title??l}),p?.description?c("span",{className:"block text-muted-foreground",children:p.description}):null]})]})});function of({text:e,label:t,children:n}){return x("span",{className:"group/hover-copy inline-flex min-w-0 items-center gap-0.5",children:[n,c("span",{className:"inline-flex opacity-0 transition-opacity duration-(--control-duration) pointer-events-none group-focus-within/hover-copy:pointer-events-auto group-focus-within/hover-copy:opacity-100 group-hover/hover-copy:pointer-events-auto group-hover/hover-copy:opacity-100 [@media(pointer:coarse)]:pointer-events-auto [@media(pointer:coarse)]:opacity-100",children:c(os,{text:e,label:t,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"})})]})}W();var r5=[".m4v",".mov",".mp4",".ogv",".webm"],a5=[".aac",".flac",".m4a",".mp3",".oga",".ogg",".opus",".wav",".weba"];function Rw(e){let t=e.name.lastIndexOf(".");if(t<=0)return null;let n=e.name.slice(t).toLowerCase();return r5.includes(n)?"video":a5.includes(n)?"audio":null}var s5=["image/gif","image/jpeg","image/png","image/webp"],i5=new Set(s5);function l5(e){return i5.has(e.toLowerCase())}function d5(e){return l5(e)?"image":"file"}var c5=new Set(["application/json","application/xml","application/x-yaml","application/yaml"]),u5=[".doc",".docx",".odt",".ppt",".pptx",".odp",".xls",".xlsx",".ods"];function Kr(e){if(e.type==="image")return"image";let t=e.mimeType.toLowerCase();if(t==="image/svg+xml")return"svg";if(t==="application/pdf")return"pdf";let n=Rw(e);if(n)return n;let o=e.name.lastIndexOf(".");return o>0&&u5.includes(e.name.slice(o).toLowerCase())?"office":t.startsWith("text/")||c5.has(t)?"text":"file"}function ua(e){let t=Kr(e);return t==="image"||t==="svg"}function yl(e){return!Number.isFinite(e)||e<=0?"0 KB":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function tv(e){let t={id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes};return d5(e.mimeType)==="image"?{type:"image",...t}:{type:"file",...t,...e.source?{source:e.source}:{}}}function rf(e,t){let n=e.flatMap(r=>r.previewUrl?[{...r,src:r.previewUrl}]:[]);if(n.length===0)return null;let o=n.findIndex(r=>r.id===t);return o<0?null:{images:n.map(r=>({src:r.src,name:r.name,attachmentId:r.id,...r.source===void 0?{}:{source:r.source},...r.type!==void 0&&r.mimeType!==void 0&&Kr({type:r.type,mimeType:r.mimeType,name:r.name})==="svg"?{svg:!0}:{}})),index:o}}function af(e){switch(e){case"image":case"svg":return lc;case"video":return qa;case"audio":return cr;case"pdf":return Zd;case"office":return ec;case"text":return Jd;case"file":return _o}}function jo(e){return e.source?._tag==="agent-artifact"?e.source:void 0}function nv({rowId:e,messageId:t,attachments:n}){let o=Ge(gt),[r,a]=kn(o.threadKey,`attachments:${t}`,!1),{t:s}=Ye(),i=n.toSorted((d,u)=>+(jo(u)?.delivered===!0)-+(jo(d)?.delivered===!0)),l=r?i:i.slice(0,4);return n.length===0?null:x("div",{className:"mb-2 max-w-[420px]","data-assistant-attachments":"",children:[c("div",{className:"grid grid-cols-2 items-start gap-2",children:l.map(d=>c("div",{className:"min-w-0",children:ua(d)?c(Dc,{images:[d],gallery:i.filter(ua)}):c(Oc,{attachment:d})},d.id))}),!r&&i.length>4?c(J,{variant:"ghost",size:"xs",className:"mt-1","aria-expanded":!1,onClick:()=>{o.onProcessDisclosureChange?.(e),a(!0)},children:s("attachments.showMore")}):null]})}function Dc({images:e,gallery:t}){let n=Ge(gt),{t:o}=Ye();return e.length===0?null:c("div",{className:t?"grid":"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:e.map(r=>x("div",{className:"overflow-hidden rounded-lg border border-border/80 bg-background/70",children:[r.previewUrl?c("button",{type:"button",className:"w-full cursor-zoom-in","data-attachment-action":"preview","data-attachment-name":r.name,"aria-label":o("attachments.preview",{name:r.name}),onClick:()=>{let a=rf(t??e,r.id);a&&n.onImageExpand(a)},children:c("img",{src:r.previewUrl,alt:r.name,loading:"lazy",decoding:"async",className:Kr(r)==="svg"?"block h-auto max-h-[220px] w-full bg-white object-contain":"block h-auto max-h-[220px] w-full object-cover object-top"})}):c("div",{className:"flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-secondary-label text-chat-dense",children:r.name}),jo(r)?.delivered||jo(r)?.title||jo(r)?.note?x("div",{className:"px-2 py-1 text-chat-meta",children:[c("p",{className:"break-words font-medium",children:jo(r)?.title||r.name}),jo(r)?.note?c("p",{className:"whitespace-pre-wrap break-words text-secondary-label",children:jo(r)?.note}):null]}):null]},r.id))})}function Oc(e){let{t}=Ye(),n=Ge(gt).onAttachmentDocumentOpen,o=Kr(e.attachment),r=af(o),a=t("attachments.open",{name:e.attachment.name}),s=x(ge,{children:[c(r,{className:"size-4 shrink-0 text-secondary-label"}),x("span",{className:"min-w-0 flex-1",children:[c("span",{className:"block truncate font-medium text-foreground text-chat-row",children:jo(e.attachment)?.title||e.attachment.name}),jo(e.attachment)?.note?c("span",{className:"block whitespace-pre-wrap break-words text-secondary-label text-chat-meta",children:jo(e.attachment)?.note}):null,c("span",{className:"block text-secondary-label text-chat-meta",children:yl(e.attachment.sizeBytes)})]})]});return!jo(e.attachment)?.delivered&&e.attachment.previewUrl&&(o==="video"||o==="audio")?x("div",{className:"flex max-w-sm flex-col gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:[c("a",{href:e.attachment.previewUrl,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 hover:underline",children:s}),c(wI,{kind:o,src:e.attachment.previewUrl,title:e.attachment.name})]}):n?c("button",{type:"button","data-attachment-action":"open","data-attachment-name":e.attachment.name,"aria-label":a,onClick:()=>n({attachmentId:e.attachment.id,name:e.attachment.name,mimeType:e.attachment.mimeType}),className:"flex w-full cursor-pointer items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 text-start hover:bg-background/90",children:s}):e.attachment.previewUrl?c("a",{href:e.attachment.previewUrl,download:e.attachment.name,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 hover:bg-background/90",children:s}):c("div",{className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:s})}W();W();var Fc=e=>e;function $r(){return pn().useThreadDisplayTitle?.()??Fc}W();var Ew=ut(null);function Mw({data:e,target:t,children:n}){let o=K(()=>({data:e,target:t}),[e,t]);return c(Ew,{value:o,children:n})}function sf(){return Ge(Ew)}function Aw({messageId:e}){let t=sf(),n=t?.data.useMessageForks;return!t||!n?null:c(p5,{read:n,target:t.target,messageId:e})}function p5({read:e,target:t,messageId:n}){let{t:o}=it(),r=$r(),[a,s]=G(!1),{threads:i,openThread:l}=e(t,n);return i.length===0?null:x(po,{open:a,onOpenChange:s,children:[c(mo,{render:c(J,{variant:"ghost",size:"xs"}),children:o("forkRelations.count",{count:i.length})}),c(fo,{"aria-label":o("forkRelations.listTitle"),className:"max-h-72 max-w-80 overflow-y-auto p-1",children:i.map(d=>x(J,{variant:"ghost",className:"h-auto w-full flex-col items-start gap-0.5 py-2",onClick:()=>{s(!1),l(d.threadId)},children:[c("span",{className:"max-w-full truncate",children:r(d.title)}),c("time",{className:"text-chat-dense text-muted-foreground",dateTime:d.createdAt,children:new Date(d.createdAt).toLocaleString()})]},d.threadId))})]})}W();function Nw({messageId:e,rowId:t}){let n=sf(),o=n?.data.useMessageMemory,r=n?.data.useMemoryExperience;return!n||!o||!r?null:c(f5,{readMemory:o,readExperience:r,target:n.target,messageId:e,rowId:t})}function f5({readMemory:e,readExperience:t,target:n,messageId:o,rowId:r}){let a=e(n,o);return a===null?null:c(m5,{experienceIds:a.experienceIds,readExperience:t,target:n,messageId:o,rowId:r})}function m5({experienceIds:e,readExperience:t,target:n,messageId:o,rowId:r}){let{t:a}=it(),s=Ge(gt),[i,l]=kn(s.threadKey,`memory-context:${o}`,!1),d=un();return x("div",{className:"flex min-w-0 flex-col items-start gap-1.5 self-stretch","data-memory-context":"",children:[x(J,{variant:"ghost-muted",size:"xs",className:"-ms-1 gap-1.5 [&_svg]:mx-0","aria-expanded":i,"aria-controls":i?d:void 0,onClick:()=>{s.onProcessDisclosureChange?.(r),l(!i)},children:[c(qt,{"aria-hidden":!0,className:j("size-icon-1",!i&&"-rotate-90")}),c(Gd,{"aria-hidden":!0,className:"size-icon-1"}),a("memoryContext.included",{count:e.length})]}),i?c("ul",{id:d,className:"m-0 w-full max-w-xl list-none divide-y divide-border overflow-hidden rounded-xl border border-border bg-card p-0",children:e.map(u=>c(g5,{readExperience:t,target:n,experienceId:u},u))}):null]})}function g5({readExperience:e,target:t,experienceId:n}){let o=e(t,n);return x("li",{className:"flex min-w-0 items-center gap-2.5 py-2 ps-3 pe-2","data-memory-experience-state":o.state,children:[c(h5,{experience:o}),c(v5,{experience:o})]})}function h5({experience:e}){let{t}=it();switch(e.state){case"loading":return x("div",{className:"min-w-0 flex-1","aria-busy":"true",children:[c("span",{className:"sr-only",children:t("memoryContext.loading")}),c(Kh,{className:"h-4 w-3/4"}),c(Kh,{className:"mt-1 h-3 w-1/2"})]});case"failed":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.loadFailed")});case"erased":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.erased")});case"active":case"forgotten":{let n=e.state==="forgotten",o=e.recordedAt===null?null:lw(e.recordedAt,Date.now());return x("div",{className:"min-w-0 flex-1",children:[c("p",{className:j("m-0 line-clamp-2 text-ui-sm",e.title===null?"text-muted-foreground":"font-medium",n&&"text-muted-foreground line-through"),children:e.title??t("memoryContext.textUnavailable")}),o===null?null:c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.recordedBy",{author:e.authorLabel??"",...o})}),n?c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.forgottenNote")}):null]})}}}function v5({experience:e}){let{t}=it();switch(e.state){case"loading":case"erased":return null;case"failed":return c(J,{variant:"ghost",size:"xs",onClick:e.retry,children:t("memoryContext.retry")});case"active":case"forgotten":{let n=e.state==="forgotten";return x("div",{className:"flex shrink-0 items-center gap-1.5",children:[n?c(Go,{variant:"muted",size:"sm",children:t("memoryContext.forgotten")}):null,x(J,{variant:"ghost",size:"xs",disabled:e.pending,softDisabled:e.blockedReason!==null,title:e.blockedReason??void 0,onClick:n?e.restore:e.forget,children:[e.pending?c(Hr,{}):null,t(n?"memoryContext.restore":"memoryContext.forget")]})]})}}}W();var y5=()=>null;function lf(e){let t=(e.useMachineLabel??y5)(e.reference.environmentId),n=$r();return x(ge,{children:[c("div",{className:"wrap-anywhere",children:n(e.reference.title)}),t===null?null:c("div",{className:"text-muted-foreground",children:t})]})}var C5=Object.freeze([]),x5=()=>C5;function _w(e){return e.type==="file"&&e.source?._tag==="thread-reference"}function b5(e){return e.omitted===null?e.carried:x(ge,{children:[c("span",{className:"inline-block max-w-full",children:e.carried})," ",c("span",{className:"inline-block max-w-full",children:e.omitted})]})}function Dw(e){let t=Ge(gt),{t:n}=Ye(),r=(t.threadReferences?.useDeliveries??x5)(t.activeThreadEnvironmentId,e).filter(a=>a.status!=="unreadable");return r.length===0?null:c("ul",{"aria-label":n("threadReference.listLabel"),className:"flex min-w-0 max-w-[min(70%,40rem)] flex-col gap-0.5 text-chat-dense text-muted-foreground",children:r.map(a=>c(S5,{delivery:a},`${a.reference.environmentId}:${a.reference.threadId}`))})}function S5(e){let{delivery:t}=e,n=Ge(gt),{t:o}=Ye(),r=$r(),a=s=>{let i={reference:t.reference};s.dispatchEvent(new CustomEvent(Ji,{bubbles:!0,detail:i}))};return c("li",{"data-thread-reference-delivery":t.status,className:"flex min-w-0",children:x(Me,{children:[x(Ne,{render:c("button",{type:"button",className:"relative flex min-w-0 flex-1 cursor-[var(--control-cursor)] items-start gap-1 rounded-sm text-left hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",onClick:s=>a(s.currentTarget)}),children:[c("span",{className:"flex h-lh shrink-0 items-center",children:c(ia,{"aria-hidden":"true",className:"size-3.5"})}),x("span",{className:"flex min-w-0 flex-1 flex-wrap gap-x-1",children:[c("span",{className:"max-w-max min-w-0 grow basis-24 truncate",children:o("threadReference.title",{title:r(t.reference.title)})}),c("span",{className:"max-w-full",children:t.status==="carried"?c(b5,{carried:o("threadReference.carried",{count:t.carriedMessages}),omitted:t.omittedMessages>0?o("threadReference.omitted",{count:t.omittedMessages}):null}):t.status==="missing"?o("threadReference.missing"):o("threadReference.loading")})]})]}),c(Ae,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(lf,{reference:t.reference,useMachineLabel:n.threadReferences?.useMachineLabel})})]})})}W();function I5(e){let t=e.match(/:(\d+)$/);if(!t?.[1])return{path:e,line:void 0,column:void 0};let n=e.slice(0,-t[0].length),o=n.match(/:(\d+)$/);return o?.[1]?{path:n.slice(0,-o[0].length),line:o[1],column:t[1]}:{path:n,line:t[1],column:void 0}}function ov(e){return e.replaceAll("\\","/")}function rv(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function w5(e){return rv(ov(e.replace(/[\\/]+$/,"")))}function T5(e){return e.slice(e.lastIndexOf("/")+1)}function P5(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function k5(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(rv(ov(e)))}function df(e,t){let{path:n,line:o,column:r}=I5(e),a=rv(ov(n)),s=a;if(t){let i=w5(t),l=T5(i),d=k5(t)?f=>f.toLowerCase():f=>f,u=d(a),p=d(i);if(u===p)s=l;else if(u.startsWith(`${p}/`))s=`${l}/${a.slice(i.length+1)}`;else if(!P5(a)){let f=a.replace(/^\.\/+/,"").replace(/^\/+/,"");s=u.startsWith(`${d(l)}/`)?a:`${l}/${f}`}}return o?`${s}:${o}${r?`:${r}`:""}`:s}var L5=/<review_comment\b([^>]*)>\s*([\s\S]*?)<\/review_comment>/g,R5=/([a-zA-Z][a-zA-Z0-9_-]*)="([^"]*)"/g,E5=/(`{3,})([^\s`]*)[^\n]*\n([\s\S]*?)\n\1/g;function M5(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function A5(e){let t={};for(let n of e.matchAll(R5))t[n[1]]=M5(n[2]??"");return t}function Ow(e){return e===void 0||!/^\d+$/.test(e)?null:Number(e)}function N5(e){let n=Array.from(e.matchAll(E5)).at(-1),o=n?.index;return{text:e.slice(0,o??e.length).trim(),language:n?.[2]?.trim()||"diff",contents:n?.[3]??""}}function _5(e,t,n){let o=A5(e),r=Ow(o.startIndex),a=Ow(o.endIndex),s=o.filePath?.trim(),i=o.sectionId?.trim();if(!s||!i||r===null||a===null)return null;let l=N5(t);return{id:`review-comment:${n}:${i}:${s}:${r}:${a}`,sectionId:i,sectionTitle:o.sectionTitle?.trim()||null,filePath:s,startIndex:Math.min(r,a),endIndex:Math.max(r,a),rangeLabel:o.rangeLabel?.trim()||null,text:l.text,diff:l.contents,fenceLanguage:l.language}}function cf(e){let t=[],n=0,o=0;for(let a of e.matchAll(L5)){let s=a.index??0,i=e.slice(n,s);i.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:i});let l=_5(a[1]??"",a[2]??"",o);l?(t.push({kind:"review-comment",comment:l}),o+=1):t.push({kind:"text",id:`review-comment-invalid:${s}`,text:a[0]}),n=s+a[0].length}let r=e.slice(n);return r.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:r}),t}function Fw(e,t){let n=Math.max(0,...Array.from(t.matchAll(/`+/g),r=>r[0].length)),o="`".repeat(Math.max(3,n+1));return[`${o}${e}`,t.trimEnd(),o].join(`
|
|
3761
|
+
`;W();W();var wS=ut(null),zd=wS.Provider,TS=ut(""),Ah=TS.Provider;function hp(){return Nt(TS)}function pn(){let e=Nt(wS);if(e===null)throw new Error("Conversation UI has not been registered.");return e}var vp="ycodium:assistant-quote-open",Ji="ycodium:thread-reference-open";var yp="conversation",Nh="conversation.prompt-preview";var Cp="__ycodiumConversationBridge",_h="ycodium.conversation.rebindable-bridge.v1";var Hd=17,PS=`ycodium.conversation.host-data.v${Hd}`,aa="\uFFFC";W();function kS(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=kS(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function LS(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=kS(e))&&(o&&(o+=" "),o+=t);return o}var RS=LS;var fz=(e,t)=>{let n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},mz=(e,t)=>({classGroupId:e,validator:t}),FS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n});var ES=[],gz="arbitrary..",hz=e=>{let t=yz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return vz(s);let i=s.split("-"),l=i[0]===""&&i.length>1?1:0;return BS(i,l,t)},getConflictingClassGroupIds:(s,i)=>{if(i){let l=o[s],d=n[s];return l?d?fz(d,l):l:d||ES}return n[s]||ES}}},BS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let d=BS(e,t+1,a);if(d)return d}let s=n.validators;if(s===null)return;let i=t===0?e.join("-"):e.slice(t).join("-"),l=s.length;for(let d=0;d<l;d++){let u=s[d];if(u.validator(i))return u.classGroupId}},vz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?gz+o:void 0})(),yz=e=>{let{theme:t,classGroups:n}=e;return Cz(n,t)},Cz=(e,t)=>{let n=FS();for(let o in e){let r=e[o];Fh(r,n,o,t)}return n},Fh=(e,t,n,o)=>{let r=e.length;for(let a=0;a<r;a++){let s=e[a];xz(s,t,n,o)}},xz=(e,t,n,o)=>{if(typeof e=="string"){bz(e,t,n);return}if(typeof e=="function"){Sz(e,t,n,o);return}Iz(e,t,n,o)},bz=(e,t,n)=>{let o=e===""?t:zS(t,e);o.classGroupId=n},Sz=(e,t,n,o)=>{if(wz(e)){Fh(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(mz(n,e))},Iz=(e,t,n,o)=>{let r=Object.entries(e),a=r.length;for(let s=0;s<a;s++){let[i,l]=r[s];Fh(l,zS(t,i),n,o)}},zS=(e,t)=>{let n=e,o=t.split("-"),r=o.length;for(let a=0;a<r;a++){let s=o[a],i=n.nextPart.get(s);i||(i=FS(),n.nextPart.set(s,i)),n=i}return n},wz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Tz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null),r=(a,s)=>{n[a]=s,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=o[a])!==void 0)return r(a,s),s},set(a,s){a in n?n[a]=s:r(a,s)}}};var Pz=[],MS=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),kz=e=>{let{prefix:t,experimentalParseClassName:n}=e,o=r=>{let a=[],s=0,i=0,l=0,d,u=r.length;for(let h=0;h<u;h++){let v=r[h];if(s===0&&i===0){if(v===":"){a.push(r.slice(l,h)),l=h+1;continue}if(v==="/"){d=h;continue}}v==="["?s++:v==="]"?s--:v==="("?i++:v===")"&&i--}let p=a.length===0?r:r.slice(l),f=p,m=!1;p.endsWith("!")?(f=p.slice(0,-1),m=!0):p.startsWith("!")&&(f=p.slice(1),m=!0);let g=d&&d>l?d-l:void 0;return MS(a,m,f,g)};if(t){let r=t+":",a=o;o=s=>s.startsWith(r)?a(s.slice(r.length)):MS(Pz,!1,s,void 0,!0)}if(n){let r=o;o=a=>n({className:a,parseClassName:r})}return o},Lz=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{let o=[],r=[];for(let a=0;a<n.length;a++){let s=n[a],i=s[0]==="[",l=t.has(s);i||l?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(s)):r.push(s)}return r.length>0&&(r.sort(),o.push(...r)),o}},Rz=e=>({cache:Tz(e.cacheSize),parseClassName:kz(e),sortModifiers:Lz(e),postfixLookupClassGroupIds:Ez(e),...hz(e)}),Ez=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let o=0;o<n.length;o++)t[n[o]]=!0;return t},Mz=/\s+/,Az=(e,t)=>{let{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a,postfixLookupClassGroupIds:s}=t,i=[],l=e.trim().split(Mz),d="";for(let u=l.length-1;u>=0;u-=1){let p=l[u],{isExternal:f,modifiers:m,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}=n(p);if(f){d=p+(d.length>0?" "+d:d);continue}let C=!!v,y;if(C){let k=h.substring(0,v);y=o(k);let P=y&&s[y]?o(h):void 0;P&&P!==y&&(y=P,C=!1)}else y=o(h);if(!y){if(!C){d=p+(d.length>0?" "+d:d);continue}if(y=o(h),!y){d=p+(d.length>0?" "+d:d);continue}C=!1}let b=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=g?b+"!":b,S=w+y;if(i.indexOf(S)>-1)continue;i.push(S);let I=r(y,C);for(let k=0;k<I.length;++k){let P=I[k];i.push(w+P)}d=p+(d.length>0?" "+d:d)}return d},Nz=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=HS(n))&&(r&&(r+=" "),r+=o);return r},HS=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=HS(e[o]))&&(n&&(n+=" "),n+=t);return n},AS=(e,...t)=>{let n,o,r,a,s=l=>{let d=t.reduce((u,p)=>p(u),e());return n=Rz(d),o=n.cache.get,r=n.cache.set,a=i,i(l)},i=l=>{let d=o(l);if(d)return d;let u=Az(l,n);return r(l,u),u};return a=s,(...l)=>a(Nz(...l))},_z=[],yn=e=>{let t=n=>n[e]||_z;return t.isThemeGetter=!0,t},US=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ka=e=>Dz.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),Fr=e=>!!e&&Number.isInteger(Number(e)),Dh=e=>e.endsWith("%")&&mt(e.slice(0,-1)),sa=e=>Oz.test(e),$S=()=>!0,Uz=e=>Fz.test(e)&&!Bz.test(e),Bh=()=>!1,Kz=e=>zz.test(e),$z=e=>Hz.test(e),qz=e=>!Be(e)&&!ze(e),Vz=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Wz=e=>$a(e,WS,Bh),Be=e=>US.test(e),_s=e=>$a(e,GS,Uz),NS=e=>$a(e,eH,mt),Gz=e=>$a(e,QS,$S),jz=e=>$a(e,jS,Bh),_S=e=>$a(e,qS,Bh),Qz=e=>$a(e,VS,$z),xp=e=>$a(e,YS,Kz),ze=e=>KS.test(e),Ud=e=>Ds(e,GS),Yz=e=>Ds(e,jS),DS=e=>Ds(e,qS),Xz=e=>Ds(e,WS),Jz=e=>Ds(e,VS),bp=e=>Ds(e,YS,!0),Zz=e=>Ds(e,QS,!0),$a=(e,t,n)=>{let o=US.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},Ds=(e,t,n=!1)=>{let o=KS.exec(e);return o?o[1]?t(o[1]):n:!1},qS=e=>e==="position"||e==="percentage",VS=e=>e==="image"||e==="url",WS=e=>e==="length"||e==="size"||e==="bg-size",GS=e=>e==="length",eH=e=>e==="number",jS=e=>e==="family-name",QS=e=>e==="number"||e==="weight",YS=e=>e==="shadow";var OS=()=>{let e=yn("color"),t=yn("font"),n=yn("text"),o=yn("font-weight"),r=yn("tracking"),a=yn("leading"),s=yn("breakpoint"),i=yn("container"),l=yn("spacing"),d=yn("radius"),u=yn("shadow"),p=yn("inset-shadow"),f=yn("text-shadow"),m=yn("drop-shadow"),g=yn("blur"),h=yn("perspective"),v=yn("aspect"),C=yn("ease"),y=yn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),ze,Be],I=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],P=()=>[ze,Be,l],T=()=>[Ka,"full","auto",...P()],L=()=>[Fr,"none","subgrid",ze,Be],E=()=>["auto",{span:["full",Fr,ze,Be]},Fr,ze,Be],A=()=>[Fr,"auto",ze,Be],R=()=>["auto","min","max","fr",ze,Be],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...P()],_=()=>[Ka,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],Q=()=>[Ka,"screen","full","dvw","lvw","svw","min","max","fit",...P()],D=()=>[Ka,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],O=()=>[e,ze,Be],re=()=>[...w(),DS,_S,{position:[ze,Be]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",Xz,Wz,{size:[ze,Be]}],X=()=>[Dh,Ud,_s],q=()=>["","none","full",d,ze,Be],V=()=>["",mt,Ud,_s],Z=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[mt,Dh,DS,_S],oe=()=>["","none",g,ze,Be],se=()=>["none",mt,ze,Be],Ce=()=>["none",mt,ze,Be],xe=()=>[mt,ze,Be],Le=()=>[Ka,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sa],breakpoint:[sa],color:[$S],container:[sa],"drop-shadow":[sa],ease:["in","out","in-out"],font:[qz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sa],shadow:[sa],spacing:["px",mt],text:[sa],"text-shadow":[sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ka,Be,ze,v]}],container:["container"],"container-type":[{"@container":["","normal","size",ze,Be]}],"container-named":[Vz],columns:[{columns:[mt,Be,ze,i]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Fr,"auto",ze,Be]}],basis:[{basis:[Ka,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,Ka,"auto","initial","none",Be]}],grow:[{grow:["",mt,ze,Be]}],shrink:[{shrink:["",mt,ze,Be]}],order:[{order:[Fr,"first","last","none",ze,Be]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[i,"screen",..._()]}],"min-w":[{"min-w":[i,"screen","none",..._()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",n,Ud,_s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Zz,Gz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dh,Be]}],"font-family":[{font:[Yz,jz,t]}],"font-features":[{"font-features":[Be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ze,Be]}],"line-clamp":[{"line-clamp":[mt,"none",ze,NS]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",ze,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",ze,_s]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[mt,"auto",ze,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Fr,ze,Be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fr,ze,Be],radial:["",ze,Be],conic:[Fr,ze,Be]},Jz,Qz]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,ze,Be]}],"outline-w":[{outline:["",mt,Ud,_s]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,bp,xp]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",p,bp,xp]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[mt,_s]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,bp,xp]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[mt,ze,Be]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[ze,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ze,Be]}],filter:[{filter:["","none",ze,Be]}],blur:[{blur:oe()}],brightness:[{brightness:[mt,ze,Be]}],contrast:[{contrast:[mt,ze,Be]}],"drop-shadow":[{"drop-shadow":["","none",m,bp,xp]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",mt,ze,Be]}],"hue-rotate":[{"hue-rotate":[mt,ze,Be]}],invert:[{invert:["",mt,ze,Be]}],saturate:[{saturate:[mt,ze,Be]}],sepia:[{sepia:["",mt,ze,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Be]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[mt,ze,Be]}],"backdrop-contrast":[{"backdrop-contrast":[mt,ze,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,ze,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,ze,Be]}],"backdrop-invert":[{"backdrop-invert":["",mt,ze,Be]}],"backdrop-opacity":[{"backdrop-opacity":[mt,ze,Be]}],"backdrop-saturate":[{"backdrop-saturate":[mt,ze,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,ze,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",ze,Be]}],ease:[{ease:["linear","initial",C,ze,Be]}],delay:[{delay:[mt,ze,Be]}],animate:[{animate:["none",y,ze,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ze,Be]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[ze,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[Fr,ze,Be]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze,Be]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[mt,Ud,_s,NS]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tH=(e,{cacheSize:t,prefix:n,experimentalParseClassName:o,extend:r={},override:a={}})=>(Zi(e,"cacheSize",t),Zi(e,"prefix",n),Zi(e,"experimentalParseClassName",o),Sp(e.theme,a.theme),Sp(e.classGroups,a.classGroups),Sp(e.conflictingClassGroups,a.conflictingClassGroups),Sp(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Zi(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Zi(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Ip(e.theme,r.theme),Ip(e.classGroups,r.classGroups),Ip(e.conflictingClassGroups,r.conflictingClassGroups),Ip(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),Oh(e,r,"postfixLookupClassGroups"),Oh(e,r,"orderSensitiveModifiers"),e),Zi=(e,t,n)=>{n!==void 0&&(e[t]=n)},Sp=(e,t)=>{if(t)for(let n in t)Zi(e,n,t[n])},Ip=(e,t)=>{if(t)for(let n in t)Oh(e,t,n)},Oh=(e,t,n)=>{let o=t[n];o!==void 0&&(e[n]=e[n]?e[n].concat(o):o)},XS=(e,...t)=>typeof e=="function"?AS(OS,e,...t):AS(()=>tH(OS(),e),...t);var nH=XS({extend:{classGroups:{"font-size":[{text:["chat","chat-row","chat-code","chat-dense","chat-meta","control-1","control-2","control-3","control-4","control-5"]}]}}});function j(...e){return nH(RS(e))}W();var wp=ut(!0);function JS(){return Ge(wp)}var zh=ut(void 0);function No(){let e=Ge(wp);return Ge(zh)??e}W();var Tp=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();var ZS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var eI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());var Hh=e=>{let t=eI(e);return t.charAt(0).toUpperCase()+t.slice(1)};W();var tI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var nI=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var oI=Tn(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:s,...i},l)=>Fe("svg",{ref:l,...tI,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Tp("lucide",r),...!a&&!nI(i)&&{"aria-hidden":"true"},...i},[...s.map(([d,u])=>Fe(d,u)),...Array.isArray(a)?a:[a]]));var te=(e,t)=>{let n=Tn(({className:o,...r},a)=>Fe(oI,{ref:a,iconNode:t,className:Tp(`lucide-${ZS(Hh(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Hh(e),n};var oH=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Os=te("archive",oH);var rH=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Kd=te("arrow-down",rH);var aH=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],$d=te("arrow-up-to-line",aH);var sH=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],qd=te("arrow-up-right",sH);var iH=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Vd=te("arrow-up",iH);var lH=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Wd=te("blocks",lH);var dH=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Gd=te("book-open",dH);var cH=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],el=te("bookmark",cH);var uH=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Fs=te("bot",uH);var pH=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dn=te("check",pH);var fH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qt=te("chevron-down",fH);var mH=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Bs=te("chevron-left",mH);var gH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cn=te("chevron-right",gH);var hH=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],jd=te("chevrons-left",hH);var vH=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Qd=te("chevrons-right",vH);var yH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Zt=te("circle-alert",yH);var CH=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zs=te("copy",CH);var xH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],co=te("ellipsis",xH);var bH=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Yd=te("eye-off",bH);var SH=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xd=te("eye",SH);var IH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Jd=te("file-code",IH);var wH=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],cr=te("file-headphone",wH);var TH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],qa=te("file-play",TH);var PH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Zd=te("file-text",PH);var kH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],ec=te("file-type",kH);var LH=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],tc=te("file",LH);var RH=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Va=te("folder",RH);var EH=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],nc=te("frame",EH);var MH=[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],oc=te("git-branch-plus",MH);var AH=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],rc=te("git-branch",AH);var NH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ac=te("globe",NH);var _H=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],sc=te("grip-vertical",_H);var DH=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],ic=te("hammer",DH);var OH=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],lc=te("image",OH);var FH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],dc=te("info",FH);var BH=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Wa=te("layers",BH);var zH=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],cc=te("list-ordered",zH);var HH=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Hs=te("list-todo",HH);var UH=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],uc=te("list",UH);var KH=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ga=te("loader-circle",KH);var $H=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],ja=te("lock-open",$H);var qH=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],pc=te("lock",qH);var VH=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],tl=te("maximize",VH);var WH=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=te("message-circle-question-mark",WH);var GH=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Us=te("message-circle",GH);var jH=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ks=te("message-square",jH);var QH=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],ia=te("messages-square",QH);var YH=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],fc=te("minimize-2",YH);var XH=[["path",{d:"M5 12h14",key:"1ays0h"}]],$s=te("minus",XH);var JH=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Br=te("mouse-pointer-click",JH);var ZH=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],mc=te("package",ZH);var eU=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],qs=te("paintbrush",eU);var tU=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],_o=te("paperclip",tU);var nU=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],zr=te("pen-line",nU);var oU=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gc=te("pencil-ruler",oU);var rU=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],hc=te("pencil",rU);var aU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vc=te("plus",aU);var sU=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Vs=te("puzzle",sU);var iU=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ws=te("rotate-ccw",iU);var lU=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gs=te("search",lU);var dU=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],yc=te("send",dU);var cU=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cc=te("settings",cU);var uU=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],nl=te("skip-forward",uU);var pU=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ol=te("sliders-horizontal",pU);var fU=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ya=te("sparkles",fU);var mU=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],uo=te("square-pen",mU);var gU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],xc=te("square",gU);var hU=[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bc=te("star-off",hU);var vU=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],js=te("star",vU);var yU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Do=te("terminal",yU);var CU=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],la=te("text-quote",CU);var xU=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Xa=te("user-round",xU);var bU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Sc=te("wrench",bU);var SU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ht=te("x",SU);var IU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qs=te("zap",IU);W();function de(){return{t:pn().i18n.usePluginTranslation()}}W();W();var Ja=ut(null),Ic=ut(null);function rl(e,t){let n=Ge(Ic);ue(()=>{if(!(!t||e===null||n===null))return n(e)},[n,t,e])}function wc(){let e=new Map;return{rows:()=>[...e.keys()],acquire:(t,n)=>{e.set(t,(e.get(t)??0)+1),n();let o=!0;return()=>{if(!o)return;o=!1;let r=e.get(t)??0;r>1?e.set(t,r-1):e.delete(t),n()}}}}var rI=new Set(["Select","AlertDialog","Dialog","Menu","Popover","Tooltip","Combobox"]);function be(e){let t=rI.has(e),n=o=>{let r=pn(),a=hp(),s=No(),i=r.ui[e],l={};if(t){let d=Ge(Ja),[u,p]=G(o.defaultOpen===!0),f=typeof o.open=="boolean"?o.open:u;rl(d,s&&f),ue(()=>{s||p(!1)},[s]),l={open:s&&f,onOpenChange:(m,...g)=>{p(m),typeof o.onOpenChange=="function"&&o.onOpenChange(m,...g)}}}return Fe(i,{...o,...l,...rI.has(e)&&!s?{open:!1}:{},className:`${a} ${typeof o.className=="string"?o.className:""}`})};return n.displayName=e,n}var kne=be("useLinkContextMenu"),ur=be("ProviderInstanceIcon"),aI=be("UserAvatar"),Go=be("Badge"),Lne=be("InlineTag"),Uh=be("Meter"),J=be("Button"),Pp=be("Label"),al=be("Input"),sI=be("SearchInput"),Za=be("EmptyInline"),iI=be("Textarea"),kp=be("Switch"),Rne=be("Separator"),Kh=be("Skeleton"),Hr=be("Spinner"),Ene=be("ScrollArea"),Mne=be("Card"),Ane=be("CardAction"),Nne=be("CardPanel"),_ne=be("CardDescription"),Dne=be("CardFooter"),One=be("CardHeader"),Fne=be("CardTitle"),Bne=be("Empty"),zne=be("EmptyContent"),Hne=be("EmptyDescription"),Une=be("EmptyHeader"),Kne=be("EmptyMedia"),$ne=be("EmptyTitle"),qne=be("InputGroup"),Vne=be("InputGroupAddon"),Wne=be("InputGroupInput"),Gne=be("DocumentPanel"),jne=be("MasterDetail"),Lp=be("Select"),Rp=be("SelectItem"),Ep=be("SelectPopup"),lI=be("SelectTrigger"),Mp=be("SelectValue"),Tc=be("Toggle"),dI=be("ToggleGroup"),sl=be("Dialog"),Qne=be("DialogClose"),il=be("DialogDescription"),Ap=be("DialogFooter"),Np=be("DialogHeader"),ll=be("DialogPopup"),cI=be("DialogPanel"),dl=be("DialogTitle"),Yne=be("DialogTrigger"),Un=be("Menu"),cl=be("MenuGroup"),uI=be("MenuGroupLabel"),Kn=be("MenuItem"),$n=be("MenuPopup"),pr=be("MenuRadioGroup"),Oo=be("MenuRadioItem"),da=be("MenuSeparator"),qn=be("MenuTrigger"),po=be("Popover"),fo=be("PopoverPopup"),mo=be("PopoverTrigger"),pI=be("Table"),fI=be("TableBody"),fr=be("TableCell"),Ys=be("TableHead"),mI=be("TableHeader"),es=be("TableRow"),Me=be("Tooltip"),Ae=be("TooltipPopup"),Ne=be("TooltipTrigger"),Pc=be("Alert"),kc=be("AlertAction"),_p=be("AlertDescription"),$h=be("AlertTitle"),ul=be("Kbd"),Dp=be("DecisionCard"),gI=be("ChoiceList"),Op=be("Command"),Fp=be("CommandGroup"),Bp=be("CommandItem"),zp=be("CommandList"),hI=be("Combobox"),vI=be("ComboboxEmpty"),yI=be("ComboboxInput"),ts=be("ComboboxItem"),CI=be("ComboboxListVirtualized"),xI=be("TooltipProvider"),bI=be("StyledDiffCodeView"),SI=be("DevBackdropArt"),Zn=be("Markdown"),II=be("DiffView"),wI=be("MediaPlayer");var{jsx:c,jsxs:x,Fragment:ge}=window.__ycodiumPluginHost.jsxRuntime;var wU="sr-only @min-[30rem]/composer-first-row:not-sr-only";function PI({mode:e,onModeChange:t}){let{t:n}=de();return c("div",{className:"flex shrink-0 items-center gap-1",children:x(dI,{className:"shrink-0","data-view-mode-toggle":!0,size:"xs","aria-label":n("trajectory.toggleLabel"),variant:"segmented",value:[e],onValueChange:o=>{let r=o[0];(r==="chat"||r==="trajectory")&&t(r)},children:[c(TI,{value:"chat",label:n("trajectory.toggleChat"),icon:c(Ks,{"aria-hidden":!0})}),c(TI,{value:"trajectory",label:n("trajectory.toggleTrajectory"),icon:c(cc,{"aria-hidden":!0})})]})})}function TI({value:e,label:t,icon:n}){return x(Me,{children:[x(Ne,{render:c(Tc,{value:e,"aria-label":t}),children:[n,c("span",{className:wU,children:t})]}),c(Ae,{side:"top",children:t})]})}function kI({mode:e,visible:t,chat:n,trajectory:o}){return c("div",{className:"relative flex min-h-0 flex-1 flex-col","aria-hidden":t?void 0:!0,inert:t?void 0:!0,"data-chat-view-pane":e,"data-pane-visible":t?"true":"false",children:c(zh,{value:t,children:e==="chat"?n:o})})}W();function it(){return{t:pn().i18n.usePluginTranslation()}}function LI(e){if(e.cacheDisjoint!==!0)return null;let t=e.cachedInputTokens,n=e.inputTokens;if(t===void 0||n===void 0)return null;let o=t+n;if(o<=0)return null;if(t>=o)return"100%";let r=t/o*100;for(let a=0;a<=3;a+=1){let s=r.toFixed(a);if(Number.parseFloat(s)<100)return`${s}%`}return"99.9%"}function RI(e){let t,n,o,r=!0,a=!1;for(let s of e)s!==void 0&&(a=!0,s.cacheDisjoint!==!0&&(r=!1),s.outputTokens!==void 0&&(t=(t??0)+s.outputTokens),s.inputTokens!==void 0&&(n=(n??0)+s.inputTokens),s.cachedInputTokens!==void 0&&(o=(o??0)+s.cachedInputTokens));if(!(t===void 0&&n===void 0&&o===void 0))return{...a&&r?{cacheDisjoint:!0}:{},...t!==void 0?{outputTokens:t}:{},...n!==void 0?{inputTokens:n}:{},...o!==void 0?{cachedInputTokens:o}:{}}}W();W();var EI=ut(null);function MI({data:e,target:t,children:n}){let o=M(r=>e.readTurnChanges(t,r),[e,t.environmentId,t.threadId]);return c(EI,{value:e.readTurnChanges?o:null,children:n})}function AI({turnId:e,filePath:t,onClose:n}){let o=Ge(EI),r=N(o),a=N(n);a.current=n;let{t:s}=it(),[i,l]=G(0),[d,u]=G(0),[p,f]=G(null),[m,g]=G("loading");return $(()=>{if(o!==r.current){a.current();return}let h=!0;if(g("loading"),!o){g("ready");return}return o({turnId:e,filePath:t,textOffset:i}).then(v=>{h&&(f(C=>({...v,text:i===0?v.text:(C?.text??"")+v.text})),g("ready"))},()=>{h&&g("failed")}),()=>{h=!1}},[o,e,t,i,d]),c(sl,{open:!0,onOpenChange:h=>{h||n()},children:x(ll,{className:"flex max-h-[80vh] w-[min(90vw,60rem)] flex-col gap-3",children:[c(dl,{children:s("turnOverview.recordedChanges")}),c(il,{children:t}),c("p",{className:"text-xs text-muted-foreground",children:p||m==="ready"?s(p?.machineUpdateRequired?"turnOverview.changesUpgradeMachine":`turnOverview.changesSource.${p?.source??"unavailable"}`):null}),m==="loading"?c("p",{role:"status",children:s("turnOverview.changesLoading")}):null,m==="failed"?c(J,{onClick:()=>u(h=>h+1),children:s("turnOverview.changesRetry")}):null,p?.text?c("pre",{className:"min-h-0 overflow-auto whitespace-pre-wrap break-all text-xs",tabIndex:0,children:p.text}):null,p?.truncated?c("p",{children:s("turnOverview.changesTruncated")}):null,p?.textWindow?.nextOffset!=null?c(J,{disabled:m==="loading",onClick:()=>l(p.textWindow.nextOffset),children:s("turnOverview.changesMore")}):null,c(J,{onClick:n,children:s("turnOverview.changesClose")})]})})}W();W();function Lc(e,t){if(!Number.isFinite(e)||e<0)return t.milliseconds("0");if(e<1e3)return t.milliseconds(String(Math.max(1,Math.round(e))));if(e<1e4){let i=Math.round(e/100)/10;return t.seconds(i>=10?"10":i.toFixed(1))}if(e<6e4)return t.seconds(String(Math.round(e/1e3)));let n=Math.round(e/1e3),o=Math.floor(n/3600),r=Math.floor(n%3600/60),a=n%60,s=[];return o>0&&s.push(t.hours(String(o))),r>0&&s.push(t.minutes(String(r))),a>0&&s.push(t.seconds(String(a))),s.reduce((i,l)=>t.pair(i,l))}function NI(e,t){return!Number.isFinite(e)||e<=0?t.seconds("0"):Lc(e,t)}function go(){let{t:e}=it();return K(()=>{let t={milliseconds:n=>e("duration.milliseconds",{value:n}),seconds:n=>e("duration.seconds",{value:n}),minutes:n=>e("duration.minutes",{value:n}),hours:n=>e("duration.hours",{value:n}),pair:(n,o)=>e("duration.pair",{left:n,right:o})};return{units:t,formatDuration:n=>Lc(n,t),formatCountedDuration:n=>NI(n,t)}},[e])}function TU({fact:e,ownerId:t,onLocate:n,turnId:o}){let{t:r}=it(),{formatDuration:a}=go(),[s,i]=G(!1),[l,d]=G(null);rl(t,s||l!==null);let u=r(`turnOverview.${e.kind}`,{count:e.value,duration:a(e.value)}),p=e.targets[0];return e.targets.length===1&&p?.filePath===void 0?c(J,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs",title:r("turnOverview.locate"),onClick:()=>p&&n(p.rowId),disabled:!p,children:u}):x(ge,{children:[x(po,{open:s,onOpenChange:i,children:[c(mo,{render:c(J,{size:"xs",variant:"ghost",className:"h-auto px-1 py-0.5 text-xs"}),children:u}),x(fo,{className:"flex max-h-72 w-80 flex-col gap-1 overflow-auto p-2",children:[e.partial?c("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:r("turnOverview.loadedFacts")}):null,e.targets.map((f,m)=>x("div",{className:"flex min-w-0 items-center gap-1",children:[f.filePath?c(J,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start whitespace-normal break-all text-left",title:r("turnOverview.recordedChanges"),onClick:()=>{i(!1),d(f.filePath)},children:f.filePath}):c("span",{className:"min-w-0 flex-1 px-2 text-xs",children:r("turnOverview.step",{index:m+1})}),c(J,{size:"xs",variant:"outline",onClick:()=>{i(!1),n(f.rowId)},children:r("turnOverview.locate")})]},`${f.rowId}:${f.filePath??m}`))]})]}),l!==null?c(AI,{turnId:o,filePath:l,onClose:()=>d(null)},`${o}:${l}`):null]})}function Hp({summary:e,...t}){let{t:n}=it();return x("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1 gap-y-0.5 text-muted-foreground","data-turn-facts":e.turnId,children:[e.facts.map(o=>c(TU,{fact:o,turnId:e.turnId,ownerId:`turn:${e.turnId}`,...t},o.kind)),e.facts.some(o=>o.partial)?c(qh,{className:"px-1 text-ui-2xs",detail:n("turnOverview.loadedFacts"),children:n("turnOverview.loaded")}):null]})}function Up({summary:e}){let{t}=it();return e.modelSummary?x("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[c("span",{className:"min-w-0 break-words",children:e.modelSummary.text}),c(qh,{className:"shrink-0 rounded border border-border px-1 text-ui-2xs font-normal text-muted-foreground",detail:e.modelSummary.modelSelection.model,children:t("turnOverview.modelSummary")})]}):null}function Kp({summary:e}){let{t}=it();return e.hasCompaction?x(qh,{className:"inline-flex shrink-0 items-center text-muted-foreground",detail:t("turnOverview.compaction"),children:[c(Os,{className:"size-3","aria-hidden":!0}),c("span",{className:"sr-only",children:t("turnOverview.compaction")})]}):null}function qh({children:e,detail:t,className:n}){return x(Me,{children:[c(Ne,{render:c("span",{className:n}),children:e}),c(Ae,{children:t})]})}W();var DI=100,PU=new Map,_I=new Map,$p=e=>typeof e=="function"?e():e,OI=(e,t)=>typeof t=="function"?t(e):t;function kU(e,t,n){let o=e.get(t);return o===void 0&&(o={values:new Map,limit:Math.max(1,n)},e.set(t,o)),o}function LU(e,t){let n=_I.get(e);return n===void 0&&(n={values:new Map,limit:Math.max(1,t)},_I.set(e,n)),n}function RU(e,t){if(!(e.values.size<=e.limit)){for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.committed||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}for(let[n,o]of e.values){if(e.values.size<=e.limit)return;o===t||o.leases>0||(e.values.delete(n),o.alive=!1,o.subscribers.clear())}}}function Vh(e,t,n){e.values.get(t)===n&&(e.values.delete(t),e.values.set(t,n))}function FI(e,t,n){let o=e.values.get(t);return o===void 0&&(o={value:$p(n),subscribers:new Set,leases:0,alive:!0,committed:!1},e.values.set(t,o)),o}function Rc(e){queueMicrotask(()=>RU(e))}function vt(e,t,n,o=DI){let r=Math.max(1,o),a=kU(PU,e,r),s=FI(a,t,n),i=M(p=>s.alive?(a.limit=r,s.committed=!0,Vh(a,t,s),s.leases+=1,s.subscribers.add(p),Rc(a),()=>{s.subscribers.delete(p),s.leases=Math.max(0,s.leases-1),Rc(a)}):()=>{},[r,s,a,t]),l=M(()=>s.value,[s]),d=Ao(i,l,l),u=M(p=>{if(!s.alive||a.values.get(t)!==s)return;let f=s.value,m=OI(f,p);if(!Object.is(m,f)){s.value=m,Vh(a,t,s);for(let g of s.subscribers)g();Rc(a)}},[s,a,t]);return[d,u]}function BI(e,t){let n=N(null);(n.current===null||n.current.key!==e)&&(n.current={key:e,value:$p(t)});let[,o]=dr(a=>a+1,0),r=M(a=>{let s=n.current;if(s===null||s.key!==e)return;let i=OI(s.value,a);Object.is(i,s.value)||(s.value=i,o())},[e]);return[n.current.value,r]}function lt(e,t,n,o=DI){let r=Math.max(1,o),a=LU(e,r),s=FI(a,t,()=>({current:$p(n)}));return $(()=>{if(!(!s.alive||a.values.get(t)!==s))return a.limit=r,s.committed=!0,Vh(a,t,s),s.leases+=1,Rc(a),()=>{s.leases=Math.max(0,s.leases-1),Rc(a)}},[r,s,a,t]),s.value}function Fo(e,t){let n=N(null);return(n.current===null||n.current.key!==e)&&(n.current={key:e,ref:{current:$p(t)}}),n.current.ref}W();var Wh="trajectory-summary-reveal";function zI({inputKey:e,rows:t,groupRows:n,paneVisible:o,resetFilter:r}){let[a,s]=vt("trajectory-turn-disclosure",e,{}),[i,l]=vt("trajectory-routine-disclosure",e,()=>new Set),[d,u]=vt("trajectory-expand-all",e,!1),[p,f]=vt(Wh,e,null),[m,g]=vt("trajectory-summary-highlight",e,null),h=lt("trajectory-default-open",e,()=>new Set),v=K(()=>n?.(t,d)??null,[n,t,d]),C=K(()=>{let k=new Map,P=new Map;if(v===null)return{rows:t,headers:k,routines:P};let T=v.findLast(A=>A.turnId!==null),L=new Set(v.map(A=>A.id));if(h.current.size>200)for(let A of h.current)L.has(A)||h.current.delete(A);o&&T&&h.current.add(T.id);let E=[];for(let A of v){let R=A.items[0],F=R?.kind==="step"?R.row:R?.rows[0];if(!F)continue;let H=d||(a[A.id]??(A.turnId===null||h.current.has(A.id)||A.summary?.state==="running"));if(k.set(A.id,{group:A,expanded:H}),E.push({...F,id:A.id,kind:"turn-header",turnId:A.turnId,createdAt:A.summary?.startedAt??F.createdAt}),!!H)for(let z of A.items){if(z.kind==="step"){E.push(z.row);continue}let _=i.has(z.id);P.set(z.id,{count:z.rows.length,expanded:_}),E.push({...z.rows[0],id:z.id,kind:"routine-header"}),_&&E.push(...z.rows)}}return{rows:E,headers:k,routines:P}},[v,t,o,h,d,a,i]),y=N(C.headers);y.current=C.headers;let b=M(k=>{u(!1),s(P=>({...P,[k]:!y.current.get(k)?.expanded}))},[u,s]),w=M(k=>l(P=>{let T=new Set(P);return T.has(k)?T.delete(k):T.add(k),T}),[l]),S=M(k=>f(P=>({rowId:k,nonce:(P?.nonce??0)+1})),[f]);ue(()=>{if(!o||p===null)return;r();let k=v?.find(T=>T.id===p.rowId||T.items.some(L=>L.kind==="step"?L.row.id===p.rowId:L.rows.some(E=>E.id===p.rowId)));if(!k||k.id===p.rowId)return;C.headers.get(k.id)?.expanded||s(T=>({...T,[k.id]:!0}));let P=k.items.find(T=>T.kind==="routine"&&T.rows.some(L=>L.id===p.rowId));P&&!i.has(P.id)&&l(T=>new Set([...T,P.id]))},[o,p,r,v,C.headers,i,s,l]);let I=M(k=>{g(k.rowId),f(P=>P===k?null:P)},[g,f]);return{...C,expandAll:d,setExpandAll:u,toggleTurn:b,toggleRoutine:w,locate:S,request:p,completeReveal:I,highlighted:m}}function pl(e){return e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function HI({rows:e,usageByTurnId:t,onSelect:n,summaries:o,actions:r}){let{t:a}=it();return e.map(({item:s,ordinal:i})=>{let l=s.attachmentPreview,d=s.isSystemMessage?a("turnNavigator.systemWake"):l===void 0?s.userText:l.count===1?l.name:a("forkRelations.attachmentPreview",l),u=s.turnId===null?void 0:o.get(s.turnId),p=s.turnId===null?void 0:t.get(s.turnId);return x("div",{className:"rounded-md hover:bg-accent/50",children:[x("button",{type:"button","data-turn-navigator-row":s.sectionKey,onClick:()=>n(s),className:"flex w-full cursor-[var(--control-cursor)] items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[c("span",{className:"shrink-0 pt-px font-mono text-ui-2xs text-muted-foreground tabular-nums",children:i}),x("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[x("span",{className:"flex items-start gap-1",children:[c("span",{className:"line-clamp-2 min-w-0 flex-1 font-medium text-chat leading-snug",children:d}),u?c(Kp,{summary:u}):null]}),u?.modelSummary?c(Up,{summary:u}):s.assistantText?c("span",{className:"line-clamp-1 text-ui-xs text-muted-foreground leading-snug",children:s.assistantText}):null,p?.outputTokens!==void 0?c("span",{className:"font-mono text-ui-2xs text-muted-foreground tabular-nums",children:pl(p.outputTokens)}):null]})]}),u&&r?c("div",{className:"pb-1 pl-7 pr-2",children:c(Hp,{summary:u,...r})}):null]},s.sectionKey)})}function EU({context:e,useSummaries:t,...n}){let o=t(e.target),r=K(()=>new Map(o.map(s=>[s.turnId,s])),[o]),[,a]=vt(Wh,e.threadKey,null);return c(HI,{...n,summaries:r,actions:{onLocate:s=>{a(i=>({rowId:s,nonce:(i?.nonce??0)+1})),n.onClose(),e.openTrajectory()},onOpenFileDiff:e.onOpenFileDiff}})}var MU=new Map;function UI(e){let t=e.summaryContext;return t?.data.useTurnSummaries?c(EU,{...e,context:t,useSummaries:t.data.useTurnSummaries}):c(HI,{...e,summaries:MU})}function AU({totals:e}){let{t}=it();if(!e)return null;let n=LI(e),o=[e.outputTokens===void 0?null:{label:t("turnNavigator.usageOutput"),value:pl(e.outputTokens)},e.inputTokens===void 0?null:{label:t("turnNavigator.usageInput"),value:pl(e.inputTokens)},e.cachedInputTokens===void 0?null:{label:t("turnNavigator.usageCacheRead"),value:n===null?pl(e.cachedInputTokens):`${pl(e.cachedInputTokens)} (${n})`}].filter(r=>r!==null);return o.length===0?null:x("div",{className:"flex items-baseline gap-2 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:t("turnNavigator.usage")}),o.map(r=>x("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums",children:[r.label," ",r.value]},r.label))]})}var NU=le(function({getText:t,size:n="xs",variant:o="outline",className:r}){let{t:a}=it(),s=pn().writeClipboard,[i,l]=G(!1),d=a("turnNavigator.copyMarkdown");return x(Me,{children:[c(Ne,{render:c(J,{"aria-label":d,disabled:i,onClick:()=>{s(t()).then(()=>{l(!0),window.setTimeout(()=>l(!1),1e3)})},type:"button",size:n,variant:o,className:j("text-muted-foreground hover:text-foreground",r)}),children:i?c(Dn,{className:"size-3 text-primary"}):c(zs,{className:"size-3"})}),c(Ae,{children:c("p",{children:d})})]})});function KI({items:e,totalTurnCount:t,bottomInset:n,usageByTurnId:o,onSelect:r,exportMarkdown:a,onDownload:s,placement:i="float",summaryContext:l}){let{t:d}=it(),[u,p]=G(!1),f=K(()=>e.map((v,C)=>({item:v,ordinal:C+1})).reverse(),[e]),m=K(()=>RI(f.map(({item:v})=>v.turnId===null?void 0:o.get(v.turnId))),[f,o]);if(e.length===0)return null;let g=t??e.length,h=d("turnNavigator.open",{count:g});return x(po,{onOpenChange:p,open:u,children:[x(mo,{render:c(J,{"aria-label":h,className:j("gap-1.5 rounded-full px-3",i==="float"&&"absolute right-3 z-40"),"data-testid":"turn-navigator-pill",size:"xs",style:i==="float"?{bottom:n+12}:void 0,title:h,variant:"glass"}),children:[c(uc,{"aria-hidden":!0}),c("span",{className:"font-mono font-semibold text-[11px] tabular-nums",children:g})]}),c(fo,{align:"end",className:"w-80 flex-col",side:"top",children:x("div",{className:"flex max-h-[min(60vh,26rem)] flex-col",children:[x("div",{className:"flex items-center gap-1.5 border-b px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.title")}),c("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:g})]}),c("div",{className:j("min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-1"),children:c(UI,{rows:f,usageByTurnId:o,summaryContext:l,onSelect:v=>{p(!1),r(v)},onClose:()=>p(!1)})}),c(AU,{totals:m}),x("div",{className:"flex items-center gap-1 border-t px-2 py-1.5",children:[c("span",{className:"flex-1 font-mono text-[10px] text-muted-foreground uppercase tracking-[0.14em]",children:d("turnNavigator.export")}),c(NU,{size:"icon-xs",getText:a,variant:"ghost"}),c(J,{"aria-label":d("turnNavigator.downloadMarkdown"),onClick:()=>s("md"),size:"xs",title:d("turnNavigator.downloadMarkdown"),variant:"ghost",children:c("span",{className:"font-mono text-[10px]",children:".md"})}),c(J,{"aria-label":d("turnNavigator.downloadJson"),onClick:()=>s("json"),size:"xs",title:d("turnNavigator.downloadJson"),variant:"ghost",children:c("span",{className:"font-mono text-[10px]",children:".json"})})]})]})})]})}W();function Ec(e){return e.replace(/\s+/g," ")}function _U(e,t){let n=e.slice(Math.max(0,e.length-t));return/^[\uDC00-\uDFFF]/.test(n)&&(n=n.slice(1)),n}function DU(e,t){let n=e.slice(0,t);return/[\uD800-\uDBFF]$/.test(n)&&(n=n.slice(0,-1)),n}function qp(e){let n=(e instanceof Element?e:e?.parentElement??null)?.closest("[data-assistant-quote-body]")??null;return n?.closest('[data-message-role="assistant"]')?n:null}function $I(e){if(!e||e.isCollapsed||e.rangeCount===0)return null;let t=e.getRangeAt(0),n=qp(t.startContainer);if(n===null||qp(t.endContainer)!==n)return null;let o=n.closest("[data-message-id]")?.dataset.messageId;if(!o)return null;let r=e.toString().trim();if(r.length===0)return null;let a=document.createRange();a.selectNodeContents(n),a.setEnd(t.startContainer,t.startOffset);let s=document.createRange();s.selectNodeContents(n),s.setStart(t.endContainer,t.endOffset);let i=Ec(t.toString()),l=i.length>i.trimStart().length?" ":"",d=i.length>i.trimEnd().length?" ":"",u=Ec(a.toString()+l),p=Ec(d+s.toString()),f=u.length,m=f+i.trim().length,g=t.getClientRects(),h=g[0]??t.getBoundingClientRect(),v=g[g.length-1]??h;return{messageId:o,text:r,start:f,end:m,prefix:_U(u,32),suffix:DU(p,32),anchor:{x:v.right,top:h.top,bottom:v.bottom}}}var Vp="assistant-quote-inserter",Wp="assistant-quote-open-comment";var OU=300;function qI(e){let{data:t,target:n,threadKey:o,surfaceRef:r}=e,{t:a}=de(),s=lt(Vp,o,null),[,i]=vt(Wp,o,null),[l,d]=G(null),u=N(null);if($(()=>{let h,v=()=>{let I=r.current,k=document.getSelection(),P=k&&k.rangeCount>0?k.getRangeAt(0):null;if(!I||!P||!I.contains(P.commonAncestorContainer)){d(null);return}let T=$I(k);if(T===null){d(null);return}let L=t.assistantQuotes.serialize({version:1,environmentId:n.environmentId,threadId:n.threadId,messageId:T.messageId,text:T.text,start:T.start,end:T.end,prefix:T.prefix,suffix:T.suffix});d({source:L,...T.anchor})},C=I=>{u.current?.contains(I.target)||(clearTimeout(h),h=setTimeout(v,OU))},y=I=>{u.current?.contains(I.target)||(clearTimeout(h),d(null))},b=()=>d(null),w=I=>{I.key==="Escape"&&d(null)},S=()=>{(document.getSelection()?.isCollapsed??!0)&&d(null)};return document.addEventListener("pointerup",C,!0),document.addEventListener("keyup",C,!0),document.addEventListener("pointerdown",y,!0),document.addEventListener("keydown",w,!0),document.addEventListener("selectionchange",S),window.addEventListener("scroll",b,!0),()=>{clearTimeout(h),document.removeEventListener("pointerup",C,!0),document.removeEventListener("keyup",C,!0),document.removeEventListener("pointerdown",y,!0),document.removeEventListener("keydown",w,!0),document.removeEventListener("selectionchange",S),window.removeEventListener("scroll",b,!0)}},[t,r,n.environmentId,n.threadId]),l===null)return null;let p=l.source,f=Math.max(8,Math.min(window.innerWidth-200,l.x-12)),m=l.bottom+6,g=m+40<=window.innerHeight?m:Math.max(8,l.top-40);return c("div",{ref:u,className:"fixed z-50 rounded-control-3 bg-background",style:{left:f,top:g},"data-assistant-quote-toolbar":"",children:x(J,{size:"sm",variant:"outline",className:"shadow-md",disabled:p===null,title:p===null?a("timeline.quote.tooLong"):void 0,onMouseDown:h=>h.preventDefault(),onClick:()=>{p!==null&&s.current?.(p)===!0&&(i(p),document.getSelection()?.removeAllRanges(),d(null))},children:[c(la,{"aria-hidden":"true"}),a("timeline.quote.cite")]})})}W();W();function VI(e){let t=e.map(o=>({key:o.key,turnId:o.turnId,firstRowIndex:o.firstRowIndex,endRowIndex:o.firstRowIndex+o.rowIds.length})),n=new Map;for(let o of e)for(let[r,a]of o.rowIds.entries())n.set(a,{turnId:o.turnId,index:o.firstRowIndex+r});return{sections:t,bySectionKey:new Map(t.map(o=>[o.key,o])),byRowId:n}}function Gp({index:e,visibleSectionKeys:t,protectedRowIds:n,selectionRows:o}){let r=t.flatMap(d=>{let u=e.bySectionKey.get(d)?.turnId;return u==null?[]:[u]}),a=n.flatMap(d=>{let u=e.byRowId.get(d)?.turnId;return u==null?[]:[u]}),s=o?e.byRowId.get(o.firstRowId)?.index:void 0,i=o?e.byRowId.get(o.lastRowId)?.index:void 0,l=s===void 0||i===void 0?[]:e.sections.flatMap(d=>d.turnId!==null&&d.endRowIndex>Math.min(s,i)&&d.firstRowIndex<=Math.max(s,i)?[d.turnId]:[]);return{firstTurnId:r[0]??null,lastTurnId:r.at(-1)??null,protectedTurnIds:[...new Set(a)],selectionTurnRange:l.length>0?{firstTurnId:l[0],lastTurnId:l.at(-1)}:null}}function WI(e,t,n,o){if(!o)return n;let r=e.findIndex(a=>t.has(a));return r<0?n:Math.max(n,e.length-r)}W();W();function Gh(e,t){for(let n of e.querySelectorAll("[data-timeline-row-id]"))if(n.dataset.timelineRowId===t)return n;return null}function Xs(e,t){let n=0,o=e.length,r=-1;for(;n<o;){let a=Math.floor((n+o)/2),i=e[a].getBoundingClientRect();Math.max(i.bottom,i.top+1)>t?(r=a,o=a):n=a+1}return r}function FU(e){let t=e.getBoundingClientRect().top,n=e.querySelectorAll("[data-timeline-turn-section]"),o=a=>{let s=a.querySelectorAll("[data-timeline-row-id]"),i=Xs(s,t),l=i<0?void 0:s[i],d=l?.dataset.timelineRowId;return!l||d===void 0?null:{rowId:d,offsetPx:Math.round(t-l.getBoundingClientRect().top)}};if(n.length===0)return o(e);let r=Xs(n,t);if(r<0)return null;for(let a=r;a<n.length;a+=1){let s=o(n[a]);if(s)return s}return null}function GI(e,t){let n=0,o=e;for(;o&&o!==t;)n+=o.offsetTop,o=o.offsetParent;return n}var jh=class extends ra{getSnapshotBeforeUpdate(t){return t.inputKey!==this.props.inputKey&&t.onBeforeInputChange(),null}componentDidUpdate(){}componentWillUnmount(){this.props.onBeforeInputChange()}render(){return this.props.children}};function jI({inputKey:e,onBeforeInputChange:t,handleRef:n,onAttach:o,className:r,children:a,onScroll:s,onInteractionRowsChange:i}){let l=N(null),d=N({inputKey:e,store:wc()});d.current.inputKey!==e&&(d.current={inputKey:e,store:wc()});let u=N(i);u.current=i;let p=M(m=>{let g=d.current;return g.store.acquire(m,()=>{d.current===g&&u.current?.(g.store.rows())})},[]);ue(()=>{i?.(d.current.store.rows())},[e,i]),Wo(n,()=>({get node(){return l.current},measure:()=>{let m=l.current;return m?{scroll:m.scrollTop,scrollLength:m.clientHeight,contentLength:m.scrollHeight,topOf:g=>{let h=Gh(m,g);return h===null?null:GI(h,m)},heightOf:g=>{let h=Gh(m,g);return h===null?null:h.offsetHeight},rowAtScroll:()=>FU(m)}:null},scrollToEnd:m=>{let g=l.current;if(g){if(m?.animated){g.scrollTo({top:g.scrollHeight,behavior:"smooth"});return}g.scrollTop=g.scrollHeight-g.clientHeight}},scrollToRow:(m,g)=>{let h=l.current;if(!h)return!1;let v=Gh(h,m);return v?(h.scrollTop=Math.max(0,GI(v,h)-(g?.viewOffset??0)),!0):!1},scrollToOffset:m=>{let g=l.current;g&&(g.scrollTop=Math.max(0,m))}}),[]);let f=M(m=>{l.current=m,o(m)},[o]);return c(jh,{inputKey:e,onBeforeInputChange:t,children:c(Ic,{value:p,children:c("div",{ref:f,className:r,style:{position:"relative"},onScroll:s,children:a})})})}function ml(e){if(!e)return!1;let t=e.tagName?.toLowerCase(),n=e.getAttribute?.("contenteditable");if(t==="textarea"||n==="true"||n===""||n==="plaintext-only"||"isContentEditable"in e&&e.isContentEditable===!0)return!0;if(t==="input"){let o=e.getAttribute?.("type")?.toLowerCase()??"text";if(!["button","submit","reset","image","checkbox","radio"].includes(o))return!0}return e.matches?.(":focus-visible")??!1}function fl(e,t){let o=(e?.nodeType===1?e:e?.parentElement)?.closest("[data-timeline-row-id]");return o&&t.contains(o)?o.dataset.timelineRowId??null:null}function jp(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return null;let n=null,o=null;for(let d=0;d<t.rangeCount;d+=1){let u=t.getRangeAt(d);u.intersectsNode(e)&&(n??=u,o=u)}if(!n||!o)return null;let r=fl(n.startContainer,e),a=fl(o.endContainer,e);if(r&&a)return{firstRowId:r,lastRowId:a};let s=e.querySelectorAll("[data-timeline-row-id]"),i=s[0]?.dataset.timelineRowId,l=s[s.length-1]?.dataset.timelineRowId;return i&&l?{firstRowId:r??i,lastRowId:a??l}:null}function Mc(e){let t=e.ownerDocument.getSelection?.();if(!t||t.isCollapsed)return!1;for(let n=0;n<t.rangeCount;n+=1)if(t.getRangeAt(n).intersectsNode(e))return!0;return!1}W();function ns(e){let t=N(e);t.current=e;let n=N(!1),o=N(null),r=N(null),a=N(0),s=M(()=>{a.current+=1,r.current!==null&&cancelAnimationFrame(r.current),r.current=null},[]),i=M(()=>{if(!n.current||!t.current||r.current!==null||o.current===null)return;let u=++a.current;r.current=requestAnimationFrame(p=>{if(u!==a.current||(r.current=null,!n.current||!t.current))return;let f=o.current;o.current=null,f?.(p)})},[]),l=M(u=>{o.current=u,i()},[i]),d=M(()=>{o.current=null,s()},[s]);return ue(()=>(n.current=!0,i(),()=>{n.current=!1,s()}),[e,s,i]),K(()=>({request:l,cancel:d}),[l,d])}function QI({root:e,inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l}){let d=N({inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l});d.current={inputKey:t,visible:n,index:o,topInset:r,bottomInset:a,interactionRows:s,onRangeChange:i,onSelectionChange:l};let u=ns(n),p=N(null),f=M(()=>{let g=d.current;if(!e||!g.visible||e.clientHeight<=0)return;let h=e.getBoundingClientRect();if(h.height<=0)return;let v=h.top+g.topInset,C=h.bottom-g.bottomInset,y=e.querySelectorAll("[data-timeline-turn-section]"),b=Xs(y,v),w=[];if(b>=0)for(let T=b;T<y.length;T+=1){let L=y[T];if(L.getBoundingClientRect().top>=C)break;L.dataset.timelineTurnSection!==void 0&&w.push(L.dataset.timelineTurnSection)}let S=[...g.interactionRows()],I=e.ownerDocument.activeElement;if(ml(I)){let T=fl(I,e);T&&S.push(T)}let k=Gp({index:g.index,visibleSectionKeys:w,protectedRowIds:S,selectionRows:jp(e)}),P=`${g.inputKey}:${JSON.stringify(k)}`;P!==p.current&&(p.current=P,g.onRangeChange?.(k))},[e]),m=M(()=>u.request(f),[u,f]);return ue(()=>{if(p.current=null,!n||!e)return;let g=t,h=!0,v=()=>{!h||d.current.inputKey!==g||!d.current.visible||(d.current.onSelectionChange(Mc(e)),m())};e.addEventListener("scroll",v,{passive:!0}),e.addEventListener("focusin",v),e.addEventListener("focusout",v),e.ownerDocument.addEventListener("selectionchange",v);let C=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return C?.observe(e),e.firstElementChild&&C?.observe(e.firstElementChild),v(),()=>{h=!1,u.cancel(),C?.disconnect(),e.removeEventListener("scroll",v),e.removeEventListener("focusin",v),e.removeEventListener("focusout",v),e.ownerDocument.removeEventListener("selectionchange",v),i?.(null)}},[u,t,i,m,e,n]),ue(()=>{n&&m()},[o,m,n]),m}W();var YI=le(function({sectionKey:t,rowKeyPrefix:n,rowIds:o,renderRow:r,sectionRef:a}){return c("div",{className:"session-turn","data-timeline-turn-section":t,ref:a,children:o.map(s=>c("div",{className:"transcript-col min-w-0 overflow-x-clip",children:r(s)},`${n}:${s}`))})});var BU=400;function XI({root:e,minimumCount:t,keepAbovePx:n=0,canCompact:o,onCompact:r}){let a=e.ownerDocument,s=new Set,i,l=!1,d=()=>e.scrollHeight-e.clientHeight-e.scrollTop<=2,u=()=>{if(i=void 0,a.hidden||s.size>0||!o()||e.clientHeight<=0||!d()||Mc(e))return;let w=e.querySelectorAll("[data-timeline-turn-section]"),S=e.getBoundingClientRect().top-32-n,I=0,k=Math.max(0,w.length-t);for(;I<k;){let T=Math.floor((I+k)/2),L=w[T].getBoundingClientRect().bottom;if(!Number.isFinite(L))return;L<=S?I=T+1:k=T}if(I===0)return;let P=a.activeElement;if(P&&ml(P)){for(let T=0;T<I;T+=1)if(w[T].contains(P))return}r(w.length-I)},p=!1,f=()=>{if(a.hidden||s.size>0||!o()||p){clearTimeout(i),i=void 0;return}i===void 0&&(i=setTimeout(u,BU))},m=()=>{clearTimeout(i),i=void 0,f()},g=()=>{let w=d();!w||!l?m():f(),l=w},h=w=>{s.add(w.pointerId),m()},v=w=>{s.delete(w.pointerId),m()},C=()=>{p=Mc(e),m()},y=()=>{s.clear(),m()},b=["wheel","keydown","focusin","focusout"];for(let w of b)e.addEventListener(w,m,{passive:!0});return e.addEventListener("scroll",g,{passive:!0}),e.addEventListener("pointerdown",h,!0),a.addEventListener("pointerup",v,!0),a.addEventListener("pointercancel",v,!0),a.addEventListener("selectionchange",C),a.addEventListener("visibilitychange",f),a.defaultView?.addEventListener("blur",y),f(),{schedule:f,disconnect:()=>{clearTimeout(i);for(let w of b)e.removeEventListener(w,m);e.removeEventListener("scroll",g),e.removeEventListener("pointerdown",h,!0),a.removeEventListener("pointerup",v,!0),a.removeEventListener("pointercancel",v,!0),a.removeEventListener("selectionchange",C),a.removeEventListener("visibilitychange",f),a.defaultView?.removeEventListener("blur",y)}}}W();function JI({root:e,topInsetPx:t,onActiveSectionChange:n,onActiveStartHiddenChange:o,active:r}){let a=N(r);a.current=r;let s=ns(r),i=N(new Map),l=N(null),d=N(null),u=N(n);u.current=n;let p=N(o);p.current=o;let f=N(null),m=N(null),g=M(()=>{if(!a.current||!e)return;let b=e.scrollTop+t,w=null,S=Number.NEGATIVE_INFINITY,I=null,k=Number.POSITIVE_INFINITY;for(let[E,A]of i.current){if(!A.isConnected)continue;let R=A.offsetTop;R<k&&(k=R,I=E),R<=b&&R>=S&&(S=R,w=E)}let P=w??I;P!==d.current&&(d.current=P,u.current(P));let T=P===null?null:i.current.get(P)?.firstElementChild??null,L=T!==null&&T.getBoundingClientRect().bottom<=e.getBoundingClientRect().top+1;L!==f.current&&(f.current=L,p.current?.(L))},[e,t]),h=M(()=>{a.current&&s.request(g)},[s,g]);$(()=>{if(!r||!e||typeof IntersectionObserver>"u")return;let b=!0,w=new IntersectionObserver(()=>{!b||!a.current||h()},{root:e,rootMargin:`-${t}px 0px 0px 0px`,threshold:0});l.current=w;for(let I of i.current.values())w.observe(I);let S=new IntersectionObserver(()=>{!b||!a.current||h()},{root:e,threshold:0});m.current=S;for(let I of i.current.values())I.firstElementChild&&S.observe(I.firstElementChild);return h(),()=>{b=!1,w.disconnect(),l.current=null,S.disconnect(),m.current=null,s.cancel()}},[r,s,h,e,t]);let v=N(new Map),C=M(b=>{let w=v.current.get(b);if(w)return w;let S=I=>{let k=i.current.get(b);k&&k!==I&&(l.current?.unobserve(k),k.firstElementChild&&m.current?.unobserve(k.firstElementChild),i.current.delete(b)),I?(i.current.set(b,I),l.current?.observe(I),I.firstElementChild&&m.current?.observe(I.firstElementChild)):v.current.get(b)===S&&v.current.delete(b)};return v.current.set(b,S),S},[]),y=M(()=>{a.current&&(d.current=null,f.current=null,h())},[h]);return K(()=>({observeSection:C,refresh:y}),[C,y])}function Qp(e,t){return e===t?!0:!e||!t?!1:e.identity===t.identity&&e.instanceId===t.instanceId&&e.driverKind===t.driverKind&&e.providerDisplayName===t.providerDisplayName&&e.accentColor===t.accentColor&&e.modelLabel===t.modelLabel&&e.effortLabel===t.effortLabel&&e.effortLevel===t.effortLevel}function ZI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ew(e,t){return e.turnId===t.turnId&&e.createdAt===t.createdAt&&Qp(e.badge,t.badge)}function tw(e,t){if(e===t)return!0;if(e.kind!==t.kind||e.id!==t.id)return!1;switch(e.kind){case"turn-identity":return ew(e,t);case"turn-summary":{let n=t;return e.createdAt===n.createdAt&&e.copyText===n.copyText&&e.cardAnchor===n.cardAnchor&&e.footer===n.footer&&(e.identity===void 0?n.identity===void 0:n.identity!==void 0&&ew(e.identity,n.identity))}case"tool-group":{let n=t;return e.createdAt===n.createdAt&&e.groupId===n.groupId&&ZI(e.entries,n.entries)}case"working":{let n=t;return e.createdAt===n.createdAt&&e.turnId===n.turnId&&e.compacting===n.compacting&&Qp(e.modelBadge,n.modelBadge)}case"model-switch":{let n=t;return e.createdAt===n.createdAt&&e.pending===n.pending&&Qp(e.badge,n.badge)}case"proposed-plan":return e.proposedPlan===t.proposedPlan;case"turn-plan":{let n=t;return e.createdAt===n.createdAt&&e.turnPlan.plan===n.turnPlan.plan}case"work":{let n=t;return e.isExpandedToolGroupEntry===n.isExpandedToolGroupEntry&&e.isLastExpandedToolGroupEntry===n.isLastExpandedToolGroupEntry&&ZI(e.groupedEntries,n.groupedEntries)}case"message":{let n=t;return e.message===n.message&&e.presentation===n.presentation&&e.textTone===n.textTone&&e.durationStart===n.durationStart&&e.showAssistantMeta===n.showAssistantMeta&&e.showAssistantCopyButton===n.showAssistantCopyButton&&e.copyInFooter===n.copyInFooter&&e.assistantCopyStreaming===n.assistantCopyStreaming&&Qp(e.modelBadge,n.modelBadge)}}}function zU(e,t,n){for(let o=t;o<n;o+=1){let r=e[o];switch(r.kind){case"turn-identity":return r.turnId;case"working":if(r.turnId!=null)return r.turnId;break;case"message":if(r.message.role==="assistant")return r.message.turnId;break;case"tool-group":if(r.entries[0]?.turnId!=null)return r.entries[0].turnId;break;case"work":if(r.groupedEntries[0]?.turnId!=null)return r.groupedEntries[0].turnId;break;case"turn-plan":return r.turnPlan.turnId;case"proposed-plan":return r.proposedPlan.turnId;case"turn-summary":return r.footer.turnId}}return null}function nw(e,t,n=[]){let o=new Map(n.map(a=>[a.key,a])),r=[];for(let a of t){if(a.end<=a.start)continue;let s=zU(e,a.start,a.end),i=o.get(a.key);if(i!==void 0&&i.turnId===s&&HU(i,e,a.start,a.end)){r.push(i);continue}r.push({key:a.key,turnId:s,firstRowIndex:a.start,rowIds:e.slice(a.start,a.end).map(l=>l.id)})}return r}function HU(e,t,n,o){if(e.firstRowIndex!==n||e.rowIds.length!==o-n)return!1;for(let r=0;r<e.rowIds.length;r+=1)if(e.rowIds[r]!==t[n+r].id)return!1;return!0}function ow(e,t){let n=Math.max(0,Math.min(t,e)),o=e-n;return{startIndex:o,hasHiddenOlder:o>0}}function Js(e,t,n){let o=e.findIndex(r=>r.rowIds.includes(t));return o<0?n:Math.max(n,e.length-o)}function UU(e,t){let n=t.historyWindow,{status:o}=t,r={activities:t.activities,timelineEntries:t.timelineEntries,turnSummaries:t.turnSummaries,latestTurn:n?null:o.latestTurn,runningTurnId:n?null:o.runningTurnId,expandedTurnIds:t.expandedTurnIds,isWorking:!n&&o.isWorking,activeTurnStartedAt:n?null:o.activeTurnStartedAt,resolveModelBadge:t.resolveModelBadge,pendingModelSelection:n?null:o.pendingModelSelection},a=e.deriveGroups(r),s=o.latestTurn;if(n&&s&&s.completedAt!==null){let i=s.turnId;if(a.rows.some(d=>d.kind==="message"?d.message.role==="assistant"&&d.message.turnId===i:d.kind==="work"?d.groupedEntries.some(u=>u.turnId===i):d.kind==="tool-group"&&d.entries.some(u=>u.turnId===i)))return e.deriveGroups({...r,latestTurn:s})}return a}var KU=new Map,$U={markdown:()=>"",download(){}},qU=[],VU={latestTurn:null,latestAssistantMessageId:null,runningTurnId:null,isWorking:!1,workingStepLabel:null,stall:null,retry:null,activeTurnStartedAt:null,totalTurnCount:null,pendingModelSelection:null,scheduledWakes:qU},WU={inputs:null,structure:{rowIds:[],sections:[]},indexById:new Map,rows:[],meta:{status:VU,usageByTurnId:KU,exportApi:$U,finalAssistantMessageReceived:!1},version:0};function GU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function jU(e,t,n,o){let r=UU(n,e),a=QU(t.structure.rowIds,r.rows),s=a?t.indexById:new Map(r.rows.map((g,h)=>[g.id,h])),i=r.rows.map((g,h)=>{let v=a?t.rows[h]:t.rows[t.indexById.get(g.id)??-1],C=v!==void 0&&tw(v,g)?v:g;return C!==v&&o.add(g.id),C});if(!a)for(let g of t.indexById.keys())s.has(g)||o.add(g);let l=nw(i,r.turnGroups,t.structure.sections),d=a?t.structure.rowIds:i.map(g=>g.id),u=a&&GU(t.structure.sections,l)?t.structure:{rowIds:d,sections:l},p=e.derive.hasSettledAssistantMessage(e.timelineEntries,e.status.latestAssistantMessageId),f=t.meta.status===e.status&&t.meta.usageByTurnId===e.usageByTurnId&&t.meta.exportApi===e.exportApi&&t.meta.finalAssistantMessageReceived===p?t.meta:{status:e.status,usageByTurnId:e.usageByTurnId,exportApi:e.exportApi,finalAssistantMessageReceived:p},m=o.size>0||u!==t.structure||f!==t.meta;return{inputs:e,structure:u,indexById:s,rows:i,meta:f,version:m?t.version+1:t.version}}function QU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n].id)return!1;return!0}function gl(e){return e.getStructure().rowIds.some(t=>e.getRow(t)?.kind==="message")}function rw(){let e=null,t=null,n=WU,o=new Set,r=0,a=new Set,s=new Map,i=()=>{if(e===null||n.inputs===e)return n;t??=e.derive.createRowsCache();let l=new Set;n=jU(e,n,t,l);for(let d of l)o.add(d);return n};return{setInputs(l){e=l},hasInputs:()=>e!==null,flush(){if(a.size===0&&s.size===0||e===null)return;let{version:l}=i();if(l===r&&o.size===0)return;r=l;let d=[...o];o.clear();for(let u of d){let p=s.get(u);if(p!==void 0)for(let f of Array.from(p))f()}for(let u of Array.from(a))u()},subscribe(l){return a.add(l),()=>{a.delete(l)}},subscribeRow(l,d){let u=s.get(l);return u===void 0&&(u=new Set,s.set(l,u)),u.add(d),()=>{u.delete(d),u.size===0&&s.get(l)===u&&s.delete(l)}},getStructure:()=>i().structure,getRow(l){let{indexById:d,rows:u}=i(),p=d.get(l);return p===void 0?void 0:u[p]},getRows:()=>i().rows,getMeta:()=>i().meta,getVersion:()=>i().version}}W();function Yp(e){return Ao(e.subscribe,e.getStructure,e.getStructure)}function aw(e,t){let n=M(r=>e.subscribeRow(t,r),[e,t]),o=M(()=>e.getRow(t),[e,t]);return Ao(n,o,o)}function Pn(e,t,n=Object.is){let o=N(null),r=M(()=>{let a=e.getVersion(),s=o.current;if(s!==null&&s.store===e&&s.select===t&&s.version===a)return s.value;let i=t(e),l=s!==null&&s.store===e&&n(s.value,i)?s.value:i;return o.current={store:e,select:t,version:a,value:l},l},[e,t,n]);return Ao(e.subscribe,r,r)}W();W();function sw(e,t){return e.getFullYear()!==new Date(t).getFullYear()}function Qh(e,t){return{month:e,day:"numeric",...t?{year:"numeric"}:{}}}function iw(e){let t=new Intl.DateTimeFormat(e,Qh("numeric",!1)),n=new Intl.DateTimeFormat(e,Qh("numeric",!0)),o=(r,a)=>(sw(r,a)?n:t).format(r);return{ofDate:o,ofIso:(r,a)=>{let s=new Date(r);return Number.isNaN(s.getTime())?"":o(s,a)}}}function lw(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?null:{date:n,formatParams:{date:Qh("short",sw(n,t))}}}function cw(e,t){let n={hour:"numeric",minute:"2-digit",...t?{second:"2-digit"}:{}};return e==="locale"?n:{...n,hour12:e==="12-hour"}}function YU(e){let t=e?.trim();if(t)try{return Intl.DateTimeFormat.supportedLocalesOf([t]),t}catch{return}}function XU(){return typeof window>"u"?null:window.desktopBridge?.getSystemLocale?.()??null}var uw=YU(XU()),dw=new Map;function pw(e,t){let n=`${e}:${t?"seconds":"minutes"}`,o=dw.get(n);if(o)return o;let r=new Intl.DateTimeFormat(uw,cw(e,t));return dw.set(n,r),r}function Yh(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Ur(e,t,n){let o=Yh(e);return o?n("timeline.timestampTooltip",{date:o,formatParams:{date:{...cw(t,!1),...t==="locale"?{hourCycle:pw(t,!1).resolvedOptions().hourCycle}:{},year:"numeric",month:"long",day:"numeric"}}}):""}var fw=iw(uw);function ca(e,t,n,o=Date.now()){let r=Yh(e);if(!r)return"";let a=pw(t,!1).format(r),s=new Date(o),i=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),d=Math.round((i-l)/864e5);return d<=0?a:d===1?n("relativeTime.yesterdayAt",{time:a}):`${fw.ofDate(r,o)} ${a}`}function mw(e,t=Date.now()){return fw.ofIso(e,t)}function gw(e){let t=Yh(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:""}W();var gt=ut(null),Xp=ut(null);W();var hl=new Map,hw=24,JU=4e3,ZU=1024,vw=16384;function Xh(e){let t=hl.get(e);if(t)return t;let n={values:new Map,listeners:new Set,stringLength:0};if(hl.set(e,n),hl.size>hw){for(let[o,r]of hl)if(r.listeners.size===0&&o!==e&&(hl.delete(o),hl.size<=hw))break}return n}function Jh(e,t,n){return Xh(e).values.get(t)??n}function Ac(e,t,n,o=!0){let r=Xh(e);if(typeof n=="string"&&(n=n.slice(0,ZU)),r.values.get(t)===n)return;let a=r.values.get(t);if(typeof a=="string"&&(r.stringLength-=a.length),r.values.delete(t),r.values.set(t,n),typeof n=="string"&&(r.stringLength+=n.length),r.stringLength>vw){for(let[s,i]of r.values)if(!(typeof i!="string"||s===t)&&(r.values.delete(s),r.stringLength-=i.length,r.stringLength<=vw))break}if(r.values.size>JU){let s=r.values.keys().next().value;if(s!==void 0){let i=r.values.get(s);typeof i=="string"&&(r.stringLength-=i.length),r.values.delete(s)}}o&&r.listeners.forEach(s=>s())}function kn(e,t,n){let o=M(i=>{let l=Xh(e);return l.listeners.add(i),()=>l.listeners.delete(i)},[e]),r=M(()=>Jh(e,t,n),[e,t,n]),a=Ao(o,r,r),s=M(i=>Ac(e,t,i),[e,t]);return[a,s]}function Ye(){let e=pn().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var yw=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api"];if(!yw)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{COMMUNICATION_RECORDS_READ_LIMIT:Gre,MAX_PLUGIN_SESSION_PROJECTION_BYTES:jre,MAX_PLUGIN_SKILL_COMPANION_FILE_BYTES:Qre,MAX_PLUGIN_SKILL_COMPANION_TOTAL_BYTES:Yre,MAX_PLUGIN_STREAM_BUFFER:Xre,MAX_PLUGIN_TOOL_PRESENTATION_BYTES:Jre,MAX_PLUGIN_WORKSPACE_WRITE_BYTES:Zre,MEMBER_INSTRUCTIONS_MAX_BYTES:eae,MEMBER_NAME_MAX:tae,MEMBER_RESPONSIBILITY_MAX:nae,MEMBER_TITLE_MAX:oae,MIN_PLUGIN_INTERVAL_MS:rae,PLUGIN_API_MIN_VERSION:aae,PLUGIN_API_VERSION:sae,PLUGIN_PROXY_DIRECT:iae,REASONING_OPTION_LABEL:lae,REQUEST_RESOLVED_TRIGGER_KIND:dae,THREAD_ACTIVITIES_LIST_LIMIT:cae,THREAD_MESSAGES_LIST_LIMIT:uae,TOOL_LIFECYCLE_ACTIVITY_KINDS:pae,TURN_PROGRESS_TRIGGER_KIND:fae,USER_INPUT_PENDING_TRIGGER_KIND:mae,acceptPluginToolPresentation:gae,definePlugin:hae,effortText:Cw,isThreadNotFound:vae,knownEffortLevel:yae,mergeLaunchEnv:Cae,modelOptionLabelKind:xw,modelSelectionStringOption:xae,parseRetryAfterMs:bae,pluginJsonByteLength:Sae,projectOrNull:Iae,readRequestResolved:wae,readThreadFailed:Tae,readTurnProgress:Pae,readUserInputPending:kae,reasoningEffortLevel:Lae,reasoningEffortShortLabel:Rae,relabelModelOptionDescriptors:bw,threadMessagesNewestFirst:Eae,threadOrNull:Mae}=yw;function Jp(e,t,n){if(e!=="opencode"||t.length===0)return!1;let o=n?.trim();return o?!t.some(r=>r.slug===o):!1}function Zp(e,t){if(e)return t?e:e.filter(n=>n.id!=="agent"||n.value!=="plan")}var Sw={effort:"traits.savedOption.effort",reasoningEffort:"traits.savedOption.reasoningEffort",variant:"traits.savedOption.variant"},Iw=e=>`traits.optionValue.${e}`;function e5(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function ww(e,t){if(t==="agent")return e("traits.savedOption.agent");let n=xw(t);return n===void 0?e5(t):e(Sw[n])}function Zh(e,t){return bw(t,{kind:n=>e(Sw[n]),level:n=>e(Iw(n))})}function ev(e,t){return Cw(t,n=>e(Iw(n)))}function Tw(e,t){return(e??[]).map(n=>typeof n.value=="boolean"?{id:n.id,label:t(n.id),type:"boolean",currentValue:n.value}:{id:n.id,label:t(n.id),type:"select",options:[{id:n.value,label:n.value}],currentValue:n.value})}function Pw(e){return e==="failed"?"failed":e==="running"?"running":"idle"}function kw(e){return e.includes("failed")?"failed":e.includes("running")?"running":"idle"}var ef="chat-process-row flex w-full min-w-0 select-none items-center gap-1.5 px-2 text-left";function Nc({children:e}){return c("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:e})}function _c({status:e}){return c("span",{"aria-hidden":!0,className:"flex size-2 shrink-0 items-center justify-center",children:e===null?null:c("span",{className:j("block size-2 rounded-full",e==="failed"?"bg-destructive":e==="success"?"bg-success":"border border-muted-foreground/60")})})}function tf({state:e,variant:t="inline",className:n,children:o}){return x("div",{"data-process-state":e,"data-process-kind":t,className:j("chat-process-shell relative min-w-0 overflow-hidden",t==="tool"?"rounded-lg bg-card":"rounded-md",n),children:[e==="running"?c("span",{"aria-hidden":!0,className:"chat-process-shell-pulse animate-status-pulse"}):null,o]})}W();W();var vl=class extends Error{reason;constructor(t,n,o){super(n,o),this.reason=t}};function t5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.fontSize="16px";let n=document.activeElement;document.body.appendChild(t);try{return t.focus({preventScroll:!0}),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{t.remove();let o=n?.focus;typeof o=="function"&&o.call(n)}}async function n5(e,t){let n=()=>new vl("unavailable",`Clipboard API is unavailable while copying ${t}.`);if(typeof window>"u")throw n();if(!e)return!1;if(typeof navigator>"u"||!navigator.clipboard?.writeText){if(t5(e))return!0;throw n()}try{return await navigator.clipboard.writeText(e),!0}catch(o){throw new vl("write-failed",`Failed to copy ${t} to the clipboard.`,{cause:o})}}function nf({timeout:e=2e3,target:t="text",onCopy:n,onError:o}={}){let[r,a]=G(!1),s=N(null),i=N(n),l=N(o),d=N(t),u=N(e);i.current=n,l.current=o,d.current=t,u.current=e;let p=M((f,m)=>{n5(f,d.current).then(g=>{g&&(s.current&&clearTimeout(s.current),a(!0),i.current?.(m),u.current!==0&&(s.current=setTimeout(()=>{a(!1),s.current=null},u.current)))},g=>{l.current?.(g instanceof Error?g:new Error(String(g)),m)})},[]);return $(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:r}}var Lw=1e3,o5={unavailable:"copyButton.clipboardUnavailable","write-failed":"copyButton.copyFailedDetail"},os=le(function({text:t,size:n="xs",variant:o="outline",className:r,toastAnchor:a="above",label:s}){let{t:i}=Ye(),l=s??i("copyButton.copyToClipboard"),[d,u]=G(!1),[p,f]=G(null),m=N(null),g=(C,y)=>{m.current&&clearTimeout(m.current),f({title:C,description:y}),m.current=setTimeout(()=>{f(null),u(!1)},Lw)};$(()=>()=>{m.current&&clearTimeout(m.current)},[]);let{copyToClipboard:h,isCopied:v}=nf({onCopy:()=>g(i("copyButton.copied")),onError:C=>g(i("copyButton.failedToCopy"),C instanceof vl?i(o5[C.reason]):C.message),timeout:Lw});return x(Me,{open:p!==null||d,onOpenChange:u,children:[c(Ne,{render:c(J,{"aria-label":l,softDisabled:v,onClick:()=>h(t),type:"button",size:n,variant:o,className:j("text-muted-foreground hover:text-foreground",r)}),children:v?c(Dn,{className:"size-3 text-primary"}):c(zs,{className:"size-3"})}),x(Ae,{side:a==="above"?"top":"bottom",className:"max-w-72",role:p?"status":void 0,children:[c("span",{children:p?.title??l}),p?.description?c("span",{className:"block text-muted-foreground",children:p.description}):null]})]})});function of({text:e,label:t,children:n}){return x("span",{className:"group/hover-copy inline-flex min-w-0 items-center gap-0.5",children:[n,c("span",{className:"inline-flex opacity-0 transition-opacity duration-(--control-duration) pointer-events-none group-focus-within/hover-copy:pointer-events-auto group-focus-within/hover-copy:opacity-100 group-hover/hover-copy:pointer-events-auto group-hover/hover-copy:opacity-100 [@media(pointer:coarse)]:pointer-events-auto [@media(pointer:coarse)]:opacity-100",children:c(os,{text:e,label:t,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"})})]})}W();var r5=[".m4v",".mov",".mp4",".ogv",".webm"],a5=[".aac",".flac",".m4a",".mp3",".oga",".ogg",".opus",".wav",".weba"];function Rw(e){let t=e.name.lastIndexOf(".");if(t<=0)return null;let n=e.name.slice(t).toLowerCase();return r5.includes(n)?"video":a5.includes(n)?"audio":null}var s5=["image/gif","image/jpeg","image/png","image/webp"],i5=new Set(s5);function l5(e){return i5.has(e.toLowerCase())}function d5(e){return l5(e)?"image":"file"}var c5=new Set(["application/json","application/xml","application/x-yaml","application/yaml"]),u5=[".doc",".docx",".odt",".ppt",".pptx",".odp",".xls",".xlsx",".ods"];function Kr(e){if(e.type==="image")return"image";let t=e.mimeType.toLowerCase();if(t==="image/svg+xml")return"svg";if(t==="application/pdf")return"pdf";let n=Rw(e);if(n)return n;let o=e.name.lastIndexOf(".");return o>0&&u5.includes(e.name.slice(o).toLowerCase())?"office":t.startsWith("text/")||c5.has(t)?"text":"file"}function ua(e){let t=Kr(e);return t==="image"||t==="svg"}function yl(e){return!Number.isFinite(e)||e<=0?"0 KB":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function tv(e){let t={id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes};return d5(e.mimeType)==="image"?{type:"image",...t}:{type:"file",...t,...e.source?{source:e.source}:{}}}function rf(e,t){let n=e.flatMap(r=>r.previewUrl?[{...r,src:r.previewUrl}]:[]);if(n.length===0)return null;let o=n.findIndex(r=>r.id===t);return o<0?null:{images:n.map(r=>({src:r.src,name:r.name,attachmentId:r.id,...r.source===void 0?{}:{source:r.source},...r.type!==void 0&&r.mimeType!==void 0&&Kr({type:r.type,mimeType:r.mimeType,name:r.name})==="svg"?{svg:!0}:{}})),index:o}}function af(e){switch(e){case"image":case"svg":return lc;case"video":return qa;case"audio":return cr;case"pdf":return Zd;case"office":return ec;case"text":return Jd;case"file":return _o}}function jo(e){return e.source?._tag==="agent-artifact"?e.source:void 0}function nv({rowId:e,messageId:t,attachments:n}){let o=Ge(gt),[r,a]=kn(o.threadKey,`attachments:${t}`,!1),{t:s}=Ye(),i=n.toSorted((d,u)=>+(jo(u)?.delivered===!0)-+(jo(d)?.delivered===!0)),l=r?i:i.slice(0,4);return n.length===0?null:x("div",{className:"mb-2 max-w-[420px]","data-assistant-attachments":"",children:[c("div",{className:"grid grid-cols-2 items-start gap-2",children:l.map(d=>c("div",{className:"min-w-0",children:ua(d)?c(Dc,{images:[d],gallery:i.filter(ua)}):c(Oc,{attachment:d})},d.id))}),!r&&i.length>4?c(J,{variant:"ghost",size:"xs",className:"mt-1","aria-expanded":!1,onClick:()=>{o.onProcessDisclosureChange?.(e),a(!0)},children:s("attachments.showMore")}):null]})}function Dc({images:e,gallery:t}){let n=Ge(gt),{t:o}=Ye();return e.length===0?null:c("div",{className:t?"grid":"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:e.map(r=>x("div",{className:"overflow-hidden rounded-lg border border-border/80 bg-background/70",children:[r.previewUrl?c("button",{type:"button",className:"w-full cursor-zoom-in","data-attachment-action":"preview","data-attachment-name":r.name,"aria-label":o("attachments.preview",{name:r.name}),onClick:()=>{let a=rf(t??e,r.id);a&&n.onImageExpand(a)},children:c("img",{src:r.previewUrl,alt:r.name,loading:"lazy",decoding:"async",className:Kr(r)==="svg"?"block h-auto max-h-[220px] w-full bg-white object-contain":"block h-auto max-h-[220px] w-full object-cover object-top"})}):c("div",{className:"flex min-h-[72px] items-center justify-center px-2 py-3 text-center text-secondary-label text-chat-dense",children:r.name}),jo(r)?.delivered||jo(r)?.title||jo(r)?.note?x("div",{className:"px-2 py-1 text-chat-meta",children:[c("p",{className:"break-words font-medium",children:jo(r)?.title||r.name}),jo(r)?.note?c("p",{className:"whitespace-pre-wrap break-words text-secondary-label",children:jo(r)?.note}):null]}):null]},r.id))})}function Oc(e){let{t}=Ye(),n=Ge(gt).onAttachmentDocumentOpen,o=Kr(e.attachment),r=af(o),a=t("attachments.open",{name:e.attachment.name}),s=x(ge,{children:[c(r,{className:"size-4 shrink-0 text-secondary-label"}),x("span",{className:"min-w-0 flex-1",children:[c("span",{className:"block truncate font-medium text-foreground text-chat-row",children:jo(e.attachment)?.title||e.attachment.name}),jo(e.attachment)?.note?c("span",{className:"block whitespace-pre-wrap break-words text-secondary-label text-chat-meta",children:jo(e.attachment)?.note}):null,c("span",{className:"block text-secondary-label text-chat-meta",children:yl(e.attachment.sizeBytes)})]})]});return!jo(e.attachment)?.delivered&&e.attachment.previewUrl&&(o==="video"||o==="audio")?x("div",{className:"flex max-w-sm flex-col gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:[c("a",{href:e.attachment.previewUrl,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 hover:underline",children:s}),c(wI,{kind:o,src:e.attachment.previewUrl,title:e.attachment.name})]}):n?c("button",{type:"button","data-attachment-action":"open","data-attachment-name":e.attachment.name,"aria-label":a,onClick:()=>n({attachmentId:e.attachment.id,name:e.attachment.name,mimeType:e.attachment.mimeType}),className:"flex w-full cursor-pointer items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 text-start hover:bg-background/90",children:s}):e.attachment.previewUrl?c("a",{href:e.attachment.previewUrl,download:e.attachment.name,target:"_blank",rel:"noreferrer","aria-label":a,className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2 hover:bg-background/90",children:s}):c("div",{className:"flex items-center gap-2 rounded-sm border border-border/70 bg-background/70 px-2.5 py-2",children:s})}W();W();var Fc=e=>e;function $r(){return pn().useThreadDisplayTitle?.()??Fc}W();var Ew=ut(null);function Mw({data:e,target:t,children:n}){let o=K(()=>({data:e,target:t}),[e,t]);return c(Ew,{value:o,children:n})}function sf(){return Ge(Ew)}function Aw({messageId:e}){let t=sf(),n=t?.data.useMessageForks;return!t||!n?null:c(p5,{read:n,target:t.target,messageId:e})}function p5({read:e,target:t,messageId:n}){let{t:o}=it(),r=$r(),[a,s]=G(!1),{threads:i,openThread:l}=e(t,n);return i.length===0?null:x(po,{open:a,onOpenChange:s,children:[c(mo,{render:c(J,{variant:"ghost",size:"xs"}),children:o("forkRelations.count",{count:i.length})}),c(fo,{"aria-label":o("forkRelations.listTitle"),className:"max-h-72 max-w-80 overflow-y-auto p-1",children:i.map(d=>x(J,{variant:"ghost",className:"h-auto w-full flex-col items-start gap-0.5 py-2",onClick:()=>{s(!1),l(d.threadId)},children:[c("span",{className:"max-w-full truncate",children:r(d.title)}),c("time",{className:"text-chat-dense text-muted-foreground",dateTime:d.createdAt,children:new Date(d.createdAt).toLocaleString()})]},d.threadId))})]})}W();function Nw({messageId:e,rowId:t}){let n=sf(),o=n?.data.useMessageMemory,r=n?.data.useMemoryExperience;return!n||!o||!r?null:c(f5,{readMemory:o,readExperience:r,target:n.target,messageId:e,rowId:t})}function f5({readMemory:e,readExperience:t,target:n,messageId:o,rowId:r}){let a=e(n,o);return a===null?null:c(m5,{experienceIds:a.experienceIds,readExperience:t,target:n,messageId:o,rowId:r})}function m5({experienceIds:e,readExperience:t,target:n,messageId:o,rowId:r}){let{t:a}=it(),s=Ge(gt),[i,l]=kn(s.threadKey,`memory-context:${o}`,!1),d=un();return x("div",{className:"flex min-w-0 flex-col items-start gap-1.5 self-stretch","data-memory-context":"",children:[x(J,{variant:"ghost-muted",size:"xs",className:"-ms-1 gap-1.5 [&_svg]:mx-0","aria-expanded":i,"aria-controls":i?d:void 0,onClick:()=>{s.onProcessDisclosureChange?.(r),l(!i)},children:[c(qt,{"aria-hidden":!0,className:j("size-icon-1",!i&&"-rotate-90")}),c(Gd,{"aria-hidden":!0,className:"size-icon-1"}),a("memoryContext.included",{count:e.length})]}),i?c("ul",{id:d,className:"m-0 w-full max-w-xl list-none divide-y divide-border overflow-hidden rounded-xl border border-border bg-card p-0",children:e.map(u=>c(g5,{readExperience:t,target:n,experienceId:u},u))}):null]})}function g5({readExperience:e,target:t,experienceId:n}){let o=e(t,n);return x("li",{className:"flex min-w-0 items-center gap-2.5 py-2 ps-3 pe-2","data-memory-experience-state":o.state,children:[c(h5,{experience:o}),c(v5,{experience:o})]})}function h5({experience:e}){let{t}=it();switch(e.state){case"loading":return x("div",{className:"min-w-0 flex-1","aria-busy":"true",children:[c("span",{className:"sr-only",children:t("memoryContext.loading")}),c(Kh,{className:"h-4 w-3/4"}),c(Kh,{className:"mt-1 h-3 w-1/2"})]});case"failed":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.loadFailed")});case"erased":return c("p",{className:"m-0 min-w-0 flex-1 text-chat-row text-muted-foreground",children:t("memoryContext.erased")});case"active":case"forgotten":{let n=e.state==="forgotten",o=e.recordedAt===null?null:lw(e.recordedAt,Date.now());return x("div",{className:"min-w-0 flex-1",children:[c("p",{className:j("m-0 line-clamp-2 text-ui-sm",e.title===null?"text-muted-foreground":"font-medium",n&&"text-muted-foreground line-through"),children:e.title??t("memoryContext.textUnavailable")}),o===null?null:c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.recordedBy",{author:e.authorLabel??"",...o})}),n?c("p",{className:"m-0 text-chat-row text-muted-foreground",children:t("memoryContext.forgottenNote")}):null]})}}}function v5({experience:e}){let{t}=it();switch(e.state){case"loading":case"erased":return null;case"failed":return c(J,{variant:"ghost",size:"xs",onClick:e.retry,children:t("memoryContext.retry")});case"active":case"forgotten":{let n=e.state==="forgotten";return x("div",{className:"flex shrink-0 items-center gap-1.5",children:[n?c(Go,{variant:"muted",size:"sm",children:t("memoryContext.forgotten")}):null,x(J,{variant:"ghost",size:"xs",disabled:e.pending,softDisabled:e.blockedReason!==null,title:e.blockedReason??void 0,onClick:n?e.restore:e.forget,children:[e.pending?c(Hr,{}):null,t(n?"memoryContext.restore":"memoryContext.forget")]})]})}}}W();var y5=()=>null;function lf(e){let t=(e.useMachineLabel??y5)(e.reference.environmentId),n=$r();return x(ge,{children:[c("div",{className:"wrap-anywhere",children:n(e.reference.title)}),t===null?null:c("div",{className:"text-muted-foreground",children:t})]})}var C5=Object.freeze([]),x5=()=>C5;function _w(e){return e.type==="file"&&e.source?._tag==="thread-reference"}function b5(e){return e.omitted===null?e.carried:x(ge,{children:[c("span",{className:"inline-block max-w-full",children:e.carried})," ",c("span",{className:"inline-block max-w-full",children:e.omitted})]})}function Dw(e){let t=Ge(gt),{t:n}=Ye(),r=(t.threadReferences?.useDeliveries??x5)(t.activeThreadEnvironmentId,e).filter(a=>a.status!=="unreadable");return r.length===0?null:c("ul",{"aria-label":n("threadReference.listLabel"),className:"flex min-w-0 max-w-[min(70%,40rem)] flex-col gap-0.5 text-chat-dense text-muted-foreground",children:r.map(a=>c(S5,{delivery:a},`${a.reference.environmentId}:${a.reference.threadId}`))})}function S5(e){let{delivery:t}=e,n=Ge(gt),{t:o}=Ye(),r=$r(),a=s=>{let i={reference:t.reference};s.dispatchEvent(new CustomEvent(Ji,{bubbles:!0,detail:i}))};return c("li",{"data-thread-reference-delivery":t.status,className:"flex min-w-0",children:x(Me,{children:[x(Ne,{render:c("button",{type:"button",className:"relative flex min-w-0 flex-1 cursor-[var(--control-cursor)] items-start gap-1 rounded-sm text-left hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",onClick:s=>a(s.currentTarget)}),children:[c("span",{className:"flex h-lh shrink-0 items-center",children:c(ia,{"aria-hidden":"true",className:"size-3.5"})}),x("span",{className:"flex min-w-0 flex-1 flex-wrap gap-x-1",children:[c("span",{className:"max-w-max min-w-0 grow basis-24 truncate",children:o("threadReference.title",{title:r(t.reference.title)})}),c("span",{className:"max-w-full",children:t.status==="carried"?c(b5,{carried:o("threadReference.carried",{count:t.carriedMessages}),omitted:t.omittedMessages>0?o("threadReference.omitted",{count:t.omittedMessages}):null}):t.status==="missing"?o("threadReference.missing"):o("threadReference.loading")})]})]}),c(Ae,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(lf,{reference:t.reference,useMachineLabel:n.threadReferences?.useMachineLabel})})]})})}W();function I5(e){let t=e.match(/:(\d+)$/);if(!t?.[1])return{path:e,line:void 0,column:void 0};let n=e.slice(0,-t[0].length),o=n.match(/:(\d+)$/);return o?.[1]?{path:n.slice(0,-o[0].length),line:o[1],column:t[1]}:{path:n,line:t[1],column:void 0}}function ov(e){return e.replaceAll("\\","/")}function rv(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function w5(e){return rv(ov(e.replace(/[\\/]+$/,"")))}function T5(e){return e.slice(e.lastIndexOf("/")+1)}function P5(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function k5(e){return e.startsWith("\\\\")||/^[A-Za-z]:([/\\]|$)/.test(rv(ov(e)))}function df(e,t){let{path:n,line:o,column:r}=I5(e),a=rv(ov(n)),s=a;if(t){let i=w5(t),l=T5(i),d=k5(t)?f=>f.toLowerCase():f=>f,u=d(a),p=d(i);if(u===p)s=l;else if(u.startsWith(`${p}/`))s=`${l}/${a.slice(i.length+1)}`;else if(!P5(a)){let f=a.replace(/^\.\/+/,"").replace(/^\/+/,"");s=u.startsWith(`${d(l)}/`)?a:`${l}/${f}`}}return o?`${s}:${o}${r?`:${r}`:""}`:s}var L5=/<review_comment\b([^>]*)>\s*([\s\S]*?)<\/review_comment>/g,R5=/([a-zA-Z][a-zA-Z0-9_-]*)="([^"]*)"/g,E5=/(`{3,})([^\s`]*)[^\n]*\n([\s\S]*?)\n\1/g;function M5(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function A5(e){let t={};for(let n of e.matchAll(R5))t[n[1]]=M5(n[2]??"");return t}function Ow(e){return e===void 0||!/^\d+$/.test(e)?null:Number(e)}function N5(e){let n=Array.from(e.matchAll(E5)).at(-1),o=n?.index;return{text:e.slice(0,o??e.length).trim(),language:n?.[2]?.trim()||"diff",contents:n?.[3]??""}}function _5(e,t,n){let o=A5(e),r=Ow(o.startIndex),a=Ow(o.endIndex),s=o.filePath?.trim(),i=o.sectionId?.trim();if(!s||!i||r===null||a===null)return null;let l=N5(t);return{id:`review-comment:${n}:${i}:${s}:${r}:${a}`,sectionId:i,sectionTitle:o.sectionTitle?.trim()||null,filePath:s,startIndex:Math.min(r,a),endIndex:Math.max(r,a),rangeLabel:o.rangeLabel?.trim()||null,text:l.text,diff:l.contents,fenceLanguage:l.language}}function cf(e){let t=[],n=0,o=0;for(let a of e.matchAll(L5)){let s=a.index??0,i=e.slice(n,s);i.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:i});let l=_5(a[1]??"",a[2]??"",o);l?(t.push({kind:"review-comment",comment:l}),o+=1):t.push({kind:"text",id:`review-comment-invalid:${s}`,text:a[0]}),n=s+a[0].length}let r=e.slice(n);return r.length>0&&t.push({kind:"text",id:`review-comment-text:${n}`,text:r}),t}function Fw(e,t){let n=Math.max(0,...Array.from(t.matchAll(/`+/g),r=>r[0].length)),o="`".repeat(Math.max(3,n+1));return[`${o}${e}`,t.trimEnd(),o].join(`
|
|
3762
3762
|
`)}function Bw(e){if((e.fenceLanguage??"diff")!=="diff")return"";let t=e.diff.trim();if(t.length===0)return"";if(t.startsWith("diff --git "))return t;let n=e.filePath.replaceAll("\\","/");return[`diff --git a/${n} b/${n}`,`--- a/${n}`,`+++ b/${n}`,t].join(`
|
|
3763
3763
|
`)}var Bc="[a-zA-Z][a-zA-Z0-9:_-]*";function Cl(e){return e===" "||e===`
|
|
3764
|
-
`||e===" "||e==="\r"}function xl(e){return e.enabled&&e.userInvocable!==!1}var Hw="ycodium",zw=`${Hw}:`,D5=new RegExp(String.raw`(^|\s)([$/])(${Bc})(?=\s|$)`,"g");function av(e){return[...e.matchAll(D5)].map(t=>{let n=(t.index??0)+(t[1]?.length??0),o=t[3]??"";return{sigil:t[2],name:o,start:n,end:n+o.length+1}})}var
|
|
3764
|
+
`||e===" "||e==="\r"}function xl(e){return e.enabled&&e.userInvocable!==!1}var Hw="ycodium",zw=`${Hw}:`,D5=new RegExp(String.raw`(^|\s)([$/])(${Bc})(?=\s|$)`,"g");function av(e){return[...e.matchAll(D5)].map(t=>{let n=(t.index??0)+(t[1]?.length??0),o=t[3]??"";return{sigil:t[2],name:o,start:n,end:n+o.length+1}})}var Yse=new RegExp(String.raw`([$/])(${Bc})(?=\s|$)`,"y");function Uw(e,t){let n=t.get(e);if(n!==void 0)return n;if(!e.startsWith(zw))return;let o=t.get(e.slice(zw.length));return o?.scope===Hw?o:void 0}function Kw(e,t,n,o=Cl){if(t.length!==e.length+1)return null;let r=0;for(;r<e.length&&e[r]===t[r];)r+=1;let a=t.charAt(r);if(!Cl(a)||r<e.length&&o(e.charAt(r))||t.slice(r+1)!==e.slice(r))return null;let s=r;for(;s>0&&!o(t.charAt(s-1));)s-=1;let l=O5.exec(t.slice(s,r))?.[1];return l===void 0||Uw(l,n)===void 0?null:{start:s,end:r+1,replacement:`$${l}${a}`}}var O5=new RegExp(String.raw`^/(${Bc})$`);function uf(e){return new Map(e.map(t=>[t.name,t]))}function $w(e,t){return t.size===0?[]:av(e).flatMap(n=>{let o=Uw(n.name,t);return o===void 0?[]:[{...n,skill:o}]})}var F5="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium leading-none align-middle",B5=`${F5} border border-border/70 bg-accent/40 text-foreground`,pf=`${B5} text-[12px]`,ff="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",mf="truncate leading-tight",qw='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>';var Vw="inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium leading-none align-middle",Ww=`${Vw} border border-border/70 bg-accent/40 text-foreground`,z5=`${Ww} text-[12px]`,Qo=`${Ww} text-[0.86em] select-none`,mr="relative inline-flex align-[-0.125em] leading-none data-[composer-chip-selected]:after:pointer-events-none data-[composer-chip-selected]:after:absolute data-[composer-chip-selected]:after:inset-0 data-[composer-chip-selected]:after:rounded-[6px] data-[composer-chip-selected]:after:bg-[Highlight] data-[composer-chip-selected]:after:opacity-30 data-[composer-chip-selected]:after:content-['']",ho="block size-[1.17em] shrink-0 self-center opacity-85 [&>svg]:block",Gw="truncate leading-tight",vo="block self-center truncate leading-tight select-none",sv="border-skill-chip-border bg-skill-chip text-skill-chip-foreground",jw=`${Vw} select-none border ${sv} text-[0.86em]`,Qw='<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',gf="ml-[0.17em] inline-flex size-[1.17em] shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/72 transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";function H5(e){return e.split(/[\s_-]+/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function U5(e){let t=e.displayName?.trim();return t||H5(e.name)}function Yw(e){let t=[],n=0;for(let o of $w(e.text,e.index))o.start>n&&t.push(e.text.slice(n,o.start)),t.push(c(K5,{skill:o.skill,rawText:e.text.slice(o.start,o.end)},`${o.start}:${o.name}`)),n=o.end;return n===0?c(ge,{children:e.text}):(n<e.text.length&&t.push(e.text.slice(n)),c(ge,{children:t}))}function K5(e){return c("span",{className:"inline-flex align-middle leading-none","data-markdown-copy":e.rawText,children:x("span",{className:j(pf,sv),children:[c("span",{"aria-hidden":"true",className:ff,dangerouslySetInnerHTML:{__html:qw}}),c("span",{className:mf,children:U5(e.skill)})]})})}function Xw(e){let{label:t,tooltipText:n,expired:o=!1}=e;return x(Me,{children:[x(Ne,{render:c("span",{className:j(pf,o&&"border-destructive/35 bg-destructive/8 text-destructive-foreground"),"data-terminal-context-expired":o?"true":void 0}),children:[c(Do,{className:j(ff,"size-icon-1",o&&"opacity-100")}),c("span",{className:mf,children:t})]}),c(Ae,{side:"top",className:"max-w-80 whitespace-pre-wrap leading-tight",children:n})]})}var $5=/\n*<element_context>\n([\s\S]*?)\n<\/element_context>\s*$/;function bl(e){let t=$5.exec(e);if(!t)return{promptText:e,contextCount:0,contexts:[]};let n=e.slice(0,t.index).replace(/\n+$/,""),o=q5(t[1]??"");return{promptText:n,contextCount:o.length,contexts:o}}function q5(e){let t=[],n=null,o=()=>{n&&(t.push({header:n.header,body:n.bodyLines.join(`
|
|
3765
3765
|
`).trimEnd()}),n=null)};for(let r of e.split(`
|
|
3766
3766
|
`)){let a=/^- (.+):$/.exec(r);if(a){o(),n={header:a[1],bodyLines:[]};continue}n&&(r.startsWith(" ")?n.bodyLines.push(r.slice(2)):r.length===0&&n.bodyLines.push(""))}return o(),t}var V5=/\n*<terminal_context>\n([\s\S]*?)\n<\/terminal_context>\s*$/;function W5(e){let t=[],n=null,o=()=>{n&&(t.push({header:n.header,body:n.bodyLines.join(`
|
|
3767
3767
|
`).trimEnd()}),n=null)};for(let r of e.split(`
|
|
@@ -3800,12 +3800,12 @@ ${iT}`,mK=new RegExp(`^${Cf}\\n<preset-prefix id="([^"]*)">\\n([\\s\\S]*?)\\n</p
|
|
|
3800
3800
|
`?r.push(zl()):i===" "?r.push(wm()):i!==""&&r.push(Rn(i))}return{node:r}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=zk(o,!1))!==null;){let a=o.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=zk(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Rn(n)}}function zk(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let a=n.parentElement;if(a===null)return null;n=a}if(n=o,oo(n)){let a=n.style.display;if(a===""&&!FR(n)||a!==""&&!a.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Wr(n))return n;if(n.nodeName==="BR")return null}}var pV={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function fa(e){let t=pV[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:$y(e.style,t),node:null}}function Rn(e=""){return Iu(new gi(e))}function Ue(e){return e instanceof gi}function $y(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",a=o.includes("line-through"),s=e.fontStyle==="italic",i=o.includes("underline"),l=e.verticalAlign;return d=>(Ue(d)&&(r&&!d.hasFormat("bold")&&d.toggleFormat("bold"),a&&!d.hasFormat("strikethrough")&&d.toggleFormat("strikethrough"),s&&!d.hasFormat("italic")&&d.toggleFormat("italic"),i&&!d.hasFormat("underline")&&d.toggleFormat("underline"),l!=="sub"||d.hasFormat("subscript")||d.toggleFormat("subscript"),l!=="super"||d.hasFormat("superscript")||d.toggleFormat("superscript"),t&&!d.hasFormat(t)&&d.toggleFormat(t)),d)}var Hl=class e extends gi{static getType(){return"tab"}static clone(t){return new e(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){let n=super.createDOM(t),o=Fl(t.theme,"tab");return o!==void 0&&n.classList.add(...o),n}static importJSON(t){return wm().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&pL(126),super.setTextContent(" ")}spliceText(t,n,o,r){return o===""&&n===0||o===" "&&n===1||me(286),this}setDetail(t){return t!==2&&me(127),this}setMode(t){return t!=="normal"&&me(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function wm(){return Iu(new Hl)}function qy(e){return e instanceof Hl}var yy=class{key;offset;type;_selection;constructor(t,n,o){this._selection=null,this.key=t,this.offset=n,this.type=o}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:pC(vr(vs(this,"next")),vr(vs(t,"next")))<0}getNode(){let t=Sn(this.key);return t===null&&me(20),t}set(t,n,o,r){let a=this._selection,s=this.key;r&&this.key===t&&this.offset===n&&this.type===o||(this.key=t,this.offset=n,this.type=o,Ql()||(ds()===s&&Mn(t),a!==null&&(a.setCachedNodes(null),a.dirty=!0)))}};function br(e,t,n){return new yy(e,t,n)}function Vv(e,t){let n=t.__key,o=e.offset,r="element";if(Ue(t)){r="text";let a=t.getTextContentSize();o>a&&(o=a)}else if(!pe(t)){let a=t.getNextSibling();if(Ue(a))n=a.__key,o=0,r="text";else{let s=t.getParent();s&&(n=s.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function Hk(e,t){if(pe(t)){let n=t.getLastDescendant();pe(n)||Ue(n)?Vv(e,n):Vv(e,t)}else Vv(e,t)}var fm=class e{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Cu(t))return!1;let n=this._nodes,o=t._nodes;return n.size===o.size&&Array.from(n).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let n=this.getNodes(),o=n.length,r=n[o-1],a;if(Ue(r))a=r.select();else{let s=r.getIndexWithinParent()+1;a=r.getParentOrThrow().select(s,s)}a.insertNodes(t);for(let s=0;s<o;s++)n[s].remove()}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=this._nodes,o=[];for(let r of n){let a=Sn(r);a!==null&&o.push(a)}return Ql()||(this._cachedNodes=o),o}getTextContent(){let t=this.getNodes(),n="";for(let o=0;o<t.length;o++)n+=t[o].getTextContent();return n}deleteNodes(){let t=this.getNodes();if((Rt()||Ci())===this&&t[0]){let n=_n(t[0],"next");KR(hs(n,n))}for(let n of t)n.remove()}};function Je(e){return e instanceof hi}var hi=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,o,r){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!Je(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=(function(o){let r=[],[a,s]=o.getTextSlices();a&&r.push(a.caret.origin);let i=new Set,l=new Set;for(let d of o)if(Cr(d)){let{origin:u}=d;r.length===0?i.add(u):(l.add(u),r.push(u))}else{let{origin:u}=d;pe(u)&&l.has(u)||r.push(u)}if(s&&r.push(s.caret.origin),yi(o.focus)&&pe(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let d=xa(o.focus.origin,"previous");Cr(d)&&i.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(r[r.length-1]);d=Gl(d))i.delete(d.origin),r.pop();for(;r.length>1;){let d=r[r.length-1];if(!pe(d)||l.has(d)||d.isEmpty()||i.has(d))break;r.pop()}if(r.length===0&&o.isCollapsed()){let d=vr(o.anchor),u=vr(o.anchor.getFlipped()),p=m=>Ca(m)?m.origin:m.getNodeAtCaret(),f=p(d)||p(u)||(o.anchor.getNodeAtCaret()?d.origin:u.origin);r.push(f)}return r})(mC(ky(this),"next"));return Ql()||(this._cachedNodes=n),n}setTextNodeRange(t,n,o,r){this.anchor.set(t.__key,n,"text"),this.focus.set(o.__key,r,"text")}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let n=t[0],o=t[t.length-1],r=this.anchor,a=this.focus,s=r.isBefore(a),[i,l]=Cy(this),d="",u=!0;for(let p=0;p<t.length;p++){let f=t[p];if(pe(f)&&!f.isInline())u||(d+=`
|
|
3801
3801
|
`),u=!f.isEmpty();else if(u=!1,Ue(f)){let m=f.getTextContent();f===n?f===o?r.type==="element"&&a.type==="element"&&a.offset!==r.offset||(m=i<l?m.slice(i,l):m.slice(l,i)):m=s?m.slice(i):m.slice(l):f===o&&(m=s?m.slice(0,l):m.slice(0,i)),d+=m}else!Qt(f)&&!pi(f)||f===o&&this.isCollapsed()||(d+=f.getTextContent())}return d}applyDOMRange(t){let n=Vt(),o=n.getEditorState()._selection,r=lR(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,o);if(r===null)return;let[a,s]=r;this.anchor.set(a.key,a.offset,a.type,!0),this.focus.set(s.key,s.offset,s.type,!0),rm(this)}clone(){let t=this.anchor,n=this.focus;return new e(br(t.key,t.offset,t.type),br(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=hu(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){let n=Vn[t];return(this.format&n)!==0}insertRawText(t){let n=t.split(/(\r?\n|\t)/),o=[],r=n.length;for(let a=0;a<r;a++){let s=n[a];s===`
|
|
3802
3802
|
`||s===`\r
|
|
3803
|
-
`?o.push(zl()):s===" "?o.push(wm()):o.push(Rn(s))}this.insertNodes(o)}insertText(t){let n=this.anchor,o=this.focus,r=this.format,a=this.style,s=n,i=o;!this.isCollapsed()&&o.isBefore(n)&&(s=o,i=n),s.type==="element"&&(function(v,C,y,b){let w=v.getNode(),S=w.getChildAtIndex(v.offset),I=Rn();if(I.setFormat(y),I.setStyle(b),vR(S))S.splice(0,0,[I]);else{let k=On(w)?ya().append(I):I;S===null?w.append(k):S.insertBefore(k)}v.is(C)&&C.set(I.__key,0,"text"),v.set(I.__key,0,"text")})(s,i,r,a),i.type==="element"&&jl(i,vr(vs(i,"next")));let l=s.offset,d=i.offset,u=this.getNodes(),p=u.length,f=u[0];Ue(f)||me(26);let m=f.getTextContent().length,g=f.getParentOrThrow(),h=u[p-1];if(p===1&&i.type==="element"&&(d=m,i.set(s.key,d,"text")),this.isCollapsed()&&l===m&&(ga(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let v=f.getNextSibling();if(Ue(v)&&v.canInsertTextBefore()&&!ga(v)||(v=Rn(),v.setFormat(r),v.setStyle(a),g.canInsertTextAfter()?f.insertAfter(v):g.insertAfter(v)),v.select(0,0),f=v,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(ga(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let v=f.getPreviousSibling();if(Ue(v)&&!ga(v)||(v=Rn(),v.setFormat(r),g.canInsertTextBefore()?f.insertBefore(v):g.insertBefore(v)),v.select(),f=v,t!=="")return void this.insertText(t)}else if(f.isSegmented()&&l!==m){let v=Rn(f.getTextContent());v.setFormat(r),f.replace(v),f=v}else if(!this.isCollapsed()&&t!==""){let v=h.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||pe(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter()))return this.insertText(""),iR(this.anchor,this.focus),void this.insertText(t)}if(p===1){if(cs(f)){let b=Rn(t);return b.select(),void f.replace(b)}let v=f.getFormat(),C=f.getStyle();if(l!==d||v===r&&C===a){if(qy(f)){let b=Rn(t);return b.setFormat(r),b.setStyle(a),b.select(),void f.replace(b)}}else{if(f.getTextContent()!==""){let b=Rn(t);if(b.setFormat(r),b.setStyle(a),b.select(),l===0)f.insertBefore(b,!1);else{let[w]=f.splitText(l);w.insertAfter(b,!1)}return void(b.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(a)}let y=d-l;f=f.spliceText(l,y,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=v,this.style=C,f.isComposing()&&(this.anchor.offset-=t.length))}else{let v=new Set([...f.getParentKeys(),...h.getParentKeys()]),C=pe(f)?f:f.getParentOrThrow(),y=pe(h)?h:h.getParentOrThrow(),b=h;if(!C.is(y)&&y.isInline())do b=y,y=y.getParentOrThrow();while(y.isInline());if(i.type==="text"&&(d!==0||h.getTextContent()==="")||i.type==="element"&&h.getIndexWithinParent()<d)if(Ue(h)&&!cs(h)&&d!==h.getTextContentSize()){if(h.isSegmented()){let P=Rn(h.getTextContent());h.replace(P),h=P}On(i.getNode())||i.type!=="text"||(h=h.spliceText(0,d,"")),v.add(h.__key)}else{let P=h.getParentOrThrow();P.canBeEmpty()||P.getChildrenSize()!==1?h.remove():P.remove()}else v.add(h.__key);let w=y.getChildren(),S=new Set(u),I=C.is(y),k=C.isInline()&&f.getNextSibling()===null?C:f;for(let P=w.length-1;P>=0;P--){let T=w[P];if(T.is(f)||pe(T)&&T.isParentOf(f))break;T.isAttached()&&(!S.has(T)||T.is(b)?I||k.insertAfter(T,!1):T.remove())}if(!I){let P=y,T=null;for(;P!==null;){let L=P.getChildren(),E=L.length;(E===0||L[E-1].is(T))&&(v.delete(P.__key),T=P),P=P.getParent()}}if(cs(f))if(l===m)f.select();else{let P=Rn(t);P.select(),f.replace(P)}else f=f.spliceText(l,m-l,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=t.length));for(let P=1;P<p;P++){let T=u[P],L=T.__key;v.has(L)||T.remove()}}}removeText(){let t=Rt()===this;su(this,$R(ky(this))),t&&Rt()!==this&&Co(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void Mn(null);let o=this.getNodes(),r=[];for(let w of o)Ue(w)&&r.push(w);let a=w=>{o.forEach(S=>{if(pe(S)){let I=S.getFormatFlags(t,w);S.setTextFormat(I)}})},s=r.length;if(s===0)return this.toggleFormat(t),Mn(null),void a(n);let i=this.anchor,l=this.focus,d=this.isBackward(),u=d?l:i,p=d?i:l,f=0,m=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===m.getTextContentSize()&&(f=1,m=r[1],g=0),m==null)return;let h=m.getFormatFlags(t,n);a(h);let v=s-1,C=r[v],y=p.type==="text"?p.offset:C.getTextContentSize();if(m.is(C)){if(g===y)return;if(ga(m)||g===0&&y===m.getTextContentSize())m.setFormat(h);else{let w=m.splitText(g,y),S=g===0?w[0]:w[1];S.setFormat(h),u.type==="text"&&u.set(S.__key,0,"text"),p.type==="text"&&p.set(S.__key,y-g,"text")}return void(this.format=h)}g===0||ga(m)||([,m]=m.splitText(g),g=0),m.setFormat(h);let b=C.getFormatFlags(t,h);y>0&&(y===C.getTextContentSize()||ga(C)||([C]=C.splitText(y)),C.setFormat(b));for(let w=f+1;w<v;w++){let S=r[w],I=S.getFormatFlags(t,b);S.setFormat(I)}u.type==="text"&&u.set(m.__key,g,"text"),p.type==="text"&&p.set(C.__key,y,"text"),this.format=h|b}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=Rt();return Je(g)||me(134),g.insertNodes(t)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=ru(n,va),r=t[t.length-1];if(pe(o)&&"__language"in o){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let g=Wv(this);o.splice(g,0,t),r.selectEnd()}return}if(!t.some(g=>(pe(g)||Qt(g))&&!g.isInline())){pe(o)||me(211,n.constructor.name,n.getType());let g=Wv(this);return o.splice(g,0,t),void r.selectEnd()}let a=(function(g){let h=ya(),v=null;for(let C=0;C<g.length;C++){let y=g[C],b=pi(y);if(b||Qt(y)&&y.isInline()||pe(y)&&y.isInline()||Ue(y)||y.isParentRequired()){if(v===null&&(v=y.createParentElementNode(),h.append(v),b))continue;v!==null&&v.append(y)}else h.append(y),v=null}return h})(t),s=a.getLastDescendant(),i=a.getChildren(),l=!pe(o)||!o.isEmpty()?this.insertParagraph():null,d=i[i.length-1],u=i[0];var p;pe(p=u)&&va(p)&&!p.isEmpty()&&pe(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(pe(o)||me(211,n.constructor.name,n.getType()),o.append(...u.getChildren()),u=i[1]),u&&(o===null&&me(212,n.constructor.name,n.getType()),(function(g,h){let v=h.getParentOrThrow().getLastChild(),C=h,y=[h];for(;C!==v;)C.getNextSibling()||me(140),C=C.getNextSibling(),y.push(C);let b=g;for(let w of y)b=b.insertAfter(w)})(o,u));let f=ru(s,va);l&&pe(f)&&(l.canMergeWhenEmpty()||va(d))&&(f.append(...l.getChildren()),l.remove()),pe(o)&&o.isEmpty()&&o.remove(),s.selectEnd();let m=pe(o)?o.getLastChild():null;pi(m)&&f!==o&&m.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=ya();return Bo().splice(this.anchor.offset,0,[s]),s.select(),s}let t=Wv(this),n=ru(this.anchor.getNode(),va);pe(n)||me(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...r),a.selectStart(),a):null}insertLineBreak(t){let n=zl();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[a,s]=Cy(this),i=this.isBackward(),[l,d]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,p]=i?[s,a]:[a,s];if(n===0)return[];if(n===1){if(Ue(o)&&!this.isCollapsed()){let f=o.splitText(u,p),m=u===0?f[0]:f[1];return m?(l.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[o]}if(Ue(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),Ue(r)){let f=r.getTextContent().length;p===0?t.pop():p!==f&&([r]=r.splitText(p),t[t.length-1]=r,d.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(Qk(this,t,n,o))return;let r=t==="move",a=Vt(),s=Ir(zo(a));if(!s)return;let i=a._blockCursorElement,l=a._rootElement,d=this.focus.getNode();if(l===null||i===null||!pe(d)||d.isInline()||d.canBeEmpty()||Sy(i,a,l),this.dirty){let u=$l(a,this.anchor.key),p=$l(a,this.focus.key);this.anchor.type==="text"&&(u=vi(u)),this.focus.type==="text"&&(p=vi(p)),u&&p&&uR(s,u,this.anchor.offset,p,this.focus.offset)}if((function(u,p,f,m){u.modify(p,f,m)})(s,t,n?"backward":"forward",o),s.rangeCount>0){let u=s.getRangeAt(0),p=this.anchor.getNode(),f=On(p)?p:NR(p);if(this.applyDOMRange(u),this.dirty=!0,!r){let m=this.getNodes(),g=[],h=!1;for(let v=0;v<m.length;v++){let C=m[v];ym(C,f)?g.push(C):h=!0}if(h&&g.length>0)if(n){let v=g[0];pe(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{let v=g[g.length-1];pe(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(v){let C=v.focus,y=v.anchor,b=y.key,w=y.offset,S=y.type;y.set(C.key,C.offset,C.type,!0),C.set(b,w,S,!0)})(this)}}o==="lineboundary"&&Qk(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&pe(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),a=n.getNextSibling()||(r===null?null:r.getNextSibling());if(pe(a)&&a.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;let a=cC(vs(o,t?"previous":"next"));if(a.getTextSlices().every(i=>i===null||i.distance===0)){let i={type:"initial"};for(let l of a.iterNodeCarets("shadowRoot"))if(Cr(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(pe(a.anchor.origin)&&a.anchor.origin.isEmpty()){let d=vr(l);su(this,hs(d,d)),a.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}}else{if(i.type==="merge-block")break;if(yi(l)){if(pe(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(a.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Qt(l.origin)){if(!l.origin.isIsolated())if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&pe(a.anchor.origin)&&a.anchor.origin.isEmpty()){a.anchor.origin.remove();let d=Vy();d.add(l.origin.getKey()),Co(d)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:d}=i;return su(this,hs(!l.origin.isEmpty()&&d.isEmpty()?Xl(_n(d,l.direction)):a.anchor,l)),this.removeText()}}let s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&o.offset===0&&Kk(this,o.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(r=o.type==="text"?o.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,d=i.getTextContentSize();if(i.is(r)||t&&l!==d||!t&&l!==0)return void $k(i,t,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,d=r.getTextContentSize();if(r.is(i)||t&&l!==0||!t&&l!==d)return void $k(r,t,l)}(function(l,d){let u=l.anchor,p=l.focus,f=u.getNode(),m=p.getNode();if(f===m&&u.type==="text"&&p.type==="text"){let g=u.offset,h=p.offset,v=g<h,C=v?g:h,y=v?h:g,b=y-1;C!==b&&(function(w){return!(PR(w)||fV(w))})(f.getTextContent().slice(C,y))&&(d?p.set(p.key,b,p.type):u.set(u.key,b,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&On(o.getParent())&&o.getPreviousSibling()===null&&Kk(this,o)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Cu(e){return e instanceof fm}function Uk(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Cy(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[Uk(n),Uk(o)]}function Kk(e,t){for(let n=t;n;n=n.getParent()){if(pe(n)){if(n.collapseAtStart(e))return!0;if(tr(n))break}if(n.getPreviousSibling())break}return!1}var fV=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1})();function $k(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),a=r.length,s=0,i=0;for(let d=0;d<a;d++){let u=d===a-1;if(i=s,s+=r[d].length,t&&s===n||s>n||u){r.splice(d,1),u&&(i=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(i,i))}function qk(e,t,n,o){let r,a=t;if(oo(e)){let s=!1,i=e.childNodes,l=i.length,d=o._blockCursorElement;a===l&&(s=!0,a=l-1);let u=i[a],p=!1;if(u===d)u=i[a+1],p=!0;else if(d!==null){let f=d.parentNode;e===f&&t>Array.prototype.indexOf.call(f.children,d)&&a--}if(r=_l(u),Ue(r))a=xr(r,s?"next":"previous");else{let f=_l(e);if(f===null)return null;if(pe(f)){let m=o.getElementByKey(f.getKey());m===null&&me(214),[f,a]=f.getDOMSlot(m).resolveChildIndex(f,m,e,t),pe(f)||me(215),s&&a>=f.getChildrenSize()&&(a=Math.max(0,f.getChildrenSize()-1));let h=f.getChildAtIndex(a);if(pe(h)&&(function(v,C,y){let b=v.getParent();return y===null||b===null||!b.canBeEmpty()||b!==y.getNode()})(h,0,n)){let v=s?h.getLastDescendant():h.getFirstDescendant();v===null?f=h:(h=v,f=pe(h)?h:h.getParentOrThrow()),a=0}Ue(h)?(r=h,f=null,a=xr(h,s?"next":"previous")):h!==f&&s&&!p&&(pe(f)||me(216),a=Math.min(f.getChildrenSize(),a+1))}else{let m=f.getIndexWithinParent();a=t===0&&Qt(f)&&_l(e)===f?m:m+1,f=f.getParentOrThrow()}if(pe(f))return br(f.__key,a,"element")}}else r=_l(e);return Ue(r)?br(r.__key,xr(r,a,"clamp"),"text"):null}function Vk(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let a=r.getPreviousSibling(),s=r.getParent();if(t){if((n||!t)&&a===null&&pe(s)&&s.isInline()){let i=s.getPreviousSibling();Ue(i)&&e.set(i.__key,i.getTextContent().length,"text")}}else pe(a)&&!n&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):Ue(a)&&e.set(a.__key,a.getTextContent().length,"text")}else if(o===r.getTextContent().length){let a=r.getNextSibling(),s=r.getParent();if(t&&pe(a)&&a.isInline())e.set(a.__key,0,"element");else if((n||t)&&a===null&&pe(s)&&s.isInline()&&!s.canInsertTextAfter()){let i=s.getNextSibling();Ue(i)&&e.set(i.__key,0,"text")}}}function iR(e,t,n){if(e.type==="text"&&t.type==="text"){let o=e.isBefore(t),r=e.is(t);Vk(e,o,r),Vk(t,!o,r),r&&t.set(e.key,e.offset,e.type)}}function lR(e,t,n,o,r,a){if(e===null||n===null||!xu(r,e,n))return null;let s=qk(e,t,Je(a)?a.anchor:null,r);if(s===null)return null;let i=qk(n,o,Je(a)?a.focus:null,r);if(i===null)return null;if(s.type==="element"&&i.type==="element"){let l=_l(e),d=_l(n);if(Qt(l)&&Qt(d))return null}return iR(s,i),[s,i]}function mV(e){return pe(e)&&!e.isInline()}function dR(e,t,n,o,r,a){let s=ba(),i=new hi(br(e,t,r),br(n,o,a),0,"");return i.dirty=!0,s._selection=i,i}function cR(){let e=br("root",0,"element"),t=br("root",0,"element");return new hi(e,t,0,"")}function Vy(){return new fm(new Set)}function gV(e,t){return Tm(null,e,t,null)}function Tm(e,t,n,o){let r=n._window;if(r===null)return null;let a=o||r.event,s=a?a.type:void 0,i=s==="selectionchange",l=!Zv&&(i||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&a&&a.detail===3||s==="drop"||s===void 0),d,u,p,f;if(Je(e)&&!l)return e.clone();if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,p=t.anchorOffset,f=t.focusOffset,(i||s===void 0)&&Je(e)&&!xu(n,d,u))return e.clone();let m=lR(d,p,u,f,n,e);if(m===null)return null;let[g,h]=m,v=0,C="";if(Je(e)){let y=e.anchor;if(g.key===y.key)v=e.format,C=e.style;else{let b=g.getNode();Ue(b)?(v=b.getFormat(),C=b.getStyle()):pe(b)&&(v=b.getTextFormat(),C=b.getTextStyle())}}return new hi(g,h,v,C)}function Rt(){return ba()._selection}function Ci(){return Vt()._editorState._selection}function mm(e,t,n,o=1){let r=e.anchor,a=e.focus,s=r.getNode(),i=a.getNode();if(!t.is(s)&&!t.is(i))return;let l=t.__key;if(e.isCollapsed()){let d=r.offset;if(n<=d&&o>0||n<d&&o<0){let u=Math.max(0,d+o);r.set(l,u,"element"),a.set(l,u,"element"),Wk(e)}}else{let d=e.isBackward(),u=d?a:r,p=u.getNode(),f=d?r:a,m=f.getNode();if(t.is(p)){let g=u.offset;(n<=g&&o>0||n<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(t.is(m)){let g=f.offset;(n<=g&&o>0||n<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}Wk(e)}function Wk(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,a=t.getNode(),s=o.getNode();if(e.isCollapsed()){if(!pe(a))return;let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),o.set(d.__key,u,"text")}return}if(pe(a)){let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(pe(s)){let i=s.getChildrenSize(),l=r>=i,d=l?s.getChildAtIndex(i-1):s.getChildAtIndex(r);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),o.set(d.__key,u,"text")}}}function gm(e,t,n,o,r){let a=null,s=0,i=null;o!==null?(a=o.__key,Ue(o)?(s=o.getTextContentSize(),i="text"):pe(o)&&(s=o.getChildrenSize(),i="element")):r!==null&&(a=r.__key,Ue(r)?i="text":pe(r)&&(i="element")),a!==null&&i!==null?e.set(a,s,i):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Gk(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function uR(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function jk(e,t,n){let o=$l(e,t.getKey());if(pe(t)){let r=t.getDOMSlot(o);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function hV(e,t,n,o,r,a,s){let i=o.anchorNode,l=o.focusNode,d=o.anchorOffset,u=o.focusOffset,p=document.activeElement;if(r.has(eR)&&p!==a||p!==null&&Xy(p))return;if(!Je(t))return void(e!==null&&xu(n,i,l)&&o.removeAllRanges());let f=t.anchor,m=t.focus,g=f.getNode(),h=m.getNode(),[v,C]=jk(n,g,f.offset),[y,b]=jk(n,h,m.offset),w=t.format,S=t.style,I=t.isCollapsed(),k=v,P=y,T=!1;var L,E,A,R,F;if(f.type==="text"?(k=vi(v),T=g.getFormat()!==w||g.getStyle()!==S):Je(e)&&e.anchor.type==="text"&&(T=!0),m.type==="text"&&(P=vi(y)),k!==null&&P!==null&&(I&&(e===null||T||Je(e)&&(e.format!==w||e.style!==S))&&(L=w,E=S,A=C,R=f.key,F=performance.now(),GL=[L,E,A,R,F]),d!==C||u!==b||i!==k||l!==P||o.type==="Range"&&I||(p!==null&&a.contains(p)||r.has(vy)||a.focus({preventScroll:!0}),f.type==="element"))){if(uR(o,k,C,P,b),!ps||!t.isCollapsed()||a===null||r.has(vy)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!r.has(tR)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let H=Je(t)&&t.anchor.type==="element"?k.childNodes[C]||null:o.rangeCount>0?o.getRangeAt(0):null;if(H!==null){let z;if(H instanceof Text){let _=document.createRange();_.selectNode(H),z=_.getBoundingClientRect()}else z=H.getBoundingClientRect();(function(_,Q,D){let O=rC(D),re=aC(O);if(O===null||re===null)return;let{top:U,bottom:ne}=Q,X=0,q=0,V=D;for(;V!==null;){let Z=V===O.body;if(Z)X=0,q=zo(_).innerHeight;else{let ee=V.getBoundingClientRect();X=ee.top,q=ee.bottom}let ae=0;if(U<X?ae=-(X-U):ne>q&&(ae=ne-q),ae!==0)if(Z)re.scrollBy(0,ae);else{let ee=V.scrollTop;V.scrollTop+=ae;let oe=V.scrollTop-ee;U-=oe,ne-=oe}if(Z)break;V=Su(V)}})(n,z,a)}}my=!0}}function vV(e){let t=Rt()||Ci();t===null&&(t=Bo().selectEnd()),t.insertNodes(e)}function yV(){let e=Rt();return e===null?"":e.getTextContent()}function Wv(e){let t=e;e.isCollapsed()||t.removeText();let n=Rt();Je(n)&&(t=n),Je(t)||me(161);let o=t.anchor,r=o.getNode(),a=o.offset;for(;!va(r);){let s=r;if([r,a]=CV(r,a),s.is(r))break}return a}function CV(e,t){let n=e.getParent();if(!n){let r=ya();return Bo().append(r),r.select(),[Bo(),0]}if(Ue(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let a=t===0?0:1;return[n,r[0].getIndexWithinParent()+a]}if(!pe(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new hi(br(e.__key,t,"element"),br(e.__key,t,"element"),0,""),a=e.insertNewAfter(r);a&&a.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Qk(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[u,p]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(u.key,u.offset,u.type),!0}let a=vs(e.focus,n?"previous":"next"),s=o==="lineboundary",i=t==="move",l=a,d=r==="decorators-and-blocks";if(!qR(l)){for(let u of l){d=!1;let{origin:p}=u;if(!Qt(p)||p.isIsolated()||(l=u,!s||!p.isInline()))break}if(d)for(let u of cC(a).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Cr(u))u.origin.isInline()||(l=u);else{if(pe(u.origin))continue;Qt(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===a)return!1;if(i&&!s&&Qt(l.origin)&&l.origin.isKeyboardSelectable()){let u=Vy();return u.add(l.origin.getKey()),Co(u),!0}return l=vr(l),i&&jl(e.anchor,l),jl(e.focus,l),d||!s}var An=null,Nn=null,yo=!1,Gv=!1,tm=0,Yk={characterData:!0,childList:!0,subtree:!0};function Ql(){return yo||An!==null&&An._readOnly}function En(){yo&&me(13)}function pR(){tm>99&&me(14)}function ba(){return An===null&&me(195,fR()),An}function Vt(){return Nn===null&&me(196,fR()),Nn}function fR(){let e=0,t=new Set,n=ms.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let a=bu(r);if(km(a))e++;else if(a){let s=String(a.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function xV(){return Nn}function Xk(e,t,n){let o=t.__type,r=Qy(e,o),a=n.get(o);a===void 0&&(a=Array.from(r.transforms),n.set(o,a));let s=a.length;for(let i=0;i<s&&(a[i](t),t.isAttached());i++);}function Jk(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function mR(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function bV(e){return Wy(e,Vt()._nodes)}function Wy(e,t){let n=e.type,o=t.get(n);o===void 0&&me(17,n);let r=o.klass;e.type!==r.getType()&&me(18,r.name);let a=r.importJSON(e),s=e.children;if(pe(a)&&Array.isArray(s))for(let i=0;i<s.length;i++){let l=Wy(s[i],t);a.append(l)}return a}function Zk(e,t,n){let o=An,r=yo,a=Nn;An=t,yo=!0,Nn=e;try{return n()}finally{An=o,yo=r,Nn=a}}function ha(e,t){let n=e._pendingEditorState,o=e._rootElement,r=e._headless||o===null;if(n===null)return;let a=e._editorState,s=a._selection,i=n._selection,l=e._dirtyType!==0,d=An,u=yo,p=Nn,f=e._updating,m=e._observer,g=null;if(e._pendingEditorState=null,e._editorState=n,!r&&l&&m!==null){Nn=e,An=n,yo=!1,e._updating=!0;try{let I=e._dirtyType,k=e._dirtyElements,P=e._dirtyLeaves;m.disconnect(),g=Hq(a,n,e,I,k,P)}catch(I){if(I instanceof Error&&e._onError(I),Gv)throw I;return yR(e,null,o,n),CL(e),e._dirtyType=2,Gv=!0,ha(e,a),void(Gv=!1)}finally{m.observe(o,Yk),e._updating=f,An=d,yo=u,Nn=p}}n._readOnly||(n._readOnly=!0);let h=e._dirtyLeaves,v=e._dirtyElements,C=e._normalizedNodes,y=e._updateTags,b=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(I,k){let P=I._decorators,T=I._pendingDecorators||P,L=k._nodeMap,E;for(E in T)L.has(E)||(T===P&&(T=wR(I)),delete T[E])})(e,n);let w=r?null:Ir(zo(e));if(e._editable&&w!==null&&(l||i===null||i.dirty||!i.is(s))&&o!==null&&!y.has(nR)){Nn=e,An=n;try{if(m!==null&&m.disconnect(),l||i===null||i.dirty){let I=e._blockCursorElement;I!==null&&Sy(I,e,o),hV(s,i,e,w,y,o)}(function(I,k,P){let T=I._blockCursorElement;if(Je(P)&&P.isCollapsed()&&P.anchor.type==="element"&&k.contains(document.activeElement)){let L=P.anchor,E=L.getNode(),A=L.offset,R=!1,F=null;if(A===E.getChildrenSize())Qv(E.getChildAtIndex(A-1))&&(R=!0);else{let H=E.getChildAtIndex(A);if(H!==null&&Qv(H)){let z=H.getPreviousSibling();(z===null||Qv(z))&&(R=!0,F=I.getElementByKey(H.__key))}}if(R){let H=I.getElementByKey(E.__key);return T===null&&(I._blockCursorElement=T=(function(z){let _=z.theme,Q=document.createElement("div");Q.contentEditable="false",Q.setAttribute("data-lexical-cursor","true");let D=_.blockCursor;if(D!==void 0){if(typeof D=="string"){let O=Tu(D);D=_.blockCursor=O}D!==void 0&&Q.classList.add(...D)}return Q})(I._config)),k.style.caretColor="transparent",void(F===null?H.appendChild(T):H.insertBefore(T,F))}}T!==null&&Sy(T,I,k)})(e,o,i)}finally{m!==null&&m.observe(o,Yk),Nn=p,An=d}}g!==null&&(function(I,k,P,T,L){let E=Array.from(I._listeners.mutation),A=E.length;for(let R=0;R<A;R++){let[F,H]=E[R];for(let z of H){let _=k.get(z);_!==void 0&&F(_,{dirtyLeaves:T,prevEditorState:L,updateTags:P})}}})(e,g,y,h,a),Je(i)||i===null||s!==null&&s.is(i)||e.dispatchCommand(Ay,void 0);let S=e._pendingDecorators;S!==null&&(e._decorators=S,e._pendingDecorators=null,ou("decorator",e,!0,S)),(function(I,k,P){let T=oL(k),L=oL(P);T!==L&&ou("textcontent",I,!0,L)})(e,t||a,n),ou("update",e,!0,{dirtyElements:v,dirtyLeaves:h,editorState:n,mutatedNodes:g,normalizedNodes:C,prevEditorState:t||a,tags:y}),(function(I,k){if(I._deferred=[],k.length!==0){let P=I._updating;I._updating=!0;try{for(let T=0;T<k.length;T++)k[T]()}finally{I._updating=P}}})(e,b),(function(I){let k=I._updates;if(k.length!==0){let P=k.shift();if(P){let[T,L]=P;Pm(I,T,L)}}})(e)}function ou(e,t,n,...o){let r=t._updating;t._updating=n;try{let a=Array.from(t._listeners[e]);for(let s=0;s<a.length;s++)a[s].apply(null,o)}finally{t._updating=r}}function eL(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[a,s]=r,i=e._pendingEditorState,l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(o=!0),s.discrete&&(i===null&&me(191),i._flushSync=!0),l&&e._deferred.push(l),mR(e,s.tag)),i==null?Pm(e,a,s):a()}}return o}function Pm(e,t,n){let o=e._updateTags,r,a=!1,s=!1;n!==void 0&&(r=n.onUpdate,mR(e,n.tag),a=n.skipTransforms||!1,s=n.discrete||!1),r&&e._deferred.push(r);let i=e._editorState,l=e._pendingEditorState,d=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=gR(l||i),d=!0),l._flushSync=s;let u=An,p=yo,f=Nn,m=e._updating;An=l,yo=!1,e._updating=!0,Nn=e;let g=e._headless||e.getRootElement()===null;jy(null);try{d&&(g?i._selection!==null&&(l._selection=i._selection.clone()):l._selection=(function(y,b){let w=y.getEditorState()._selection,S=Ir(zo(y));return Je(w)||w==null?Tm(w,S,y,b):w.clone()})(e,n&&n.event||null));let v=e._compositionKey;t(),a=eL(e,a),(function(y,b){let w=b.getEditorState()._selection,S=y._selection;if(Je(S)){let I=S.anchor,k=S.focus,P;if(I.type==="text"&&(P=I.getNode(),P.selectionTransform(w,S)),k.type==="text"){let T=k.getNode();P!==T&&T.selectionTransform(w,S)}}})(l,e),e._dirtyType!==0&&(a?(function(y,b){let w=b._dirtyLeaves,S=y._nodeMap;for(let I of w){let k=S.get(I);Ue(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&Lk(k)}})(l,e):(function(y,b){let w=b._dirtyLeaves,S=b._dirtyElements,I=y._nodeMap,k=ds(),P=new Map,T=w,L=T.size,E=S,A=E.size;for(;L>0||A>0;){if(L>0){b._dirtyLeaves=new Set;for(let R of T){let F=I.get(R);Ue(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Lk(F),F!==void 0&&Jk(F,k)&&Xk(b,F,P),w.add(R)}if(T=b._dirtyLeaves,L=T.size,L>0){tm++;continue}}b._dirtyLeaves=new Set,b._dirtyElements=new Map,E.delete("root")&&E.set("root",!0);for(let R of E){let F=R[0],H=R[1];if(S.set(F,H),!H)continue;let z=I.get(F);z!==void 0&&Jk(z,k)&&Xk(b,z,P)}T=b._dirtyLeaves,L=T.size,E=b._dirtyElements,A=E.size,tm++}b._dirtyLeaves=w,b._dirtyElements=S})(l,e),eL(e),(function(y,b,w,S){let I=y._nodeMap,k=b._nodeMap,P=[];for(let[T]of S){let L=k.get(T);L!==void 0&&(L.isAttached()||(pe(L)&&hL(L,T,I,k,P,S),I.has(T)||S.delete(T),P.push(T)))}for(let T of P)k.delete(T);for(let T of w){let L=k.get(T);L===void 0||L.isAttached()||(I.has(T)||w.delete(T),k.delete(T))}})(i,l,e._dirtyLeaves,e._dirtyElements)),v!==e._compositionKey&&(l._flushSync=!0);let C=l._selection;if(Je(C)){let y=l._nodeMap,b=C.anchor.key,w=C.focus.key;y.get(b)!==void 0&&y.get(w)!==void 0||me(19)}else Cu(C)&&C._nodes.size===0&&(l._selection=null)}catch(v){return v instanceof Error&&e._onError(v),e._pendingEditorState=i,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ha(e)}finally{An=u,yo=p,Nn=f,e._updating=m,tm=0}e._dirtyType!==0||e._deferred.length>0||(function(v,C){let y=C.getEditorState()._selection,b=v._selection;if(b!==null){if(b.dirty||!b.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,ha(e)):d&&EV(()=>{ha(e)}):(l._flushSync=!1,d&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function Vr(e,t,n){Nn===e&&n===void 0?t():Pm(e,t,n)}var xy=class e{element;before;after;constructor(t,n,o){this.element=t,this.before=n||null,this.after=o||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(t){let n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&me(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&me(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&me(224),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{let n=t==="decorator"&&(bm||yu||xm);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,a=document.createElement("br");if(o.insertBefore(a,r),t){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",o.insertBefore(s,a),o.__lexicalLineBreak=s}else o.__lexicalLineBreak=a}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,r))]}let a=tL(n,o);a.push(r);let s=tL(n,this.element),i=t.getIndexWithinParent();for(let l=0;l<s.length;l++){let d=a[l],u=s[l];if(d===void 0||d<u)break;if(d>u){i+=1;break}}return[t.getParentOrThrow(),i]}};function tL(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let a=o.previousSibling;a!==null;a=a.previousSibling)r++;n.push(r)}return o!==e&&me(225),n.reverse()}var fs=class extends er{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),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(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let t=this.getFormat();return Pq[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let t=Vt()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){let t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){let t=[],n=this.getFirstChild();for(;n!==null;){if(Ue(n)&&t.push(n),pe(n)){let o=n.getAllTextNodes();t.push(...o)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;pe(t);){let n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;pe(t);){let n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){let n=this.getChildren(),o=n.length;if(t>=o){let a=n[o-1];return pe(a)&&a.getLastDescendant()||a||null}let r=n[t];return pe(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let t=this.getLatest().__first;return t===null?null:Sn(t)}getFirstChildOrThrow(){let t=this.getFirstChild();return t===null&&me(45,this.__key),t}getLastChild(){let t=this.getLatest().__last;return t===null?null:Sn(t)}getLastChildOrThrow(){let t=this.getLastChild();return t===null&&me(96,this.__key),t}getChildAtIndex(t){let n=this.getChildrenSize(),o,r;if(t<n/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=t;){if(r===t)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=n-1;o!==null&&r>=t;){if(r===t)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let t="",n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContent(),pe(a)&&r!==o-1&&!a.isInline()&&(t+=Sm)}return t}getTextContentSize(){let t=0,n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContentSize(),pe(a)&&r!==o-1&&!a.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){let n=Jv[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){let n=Vn[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return hu(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){En();let o=Rt(),r=t,a=n,s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){let l=this.getFirstChild();if(Ue(l)||pe(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){let l=this.getLastChild();if(Ue(l)||pe(l))return l.select()}}r===void 0&&(r=s),a===void 0&&(a=s);let i=this.__key;return Je(o)?(o.anchor.set(i,r,"element"),o.focus.set(i,a,"element"),o.dirty=!0,o):dR(i,r,i,a,"element","element")}selectStart(){let t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){let t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){let t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){let n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Jv[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){let n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){let n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,o){pm(this)&&me(324,this.__key,this.__type);let r=this.getChildrenSize(),a=this.getWritable();t+n<=r||me(226,String(t),String(n),String(r));let s=a.__key,i=[],l=[],d=this.getChildAtIndex(t+n),u=null,p=r-n+o.length;if(t!==0)if(t===r)u=this.getLastChild();else{let m=this.getChildAtIndex(t);m!==null&&(u=m.getPreviousSibling())}if(n>0){let m=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){m===null&&me(100);let h=m.getNextSibling(),v=m.__key;us(m.getWritable()),l.push(v),m=h}}let f=u;for(let m of o){f!==null&&m.is(f)&&(u=f=f.getPreviousSibling());let g=m.getWritable();g.__parent===s&&p--,us(g);let h=m.__key;if(f===null)a.__first=h,g.__prev=null;else{let v=f.getWritable();v.__next=h,g.__prev=v.__key}m.__key===s&&me(76),g.__parent=s,i.push(h),f=m}if(t+n===r)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(d!==null){let m=d.getWritable();if(f!==null){let g=f.getWritable();m.__prev=f.__key,g.__next=d.__key}else m.__prev=null}if(a.__size=p,l.length){let m=Rt();if(Je(m)){let g=new Set(l),h=new Set(i),{anchor:v,focus:C}=m;nL(v,g,h)&&gm(v,v.getNode(),this,u,d),nL(C,g,h)&&gm(C,C.getNode(),this,u,d),p!==0||this.canBeEmpty()||tr(this)||this.remove()}}return a}getDOMSlot(t){return new xy(t)}exportDOM(t){let{element:n}=super.exportDOM(t);if(oo(n)){let o=this.getIndent();o>0&&(n.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){let t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),o=this.getTextStyle();return n===0&&o===""||tr(this)||this.getChildren().some(Ue)||(n!==0&&(t.textFormat=n),o!==""&&(t.textStyle=o)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){let o=this.getDOMSlot(t),r=o.getFirstChild();for(let a=this.getFirstChild();a;a=a.getNextSibling()){let s=n.getElementByKey(a.getKey());s!==null&&(r==null?(o.insertChild(s),r=s):r!==s&&o.replaceChild(s,r),r=r.nextSibling)}}};function pe(e){return e instanceof fs}function nL(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var mu=class extends er{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Qt(e){return e instanceof mu}var Ul=class e extends fs{__cachedText;static getType(){return"root"}static clone(){return new e}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){me(51)}getTextContent(){let t=this.__cachedText;return!Ql()&&Vt()._dirtyType!==0||t===null?super.getTextContent():t}remove(){me(52)}replace(t){me(53)}insertBefore(t){me(54)}insertAfter(t){me(55)}updateDOM(t,n){return!1}splice(t,n,o){for(let r of o)pe(r)||Qt(r)||me(282);return super.splice(t,n,o)}static importJSON(t){return Bo().updateFromJSON(t)}collapseAtStart(){return!0}};function On(e){return e instanceof Ul}function gR(e){return new gu(new Map(e._nodeMap))}function Gy(){return new gu(new Map([["root",new Ul]]))}function hR(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&me(130,n.name),pe(e)){let o=t.children;Array.isArray(o)||me(59,n.name);let r=e.getChildren();for(let a=0;a<r.length;a++){let s=hR(r[a]);o.push(s)}}return t}function SV(e){return e instanceof gu}var gu=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Zk(n&&n.editor||null,this,t)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Zk(null,this,()=>({root:hR(Bo())}))}},hm=class extends fs{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}},Kl=class e extends fs{static getType(){return"paragraph"}static clone(t){return new e(t.__key)}createDOM(t){let n=document.createElement("p"),o=Fl(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}static importDOM(){return{p:t=>({conversion:IV,priority:0})}}exportDOM(t){let{element:n}=super.exportDOM(t);if(oo(n)){this.isEmpty()&&n.append(document.createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}static importJSON(t){return ya().updateFromJSON(t)}exportJSON(){let t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(Ue);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){let o=ya();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){let t=this.getChildren();if(t.length===0||Ue(t[0])&&t[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 IV(e){let t=ya();if(e.style&&(t.setFormat(e.style.textAlign),BR(e,t)),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in Jv&&t.setFormat(n)}return{node:t}}function ya(){return Iu(new Kl)}function vR(e){return e instanceof Kl}var Nl=0,wV=1,TV=2,PV=3,kV=4;function yR(e,t,n,o){let r=e._keyToDOMMap;r.clear(),e._editorState=Gy(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function CR(e){let t=new Set,n=new Set,o=e;for(;o;){let{ownNodeConfig:r}=wu(o),a=o.transform;if(!n.has(a)){n.add(a);let s=o.transform();s&&t.add(s)}if(r){let s=r.$transform;s&&t.add(s),o=r.extends}else{let s=Object.getPrototypeOf(o);o=s.prototype instanceof er&&s!==er?s:void 0}}return t}function LV(e){let t=e||{},n=xV(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,s=Gy(),i=t.namespace||(r!==null?r._config.namespace:kR()),l=t.editorState,d=[Ul,gi,Bl,Hl,Kl,hm,...t.nodes||[]],{onError:u,html:p}=t,f=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let h=0;h<d.length;h++){let v=d[h],C=null,y=null;if(typeof v!="function"){let S=v;v=S.replace,C=S.with,y=S.withKlass||null}wu(v);let b=v.getType(),w=CR(v);m.set(b,{exportDOM:p&&p.export?p.export.get(v):void 0,klass:v,replace:C,replaceWithKlass:y,sharedNodeState:xL(d[h]),transforms:w})}}let g=new ms(s,r,m,{disableEvents:a,namespace:i,theme:o},u||console.error,(function(h,v){let C=new Map,y=new Set,b=w=>{Object.keys(w).forEach(S=>{let I=C.get(S);I===void 0&&(I=[],C.set(S,I)),I.push(w[S])})};return h.forEach(w=>{let S=w.klass.importDOM;if(S==null||y.has(S))return;y.add(S);let I=S.call(w.klass);I!==null&&b(I)}),v&&b(v),C})(m,p?p.import:void 0),f,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(h){h.registerCommand(Ny,Yq,Nl),h.registerCommand(_y,Xq,Nl),h.registerCommand(Dy,Jq,Nl),h.registerCommand(Oy,Zq,Nl),h.registerCommand(Hy,eV,Nl)})(g),g}var ms=class{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(t,n,o,r,a,s,i,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,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=r,this._nodes=o,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=kR(),this._onError=a,this._htmlConversions=s,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){let n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){let n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){let n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){let n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,o){o===void 0&&me(35);let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let a=r.get(t);a===void 0&&me(36,String(t));let s=a[o];return s.add(n),()=>{s.delete(n),a.every(i=>i.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,a=this._listeners.mutation,s=a.get(n);s===void 0&&(s=new Set,a.set(n,s)),s.add(r);let i=o&&o.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(n,r),()=>{s.delete(r),s.size===0&&a.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&me(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=wy(o).get(n.getType());if(!r)return;let a=new Map;for(let s of r.keys())a.set(s,"created");a.size>0&&t(a,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],a=o.replaceWithKlass;if(a!=null){let s=this.registerNodeTransformToKlass(a,n);r.push(s)}return(function(s,i){let l=wy(s.getEditorState()),d=[];for(let u of i){let p=l.get(u);p&&d.push(p)}d.length!==0&&s.update(()=>{for(let u of d)for(let p of u.keys()){let f=Sn(p);f&&f.markDirty()}},s._pendingEditorState===null?{tag:em}:void 0)})(this,r.map(s=>s.klass.getType())),()=>{r.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return De(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=Fl(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,yR(this,n,t,r),n!==null&&(this._config.disableEvents||tV(n),o!=null&&n.classList.remove(...o)),t!==null){let a=aC(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=a,this._dirtyType=2,CL(this),this._updateTags.add(em),ha(this),this._config.disableEvents||(function(i,l){let d=i.ownerDocument;fy.set(i,d);let u=cm.get(d)??0;u<1&&d.addEventListener("selectionchange",JL),cm.set(d,u+1),i.__lexicalEditor=l;let p=XL(i);for(let f=0;f<py.length;f++){let[m,g]=py[f],h=typeof g=="function"?v=>{Dk(v)||(_k(v),(l.isEditable()||m==="click")&&g(v,l))}:v=>{if(Dk(v))return;_k(v);let C=l.isEditable();switch(m){case"cut":return C&&De(l,Ky,v);case"copy":return De(l,Uy,v);case"paste":return C&&De(l,Fy,v);case"dragstart":return C&&De(l,zL,v);case"dragover":return C&&De(l,HL,v);case"dragend":return C&&De(l,UL,v);case"focus":return C&&De(l,KL,v);case"blur":return C&&De(l,$L,v);case"drop":return C&&De(l,BL,v)}};i.addEventListener(m,h),p.push(()=>{i.removeEventListener(m,h)})}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(em),ha(this);ou("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&me(38);let o=t;o._readOnly&&(o=gR(t),o._selection=t._selection?t._selection.clone():null),yL(this);let r=this._pendingEditorState,a=this._updateTags,s=n!==void 0?n.tag:null;r===null||r.isEmpty()||(s!=null&&a.add(s),ha(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&a.add(s),this._updating||ha(this)}parseEditorState(t,n){return(function(o,r,a){let s=Gy(),i=An,l=yo,d=Nn,u=r._dirtyElements,p=r._dirtyLeaves,f=r._cloneNotNeeded,m=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,An=s,yo=!1,Nn=r,jy(null);try{let g=r._nodes;Wy(o.root,g),a&&a(),s._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=p,r._cloneNotNeeded=f,r._dirtyType=m,An=i,yo=l,Nn=d}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return ha(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(o,r,a){o._updating?o._updates.push([r,a]):Pm(o,r,a)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),Vr(this,()=>{let r=Rt(),a=Bo();r!==null?r.dirty||Co(r.clone()):a.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?a.selectStart():a.selectEnd()),Em("focus"),AR(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Ir(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,ou("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};ms.version="0.41.0+prod.esm";var by=null;function jy(e){by=e}var xR=1;function RV(){xR=1}function Qy(e,t){let n=Yy(e,t);return n===void 0&&me(30,t),n}function Yy(e,t){return e._nodes.get(t)}var EV=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function bR(e){return Qt(Rm(e))}function Xy(e){let t=document.activeElement;if(!oo(t))return!1;let n=t.nodeName;return Qt(Rm(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&bu(t)==null)}function xu(e,t,n){let o=e.getRootElement();try{return o!==null&&o.contains(t)&&o.contains(n)&&t!==null&&!Xy(t)&&Jy(t)===e}catch{return!1}}function km(e){return e instanceof ms}function Jy(e){let t=e;for(;t!=null;){let n=bu(t);if(km(n))return n;t=Su(t)}return null}function bu(e){return e?e.__lexicalEditor:null}function MV(e){return Iq.test(e)?"rtl":wq.test(e)?"ltr":null}function cs(e){return qy(e)||e.isToken()}function ga(e){return cs(e)||e.isSegmented()}function Wr(e){return Yl(e)&&e.nodeType===3}function SR(e){return Yl(e)&&e.nodeType===9}function vi(e){let t=e;for(;t!=null;){if(Wr(t))return t;t=t.firstChild}return null}function hu(e,t,n){let o=Vn[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~Vn.superscript:t==="superscript"?r&=~Vn.subscript:t==="lowercase"?(r&=~Vn.uppercase,r&=~Vn.capitalize):t==="uppercase"?(r&=~Vn.lowercase,r&=~Vn.capitalize):t==="capitalize"&&(r&=~Vn.lowercase,r&=~Vn.uppercase),r}function AV(e){return Ue(e)||pi(e)||Qt(e)}function IR(e,t){let n=(function(){let s=by;return by=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);En(),pR();let o=Vt(),r=ba(),a=""+xR++;r._nodeMap.set(a,e),pe(e)?o._dirtyElements.set(a,!0):o._dirtyLeaves.add(a),o._cloneNotNeeded.add(a),o._dirtyType=1,e.__key=a}function us(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),a=e.getNextSibling(),s=a!==null?a.__key:null,i=r!==null?r.__key:null,l=r!==null?r.getWritable():null,d=a!==null?a.getWritable():null;r===null&&(o.__first=s),a===null&&(o.__last=i),l!==null&&(l.__next=s),d!==null&&(d.__prev=i),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}function vm(e){pR(),pm(e)&&me(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,o=ba(),r=Vt(),a=o._nodeMap,s=r._dirtyElements;n!==null&&(function(l,d,u){let p=l;for(;p!==null;){if(u.has(p))return;let f=d.get(p);if(f===void 0)break;u.set(p,!1),p=f.__parent}})(n,a,s);let i=t.__key;r._dirtyType=1,pe(e)?s.set(i,!0):r._dirtyLeaves.add(i)}function Mn(e){En();let t=Vt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=Sn(n);o!==null&&o.getWritable()}if(e!==null){let o=Sn(e);o!==null&&o.getWritable()}}}function ds(){return Ql()?null:Vt()._compositionKey}function Sn(e,t){let n=(t||ba())._nodeMap.get(e);return n===void 0?null:n}function Zy(e,t){let n=Lm(e,Vt());return n!==void 0?Sn(n,t):null}function Lm(e,t){return e[`__lexicalKey_${t._key}`]}function Rm(e,t){let n=e;for(;n!=null;){let o=Zy(n,t);if(o!==null)return o;n=Su(n)}return null}function wR(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function oL(e){return e.read(()=>Bo().getTextContent())}function Bo(){return TR(ba())}function TR(e){return e._nodeMap.get("root")}function Co(e){En();let t=ba();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function _l(e){let t=Vt(),n=(function(o,r){let a=o;for(;a!=null;){let s=Lm(a,r);if(s!==void 0)return s;a=Su(a)}return null})(e,t);return n===null?e===t.getRootElement()?Sn("root"):null:Sn(n)}function PR(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function eC(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function kR(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function LR(e){return Wr(e)?e.nodeValue:null}function tC(e,t,n){let o=Ir(zo(t));if(o===null)return;let r=o.anchorNode,{anchorOffset:a,focusOffset:s}=o;if(r!==null){let i=LR(r),l=Rm(r);if(i!==null&&Ue(l)){if((i===iu||i===Ry)&&n){let d=n.length;i=n,a=d,s=d}i!==null&&nC(l,i,a,s,e)}}}function nC(e,t,n,o,r){let a=e;if(a.isAttached()&&(r||!a.isDirty())){let s=a.isComposing(),i=t;if((s||r)&&(t.endsWith(iu)&&(i=t.slice(0,-iu.length)),r)){let d=Ry,u;for(;(u=i.indexOf(d))!==-1;)i=i.slice(0,u)+i.slice(u+d.length),n!==null&&n>u&&(n=Math.max(u,n-d.length)),o!==null&&o>u&&(o=Math.max(u,o-d.length))}let l=a.getTextContent();if(r||i!==l){if(i===""){if(Mn(null),xm||yu||bm)a.remove();else{let h=Vt();setTimeout(()=>{h.update(()=>{a.isAttached()&&a.remove()})},20)}return}let d=a.getParent(),u=Ci(),p=a.getTextContentSize(),f=ds(),m=a.getKey();if(a.isToken()||f!==null&&m===f&&!s||Je(u)&&(d!==null&&!d.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===p&&!a.canInsertTextAfter()&&!s))return void a.markDirty();let g=Rt();if(!Je(g)||n===null||o===null)return void rL(a,i,g);if(g.setTextNodeRange(a,n,a,o),a.isSegmented()){let h=Rn(a.getTextContent());a.replace(h),a=h}rL(a,i,g)}}}function rL(e,t,n){if(e.setTextContent(t),Je(n)){let o=e.getKey();for(let r of["anchor","focus"]){let a=n[r];a.type==="text"&&a.key===o&&(a.offset=xr(e,a.offset,"clamp"))}}}function jf(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function RR(e,t){return jf(e,t,"altKey")&&jf(e,t,"ctrlKey")&&jf(e,t,"shiftKey")&&jf(e,t,"metaKey")}function Dt(e,t,n){if(!RR(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let o="Key"+t.toUpperCase();return e.code===o}var ma={ctrlKey:!hr,metaKey:hr},aL={altKey:hr,ctrlKey:!hr};function sL(e){return e.key==="Backspace"}function iL(e){return Dt(e,"a",ma)}function NV(e){let t=Bo();if(Je(e)){let n=e.anchor,o=e.focus,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),rm(e),e}{let n=t.select(0,t.getChildrenSize());return Co(rm(n)),n}}function Fl(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let a=Tu(r);return n[t]=a,a}return r}function oC(e,t,n,o,r){if(n.size===0)return;let a=o.__type,s=o.__key,i=t.get(a);i===void 0&&me(33,a);let l=i.klass,d=e.get(l);d===void 0&&(d=new Map,e.set(l,d));let u=d.get(s),p=u==="destroyed"&&r==="created";(u===void 0||p)&&d.set(s,p?"updated":r)}function _V(e){let t=e.getType(),n=ba();if(n._readOnly){let a=wy(n).get(t);return a?Array.from(a.values()):[]}let o=n._nodeMap,r=[];for(let[,a]of o)a instanceof e&&a.__type===t&&a.isAttached()&&r.push(a);return r}function lL(e,t,n){let o=e.getParent(),r=n,a=e;return o!==null&&(t&&n===0?(r=a.getIndexWithinParent(),a=o):t||n!==a.getChildrenSize()||(r=a.getIndexWithinParent()+1,a=o)),a.getChildAtIndex(t?r-1:r)}function ER(e,t){let n=e.offset;if(e.type==="element")return lL(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?lL(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function MR(e){let t=zo(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function De(e,t,n){return(function(o,r,a){let s=eC(o);for(let i=4;i>=0;i--)for(let l=0;l<s.length;l++){let d=s[l],u=d._commands.get(r);if(u!==void 0){let p=u[i];if(p!==void 0){let f=Array.from(p),m=f.length,g=!1;if(Vr(d,()=>{for(let h=0;h<m;h++)if(f[h](a,o))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function $l(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&me(75,t),n}function Su(e){let t=e.assignedSlot||e.parentElement;return OR(t)?t.host:t}function rC(e){return SR(e)?e:oo(e)?e.ownerDocument:null}function DV(e){return Vt()._updateTags.has(e)}function Em(e){En(),Vt()._updateTags.add(e)}function AR(e){En(),Vt()._deferred.push(e)}function ym(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function aC(e){let t=rC(e);return t?t.defaultView:null}function zo(e){let t=e._window;return t===null&&me(78),t}function OV(e){return pe(e)&&e.isInline()||Qt(e)&&e.isInline()}function NR(e){let t=e.getParentOrThrow();for(;t!==null;){if(tr(t))return t;t=t.getParentOrThrow()}return t}function tr(e){return On(e)||pe(e)&&e.isShadowRoot()}function sC(e){let t=e.constructor.clone(e);return IR(t,null),t.afterCloneFrom(e),t}function Iu(e){let t=Vt(),n=e.getType(),o=Yy(t,n);o===void 0&&me(200,e.constructor.name,n);let{replace:r,replaceWithKlass:a}=o;if(r!==null){let s=r(e),i=s.constructor;return a!==null?s instanceof a||me(201,a.name,a.getType(),i.name,i.getType(),e.constructor.name,n):s instanceof e.constructor&&i!==e.constructor||me(202,i.name,i.getType(),e.constructor.name,n),s.__key===e.__key&&me(203,e.constructor.name,n,i.name,i.getType()),s}return e}function jv(e,t){!On(e.getParent())||pe(t)||Qt(t)||me(99)}function _R(e){let t=Sn(e);return t===null&&me(63,e),t}function Qv(e){return(Qt(e)||pe(e)&&!e.canBeEmpty())&&!e.isInline()}function Sy(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Ir(e){return Sr?(e||window).getSelection():null}function DR(e){let t=aC(e);return t?t.getSelection():null}function FV(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),tr(e)&&me(102);let o=s=>{let i=s.getParentOrThrow(),l=tr(i),d=s!==n||l?sC(s):s;if(l)return pe(s)&&pe(d)||me(133),s.insertAfter(d),[s,d,d];{let[u,p,f]=o(i),m=s.getNextSiblings();return f.append(d,...m),[u,p,d]}},[r,a]=o(n);return[r,a]}function BV(e){return oo(e)&&e.tagName==="A"}function oo(e){return Yl(e)&&e.nodeType===1}function Yl(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function OR(e){return Yl(e)&&e.nodeType===11}function FR(e){let t=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 e.nodeName.match(t)!==null}function Iy(e){let t=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 e.nodeName.match(t)!==null}function va(e){if(Qt(e)&&!e.isInline())return!0;if(!pe(e)||tr(e))return!1;let t=e.getFirstChild(),n=t===null||pi(t)||Ue(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function iC(){return Vt()}var dL=new WeakMap,zV=new Map;function wy(e){if(!e._readOnly&&e.isEmpty())return zV;e._readOnly||me(192);let t=dL.get(e);return t||(t=(function(n){let o=new Map;for(let[r,a]of n._nodeMap){let s=a.__type,i=o.get(s);i||(i=new Map,o.set(s,i)),i.set(r,a)}return o})(e),dL.set(e,t)),t}function lC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function HV(e){return(t=lC(e))[ZL]=!0,t;var t}function BR(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,o=Math.round(n/40);t.setIndent(o)}function UV(e){e.__lexicalUnmanaged=!0}function zR(e){return e.__lexicalUnmanaged===!0}function Zc(e,t){return(function(n,o){return Object.prototype.hasOwnProperty.call(n,o)})(e,t)&&e[t]!==er[t]}function wu(e){let t=bk in e.prototype?e.prototype[bk]():void 0,n=(function(s){if(!(s===er||s.prototype instanceof er)){let i="<unknown>",l="<unknown>";try{i=s.getType()}catch{}try{ms.version&&(l=JSON.parse(ms.version))}catch{}me(290,s.name,i,l)}return s===mu||s===fs||s===er})(e),o=!n&&Zc(e,"getType")?e.getType():void 0,r,a=o;if(t)if(o)r=t[o];else for(let[s,i]of Object.entries(t))a=s,r=i;if(!n&&a&&(Zc(e,"getType")||(e.getType=()=>a),Zc(e,"clone")||(e.clone=s=>(jy(s),new e)),Zc(e,"importJSON")||(e.importJSON=r&&r.$importJSON||(s=>new e().updateFromJSON(s))),!Zc(e,"importDOM")&&r)){let{importDOM:s}=r;s&&(e.importDOM=()=>s)}return{ownNodeConfig:r,ownNodeType:a}}function KV(e){let t=iC();return En(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var ru=(e,t)=>{let n=e;for(;n!=null&&!On(n);){if(t(n))return n;n=n.getParent()}return null},$V={next:"previous",previous:"next"},ql=class{origin;constructor(t){this.origin=t}[Symbol.iterator](){return uC({hasNext:yi,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return _n(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _n(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),a=this,s=this.getParentAtCaret(),i=new Map;for(let l=a.getAdjacentCaret();l!==null&&i.size<t;l=l.getAdjacentCaret()){let d=l.origin.getWritable();i.set(d.getKey(),d)}for(let l of r){if(i.size>0){let d=a.getNodeAtCaret();if(d){if(i.delete(d.getKey()),i.delete(l.getKey()),!(d.is(l)||a.origin.is(l))){let u=l.getParent();u&&u.is(s)&&l.remove(),d.replace(l)}}else d===null&&me(263,Array.from(i).join(" "))}else a.insert(l);a=_n(l,this.direction)}for(let l of i.values())l.remove();return this}},vu=class e extends ql{type="child";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:xa(t,this.direction)}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return _n(this.getNodeAtCaret(),t)||xa(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}},qV={root:On,shadowRoot:tr};function Cs(e){return $V[e]}function dC(e,t="root"){return qV[t](e)?null:e}var Vl=class e extends ql{type="sibling";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:_n(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return pe(this.origin)?xa(this.origin,this.direction):null}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return _n(this.getNodeAtCaret(),t)||xa(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Wl)&&this.direction===t.direction&&this.origin.is(t.origin)}},Wl=class e extends ql{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){let t=this.origin.getLatest();return t===this.origin?this:gs(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){return gs(this.origin,Cs(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Vl||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return _n(this.origin,this.direction)}};function Ca(e){return e instanceof Wl}function VV(e){return e instanceof ql}function yi(e){return e instanceof Vl}function Cr(e){return e instanceof vu}var WV={next:class extends Wl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Wl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},GV={next:class extends Vl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},jV={next:class extends vu{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends vu{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function _n(e,t){return e?new GV[t](e):null}function gs(e,t,n){return e?new WV[t](e,xr(e,n)):null}function xr(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&pL(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function Ty(e,t){return new Cm(e,t)}function xa(e,t){return pe(e)?new jV[t](e):null}function HR(e){return e&&e.getChildCaret()||e}function Gl(e){return e&&HR(e.getAdjacentCaret())}var Py=class e{type="node-caret-range";direction;anchor;focus;constructor(t,n,o){this.anchor=t,this.focus=n,this.direction=o}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let t=r=>{let a=this[r].getLatest();return Ca(a)?(function(s,i){let{direction:l,origin:d}=s,u=xr(d,i==="focus"?Cs(l):l);return Ty(s,u-s.offset)})(a,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:a}=o;if(r.isSameNodeCaret(a))return[Ty(r,a.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=Ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=Ca(o),a=s=>s.isSameNodeCaret(o)?null:Gl(s)||s.getParentCaret(t);return uC({hasNext:s=>s!==null&&!(r&&o.isSameNodeCaret(s)),initial:n.isSameNodeCaret(o)?null:a(n),map:s=>s,step:a})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Cm=class{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),a=t.getTextContent();return gs(t.setTextContent(a.slice(0,o)+a.slice(r)),n,o)}};function QV(e){return e instanceof Cm}function cC(e){return hs(e,_n(Bo(),e.direction))}function UR(e){return hs(e,e)}function hs(e,t){return e.direction!==t.direction&&me(265),new Py(e,t,e.direction)}function uC(e){let{initial:t,hasNext:n,step:o,map:r}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let s={done:!1,value:r(a)};return a=o(a),s}}}function pC(e,t){let n=au(e.origin,t.origin);switch(n===null&&me(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(a,s){return Math.sign(a-s)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return fC(n)}}function fC(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,a=t,s=n;for(;a&&s;a=a.getNextSibling(),s=s.getNextSibling()){if(a.__key===r)return-1;if(s.__key===o)return 1}return a===null?1:-1}function Qf(e,t){return t.is(e)}function cL(e){return pe(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function au(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=cL(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=cL(t);o;r=o,o=o.getParent()){let a=n.get(o);if(a!==void 0)return a===null?(Qf(e,o)||me(276),{commonAncestor:o,type:"ancestor"}):r===null?(Qf(t,o)||me(277),{commonAncestor:o,type:"descendant"}):((pe(a)||Qf(e,a))&&(pe(r)||Qf(t,r))&&o.is(a.getParent())&&o.is(r.getParent())||me(278),{a,b:r,commonAncestor:o,type:"branch"})}return null}function vs(e,t){let{type:n,key:o,offset:r}=e,a=_R(e.key);return n==="text"?(Ue(a)||me(266,a.getType(),o),gs(a,t,r)):(pe(a)||me(267,a.getType(),o),VR(a,e.offset,t))}function jl(e,t){let{origin:n,direction:o}=t,r=o==="next";Ca(t)?e.set(n.getKey(),t.offset,"text"):yi(t)?Ue(n)?e.set(n.getKey(),xr(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Cr(t)&&pe(n)||me(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function KR(e){let t=Rt(),n=Je(t)?t:cR();return su(n,e),Co(n),n}function su(e,t){jl(e.anchor,t.anchor),jl(e.focus,t.focus)}function ky(e){let{anchor:t,focus:n}=e,o=vs(t,"next"),r=vs(n,"next"),a=pC(o,r)<=0?"next":"previous";return hs(ys(o,a),ys(r,a))}function Xl(e){let{direction:t,origin:n}=e,o=_n(n,Cs(t)).getNodeAtCaret();return o?_n(o,t):xa(n.getParentOrThrow(),t)}function uL(e,t="root"){let n=[e];for(let o=Cr(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Xl(o));return n}function Yv(e){return!!e&&e.origin.isAttached()}function $R(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,a=mC(e,o),s=uL(a.anchor,n),i=uL(a.focus.getFlipped(),n),l=new Set,d=[];for(let g of a.iterNodeCarets(n))if(Cr(g))l.add(g.origin.getKey());else if(yi(g)){let{origin:h}=g;pe(h)&&!l.has(h.getKey())||d.push(h)}for(let g of d)g.remove();for(let g of a.getTextSlices()){if(!g)continue;let{origin:h}=g.caret,v=h.getTextContentSize(),C=Xl(_n(h,o)),y=h.getMode();if(Math.abs(g.distance)===v&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)C.remove();else if(g.distance!==0){r="removeEmptySlices";let b=g.removeTextSlice(),w=g.caret.origin;if(y==="segmented"){let S=b.origin,I=Rn(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());C.replaceOrInsert(I),b=gs(I,o,b.offset)}w.is(s[0].origin)&&(s[0]=b),w.is(i[0].origin)&&(i[0]=b.getFlipped())}}let u,p;for(let g of s)if(Yv(g)){u=vr(g);break}for(let g of i)if(Yv(g)){p=vr(g);break}let f=(function(g,h,v){if(!g||!h)return null;let C=g.getParentAtCaret(),y=h.getParentAtCaret();if(!C||!y)return null;let b=C.getParents().reverse();b.push(C);let w=y.getParents().reverse();w.push(y);let S=Math.min(b.length,w.length),I;for(I=0;I<S&&b[I]===w[I];I++);let k=(L,E)=>{let A;for(let R=I;R<L.length;R++){let F=L[R];if(tr(F))return;!A&&E(F)&&(A=F)}return A},P=k(b,va),T=P&&k(w,L=>v.has(L.getKey())&&va(L));return P&&T?[P,T]:null})(u,p,l);if(f){let[g,h]=f;xa(g,"previous").splice(0,h.getChildren());let v=h.getParent();for(h.remove(!0);v&&v.isEmpty();){let C=v;v=v.getParent(),C.remove(!0)}}let m=[u,p,...s,...i].find(Yv);if(m)return UR(ys(vr(m),e.direction));me(269,JSON.stringify(s.map(g=>g.origin.__key)))}function vr(e){let t=(function(r){let a=r;for(;Cr(a);){let s=Gl(a);if(!Cr(s))break;a=s}return a})(e.getLatest()),{direction:n}=t;if(Ue(t.origin))return Ca(t)?t:gs(t.origin,n,n);let o=t.getAdjacentCaret();return yi(o)&&Ue(o.origin)?gs(o.origin,n,Cs(n)):t}function qR(e){return Ca(e)&&e.offset!==xr(e.origin,e.direction)}function ys(e,t){return e.direction===t?e:e.getFlipped()}function mC(e,t){return e.direction===t?e:hs(ys(e.focus,t),ys(e.anchor,t))}function VR(e,t,n){let o=xa(e,"next");for(let r=0;r<t;r++){let a=o.getAdjacentCaret();if(a===null)break;o=a}return ys(o,n)}function YV(e,t="root"){let n=0,o=e,r=Gl(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Gl(o)}return r&&[r,n]}function XV(e){let{origin:t,offset:n,direction:o}=e;if(n===xr(t,o))return e.getSiblingCaret();if(n===xr(t,Cs(o)))return Xl(e.getSiblingCaret());let[r]=t.splitText(n);return Ue(r)||me(281),ys(_n(r,"next"),o)}function JV(e,t){return!0}function ZV(e,{$copyElementNode:t=sC,$splitTextPointCaretNext:n=XV,rootMode:o="shadowRoot",$shouldSplit:r=JV}={}){if(Ca(e))return n(e);let a=e.getParentCaret(o);if(a){let{origin:s}=a;if(Cr(e)&&(!s.canBeEmpty()||!r(s,"first")))return Xl(a);let i=(function(l){let d=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())d.push(u.origin);return d})(e);(i.length>0||s.canBeEmpty()&&r(s,"last"))&&a.insert(t(s).splice(0,0,i))}return a}function e4(e){return e}function t4(...e){return e}function n4(e,t){return[e,t]}function o4(e){return e}function r4(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Tu(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function a4(e,...t){let n=Tu(...t);n.length>0&&e.classList.add(...n)}function s4(e,...t){let n=Tu(...t);n.length>0&&e.classList.remove(...n)}function i4(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var B=gC,oge=B.$addUpdateTag,xs=B.$applyNodeReplacement,Jl=B.$caretFromPoint,WR=B.$caretRangeFromSelection,Mm=B.$cloneWithProperties,GR=B.$cloneWithPropertiesEphemeral,rge=B.$comparePointCaretNext,age=B.$copyNode,jR=B.$create,xi=B.$createLineBreakNode,QR=B.$createNodeSelection,nr=B.$createParagraphNode,sge=B.$createPoint,bi=B.$createRangeSelection,YR=B.$createRangeSelectionFromDom,XR=B.$createTabNode,wr=B.$createTextNode,JR=B.$extendCaretToRange,Sa=B.$findMatchingParent,hC=B.$getAdjacentChildCaret,ige=B.$getAdjacentNode,Si=B.$getAdjacentSiblingOrParentSiblingCaret,vC=B.$getCaretInDirection,ZR=B.$getCaretRange,lge=B.$getCaretRangeInDirection,eE=B.$getCharacterOffsets,bs=B.$getChildCaret,dge=B.$getChildCaretAtIndex,yC=B.$getChildCaretOrSelf,tE=B.$getCollapsedCaretRange,cge=B.$getCommonAncestor,uge=B.$getCommonAncestorResultBranchOrder,Am=B.$getEditor,pge=B.$getNearestNodeFromDOMNode,fge=B.$getNearestRootOrShadowRoot,Zl=B.$getNodeByKey,mge=B.$getNodeByKeyOrThrow,nE=B.$getNodeFromDOMNode,Pu=B.$getPreviousSelection,yt=B.$getRoot,Oe=B.$getSelection,Ia=B.$getSiblingCaret,Nm=B.$getState,gge=B.$getStateChange,hge=B.$getTextContent,vge=B.$getTextNodeOffset,yge=B.$getTextPointCaret,Cge=B.$getTextPointCaretSlice,xge=B.$getWritableNodeState,oE=B.$hasAncestor,bge=B.$hasUpdateTag,Sge=B.$insertNodes,ed=B.$isBlockElementNode,ku=B.$isChildCaret,_m=B.$isDecoratorNode,rE=B.$isEditorState,Xe=B.$isElementNode,aE=B.$isExtendableTextPointCaret,Ige=B.$isInlineElementOrDecoratorNode,sE=B.$isLeafNode,td=B.$isLineBreakNode,wge=B.$isNodeCaret,CC=B.$isNodeSelection,iE=B.$isParagraphNode,Ee=B.$isRangeSelection,Lu=B.$isRootNode,Ii=B.$isRootOrShadowRoot,lE=B.$isSiblingCaret,Tge=B.$isTabNode,pt=B.$isTextNode,Dm=B.$isTextPointCaret,Pge=B.$isTextPointCaretSlice,xC=B.$isTokenOrSegmented,kge=B.$isTokenOrTab,Lge=B.$nodesOfType,dE=B.$normalizeCaret,cE=B.$normalizeSelection__EXPERIMENTAL,Rge=B.$onUpdate,uE=B.$parseSerializedNode,Ege=B.$removeTextFromCaretRange,pE=B.$rewindSiblingCaret,Om=B.$selectAll,Mge=B.$setCompositionKey,Age=B.$setPointFromCaret,or=B.$setSelection,fE=B.$setSelectionFromCaretRange,Fm=B.$setState,mE=B.$splitAtPointCaretNext,gE=B.$splitNode,Nge=B.$updateRangeSelectionFromCaretRange,bC=B.ArtificialNode__DO_NOT_USE,_ge=B.BEFORE_INPUT_COMMAND,hE=B.BLUR_COMMAND,Ru=B.CAN_REDO_COMMAND,Eu=B.CAN_UNDO_COMMAND,Bm=B.CLEAR_EDITOR_COMMAND,vE=B.CLEAR_HISTORY_COMMAND,yE=B.CLICK_COMMAND,Dge=B.COLLABORATION_TAG,zm=B.COMMAND_PRIORITY_CRITICAL,Yt=B.COMMAND_PRIORITY_EDITOR,rr=B.COMMAND_PRIORITY_HIGH,nd=B.COMMAND_PRIORITY_LOW,Oge=B.COMMAND_PRIORITY_NORMAL,Fge=B.COMPOSITION_END_COMMAND,CE=B.COMPOSITION_END_TAG,Bge=B.COMPOSITION_START_COMMAND,xE=B.COMPOSITION_START_TAG,bE=B.CONTROLLED_TEXT_INSERTION_COMMAND,Hm=B.COPY_COMMAND,SE=B.CUT_COMMAND,Um=B.DELETE_CHARACTER_COMMAND,IE=B.DELETE_LINE_COMMAND,wE=B.DELETE_WORD_COMMAND,zge=B.DRAGEND_COMMAND,Hge=B.DRAGOVER_COMMAND,TE=B.DRAGSTART_COMMAND,PE=B.DROP_COMMAND,xo=B.DecoratorNode,Uge=B.ElementNode,kE=B.FOCUS_COMMAND,Kge=B.FORMAT_ELEMENT_COMMAND,LE=B.FORMAT_TEXT_COMMAND,Km=B.HISTORIC_TAG,bo=B.HISTORY_MERGE_TAG,RE=B.HISTORY_PUSH_TAG,SC=B.INDENT_CONTENT_COMMAND,$ge=B.INPUT_COMMAND,IC=B.INSERT_LINE_BREAK_COMMAND,EE=B.INSERT_PARAGRAPH_COMMAND,ME=B.INSERT_TAB_COMMAND,Mu=B.INTERNAL_$isBlock,qge=B.IS_ALL_FORMATTING,Vge=B.IS_BOLD,Wge=B.IS_CODE,Gge=B.IS_HIGHLIGHT,jge=B.IS_ITALIC,Qge=B.IS_STRIKETHROUGH,Yge=B.IS_SUBSCRIPT,Xge=B.IS_SUPERSCRIPT,Jge=B.IS_UNDERLINE,AE=B.KEY_ARROW_DOWN_COMMAND,$m=B.KEY_ARROW_LEFT_COMMAND,qm=B.KEY_ARROW_RIGHT_COMMAND,NE=B.KEY_ARROW_UP_COMMAND,Vm=B.KEY_BACKSPACE_COMMAND,_E=B.KEY_DELETE_COMMAND,DE=B.KEY_DOWN_COMMAND,Wm=B.KEY_ENTER_COMMAND,OE=B.KEY_ESCAPE_COMMAND,Zge=B.KEY_MODIFIER_COMMAND,ehe=B.KEY_SPACE_COMMAND,Gm=B.KEY_TAB_COMMAND,FE=B.LineBreakNode,the=B.MOVE_TO_END,nhe=B.MOVE_TO_START,ohe=B.NODE_STATE_KEY,BE=B.OUTDENT_CONTENT_COMMAND,jm=B.PASTE_COMMAND,zE=B.PASTE_TAG,HE=B.ParagraphNode,UE=B.REDO_COMMAND,KE=B.REMOVE_TEXT_COMMAND,$E=B.RootNode,rhe=B.SELECTION_CHANGE_COMMAND,qE=B.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,VE=B.SELECT_ALL_COMMAND,ahe=B.SKIP_COLLAB_TAG,WE=B.SKIP_DOM_SELECTION_TAG,wC=B.SKIP_SCROLL_INTO_VIEW_TAG,she=B.SKIP_SELECTION_FOCUS_TAG,GE=B.TEXT_TYPE_TO_FORMAT,jE=B.TabNode,Qm=B.TextNode,QE=B.UNDO_COMMAND,Au=B.addClassNamesToElement,ihe=B.buildImportMap,Ym=B.configExtension,YE=B.createCommand,Xm=B.createEditor,lhe=B.createSharedNodeState,XE=B.createState,JE=B.declarePeerDependency,fn=B.defineExtension,dhe=B.flipDirection,che=B.getDOMOwnerDocument,TC=B.getDOMSelection,uhe=B.getDOMSelectionFromTarget,ZE=B.getDOMTextNode,phe=B.getEditorPropertyFromDOMNode,fhe=B.getNearestEditorFromDOMNode,eM=B.getRegisteredNode,mhe=B.getRegisteredNodeOrThrow,ghe=B.getStaticNodeConfig,hhe=B.getTextDirection,vhe=B.getTransformSetFromKlass,tM=B.isBlockDomNode,yhe=B.isCurrentlyReadOnlyMode,nM=B.isDOMDocumentNode,oM=B.isDOMNode,Che=B.isDOMTextNode,xhe=B.isDOMUnmanaged,PC=B.isDocumentFragment,bhe=B.isExactShortcutMatch,rM=B.isHTMLAnchorElement,Jm=B.isHTMLElement,Nu=B.isInlineDomNode,She=B.isLexicalEditor,Ihe=B.isModifierMatch,whe=B.isSelectionCapturedInDecoratorInput,aM=B.isSelectionWithinEditor,kC=B.makeStepwiseIterator,Gr=B.mergeRegister,The=B.normalizeClassNames,Zm=B.removeClassNamesFromElement,Phe=B.removeFromParent,khe=B.resetRandomKey,Tr=B.safeCast,Lhe=B.setDOMUnmanaged,Rhe=B.setNodeIndentFromDOM,eg=B.shallowMergeConfig,LC=B.toggleTextFormatType;var RC={};cn(RC,{LexicalComposer:()=>d4});W();var sM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,l4=sM?ue:$,tg={tag:bo};function d4({initialConfig:e,children:t}){let n=K(()=>{let{theme:o,namespace:r,nodes:a,onError:s,editorState:i,html:l}=e,d=xk(null,o),u=Xm({editable:e.editable,html:l,namespace:r,nodes:a,onError:p=>s(p,u),theme:o});return(function(p,f){if(f!==null){if(f===void 0)p.update(()=>{let m=yt();if(m.isEmpty()){let g=nr();m.append(g);let h=sM?document.activeElement:null;(Oe()!==null||h!==null&&h===p.getRootElement())&&g.select()}},tg);else if(f!==null)switch(typeof f){case"string":{let m=p.parseEditorState(f);p.setEditorState(m,tg);break}case"object":p.setEditorState(f,tg);break;case"function":p.update(()=>{yt().isEmpty()&&f(p)},tg)}}})(u,i),[u,d]},[]);return l4(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),c(Ck.Provider,{value:n,children:t})}var c4=RC,iM=c4.LexicalComposer;var MC={};cn(MC,{$canShowPlaceholder:()=>dM,$canShowPlaceholderCurry:()=>p4,$findTextIntersectionFromCharacters:()=>f4,$isRootTextContentEmpty:()=>EC,$isRootTextContentEmptyCurry:()=>u4,$rootTextContent:()=>lM,registerLexicalTextEntity:()=>g4});function lM(){return yt().getTextContent()}function EC(e,t=!0){if(e)return!1;let n=lM();return t&&(n=n.trim()),n===""}function u4(e,t){return()=>EC(e,t)}function dM(e){if(!EC(e,!1))return!1;let t=yt().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(_m(r))return!1;if(Xe(r)){if(!iE(r)||r.__indent!==0)return!1;let a=r.getChildren(),s=a.length;for(let i=0;i<s;i++){let l=a[o];if(!pt(l))return!1}}}return!0}function p4(e){return()=>dM(e)}function f4(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(Xe(n)){let s=n.getFirstChild();if(s!==null){n=s;continue}}else if(pt(n)){let s=n.getTextContentSize();if(o+s>t)return{node:n,offset:t-o};o+=s}let r=n.getNextSibling();if(r!==null){n=r;continue}let a=n.getParent();for(;a!==null;){let s=a.getNextSibling();if(s!==null){n=s;continue e}a=a.getParent()}break}return null}function m4(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function g4(e,t,n,o){let r=s=>s instanceof n,a=s=>{let i=wr(s.getTextContent());i.setFormat(s.getFormat()),s.replace(i)};return[e.registerNodeTransform(Qm,s=>{if(!s.isSimpleText())return;let i,l=s.getPreviousSibling(),d=s.getTextContent(),u=s;if(pt(l)){let f=l.getTextContent(),m=t(f+d);if(r(l)){if(m===null||(g=>g.getLatest().__mode)(l)!==0)return void a(l);{let g=m.end-f.length;if(g>0){let h=f+d.slice(0,g);if(l.select(),l.setTextContent(h),g===d.length)s.remove();else{let v=d.slice(g);s.setTextContent(v)}return}}}else if(m===null||m.start<f.length)return}let p=0;for(;;){i=t(d);let f,m=i===null?"":d.slice(i.end);if(d=m,m===""){let h=u.getNextSibling();if(pt(h)){m=u.getTextContent()+h.getTextContent();let v=t(m);if(v===null)return void(r(h)?a(h):h.markDirty());if(v.start!==0)return}}if(i===null)return;if(i.start===0&&pt(l)&&l.isTextEntity()){p+=i.end;continue}i.start===0?[f,u]=u.splitText(i.end):[,f,u]=u.splitText(i.start+p,i.end+p),f===void 0&&m4(165,"nodeToReplace");let g=o(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;p=0,l=g}}),e.registerNodeTransform(n,s=>{let i=s.getTextContent(),l=t(i);if(l===null||l.start!==0)return void a(s);if(i.length>l.end)return void s.splitText(l.end);let d=s.getPreviousSibling();pt(d)&&d.isTextEntity()&&(a(d),a(s));let u=s.getNextSibling();pt(u)&&u.isTextEntity()&&(a(u),r(s)&&a(s))})]}var wi=MC,Fhe=wi.$canShowPlaceholder,ng=wi.$canShowPlaceholderCurry,Bhe=wi.$findTextIntersectionFromCharacters,zhe=wi.$isRootTextContentEmpty,Hhe=wi.$isRootTextContentEmptyCurry,Uhe=wi.$rootTextContent,Khe=wi.registerLexicalTextEntity;var FC={};cn(FC,{$addNodeStyle:()=>b4,$cloneWithProperties:()=>Mm,$copyBlockFormatIndent:()=>yM,$ensureForwardRangeSelection:()=>vM,$forEachSelectedTextNode:()=>hM,$getComputedStyleForElement:()=>_C,$getComputedStyleForParent:()=>DC,$getSelectionStyleValueForProperty:()=>R4,$isAtNodeEnd:()=>x4,$isParentElementRTL:()=>OC,$isParentRTL:()=>y4,$moveCaretSelection:()=>bM,$moveCharacter:()=>k4,$patchStyleText:()=>S4,$selectAll:()=>Om,$setBlocksType:()=>I4,$shouldOverrideDefaultCharacterSelection:()=>P4,$sliceSelectedTextNodeContent:()=>C4,$trimTextContentFromAnchor:()=>gM,$wrapNodes:()=>T4,createDOMRange:()=>h4,createRectsFromDOMRange:()=>v4,getCSSFromStyleObject:()=>mM,getStyleObjectFromCSS:()=>ag,trimTextContentFromAnchor:()=>E4});function NC(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rg=new Map;function cM(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function uM(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function h4(e,t,n,o,r){let a=t.getKey(),s=o.getKey(),i=document.createRange(),l=e.getElementByKey(a),d=e.getElementByKey(s),u=n,p=r;if(pt(t)&&(l=cM(l)),pt(o)&&(d=cM(d)),t===void 0||o===void 0||l===null||d===null)return null;l.nodeName==="BR"&&([l,u]=uM(l)),d.nodeName==="BR"&&([d,p]=uM(d));let f=l.firstChild;l===d&&f!=null&&f.nodeName==="BR"&&u===0&&p===0&&(p=1);try{i.setStart(l,u),i.setEnd(d,p)}catch{return null}return!i.collapsed||u===p&&a===s||(i.setStart(d,p),i.setEnd(l,u)),i}function v4(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),s=Array.from(t.getClientRects()),i,l=s.length;s.sort((d,u)=>{let p=d.top-u.top;return Math.abs(p)<=3?d.left-u.left:p});for(let d=0;d<l;d++){let u=s[d],p=i&&i.top<=u.top&&i.top+i.height>u.top&&i.left+i.width>u.left,f=u.width+a===o.width;p||f?(s.splice(d--,1),l--):i=u}return s}function fM(e){let t={};if(!e)return t;let n=e.split(";");for(let o of n)if(o!==""){let[r,a]=o.split(/:([^]+)/);r&&a&&(t[r.trim()]=a.trim())}return t}function ag(e){let t=rg.get(e);return t===void 0&&(t=fM(e),rg.set(e,t)),t}function mM(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function _C(e){let t=Am().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function DC(e){return _C(Lu(e)?e:e.getParentOrThrow())}function y4(e){let t=DC(e);return t!==null&&t.direction==="rtl"}function C4(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!xC(t)&&o!==null){let[r,a]=o,s=e.isBackward(),i=r.getNode(),l=a.getNode(),d=t.is(i),u=t.is(l);if(d||u){let[p,f]=eE(e),m=i.is(l),g=t.is(s?l:i),h=t.is(s?i:l),v,C=0;m?(C=p>f?f:p,v=p>f?p:f):g?(C=s?f:p,v=void 0):h&&(C=0,v=s?p:f);let y=t.__text.slice(C,v);y!==t.__text&&(n==="clone"&&(t=GR(t)),t.__text=y)}}return t}function x4(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return Xe(t)||NC(177),e.offset===t.getChildrenSize()}function gM(e,t,n){let o=t.getNode(),r=n;if(Xe(o)){let a=o.getDescendantByIndex(t.offset);a!==null&&(o=a)}for(;r>0&&o!==null;){if(Xe(o)){let d=o.getLastDescendant();d!==null&&(o=d)}let a=o.getPreviousSibling(),s=0;if(a===null){let d=o.getParentOrThrow(),u=d.getPreviousSibling();for(;u===null;){if(d=d.getParent(),d===null){a=null;break}u=d.getPreviousSibling()}d!==null&&(s=d.isInline()?0:2,a=u)}let i=o.getTextContent();i===""&&Xe(o)&&!o.isInline()&&(i=`
|
|
3803
|
+
`?o.push(zl()):s===" "?o.push(wm()):o.push(Rn(s))}this.insertNodes(o)}insertText(t){let n=this.anchor,o=this.focus,r=this.format,a=this.style,s=n,i=o;!this.isCollapsed()&&o.isBefore(n)&&(s=o,i=n),s.type==="element"&&(function(v,C,y,b){let w=v.getNode(),S=w.getChildAtIndex(v.offset),I=Rn();if(I.setFormat(y),I.setStyle(b),vR(S))S.splice(0,0,[I]);else{let k=On(w)?ya().append(I):I;S===null?w.append(k):S.insertBefore(k)}v.is(C)&&C.set(I.__key,0,"text"),v.set(I.__key,0,"text")})(s,i,r,a),i.type==="element"&&jl(i,vr(vs(i,"next")));let l=s.offset,d=i.offset,u=this.getNodes(),p=u.length,f=u[0];Ue(f)||me(26);let m=f.getTextContent().length,g=f.getParentOrThrow(),h=u[p-1];if(p===1&&i.type==="element"&&(d=m,i.set(s.key,d,"text")),this.isCollapsed()&&l===m&&(ga(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let v=f.getNextSibling();if(Ue(v)&&v.canInsertTextBefore()&&!ga(v)||(v=Rn(),v.setFormat(r),v.setStyle(a),g.canInsertTextAfter()?f.insertAfter(v):g.insertAfter(v)),v.select(0,0),f=v,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(ga(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let v=f.getPreviousSibling();if(Ue(v)&&!ga(v)||(v=Rn(),v.setFormat(r),g.canInsertTextBefore()?f.insertBefore(v):g.insertBefore(v)),v.select(),f=v,t!=="")return void this.insertText(t)}else if(f.isSegmented()&&l!==m){let v=Rn(f.getTextContent());v.setFormat(r),f.replace(v),f=v}else if(!this.isCollapsed()&&t!==""){let v=h.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||pe(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter()))return this.insertText(""),iR(this.anchor,this.focus),void this.insertText(t)}if(p===1){if(cs(f)){let b=Rn(t);return b.select(),void f.replace(b)}let v=f.getFormat(),C=f.getStyle();if(l!==d||v===r&&C===a){if(qy(f)){let b=Rn(t);return b.setFormat(r),b.setStyle(a),b.select(),void f.replace(b)}}else{if(f.getTextContent()!==""){let b=Rn(t);if(b.setFormat(r),b.setStyle(a),b.select(),l===0)f.insertBefore(b,!1);else{let[w]=f.splitText(l);w.insertAfter(b,!1)}return void(b.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(a)}let y=d-l;f=f.spliceText(l,y,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=v,this.style=C,f.isComposing()&&(this.anchor.offset-=t.length))}else{let v=new Set([...f.getParentKeys(),...h.getParentKeys()]),C=pe(f)?f:f.getParentOrThrow(),y=pe(h)?h:h.getParentOrThrow(),b=h;if(!C.is(y)&&y.isInline())do b=y,y=y.getParentOrThrow();while(y.isInline());if(i.type==="text"&&(d!==0||h.getTextContent()==="")||i.type==="element"&&h.getIndexWithinParent()<d)if(Ue(h)&&!cs(h)&&d!==h.getTextContentSize()){if(h.isSegmented()){let P=Rn(h.getTextContent());h.replace(P),h=P}On(i.getNode())||i.type!=="text"||(h=h.spliceText(0,d,"")),v.add(h.__key)}else{let P=h.getParentOrThrow();P.canBeEmpty()||P.getChildrenSize()!==1?h.remove():P.remove()}else v.add(h.__key);let w=y.getChildren(),S=new Set(u),I=C.is(y),k=C.isInline()&&f.getNextSibling()===null?C:f;for(let P=w.length-1;P>=0;P--){let T=w[P];if(T.is(f)||pe(T)&&T.isParentOf(f))break;T.isAttached()&&(!S.has(T)||T.is(b)?I||k.insertAfter(T,!1):T.remove())}if(!I){let P=y,T=null;for(;P!==null;){let L=P.getChildren(),E=L.length;(E===0||L[E-1].is(T))&&(v.delete(P.__key),T=P),P=P.getParent()}}if(cs(f))if(l===m)f.select();else{let P=Rn(t);P.select(),f.replace(P)}else f=f.spliceText(l,m-l,t,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=t.length));for(let P=1;P<p;P++){let T=u[P],L=T.__key;v.has(L)||T.remove()}}}removeText(){let t=Rt()===this;su(this,$R(ky(this))),t&&Rt()!==this&&Co(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void Mn(null);let o=this.getNodes(),r=[];for(let w of o)Ue(w)&&r.push(w);let a=w=>{o.forEach(S=>{if(pe(S)){let I=S.getFormatFlags(t,w);S.setTextFormat(I)}})},s=r.length;if(s===0)return this.toggleFormat(t),Mn(null),void a(n);let i=this.anchor,l=this.focus,d=this.isBackward(),u=d?l:i,p=d?i:l,f=0,m=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===m.getTextContentSize()&&(f=1,m=r[1],g=0),m==null)return;let h=m.getFormatFlags(t,n);a(h);let v=s-1,C=r[v],y=p.type==="text"?p.offset:C.getTextContentSize();if(m.is(C)){if(g===y)return;if(ga(m)||g===0&&y===m.getTextContentSize())m.setFormat(h);else{let w=m.splitText(g,y),S=g===0?w[0]:w[1];S.setFormat(h),u.type==="text"&&u.set(S.__key,0,"text"),p.type==="text"&&p.set(S.__key,y-g,"text")}return void(this.format=h)}g===0||ga(m)||([,m]=m.splitText(g),g=0),m.setFormat(h);let b=C.getFormatFlags(t,h);y>0&&(y===C.getTextContentSize()||ga(C)||([C]=C.splitText(y)),C.setFormat(b));for(let w=f+1;w<v;w++){let S=r[w],I=S.getFormatFlags(t,b);S.setFormat(I)}u.type==="text"&&u.set(m.__key,g,"text"),p.type==="text"&&p.set(C.__key,y,"text"),this.format=h|b}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=Rt();return Je(g)||me(134),g.insertNodes(t)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=ru(n,va),r=t[t.length-1];if(pe(o)&&"__language"in o){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let g=Wv(this);o.splice(g,0,t),r.selectEnd()}return}if(!t.some(g=>(pe(g)||Qt(g))&&!g.isInline())){pe(o)||me(211,n.constructor.name,n.getType());let g=Wv(this);return o.splice(g,0,t),void r.selectEnd()}let a=(function(g){let h=ya(),v=null;for(let C=0;C<g.length;C++){let y=g[C],b=pi(y);if(b||Qt(y)&&y.isInline()||pe(y)&&y.isInline()||Ue(y)||y.isParentRequired()){if(v===null&&(v=y.createParentElementNode(),h.append(v),b))continue;v!==null&&v.append(y)}else h.append(y),v=null}return h})(t),s=a.getLastDescendant(),i=a.getChildren(),l=!pe(o)||!o.isEmpty()?this.insertParagraph():null,d=i[i.length-1],u=i[0];var p;pe(p=u)&&va(p)&&!p.isEmpty()&&pe(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(pe(o)||me(211,n.constructor.name,n.getType()),o.append(...u.getChildren()),u=i[1]),u&&(o===null&&me(212,n.constructor.name,n.getType()),(function(g,h){let v=h.getParentOrThrow().getLastChild(),C=h,y=[h];for(;C!==v;)C.getNextSibling()||me(140),C=C.getNextSibling(),y.push(C);let b=g;for(let w of y)b=b.insertAfter(w)})(o,u));let f=ru(s,va);l&&pe(f)&&(l.canMergeWhenEmpty()||va(d))&&(f.append(...l.getChildren()),l.remove()),pe(o)&&o.isEmpty()&&o.remove(),s.selectEnd();let m=pe(o)?o.getLastChild():null;pi(m)&&f!==o&&m.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=ya();return Bo().splice(this.anchor.offset,0,[s]),s.select(),s}let t=Wv(this),n=ru(this.anchor.getNode(),va);pe(n)||me(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...r),a.selectStart(),a):null}insertLineBreak(t){let n=zl();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[a,s]=Cy(this),i=this.isBackward(),[l,d]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,p]=i?[s,a]:[a,s];if(n===0)return[];if(n===1){if(Ue(o)&&!this.isCollapsed()){let f=o.splitText(u,p),m=u===0?f[0]:f[1];return m?(l.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[o]}if(Ue(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),Ue(r)){let f=r.getTextContent().length;p===0?t.pop():p!==f&&([r]=r.splitText(p),t[t.length-1]=r,d.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(Qk(this,t,n,o))return;let r=t==="move",a=Vt(),s=Ir(zo(a));if(!s)return;let i=a._blockCursorElement,l=a._rootElement,d=this.focus.getNode();if(l===null||i===null||!pe(d)||d.isInline()||d.canBeEmpty()||Sy(i,a,l),this.dirty){let u=$l(a,this.anchor.key),p=$l(a,this.focus.key);this.anchor.type==="text"&&(u=vi(u)),this.focus.type==="text"&&(p=vi(p)),u&&p&&uR(s,u,this.anchor.offset,p,this.focus.offset)}if((function(u,p,f,m){u.modify(p,f,m)})(s,t,n?"backward":"forward",o),s.rangeCount>0){let u=s.getRangeAt(0),p=this.anchor.getNode(),f=On(p)?p:NR(p);if(this.applyDOMRange(u),this.dirty=!0,!r){let m=this.getNodes(),g=[],h=!1;for(let v=0;v<m.length;v++){let C=m[v];ym(C,f)?g.push(C):h=!0}if(h&&g.length>0)if(n){let v=g[0];pe(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{let v=g[g.length-1];pe(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(v){let C=v.focus,y=v.anchor,b=y.key,w=y.offset,S=y.type;y.set(C.key,C.offset,C.type,!0),C.set(b,w,S,!0)})(this)}}o==="lineboundary"&&Qk(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&pe(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),a=n.getNextSibling()||(r===null?null:r.getNextSibling());if(pe(a)&&a.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;let a=cC(vs(o,t?"previous":"next"));if(a.getTextSlices().every(i=>i===null||i.distance===0)){let i={type:"initial"};for(let l of a.iterNodeCarets("shadowRoot"))if(Cr(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(pe(a.anchor.origin)&&a.anchor.origin.isEmpty()){let d=vr(l);su(this,hs(d,d)),a.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}}else{if(i.type==="merge-block")break;if(yi(l)){if(pe(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(a.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Qt(l.origin)){if(!l.origin.isIsolated())if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&pe(a.anchor.origin)&&a.anchor.origin.isEmpty()){a.anchor.origin.remove();let d=Vy();d.add(l.origin.getKey()),Co(d)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:d}=i;return su(this,hs(!l.origin.isEmpty()&&d.isEmpty()?Xl(_n(d,l.direction)):a.anchor,l)),this.removeText()}}let s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&o.offset===0&&Kk(this,o.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(r=o.type==="text"?o.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,d=i.getTextContentSize();if(i.is(r)||t&&l!==d||!t&&l!==0)return void $k(i,t,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,d=r.getTextContentSize();if(r.is(i)||t&&l!==0||!t&&l!==d)return void $k(r,t,l)}(function(l,d){let u=l.anchor,p=l.focus,f=u.getNode(),m=p.getNode();if(f===m&&u.type==="text"&&p.type==="text"){let g=u.offset,h=p.offset,v=g<h,C=v?g:h,y=v?h:g,b=y-1;C!==b&&(function(w){return!(PR(w)||fV(w))})(f.getTextContent().slice(C,y))&&(d?p.set(p.key,b,p.type):u.set(u.key,b,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&On(o.getParent())&&o.getPreviousSibling()===null&&Kk(this,o)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Cu(e){return e instanceof fm}function Uk(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Cy(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[Uk(n),Uk(o)]}function Kk(e,t){for(let n=t;n;n=n.getParent()){if(pe(n)){if(n.collapseAtStart(e))return!0;if(tr(n))break}if(n.getPreviousSibling())break}return!1}var fV=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1})();function $k(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),a=r.length,s=0,i=0;for(let d=0;d<a;d++){let u=d===a-1;if(i=s,s+=r[d].length,t&&s===n||s>n||u){r.splice(d,1),u&&(i=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(i,i))}function qk(e,t,n,o){let r,a=t;if(oo(e)){let s=!1,i=e.childNodes,l=i.length,d=o._blockCursorElement;a===l&&(s=!0,a=l-1);let u=i[a],p=!1;if(u===d)u=i[a+1],p=!0;else if(d!==null){let f=d.parentNode;e===f&&t>Array.prototype.indexOf.call(f.children,d)&&a--}if(r=_l(u),Ue(r))a=xr(r,s?"next":"previous");else{let f=_l(e);if(f===null)return null;if(pe(f)){let m=o.getElementByKey(f.getKey());m===null&&me(214),[f,a]=f.getDOMSlot(m).resolveChildIndex(f,m,e,t),pe(f)||me(215),s&&a>=f.getChildrenSize()&&(a=Math.max(0,f.getChildrenSize()-1));let h=f.getChildAtIndex(a);if(pe(h)&&(function(v,C,y){let b=v.getParent();return y===null||b===null||!b.canBeEmpty()||b!==y.getNode()})(h,0,n)){let v=s?h.getLastDescendant():h.getFirstDescendant();v===null?f=h:(h=v,f=pe(h)?h:h.getParentOrThrow()),a=0}Ue(h)?(r=h,f=null,a=xr(h,s?"next":"previous")):h!==f&&s&&!p&&(pe(f)||me(216),a=Math.min(f.getChildrenSize(),a+1))}else{let m=f.getIndexWithinParent();a=t===0&&Qt(f)&&_l(e)===f?m:m+1,f=f.getParentOrThrow()}if(pe(f))return br(f.__key,a,"element")}}else r=_l(e);return Ue(r)?br(r.__key,xr(r,a,"clamp"),"text"):null}function Vk(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let a=r.getPreviousSibling(),s=r.getParent();if(t){if((n||!t)&&a===null&&pe(s)&&s.isInline()){let i=s.getPreviousSibling();Ue(i)&&e.set(i.__key,i.getTextContent().length,"text")}}else pe(a)&&!n&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):Ue(a)&&e.set(a.__key,a.getTextContent().length,"text")}else if(o===r.getTextContent().length){let a=r.getNextSibling(),s=r.getParent();if(t&&pe(a)&&a.isInline())e.set(a.__key,0,"element");else if((n||t)&&a===null&&pe(s)&&s.isInline()&&!s.canInsertTextAfter()){let i=s.getNextSibling();Ue(i)&&e.set(i.__key,0,"text")}}}function iR(e,t,n){if(e.type==="text"&&t.type==="text"){let o=e.isBefore(t),r=e.is(t);Vk(e,o,r),Vk(t,!o,r),r&&t.set(e.key,e.offset,e.type)}}function lR(e,t,n,o,r,a){if(e===null||n===null||!xu(r,e,n))return null;let s=qk(e,t,Je(a)?a.anchor:null,r);if(s===null)return null;let i=qk(n,o,Je(a)?a.focus:null,r);if(i===null)return null;if(s.type==="element"&&i.type==="element"){let l=_l(e),d=_l(n);if(Qt(l)&&Qt(d))return null}return iR(s,i),[s,i]}function mV(e){return pe(e)&&!e.isInline()}function dR(e,t,n,o,r,a){let s=ba(),i=new hi(br(e,t,r),br(n,o,a),0,"");return i.dirty=!0,s._selection=i,i}function cR(){let e=br("root",0,"element"),t=br("root",0,"element");return new hi(e,t,0,"")}function Vy(){return new fm(new Set)}function gV(e,t){return Tm(null,e,t,null)}function Tm(e,t,n,o){let r=n._window;if(r===null)return null;let a=o||r.event,s=a?a.type:void 0,i=s==="selectionchange",l=!Zv&&(i||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&a&&a.detail===3||s==="drop"||s===void 0),d,u,p,f;if(Je(e)&&!l)return e.clone();if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,p=t.anchorOffset,f=t.focusOffset,(i||s===void 0)&&Je(e)&&!xu(n,d,u))return e.clone();let m=lR(d,p,u,f,n,e);if(m===null)return null;let[g,h]=m,v=0,C="";if(Je(e)){let y=e.anchor;if(g.key===y.key)v=e.format,C=e.style;else{let b=g.getNode();Ue(b)?(v=b.getFormat(),C=b.getStyle()):pe(b)&&(v=b.getTextFormat(),C=b.getTextStyle())}}return new hi(g,h,v,C)}function Rt(){return ba()._selection}function Ci(){return Vt()._editorState._selection}function mm(e,t,n,o=1){let r=e.anchor,a=e.focus,s=r.getNode(),i=a.getNode();if(!t.is(s)&&!t.is(i))return;let l=t.__key;if(e.isCollapsed()){let d=r.offset;if(n<=d&&o>0||n<d&&o<0){let u=Math.max(0,d+o);r.set(l,u,"element"),a.set(l,u,"element"),Wk(e)}}else{let d=e.isBackward(),u=d?a:r,p=u.getNode(),f=d?r:a,m=f.getNode();if(t.is(p)){let g=u.offset;(n<=g&&o>0||n<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(t.is(m)){let g=f.offset;(n<=g&&o>0||n<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}Wk(e)}function Wk(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,a=t.getNode(),s=o.getNode();if(e.isCollapsed()){if(!pe(a))return;let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),o.set(d.__key,u,"text")}return}if(pe(a)){let i=a.getChildrenSize(),l=n>=i,d=l?a.getChildAtIndex(i-1):a.getChildAtIndex(n);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(pe(s)){let i=s.getChildrenSize(),l=r>=i,d=l?s.getChildAtIndex(i-1):s.getChildAtIndex(r);if(Ue(d)){let u=0;l&&(u=d.getTextContentSize()),o.set(d.__key,u,"text")}}}function gm(e,t,n,o,r){let a=null,s=0,i=null;o!==null?(a=o.__key,Ue(o)?(s=o.getTextContentSize(),i="text"):pe(o)&&(s=o.getChildrenSize(),i="element")):r!==null&&(a=r.__key,Ue(r)?i="text":pe(r)&&(i="element")),a!==null&&i!==null?e.set(a,s,i):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Gk(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function uR(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function jk(e,t,n){let o=$l(e,t.getKey());if(pe(t)){let r=t.getDOMSlot(o);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function hV(e,t,n,o,r,a,s){let i=o.anchorNode,l=o.focusNode,d=o.anchorOffset,u=o.focusOffset,p=document.activeElement;if(r.has(eR)&&p!==a||p!==null&&Xy(p))return;if(!Je(t))return void(e!==null&&xu(n,i,l)&&o.removeAllRanges());let f=t.anchor,m=t.focus,g=f.getNode(),h=m.getNode(),[v,C]=jk(n,g,f.offset),[y,b]=jk(n,h,m.offset),w=t.format,S=t.style,I=t.isCollapsed(),k=v,P=y,T=!1;var L,E,A,R,F;if(f.type==="text"?(k=vi(v),T=g.getFormat()!==w||g.getStyle()!==S):Je(e)&&e.anchor.type==="text"&&(T=!0),m.type==="text"&&(P=vi(y)),k!==null&&P!==null&&(I&&(e===null||T||Je(e)&&(e.format!==w||e.style!==S))&&(L=w,E=S,A=C,R=f.key,F=performance.now(),GL=[L,E,A,R,F]),d!==C||u!==b||i!==k||l!==P||o.type==="Range"&&I||(p!==null&&a.contains(p)||r.has(vy)||a.focus({preventScroll:!0}),f.type==="element"))){if(uR(o,k,C,P,b),!ps||!t.isCollapsed()||a===null||r.has(vy)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!r.has(tR)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let H=Je(t)&&t.anchor.type==="element"?k.childNodes[C]||null:o.rangeCount>0?o.getRangeAt(0):null;if(H!==null){let z;if(H instanceof Text){let _=document.createRange();_.selectNode(H),z=_.getBoundingClientRect()}else z=H.getBoundingClientRect();(function(_,Q,D){let O=rC(D),re=aC(O);if(O===null||re===null)return;let{top:U,bottom:ne}=Q,X=0,q=0,V=D;for(;V!==null;){let Z=V===O.body;if(Z)X=0,q=zo(_).innerHeight;else{let ee=V.getBoundingClientRect();X=ee.top,q=ee.bottom}let ae=0;if(U<X?ae=-(X-U):ne>q&&(ae=ne-q),ae!==0)if(Z)re.scrollBy(0,ae);else{let ee=V.scrollTop;V.scrollTop+=ae;let oe=V.scrollTop-ee;U-=oe,ne-=oe}if(Z)break;V=Su(V)}})(n,z,a)}}my=!0}}function vV(e){let t=Rt()||Ci();t===null&&(t=Bo().selectEnd()),t.insertNodes(e)}function yV(){let e=Rt();return e===null?"":e.getTextContent()}function Wv(e){let t=e;e.isCollapsed()||t.removeText();let n=Rt();Je(n)&&(t=n),Je(t)||me(161);let o=t.anchor,r=o.getNode(),a=o.offset;for(;!va(r);){let s=r;if([r,a]=CV(r,a),s.is(r))break}return a}function CV(e,t){let n=e.getParent();if(!n){let r=ya();return Bo().append(r),r.select(),[Bo(),0]}if(Ue(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let a=t===0?0:1;return[n,r[0].getIndexWithinParent()+a]}if(!pe(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new hi(br(e.__key,t,"element"),br(e.__key,t,"element"),0,""),a=e.insertNewAfter(r);a&&a.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Qk(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[u,p]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(u.key,u.offset,u.type),!0}let a=vs(e.focus,n?"previous":"next"),s=o==="lineboundary",i=t==="move",l=a,d=r==="decorators-and-blocks";if(!qR(l)){for(let u of l){d=!1;let{origin:p}=u;if(!Qt(p)||p.isIsolated()||(l=u,!s||!p.isInline()))break}if(d)for(let u of cC(a).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Cr(u))u.origin.isInline()||(l=u);else{if(pe(u.origin))continue;Qt(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===a)return!1;if(i&&!s&&Qt(l.origin)&&l.origin.isKeyboardSelectable()){let u=Vy();return u.add(l.origin.getKey()),Co(u),!0}return l=vr(l),i&&jl(e.anchor,l),jl(e.focus,l),d||!s}var An=null,Nn=null,yo=!1,Gv=!1,tm=0,Yk={characterData:!0,childList:!0,subtree:!0};function Ql(){return yo||An!==null&&An._readOnly}function En(){yo&&me(13)}function pR(){tm>99&&me(14)}function ba(){return An===null&&me(195,fR()),An}function Vt(){return Nn===null&&me(196,fR()),Nn}function fR(){let e=0,t=new Set,n=ms.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let a=bu(r);if(km(a))e++;else if(a){let s=String(a.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function xV(){return Nn}function Xk(e,t,n){let o=t.__type,r=Qy(e,o),a=n.get(o);a===void 0&&(a=Array.from(r.transforms),n.set(o,a));let s=a.length;for(let i=0;i<s&&(a[i](t),t.isAttached());i++);}function Jk(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function mR(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function bV(e){return Wy(e,Vt()._nodes)}function Wy(e,t){let n=e.type,o=t.get(n);o===void 0&&me(17,n);let r=o.klass;e.type!==r.getType()&&me(18,r.name);let a=r.importJSON(e),s=e.children;if(pe(a)&&Array.isArray(s))for(let i=0;i<s.length;i++){let l=Wy(s[i],t);a.append(l)}return a}function Zk(e,t,n){let o=An,r=yo,a=Nn;An=t,yo=!0,Nn=e;try{return n()}finally{An=o,yo=r,Nn=a}}function ha(e,t){let n=e._pendingEditorState,o=e._rootElement,r=e._headless||o===null;if(n===null)return;let a=e._editorState,s=a._selection,i=n._selection,l=e._dirtyType!==0,d=An,u=yo,p=Nn,f=e._updating,m=e._observer,g=null;if(e._pendingEditorState=null,e._editorState=n,!r&&l&&m!==null){Nn=e,An=n,yo=!1,e._updating=!0;try{let I=e._dirtyType,k=e._dirtyElements,P=e._dirtyLeaves;m.disconnect(),g=Hq(a,n,e,I,k,P)}catch(I){if(I instanceof Error&&e._onError(I),Gv)throw I;return yR(e,null,o,n),CL(e),e._dirtyType=2,Gv=!0,ha(e,a),void(Gv=!1)}finally{m.observe(o,Yk),e._updating=f,An=d,yo=u,Nn=p}}n._readOnly||(n._readOnly=!0);let h=e._dirtyLeaves,v=e._dirtyElements,C=e._normalizedNodes,y=e._updateTags,b=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(I,k){let P=I._decorators,T=I._pendingDecorators||P,L=k._nodeMap,E;for(E in T)L.has(E)||(T===P&&(T=wR(I)),delete T[E])})(e,n);let w=r?null:Ir(zo(e));if(e._editable&&w!==null&&(l||i===null||i.dirty||!i.is(s))&&o!==null&&!y.has(nR)){Nn=e,An=n;try{if(m!==null&&m.disconnect(),l||i===null||i.dirty){let I=e._blockCursorElement;I!==null&&Sy(I,e,o),hV(s,i,e,w,y,o)}(function(I,k,P){let T=I._blockCursorElement;if(Je(P)&&P.isCollapsed()&&P.anchor.type==="element"&&k.contains(document.activeElement)){let L=P.anchor,E=L.getNode(),A=L.offset,R=!1,F=null;if(A===E.getChildrenSize())Qv(E.getChildAtIndex(A-1))&&(R=!0);else{let H=E.getChildAtIndex(A);if(H!==null&&Qv(H)){let z=H.getPreviousSibling();(z===null||Qv(z))&&(R=!0,F=I.getElementByKey(H.__key))}}if(R){let H=I.getElementByKey(E.__key);return T===null&&(I._blockCursorElement=T=(function(z){let _=z.theme,Q=document.createElement("div");Q.contentEditable="false",Q.setAttribute("data-lexical-cursor","true");let D=_.blockCursor;if(D!==void 0){if(typeof D=="string"){let O=Tu(D);D=_.blockCursor=O}D!==void 0&&Q.classList.add(...D)}return Q})(I._config)),k.style.caretColor="transparent",void(F===null?H.appendChild(T):H.insertBefore(T,F))}}T!==null&&Sy(T,I,k)})(e,o,i)}finally{m!==null&&m.observe(o,Yk),Nn=p,An=d}}g!==null&&(function(I,k,P,T,L){let E=Array.from(I._listeners.mutation),A=E.length;for(let R=0;R<A;R++){let[F,H]=E[R];for(let z of H){let _=k.get(z);_!==void 0&&F(_,{dirtyLeaves:T,prevEditorState:L,updateTags:P})}}})(e,g,y,h,a),Je(i)||i===null||s!==null&&s.is(i)||e.dispatchCommand(Ay,void 0);let S=e._pendingDecorators;S!==null&&(e._decorators=S,e._pendingDecorators=null,ou("decorator",e,!0,S)),(function(I,k,P){let T=oL(k),L=oL(P);T!==L&&ou("textcontent",I,!0,L)})(e,t||a,n),ou("update",e,!0,{dirtyElements:v,dirtyLeaves:h,editorState:n,mutatedNodes:g,normalizedNodes:C,prevEditorState:t||a,tags:y}),(function(I,k){if(I._deferred=[],k.length!==0){let P=I._updating;I._updating=!0;try{for(let T=0;T<k.length;T++)k[T]()}finally{I._updating=P}}})(e,b),(function(I){let k=I._updates;if(k.length!==0){let P=k.shift();if(P){let[T,L]=P;Pm(I,T,L)}}})(e)}function ou(e,t,n,...o){let r=t._updating;t._updating=n;try{let a=Array.from(t._listeners[e]);for(let s=0;s<a.length;s++)a[s].apply(null,o)}finally{t._updating=r}}function eL(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[a,s]=r,i=e._pendingEditorState,l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(o=!0),s.discrete&&(i===null&&me(191),i._flushSync=!0),l&&e._deferred.push(l),mR(e,s.tag)),i==null?Pm(e,a,s):a()}}return o}function Pm(e,t,n){let o=e._updateTags,r,a=!1,s=!1;n!==void 0&&(r=n.onUpdate,mR(e,n.tag),a=n.skipTransforms||!1,s=n.discrete||!1),r&&e._deferred.push(r);let i=e._editorState,l=e._pendingEditorState,d=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=gR(l||i),d=!0),l._flushSync=s;let u=An,p=yo,f=Nn,m=e._updating;An=l,yo=!1,e._updating=!0,Nn=e;let g=e._headless||e.getRootElement()===null;jy(null);try{d&&(g?i._selection!==null&&(l._selection=i._selection.clone()):l._selection=(function(y,b){let w=y.getEditorState()._selection,S=Ir(zo(y));return Je(w)||w==null?Tm(w,S,y,b):w.clone()})(e,n&&n.event||null));let v=e._compositionKey;t(),a=eL(e,a),(function(y,b){let w=b.getEditorState()._selection,S=y._selection;if(Je(S)){let I=S.anchor,k=S.focus,P;if(I.type==="text"&&(P=I.getNode(),P.selectionTransform(w,S)),k.type==="text"){let T=k.getNode();P!==T&&T.selectionTransform(w,S)}}})(l,e),e._dirtyType!==0&&(a?(function(y,b){let w=b._dirtyLeaves,S=y._nodeMap;for(let I of w){let k=S.get(I);Ue(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&Lk(k)}})(l,e):(function(y,b){let w=b._dirtyLeaves,S=b._dirtyElements,I=y._nodeMap,k=ds(),P=new Map,T=w,L=T.size,E=S,A=E.size;for(;L>0||A>0;){if(L>0){b._dirtyLeaves=new Set;for(let R of T){let F=I.get(R);Ue(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Lk(F),F!==void 0&&Jk(F,k)&&Xk(b,F,P),w.add(R)}if(T=b._dirtyLeaves,L=T.size,L>0){tm++;continue}}b._dirtyLeaves=new Set,b._dirtyElements=new Map,E.delete("root")&&E.set("root",!0);for(let R of E){let F=R[0],H=R[1];if(S.set(F,H),!H)continue;let z=I.get(F);z!==void 0&&Jk(z,k)&&Xk(b,z,P)}T=b._dirtyLeaves,L=T.size,E=b._dirtyElements,A=E.size,tm++}b._dirtyLeaves=w,b._dirtyElements=S})(l,e),eL(e),(function(y,b,w,S){let I=y._nodeMap,k=b._nodeMap,P=[];for(let[T]of S){let L=k.get(T);L!==void 0&&(L.isAttached()||(pe(L)&&hL(L,T,I,k,P,S),I.has(T)||S.delete(T),P.push(T)))}for(let T of P)k.delete(T);for(let T of w){let L=k.get(T);L===void 0||L.isAttached()||(I.has(T)||w.delete(T),k.delete(T))}})(i,l,e._dirtyLeaves,e._dirtyElements)),v!==e._compositionKey&&(l._flushSync=!0);let C=l._selection;if(Je(C)){let y=l._nodeMap,b=C.anchor.key,w=C.focus.key;y.get(b)!==void 0&&y.get(w)!==void 0||me(19)}else Cu(C)&&C._nodes.size===0&&(l._selection=null)}catch(v){return v instanceof Error&&e._onError(v),e._pendingEditorState=i,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ha(e)}finally{An=u,yo=p,Nn=f,e._updating=m,tm=0}e._dirtyType!==0||e._deferred.length>0||(function(v,C){let y=C.getEditorState()._selection,b=v._selection;if(b!==null){if(b.dirty||!b.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,ha(e)):d&&EV(()=>{ha(e)}):(l._flushSync=!1,d&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function Vr(e,t,n){Nn===e&&n===void 0?t():Pm(e,t,n)}var xy=class e{element;before;after;constructor(t,n,o){this.element=t,this.before=n||null,this.after=o||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(t){let n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&me(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&me(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&me(224),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{let n=t==="decorator"&&(bm||yu||xm);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,a=document.createElement("br");if(o.insertBefore(a,r),t){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",o.insertBefore(s,a),o.__lexicalLineBreak=s}else o.__lexicalLineBreak=a}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,r))]}let a=tL(n,o);a.push(r);let s=tL(n,this.element),i=t.getIndexWithinParent();for(let l=0;l<s.length;l++){let d=a[l],u=s[l];if(d===void 0||d<u)break;if(d>u){i+=1;break}}return[t.getParentOrThrow(),i]}};function tL(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let a=o.previousSibling;a!==null;a=a.previousSibling)r++;n.push(r)}return o!==e&&me(225),n.reverse()}var fs=class extends er{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),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(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let t=this.getFormat();return Pq[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){let t=[],n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let t=Vt()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){let t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){let t=[],n=this.getFirstChild();for(;n!==null;){if(Ue(n)&&t.push(n),pe(n)){let o=n.getAllTextNodes();t.push(...o)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;pe(t);){let n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;pe(t);){let n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){let n=this.getChildren(),o=n.length;if(t>=o){let a=n[o-1];return pe(a)&&a.getLastDescendant()||a||null}let r=n[t];return pe(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let t=this.getLatest().__first;return t===null?null:Sn(t)}getFirstChildOrThrow(){let t=this.getFirstChild();return t===null&&me(45,this.__key),t}getLastChild(){let t=this.getLatest().__last;return t===null?null:Sn(t)}getLastChildOrThrow(){let t=this.getLastChild();return t===null&&me(96,this.__key),t}getChildAtIndex(t){let n=this.getChildrenSize(),o,r;if(t<n/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=t;){if(r===t)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=n-1;o!==null&&r>=t;){if(r===t)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let t="",n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContent(),pe(a)&&r!==o-1&&!a.isInline()&&(t+=Sm)}return t}getTextContentSize(){let t=0,n=this.getChildren(),o=n.length;for(let r=0;r<o;r++){let a=n[r];t+=a.getTextContentSize(),pe(a)&&r!==o-1&&!a.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){let n=Jv[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){let n=Vn[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return hu(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){En();let o=Rt(),r=t,a=n,s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){let l=this.getFirstChild();if(Ue(l)||pe(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){let l=this.getLastChild();if(Ue(l)||pe(l))return l.select()}}r===void 0&&(r=s),a===void 0&&(a=s);let i=this.__key;return Je(o)?(o.anchor.set(i,r,"element"),o.focus.set(i,a,"element"),o.dirty=!0,o):dR(i,r,i,a,"element","element")}selectStart(){let t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){let t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){let t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){let n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Jv[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){let n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){let n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,o){pm(this)&&me(324,this.__key,this.__type);let r=this.getChildrenSize(),a=this.getWritable();t+n<=r||me(226,String(t),String(n),String(r));let s=a.__key,i=[],l=[],d=this.getChildAtIndex(t+n),u=null,p=r-n+o.length;if(t!==0)if(t===r)u=this.getLastChild();else{let m=this.getChildAtIndex(t);m!==null&&(u=m.getPreviousSibling())}if(n>0){let m=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){m===null&&me(100);let h=m.getNextSibling(),v=m.__key;us(m.getWritable()),l.push(v),m=h}}let f=u;for(let m of o){f!==null&&m.is(f)&&(u=f=f.getPreviousSibling());let g=m.getWritable();g.__parent===s&&p--,us(g);let h=m.__key;if(f===null)a.__first=h,g.__prev=null;else{let v=f.getWritable();v.__next=h,g.__prev=v.__key}m.__key===s&&me(76),g.__parent=s,i.push(h),f=m}if(t+n===r)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(d!==null){let m=d.getWritable();if(f!==null){let g=f.getWritable();m.__prev=f.__key,g.__next=d.__key}else m.__prev=null}if(a.__size=p,l.length){let m=Rt();if(Je(m)){let g=new Set(l),h=new Set(i),{anchor:v,focus:C}=m;nL(v,g,h)&&gm(v,v.getNode(),this,u,d),nL(C,g,h)&&gm(C,C.getNode(),this,u,d),p!==0||this.canBeEmpty()||tr(this)||this.remove()}}return a}getDOMSlot(t){return new xy(t)}exportDOM(t){let{element:n}=super.exportDOM(t);if(oo(n)){let o=this.getIndent();o>0&&(n.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){let t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),o=this.getTextStyle();return n===0&&o===""||tr(this)||this.getChildren().some(Ue)||(n!==0&&(t.textFormat=n),o!==""&&(t.textStyle=o)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){let o=this.getDOMSlot(t),r=o.getFirstChild();for(let a=this.getFirstChild();a;a=a.getNextSibling()){let s=n.getElementByKey(a.getKey());s!==null&&(r==null?(o.insertChild(s),r=s):r!==s&&o.replaceChild(s,r),r=r.nextSibling)}}};function pe(e){return e instanceof fs}function nL(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var mu=class extends er{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Qt(e){return e instanceof mu}var Ul=class e extends fs{__cachedText;static getType(){return"root"}static clone(){return new e}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){me(51)}getTextContent(){let t=this.__cachedText;return!Ql()&&Vt()._dirtyType!==0||t===null?super.getTextContent():t}remove(){me(52)}replace(t){me(53)}insertBefore(t){me(54)}insertAfter(t){me(55)}updateDOM(t,n){return!1}splice(t,n,o){for(let r of o)pe(r)||Qt(r)||me(282);return super.splice(t,n,o)}static importJSON(t){return Bo().updateFromJSON(t)}collapseAtStart(){return!0}};function On(e){return e instanceof Ul}function gR(e){return new gu(new Map(e._nodeMap))}function Gy(){return new gu(new Map([["root",new Ul]]))}function hR(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&me(130,n.name),pe(e)){let o=t.children;Array.isArray(o)||me(59,n.name);let r=e.getChildren();for(let a=0;a<r.length;a++){let s=hR(r[a]);o.push(s)}}return t}function SV(e){return e instanceof gu}var gu=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Zk(n&&n.editor||null,this,t)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Zk(null,this,()=>({root:hR(Bo())}))}},hm=class extends fs{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}},Kl=class e extends fs{static getType(){return"paragraph"}static clone(t){return new e(t.__key)}createDOM(t){let n=document.createElement("p"),o=Fl(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}static importDOM(){return{p:t=>({conversion:IV,priority:0})}}exportDOM(t){let{element:n}=super.exportDOM(t);if(oo(n)){this.isEmpty()&&n.append(document.createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}static importJSON(t){return ya().updateFromJSON(t)}exportJSON(){let t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(Ue);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){let o=ya();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){let t=this.getChildren();if(t.length===0||Ue(t[0])&&t[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 IV(e){let t=ya();if(e.style&&(t.setFormat(e.style.textAlign),BR(e,t)),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in Jv&&t.setFormat(n)}return{node:t}}function ya(){return Iu(new Kl)}function vR(e){return e instanceof Kl}var Nl=0,wV=1,TV=2,PV=3,kV=4;function yR(e,t,n,o){let r=e._keyToDOMMap;r.clear(),e._editorState=Gy(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function CR(e){let t=new Set,n=new Set,o=e;for(;o;){let{ownNodeConfig:r}=wu(o),a=o.transform;if(!n.has(a)){n.add(a);let s=o.transform();s&&t.add(s)}if(r){let s=r.$transform;s&&t.add(s),o=r.extends}else{let s=Object.getPrototypeOf(o);o=s.prototype instanceof er&&s!==er?s:void 0}}return t}function LV(e){let t=e||{},n=xV(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,s=Gy(),i=t.namespace||(r!==null?r._config.namespace:kR()),l=t.editorState,d=[Ul,gi,Bl,Hl,Kl,hm,...t.nodes||[]],{onError:u,html:p}=t,f=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let h=0;h<d.length;h++){let v=d[h],C=null,y=null;if(typeof v!="function"){let S=v;v=S.replace,C=S.with,y=S.withKlass||null}wu(v);let b=v.getType(),w=CR(v);m.set(b,{exportDOM:p&&p.export?p.export.get(v):void 0,klass:v,replace:C,replaceWithKlass:y,sharedNodeState:xL(d[h]),transforms:w})}}let g=new ms(s,r,m,{disableEvents:a,namespace:i,theme:o},u||console.error,(function(h,v){let C=new Map,y=new Set,b=w=>{Object.keys(w).forEach(S=>{let I=C.get(S);I===void 0&&(I=[],C.set(S,I)),I.push(w[S])})};return h.forEach(w=>{let S=w.klass.importDOM;if(S==null||y.has(S))return;y.add(S);let I=S.call(w.klass);I!==null&&b(I)}),v&&b(v),C})(m,p?p.import:void 0),f,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(h){h.registerCommand(Ny,Yq,Nl),h.registerCommand(_y,Xq,Nl),h.registerCommand(Dy,Jq,Nl),h.registerCommand(Oy,Zq,Nl),h.registerCommand(Hy,eV,Nl)})(g),g}var ms=class{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(t,n,o,r,a,s,i,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,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=r,this._nodes=o,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=kR(),this._onError=a,this._htmlConversions=s,this._editable=i,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){let n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){let n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){let n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){let n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,o){o===void 0&&me(35);let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let a=r.get(t);a===void 0&&me(36,String(t));let s=a[o];return s.add(n),()=>{s.delete(n),a.every(i=>i.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,a=this._listeners.mutation,s=a.get(n);s===void 0&&(s=new Set,a.set(n,s)),s.add(r);let i=o&&o.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(n,r),()=>{s.delete(r),s.size===0&&a.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&me(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=wy(o).get(n.getType());if(!r)return;let a=new Map;for(let s of r.keys())a.set(s,"created");a.size>0&&t(a,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],a=o.replaceWithKlass;if(a!=null){let s=this.registerNodeTransformToKlass(a,n);r.push(s)}return(function(s,i){let l=wy(s.getEditorState()),d=[];for(let u of i){let p=l.get(u);p&&d.push(p)}d.length!==0&&s.update(()=>{for(let u of d)for(let p of u.keys()){let f=Sn(p);f&&f.markDirty()}},s._pendingEditorState===null?{tag:em}:void 0)})(this,r.map(s=>s.klass.getType())),()=>{r.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return De(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=Fl(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,yR(this,n,t,r),n!==null&&(this._config.disableEvents||tV(n),o!=null&&n.classList.remove(...o)),t!==null){let a=aC(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=a,this._dirtyType=2,CL(this),this._updateTags.add(em),ha(this),this._config.disableEvents||(function(i,l){let d=i.ownerDocument;fy.set(i,d);let u=cm.get(d)??0;u<1&&d.addEventListener("selectionchange",JL),cm.set(d,u+1),i.__lexicalEditor=l;let p=XL(i);for(let f=0;f<py.length;f++){let[m,g]=py[f],h=typeof g=="function"?v=>{Dk(v)||(_k(v),(l.isEditable()||m==="click")&&g(v,l))}:v=>{if(Dk(v))return;_k(v);let C=l.isEditable();switch(m){case"cut":return C&&De(l,Ky,v);case"copy":return De(l,Uy,v);case"paste":return C&&De(l,Fy,v);case"dragstart":return C&&De(l,zL,v);case"dragover":return C&&De(l,HL,v);case"dragend":return C&&De(l,UL,v);case"focus":return C&&De(l,KL,v);case"blur":return C&&De(l,$L,v);case"drop":return C&&De(l,BL,v)}};i.addEventListener(m,h),p.push(()=>{i.removeEventListener(m,h)})}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(em),ha(this);ou("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&me(38);let o=t;o._readOnly&&(o=gR(t),o._selection=t._selection?t._selection.clone():null),yL(this);let r=this._pendingEditorState,a=this._updateTags,s=n!==void 0?n.tag:null;r===null||r.isEmpty()||(s!=null&&a.add(s),ha(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&a.add(s),this._updating||ha(this)}parseEditorState(t,n){return(function(o,r,a){let s=Gy(),i=An,l=yo,d=Nn,u=r._dirtyElements,p=r._dirtyLeaves,f=r._cloneNotNeeded,m=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,An=s,yo=!1,Nn=r,jy(null);try{let g=r._nodes;Wy(o.root,g),a&&a(),s._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=p,r._cloneNotNeeded=f,r._dirtyType=m,An=i,yo=l,Nn=d}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return ha(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(o,r,a){o._updating?o._updates.push([r,a]):Pm(o,r,a)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),Vr(this,()=>{let r=Rt(),a=Bo();r!==null?r.dirty||Co(r.clone()):a.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?a.selectStart():a.selectEnd()),Em("focus"),AR(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Ir(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,ou("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};ms.version="0.41.0+prod.esm";var by=null;function jy(e){by=e}var xR=1;function RV(){xR=1}function Qy(e,t){let n=Yy(e,t);return n===void 0&&me(30,t),n}function Yy(e,t){return e._nodes.get(t)}var EV=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function bR(e){return Qt(Rm(e))}function Xy(e){let t=document.activeElement;if(!oo(t))return!1;let n=t.nodeName;return Qt(Rm(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&bu(t)==null)}function xu(e,t,n){let o=e.getRootElement();try{return o!==null&&o.contains(t)&&o.contains(n)&&t!==null&&!Xy(t)&&Jy(t)===e}catch{return!1}}function km(e){return e instanceof ms}function Jy(e){let t=e;for(;t!=null;){let n=bu(t);if(km(n))return n;t=Su(t)}return null}function bu(e){return e?e.__lexicalEditor:null}function MV(e){return Iq.test(e)?"rtl":wq.test(e)?"ltr":null}function cs(e){return qy(e)||e.isToken()}function ga(e){return cs(e)||e.isSegmented()}function Wr(e){return Yl(e)&&e.nodeType===3}function SR(e){return Yl(e)&&e.nodeType===9}function vi(e){let t=e;for(;t!=null;){if(Wr(t))return t;t=t.firstChild}return null}function hu(e,t,n){let o=Vn[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~Vn.superscript:t==="superscript"?r&=~Vn.subscript:t==="lowercase"?(r&=~Vn.uppercase,r&=~Vn.capitalize):t==="uppercase"?(r&=~Vn.lowercase,r&=~Vn.capitalize):t==="capitalize"&&(r&=~Vn.lowercase,r&=~Vn.uppercase),r}function AV(e){return Ue(e)||pi(e)||Qt(e)}function IR(e,t){let n=(function(){let s=by;return by=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);En(),pR();let o=Vt(),r=ba(),a=""+xR++;r._nodeMap.set(a,e),pe(e)?o._dirtyElements.set(a,!0):o._dirtyLeaves.add(a),o._cloneNotNeeded.add(a),o._dirtyType=1,e.__key=a}function us(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),a=e.getNextSibling(),s=a!==null?a.__key:null,i=r!==null?r.__key:null,l=r!==null?r.getWritable():null,d=a!==null?a.getWritable():null;r===null&&(o.__first=s),a===null&&(o.__last=i),l!==null&&(l.__next=s),d!==null&&(d.__prev=i),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}function vm(e){pR(),pm(e)&&me(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,o=ba(),r=Vt(),a=o._nodeMap,s=r._dirtyElements;n!==null&&(function(l,d,u){let p=l;for(;p!==null;){if(u.has(p))return;let f=d.get(p);if(f===void 0)break;u.set(p,!1),p=f.__parent}})(n,a,s);let i=t.__key;r._dirtyType=1,pe(e)?s.set(i,!0):r._dirtyLeaves.add(i)}function Mn(e){En();let t=Vt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=Sn(n);o!==null&&o.getWritable()}if(e!==null){let o=Sn(e);o!==null&&o.getWritable()}}}function ds(){return Ql()?null:Vt()._compositionKey}function Sn(e,t){let n=(t||ba())._nodeMap.get(e);return n===void 0?null:n}function Zy(e,t){let n=Lm(e,Vt());return n!==void 0?Sn(n,t):null}function Lm(e,t){return e[`__lexicalKey_${t._key}`]}function Rm(e,t){let n=e;for(;n!=null;){let o=Zy(n,t);if(o!==null)return o;n=Su(n)}return null}function wR(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function oL(e){return e.read(()=>Bo().getTextContent())}function Bo(){return TR(ba())}function TR(e){return e._nodeMap.get("root")}function Co(e){En();let t=ba();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function _l(e){let t=Vt(),n=(function(o,r){let a=o;for(;a!=null;){let s=Lm(a,r);if(s!==void 0)return s;a=Su(a)}return null})(e,t);return n===null?e===t.getRootElement()?Sn("root"):null:Sn(n)}function PR(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function eC(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function kR(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function LR(e){return Wr(e)?e.nodeValue:null}function tC(e,t,n){let o=Ir(zo(t));if(o===null)return;let r=o.anchorNode,{anchorOffset:a,focusOffset:s}=o;if(r!==null){let i=LR(r),l=Rm(r);if(i!==null&&Ue(l)){if((i===iu||i===Ry)&&n){let d=n.length;i=n,a=d,s=d}i!==null&&nC(l,i,a,s,e)}}}function nC(e,t,n,o,r){let a=e;if(a.isAttached()&&(r||!a.isDirty())){let s=a.isComposing(),i=t;if((s||r)&&(t.endsWith(iu)&&(i=t.slice(0,-iu.length)),r)){let d=Ry,u;for(;(u=i.indexOf(d))!==-1;)i=i.slice(0,u)+i.slice(u+d.length),n!==null&&n>u&&(n=Math.max(u,n-d.length)),o!==null&&o>u&&(o=Math.max(u,o-d.length))}let l=a.getTextContent();if(r||i!==l){if(i===""){if(Mn(null),xm||yu||bm)a.remove();else{let h=Vt();setTimeout(()=>{h.update(()=>{a.isAttached()&&a.remove()})},20)}return}let d=a.getParent(),u=Ci(),p=a.getTextContentSize(),f=ds(),m=a.getKey();if(a.isToken()||f!==null&&m===f&&!s||Je(u)&&(d!==null&&!d.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===p&&!a.canInsertTextAfter()&&!s))return void a.markDirty();let g=Rt();if(!Je(g)||n===null||o===null)return void rL(a,i,g);if(g.setTextNodeRange(a,n,a,o),a.isSegmented()){let h=Rn(a.getTextContent());a.replace(h),a=h}rL(a,i,g)}}}function rL(e,t,n){if(e.setTextContent(t),Je(n)){let o=e.getKey();for(let r of["anchor","focus"]){let a=n[r];a.type==="text"&&a.key===o&&(a.offset=xr(e,a.offset,"clamp"))}}}function jf(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function RR(e,t){return jf(e,t,"altKey")&&jf(e,t,"ctrlKey")&&jf(e,t,"shiftKey")&&jf(e,t,"metaKey")}function Dt(e,t,n){if(!RR(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let o="Key"+t.toUpperCase();return e.code===o}var ma={ctrlKey:!hr,metaKey:hr},aL={altKey:hr,ctrlKey:!hr};function sL(e){return e.key==="Backspace"}function iL(e){return Dt(e,"a",ma)}function NV(e){let t=Bo();if(Je(e)){let n=e.anchor,o=e.focus,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),rm(e),e}{let n=t.select(0,t.getChildrenSize());return Co(rm(n)),n}}function Fl(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let a=Tu(r);return n[t]=a,a}return r}function oC(e,t,n,o,r){if(n.size===0)return;let a=o.__type,s=o.__key,i=t.get(a);i===void 0&&me(33,a);let l=i.klass,d=e.get(l);d===void 0&&(d=new Map,e.set(l,d));let u=d.get(s),p=u==="destroyed"&&r==="created";(u===void 0||p)&&d.set(s,p?"updated":r)}function _V(e){let t=e.getType(),n=ba();if(n._readOnly){let a=wy(n).get(t);return a?Array.from(a.values()):[]}let o=n._nodeMap,r=[];for(let[,a]of o)a instanceof e&&a.__type===t&&a.isAttached()&&r.push(a);return r}function lL(e,t,n){let o=e.getParent(),r=n,a=e;return o!==null&&(t&&n===0?(r=a.getIndexWithinParent(),a=o):t||n!==a.getChildrenSize()||(r=a.getIndexWithinParent()+1,a=o)),a.getChildAtIndex(t?r-1:r)}function ER(e,t){let n=e.offset;if(e.type==="element")return lL(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?lL(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function MR(e){let t=zo(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function De(e,t,n){return(function(o,r,a){let s=eC(o);for(let i=4;i>=0;i--)for(let l=0;l<s.length;l++){let d=s[l],u=d._commands.get(r);if(u!==void 0){let p=u[i];if(p!==void 0){let f=Array.from(p),m=f.length,g=!1;if(Vr(d,()=>{for(let h=0;h<m;h++)if(f[h](a,o))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function $l(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&me(75,t),n}function Su(e){let t=e.assignedSlot||e.parentElement;return OR(t)?t.host:t}function rC(e){return SR(e)?e:oo(e)?e.ownerDocument:null}function DV(e){return Vt()._updateTags.has(e)}function Em(e){En(),Vt()._updateTags.add(e)}function AR(e){En(),Vt()._deferred.push(e)}function ym(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function aC(e){let t=rC(e);return t?t.defaultView:null}function zo(e){let t=e._window;return t===null&&me(78),t}function OV(e){return pe(e)&&e.isInline()||Qt(e)&&e.isInline()}function NR(e){let t=e.getParentOrThrow();for(;t!==null;){if(tr(t))return t;t=t.getParentOrThrow()}return t}function tr(e){return On(e)||pe(e)&&e.isShadowRoot()}function sC(e){let t=e.constructor.clone(e);return IR(t,null),t.afterCloneFrom(e),t}function Iu(e){let t=Vt(),n=e.getType(),o=Yy(t,n);o===void 0&&me(200,e.constructor.name,n);let{replace:r,replaceWithKlass:a}=o;if(r!==null){let s=r(e),i=s.constructor;return a!==null?s instanceof a||me(201,a.name,a.getType(),i.name,i.getType(),e.constructor.name,n):s instanceof e.constructor&&i!==e.constructor||me(202,i.name,i.getType(),e.constructor.name,n),s.__key===e.__key&&me(203,e.constructor.name,n,i.name,i.getType()),s}return e}function jv(e,t){!On(e.getParent())||pe(t)||Qt(t)||me(99)}function _R(e){let t=Sn(e);return t===null&&me(63,e),t}function Qv(e){return(Qt(e)||pe(e)&&!e.canBeEmpty())&&!e.isInline()}function Sy(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Ir(e){return Sr?(e||window).getSelection():null}function DR(e){let t=aC(e);return t?t.getSelection():null}function FV(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),tr(e)&&me(102);let o=s=>{let i=s.getParentOrThrow(),l=tr(i),d=s!==n||l?sC(s):s;if(l)return pe(s)&&pe(d)||me(133),s.insertAfter(d),[s,d,d];{let[u,p,f]=o(i),m=s.getNextSiblings();return f.append(d,...m),[u,p,d]}},[r,a]=o(n);return[r,a]}function BV(e){return oo(e)&&e.tagName==="A"}function oo(e){return Yl(e)&&e.nodeType===1}function Yl(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function OR(e){return Yl(e)&&e.nodeType===11}function FR(e){let t=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 e.nodeName.match(t)!==null}function Iy(e){let t=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 e.nodeName.match(t)!==null}function va(e){if(Qt(e)&&!e.isInline())return!0;if(!pe(e)||tr(e))return!1;let t=e.getFirstChild(),n=t===null||pi(t)||Ue(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function iC(){return Vt()}var dL=new WeakMap,zV=new Map;function wy(e){if(!e._readOnly&&e.isEmpty())return zV;e._readOnly||me(192);let t=dL.get(e);return t||(t=(function(n){let o=new Map;for(let[r,a]of n._nodeMap){let s=a.__type,i=o.get(s);i||(i=new Map,o.set(s,i)),i.set(r,a)}return o})(e),dL.set(e,t)),t}function lC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function HV(e){return(t=lC(e))[ZL]=!0,t;var t}function BR(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,o=Math.round(n/40);t.setIndent(o)}function UV(e){e.__lexicalUnmanaged=!0}function zR(e){return e.__lexicalUnmanaged===!0}function Zc(e,t){return(function(n,o){return Object.prototype.hasOwnProperty.call(n,o)})(e,t)&&e[t]!==er[t]}function wu(e){let t=bk in e.prototype?e.prototype[bk]():void 0,n=(function(s){if(!(s===er||s.prototype instanceof er)){let i="<unknown>",l="<unknown>";try{i=s.getType()}catch{}try{ms.version&&(l=JSON.parse(ms.version))}catch{}me(290,s.name,i,l)}return s===mu||s===fs||s===er})(e),o=!n&&Zc(e,"getType")?e.getType():void 0,r,a=o;if(t)if(o)r=t[o];else for(let[s,i]of Object.entries(t))a=s,r=i;if(!n&&a&&(Zc(e,"getType")||(e.getType=()=>a),Zc(e,"clone")||(e.clone=s=>(jy(s),new e)),Zc(e,"importJSON")||(e.importJSON=r&&r.$importJSON||(s=>new e().updateFromJSON(s))),!Zc(e,"importDOM")&&r)){let{importDOM:s}=r;s&&(e.importDOM=()=>s)}return{ownNodeConfig:r,ownNodeType:a}}function KV(e){let t=iC();return En(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var ru=(e,t)=>{let n=e;for(;n!=null&&!On(n);){if(t(n))return n;n=n.getParent()}return null},$V={next:"previous",previous:"next"},ql=class{origin;constructor(t){this.origin=t}[Symbol.iterator](){return uC({hasNext:yi,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return _n(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _n(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),a=this,s=this.getParentAtCaret(),i=new Map;for(let l=a.getAdjacentCaret();l!==null&&i.size<t;l=l.getAdjacentCaret()){let d=l.origin.getWritable();i.set(d.getKey(),d)}for(let l of r){if(i.size>0){let d=a.getNodeAtCaret();if(d){if(i.delete(d.getKey()),i.delete(l.getKey()),!(d.is(l)||a.origin.is(l))){let u=l.getParent();u&&u.is(s)&&l.remove(),d.replace(l)}}else d===null&&me(263,Array.from(i).join(" "))}else a.insert(l);a=_n(l,this.direction)}for(let l of i.values())l.remove();return this}},vu=class e extends ql{type="child";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:xa(t,this.direction)}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return _n(this.getNodeAtCaret(),t)||xa(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}},qV={root:On,shadowRoot:tr};function Cs(e){return $V[e]}function dC(e,t="root"){return qV[t](e)?null:e}var Vl=class e extends ql{type="sibling";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:_n(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return pe(this.origin)?xa(this.origin,this.direction):null}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=Cs(this.direction);return _n(this.getNodeAtCaret(),t)||xa(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Wl)&&this.direction===t.direction&&this.origin.is(t.origin)}},Wl=class e extends ql{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){let t=this.origin.getLatest();return t===this.origin?this:gs(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return _n(dC(this.getParentAtCaret(),t),this.direction)}getFlipped(){return gs(this.origin,Cs(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Vl||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return _n(this.origin,this.direction)}};function Ca(e){return e instanceof Wl}function VV(e){return e instanceof ql}function yi(e){return e instanceof Vl}function Cr(e){return e instanceof vu}var WV={next:class extends Wl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Wl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},GV={next:class extends Vl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},jV={next:class extends vu{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends vu{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function _n(e,t){return e?new GV[t](e):null}function gs(e,t,n){return e?new WV[t](e,xr(e,n)):null}function xr(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&pL(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function Ty(e,t){return new Cm(e,t)}function xa(e,t){return pe(e)?new jV[t](e):null}function HR(e){return e&&e.getChildCaret()||e}function Gl(e){return e&&HR(e.getAdjacentCaret())}var Py=class e{type="node-caret-range";direction;anchor;focus;constructor(t,n,o){this.anchor=t,this.focus=n,this.direction=o}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let t=r=>{let a=this[r].getLatest();return Ca(a)?(function(s,i){let{direction:l,origin:d}=s,u=xr(d,i==="focus"?Cs(l):l);return Ty(s,u-s.offset)})(a,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:a}=o;if(r.isSameNodeCaret(a))return[Ty(r,a.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=Ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=Ca(o),a=s=>s.isSameNodeCaret(o)?null:Gl(s)||s.getParentCaret(t);return uC({hasNext:s=>s!==null&&!(r&&o.isSameNodeCaret(s)),initial:n.isSameNodeCaret(o)?null:a(n),map:s=>s,step:a})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Cm=class{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),a=t.getTextContent();return gs(t.setTextContent(a.slice(0,o)+a.slice(r)),n,o)}};function QV(e){return e instanceof Cm}function cC(e){return hs(e,_n(Bo(),e.direction))}function UR(e){return hs(e,e)}function hs(e,t){return e.direction!==t.direction&&me(265),new Py(e,t,e.direction)}function uC(e){let{initial:t,hasNext:n,step:o,map:r}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let s={done:!1,value:r(a)};return a=o(a),s}}}function pC(e,t){let n=au(e.origin,t.origin);switch(n===null&&me(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(a,s){return Math.sign(a-s)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return fC(n)}}function fC(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,a=t,s=n;for(;a&&s;a=a.getNextSibling(),s=s.getNextSibling()){if(a.__key===r)return-1;if(s.__key===o)return 1}return a===null?1:-1}function Qf(e,t){return t.is(e)}function cL(e){return pe(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function au(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=cL(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=cL(t);o;r=o,o=o.getParent()){let a=n.get(o);if(a!==void 0)return a===null?(Qf(e,o)||me(276),{commonAncestor:o,type:"ancestor"}):r===null?(Qf(t,o)||me(277),{commonAncestor:o,type:"descendant"}):((pe(a)||Qf(e,a))&&(pe(r)||Qf(t,r))&&o.is(a.getParent())&&o.is(r.getParent())||me(278),{a,b:r,commonAncestor:o,type:"branch"})}return null}function vs(e,t){let{type:n,key:o,offset:r}=e,a=_R(e.key);return n==="text"?(Ue(a)||me(266,a.getType(),o),gs(a,t,r)):(pe(a)||me(267,a.getType(),o),VR(a,e.offset,t))}function jl(e,t){let{origin:n,direction:o}=t,r=o==="next";Ca(t)?e.set(n.getKey(),t.offset,"text"):yi(t)?Ue(n)?e.set(n.getKey(),xr(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Cr(t)&&pe(n)||me(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function KR(e){let t=Rt(),n=Je(t)?t:cR();return su(n,e),Co(n),n}function su(e,t){jl(e.anchor,t.anchor),jl(e.focus,t.focus)}function ky(e){let{anchor:t,focus:n}=e,o=vs(t,"next"),r=vs(n,"next"),a=pC(o,r)<=0?"next":"previous";return hs(ys(o,a),ys(r,a))}function Xl(e){let{direction:t,origin:n}=e,o=_n(n,Cs(t)).getNodeAtCaret();return o?_n(o,t):xa(n.getParentOrThrow(),t)}function uL(e,t="root"){let n=[e];for(let o=Cr(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Xl(o));return n}function Yv(e){return!!e&&e.origin.isAttached()}function $R(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,a=mC(e,o),s=uL(a.anchor,n),i=uL(a.focus.getFlipped(),n),l=new Set,d=[];for(let g of a.iterNodeCarets(n))if(Cr(g))l.add(g.origin.getKey());else if(yi(g)){let{origin:h}=g;pe(h)&&!l.has(h.getKey())||d.push(h)}for(let g of d)g.remove();for(let g of a.getTextSlices()){if(!g)continue;let{origin:h}=g.caret,v=h.getTextContentSize(),C=Xl(_n(h,o)),y=h.getMode();if(Math.abs(g.distance)===v&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)C.remove();else if(g.distance!==0){r="removeEmptySlices";let b=g.removeTextSlice(),w=g.caret.origin;if(y==="segmented"){let S=b.origin,I=Rn(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());C.replaceOrInsert(I),b=gs(I,o,b.offset)}w.is(s[0].origin)&&(s[0]=b),w.is(i[0].origin)&&(i[0]=b.getFlipped())}}let u,p;for(let g of s)if(Yv(g)){u=vr(g);break}for(let g of i)if(Yv(g)){p=vr(g);break}let f=(function(g,h,v){if(!g||!h)return null;let C=g.getParentAtCaret(),y=h.getParentAtCaret();if(!C||!y)return null;let b=C.getParents().reverse();b.push(C);let w=y.getParents().reverse();w.push(y);let S=Math.min(b.length,w.length),I;for(I=0;I<S&&b[I]===w[I];I++);let k=(L,E)=>{let A;for(let R=I;R<L.length;R++){let F=L[R];if(tr(F))return;!A&&E(F)&&(A=F)}return A},P=k(b,va),T=P&&k(w,L=>v.has(L.getKey())&&va(L));return P&&T?[P,T]:null})(u,p,l);if(f){let[g,h]=f;xa(g,"previous").splice(0,h.getChildren());let v=h.getParent();for(h.remove(!0);v&&v.isEmpty();){let C=v;v=v.getParent(),C.remove(!0)}}let m=[u,p,...s,...i].find(Yv);if(m)return UR(ys(vr(m),e.direction));me(269,JSON.stringify(s.map(g=>g.origin.__key)))}function vr(e){let t=(function(r){let a=r;for(;Cr(a);){let s=Gl(a);if(!Cr(s))break;a=s}return a})(e.getLatest()),{direction:n}=t;if(Ue(t.origin))return Ca(t)?t:gs(t.origin,n,n);let o=t.getAdjacentCaret();return yi(o)&&Ue(o.origin)?gs(o.origin,n,Cs(n)):t}function qR(e){return Ca(e)&&e.offset!==xr(e.origin,e.direction)}function ys(e,t){return e.direction===t?e:e.getFlipped()}function mC(e,t){return e.direction===t?e:hs(ys(e.focus,t),ys(e.anchor,t))}function VR(e,t,n){let o=xa(e,"next");for(let r=0;r<t;r++){let a=o.getAdjacentCaret();if(a===null)break;o=a}return ys(o,n)}function YV(e,t="root"){let n=0,o=e,r=Gl(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Gl(o)}return r&&[r,n]}function XV(e){let{origin:t,offset:n,direction:o}=e;if(n===xr(t,o))return e.getSiblingCaret();if(n===xr(t,Cs(o)))return Xl(e.getSiblingCaret());let[r]=t.splitText(n);return Ue(r)||me(281),ys(_n(r,"next"),o)}function JV(e,t){return!0}function ZV(e,{$copyElementNode:t=sC,$splitTextPointCaretNext:n=XV,rootMode:o="shadowRoot",$shouldSplit:r=JV}={}){if(Ca(e))return n(e);let a=e.getParentCaret(o);if(a){let{origin:s}=a;if(Cr(e)&&(!s.canBeEmpty()||!r(s,"first")))return Xl(a);let i=(function(l){let d=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())d.push(u.origin);return d})(e);(i.length>0||s.canBeEmpty()&&r(s,"last"))&&a.insert(t(s).splice(0,0,i))}return a}function e4(e){return e}function t4(...e){return e}function n4(e,t){return[e,t]}function o4(e){return e}function r4(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Tu(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function a4(e,...t){let n=Tu(...t);n.length>0&&e.classList.add(...n)}function s4(e,...t){let n=Tu(...t);n.length>0&&e.classList.remove(...n)}function i4(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var B=gC,ige=B.$addUpdateTag,xs=B.$applyNodeReplacement,Jl=B.$caretFromPoint,WR=B.$caretRangeFromSelection,Mm=B.$cloneWithProperties,GR=B.$cloneWithPropertiesEphemeral,lge=B.$comparePointCaretNext,dge=B.$copyNode,jR=B.$create,xi=B.$createLineBreakNode,QR=B.$createNodeSelection,nr=B.$createParagraphNode,cge=B.$createPoint,bi=B.$createRangeSelection,YR=B.$createRangeSelectionFromDom,XR=B.$createTabNode,wr=B.$createTextNode,JR=B.$extendCaretToRange,Sa=B.$findMatchingParent,hC=B.$getAdjacentChildCaret,uge=B.$getAdjacentNode,Si=B.$getAdjacentSiblingOrParentSiblingCaret,vC=B.$getCaretInDirection,ZR=B.$getCaretRange,pge=B.$getCaretRangeInDirection,eE=B.$getCharacterOffsets,bs=B.$getChildCaret,fge=B.$getChildCaretAtIndex,yC=B.$getChildCaretOrSelf,tE=B.$getCollapsedCaretRange,mge=B.$getCommonAncestor,gge=B.$getCommonAncestorResultBranchOrder,Am=B.$getEditor,hge=B.$getNearestNodeFromDOMNode,vge=B.$getNearestRootOrShadowRoot,Zl=B.$getNodeByKey,yge=B.$getNodeByKeyOrThrow,nE=B.$getNodeFromDOMNode,Pu=B.$getPreviousSelection,yt=B.$getRoot,Oe=B.$getSelection,Ia=B.$getSiblingCaret,Nm=B.$getState,Cge=B.$getStateChange,xge=B.$getTextContent,bge=B.$getTextNodeOffset,Sge=B.$getTextPointCaret,Ige=B.$getTextPointCaretSlice,wge=B.$getWritableNodeState,oE=B.$hasAncestor,Tge=B.$hasUpdateTag,Pge=B.$insertNodes,ed=B.$isBlockElementNode,ku=B.$isChildCaret,_m=B.$isDecoratorNode,rE=B.$isEditorState,Xe=B.$isElementNode,aE=B.$isExtendableTextPointCaret,kge=B.$isInlineElementOrDecoratorNode,sE=B.$isLeafNode,td=B.$isLineBreakNode,Lge=B.$isNodeCaret,CC=B.$isNodeSelection,iE=B.$isParagraphNode,Ee=B.$isRangeSelection,Lu=B.$isRootNode,Ii=B.$isRootOrShadowRoot,lE=B.$isSiblingCaret,Rge=B.$isTabNode,pt=B.$isTextNode,Dm=B.$isTextPointCaret,Ege=B.$isTextPointCaretSlice,xC=B.$isTokenOrSegmented,Mge=B.$isTokenOrTab,Age=B.$nodesOfType,dE=B.$normalizeCaret,cE=B.$normalizeSelection__EXPERIMENTAL,Nge=B.$onUpdate,uE=B.$parseSerializedNode,_ge=B.$removeTextFromCaretRange,pE=B.$rewindSiblingCaret,Om=B.$selectAll,Dge=B.$setCompositionKey,Oge=B.$setPointFromCaret,or=B.$setSelection,fE=B.$setSelectionFromCaretRange,Fm=B.$setState,mE=B.$splitAtPointCaretNext,gE=B.$splitNode,Fge=B.$updateRangeSelectionFromCaretRange,bC=B.ArtificialNode__DO_NOT_USE,Bge=B.BEFORE_INPUT_COMMAND,hE=B.BLUR_COMMAND,Ru=B.CAN_REDO_COMMAND,Eu=B.CAN_UNDO_COMMAND,Bm=B.CLEAR_EDITOR_COMMAND,vE=B.CLEAR_HISTORY_COMMAND,yE=B.CLICK_COMMAND,zge=B.COLLABORATION_TAG,zm=B.COMMAND_PRIORITY_CRITICAL,Yt=B.COMMAND_PRIORITY_EDITOR,rr=B.COMMAND_PRIORITY_HIGH,nd=B.COMMAND_PRIORITY_LOW,Hge=B.COMMAND_PRIORITY_NORMAL,Uge=B.COMPOSITION_END_COMMAND,CE=B.COMPOSITION_END_TAG,Kge=B.COMPOSITION_START_COMMAND,xE=B.COMPOSITION_START_TAG,bE=B.CONTROLLED_TEXT_INSERTION_COMMAND,Hm=B.COPY_COMMAND,SE=B.CUT_COMMAND,Um=B.DELETE_CHARACTER_COMMAND,IE=B.DELETE_LINE_COMMAND,wE=B.DELETE_WORD_COMMAND,$ge=B.DRAGEND_COMMAND,qge=B.DRAGOVER_COMMAND,TE=B.DRAGSTART_COMMAND,PE=B.DROP_COMMAND,xo=B.DecoratorNode,Vge=B.ElementNode,kE=B.FOCUS_COMMAND,Wge=B.FORMAT_ELEMENT_COMMAND,LE=B.FORMAT_TEXT_COMMAND,Km=B.HISTORIC_TAG,bo=B.HISTORY_MERGE_TAG,RE=B.HISTORY_PUSH_TAG,SC=B.INDENT_CONTENT_COMMAND,Gge=B.INPUT_COMMAND,IC=B.INSERT_LINE_BREAK_COMMAND,EE=B.INSERT_PARAGRAPH_COMMAND,ME=B.INSERT_TAB_COMMAND,Mu=B.INTERNAL_$isBlock,jge=B.IS_ALL_FORMATTING,Qge=B.IS_BOLD,Yge=B.IS_CODE,Xge=B.IS_HIGHLIGHT,Jge=B.IS_ITALIC,Zge=B.IS_STRIKETHROUGH,ehe=B.IS_SUBSCRIPT,the=B.IS_SUPERSCRIPT,nhe=B.IS_UNDERLINE,AE=B.KEY_ARROW_DOWN_COMMAND,$m=B.KEY_ARROW_LEFT_COMMAND,qm=B.KEY_ARROW_RIGHT_COMMAND,NE=B.KEY_ARROW_UP_COMMAND,Vm=B.KEY_BACKSPACE_COMMAND,_E=B.KEY_DELETE_COMMAND,DE=B.KEY_DOWN_COMMAND,Wm=B.KEY_ENTER_COMMAND,OE=B.KEY_ESCAPE_COMMAND,ohe=B.KEY_MODIFIER_COMMAND,rhe=B.KEY_SPACE_COMMAND,Gm=B.KEY_TAB_COMMAND,FE=B.LineBreakNode,ahe=B.MOVE_TO_END,she=B.MOVE_TO_START,ihe=B.NODE_STATE_KEY,BE=B.OUTDENT_CONTENT_COMMAND,jm=B.PASTE_COMMAND,zE=B.PASTE_TAG,HE=B.ParagraphNode,UE=B.REDO_COMMAND,KE=B.REMOVE_TEXT_COMMAND,$E=B.RootNode,lhe=B.SELECTION_CHANGE_COMMAND,qE=B.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,VE=B.SELECT_ALL_COMMAND,dhe=B.SKIP_COLLAB_TAG,WE=B.SKIP_DOM_SELECTION_TAG,wC=B.SKIP_SCROLL_INTO_VIEW_TAG,che=B.SKIP_SELECTION_FOCUS_TAG,GE=B.TEXT_TYPE_TO_FORMAT,jE=B.TabNode,Qm=B.TextNode,QE=B.UNDO_COMMAND,Au=B.addClassNamesToElement,uhe=B.buildImportMap,Ym=B.configExtension,YE=B.createCommand,Xm=B.createEditor,phe=B.createSharedNodeState,XE=B.createState,JE=B.declarePeerDependency,fn=B.defineExtension,fhe=B.flipDirection,mhe=B.getDOMOwnerDocument,TC=B.getDOMSelection,ghe=B.getDOMSelectionFromTarget,ZE=B.getDOMTextNode,hhe=B.getEditorPropertyFromDOMNode,vhe=B.getNearestEditorFromDOMNode,eM=B.getRegisteredNode,yhe=B.getRegisteredNodeOrThrow,Che=B.getStaticNodeConfig,xhe=B.getTextDirection,bhe=B.getTransformSetFromKlass,tM=B.isBlockDomNode,She=B.isCurrentlyReadOnlyMode,nM=B.isDOMDocumentNode,oM=B.isDOMNode,Ihe=B.isDOMTextNode,whe=B.isDOMUnmanaged,PC=B.isDocumentFragment,The=B.isExactShortcutMatch,rM=B.isHTMLAnchorElement,Jm=B.isHTMLElement,Nu=B.isInlineDomNode,Phe=B.isLexicalEditor,khe=B.isModifierMatch,Lhe=B.isSelectionCapturedInDecoratorInput,aM=B.isSelectionWithinEditor,kC=B.makeStepwiseIterator,Gr=B.mergeRegister,Rhe=B.normalizeClassNames,Zm=B.removeClassNamesFromElement,Ehe=B.removeFromParent,Mhe=B.resetRandomKey,Tr=B.safeCast,Ahe=B.setDOMUnmanaged,Nhe=B.setNodeIndentFromDOM,eg=B.shallowMergeConfig,LC=B.toggleTextFormatType;var RC={};cn(RC,{LexicalComposer:()=>d4});W();var sM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,l4=sM?ue:$,tg={tag:bo};function d4({initialConfig:e,children:t}){let n=K(()=>{let{theme:o,namespace:r,nodes:a,onError:s,editorState:i,html:l}=e,d=xk(null,o),u=Xm({editable:e.editable,html:l,namespace:r,nodes:a,onError:p=>s(p,u),theme:o});return(function(p,f){if(f!==null){if(f===void 0)p.update(()=>{let m=yt();if(m.isEmpty()){let g=nr();m.append(g);let h=sM?document.activeElement:null;(Oe()!==null||h!==null&&h===p.getRootElement())&&g.select()}},tg);else if(f!==null)switch(typeof f){case"string":{let m=p.parseEditorState(f);p.setEditorState(m,tg);break}case"object":p.setEditorState(f,tg);break;case"function":p.update(()=>{yt().isEmpty()&&f(p)},tg)}}})(u,i),[u,d]},[]);return l4(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),c(Ck.Provider,{value:n,children:t})}var c4=RC,iM=c4.LexicalComposer;var MC={};cn(MC,{$canShowPlaceholder:()=>dM,$canShowPlaceholderCurry:()=>p4,$findTextIntersectionFromCharacters:()=>f4,$isRootTextContentEmpty:()=>EC,$isRootTextContentEmptyCurry:()=>u4,$rootTextContent:()=>lM,registerLexicalTextEntity:()=>g4});function lM(){return yt().getTextContent()}function EC(e,t=!0){if(e)return!1;let n=lM();return t&&(n=n.trim()),n===""}function u4(e,t){return()=>EC(e,t)}function dM(e){if(!EC(e,!1))return!1;let t=yt().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(_m(r))return!1;if(Xe(r)){if(!iE(r)||r.__indent!==0)return!1;let a=r.getChildren(),s=a.length;for(let i=0;i<s;i++){let l=a[o];if(!pt(l))return!1}}}return!0}function p4(e){return()=>dM(e)}function f4(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(Xe(n)){let s=n.getFirstChild();if(s!==null){n=s;continue}}else if(pt(n)){let s=n.getTextContentSize();if(o+s>t)return{node:n,offset:t-o};o+=s}let r=n.getNextSibling();if(r!==null){n=r;continue}let a=n.getParent();for(;a!==null;){let s=a.getNextSibling();if(s!==null){n=s;continue e}a=a.getParent()}break}return null}function m4(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function g4(e,t,n,o){let r=s=>s instanceof n,a=s=>{let i=wr(s.getTextContent());i.setFormat(s.getFormat()),s.replace(i)};return[e.registerNodeTransform(Qm,s=>{if(!s.isSimpleText())return;let i,l=s.getPreviousSibling(),d=s.getTextContent(),u=s;if(pt(l)){let f=l.getTextContent(),m=t(f+d);if(r(l)){if(m===null||(g=>g.getLatest().__mode)(l)!==0)return void a(l);{let g=m.end-f.length;if(g>0){let h=f+d.slice(0,g);if(l.select(),l.setTextContent(h),g===d.length)s.remove();else{let v=d.slice(g);s.setTextContent(v)}return}}}else if(m===null||m.start<f.length)return}let p=0;for(;;){i=t(d);let f,m=i===null?"":d.slice(i.end);if(d=m,m===""){let h=u.getNextSibling();if(pt(h)){m=u.getTextContent()+h.getTextContent();let v=t(m);if(v===null)return void(r(h)?a(h):h.markDirty());if(v.start!==0)return}}if(i===null)return;if(i.start===0&&pt(l)&&l.isTextEntity()){p+=i.end;continue}i.start===0?[f,u]=u.splitText(i.end):[,f,u]=u.splitText(i.start+p,i.end+p),f===void 0&&m4(165,"nodeToReplace");let g=o(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;p=0,l=g}}),e.registerNodeTransform(n,s=>{let i=s.getTextContent(),l=t(i);if(l===null||l.start!==0)return void a(s);if(i.length>l.end)return void s.splitText(l.end);let d=s.getPreviousSibling();pt(d)&&d.isTextEntity()&&(a(d),a(s));let u=s.getNextSibling();pt(u)&&u.isTextEntity()&&(a(u),r(s)&&a(s))})]}var wi=MC,Uhe=wi.$canShowPlaceholder,ng=wi.$canShowPlaceholderCurry,Khe=wi.$findTextIntersectionFromCharacters,$he=wi.$isRootTextContentEmpty,qhe=wi.$isRootTextContentEmptyCurry,Vhe=wi.$rootTextContent,Whe=wi.registerLexicalTextEntity;var FC={};cn(FC,{$addNodeStyle:()=>b4,$cloneWithProperties:()=>Mm,$copyBlockFormatIndent:()=>yM,$ensureForwardRangeSelection:()=>vM,$forEachSelectedTextNode:()=>hM,$getComputedStyleForElement:()=>_C,$getComputedStyleForParent:()=>DC,$getSelectionStyleValueForProperty:()=>R4,$isAtNodeEnd:()=>x4,$isParentElementRTL:()=>OC,$isParentRTL:()=>y4,$moveCaretSelection:()=>bM,$moveCharacter:()=>k4,$patchStyleText:()=>S4,$selectAll:()=>Om,$setBlocksType:()=>I4,$shouldOverrideDefaultCharacterSelection:()=>P4,$sliceSelectedTextNodeContent:()=>C4,$trimTextContentFromAnchor:()=>gM,$wrapNodes:()=>T4,createDOMRange:()=>h4,createRectsFromDOMRange:()=>v4,getCSSFromStyleObject:()=>mM,getStyleObjectFromCSS:()=>ag,trimTextContentFromAnchor:()=>E4});function NC(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rg=new Map;function cM(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function uM(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function h4(e,t,n,o,r){let a=t.getKey(),s=o.getKey(),i=document.createRange(),l=e.getElementByKey(a),d=e.getElementByKey(s),u=n,p=r;if(pt(t)&&(l=cM(l)),pt(o)&&(d=cM(d)),t===void 0||o===void 0||l===null||d===null)return null;l.nodeName==="BR"&&([l,u]=uM(l)),d.nodeName==="BR"&&([d,p]=uM(d));let f=l.firstChild;l===d&&f!=null&&f.nodeName==="BR"&&u===0&&p===0&&(p=1);try{i.setStart(l,u),i.setEnd(d,p)}catch{return null}return!i.collapsed||u===p&&a===s||(i.setStart(d,p),i.setEnd(l,u)),i}function v4(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),s=Array.from(t.getClientRects()),i,l=s.length;s.sort((d,u)=>{let p=d.top-u.top;return Math.abs(p)<=3?d.left-u.left:p});for(let d=0;d<l;d++){let u=s[d],p=i&&i.top<=u.top&&i.top+i.height>u.top&&i.left+i.width>u.left,f=u.width+a===o.width;p||f?(s.splice(d--,1),l--):i=u}return s}function fM(e){let t={};if(!e)return t;let n=e.split(";");for(let o of n)if(o!==""){let[r,a]=o.split(/:([^]+)/);r&&a&&(t[r.trim()]=a.trim())}return t}function ag(e){let t=rg.get(e);return t===void 0&&(t=fM(e),rg.set(e,t)),t}function mM(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function _C(e){let t=Am().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function DC(e){return _C(Lu(e)?e:e.getParentOrThrow())}function y4(e){let t=DC(e);return t!==null&&t.direction==="rtl"}function C4(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!xC(t)&&o!==null){let[r,a]=o,s=e.isBackward(),i=r.getNode(),l=a.getNode(),d=t.is(i),u=t.is(l);if(d||u){let[p,f]=eE(e),m=i.is(l),g=t.is(s?l:i),h=t.is(s?i:l),v,C=0;m?(C=p>f?f:p,v=p>f?p:f):g?(C=s?f:p,v=void 0):h&&(C=0,v=s?p:f);let y=t.__text.slice(C,v);y!==t.__text&&(n==="clone"&&(t=GR(t)),t.__text=y)}}return t}function x4(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return Xe(t)||NC(177),e.offset===t.getChildrenSize()}function gM(e,t,n){let o=t.getNode(),r=n;if(Xe(o)){let a=o.getDescendantByIndex(t.offset);a!==null&&(o=a)}for(;r>0&&o!==null;){if(Xe(o)){let d=o.getLastDescendant();d!==null&&(o=d)}let a=o.getPreviousSibling(),s=0;if(a===null){let d=o.getParentOrThrow(),u=d.getPreviousSibling();for(;u===null;){if(d=d.getParent(),d===null){a=null;break}u=d.getPreviousSibling()}d!==null&&(s=d.isInline()?0:2,a=u)}let i=o.getTextContent();i===""&&Xe(o)&&!o.isInline()&&(i=`
|
|
3804
3804
|
|
|
3805
|
-
`);let l=i.length;if(!pt(o)||r>=l){let d=o.getParent();o.remove(),d==null||d.getChildrenSize()!==0||Lu(d)||d.remove(),r-=l+s,o=a}else{let d=o.getKey(),u=e.getEditorState().read(()=>{let m=Zl(d);return pt(m)&&m.isSimpleText()?m.getTextContent():null}),p=l-r,f=i.slice(0,p);if(u!==null&&u!==i){let m=Pu(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let h=wr(u);o.replace(h),g=h}if(Ee(m)&&m.isCollapsed()){let h=m.anchor.offset;g.select(h,h)}}else if(o.isSimpleText()){let m=t.key===d,g=t.offset;g<r&&(g=l);let h=m?g-r:0,v=m?g:p;if(m&&h===0){let[C]=o.splitText(h,v);C.remove()}else{let[,C]=o.splitText(h,v);C.remove()}}else{let m=wr(f);o.replace(m)}r=0}}}function b4(e){let t=e.getStyle(),n=fM(t);rg.set(t,n)}function og(e,t){(Ee(e)?e.isCollapsed():pt(e)||Xe(e))||NC(280);let n=ag(Ee(e)?e.style:pt(e)?e.getStyle():e.getTextStyle()),o=Object.entries(t).reduce((a,[s,i])=>(typeof i=="function"?a[s]=i(n[s],e):i===null?delete a[s]:a[s]=i,a),{...n}),r=mM(o);Ee(e)||pt(e)?e.setStyle(r):e.setTextStyle(r),rg.set(r,o)}function S4(e,t){if(Ee(e)&&e.isCollapsed()){og(e,t);let o=e.anchor.getNode();Xe(o)&&o.isEmpty()&&og(o,t)}hM(o=>{og(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!Xe(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let a=r.getKey();o.has(a)||(o.add(a),og(r,t))}}}function hM(e){let t=Oe();if(!t)return;let n=new Map,o=a=>n.get(a.getKey())||[0,a.getTextContentSize()];if(Ee(t))for(let a of WR(t).getTextSlices())a&&n.set(a.caret.origin.getKey(),a.getSliceIndices());let r=t.getNodes();for(let a of r){if(!pt(a)||!a.canHaveFormat())continue;let[s,i]=o(a);i!==s&&(xC(a)||s===0&&i===a.getTextContentSize()?e(a):e(a.splitText(s,i)[s===0?0:1]))}Ee(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&vM(t)}function vM(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:a}=t;t.set(n.key,n.offset,n.type),n.set(o,r,a)}}function yM(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function I4(e,t,n=yM){if(e===null)return;let o=e.getStartEndPoints(),r=new Map,a=null;if(o){let[s,i]=o;a=bi(),a.anchor.set(s.key,s.offset,s.type),a.focus.set(i.key,i.offset,i.type);let l=Sa(s.getNode(),Mu),d=Sa(i.getNode(),Mu);Xe(l)&&r.set(l.getKey(),l),Xe(d)&&r.set(d.getKey(),d)}for(let s of e.getNodes())if(Xe(s)&&Mu(s))r.set(s.getKey(),s);else if(o===null){let i=Sa(s,Mu);Xe(i)&&r.set(i.getKey(),i)}for(let[s,i]of r){let l=t();n(i,l),i.replace(l,!0),a&&(s===a.anchor.key&&a.anchor.set(l.getKey(),a.anchor.offset,a.anchor.type),s===a.focus.key&&a.focus.set(l.getKey(),a.focus.offset,a.focus.type))}a&&e.is(Oe())&&or(a)}function pM(e){return e.getNode().isAttached()}function w4(e){let t=e;for(;t!==null&&!Ii(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function T4(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,a=e.getNodes(),s=a.length;if(r!==null&&(s===0||s===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let d=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=d.getChildren(),p=t();return p.setFormat(d.getFormatType()),p.setIndent(d.getIndent()),u.forEach(f=>p.append(f)),n&&(p=n.append(p)),void d.replace(p)}let i=null,l=[];for(let d=0;d<s;d++){let u=a[d];Ii(u)?(AC(e,l,l.length,t,n),l=[],i=u):i===null||i!==null&&oE(u,i)?l.push(u):(AC(e,l,l.length,t,n),l=[u])}AC(e,l,l.length,t,n)}function AC(e,t,n,o,r=null){if(t.length===0)return;let a=t[0],s=new Map,i=[],l=Xe(a)?a:a.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let d=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,d=!0;break}if(l=l.getParentOrThrow(),Ii(l))break}let u=new Set;for(let g=0;g<n;g++){let h=t[g];Xe(h)&&h.getChildrenSize()===0&&u.add(h.getKey())}let p=new Set;for(let g=0;g<n;g++){let h=t[g],v=h.getParent();if(v!==null&&v.isInline()&&(v=v.getParent()),v!==null&&sE(h)&&!p.has(h.getKey())){let C=v.getKey();if(s.get(C)===void 0){let y=o();y.setFormat(v.getFormatType()),y.setIndent(v.getIndent()),i.push(y),s.set(C,y),v.getChildren().forEach(b=>{y.append(b),p.add(b.getKey()),Xe(b)&&b.getChildrenKeys().forEach(w=>p.add(w))}),w4(v)}}else if(u.has(h.getKey())){Xe(h)||NC(179);let C=o();C.setFormat(h.getFormatType()),C.setIndent(h.getIndent()),i.push(C),h.remove(!0)}}if(r!==null)for(let g=0;g<i.length;g++){let h=i[g];r.append(h)}let f=null;if(Ii(l))if(d)if(r!==null)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h)}else{let g=l.getFirstChild();if(Xe(g)&&(l=g),g===null)if(r)l.append(r);else for(let h=0;h<i.length;h++){let v=i[h];l.append(v),f=v}else if(r!==null)g.insertBefore(r);else for(let h=0;h<i.length;h++){let v=i[h];g.insertBefore(v),f=v}}else if(r)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h),f=h}let m=Pu();Ee(m)&&pM(m.anchor)&&pM(m.focus)?or(m.clone()):f!==null?f.selectEnd():e.dirty=!0}function CM(e){let t=xM(e);return t!==null&&t.writingMode==="vertical-rl"}function xM(e){let t=e.anchor.getNode();return Xe(t)?_C(t):DC(t)}function P4(e,t){let n=CM(e)?!t:t;OC(e)&&(n=!n);let o=Jl(e.focus,n?"previous":"next");if(aE(o))return!1;for(let r of JR(o)){if(ku(r))return!r.origin.isInline();if(!Xe(r.origin)){if(_m(r.origin))return!0;break}}return!1}function bM(e,t,n,o){e.modify(t?"extend":"move",n,o)}function OC(e){let t=xM(e);return t!==null&&t.direction==="rtl"}function k4(e,t,n){let o=OC(e),r;r=CM(e)||o?!n:n,bM(e,t,r,"character")}function L4(e,t,n){let o=ag(e.getStyle());return o!==null&&o[t]||n}function R4(e,t,n=""){let o=null,r=e.getNodes(),a=e.anchor,s=e.focus,i=e.isBackward(),l=i?s.offset:a.offset,d=i?s.getNode():a.getNode();if(Ee(e)&&e.isCollapsed()&&e.style!==""){let u=ag(e.style);if(u!==null&&t in u)return u[t]}for(let u=0;u<r.length;u++){let p=r[u];if((u===0||l!==0||!p.is(d))&&pt(p)){let f=L4(p,t,n);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?n:o}var E4=gM;var en=FC,SM=en.$addNodeStyle,Whe=en.$cloneWithProperties,Ghe=en.$copyBlockFormatIndent,jhe=en.$ensureForwardRangeSelection,Qhe=en.$forEachSelectedTextNode,Yhe=en.$getComputedStyleForElement,Xhe=en.$getComputedStyleForParent,Jhe=en.$getSelectionStyleValueForProperty,Zhe=en.$isAtNodeEnd,eve=en.$isParentElementRTL,tve=en.$isParentRTL,nve=en.$moveCaretSelection,BC=en.$moveCharacter,ove=en.$patchStyleText,rve=en.$selectAll,ave=en.$setBlocksType,zC=en.$shouldOverrideDefaultCharacterSelection,sg=en.$sliceSelectedTextNodeContent,sve=en.$trimTextContentFromAnchor,ive=en.$wrapNodes,lve=en.createDOMRange,IM=en.createRectsFromDOMRange,dve=en.getCSSFromStyleObject,cve=en.getStyleObjectFromCSS,uve=en.trimTextContentFromAnchor;var $C={};cn($C,{$descendantsMatching:()=>fW,$dfs:()=>Q4,$dfsIterator:()=>NM,$filter:()=>iW,$findMatchingParent:()=>Sa,$firstToLastIterator:()=>mW,$getAdjacentCaret:()=>Y4,$getAdjacentSiblingOrParentSiblingCaret:()=>Si,$getDepth:()=>DM,$getNearestBlockElementAncestorOrThrow:()=>tW,$getNearestNodeOfType:()=>eW,$getNextRightPreorderNode:()=>Z4,$getNextSiblingOrParentSibling:()=>J4,$handleIndentAndOutdent:()=>lW,$insertFirst:()=>dW,$insertNodeToNearestRoot:()=>rW,$insertNodeToNearestRootAtCaret:()=>FM,$isEditorIsNestedEditor:()=>uW,$lastToFirstIterator:()=>KC,$restoreEditorState:()=>oW,$reverseDfs:()=>X4,$reverseDfsIterator:()=>OM,$splitNode:()=>gE,$unwrapAndFilterDescendants:()=>pW,$unwrapNode:()=>gW,$wrapNodeInElement:()=>aW,CAN_USE_BEFORE_INPUT:()=>H4,CAN_USE_DOM:()=>EM,IS_ANDROID:()=>U4,IS_ANDROID_CHROME:()=>K4,IS_APPLE:()=>$4,IS_APPLE_WEBKIT:()=>q4,IS_CHROME:()=>V4,IS_FIREFOX:()=>MM,IS_IOS:()=>W4,IS_SAFARI:()=>G4,addClassNamesToElement:()=>Au,calculateZoomLevel:()=>cW,isBlockDomNode:()=>tM,isHTMLAnchorElement:()=>rM,isHTMLElement:()=>Jm,isInlineDomNode:()=>Nu,isMimeType:()=>AM,makeStateWrapper:()=>hW,markSelection:()=>RM,mediaFileReader:()=>j4,mergeRegister:()=>Gr,objectKlassEquals:()=>sW,positionNodeOnRange:()=>LM,registerNestedElementResolver:()=>nW,removeClassNamesFromElement:()=>Zm,selectionAlwaysOnDisplay:()=>z4});function ig(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Pr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,M4=Pr&&"documentMode"in document?document.documentMode:null,PM=Pr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),A4=Pr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),N4=!(!Pr||!("InputEvent"in window)||M4)&&"getTargetRanges"in new window.InputEvent("input"),_4=Pr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),D4=Pr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,kM=Pr&&/Android/.test(navigator.userAgent),UC=Pr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O4=Pr&&kM&&UC,F4=Pr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&PM&&!UC;function jr(e){return`${e}px`}var B4={attributes:!0,characterData:!0,childList:!0,subtree:!0};function LM(e,t,n){let o=null,r=null,a=null,s=[],i=document.createElement("div");function l(){o===null&&ig(182),r===null&&ig(183);let{left:p,top:f}=r.getBoundingClientRect(),m=IM(e,t);var g,h;i.isConnected||(h=i,(g=r).insertBefore(h,g.firstChild));let v=!1;for(let C=0;C<m.length;C++){let y=m[C],b=s[C]||document.createElement("div"),w=b.style;w.position!=="absolute"&&(w.position="absolute",v=!0);let S=jr(y.left-p);w.left!==S&&(w.left=S,v=!0);let I=jr(y.top-f);w.top!==I&&(b.style.top=I,v=!0);let k=jr(y.width);w.width!==k&&(b.style.width=k,v=!0);let P=jr(y.height);w.height!==P&&(b.style.height=P,v=!0),b.parentNode!==i&&(i.append(b),v=!0),s[C]=b}for(;s.length>m.length;)s.pop();v&&n(s)}function d(){r=null,o=null,a!==null&&a.disconnect(),a=null,i.remove();for(let p of s)p.remove();s=[]}i.style.position="relative";let u=e.registerRootListener(function p(){let f=e.getRootElement();if(f===null)return d();let m=f.parentElement;if(!Jm(m))return d();d(),o=f,r=m,a=new MutationObserver(g=>{let h=e.getRootElement(),v=h&&h.parentElement;if(h!==o||v!==r)return p();for(let C of g)if(!i.contains(C.target))return l()}),a.observe(m,B4),l()});return()=>{u(),d()}}function wM(e,t,n){if(e.type!=="text"&&Xe(t)){let o=t.getDOMSlot(n);return[o.element,o.getFirstChildOffset()+e.offset]}return[ZE(n)||n,e.offset]}function RM(e,t){let n=null,o=null,r=null,a=null,s=null,i=null,l=()=>{};function d(u){u.read(()=>{let p=Oe();if(!Ee(p))return n=null,r=null,a=null,i=null,l(),void(l=()=>{});let[f,m]=(function(P){let T=P.getStartEndPoints();return P.isBackward()?[T[1],T[0]]:T})(p),g=f.getNode(),h=g.getKey(),v=f.offset,C=m.getNode(),y=C.getKey(),b=m.offset,w=e.getElementByKey(h),S=e.getElementByKey(y),I=n===null||w!==o||v!==r||h!==n.getKey(),k=a===null||S!==s||b!==i||y!==a.getKey();if((I||k)&&w!==null&&S!==null){let P=(function(T,L,E,A,R,F,H){let z=(T._window?T._window.document:document).createRange();return z.setStart(...wM(L,E,A)),z.setEnd(...wM(R,F,H)),z})(e,f,g,w,m,C,S);l(),l=LM(e,P,T=>{if(t===void 0)for(let L of T){let E=L.style;E.background!=="Highlight"&&(E.background="Highlight"),E.color!=="HighlightText"&&(E.color="HighlightText"),E.marginTop!==jr(-1.5)&&(E.marginTop=jr(-1.5)),E.paddingTop!==jr(4)&&(E.paddingTop=jr(4)),E.paddingBottom!==jr(0)&&(E.paddingBottom=jr(0))}else t(T)})}n=g,o=w,r=v,a=C,s=S,i=b})}return d(e.getEditorState()),Gr(e.registerUpdateListener(({editorState:u})=>d(u)),()=>{l()})}function z4(e,t){let n=null,o=()=>{let r=getSelection(),a=r&&r.anchorNode,s=e.getRootElement();a!==null&&s!==null&&s.contains(a)?n!==null&&(n(),n=null):n===null&&(n=RM(e,t))};return document.addEventListener("selectionchange",o),()=>{n!==null&&n(),document.removeEventListener("selectionchange",o)}}var H4=N4,EM=Pr,U4=kM,K4=O4,$4=PM,q4=F4,V4=UC,MM=A4,W4=D4,G4=_4;function AM(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function j4(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let a=[],s=()=>{let{done:i,value:l}=n.next();if(i)return o(a);let d=new FileReader;d.addEventListener("error",r),d.addEventListener("load",()=>{let u=d.result;typeof u=="string"&&a.push({file:l,result:u}),s()}),AM(l,t)?d.readAsDataURL(l):s()};s()})}function Q4(e,t){return Array.from(NM(e,t))}function Y4(e){return e?e.getAdjacentCaret():null}function X4(e,t){return Array.from(OM(e,t))}function NM(e,t){return _M("next",e,t)}function TM(e,t){let n=Si(Ia(e,t));return n&&n[0]}function _M(e,t,n){let o=yt(),r=t||o,a=Xe(r)?bs(r,e):Ia(r,e),s=DM(r),i=n?hC(yC(Ia(n,e)))||TM(n,e):TM(r,e),l=s;return kC({hasNext:d=>d!==null,initial:a,map:d=>({depth:l,node:d.origin}),step:d=>{if(d.isSameNodeCaret(i))return null;ku(d)&&l++;let u=Si(d);return!u||u[0].isSameNodeCaret(i)?null:(l+=u[1],u[0])}})}function J4(e){let t=Si(Ia(e,"next"));return t&&[t[0].origin,t[1]]}function DM(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function Z4(e){let t=yC(Ia(e,"previous")),n=Si(t,"root");return n&&n[0].origin}function OM(e,t){return _M("previous",e,t)}function eW(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function tW(e){let t=Sa(e,n=>Xe(n)&&!n.isInline());return Xe(t)||ig(4,e.__key),t}function nW(e,t,n,o){let r=a=>a instanceof t;return e.registerNodeTransform(t,a=>{let s=(i=>{let l=i.getChildren();for(let p=0;p<l.length;p++){let f=l[p];if(r(f))return null}let d=i,u=i;for(;d!==null;)if(u=d,d=d.getParent(),r(d))return{child:u,parent:d};return null})(a);if(s!==null){let{child:i,parent:l}=s;if(i.is(a)){o(l,a);let d=i.getNextSiblings(),u=d.length;if(l.insertAfter(i),u!==0){let p=n(l);i.insertAfter(p);for(let f=0;f<u;f++)p.append(d[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function oW(e,t){let n=new Map,o=e._pendingEditorState;for(let[a,s]of t._nodeMap)n.set(a,Mm(s));o&&(o._nodeMap=n),e._dirtyType=2;let r=t._selection;or(r===null?null:r.clone())}function rW(e){let t=Oe()||Pu(),n;if(Ee(t))n=Jl(t.focus,"next");else{if(t!=null){let s=t.getNodes(),i=s[s.length-1];i&&(n=Ia(i,"next"))}n=n||bs(yt(),"previous").getFlipped().insert(nr())}let o=FM(e,n),r=hC(o),a=ku(r)?dE(r):o;return fE(tE(a)),e.getLatest()}function FM(e,t,n){let o=vC(t,"next");for(let r=o;r;r=mE(r,n))o=r;return Dm(o)&&ig(283),o.insert(e.isInline()?nr().append(e):e),vC(Ia(e.getLatest(),"next"),t.direction)}function aW(e,t){let n=t();return e.replace(n),n.append(e),n}function sW(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function iW(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function lW(e){let t=Oe();if(!Ee(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let a=o[r],s=a.getKey();if(n.has(s))continue;let i=Sa(a,d=>Xe(d)&&!d.isInline());if(i===null)continue;let l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function dW(e,t){bs(e,"next").insert(t)}var HC=!(MM||!EM)&&void 0;function cW(e,t=!1){let n=1;if((function(){if(HC===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),HC=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return HC})()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function uW(e){return e._parentEditor!==null}function pW(e,t){return BM(e,t,null)}function BM(e,t,n){let o=!1;for(let r of KC(e))t(r)?n!==null&&n(r):(o=!0,Xe(r)&&BM(r,t,n||(a=>r.insertAfter(a))),r.remove());return o}function fW(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(Xe(r))for(let a of KC(r))o.push(a);return n}function mW(e){return zM(bs(e,"next"))}function KC(e){return zM(bs(e,"previous"))}function zM(e){return kC({hasNext:lE,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function gW(e){pE(Ia(e,"next")).splice(1,e.getChildren())}function hW(e){let t=o=>Nm(o,e),n=(o,r)=>Fm(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}var Ze=$C,hve=Ze.$descendantsMatching,vve=Ze.$dfs,yve=Ze.$dfsIterator,Cve=Ze.$filter,xve=Ze.$findMatchingParent,bve=Ze.$firstToLastIterator,Sve=Ze.$getAdjacentCaret,Ive=Ze.$getAdjacentSiblingOrParentSiblingCaret,wve=Ze.$getDepth,HM=Ze.$getNearestBlockElementAncestorOrThrow,Tve=Ze.$getNearestNodeOfType,Pve=Ze.$getNextRightPreorderNode,kve=Ze.$getNextSiblingOrParentSibling,UM=Ze.$handleIndentAndOutdent,Lve=Ze.$insertFirst,Rve=Ze.$insertNodeToNearestRoot,Eve=Ze.$insertNodeToNearestRootAtCaret,Mve=Ze.$isEditorIsNestedEditor,Ave=Ze.$lastToFirstIterator,Nve=Ze.$restoreEditorState,_ve=Ze.$reverseDfs,Dve=Ze.$reverseDfsIterator,Ove=Ze.$splitNode,Fve=Ze.$unwrapAndFilterDescendants,Bve=Ze.$unwrapNode,zve=Ze.$wrapNodeInElement,Hve=Ze.CAN_USE_BEFORE_INPUT,Uve=Ze.CAN_USE_DOM,Kve=Ze.IS_ANDROID,$ve=Ze.IS_ANDROID_CHROME,qve=Ze.IS_APPLE,Vve=Ze.IS_APPLE_WEBKIT,Wve=Ze.IS_CHROME,Gve=Ze.IS_FIREFOX,jve=Ze.IS_IOS,Qve=Ze.IS_SAFARI,Yve=Ze.addClassNamesToElement,Xve=Ze.calculateZoomLevel,qC=Ze.isBlockDomNode,Jve=Ze.isHTMLAnchorElement,KM=Ze.isHTMLElement,Zve=Ze.isInlineDomNode,eye=Ze.isMimeType,tye=Ze.makeStateWrapper,nye=Ze.markSelection,oye=Ze.mediaFileReader,wa=Ze.mergeRegister,_u=Ze.objectKlassEquals,rye=Ze.positionNodeOnRange,aye=Ze.registerNestedElementResolver,sye=Ze.removeClassNamesFromElement,iye=Ze.selectionAlwaysOnDisplay;var VC={};cn(VC,{ContentEditable:()=>yW,ContentEditableElement:()=>VM});W();var qM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function vW({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:a,ariaExpanded:s,ariaInvalid:i,ariaLabel:l,ariaLabelledBy:d,ariaMultiline:u,ariaOwns:p,ariaRequired:f,autoCapitalize:m,className:g,id:h,role:v="textbox",spellCheck:C=!0,style:y,tabIndex:b,"data-testid":w,...S},I){let[k,P]=G(e.isEditable()),T=M(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?e.setRootElement(E):e.setRootElement(null)},[e]),L=K(()=>(function(...E){return A=>{for(let R of E)typeof R=="function"?R(A):R!=null&&(R.current=A)}})(I,T),[T,I]);return qM(()=>(P(e.isEditable()),e.registerEditableListener(E=>{P(E)})),[e]),c("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?o:void 0,"aria-describedby":r,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":k&&v==="combobox"?!!s:void 0,...i!=null?{"aria-invalid":i}:{},"aria-label":l,"aria-labelledby":d,"aria-multiline":u,"aria-owns":k?p:void 0,"aria-readonly":!k||void 0,"aria-required":f,autoCapitalize:m,className:g,contentEditable:k,"data-testid":w,id:h,ref:L,role:v,spellCheck:C,style:y,tabIndex:b,...S})}var VM=Tn(vW);function $M(e){return e.getEditorState().read(ng(e.isComposing()))}var yW=Tn(CW);function CW(e,t){let{placeholder:n,...o}=e,[r]=jt();return x(ge,{children:[c(VM,{editor:r,...o,ref:t}),n!=null&&c(xW,{editor:r,content:n})]})}function xW({content:e,editor:t}){let n=(function(s){let[i,l]=G(()=>$M(s));return qM(()=>{function d(){let u=$M(s);l(u)}return d(),wa(s.registerUpdateListener(()=>{d()}),s.registerEditableListener(()=>{d()}))},[s]),i})(t),[o,r]=G(t.isEditable());if(ue(()=>(r(t.isEditable()),t.registerEditableListener(s=>{r(s)})),[t]),!n)return null;let a=null;return typeof e=="function"?a=e(o):e!==null&&(a=e),a===null?null:c("div",{"aria-hidden":!0,children:a})}var WM=VC,GM=WM.ContentEditable,mye=WM.ContentEditableElement;W();var bW=ut(null),WC={didCatch:!1,error:null},lg=class extends ra{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=WC}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){let{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(WC))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){let{didCatch:o}=this.state,{resetKeys:r}=this.props;o&&n.error!==null&&SW(t.resetKeys,r)&&(this.props.onReset?.({next:r,prev:t.resetKeys,reason:"keys"}),this.setState(WC))}render(){let{children:t,fallbackRender:n,FallbackComponent:o,fallback:r}=this.props,{didCatch:a,error:s}=this.state,i=t;if(a){let l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(l);else if(o)i=Fe(o,l);else if(r!==void 0)i=r;else throw s}return Fe(bW.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}};function SW(e=[],t=[]){return e.length!==t.length||e.some((n,o)=>!Object.is(n,t[o]))}var GC={};cn(GC,{LexicalErrorBoundary:()=>IW});function IW({children:e,onError:t}){return c(lg,{fallback:c("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var wW=GC,jM=wW.LexicalErrorBoundary;var lx={};cn(lx,{$createHorizontalRuleNode:()=>ix,$isDecoratorTextNode:()=>lA,$isHorizontalRuleNode:()=>mA,AutoFocusExtension:()=>kW,ClearEditorExtension:()=>LW,DecoratorTextExtension:()=>_W,DecoratorTextNode:()=>Fu,EditorStateExtension:()=>pg,HorizontalRuleExtension:()=>VW,HorizontalRuleNode:()=>Pi,INSERT_HORIZONTAL_RULE_COMMAND:()=>$W,InitialStateExtension:()=>pA,LexicalBuilder:()=>sd,NodeSelectionExtension:()=>ox,TabIndentationExtension:()=>WW,applyFormatFromStyle:()=>EW,applyFormatToDom:()=>MW,batch:()=>eA,buildEditorFromExtensions:()=>BW,computed:()=>oA,configExtension:()=>Ym,declarePeerDependency:()=>JE,defineExtension:()=>fn,effect:()=>Is,getExtensionDependencyFromEditor:()=>HW,getKnownTypesAndNodes:()=>RW,getPeerDependencyFromEditor:()=>fA,getPeerDependencyFromEditorOrThrow:()=>UW,namedSignals:()=>mg,registerClearEditor:()=>sA,registerTabIndentation:()=>hA,safeCast:()=>Tr,shallowMergeConfig:()=>eg,signal:()=>ad,untracked:()=>ZC,watchedSignal:()=>ax});var TW=Symbol.for("preact-signals");function fg(){if(Ss>1)return void Ss--;let e,t=!1;for(;Ou!==void 0;){let n=Ou;for(Ou=void 0,ex++;n!==void 0;){let o=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&tA(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(ex=0,Ss--,t)throw e}function eA(e){if(Ss>0)return e();Ss++;try{return e()}finally{fg()}}var Ot,Ou;function ZC(e){let t=Ot;Ot=void 0;try{return e()}finally{Ot=t}}var Ss=0,ex=0,ug=0;function QM(e){if(Ot===void 0)return;let t=e.n;return t===void 0||t.t!==Ot?(t={i:0,S:e,p:Ot.s,n:void 0,t:Ot,e:void 0,x:void 0,r:t},Ot.s!==void 0&&(Ot.s.n=t),Ot.s=t,e.n=t,32&Ot.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ot.s,t.n=void 0,Ot.s.n=t,Ot.s=t),t):void 0}function ro(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function ad(e,t){return new ro(e,t)}function tA(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function YM(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function nA(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function Ti(e,t){ro.call(this,void 0),this.x=e,this.s=void 0,this.g=ug-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function oA(e,t){return new Ti(e,t)}function rA(e){let t=e.u;if(e.u=void 0,typeof t=="function"){Ss++;let n=Ot;Ot=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,rx(e),o}finally{Ot=n,fg()}}}function rx(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,rA(e)}function PW(e){if(Ot!==this)throw new Error("Out-of-order effect");nA(this),Ot=e,this.f&=-2,8&this.f&&rx(this),fg()}function rd(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Is(e,t){let n=new rd(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function mg(e,t={}){let n={};for(let o in e){let r=t[o],a=ad(r===void 0?e[o]:r);n[o]=a}return n}ro.prototype.brand=TW,ro.prototype.h=function(){return!0},ro.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:ZC(()=>{var n;(n=this.W)==null||n.call(this)}))},ro.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&ZC(()=>{var o;(o=this.Z)==null||o.call(this)}))}},ro.prototype.subscribe=function(e){return Is(()=>{let t=this.value,n=Ot;Ot=void 0;try{e(t)}finally{Ot=n}},{name:"sub"})},ro.prototype.valueOf=function(){return this.value},ro.prototype.toString=function(){return this.value+""},ro.prototype.toJSON=function(){return this.value},ro.prototype.peek=function(){let e=Ot;Ot=void 0;try{return this.value}finally{Ot=e}},Object.defineProperty(ro.prototype,"value",{get(){let e=QM(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ex>100)throw new Error("Cycle detected");this.v=e,this.i++,ug++,Ss++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{fg()}}}}),Ti.prototype=new ro,Ti.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ug))return!0;if(this.g=ug,this.f|=1,this.i>0&&!tA(this))return this.f&=-2,!0;let e=Ot;try{YM(this),Ot=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ot=e,nA(this),this.f&=-2,!0},Ti.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}ro.prototype.S.call(this,e)},Ti.prototype.U=function(e){if(this.t!==void 0&&(ro.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ti.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ti.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let e=QM(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),rd.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},rd.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,rA(this),YM(this),Ss++;let e=Ot;return Ot=this,PW.bind(this,e)},rd.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ou,Ou=this)},rd.prototype.d=function(){this.f|=8,1&this.f||rx(this)},rd.prototype.dispose=function(){this.d()};var kW=fn({build:(e,t,n)=>mg(t),config:Tr({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return Is(()=>o.disabled.value?void 0:e.registerRootListener(r=>{e.focus(()=>{let a=document.activeElement;r===null||a!==null&&r.contains(a)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function aA(){let e=yt(),t=Oe(),n=nr();e.clear(),e.append(n),t!==null&&n.select(),Ee(t)&&(t.format=0)}function sA(e,t=aA){return e.registerCommand(Bm,n=>(e.update(t),!0),Yt)}var LW=fn({build:(e,t,n)=>mg(t),config:Tr({$onClear:aA}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return Is(()=>sA(e,o.value))}});function RW(e){let t=new Set,n=new Set;for(let o of iA(e)){let r=typeof o=="function"?o:o.replace;t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function iA(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var jC=XE("format",{parse:e=>typeof e=="number"?e:0}),Fu=class extends xo{$config(){return this.config("decorator-text",{extends:xo,stateConfigs:[{flat:!0,stateConfig:jC}]})}getFormat(){return Nm(this,jC)}getFormatFlags(t,n){return LC(this.getFormat(),t,n)}hasFormat(t){let n=GE[t];return(this.getFormat()&n)!==0}setFormat(t){return Fm(this,jC,t)}toggleFormat(t){let n=this.getFormat(),o=LC(n,t,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function lA(e){return e instanceof Fu}function EW(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),a=o==="700"||o==="bold",s=r.includes("line-through"),i=t.fontStyle==="italic",l=r.includes("underline"),d=t.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),i&&!e.hasFormat("italic")&&e.toggleFormat("italic"),l&&!e.hasFormat("underline")&&e.toggleFormat("underline"),d!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),d!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function MW(e,t,n=NW){for(let[o,r]of Object.entries(n))e.hasFormat(r)&&(t=AW(t,o));return t}function AW(e,t){let n=document.createElement(t);return n.appendChild(e),n}var NW={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},_W=fn({name:"@lexical/extension/DecoratorText",nodes:()=>[Fu],register:(e,t,n)=>e.registerCommand(LE,o=>{let r=Oe();if(CC(r)||Ee(r))for(let a of r.getNodes())lA(a)&&a.toggleFormat(o);return!1},nd)});function ax(e,t){let n;return ad(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var pg=fn({build:e=>ax(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function Ut(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function dA(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)n[r]=dA(n[r],o[r]);return e}return t}var sx=0,tx=1,cA=2,QC=3,dg=4,od=5,YC=6,Du=7;function XC(e){return e.id===sx}function uA(e){return e.id===cA}function DW(e){return(function(t){return t.id===tx})(e)||Ut(305,String(e.id),String(tx)),Object.assign(e,{id:cA})}var OW=new Set,nx=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:sx}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):eg;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;uA(n)||Ut(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},a=(function(i,l,d){return Object.assign(i,{config:l,id:QC,registerState:d})})(n,this.mergeConfigs(),o),s;this.state=a,this.extension.init&&(s=this.extension.init(t,a.config,o)),this.state=(function(i,l,d){return Object.assign(i,{id:dg,initResult:l,registerState:d})})(a,s,r)}build(t){let n=this.state,o;n.id!==dg&&Ut(307,String(n.id),String(od)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(a,s,i){return Object.assign(a,{id:od,output:s,registerState:i})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==od&&Ut(308,String(o.id),String(od));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(a){return Object.assign(a,{id:YC})})(o),()=>{let a=this.state;a.id!==Du&&Ut(309,String(o.id),String(Du)),this.state=(function(s){return Object.assign(s,{id:od})})(a),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==YC&&Ut(310,String(n.id),String(YC)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:Du})})(n),o}getSignal(){return this._signal===void 0&&Ut(311),this._signal}getInitResult(){this.extension.init===void 0&&Ut(312,this.extension.name);let t=this.state;return(function(n){return n.id>=dg})(t)||Ut(313,String(t.id),String(dg)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=QC})(t)||Ut(314,String(t.id),String(QC)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Ut(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Ut(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=Du})(t)||Ut(316,String(t.id),String(Du)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||OW}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=od})(t)||Ut(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},XM={tag:bo};function FW(){let e=yt();e.isEmpty()&&e.append(nr())}var pA=fn({config:Tr({setOptions:XM,updateOptions:XM}),init:({$initialEditorState:e=FW})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:a}=r;if(rE(a))e.setEditorState(a,n);else if(typeof a=="function")e.update(()=>{a(e)},t);else if(a&&(typeof a=="string"||typeof a=="object")){let s=e.parseEditorState(a);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[$E,Qm,FE,jE,HE]}),JM=Symbol.for("@lexical/extension/LexicalBuilder");function BW(...e){return sd.fromExtensions(e).buildEditor()}function ZM(){}function zW(e){throw e}function cg(e){return Array.isArray(e)?e:[e]}var JC="0.41.0+prod.esm",sd=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=JC,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[cg(pA)];for(let o of t)n.push(cg(o));return new e(n)}static maybeFromEditor(t){let n=t[JM];return n&&(n.PACKAGE_VERSION!==JC&&Ut(292,n.PACKAGE_VERSION,JC),n instanceof e||Ut(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Ut(294),n}constructEditor(){let{$initialEditorState:t,onError:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(Xm({...o,...n?{onError:a=>{n(a,r)}}:{}}),{[JM]:this});for(let a of this.sortedExtensionReps())a.build(r);return r}buildEditor(){let t=ZM;function n(){try{t()}finally{t=ZM}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Gr(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ut(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);r?r.set(n,o):this.outgoingConfigEdges.set(t,new Map([[n,o]]));let a=this.incomingEdges.get(n);a?a.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ut(296);let n=cg(t),[o]=n;typeof o.name!="string"&&Ut(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&Ut(298,o.name),!r){r=new nx(this,o),this.extensionNameMap.set(o.name,r);let a=this.conflicts.get(o.name);typeof a=="string"&&Ut(299,o.name,a);for(let s of o.conflictsWith||[])this.extensionNameMap.has(s)&&Ut(299,o.name,s),this.conflicts.set(s,o.name);for(let s of o.dependencies||[]){let i=cg(s);this.addEdge(o.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of o.peerDependencies||[])this.addEdge(o.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let a=o.state;if(uA(a))return;let s=o.extension.name;var i;XC(a)||Ut(300,s,r||"[unknown]"),XC(i=a)||Ut(304,String(i.id),String(sx)),a=Object.assign(i,{id:tx}),o.state=a;let l=this.outgoingConfigEdges.get(s);if(l)for(let d of l.keys()){let u=this.extensionNameMap.get(d);u&&n(u,s)}a=DW(a),o.state=a,t.push(o)};for(let o of this.extensionNameMap.values())XC(o.state)&&n(o);for(let o of t)for(let[r,a]of this.outgoingConfigEdges.get(o.extension.name)||[])if(a.length>0){let s=this.extensionNameMap.get(r);if(s)for(let i of a)s.configs.add(i)}for(let[o,...r]of this.roots)if(r.length>0){let a=this.extensionNameMap.get(o.name);a===void 0&&Ut(301,o.name);for(let s of r)a.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],a=o.signal;for(let s of n){let i=s.register(t,a);i&&r.push(i)}for(let s of n){let i=s.afterRegistration(t);i&&r.push(i)}return Gr(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,a={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:p}=u;if(p.onError!==void 0&&(t.onError=p.onError),p.disableEvents!==void 0&&(t.disableEvents=p.disableEvents),p.parentEditor!==void 0&&(t.parentEditor=p.parentEditor),p.editable!==void 0&&(t.editable=p.editable),p.namespace!==void 0&&(t.namespace=p.namespace),p.$initialEditorState!==void 0&&(t.$initialEditorState=p.$initialEditorState),p.nodes)for(let f of iA(p)){if(typeof f!="function"){let m=o.get(f.replace);m&&Ut(302,p.name,f.replace.name,m.extension.name),o.set(f.replace,u)}n.add(f)}if(p.html){if(p.html.export)for(let[f,m]of p.html.export.entries())r.set(f,m);p.html.import&&Object.assign(a,p.html.import)}p.theme&&dA(s,p.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);let l=Object.keys(a).length>0,d=r.size>0;(l||d)&&(t.html={},l&&(t.html.import=a),d&&(t.html.export=r));for(let u of i)u.init(t);return t.onError||(t.onError=zW),t}};function HW(e,t){let n=sd.fromEditor(e).getExtensionRep(t);return n===void 0&&Ut(303,t.name),n.getExtensionDependency()}function fA(e,t){let n=sd.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function UW(e,t){let n=fA(e,t);return n===void 0&&Ut(291,t),n}var KW=new Set,ox=fn({build(e,t,n){let o=n.getDependency(pg).output,r=ad({watchedNodeKeys:new Map}),a=ax(()=>{},()=>Is(()=>{let s=a.peek(),{watchedNodeKeys:i}=r.value,l,d=!1;o.value.read(()=>{if(Oe())for(let[u,p]of i.entries()){if(p.size===0){i.delete(u);continue}let f=Zl(u),m=f&&f.isSelected()||!1;d=d||m!==(!!s&&s.has(u)),m&&(l=l||new Set,l.add(u))}}),!d&&l&&s&&l.size===s.size||(a.value=l)}));return{watchNodeKey:function(s){let i=oA(()=>(a.value||KW).has(s)),{watchedNodeKeys:l}=r.peek(),d=l.get(s),u=d!==void 0;return d=d||new Set,d.add(i),u||(l.set(s,d),r.value={watchedNodeKeys:l}),i}}},dependencies:[pg],name:"@lexical/extension/NodeSelection"}),$W=YE("INSERT_HORIZONTAL_RULE_COMMAND"),Pi=class e extends xo{static getType(){return"horizontalrule"}static clone(t){return new e(t.__key)}static importJSON(t){return ix().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:qW,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let n=document.createElement("hr");return Au(n,t.theme.hr),n}getTextContent(){return`
|
|
3806
|
-
`}isInline(){return!1}updateDOM(){return!1}};function qW(){return{node:ix()}}function ix(){return jR(Pi)}function mA(e){return e instanceof Pi}var VW=fn({dependencies:[pg,ox],name:"@lexical/extension/HorizontalRule",nodes:()=>[Pi],register(e,t,n){let{watchNodeKey:o}=n.getDependency(ox).output,r=ad({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Gr(e.registerCommand(yE,s=>{if(oM(s.target)){let i=nE(s.target);if(mA(i))return(function(l,d=!1){let u=Oe(),p=l.isSelected(),f=l.getKey(),m;d&&CC(u)?m=u:(m=QR(),or(m)),p?m.delete(f):m.add(f)})(i,s.shiftKey),!0}return!1},nd),e.registerMutationListener(Pi,(s,i)=>{eA(()=>{let l=!1,{nodeSelections:d}=r.peek();for(let[u,p]of s.entries())if(p==="destroyed")d.delete(u),l=!0;else{let f=d.get(u),m=e.getElementByKey(u);f?f.domNode.value=m:(l=!0,d.set(u,{domNode:ad(m),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:d})})}),Is(()=>{let s=[];for(let{domNode:i,selectedSignal:l}of r.value.nodeSelections.values())s.push(Is(()=>{let d=i.value;d&&(l.value?Au(d,a):Zm(d,a))}));return Gr(...s)}))}});function gA(e){return e.canBeEmpty()}function hA(e,t,n=gA){return Gr(e.registerCommand(Gm,o=>{let r=Oe();if(!Ee(r))return!1;o.preventDefault();let a=(function(s){if(s.getNodes().filter(f=>ed(f)&&f.canIndent()).length>0)return!0;let i=s.anchor,l=s.focus,d=l.isBefore(i)?l:i,u=d.getNode(),p=HM(u);if(p.canIndent()){let f=p.getKey(),m=bi();if(m.anchor.set(f,0,"element"),m.focus.set(f,0,"element"),m=cE(m),m.anchor.is(d))return!0}return!1})(r)?o.shiftKey?BE:SC:ME;return e.dispatchCommand(a,void 0)},Yt),e.registerCommand(SC,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=Oe();if(!Ee(r))return!1;let a=typeof n=="function"?n:n.peek();return UM(s=>{if(a(s)){let i=s.getIndent()+1;(!o||i<o)&&s.setIndent(i)}})},zm))}var WW=fn({build:(e,t,n)=>mg(t),config:Tr({$canIndent:gA,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:a}=n.getOutput();return Is(()=>{if(!o.value)return hA(e,r,a)})}});var St=lx,wye=St.$createHorizontalRuleNode,Tye=St.$isDecoratorTextNode,Pye=St.$isHorizontalRuleNode,kye=St.AutoFocusExtension,Lye=St.ClearEditorExtension,Rye=St.DecoratorTextExtension,Eye=St.DecoratorTextNode,Mye=St.EditorStateExtension,Aye=St.HorizontalRuleExtension,Nye=St.HorizontalRuleNode,_ye=St.INSERT_HORIZONTAL_RULE_COMMAND,Dye=St.InitialStateExtension,vA=St.LexicalBuilder,Oye=St.NodeSelectionExtension,Fye=St.TabIndentationExtension,Bye=St.applyFormatFromStyle,zye=St.applyFormatToDom,yA=St.batch,Hye=St.buildEditorFromExtensions,Uye=St.computed,Kye=St.configExtension,$ye=St.declarePeerDependency,qye=St.defineExtension,Bu=St.effect,Vye=St.getExtensionDependencyFromEditor,Wye=St.getKnownTypesAndNodes,CA=St.getPeerDependencyFromEditor,Gye=St.getPeerDependencyFromEditorOrThrow,gg=St.namedSignals,jye=St.registerClearEditor,Qye=St.registerTabIndentation,Yye=St.safeCast,Xye=St.shallowMergeConfig,Jye=St.signal,Zye=St.untracked,eCe=St.watchedSignal;var dx={};cn(dx,{HistoryExtension:()=>hg,SharedHistoryExtension:()=>QW,createEmptyHistoryState:()=>SA,registerHistory:()=>bA});function GW(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let a=t._selection,s=e._selection;if(r)return 1;if(!(Ee(a)&&Ee(s)&&s.isCollapsed()&&a.isCollapsed()))return 0;let i=(function(C,y,b){let w=C._nodeMap,S=[];for(let I of y){let k=w.get(I);k!==void 0&&S.push(k)}for(let[I,k]of b){if(!k)continue;let P=w.get(I);P===void 0||Lu(P)||S.push(P)}return S})(t,n,o);if(i.length===0)return 0;if(i.length>1){let C=t._nodeMap,y=C.get(a.anchor.key),b=C.get(s.anchor.key);return y&&b&&!e._nodeMap.has(y.__key)&&pt(y)&&y.__text.length===1&&a.anchor.offset===1?2:0}let l=i[0],d=e._nodeMap.get(l.__key);if(!pt(d)||!pt(l)||d.__mode!==l.__mode)return 0;let u=d.__text,p=l.__text;if(u===p)return 0;let f=a.anchor,m=s.anchor;if(f.key!==m.key||f.type!=="text")return 0;let g=f.offset,h=m.offset,v=p.length-u.length;return v===1&&h===g-1?2:v===-1&&h===g+1?3:v===-1&&h===g?4:0}function jW(e,t){let n=Date.now(),o=0,r=Date.now(),a=0,s=null;return(i,l,d,u,p,f)=>{let m=Date.now();if(f.has(xE)&&(r=n,a=o,s=i),f.has(Km))return o=0,n=m,2;f.has(CE)&&s&&(n=r,o=a,i=s);let g=GW(i,l,u,p,e.isComposing()),h=(()=>{let v=d===null||d.editor===e,C=f.has(RE);if(!C&&v&&f.has(bo))return 0;if(g===1)return 2;if(i===null)return 1;let y=l._selection;if(!(u.size>0||p.size>0))return y!==null?0:2;let b=typeof t=="number"?t:t.peek();return C===!1&&g!==0&&g===o&&m<n+b&&v||u.size===1&&(function(w,S,I){let k=S._nodeMap.get(w),P=I._nodeMap.get(w),T=S._selection,L=I._selection;return!(Ee(T)&&Ee(L)&&T.anchor.type==="element"&&T.focus.type==="element"&&L.anchor.type==="text"&&L.focus.type==="text"||!pt(k)||!pt(P)||k.__parent!==P.__parent)&&JSON.stringify(S.read(()=>k.exportJSON()))===JSON.stringify(I.read(()=>P.exportJSON()))})(Array.from(u)[0],i,l)?0:1})();return n=m,o=g,h}}function xA(e){e.undoStack=[],e.redoStack=[],e.current=null}function bA(e,t,n){let o=jW(e,n);return wa(e.registerCommand(QE,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(l.length!==0){let d=s.current,u=l.pop();d!==null&&(i.push(d),a.dispatchCommand(Ru,!0)),l.length===0&&a.dispatchCommand(Eu,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Km})}})(e,t),!0),Yt),e.registerCommand(UE,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(i.length!==0){let d=s.current;d!==null&&(l.push(d),a.dispatchCommand(Eu,!0));let u=i.pop();i.length===0&&a.dispatchCommand(Ru,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Km})}})(e,t),!0),Yt),e.registerCommand(Bm,()=>(xA(t),!1),Yt),e.registerCommand(vE,()=>(xA(t),e.dispatchCommand(Ru,!1),e.dispatchCommand(Eu,!1),!0),Yt),e.registerUpdateListener(({editorState:a,prevEditorState:s,dirtyLeaves:i,dirtyElements:l,tags:d})=>{let u=t.current,p=t.redoStack,f=t.undoStack,m=u===null?null:u.editorState;if(u!==null&&a===m)return;let g=o(s,a,u,i,l,d);if(g===1)p.length!==0&&(t.redoStack=[],e.dispatchCommand(Ru,!1)),u!==null&&(f.push({...u}),e.dispatchCommand(Eu,!0));else if(g===2)return;t.current={editor:e,editorState:a}}))}function SA(){return{current:null,redoStack:[],undoStack:[]}}var hg=fn({build:(e,{delay:t,createInitialHistoryState:n,disabled:o})=>gg({delay:t,disabled:o,historyState:n(e)}),config:Tr({createInitialHistoryState:SA,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(e,t,n)=>{let o=n.getOutput();return Bu(()=>o.disabled.value?void 0:bA(e,o.historyState.value,o.delay))}}),QW=fn({dependencies:[Ym(hg,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(e,t,n){let{output:o}=n.getDependency(hg),r=(function(s){return s?CA(s,hg.name):null})(e._parentEditor);if(!r)return()=>{};let a=r.output;return Bu(()=>yA(()=>{o.delay.value=a.delay.value,o.historyState.value=a.historyState.value,o.disabled.value=a.disabled.value}))}});var vg=dx,aCe=vg.HistoryExtension,sCe=vg.SharedHistoryExtension,yg=vg.createEmptyHistoryState,IA=vg.registerHistory;var cx={};cn(cx,{HistoryPlugin:()=>YW,createEmptyHistoryState:()=>yg});W();function YW({delay:e,externalHistoryState:t}){let[n]=jt();return(function(o,r,a=1e3){let s=K(()=>r||yg(),[r]);$(()=>IA(o,s,a),[a,o,s])})(n,t,e),null}var wA=cx,TA=wA.HistoryPlugin,PA=wA.createEmptyHistoryState;var ux={};cn(ux,{OnChangePlugin:()=>JW});W();var XW=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function JW({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=jt();return XW(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:a,dirtyLeaves:s,prevEditorState:i,tags:l})=>{t&&a.size===0&&s.size===0||e&&l.has(bo)||i.isEmpty()||n(r,o,l)})},[o,e,t,n]),null}var ZW=ux,kA=ZW.OnChangePlugin;var px={};cn(px,{useLexicalEditable:()=>nG});W();var eG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function tG(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function nG(){return(function(e){let[t]=jt(),n=K(()=>e(t),[t,e]),[o,r]=G(()=>n.initialValueFn()),a=N(o);return eG(()=>{let{initialValueFn:s,subscribe:i}=n,l=s();return a.current!==l&&(a.current=l,r(l)),i(d=>{a.current=d,r(d)})},[n,e]),o})(tG)}var oG=px,LA=oG.useLexicalEditable;var fx={};cn(fx,{ReactProviderExtension:()=>rG});var rG=fn({name:"@lexical/react/ReactProvider"});var aG=fx,RA=aG.ReactProviderExtension;var mx={};cn(mx,{DragonExtension:()=>sG,registerDragonSupport:()=>EA});function EA(e){let t=window.location.origin,n=o=>{if(o.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let a=o.data;if(typeof a=="string"){let s;try{s=JSON.parse(a)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let l=i.args;if(l){let[d,u,p,f,m]=l;e.update(()=>{let g=Oe();if(Ee(g)){let h=g.anchor,v=h.getNode(),C=0,y=0;if(pt(v)&&d>=0&&u>=0&&(C=d,y=d+u,g.setTextNodeRange(v,C,v,y)),C===y&&p===""||(g.insertRawText(p),v=h.getNode()),pt(v)){C=f,y=f+m;let b=v.getTextContentSize();C=C>b?b:C,y=y>b?b:y,g.setTextNodeRange(v,C,v,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}var sG=fn({build:(e,t,n)=>gg(t),config:Tr({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>Bu(()=>n.getOutput().disabled.value?void 0:EA(e))});var MA=mx,AA=MA.DragonExtension,NA=MA.registerDragonSupport;var gx={};cn(gx,{$generateHtmlFromNodes:()=>lG,$generateNodesFromDOM:()=>iG});function iG(e,t){let n=nM(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let a of n)if(!DA.has(a.nodeName)){let s=OA(a,e,r,!1);s!==null&&(o=o.concat(s))}return(function(a){for(let s of a)s.getNextSibling()instanceof bC&&s.insertAfter(xi());for(let s of a){let i=s.getChildren();for(let l of i)s.insertBefore(l);s.remove()}})(r),o}function lG(e,t){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.");let n=document.createElement("div"),o=yt().getChildren();for(let r=0;r<o.length;r++)_A(e,o[r],n,t);return n.innerHTML}function _A(e,t,n,o=null){let r=o===null||t.isSelected(o),a=Xe(t)&&t.excludeFromCopy("html"),s=t;o!==null&&pt(t)&&(s=sg(o,t,"clone"));let i=Xe(s)?s.getChildren():[],l=eM(e,s.getType()),d;d=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);let{element:u,after:p}=d;if(!u)return!1;let f=document.createDocumentFragment();for(let m=0;m<i.length;m++){let g=i[m],h=_A(e,g,f,o);!r&&Xe(t)&&h&&t.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!a){if((KM(u)||PC(u))&&u.append(f),n.append(u),p){let m=p.call(s,u);m&&(PC(u)?u.replaceChildren(m):u.replaceWith(m))}}else n.append(f);return r}var DA=new Set(["STYLE","SCRIPT"]);function OA(e,t,n,o,r=new Map,a){let s=[];if(DA.has(e.nodeName))return s;let i=null,l=(function(g,h){let{nodeName:v}=g,C=h._htmlConversions.get(v.toLowerCase()),y=null;if(C!==void 0)for(let b of C){let w=b(g);w!==null&&(y===null||(y.priority||0)<=(w.priority||0))&&(y=w)}return y!==null?y.conversion:null})(e,t),d=l?l(e):null,u=null;if(d!==null){u=d.after;let g=d.node;if(i=Array.isArray(g)?g[g.length-1]:g,i!==null){for(let[,h]of r)if(i=h(i,a),!i)break;i&&s.push(...Array.isArray(g)?g:[i])}d.forChild!=null&&r.set(e.nodeName,d.forChild)}let p=e.childNodes,f=[],m=(i==null||!Ii(i))&&(i!=null&&ed(i)||o);for(let g=0;g<p.length;g++)f.push(...OA(p[g],t,n,m,new Map(r),i));return u!=null&&(f=u(f)),qC(e)&&(f=dG(e,f,m?()=>{let g=new bC;return n.push(g),g}:nr)),i==null?f.length>0?s=s.concat(f):qC(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Nu(g.nextSibling)&&Nu(g.previousSibling)})(e)&&(s=s.concat(xi())):Xe(i)&&i.append(...f),s}function dG(e,t,n){let o=e.style.textAlign,r=[],a=[];for(let s=0;s<t.length;s++){let i=t[s];if(ed(i))o&&!i.getFormat()&&i.setFormat(o),r.push(i);else if(a.push(i),s===t.length-1||s<t.length-1&&ed(t[s+1])){let l=n();l.setFormat(o),l.append(...a),r.push(l),a=[]}}return r}var FA=gx,BA=FA.$generateHtmlFromNodes,zA=FA.$generateNodesFromDOM;var vx={};cn(vx,{$generateJSONFromSelectedNodes:()=>qA,$generateNodesFromSerializedNodes:()=>VA,$getClipboardDataFromSelection:()=>GA,$getHtmlContent:()=>UA,$getLexicalContent:()=>KA,$insertDataTransferForPlainText:()=>cG,$insertDataTransferForRichText:()=>uG,$insertGeneratedNodes:()=>hx,copyToClipboard:()=>pG,setLexicalClipboardDataTransfer:()=>jA});function Cg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function UA(e,t=Oe()){return t==null&&Cg(166),Ee(t)&&t.isCollapsed()||t.getNodes().length===0?"":BA(e,t)}function KA(e,t=Oe()){return t==null&&Cg(166),Ee(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(qA(e,t))}function cG(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function uG(e,t,n){let o=e.getData("application/x-lexical-editor");if(o)try{let i=JSON.parse(o);if(i.namespace===n._config.namespace&&Array.isArray(i.nodes))return hx(n,VA(i.nodes),t)}catch(i){console.error(i)}let r=e.getData("text/html"),a=e.getData("text/plain");if(r&&a!==r)try{let i=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:d=>d}).createHTML(l):l})(r),"text/html");return hx(n,zA(n,i),t)}catch(i){console.error(i)}let s=a||e.getData("text/uri-list");if(s!=null)if(Ee(t)){let i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){let d=Oe();if(Ee(d)){let u=i[l];u===`
|
|
3805
|
+
`);let l=i.length;if(!pt(o)||r>=l){let d=o.getParent();o.remove(),d==null||d.getChildrenSize()!==0||Lu(d)||d.remove(),r-=l+s,o=a}else{let d=o.getKey(),u=e.getEditorState().read(()=>{let m=Zl(d);return pt(m)&&m.isSimpleText()?m.getTextContent():null}),p=l-r,f=i.slice(0,p);if(u!==null&&u!==i){let m=Pu(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let h=wr(u);o.replace(h),g=h}if(Ee(m)&&m.isCollapsed()){let h=m.anchor.offset;g.select(h,h)}}else if(o.isSimpleText()){let m=t.key===d,g=t.offset;g<r&&(g=l);let h=m?g-r:0,v=m?g:p;if(m&&h===0){let[C]=o.splitText(h,v);C.remove()}else{let[,C]=o.splitText(h,v);C.remove()}}else{let m=wr(f);o.replace(m)}r=0}}}function b4(e){let t=e.getStyle(),n=fM(t);rg.set(t,n)}function og(e,t){(Ee(e)?e.isCollapsed():pt(e)||Xe(e))||NC(280);let n=ag(Ee(e)?e.style:pt(e)?e.getStyle():e.getTextStyle()),o=Object.entries(t).reduce((a,[s,i])=>(typeof i=="function"?a[s]=i(n[s],e):i===null?delete a[s]:a[s]=i,a),{...n}),r=mM(o);Ee(e)||pt(e)?e.setStyle(r):e.setTextStyle(r),rg.set(r,o)}function S4(e,t){if(Ee(e)&&e.isCollapsed()){og(e,t);let o=e.anchor.getNode();Xe(o)&&o.isEmpty()&&og(o,t)}hM(o=>{og(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!Xe(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let a=r.getKey();o.has(a)||(o.add(a),og(r,t))}}}function hM(e){let t=Oe();if(!t)return;let n=new Map,o=a=>n.get(a.getKey())||[0,a.getTextContentSize()];if(Ee(t))for(let a of WR(t).getTextSlices())a&&n.set(a.caret.origin.getKey(),a.getSliceIndices());let r=t.getNodes();for(let a of r){if(!pt(a)||!a.canHaveFormat())continue;let[s,i]=o(a);i!==s&&(xC(a)||s===0&&i===a.getTextContentSize()?e(a):e(a.splitText(s,i)[s===0?0:1]))}Ee(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&vM(t)}function vM(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:a}=t;t.set(n.key,n.offset,n.type),n.set(o,r,a)}}function yM(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function I4(e,t,n=yM){if(e===null)return;let o=e.getStartEndPoints(),r=new Map,a=null;if(o){let[s,i]=o;a=bi(),a.anchor.set(s.key,s.offset,s.type),a.focus.set(i.key,i.offset,i.type);let l=Sa(s.getNode(),Mu),d=Sa(i.getNode(),Mu);Xe(l)&&r.set(l.getKey(),l),Xe(d)&&r.set(d.getKey(),d)}for(let s of e.getNodes())if(Xe(s)&&Mu(s))r.set(s.getKey(),s);else if(o===null){let i=Sa(s,Mu);Xe(i)&&r.set(i.getKey(),i)}for(let[s,i]of r){let l=t();n(i,l),i.replace(l,!0),a&&(s===a.anchor.key&&a.anchor.set(l.getKey(),a.anchor.offset,a.anchor.type),s===a.focus.key&&a.focus.set(l.getKey(),a.focus.offset,a.focus.type))}a&&e.is(Oe())&&or(a)}function pM(e){return e.getNode().isAttached()}function w4(e){let t=e;for(;t!==null&&!Ii(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function T4(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,a=e.getNodes(),s=a.length;if(r!==null&&(s===0||s===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let d=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=d.getChildren(),p=t();return p.setFormat(d.getFormatType()),p.setIndent(d.getIndent()),u.forEach(f=>p.append(f)),n&&(p=n.append(p)),void d.replace(p)}let i=null,l=[];for(let d=0;d<s;d++){let u=a[d];Ii(u)?(AC(e,l,l.length,t,n),l=[],i=u):i===null||i!==null&&oE(u,i)?l.push(u):(AC(e,l,l.length,t,n),l=[u])}AC(e,l,l.length,t,n)}function AC(e,t,n,o,r=null){if(t.length===0)return;let a=t[0],s=new Map,i=[],l=Xe(a)?a:a.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let d=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,d=!0;break}if(l=l.getParentOrThrow(),Ii(l))break}let u=new Set;for(let g=0;g<n;g++){let h=t[g];Xe(h)&&h.getChildrenSize()===0&&u.add(h.getKey())}let p=new Set;for(let g=0;g<n;g++){let h=t[g],v=h.getParent();if(v!==null&&v.isInline()&&(v=v.getParent()),v!==null&&sE(h)&&!p.has(h.getKey())){let C=v.getKey();if(s.get(C)===void 0){let y=o();y.setFormat(v.getFormatType()),y.setIndent(v.getIndent()),i.push(y),s.set(C,y),v.getChildren().forEach(b=>{y.append(b),p.add(b.getKey()),Xe(b)&&b.getChildrenKeys().forEach(w=>p.add(w))}),w4(v)}}else if(u.has(h.getKey())){Xe(h)||NC(179);let C=o();C.setFormat(h.getFormatType()),C.setIndent(h.getIndent()),i.push(C),h.remove(!0)}}if(r!==null)for(let g=0;g<i.length;g++){let h=i[g];r.append(h)}let f=null;if(Ii(l))if(d)if(r!==null)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h)}else{let g=l.getFirstChild();if(Xe(g)&&(l=g),g===null)if(r)l.append(r);else for(let h=0;h<i.length;h++){let v=i[h];l.append(v),f=v}else if(r!==null)g.insertBefore(r);else for(let h=0;h<i.length;h++){let v=i[h];g.insertBefore(v),f=v}}else if(r)l.insertAfter(r);else for(let g=i.length-1;g>=0;g--){let h=i[g];l.insertAfter(h),f=h}let m=Pu();Ee(m)&&pM(m.anchor)&&pM(m.focus)?or(m.clone()):f!==null?f.selectEnd():e.dirty=!0}function CM(e){let t=xM(e);return t!==null&&t.writingMode==="vertical-rl"}function xM(e){let t=e.anchor.getNode();return Xe(t)?_C(t):DC(t)}function P4(e,t){let n=CM(e)?!t:t;OC(e)&&(n=!n);let o=Jl(e.focus,n?"previous":"next");if(aE(o))return!1;for(let r of JR(o)){if(ku(r))return!r.origin.isInline();if(!Xe(r.origin)){if(_m(r.origin))return!0;break}}return!1}function bM(e,t,n,o){e.modify(t?"extend":"move",n,o)}function OC(e){let t=xM(e);return t!==null&&t.direction==="rtl"}function k4(e,t,n){let o=OC(e),r;r=CM(e)||o?!n:n,bM(e,t,r,"character")}function L4(e,t,n){let o=ag(e.getStyle());return o!==null&&o[t]||n}function R4(e,t,n=""){let o=null,r=e.getNodes(),a=e.anchor,s=e.focus,i=e.isBackward(),l=i?s.offset:a.offset,d=i?s.getNode():a.getNode();if(Ee(e)&&e.isCollapsed()&&e.style!==""){let u=ag(e.style);if(u!==null&&t in u)return u[t]}for(let u=0;u<r.length;u++){let p=r[u];if((u===0||l!==0||!p.is(d))&&pt(p)){let f=L4(p,t,n);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?n:o}var E4=gM;var en=FC,SM=en.$addNodeStyle,Yhe=en.$cloneWithProperties,Xhe=en.$copyBlockFormatIndent,Jhe=en.$ensureForwardRangeSelection,Zhe=en.$forEachSelectedTextNode,eve=en.$getComputedStyleForElement,tve=en.$getComputedStyleForParent,nve=en.$getSelectionStyleValueForProperty,ove=en.$isAtNodeEnd,rve=en.$isParentElementRTL,ave=en.$isParentRTL,sve=en.$moveCaretSelection,BC=en.$moveCharacter,ive=en.$patchStyleText,lve=en.$selectAll,dve=en.$setBlocksType,zC=en.$shouldOverrideDefaultCharacterSelection,sg=en.$sliceSelectedTextNodeContent,cve=en.$trimTextContentFromAnchor,uve=en.$wrapNodes,pve=en.createDOMRange,IM=en.createRectsFromDOMRange,fve=en.getCSSFromStyleObject,mve=en.getStyleObjectFromCSS,gve=en.trimTextContentFromAnchor;var $C={};cn($C,{$descendantsMatching:()=>fW,$dfs:()=>Q4,$dfsIterator:()=>NM,$filter:()=>iW,$findMatchingParent:()=>Sa,$firstToLastIterator:()=>mW,$getAdjacentCaret:()=>Y4,$getAdjacentSiblingOrParentSiblingCaret:()=>Si,$getDepth:()=>DM,$getNearestBlockElementAncestorOrThrow:()=>tW,$getNearestNodeOfType:()=>eW,$getNextRightPreorderNode:()=>Z4,$getNextSiblingOrParentSibling:()=>J4,$handleIndentAndOutdent:()=>lW,$insertFirst:()=>dW,$insertNodeToNearestRoot:()=>rW,$insertNodeToNearestRootAtCaret:()=>FM,$isEditorIsNestedEditor:()=>uW,$lastToFirstIterator:()=>KC,$restoreEditorState:()=>oW,$reverseDfs:()=>X4,$reverseDfsIterator:()=>OM,$splitNode:()=>gE,$unwrapAndFilterDescendants:()=>pW,$unwrapNode:()=>gW,$wrapNodeInElement:()=>aW,CAN_USE_BEFORE_INPUT:()=>H4,CAN_USE_DOM:()=>EM,IS_ANDROID:()=>U4,IS_ANDROID_CHROME:()=>K4,IS_APPLE:()=>$4,IS_APPLE_WEBKIT:()=>q4,IS_CHROME:()=>V4,IS_FIREFOX:()=>MM,IS_IOS:()=>W4,IS_SAFARI:()=>G4,addClassNamesToElement:()=>Au,calculateZoomLevel:()=>cW,isBlockDomNode:()=>tM,isHTMLAnchorElement:()=>rM,isHTMLElement:()=>Jm,isInlineDomNode:()=>Nu,isMimeType:()=>AM,makeStateWrapper:()=>hW,markSelection:()=>RM,mediaFileReader:()=>j4,mergeRegister:()=>Gr,objectKlassEquals:()=>sW,positionNodeOnRange:()=>LM,registerNestedElementResolver:()=>nW,removeClassNamesFromElement:()=>Zm,selectionAlwaysOnDisplay:()=>z4});function ig(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Pr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,M4=Pr&&"documentMode"in document?document.documentMode:null,PM=Pr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),A4=Pr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),N4=!(!Pr||!("InputEvent"in window)||M4)&&"getTargetRanges"in new window.InputEvent("input"),_4=Pr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),D4=Pr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,kM=Pr&&/Android/.test(navigator.userAgent),UC=Pr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O4=Pr&&kM&&UC,F4=Pr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&PM&&!UC;function jr(e){return`${e}px`}var B4={attributes:!0,characterData:!0,childList:!0,subtree:!0};function LM(e,t,n){let o=null,r=null,a=null,s=[],i=document.createElement("div");function l(){o===null&&ig(182),r===null&&ig(183);let{left:p,top:f}=r.getBoundingClientRect(),m=IM(e,t);var g,h;i.isConnected||(h=i,(g=r).insertBefore(h,g.firstChild));let v=!1;for(let C=0;C<m.length;C++){let y=m[C],b=s[C]||document.createElement("div"),w=b.style;w.position!=="absolute"&&(w.position="absolute",v=!0);let S=jr(y.left-p);w.left!==S&&(w.left=S,v=!0);let I=jr(y.top-f);w.top!==I&&(b.style.top=I,v=!0);let k=jr(y.width);w.width!==k&&(b.style.width=k,v=!0);let P=jr(y.height);w.height!==P&&(b.style.height=P,v=!0),b.parentNode!==i&&(i.append(b),v=!0),s[C]=b}for(;s.length>m.length;)s.pop();v&&n(s)}function d(){r=null,o=null,a!==null&&a.disconnect(),a=null,i.remove();for(let p of s)p.remove();s=[]}i.style.position="relative";let u=e.registerRootListener(function p(){let f=e.getRootElement();if(f===null)return d();let m=f.parentElement;if(!Jm(m))return d();d(),o=f,r=m,a=new MutationObserver(g=>{let h=e.getRootElement(),v=h&&h.parentElement;if(h!==o||v!==r)return p();for(let C of g)if(!i.contains(C.target))return l()}),a.observe(m,B4),l()});return()=>{u(),d()}}function wM(e,t,n){if(e.type!=="text"&&Xe(t)){let o=t.getDOMSlot(n);return[o.element,o.getFirstChildOffset()+e.offset]}return[ZE(n)||n,e.offset]}function RM(e,t){let n=null,o=null,r=null,a=null,s=null,i=null,l=()=>{};function d(u){u.read(()=>{let p=Oe();if(!Ee(p))return n=null,r=null,a=null,i=null,l(),void(l=()=>{});let[f,m]=(function(P){let T=P.getStartEndPoints();return P.isBackward()?[T[1],T[0]]:T})(p),g=f.getNode(),h=g.getKey(),v=f.offset,C=m.getNode(),y=C.getKey(),b=m.offset,w=e.getElementByKey(h),S=e.getElementByKey(y),I=n===null||w!==o||v!==r||h!==n.getKey(),k=a===null||S!==s||b!==i||y!==a.getKey();if((I||k)&&w!==null&&S!==null){let P=(function(T,L,E,A,R,F,H){let z=(T._window?T._window.document:document).createRange();return z.setStart(...wM(L,E,A)),z.setEnd(...wM(R,F,H)),z})(e,f,g,w,m,C,S);l(),l=LM(e,P,T=>{if(t===void 0)for(let L of T){let E=L.style;E.background!=="Highlight"&&(E.background="Highlight"),E.color!=="HighlightText"&&(E.color="HighlightText"),E.marginTop!==jr(-1.5)&&(E.marginTop=jr(-1.5)),E.paddingTop!==jr(4)&&(E.paddingTop=jr(4)),E.paddingBottom!==jr(0)&&(E.paddingBottom=jr(0))}else t(T)})}n=g,o=w,r=v,a=C,s=S,i=b})}return d(e.getEditorState()),Gr(e.registerUpdateListener(({editorState:u})=>d(u)),()=>{l()})}function z4(e,t){let n=null,o=()=>{let r=getSelection(),a=r&&r.anchorNode,s=e.getRootElement();a!==null&&s!==null&&s.contains(a)?n!==null&&(n(),n=null):n===null&&(n=RM(e,t))};return document.addEventListener("selectionchange",o),()=>{n!==null&&n(),document.removeEventListener("selectionchange",o)}}var H4=N4,EM=Pr,U4=kM,K4=O4,$4=PM,q4=F4,V4=UC,MM=A4,W4=D4,G4=_4;function AM(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function j4(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let a=[],s=()=>{let{done:i,value:l}=n.next();if(i)return o(a);let d=new FileReader;d.addEventListener("error",r),d.addEventListener("load",()=>{let u=d.result;typeof u=="string"&&a.push({file:l,result:u}),s()}),AM(l,t)?d.readAsDataURL(l):s()};s()})}function Q4(e,t){return Array.from(NM(e,t))}function Y4(e){return e?e.getAdjacentCaret():null}function X4(e,t){return Array.from(OM(e,t))}function NM(e,t){return _M("next",e,t)}function TM(e,t){let n=Si(Ia(e,t));return n&&n[0]}function _M(e,t,n){let o=yt(),r=t||o,a=Xe(r)?bs(r,e):Ia(r,e),s=DM(r),i=n?hC(yC(Ia(n,e)))||TM(n,e):TM(r,e),l=s;return kC({hasNext:d=>d!==null,initial:a,map:d=>({depth:l,node:d.origin}),step:d=>{if(d.isSameNodeCaret(i))return null;ku(d)&&l++;let u=Si(d);return!u||u[0].isSameNodeCaret(i)?null:(l+=u[1],u[0])}})}function J4(e){let t=Si(Ia(e,"next"));return t&&[t[0].origin,t[1]]}function DM(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function Z4(e){let t=yC(Ia(e,"previous")),n=Si(t,"root");return n&&n[0].origin}function OM(e,t){return _M("previous",e,t)}function eW(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function tW(e){let t=Sa(e,n=>Xe(n)&&!n.isInline());return Xe(t)||ig(4,e.__key),t}function nW(e,t,n,o){let r=a=>a instanceof t;return e.registerNodeTransform(t,a=>{let s=(i=>{let l=i.getChildren();for(let p=0;p<l.length;p++){let f=l[p];if(r(f))return null}let d=i,u=i;for(;d!==null;)if(u=d,d=d.getParent(),r(d))return{child:u,parent:d};return null})(a);if(s!==null){let{child:i,parent:l}=s;if(i.is(a)){o(l,a);let d=i.getNextSiblings(),u=d.length;if(l.insertAfter(i),u!==0){let p=n(l);i.insertAfter(p);for(let f=0;f<u;f++)p.append(d[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function oW(e,t){let n=new Map,o=e._pendingEditorState;for(let[a,s]of t._nodeMap)n.set(a,Mm(s));o&&(o._nodeMap=n),e._dirtyType=2;let r=t._selection;or(r===null?null:r.clone())}function rW(e){let t=Oe()||Pu(),n;if(Ee(t))n=Jl(t.focus,"next");else{if(t!=null){let s=t.getNodes(),i=s[s.length-1];i&&(n=Ia(i,"next"))}n=n||bs(yt(),"previous").getFlipped().insert(nr())}let o=FM(e,n),r=hC(o),a=ku(r)?dE(r):o;return fE(tE(a)),e.getLatest()}function FM(e,t,n){let o=vC(t,"next");for(let r=o;r;r=mE(r,n))o=r;return Dm(o)&&ig(283),o.insert(e.isInline()?nr().append(e):e),vC(Ia(e.getLatest(),"next"),t.direction)}function aW(e,t){let n=t();return e.replace(n),n.append(e),n}function sW(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function iW(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function lW(e){let t=Oe();if(!Ee(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let a=o[r],s=a.getKey();if(n.has(s))continue;let i=Sa(a,d=>Xe(d)&&!d.isInline());if(i===null)continue;let l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function dW(e,t){bs(e,"next").insert(t)}var HC=!(MM||!EM)&&void 0;function cW(e,t=!1){let n=1;if((function(){if(HC===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),HC=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return HC})()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function uW(e){return e._parentEditor!==null}function pW(e,t){return BM(e,t,null)}function BM(e,t,n){let o=!1;for(let r of KC(e))t(r)?n!==null&&n(r):(o=!0,Xe(r)&&BM(r,t,n||(a=>r.insertAfter(a))),r.remove());return o}function fW(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(Xe(r))for(let a of KC(r))o.push(a);return n}function mW(e){return zM(bs(e,"next"))}function KC(e){return zM(bs(e,"previous"))}function zM(e){return kC({hasNext:lE,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function gW(e){pE(Ia(e,"next")).splice(1,e.getChildren())}function hW(e){let t=o=>Nm(o,e),n=(o,r)=>Fm(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}var Ze=$C,xve=Ze.$descendantsMatching,bve=Ze.$dfs,Sve=Ze.$dfsIterator,Ive=Ze.$filter,wve=Ze.$findMatchingParent,Tve=Ze.$firstToLastIterator,Pve=Ze.$getAdjacentCaret,kve=Ze.$getAdjacentSiblingOrParentSiblingCaret,Lve=Ze.$getDepth,HM=Ze.$getNearestBlockElementAncestorOrThrow,Rve=Ze.$getNearestNodeOfType,Eve=Ze.$getNextRightPreorderNode,Mve=Ze.$getNextSiblingOrParentSibling,UM=Ze.$handleIndentAndOutdent,Ave=Ze.$insertFirst,Nve=Ze.$insertNodeToNearestRoot,_ve=Ze.$insertNodeToNearestRootAtCaret,Dve=Ze.$isEditorIsNestedEditor,Ove=Ze.$lastToFirstIterator,Fve=Ze.$restoreEditorState,Bve=Ze.$reverseDfs,zve=Ze.$reverseDfsIterator,Hve=Ze.$splitNode,Uve=Ze.$unwrapAndFilterDescendants,Kve=Ze.$unwrapNode,$ve=Ze.$wrapNodeInElement,qve=Ze.CAN_USE_BEFORE_INPUT,Vve=Ze.CAN_USE_DOM,Wve=Ze.IS_ANDROID,Gve=Ze.IS_ANDROID_CHROME,jve=Ze.IS_APPLE,Qve=Ze.IS_APPLE_WEBKIT,Yve=Ze.IS_CHROME,Xve=Ze.IS_FIREFOX,Jve=Ze.IS_IOS,Zve=Ze.IS_SAFARI,eye=Ze.addClassNamesToElement,tye=Ze.calculateZoomLevel,qC=Ze.isBlockDomNode,nye=Ze.isHTMLAnchorElement,KM=Ze.isHTMLElement,oye=Ze.isInlineDomNode,rye=Ze.isMimeType,aye=Ze.makeStateWrapper,sye=Ze.markSelection,iye=Ze.mediaFileReader,wa=Ze.mergeRegister,_u=Ze.objectKlassEquals,lye=Ze.positionNodeOnRange,dye=Ze.registerNestedElementResolver,cye=Ze.removeClassNamesFromElement,uye=Ze.selectionAlwaysOnDisplay;var VC={};cn(VC,{ContentEditable:()=>yW,ContentEditableElement:()=>VM});W();var qM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function vW({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:a,ariaExpanded:s,ariaInvalid:i,ariaLabel:l,ariaLabelledBy:d,ariaMultiline:u,ariaOwns:p,ariaRequired:f,autoCapitalize:m,className:g,id:h,role:v="textbox",spellCheck:C=!0,style:y,tabIndex:b,"data-testid":w,...S},I){let[k,P]=G(e.isEditable()),T=M(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?e.setRootElement(E):e.setRootElement(null)},[e]),L=K(()=>(function(...E){return A=>{for(let R of E)typeof R=="function"?R(A):R!=null&&(R.current=A)}})(I,T),[T,I]);return qM(()=>(P(e.isEditable()),e.registerEditableListener(E=>{P(E)})),[e]),c("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?o:void 0,"aria-describedby":r,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":k&&v==="combobox"?!!s:void 0,...i!=null?{"aria-invalid":i}:{},"aria-label":l,"aria-labelledby":d,"aria-multiline":u,"aria-owns":k?p:void 0,"aria-readonly":!k||void 0,"aria-required":f,autoCapitalize:m,className:g,contentEditable:k,"data-testid":w,id:h,ref:L,role:v,spellCheck:C,style:y,tabIndex:b,...S})}var VM=Tn(vW);function $M(e){return e.getEditorState().read(ng(e.isComposing()))}var yW=Tn(CW);function CW(e,t){let{placeholder:n,...o}=e,[r]=jt();return x(ge,{children:[c(VM,{editor:r,...o,ref:t}),n!=null&&c(xW,{editor:r,content:n})]})}function xW({content:e,editor:t}){let n=(function(s){let[i,l]=G(()=>$M(s));return qM(()=>{function d(){let u=$M(s);l(u)}return d(),wa(s.registerUpdateListener(()=>{d()}),s.registerEditableListener(()=>{d()}))},[s]),i})(t),[o,r]=G(t.isEditable());if(ue(()=>(r(t.isEditable()),t.registerEditableListener(s=>{r(s)})),[t]),!n)return null;let a=null;return typeof e=="function"?a=e(o):e!==null&&(a=e),a===null?null:c("div",{"aria-hidden":!0,children:a})}var WM=VC,GM=WM.ContentEditable,yye=WM.ContentEditableElement;W();var bW=ut(null),WC={didCatch:!1,error:null},lg=class extends ra{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=WC}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){let{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(WC))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){let{didCatch:o}=this.state,{resetKeys:r}=this.props;o&&n.error!==null&&SW(t.resetKeys,r)&&(this.props.onReset?.({next:r,prev:t.resetKeys,reason:"keys"}),this.setState(WC))}render(){let{children:t,fallbackRender:n,FallbackComponent:o,fallback:r}=this.props,{didCatch:a,error:s}=this.state,i=t;if(a){let l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")i=n(l);else if(o)i=Fe(o,l);else if(r!==void 0)i=r;else throw s}return Fe(bW.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}};function SW(e=[],t=[]){return e.length!==t.length||e.some((n,o)=>!Object.is(n,t[o]))}var GC={};cn(GC,{LexicalErrorBoundary:()=>IW});function IW({children:e,onError:t}){return c(lg,{fallback:c("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var wW=GC,jM=wW.LexicalErrorBoundary;var lx={};cn(lx,{$createHorizontalRuleNode:()=>ix,$isDecoratorTextNode:()=>lA,$isHorizontalRuleNode:()=>mA,AutoFocusExtension:()=>kW,ClearEditorExtension:()=>LW,DecoratorTextExtension:()=>_W,DecoratorTextNode:()=>Fu,EditorStateExtension:()=>pg,HorizontalRuleExtension:()=>VW,HorizontalRuleNode:()=>Pi,INSERT_HORIZONTAL_RULE_COMMAND:()=>$W,InitialStateExtension:()=>pA,LexicalBuilder:()=>sd,NodeSelectionExtension:()=>ox,TabIndentationExtension:()=>WW,applyFormatFromStyle:()=>EW,applyFormatToDom:()=>MW,batch:()=>eA,buildEditorFromExtensions:()=>BW,computed:()=>oA,configExtension:()=>Ym,declarePeerDependency:()=>JE,defineExtension:()=>fn,effect:()=>Is,getExtensionDependencyFromEditor:()=>HW,getKnownTypesAndNodes:()=>RW,getPeerDependencyFromEditor:()=>fA,getPeerDependencyFromEditorOrThrow:()=>UW,namedSignals:()=>mg,registerClearEditor:()=>sA,registerTabIndentation:()=>hA,safeCast:()=>Tr,shallowMergeConfig:()=>eg,signal:()=>ad,untracked:()=>ZC,watchedSignal:()=>ax});var TW=Symbol.for("preact-signals");function fg(){if(Ss>1)return void Ss--;let e,t=!1;for(;Ou!==void 0;){let n=Ou;for(Ou=void 0,ex++;n!==void 0;){let o=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&tA(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(ex=0,Ss--,t)throw e}function eA(e){if(Ss>0)return e();Ss++;try{return e()}finally{fg()}}var Ot,Ou;function ZC(e){let t=Ot;Ot=void 0;try{return e()}finally{Ot=t}}var Ss=0,ex=0,ug=0;function QM(e){if(Ot===void 0)return;let t=e.n;return t===void 0||t.t!==Ot?(t={i:0,S:e,p:Ot.s,n:void 0,t:Ot,e:void 0,x:void 0,r:t},Ot.s!==void 0&&(Ot.s.n=t),Ot.s=t,e.n=t,32&Ot.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ot.s,t.n=void 0,Ot.s.n=t,Ot.s=t),t):void 0}function ro(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function ad(e,t){return new ro(e,t)}function tA(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function YM(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function nA(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function Ti(e,t){ro.call(this,void 0),this.x=e,this.s=void 0,this.g=ug-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function oA(e,t){return new Ti(e,t)}function rA(e){let t=e.u;if(e.u=void 0,typeof t=="function"){Ss++;let n=Ot;Ot=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,rx(e),o}finally{Ot=n,fg()}}}function rx(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,rA(e)}function PW(e){if(Ot!==this)throw new Error("Out-of-order effect");nA(this),Ot=e,this.f&=-2,8&this.f&&rx(this),fg()}function rd(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Is(e,t){let n=new rd(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function mg(e,t={}){let n={};for(let o in e){let r=t[o],a=ad(r===void 0?e[o]:r);n[o]=a}return n}ro.prototype.brand=TW,ro.prototype.h=function(){return!0},ro.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:ZC(()=>{var n;(n=this.W)==null||n.call(this)}))},ro.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&ZC(()=>{var o;(o=this.Z)==null||o.call(this)}))}},ro.prototype.subscribe=function(e){return Is(()=>{let t=this.value,n=Ot;Ot=void 0;try{e(t)}finally{Ot=n}},{name:"sub"})},ro.prototype.valueOf=function(){return this.value},ro.prototype.toString=function(){return this.value+""},ro.prototype.toJSON=function(){return this.value},ro.prototype.peek=function(){let e=Ot;Ot=void 0;try{return this.value}finally{Ot=e}},Object.defineProperty(ro.prototype,"value",{get(){let e=QM(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ex>100)throw new Error("Cycle detected");this.v=e,this.i++,ug++,Ss++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{fg()}}}}),Ti.prototype=new ro,Ti.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ug))return!0;if(this.g=ug,this.f|=1,this.i>0&&!tA(this))return this.f&=-2,!0;let e=Ot;try{YM(this),Ot=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ot=e,nA(this),this.f&=-2,!0},Ti.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}ro.prototype.S.call(this,e)},Ti.prototype.U=function(e){if(this.t!==void 0&&(ro.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ti.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ti.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let e=QM(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),rd.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},rd.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,rA(this),YM(this),Ss++;let e=Ot;return Ot=this,PW.bind(this,e)},rd.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ou,Ou=this)},rd.prototype.d=function(){this.f|=8,1&this.f||rx(this)},rd.prototype.dispose=function(){this.d()};var kW=fn({build:(e,t,n)=>mg(t),config:Tr({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return Is(()=>o.disabled.value?void 0:e.registerRootListener(r=>{e.focus(()=>{let a=document.activeElement;r===null||a!==null&&r.contains(a)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function aA(){let e=yt(),t=Oe(),n=nr();e.clear(),e.append(n),t!==null&&n.select(),Ee(t)&&(t.format=0)}function sA(e,t=aA){return e.registerCommand(Bm,n=>(e.update(t),!0),Yt)}var LW=fn({build:(e,t,n)=>mg(t),config:Tr({$onClear:aA}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return Is(()=>sA(e,o.value))}});function RW(e){let t=new Set,n=new Set;for(let o of iA(e)){let r=typeof o=="function"?o:o.replace;t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function iA(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var jC=XE("format",{parse:e=>typeof e=="number"?e:0}),Fu=class extends xo{$config(){return this.config("decorator-text",{extends:xo,stateConfigs:[{flat:!0,stateConfig:jC}]})}getFormat(){return Nm(this,jC)}getFormatFlags(t,n){return LC(this.getFormat(),t,n)}hasFormat(t){let n=GE[t];return(this.getFormat()&n)!==0}setFormat(t){return Fm(this,jC,t)}toggleFormat(t){let n=this.getFormat(),o=LC(n,t,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function lA(e){return e instanceof Fu}function EW(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),a=o==="700"||o==="bold",s=r.includes("line-through"),i=t.fontStyle==="italic",l=r.includes("underline"),d=t.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),i&&!e.hasFormat("italic")&&e.toggleFormat("italic"),l&&!e.hasFormat("underline")&&e.toggleFormat("underline"),d!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),d!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function MW(e,t,n=NW){for(let[o,r]of Object.entries(n))e.hasFormat(r)&&(t=AW(t,o));return t}function AW(e,t){let n=document.createElement(t);return n.appendChild(e),n}var NW={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},_W=fn({name:"@lexical/extension/DecoratorText",nodes:()=>[Fu],register:(e,t,n)=>e.registerCommand(LE,o=>{let r=Oe();if(CC(r)||Ee(r))for(let a of r.getNodes())lA(a)&&a.toggleFormat(o);return!1},nd)});function ax(e,t){let n;return ad(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var pg=fn({build:e=>ax(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function Ut(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function dA(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)n[r]=dA(n[r],o[r]);return e}return t}var sx=0,tx=1,cA=2,QC=3,dg=4,od=5,YC=6,Du=7;function XC(e){return e.id===sx}function uA(e){return e.id===cA}function DW(e){return(function(t){return t.id===tx})(e)||Ut(305,String(e.id),String(tx)),Object.assign(e,{id:cA})}var OW=new Set,nx=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:sx}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):eg;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;uA(n)||Ut(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},a=(function(i,l,d){return Object.assign(i,{config:l,id:QC,registerState:d})})(n,this.mergeConfigs(),o),s;this.state=a,this.extension.init&&(s=this.extension.init(t,a.config,o)),this.state=(function(i,l,d){return Object.assign(i,{id:dg,initResult:l,registerState:d})})(a,s,r)}build(t){let n=this.state,o;n.id!==dg&&Ut(307,String(n.id),String(od)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(a,s,i){return Object.assign(a,{id:od,output:s,registerState:i})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==od&&Ut(308,String(o.id),String(od));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(a){return Object.assign(a,{id:YC})})(o),()=>{let a=this.state;a.id!==Du&&Ut(309,String(o.id),String(Du)),this.state=(function(s){return Object.assign(s,{id:od})})(a),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==YC&&Ut(310,String(n.id),String(YC)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:Du})})(n),o}getSignal(){return this._signal===void 0&&Ut(311),this._signal}getInitResult(){this.extension.init===void 0&&Ut(312,this.extension.name);let t=this.state;return(function(n){return n.id>=dg})(t)||Ut(313,String(t.id),String(dg)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=QC})(t)||Ut(314,String(t.id),String(QC)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Ut(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Ut(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=Du})(t)||Ut(316,String(t.id),String(Du)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||OW}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=od})(t)||Ut(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},XM={tag:bo};function FW(){let e=yt();e.isEmpty()&&e.append(nr())}var pA=fn({config:Tr({setOptions:XM,updateOptions:XM}),init:({$initialEditorState:e=FW})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:a}=r;if(rE(a))e.setEditorState(a,n);else if(typeof a=="function")e.update(()=>{a(e)},t);else if(a&&(typeof a=="string"||typeof a=="object")){let s=e.parseEditorState(a);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[$E,Qm,FE,jE,HE]}),JM=Symbol.for("@lexical/extension/LexicalBuilder");function BW(...e){return sd.fromExtensions(e).buildEditor()}function ZM(){}function zW(e){throw e}function cg(e){return Array.isArray(e)?e:[e]}var JC="0.41.0+prod.esm",sd=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=JC,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[cg(pA)];for(let o of t)n.push(cg(o));return new e(n)}static maybeFromEditor(t){let n=t[JM];return n&&(n.PACKAGE_VERSION!==JC&&Ut(292,n.PACKAGE_VERSION,JC),n instanceof e||Ut(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Ut(294),n}constructEditor(){let{$initialEditorState:t,onError:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(Xm({...o,...n?{onError:a=>{n(a,r)}}:{}}),{[JM]:this});for(let a of this.sortedExtensionReps())a.build(r);return r}buildEditor(){let t=ZM;function n(){try{t()}finally{t=ZM}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Gr(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ut(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);r?r.set(n,o):this.outgoingConfigEdges.set(t,new Map([[n,o]]));let a=this.incomingEdges.get(n);a?a.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ut(296);let n=cg(t),[o]=n;typeof o.name!="string"&&Ut(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&Ut(298,o.name),!r){r=new nx(this,o),this.extensionNameMap.set(o.name,r);let a=this.conflicts.get(o.name);typeof a=="string"&&Ut(299,o.name,a);for(let s of o.conflictsWith||[])this.extensionNameMap.has(s)&&Ut(299,o.name,s),this.conflicts.set(s,o.name);for(let s of o.dependencies||[]){let i=cg(s);this.addEdge(o.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of o.peerDependencies||[])this.addEdge(o.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let a=o.state;if(uA(a))return;let s=o.extension.name;var i;XC(a)||Ut(300,s,r||"[unknown]"),XC(i=a)||Ut(304,String(i.id),String(sx)),a=Object.assign(i,{id:tx}),o.state=a;let l=this.outgoingConfigEdges.get(s);if(l)for(let d of l.keys()){let u=this.extensionNameMap.get(d);u&&n(u,s)}a=DW(a),o.state=a,t.push(o)};for(let o of this.extensionNameMap.values())XC(o.state)&&n(o);for(let o of t)for(let[r,a]of this.outgoingConfigEdges.get(o.extension.name)||[])if(a.length>0){let s=this.extensionNameMap.get(r);if(s)for(let i of a)s.configs.add(i)}for(let[o,...r]of this.roots)if(r.length>0){let a=this.extensionNameMap.get(o.name);a===void 0&&Ut(301,o.name);for(let s of r)a.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],a=o.signal;for(let s of n){let i=s.register(t,a);i&&r.push(i)}for(let s of n){let i=s.afterRegistration(t);i&&r.push(i)}return Gr(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,a={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:p}=u;if(p.onError!==void 0&&(t.onError=p.onError),p.disableEvents!==void 0&&(t.disableEvents=p.disableEvents),p.parentEditor!==void 0&&(t.parentEditor=p.parentEditor),p.editable!==void 0&&(t.editable=p.editable),p.namespace!==void 0&&(t.namespace=p.namespace),p.$initialEditorState!==void 0&&(t.$initialEditorState=p.$initialEditorState),p.nodes)for(let f of iA(p)){if(typeof f!="function"){let m=o.get(f.replace);m&&Ut(302,p.name,f.replace.name,m.extension.name),o.set(f.replace,u)}n.add(f)}if(p.html){if(p.html.export)for(let[f,m]of p.html.export.entries())r.set(f,m);p.html.import&&Object.assign(a,p.html.import)}p.theme&&dA(s,p.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);let l=Object.keys(a).length>0,d=r.size>0;(l||d)&&(t.html={},l&&(t.html.import=a),d&&(t.html.export=r));for(let u of i)u.init(t);return t.onError||(t.onError=zW),t}};function HW(e,t){let n=sd.fromEditor(e).getExtensionRep(t);return n===void 0&&Ut(303,t.name),n.getExtensionDependency()}function fA(e,t){let n=sd.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function UW(e,t){let n=fA(e,t);return n===void 0&&Ut(291,t),n}var KW=new Set,ox=fn({build(e,t,n){let o=n.getDependency(pg).output,r=ad({watchedNodeKeys:new Map}),a=ax(()=>{},()=>Is(()=>{let s=a.peek(),{watchedNodeKeys:i}=r.value,l,d=!1;o.value.read(()=>{if(Oe())for(let[u,p]of i.entries()){if(p.size===0){i.delete(u);continue}let f=Zl(u),m=f&&f.isSelected()||!1;d=d||m!==(!!s&&s.has(u)),m&&(l=l||new Set,l.add(u))}}),!d&&l&&s&&l.size===s.size||(a.value=l)}));return{watchNodeKey:function(s){let i=oA(()=>(a.value||KW).has(s)),{watchedNodeKeys:l}=r.peek(),d=l.get(s),u=d!==void 0;return d=d||new Set,d.add(i),u||(l.set(s,d),r.value={watchedNodeKeys:l}),i}}},dependencies:[pg],name:"@lexical/extension/NodeSelection"}),$W=YE("INSERT_HORIZONTAL_RULE_COMMAND"),Pi=class e extends xo{static getType(){return"horizontalrule"}static clone(t){return new e(t.__key)}static importJSON(t){return ix().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:qW,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let n=document.createElement("hr");return Au(n,t.theme.hr),n}getTextContent(){return`
|
|
3806
|
+
`}isInline(){return!1}updateDOM(){return!1}};function qW(){return{node:ix()}}function ix(){return jR(Pi)}function mA(e){return e instanceof Pi}var VW=fn({dependencies:[pg,ox],name:"@lexical/extension/HorizontalRule",nodes:()=>[Pi],register(e,t,n){let{watchNodeKey:o}=n.getDependency(ox).output,r=ad({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Gr(e.registerCommand(yE,s=>{if(oM(s.target)){let i=nE(s.target);if(mA(i))return(function(l,d=!1){let u=Oe(),p=l.isSelected(),f=l.getKey(),m;d&&CC(u)?m=u:(m=QR(),or(m)),p?m.delete(f):m.add(f)})(i,s.shiftKey),!0}return!1},nd),e.registerMutationListener(Pi,(s,i)=>{eA(()=>{let l=!1,{nodeSelections:d}=r.peek();for(let[u,p]of s.entries())if(p==="destroyed")d.delete(u),l=!0;else{let f=d.get(u),m=e.getElementByKey(u);f?f.domNode.value=m:(l=!0,d.set(u,{domNode:ad(m),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:d})})}),Is(()=>{let s=[];for(let{domNode:i,selectedSignal:l}of r.value.nodeSelections.values())s.push(Is(()=>{let d=i.value;d&&(l.value?Au(d,a):Zm(d,a))}));return Gr(...s)}))}});function gA(e){return e.canBeEmpty()}function hA(e,t,n=gA){return Gr(e.registerCommand(Gm,o=>{let r=Oe();if(!Ee(r))return!1;o.preventDefault();let a=(function(s){if(s.getNodes().filter(f=>ed(f)&&f.canIndent()).length>0)return!0;let i=s.anchor,l=s.focus,d=l.isBefore(i)?l:i,u=d.getNode(),p=HM(u);if(p.canIndent()){let f=p.getKey(),m=bi();if(m.anchor.set(f,0,"element"),m.focus.set(f,0,"element"),m=cE(m),m.anchor.is(d))return!0}return!1})(r)?o.shiftKey?BE:SC:ME;return e.dispatchCommand(a,void 0)},Yt),e.registerCommand(SC,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=Oe();if(!Ee(r))return!1;let a=typeof n=="function"?n:n.peek();return UM(s=>{if(a(s)){let i=s.getIndent()+1;(!o||i<o)&&s.setIndent(i)}})},zm))}var WW=fn({build:(e,t,n)=>mg(t),config:Tr({$canIndent:gA,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:a}=n.getOutput();return Is(()=>{if(!o.value)return hA(e,r,a)})}});var St=lx,Lye=St.$createHorizontalRuleNode,Rye=St.$isDecoratorTextNode,Eye=St.$isHorizontalRuleNode,Mye=St.AutoFocusExtension,Aye=St.ClearEditorExtension,Nye=St.DecoratorTextExtension,_ye=St.DecoratorTextNode,Dye=St.EditorStateExtension,Oye=St.HorizontalRuleExtension,Fye=St.HorizontalRuleNode,Bye=St.INSERT_HORIZONTAL_RULE_COMMAND,zye=St.InitialStateExtension,vA=St.LexicalBuilder,Hye=St.NodeSelectionExtension,Uye=St.TabIndentationExtension,Kye=St.applyFormatFromStyle,$ye=St.applyFormatToDom,yA=St.batch,qye=St.buildEditorFromExtensions,Vye=St.computed,Wye=St.configExtension,Gye=St.declarePeerDependency,jye=St.defineExtension,Bu=St.effect,Qye=St.getExtensionDependencyFromEditor,Yye=St.getKnownTypesAndNodes,CA=St.getPeerDependencyFromEditor,Xye=St.getPeerDependencyFromEditorOrThrow,gg=St.namedSignals,Jye=St.registerClearEditor,Zye=St.registerTabIndentation,eCe=St.safeCast,tCe=St.shallowMergeConfig,nCe=St.signal,oCe=St.untracked,rCe=St.watchedSignal;var dx={};cn(dx,{HistoryExtension:()=>hg,SharedHistoryExtension:()=>QW,createEmptyHistoryState:()=>SA,registerHistory:()=>bA});function GW(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let a=t._selection,s=e._selection;if(r)return 1;if(!(Ee(a)&&Ee(s)&&s.isCollapsed()&&a.isCollapsed()))return 0;let i=(function(C,y,b){let w=C._nodeMap,S=[];for(let I of y){let k=w.get(I);k!==void 0&&S.push(k)}for(let[I,k]of b){if(!k)continue;let P=w.get(I);P===void 0||Lu(P)||S.push(P)}return S})(t,n,o);if(i.length===0)return 0;if(i.length>1){let C=t._nodeMap,y=C.get(a.anchor.key),b=C.get(s.anchor.key);return y&&b&&!e._nodeMap.has(y.__key)&&pt(y)&&y.__text.length===1&&a.anchor.offset===1?2:0}let l=i[0],d=e._nodeMap.get(l.__key);if(!pt(d)||!pt(l)||d.__mode!==l.__mode)return 0;let u=d.__text,p=l.__text;if(u===p)return 0;let f=a.anchor,m=s.anchor;if(f.key!==m.key||f.type!=="text")return 0;let g=f.offset,h=m.offset,v=p.length-u.length;return v===1&&h===g-1?2:v===-1&&h===g+1?3:v===-1&&h===g?4:0}function jW(e,t){let n=Date.now(),o=0,r=Date.now(),a=0,s=null;return(i,l,d,u,p,f)=>{let m=Date.now();if(f.has(xE)&&(r=n,a=o,s=i),f.has(Km))return o=0,n=m,2;f.has(CE)&&s&&(n=r,o=a,i=s);let g=GW(i,l,u,p,e.isComposing()),h=(()=>{let v=d===null||d.editor===e,C=f.has(RE);if(!C&&v&&f.has(bo))return 0;if(g===1)return 2;if(i===null)return 1;let y=l._selection;if(!(u.size>0||p.size>0))return y!==null?0:2;let b=typeof t=="number"?t:t.peek();return C===!1&&g!==0&&g===o&&m<n+b&&v||u.size===1&&(function(w,S,I){let k=S._nodeMap.get(w),P=I._nodeMap.get(w),T=S._selection,L=I._selection;return!(Ee(T)&&Ee(L)&&T.anchor.type==="element"&&T.focus.type==="element"&&L.anchor.type==="text"&&L.focus.type==="text"||!pt(k)||!pt(P)||k.__parent!==P.__parent)&&JSON.stringify(S.read(()=>k.exportJSON()))===JSON.stringify(I.read(()=>P.exportJSON()))})(Array.from(u)[0],i,l)?0:1})();return n=m,o=g,h}}function xA(e){e.undoStack=[],e.redoStack=[],e.current=null}function bA(e,t,n){let o=jW(e,n);return wa(e.registerCommand(QE,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(l.length!==0){let d=s.current,u=l.pop();d!==null&&(i.push(d),a.dispatchCommand(Ru,!0)),l.length===0&&a.dispatchCommand(Eu,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Km})}})(e,t),!0),Yt),e.registerCommand(UE,()=>((function(a,s){let i=s.redoStack,l=s.undoStack;if(i.length!==0){let d=s.current;d!==null&&(l.push(d),a.dispatchCommand(Eu,!0));let u=i.pop();i.length===0&&a.dispatchCommand(Ru,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:Km})}})(e,t),!0),Yt),e.registerCommand(Bm,()=>(xA(t),!1),Yt),e.registerCommand(vE,()=>(xA(t),e.dispatchCommand(Ru,!1),e.dispatchCommand(Eu,!1),!0),Yt),e.registerUpdateListener(({editorState:a,prevEditorState:s,dirtyLeaves:i,dirtyElements:l,tags:d})=>{let u=t.current,p=t.redoStack,f=t.undoStack,m=u===null?null:u.editorState;if(u!==null&&a===m)return;let g=o(s,a,u,i,l,d);if(g===1)p.length!==0&&(t.redoStack=[],e.dispatchCommand(Ru,!1)),u!==null&&(f.push({...u}),e.dispatchCommand(Eu,!0));else if(g===2)return;t.current={editor:e,editorState:a}}))}function SA(){return{current:null,redoStack:[],undoStack:[]}}var hg=fn({build:(e,{delay:t,createInitialHistoryState:n,disabled:o})=>gg({delay:t,disabled:o,historyState:n(e)}),config:Tr({createInitialHistoryState:SA,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(e,t,n)=>{let o=n.getOutput();return Bu(()=>o.disabled.value?void 0:bA(e,o.historyState.value,o.delay))}}),QW=fn({dependencies:[Ym(hg,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(e,t,n){let{output:o}=n.getDependency(hg),r=(function(s){return s?CA(s,hg.name):null})(e._parentEditor);if(!r)return()=>{};let a=r.output;return Bu(()=>yA(()=>{o.delay.value=a.delay.value,o.historyState.value=a.historyState.value,o.disabled.value=a.disabled.value}))}});var vg=dx,dCe=vg.HistoryExtension,cCe=vg.SharedHistoryExtension,yg=vg.createEmptyHistoryState,IA=vg.registerHistory;var cx={};cn(cx,{HistoryPlugin:()=>YW,createEmptyHistoryState:()=>yg});W();function YW({delay:e,externalHistoryState:t}){let[n]=jt();return(function(o,r,a=1e3){let s=K(()=>r||yg(),[r]);$(()=>IA(o,s,a),[a,o,s])})(n,t,e),null}var wA=cx,TA=wA.HistoryPlugin,PA=wA.createEmptyHistoryState;var ux={};cn(ux,{OnChangePlugin:()=>JW});W();var XW=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function JW({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=jt();return XW(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:a,dirtyLeaves:s,prevEditorState:i,tags:l})=>{t&&a.size===0&&s.size===0||e&&l.has(bo)||i.isEmpty()||n(r,o,l)})},[o,e,t,n]),null}var ZW=ux,kA=ZW.OnChangePlugin;var px={};cn(px,{useLexicalEditable:()=>nG});W();var eG=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function tG(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function nG(){return(function(e){let[t]=jt(),n=K(()=>e(t),[t,e]),[o,r]=G(()=>n.initialValueFn()),a=N(o);return eG(()=>{let{initialValueFn:s,subscribe:i}=n,l=s();return a.current!==l&&(a.current=l,r(l)),i(d=>{a.current=d,r(d)})},[n,e]),o})(tG)}var oG=px,LA=oG.useLexicalEditable;var fx={};cn(fx,{ReactProviderExtension:()=>rG});var rG=fn({name:"@lexical/react/ReactProvider"});var aG=fx,RA=aG.ReactProviderExtension;var mx={};cn(mx,{DragonExtension:()=>sG,registerDragonSupport:()=>EA});function EA(e){let t=window.location.origin,n=o=>{if(o.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let a=o.data;if(typeof a=="string"){let s;try{s=JSON.parse(a)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let l=i.args;if(l){let[d,u,p,f,m]=l;e.update(()=>{let g=Oe();if(Ee(g)){let h=g.anchor,v=h.getNode(),C=0,y=0;if(pt(v)&&d>=0&&u>=0&&(C=d,y=d+u,g.setTextNodeRange(v,C,v,y)),C===y&&p===""||(g.insertRawText(p),v=h.getNode()),pt(v)){C=f,y=f+m;let b=v.getTextContentSize();C=C>b?b:C,y=y>b?b:y,g.setTextNodeRange(v,C,v,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}var sG=fn({build:(e,t,n)=>gg(t),config:Tr({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>Bu(()=>n.getOutput().disabled.value?void 0:EA(e))});var MA=mx,AA=MA.DragonExtension,NA=MA.registerDragonSupport;var gx={};cn(gx,{$generateHtmlFromNodes:()=>lG,$generateNodesFromDOM:()=>iG});function iG(e,t){let n=nM(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let a of n)if(!DA.has(a.nodeName)){let s=OA(a,e,r,!1);s!==null&&(o=o.concat(s))}return(function(a){for(let s of a)s.getNextSibling()instanceof bC&&s.insertAfter(xi());for(let s of a){let i=s.getChildren();for(let l of i)s.insertBefore(l);s.remove()}})(r),o}function lG(e,t){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.");let n=document.createElement("div"),o=yt().getChildren();for(let r=0;r<o.length;r++)_A(e,o[r],n,t);return n.innerHTML}function _A(e,t,n,o=null){let r=o===null||t.isSelected(o),a=Xe(t)&&t.excludeFromCopy("html"),s=t;o!==null&&pt(t)&&(s=sg(o,t,"clone"));let i=Xe(s)?s.getChildren():[],l=eM(e,s.getType()),d;d=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);let{element:u,after:p}=d;if(!u)return!1;let f=document.createDocumentFragment();for(let m=0;m<i.length;m++){let g=i[m],h=_A(e,g,f,o);!r&&Xe(t)&&h&&t.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!a){if((KM(u)||PC(u))&&u.append(f),n.append(u),p){let m=p.call(s,u);m&&(PC(u)?u.replaceChildren(m):u.replaceWith(m))}}else n.append(f);return r}var DA=new Set(["STYLE","SCRIPT"]);function OA(e,t,n,o,r=new Map,a){let s=[];if(DA.has(e.nodeName))return s;let i=null,l=(function(g,h){let{nodeName:v}=g,C=h._htmlConversions.get(v.toLowerCase()),y=null;if(C!==void 0)for(let b of C){let w=b(g);w!==null&&(y===null||(y.priority||0)<=(w.priority||0))&&(y=w)}return y!==null?y.conversion:null})(e,t),d=l?l(e):null,u=null;if(d!==null){u=d.after;let g=d.node;if(i=Array.isArray(g)?g[g.length-1]:g,i!==null){for(let[,h]of r)if(i=h(i,a),!i)break;i&&s.push(...Array.isArray(g)?g:[i])}d.forChild!=null&&r.set(e.nodeName,d.forChild)}let p=e.childNodes,f=[],m=(i==null||!Ii(i))&&(i!=null&&ed(i)||o);for(let g=0;g<p.length;g++)f.push(...OA(p[g],t,n,m,new Map(r),i));return u!=null&&(f=u(f)),qC(e)&&(f=dG(e,f,m?()=>{let g=new bC;return n.push(g),g}:nr)),i==null?f.length>0?s=s.concat(f):qC(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Nu(g.nextSibling)&&Nu(g.previousSibling)})(e)&&(s=s.concat(xi())):Xe(i)&&i.append(...f),s}function dG(e,t,n){let o=e.style.textAlign,r=[],a=[];for(let s=0;s<t.length;s++){let i=t[s];if(ed(i))o&&!i.getFormat()&&i.setFormat(o),r.push(i);else if(a.push(i),s===t.length-1||s<t.length-1&&ed(t[s+1])){let l=n();l.setFormat(o),l.append(...a),r.push(l),a=[]}}return r}var FA=gx,BA=FA.$generateHtmlFromNodes,zA=FA.$generateNodesFromDOM;var vx={};cn(vx,{$generateJSONFromSelectedNodes:()=>qA,$generateNodesFromSerializedNodes:()=>VA,$getClipboardDataFromSelection:()=>GA,$getHtmlContent:()=>UA,$getLexicalContent:()=>KA,$insertDataTransferForPlainText:()=>cG,$insertDataTransferForRichText:()=>uG,$insertGeneratedNodes:()=>hx,copyToClipboard:()=>pG,setLexicalClipboardDataTransfer:()=>jA});function Cg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function UA(e,t=Oe()){return t==null&&Cg(166),Ee(t)&&t.isCollapsed()||t.getNodes().length===0?"":BA(e,t)}function KA(e,t=Oe()){return t==null&&Cg(166),Ee(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(qA(e,t))}function cG(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function uG(e,t,n){let o=e.getData("application/x-lexical-editor");if(o)try{let i=JSON.parse(o);if(i.namespace===n._config.namespace&&Array.isArray(i.nodes))return hx(n,VA(i.nodes),t)}catch(i){console.error(i)}let r=e.getData("text/html"),a=e.getData("text/plain");if(r&&a!==r)try{let i=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:d=>d}).createHTML(l):l})(r),"text/html");return hx(n,zA(n,i),t)}catch(i){console.error(i)}let s=a||e.getData("text/uri-list");if(s!=null)if(Ee(t)){let i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){let d=Oe();if(Ee(d)){let u=i[l];u===`
|
|
3807
3807
|
`||u===`\r
|
|
3808
|
-
`?d.insertParagraph():u===" "?d.insertNodes([XR()]):d.insertText(u)}}}else t.insertRawText(s)}function hx(e,t,n){e.dispatchCommand(qE,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(Ee(o)&&o.isCollapsed()){let r=o.anchor,a=null,s=Jl(r,"previous");if(s)if(Dm(s))a=s.origin;else{let i=ZR(s,bs(yt(),"next").getFlipped());for(let l of i){if(pt(l.origin)){a=l.origin;break}if(Xe(l.origin)&&!l.origin.isInline())break}}if(a&&pt(a)){let i=a.getFormat(),l=a.getStyle();o.format===i&&o.style===l||(o.format=i,o.style=l,o.dirty=!0)}}})(n))}function $A(e,t,n,o=[]){let r=t===null||n.isSelected(t),a=Xe(n)&&n.excludeFromCopy("html"),s=n;t!==null&&pt(s)&&(s=sg(t,s,"clone"));let i=Xe(s)?s.getChildren():[],l=(function(d){let u=d.exportJSON(),p=d.constructor;if(u.type!==p.getType()&&Cg(58,p.name),Xe(d)){let f=u.children;Array.isArray(f)||Cg(59,p.name)}return u})(s);pt(s)&&s.getTextContentSize()===0&&(r=!1);for(let d=0;d<i.length;d++){let u=i[d],p=$A(e,t,u,l.children);!r&&Xe(n)&&p&&n.extractWithChild(u,t,"clone")&&(r=!0)}if(r&&!a)o.push(l);else if(Array.isArray(l.children))for(let d=0;d<l.children.length;d++){let u=l.children[d];o.push(u)}return r}function qA(e,t){let n=[],o=yt().getChildren();for(let r=0;r<o.length;r++)$A(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function VA(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=uE(o);pt(r)&&SM(r),t.push(r)}return t}var id=null;async function pG(e,t,n){if(id!==null)return!1;if(t!==null)return new Promise((d,u)=>{e.update(()=>{d(HA(e,t,n))})});let o=e.getRootElement(),r=e._window||window,a=r.document,s=TC(r);if(o===null||s===null)return!1;let i=a.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(a.createTextNode("#")),o.append(i);let l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((d,u)=>{let p=e.registerCommand(Hm,f=>(_u(f,ClipboardEvent)&&(p(),id!==null&&(r.clearTimeout(id),id=null),d(HA(e,f,n))),!0),zm);id=r.setTimeout(()=>{p(),id=null,d(!1)},50),a.execCommand("copy"),i.remove()})}function HA(e,t,n){if(n===void 0){let r=TC(e._window),a=Oe();if(!a||a.isCollapsed()||!r)return!1;let s=r.anchorNode,i=r.focusNode;if(s!==null&&i!==null&&!aM(e,s,i))return!1;n=GA(a)}t.preventDefault();let o=t.clipboardData;return o!==null&&(jA(o,n),!0)}var WA=[["text/html",UA],["application/x-lexical-editor",KA]];function GA(e=Oe()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=Am();for(let[o,r]of WA){let a=r(n,e);a!==null&&(t[o]=a)}}return t}function jA(e,t){for(let[n]of WA)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}var Qr=vx,
|
|
3808
|
+
`?d.insertParagraph():u===" "?d.insertNodes([XR()]):d.insertText(u)}}}else t.insertRawText(s)}function hx(e,t,n){e.dispatchCommand(qE,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(Ee(o)&&o.isCollapsed()){let r=o.anchor,a=null,s=Jl(r,"previous");if(s)if(Dm(s))a=s.origin;else{let i=ZR(s,bs(yt(),"next").getFlipped());for(let l of i){if(pt(l.origin)){a=l.origin;break}if(Xe(l.origin)&&!l.origin.isInline())break}}if(a&&pt(a)){let i=a.getFormat(),l=a.getStyle();o.format===i&&o.style===l||(o.format=i,o.style=l,o.dirty=!0)}}})(n))}function $A(e,t,n,o=[]){let r=t===null||n.isSelected(t),a=Xe(n)&&n.excludeFromCopy("html"),s=n;t!==null&&pt(s)&&(s=sg(t,s,"clone"));let i=Xe(s)?s.getChildren():[],l=(function(d){let u=d.exportJSON(),p=d.constructor;if(u.type!==p.getType()&&Cg(58,p.name),Xe(d)){let f=u.children;Array.isArray(f)||Cg(59,p.name)}return u})(s);pt(s)&&s.getTextContentSize()===0&&(r=!1);for(let d=0;d<i.length;d++){let u=i[d],p=$A(e,t,u,l.children);!r&&Xe(n)&&p&&n.extractWithChild(u,t,"clone")&&(r=!0)}if(r&&!a)o.push(l);else if(Array.isArray(l.children))for(let d=0;d<l.children.length;d++){let u=l.children[d];o.push(u)}return r}function qA(e,t){let n=[],o=yt().getChildren();for(let r=0;r<o.length;r++)$A(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function VA(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=uE(o);pt(r)&&SM(r),t.push(r)}return t}var id=null;async function pG(e,t,n){if(id!==null)return!1;if(t!==null)return new Promise((d,u)=>{e.update(()=>{d(HA(e,t,n))})});let o=e.getRootElement(),r=e._window||window,a=r.document,s=TC(r);if(o===null||s===null)return!1;let i=a.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(a.createTextNode("#")),o.append(i);let l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((d,u)=>{let p=e.registerCommand(Hm,f=>(_u(f,ClipboardEvent)&&(p(),id!==null&&(r.clearTimeout(id),id=null),d(HA(e,f,n))),!0),zm);id=r.setTimeout(()=>{p(),id=null,d(!1)},50),a.execCommand("copy"),i.remove()})}function HA(e,t,n){if(n===void 0){let r=TC(e._window),a=Oe();if(!a||a.isCollapsed()||!r)return!1;let s=r.anchorNode,i=r.focusNode;if(s!==null&&i!==null&&!aM(e,s,i))return!1;n=GA(a)}t.preventDefault();let o=t.clipboardData;return o!==null&&(jA(o,n),!0)}var WA=[["text/html",UA],["application/x-lexical-editor",KA]];function GA(e=Oe()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=Am();for(let[o,r]of WA){let a=r(n,e);a!==null&&(t[o]=a)}}return t}function jA(e,t){for(let[n]of WA)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}var Qr=vx,FCe=Qr.$generateJSONFromSelectedNodes,BCe=Qr.$generateNodesFromSerializedNodes,zCe=Qr.$getClipboardDataFromSelection,QA=Qr.$getHtmlContent,HCe=Qr.$getLexicalContent,yx=Qr.$insertDataTransferForPlainText,UCe=Qr.$insertDataTransferForRichText,KCe=Qr.$insertGeneratedNodes,$Ce=Qr.copyToClipboard,qCe=Qr.setLexicalClipboardDataTransfer;var Cx={};cn(Cx,{PlainTextExtension:()=>CG,registerPlainText:()=>JA});var ki=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fG=ki&&"documentMode"in document?document.documentMode:null,mG=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),gG=!(!ki||!("InputEvent"in window)||fG)&&"getTargetRanges"in new window.InputEvent("input"),hG=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),YA=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vG=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yG=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mG&&!vG;function XA(e,t){t.update(()=>{if(e!==null){let n=_u(e,KeyboardEvent)?null:e.clipboardData,o=Oe();if(o!==null&&!o.isCollapsed()&&n!=null){e.preventDefault();let r=QA(t);r!==null&&n.setData("text/html",r),n.setData("text/plain",o.getTextContent())}}})}function JA(e){return wa(e.registerCommand(Um,t=>{let n=Oe();return!!Ee(n)&&(n.deleteCharacter(t),!0)},Yt),e.registerCommand(wE,t=>{let n=Oe();return!!Ee(n)&&(n.deleteWord(t),!0)},Yt),e.registerCommand(IE,t=>{let n=Oe();return!!Ee(n)&&(n.deleteLine(t),!0)},Yt),e.registerCommand(bE,t=>{let n=Oe();if(!Ee(n))return!1;if(typeof t=="string")n.insertText(t);else{let o=t.dataTransfer;if(o!=null)yx(o,n);else{let r=t.data;r&&n.insertText(r)}}return!0},Yt),e.registerCommand(KE,()=>{let t=Oe();return!!Ee(t)&&(t.removeText(),!0)},Yt),e.registerCommand(IC,t=>{let n=Oe();return!!Ee(n)&&(n.insertLineBreak(t),!0)},Yt),e.registerCommand(EE,()=>{let t=Oe();return!!Ee(t)&&(t.insertLineBreak(),!0)},Yt),e.registerCommand($m,t=>{let n=Oe();if(!Ee(n))return!1;let o=t,r=o.shiftKey;return!!zC(n,!0)&&(o.preventDefault(),BC(n,r,!0),!0)},Yt),e.registerCommand(qm,t=>{let n=Oe();if(!Ee(n))return!1;let o=t,r=o.shiftKey;return!!zC(n,!1)&&(o.preventDefault(),BC(n,r,!1),!0)},Yt),e.registerCommand(Vm,t=>{let n=Oe();return!!Ee(n)&&(!YA||navigator.language!=="ko-KR")&&(t.preventDefault(),e.dispatchCommand(Um,!0))},Yt),e.registerCommand(_E,t=>{let n=Oe();return!!Ee(n)&&(t.preventDefault(),e.dispatchCommand(Um,!1))},Yt),e.registerCommand(Wm,t=>{let n=Oe();if(!Ee(n))return!1;if(t!==null){if((YA||hG||yG)&&gG)return!1;t.preventDefault()}return e.dispatchCommand(IC,!1)},Yt),e.registerCommand(VE,()=>(Om(),!0),Yt),e.registerCommand(Hm,t=>{let n=Oe();return!!Ee(n)&&(XA(t,e),!0)},Yt),e.registerCommand(SE,t=>{let n=Oe();return!!Ee(n)&&((function(o,r){XA(o,r),r.update(()=>{let a=Oe();Ee(a)&&a.removeText()})})(t,e),!0)},Yt),e.registerCommand(jm,t=>{let n=Oe();return!!Ee(n)&&((function(o,r){o.preventDefault(),r.update(()=>{let a=Oe(),s=_u(o,ClipboardEvent)?o.clipboardData:null;s!=null&&Ee(a)&&yx(s,a)},{tag:zE})})(t,e),!0)},Yt),e.registerCommand(PE,t=>{let n=Oe();return!!Ee(n)&&(t.preventDefault(),!0)},Yt),e.registerCommand(TE,t=>{let n=Oe();return!!Ee(n)&&(t.preventDefault(),!0)},Yt))}var CG=fn({conflictsWith:["@lexical/rich-text"],dependencies:[AA],name:"@lexical/plain-text",register:JA});var ZA=Cx,XCe=ZA.PlainTextExtension,eN=ZA.registerPlainText;var bx={};cn(bx,{PlainTextPlugin:()=>IG});W();var xg=Fd($c(),1);function xG(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var xx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ue:$;function bG({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,a]=G(()=>n.getDecorators());return xx(()=>n.registerDecoratorListener(s=>{(0,xg.flushSync)(()=>{a(s)})}),[n]),$(()=>{a(n.getDecorators())},[n]),K(()=>{let s=[],i=Object.keys(r);for(let l=0;l<i.length;l++){let d=i[l],u=c(o,{onError:f=>n._onError(f),children:c(Rh,{fallback:null,children:r[d]})}),p=n.getElementByKey(d);p!==null&&s.push((0,xg.createPortal)(u,p,d))}return s},[o,r,n])})(e,t)}function SG({editor:e,ErrorBoundary:t}){return(function(n){let o=vA.maybeFromEditor(n);if(o&&o.hasExtensionByName(RA.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&xG(320,r);return!0}return!1})(e)?null:c(bG,{editor:e,ErrorBoundary:t})}function tN(e){return e.getEditorState().read(ng(e.isComposing()))}function IG({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=jt();return(function(r){xx(()=>wa(eN(r),NA(r)),[r])})(o),x(ge,{children:[e,c(wG,{content:t}),c(SG,{editor:o,ErrorBoundary:n})]})}function wG({content:e}){let[t]=jt(),n=(function(r){let[a,s]=G(()=>tN(r));return xx(()=>{function i(){let l=tN(r);s(l)}return i(),wa(r.registerUpdateListener(()=>{i()}),r.registerEditableListener(()=>{i()}))},[r]),a})(t),o=LA();return n?typeof e=="function"?e(o):e:null}var TG=bx,nN=TG.PlainTextPlugin;W();var PG=new RegExp(`^(?:${Bc})?$`);function kG(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function oN(e,t,n=Cl){let o=kG(e,t),r=e.lastIndexOf(`
|
|
3809
3809
|
`,Math.max(0,o-1))+1,a=/^\/(\S*)$/.exec(e.slice(r,o));if(a)return{kind:"slash-command",query:a[1]??"",rangeStart:r,rangeEnd:o};let s=o;for(;s>0&&!n(e[s-1]??"");)s-=1;let i=e.slice(s,o),l={query:i.slice(1),rangeStart:s,rangeEnd:o};if(i.startsWith("$"))return{kind:"skill",...l};if(i.startsWith("@"))return{kind:"path",...l};if(!i.startsWith("/"))return null;let d=o;for(;d<e.length&&!n(e[d]??"");)d+=1;return PG.test(e.slice(s+1,d))?{kind:"slash-skill",...l}:null}var LG=/(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g,RG=512,EG=new RegExp(`(^|\\s)\\[((?:\\\\.|[^\\]\\\\]){0,${RG}})\\]\\(([^)\\s]+)\\)(?=\\s)`,"g"),MG=/^[A-Za-z][A-Za-z0-9+.-]*:/,AG=/^[A-Za-z]:[\\/]/,NG=/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/;function _G(e){let t=[];for(let n of e.matchAll(EG)){let o=n[0],r=n[1]??"",a=(n[2]??"").replace(/\\(.)/g,"$1"),s=n[3]??"",i=s;try{i=decodeURIComponent(s)}catch{}let l=Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\")),d=l>=0?i.slice(l+1):i,u=MG.test(i)&&!AG.test(i);if(!i||u||a!==d)continue;let p=(n.index??0)+r.length,f=p+o.length-r.length;t.push({type:"mention",value:i,source:e.slice(p,f),start:p,end:f})}for(let n of e.matchAll(LG)){let o=n[0],r=n[1]??"",a=n[2],s=a!==void 0?a.replace(/\\(.)/g,"$1"):n[3]??"";if(!s||a===void 0&&NG.test(s))continue;let i=(n.index??0)+r.length,l=i+o.length-r.length;t.push({type:"mention",value:s,source:e.slice(i,l),start:i,end:l})}return t}function zu(e,t={}){let n=_G(e);for(let o of av(e))o.sigil!=="$"||o.end>=e.length||n.push({type:"skill",value:o.name,source:e.slice(o.start,o.end),start:o.start,end:o.end});for(let o of t.preserveTrailingFrom??[])o.end===e.length&&e.slice(o.start,o.end)===o.source&&!n.some(r=>r.type===o.type&&r.start===o.start&&r.end===o.end)&&n.push(o);return[...n].sort((o,r)=>o.start-r.start)}function DG(e){return e.replace(/\r\n/g,`
|
|
3810
3810
|
`).replace(/^\n+|\n+$/g,"")}function OG(e){return DG(e.text).length>0}function rN(e){return!OG(e)}function FG(e,t){return e.lineStart===e.lineEnd?t("pendingContext.terminalLine",{line:e.lineStart}):t("pendingContext.terminalLines",{start:e.lineStart,end:e.lineEnd})}function aN(e,t){return t("pendingContext.terminalLabel",{terminal:e.terminalLabel,range:FG(e,t)})}function sN(e,t,n){return e<=n&&n<t}function iN(e,t){if(!t)return;let n=e[e.length-1];if(n&&n.type==="text"){n.text+=t;return}e.push({type:"text",text:t})}function lN(e,t){let n=0;for(let o=0;o<e.length;o+=1)if(e[o]===aa){if(o>n&&t({type:"text",text:e.slice(n,o),promptOffset:n})===!0||t({type:"terminal-context",promptOffset:o})===!0)return!0;n=o+1}return n<e.length&&t({type:"text",text:e.slice(n),promptOffset:n})===!0}function BG(e,t){return lN(e,n=>n.type!=="text"?!1:t(n.text,n.promptOffset))}function zG(e,t){return BG(e,(n,o)=>{for(let r of zu(n))if(r.type==="mention"&&t(r,o)===!0)return!0;return!1})}function HG(e){let t=[];if(!e)return t;let n=zu(e),o=0;for(let r of n)r.start<o||(r.start>o&&iN(t,e.slice(o,r.start)),r.type==="mention"?t.push({type:"mention",path:r.value,source:r.source}):t.push({type:"skill",name:r.value}),o=r.end);return o<e.length&&iN(t,e.slice(o)),t}function Sx(e,t,n){return!e||t>=n?!1:zG(e,(o,r)=>{let a=r+o.start,s=r+o.end,i=a-1,l=s;return!!(i>=0&&/\s/.test(e[i]??"")&&sN(t,n,i)||l<e.length&&/\s/.test(e[l]??"")&&sN(t,n,l))})}function Ta(e,t=[]){if(!e)return[];let n=[],o=0;return lN(e,r=>r.type==="text"?(n.push(...HG(r.text)),!1):(n.push({type:"terminal-context",context:t[o]??null}),o+=1,!1)),n}function cN(e){return e.isMobileViewport?null:e.modifierKey&&e.shiftKey?e.isDraftThread?"background":null:e.shiftKey?null:e.modifierKey?"steer":"foreground"}var dN=e=>e.type!=="text";function uN(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function Ix(e){return Cl(e)||e===aa}function Ho(e,t){let n=uN(e,t),o=Ta(e);if(o.length===0)return n;let r=n,a=0;for(let s of o){if(s.type==="mention"){let l=s.source.length;if(r<=1)return a+(r===0?0:l);r-=1,a+=l;continue}if(s.type==="skill"){let l=s.name.length+1;if(r<=1)return a+(r===0?0:l);r-=1,a+=l;continue}if(s.type==="terminal-context"){if(r<=1)return a+r;r-=1,a+=1;continue}let i=s.text.length;if(r<=i)return a+r;r-=i,a+=i}return a}function pN(e){return e.type==="text"?e.text.length:1}function fN(e,t){let n=e.reduce((o,r)=>o+pN(r),0);return Number.isFinite(t)?Math.max(0,Math.min(n,Math.floor(t))):n}function ar(e,t){return fN(Ta(e),t)}function Wn(e,t){let n=uN(e,t),o=Ta(e);if(o.length===0)return n;let r=n,a=0;for(let s of o){if(s.type==="mention"){let l=s.source.length;if(r===0)return a;if(r<=l)return a+1;r-=l,a+=1;continue}if(s.type==="skill"){let l=s.name.length+1;if(r===0)return a;if(r<=l)return a+1;r-=l,a+=1;continue}if(s.type==="terminal-context"){if(r<=1)return a+r;r-=1,a+=1;continue}let i=s.text.length;if(r<=i)return a+r;r-=i,a+=i}return a}function ld(e,t,n){let o=Ta(e);if(!o.some(dN))return!1;let r=fN(o,t),a=0;for(let s of o){if(dN(s)&&(n==="left"&&r===a+1||n==="right"&&r===a))return!0;a+=pN(s)}return!1}function So(e,t){return oN(e,t,Ix)}function mN(e,t,n,o){let r=Math.max(0,Math.min(e.length,t)),a=Math.max(r,Math.min(e.length,n));return{text:`${e.slice(0,r)}${o}${e.slice(a)}`,cursor:r+o.length}}function gN(e){return e.map(t=>[t.id,t.threadId,t.terminalId,t.terminalLabel,t.lineStart,t.lineEnd,t.createdAt,t.text].join("")).join("")}function hN(e){return e.map(t=>[t.name,t.displayName??"",t.shortDescription??"",t.description??"",t.path,t.scope??"",t.enabled?"1":"0"].join("")).join("")}function vN(e){let t=0;return e.getEditorState().read(()=>{let n=Oe();Ee(n)&&!n.isCollapsed()&&(t=n.getTextContent().length)}),t}function yN(e){e.update(()=>{let t=Oe();Ee(t)&&!t.isCollapsed()&&t.removeText()})}W();W();function UG(e){return(e.comment??e.text).replace(/\s+/g," ").trim()}var dd=class e extends xo{__quote;__source;static getType(){return"composer-quote"}static clone(t){return new e(t.__quote,t.__source,t.__key)}static importJSON(t){return bg(t.quote,t.source).updateFromJSON(t)}constructor(t,n,o){super(o),this.__quote=t,this.__source=n}exportJSON(){return{...super.exportJSON(),quote:this.__quote,source:this.__source,type:"composer-quote",version:1}}createDOM(){let t=document.createElement("span");return t.className=mr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c(KG,{nodeKey:this.getKey(),quote:this.__quote,source:this.__source})}};function bg(e,t){return xs(new dd(e,t))}function KG(e){let{t}=de(),[n]=jt(),o=Xo(),r=o?.data.assistantQuotes??null,[a,s]=G(!1),[i,l]=G(e.quote.comment??""),[d,u]=vt(Wp,o?.threadKey??"",null);$(()=>{d===null||d!==e.source||(u(null),l(e.quote.comment??""),s(!0))},[d,e.quote.comment,e.source,u]);let p=UG(e.quote),f=()=>{if(s(!1),r===null)return;let m=r.withComment(e.quote,i),g=r.serialize(m);g!==null&&n.update(()=>{let h=Zl(e.nodeKey);h instanceof dd&&h.replace(bg(m,g))})};return x(po,{open:a,onOpenChange:m=>{m&&l(e.quote.comment??""),s(m)},children:[c(mo,{render:x("span",{className:Qo,contentEditable:!1,spellCheck:!1,role:"button",tabIndex:-1,"data-composer-quote-chip":"true","aria-label":t("composer.quote.chipLabel",{text:p}),children:[c(la,{"aria-hidden":"true",className:ho}),c("span",{className:vo,children:p})]})}),c(fo,{side:"top",align:"start",className:"w-96 max-w-[calc(100vw-2rem)]",children:x("div",{className:"flex flex-col gap-2",children:[c("div",{className:"line-clamp-6 whitespace-pre-wrap border-l-2 border-border ps-2 text-muted-foreground text-sm",children:e.quote.text}),c(iI,{value:i,autoFocus:!0,rows:3,placeholder:t("composer.quote.commentPlaceholder"),"aria-label":t("composer.quote.commentLabel"),onChange:m=>l(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),f())}}),x("div",{className:"flex justify-end gap-2",children:[c(J,{size:"sm",variant:"ghost",onClick:()=>s(!1),children:t("composer.cancel")}),c(J,{size:"sm",onClick:f,disabled:r===null,children:t("composer.quote.saveComment")})]})]})})]})}var Hu=class e extends xo{__reference;__source;static getType(){return"composer-thread-reference"}static clone(t){return new e(t.__reference,t.__source,t.__key)}static importJSON(t){return wx(t.reference,t.source).updateFromJSON(t)}constructor(t,n,o){super(o),this.__reference=t,this.__source=n}exportJSON(){return{...super.exportJSON(),reference:this.__reference,source:this.__source,type:"composer-thread-reference",version:1}}createDOM(){let t=document.createElement("span");return t.className=mr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c($G,{reference:this.__reference})}};function wx(e,t){return xs(new Hu(e,t))}function $G(e){let{t}=de(),n=Xo(),r=$r()(e.reference.title),a=x("span",{className:Qo,contentEditable:!1,spellCheck:!1,"data-composer-thread-reference-chip":"true","aria-label":t("composer.threadReference.chipLabel",{title:r}),children:[c(ia,{"aria-hidden":"true",className:ho}),c("span",{className:vo,children:r})]});return x(Me,{children:[c(Ne,{render:a}),c(Ae,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:c(lf,{reference:e.reference,useMachineLabel:n?.data.threadReferences?.useMachineLabel})})]})}var Tx=[dd,Hu];function Sg(e){return Tx.some(t=>e instanceof t)}function qG(e){return{collect:t=>[...e.assistantQuotes.collect(t).map(n=>({start:n.start,end:n.end,createNode:()=>bg(n.quote,n.source)})),...(e.threadReferences?.collect(t)??[]).map(n=>({start:n.start,end:n.end,createNode:()=>wx(n.reference,n.source)}))].toSorted((n,o)=>n.start-o.start)}}function Li(){let e=Xo()?.data??null,t=K(()=>e===null?null:qG(e),[e]),n=N(t);return n.current=t,n}var cd=new Map,VG=32;function CN(e,t){for(cd.delete(e),cd.set(e,t);cd.size>VG;){let n=cd.keys().next().value;if(n===void 0)break;cd.delete(n)}}function WG(e){return{anchor:e.length,focus:e.length}}function Pa(e,t,n){let o=cd.get(e);if(o)return CN(e,o),o;let r={cursor:n?.cursor??t.length,expandedCursor:n?.expandedCursor??t.length,selection:n?{anchor:n.cursor,focus:n.cursor}:WG(t),history:PA()};return CN(e,r),r}function ud(e,t,n){let o=Pa(e,t);o.cursor=n.cursor,o.expandedCursor=n.expandedCursor,o.selection=n.selection}function xN(e,t,n,o){let r=Pa(e,t);r.cursor=n,r.expandedCursor=o}function bN(e,t){let n=e.current,o=[...e.undoStack],r=[...e.redoStack];t(),e.current=n,e.undoStack.splice(0,e.undoStack.length,...o),e.redoStack.splice(0,e.redoStack.length,...r)}function GG(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?e.slice(t+1):e}function jG(e){return e.replaceAll("\\","\\\\").replaceAll("[","\\[").replaceAll("]","\\]")}function QG(e){return encodeURI(e).replaceAll("(","%28").replaceAll(")","%29").replaceAll("#","%23").replaceAll("?","%3F").replaceAll("\\","%5C")}function Ri(e){return`[${jG(GG(e))}](${QG(e)})`}W();function Px(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)}function SN(e){let t=Px(e);return t.startsWith(".")&&!t.slice(1).includes(".")?"directory":t.includes(".")?"file":"directory"}W();W();var IN=ut(null),Ig=IN.Provider;function _t(){let e=Nt(IN);if(e===null)throw new Error("Composer API has not been provided.");return e}var wg=le(function(t){let n=_t().pierreIcons,o=n.useSpriteReady();Bd(n.ensureSprite,[n]);let r=K(()=>n.resolveForEntry(t.pathValue,t.kind),[n,t.kind,t.pathValue]);return o?c("svg",{"aria-hidden":"true","data-file-icon":r.symbolId,className:j("size-4 shrink-0",t.className),children:c("use",{href:`#${r.symbolId}`})}):t.kind==="directory"?c(Va,{className:j("size-4 shrink-0 text-icon-muted",t.className)}):c(tc,{className:j("size-4 shrink-0 text-icon-muted",t.className)})});var wN=Qo;function TN(e){return x(ge,{children:[c(wg,{pathValue:e.path,kind:SN(e.path),theme:e.theme,className:ho}),c("span",{className:e.selectable?Gw:vo,children:e.label})]})}function Tg(e){return c("span",{className:wN,contentEditable:!1,spellCheck:!1,"data-composer-mention-chip":"true",children:c(TN,{path:e.path,label:Px(e.path),theme:e.theme})})}function Pg(e){return x("span",{className:jw,contentEditable:!1,spellCheck:!1,"data-composer-skill-chip":"true",children:[c("span",{"aria-hidden":"true",className:ho,dangerouslySetInnerHTML:{__html:Qw}}),c("span",{className:vo,children:e.label})]})}function PN(e){let{label:t,tooltipText:n,expired:o=!1}=e;return x(Me,{children:[c(Ne,{render:x("span",{className:j(Qo,o&&"border-destructive/35 bg-destructive/8 text-destructive-foreground"),"data-terminal-context-expired":o?"true":void 0,children:[c(Do,{className:j(ho,"size-icon-1",o&&"opacity-100")}),c("span",{className:vo,children:t})]})}),c(Ae,{side:"top",className:"max-w-80 whitespace-pre-wrap leading-tight",children:n})]})}function kN({context:e}){let{t}=de(),n=aN(e,t),o=rN(e),r=o?t("pendingContext.terminalExpired",{label:n}):e.text;return c(PN,{label:n,tooltipText:r,expired:o})}function YG(e){let t=[];for(let n of e.split(/[\s:_-]+/))n.length!==0&&t.push(n.charAt(0).toUpperCase()+n.slice(1));return t.join(" ")}function XG(e){return e.replaceAll("\\","/")}function Uo(e){let t=e.displayName?.trim();return t||YG(e.name)}function kx(e,t){return t?e.filter(xl):[]}function LN(e,t){let n=new Set(t.map(o=>o.name.trim().toLowerCase()));return e.filter(o=>!n.has(o.name.trim().toLowerCase()))}function RN(e){let t=XG(e.path);if(t.includes("/.codex/plugins/")||t.includes("/.agents/plugins/"))return"app";switch(e.scope?.trim().toLowerCase()){case"repo":case"repository":return"repo";case"project":case"workspace":case"local":return"project";case"user":case"personal":return"personal";case"system":return"system";case void 0:case"":return"other";default:return"other"}}var kg=ut({onRemoveTerminalContext:()=>{}});function JG(e){let t=c(Tg,{path:e.path,theme:nj()});return x(Me,{children:[c(Ne,{render:t}),c(Ae,{side:"top",className:"max-w-120 whitespace-normal leading-tight wrap-anywhere",children:e.path})]})}var Ei=class e extends xo{__path;__source;static getType(){return"composer-mention"}static clone(t){return new e(t.__path,t.__source,t.__key)}static importJSON(t){return Uu(t.path,t.source).updateFromJSON(t)}constructor(t,n=Ri(t),o){super(o),this.__path=t,this.__source=n}exportJSON(){return{...super.exportJSON(),path:this.__path,source:this.__source,type:"composer-mention",version:1}}createDOM(){let t=document.createElement("span");return t.className=mr,t}updateDOM(){return!1}getTextContent(){return this.__source}isInline(){return!0}decorate(){return c(JG,{path:this.__path})}};function Uu(e,t){return xs(new Ei(e,t))}function ZG(e){let t=e.shortDescription?.trim();return t||e.description?.trim()||null}function Mi(e){return new Map(e.map(t=>[t.name,{label:Uo(t),description:ZG(t)}]))}function ej(e){let t=c(Pg,{label:e.skillLabel});return e.skillDescription?x(Me,{children:[c(Ne,{render:t}),c(Ae,{side:"top",className:"max-w-120 whitespace-normal leading-tight",children:e.skillDescription})]}):t}var pd=class e extends xo{__skillName;__skillLabel;__skillDescription;static getType(){return"composer-skill"}static clone(t){return new e(t.__skillName,t.__skillLabel,t.__skillDescription,t.__key)}static importJSON(t){return Lx(t.skillName,t.skillLabel??t.skillName,t.skillDescription??null).updateFromJSON(t)}constructor(t,n,o,r){super(r);let a=t.startsWith("$")?t.slice(1):t;this.__skillName=a,this.__skillLabel=n,this.__skillDescription=o}exportJSON(){return{...super.exportJSON(),skillName:this.__skillName,skillLabel:this.__skillLabel,...this.__skillDescription?{skillDescription:this.__skillDescription}:{},type:"composer-skill",version:1}}createDOM(){let t=document.createElement("span");return t.className=mr,t}updateDOM(){return!1}getTextContent(){return`$${this.__skillName}`}isInline(){return!0}decorate(){return c(ej,{skillLabel:this.__skillLabel,skillDescription:this.__skillDescription})}};function Lx(e,t,n){return xs(new pd(e,t,n))}function tj(e){return c(kN,{context:e.context})}var Yr=class e extends xo{__context;static getType(){return"composer-terminal-context"}static clone(t){return new e(t.__context,t.__key)}static importJSON(t){return Rx(t.context)}constructor(t,n){super(n),this.__context=t}exportJSON(){return{...super.exportJSON(),context:this.__context,type:"composer-terminal-context",version:1}}createDOM(){let t=document.createElement("span");return t.className=mr,t}updateDOM(){return!1}getTextContent(){return aa}isInline(){return!0}decorate(){return c(tj,{context:this.__context})}};function Rx(e){return xs(new Yr(e))}function kr(e){return e instanceof Ei||e instanceof pd||e instanceof Yr||Sg(e)}function nj(){return document.documentElement.classList.contains("dark")?"dark":"light"}function $u(e,t){return Number.isFinite(t)?Math.max(0,Math.min(e.length,Math.floor(t))):e.length}function Lg(e){return Sg(e)?e.getTextContentSize():1}function MN(e){return e.getTextContentSize()}function oj(e,t,n){return t+(n>0?Lg(e):0)}function rj(e,t,n){return t+(n>0?MN(e):0)}function aj(e,t){let n=e.getParent();if(!n||!Xe(n))return null;let o=e.getIndexWithinParent();return t.value===0?{key:n.getKey(),offset:o,type:"element"}:t.value===Lg(e)?{key:n.getKey(),offset:o+1,type:"element"}:(t.value-=Lg(e),null)}function Rg(e){return kr(e)?Lg(e):pt(e)?e.getTextContentSize():td(e)?1:Xe(e)?e.getChildren().reduce((t,n)=>t+Rg(n),0):0}function Ex(e){return kr(e)?MN(e):pt(e)?e.getTextContentSize():td(e)?1:Xe(e)?e.getChildren().reduce((t,n)=>t+Ex(n),0):0}function fd(e,t){let n=0,o=e;for(;o;){let r=o.getParent();if(!r||!Xe(r))break;let a=r.getChildren(),s=o.getIndexWithinParent();for(let i=0;i<s;i+=1){let l=a[i];l&&(n+=Rg(l))}o=r}if(pt(e))return n+Math.min(t,e.getTextContentSize());if(kr(e))return oj(e,n,t);if(td(e))return n+Math.min(t,1);if(Xe(e)){let r=e.getChildren(),a=Math.max(0,Math.min(t,r.length));for(let s=0;s<a;s+=1){let i=r[s];i&&(n+=Rg(i))}return n}return n}function Ku(e,t){let n=0,o=e;for(;o;){let r=o.getParent();if(!r||!Xe(r))break;let a=r.getChildren(),s=o.getIndexWithinParent();for(let i=0;i<s;i+=1){let l=a[i];l&&(n+=Ex(l))}o=r}if(pt(e))return n+Math.min(t,e.getTextContentSize());if(kr(e))return rj(e,n,t);if(td(e))return n+Math.min(t,1);if(Xe(e)){let r=e.getChildren(),a=Math.max(0,Math.min(t,r.length));for(let s=0;s<a;s+=1){let i=r[s];i&&(n+=Ex(i))}return n}return n}function Eg(e,t){if(kr(e))return aj(e,t);if(pt(e)){let n=e.getTextContentSize();return t.value<=n?{key:e.getKey(),offset:t.value,type:"text"}:(t.value-=n,null)}if(td(e)){let n=e.getParent();if(!n)return null;let o=e.getIndexWithinParent();return t.value===0?{key:n.getKey(),offset:o,type:"element"}:t.value===1?{key:n.getKey(),offset:o+1,type:"element"}:(t.value-=1,null)}if(Xe(e)){let n=e.getChildren();for(let o of n){let r=Eg(o,t);if(r)return r}if(t.value===0)return{key:e.getKey(),offset:n.length,type:"element"}}return null}function qu(){return yt().getChildren().reduce((n,o)=>n+Rg(o),0)}function ka(e){let t=yt(),n=qu(),r={value:Math.max(0,Math.min(e,n))},a=Eg(t,r)??{key:t.getKey(),offset:t.getChildren().length,type:"element"},s=bi();s.anchor.set(a.key,a.offset,a.type),s.focus.set(a.key,a.offset,a.type),or(s)}function md(e,t){let n=yt(),o=qu(),r=Math.max(0,Math.min(e,o)),a=Math.max(0,Math.min(t,o)),s={value:r},i={value:a},l=Eg(n,s)??{key:n.getKey(),offset:n.getChildren().length,type:"element"},d=Eg(n,i)??{key:n.getKey(),offset:n.getChildren().length,type:"element"},u=bi();u.anchor.set(l.key,l.offset,l.type),u.focus.set(d.key,d.offset,d.type),or(u)}function Mx(e){if(!Ee(e))return null;let t=e.anchor.getNode(),n=e.focus.getNode(),o=Ku(t,e.anchor.offset),r=Ku(n,e.focus.offset);return{start:Math.min(o,r),end:Math.max(o,r)}}function Ax(e){return Ee(e)?e.getNodes().some(t=>kr(t)):!1}function Ai(e){let t=Oe();if(!Ee(t)||!t.isCollapsed())return e;let n=t.anchor.getNode(),o=fd(n,t.anchor.offset),r=qu();return Math.max(0,Math.min(o,r))}function Nx(e){let t=Oe();if(!Ee(t)||!t.isCollapsed())return e;let n=t.anchor.getNode(),o=Ku(n,t.anchor.offset),r=yt().getTextContent().length;return Math.max(0,Math.min(o,r))}function Mg(e){let t=Oe();return Ee(t)?{anchor:fd(t.anchor.getNode(),t.anchor.offset),focus:fd(t.focus.getNode(),t.focus.offset)}:e}function EN(e,t){let n=t.split(`
|
|
3811
3811
|
`);for(let o=0;o<n.length;o+=1){let r=n[o]??"";r.length>0&&e.append(wr(r)),o<n.length-1&&e.append(xi())}}function sj(e,t,n){let o=0;for(let r of n?.collect(t)??[])EN(e,t.slice(o,r.start)),e.append(r.createNode()),o=r.end;EN(e,t.slice(o))}function Vu(e,t,n,o){let r=yt();r.clear();let a=nr();r.append(a);let s=Ta(e,t);for(let i of s){if(i.type==="mention"){a.append(Uu(i.path,i.source));continue}if(i.type==="skill"){let l=n.get(i.name);a.append(Lx(i.name,l?.label??Uo({name:i.name}),l?.description??null));continue}if(i.type==="terminal-context"){i.context&&a.append(Rx(i.context));continue}sj(a,i.text,o)}}function Ag(e){return e instanceof Yr?[e.__context.id]:Xe(e)?e.getChildren().flatMap(t=>Ag(t)):[]}W();function gd(e){return/mac|iphone|ipad|ipod/i.test(e)}function Ni(){let e=globalThis.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n of e)t+=n.toString(16).padStart(2,"0");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function AN(e,t){return e.registerCommand(jm,n=>{if(!(n instanceof ClipboardEvent)||n.clipboardData===null||n.clipboardData.files.length>0)return!1;let o=n.clipboardData.getData("text/plain");if(o.length===0)return!1;let r=t.readLinkChips?.()?.collect(o)??[],a=zu(`${o}
|
|
@@ -3820,7 +3820,7 @@ ${t8(e.t,e.snapShotHint)}`}W();W();var _D=le(function(t){let{t:n}=de(),o=yd();re
|
|
|
3820
3820
|
`,s=[...n.map(i=>`-${i}`),...o.map(i=>`+${i}`)];return`${r}${a}${s.join(`
|
|
3821
3821
|
`)}
|
|
3822
3822
|
`}function OF(e){if(e.length===0)return[];let t=e.split(`
|
|
3823
|
-
`);return t.at(-1)===""?t.slice(0,-1):t}function KF(e){let t=new Map;return e.map(n=>{let o=t.get(n.path)??0;return t.set(n.path,o+1),o===0?n.path:`${n.path}#${o}`})}function $F(e){return{additions:e.additions??0,deletions:e.deletions??0}}W();W();var
|
|
3823
|
+
`);return t.at(-1)===""?t.slice(0,-1):t}function KF(e){let t=new Map;return e.map(n=>{let o=t.get(n.path)??0;return t.set(n.path,o+1),o===0?n.path:`${n.path}#${o}`})}function $F(e){return{additions:e.additions??0,deletions:e.deletions??0}}W();W();var pAe=(()=>{try{return!1}catch{return!1}})(),qF=/(?=^From [a-f0-9]+ .+$)/m,Jb=/(?=^diff --git)/gm;var VF=/^(---|\+\+\+)\s+([^\t\r\n]+)/,WF=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,GF=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,jF=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;var vY={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},fAe={...vY,hunkLineCount:1};var mAe=Object.freeze({fromStart:0,fromEnd:0});function Zb(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var yY=new TextEncoder,CY=new TextDecoder("utf-8",{ignoreBOM:!0}),xY=/[\uD800-\uDFFF]/,eS=1024,Md=new Uint8Array(eS);function QF(){Md.length!==eS&&(Md=new Uint8Array(eS))}function mn(e){if(e.length===0)return e;if(xY.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Md.length<t&&(Md=new Uint8Array(t));let{written:n}=yY.encodeInto(e,Md);return CY.decode(Md.subarray(0,n))}function XF(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let o=t.hunkContent[n];if(o.type!=="change")continue;let r=SY(e,o);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}bY(t,e)}}function bY(e,t){let{hunkContent:n}=e;for(let o=1;o<n.length;o++){let r=n[o],a=n[o-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||a.type!=="context")continue;let s=r.additions>0,i=s?t.additionLines:t.deletionLines,l=s?r.additionLineIndex:r.deletionLineIndex,d=s?r.additions:r.deletions,u=i[l]??"";if(u.trim()!=="")continue;let p=!0;for(let v=1;v<d;v++)if(i[l+v]!==u){p=!1;break}if(!p)continue;let f=0;for(;f<a.lines&&t.additionLines[a.additionLineIndex+a.lines-1-f]===u;)f++;if(f===0)continue;r.additionLineIndex-=f,r.deletionLineIndex-=f;let m=r.additionLineIndex+r.additions,g=r.deletionLineIndex+r.deletions,h=n[o+1];h?.type==="context"?(h.lines+=f,h.additionLineIndex=m,h.deletionLineIndex=g):n.splice(o+1,0,{type:"context",lines:f,additionLineIndex:m,deletionLineIndex:g}),a.lines-=f,a.lines===0&&(n.splice(o-1,1),o--)}}function SY(e,t){let{deletions:n,additions:o,deletionLineIndex:r,additionLineIndex:a}=t,s=Math.min(n,o),i=Math.abs(o-n);if(s===0||i===0||s*(i+1)>4096)return null;let l=[];for(let h=0;h<n;h++)l.push(YF(e.deletionLines[r+h]??""));let d=[];for(let h=0;h<o;h++)d.push(YF(e.additionLines[a+h]??""));let u=o>n,p=0,f=-1;for(let h=0;h<=i;h++){let v=0;for(let C=0;C<s;C++)v+=wY(l[C+(u?0:h)],d[C+(u?h:0)]);h===0?f=v+s*.5:v>f&&(f=v,p=h)}if(p===0)return null;let m=[],g=(h,v,C,y)=>{(h>0||v>0)&&m.push({type:"change",deletions:h,additions:v,deletionLineIndex:C,additionLineIndex:y})};return u?(g(0,p,r,a),g(s,s,r,a+p),g(0,o-s-p,r+s,a+p+s)):(g(p,0,r,a),g(s,s,r+p,a),g(n-s-p,0,r+p+s,a+s)),m}var IY=/\s+/g;function YF(e){return e.replace(IY,"")}function wY(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),o=Math.min(e.length,t.length);if(o===0)return 0;let r=0;for(;r<o&&e[r]===t[r];)r++;let a=0;for(;a<o-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return(r+a)/n}function TY(e,t,n){try{return PY(e,t,n)}finally{QF()}}function PY(e,t,n=!1){let o=DY(e),r=o?RY(e):EY(e),a,s=[];for(let i of r){if(o&&!Jb.test(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}else if(!o&&!MY(i)){if(a==null)a=mn(i);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",i)}continue}let l=kY(i,{cacheKey:t!=null?`${t}-${s.length}`:void 0,isGitDiff:o,throwOnError:n});l!=null&&s.push(l)}return{patchMetadata:a,files:s}}function kY(e,{cacheKey:t,isGitDiff:n=Jb.test(e),oldFile:o,newFile:r,throwOnError:a=!1}={}){let s=0,i=s2(e,"@@ "),l,d=o==null||r==null,u=0,p=0;for(let f of i){let m=o2(f),g=m[0];if(g==null){if(a)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}let h=a2(g),v=0,C=0;if(h==null||l==null){if(l!=null){if(a)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&o!=null&&r!=null?JF(r.contents):[],deletionLines:!d&&o!=null&&r!=null?JF(o.contents):[],cacheKey:t2(t)},l.additionLines.length===1&&r?.contents===""&&(l.additionLines.length=0),l.deletionLines.length===1&&o?.contents===""&&(l.deletionLines.length=0);for(let T of m){if(T.startsWith("diff --git")){let E=T.trim().match(GF),A=E?.[1]??E?.[2],R=E?.[3]??E?.[4];if(A==null||R==null){if(a)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",T);continue}l.name=mn(R.trim()),A!==R&&(l.prevName=mn(A.trim()));continue}let L=T.startsWith("---")||T.startsWith("+++")?T.match(n?WF:VF):null;if(L!=null){let[,E,A]=L;if(E==="---"&&A!=="/dev/null"){let R=mn(A.trim());l.prevName=R,l.name=R}else E==="+++"&&A!=="/dev/null"&&(l.name=mn(A.trim()))}else if(n){if(T.startsWith("new mode ")&&(l.mode=mn(T.slice(8).trim())),T.startsWith("old mode ")&&(l.prevMode=mn(T.slice(8).trim())),T.startsWith("new file mode")&&(l.type="new",l.mode=mn(T.slice(13).trim())),T.startsWith("deleted file mode")&&(l.type="deleted",l.mode=mn(T.slice(17).trim())),T.startsWith("similarity index")&&(T.startsWith("similarity index 100%")?l.type="rename-pure":l.type="rename-changed"),T.startsWith("index ")){let[,E,A,R]=T.trim().match(jF)??[];E!=null&&(l.prevObjectId=mn(E)),A!=null&&(l.newObjectId=mn(A)),R!=null&&(l.mode=mn(R))}T.startsWith("rename from ")&&(l.prevName=mn(T.slice(12).trim())),T.startsWith("rename to ")&&(l.name=mn(T.slice(10).trim()))}}continue}let y,b;for(;m.length>0&&(m[m.length-1]===`
|
|
3824
3824
|
`||m[m.length-1]==="\r"||m[m.length-1]===`\r
|
|
3825
3825
|
`||m[m.length-1]==="");)m.pop();let{additionStart:w,deletionStart:S}=h;u=d?u:S-1,p=d?p:w-1;let I={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:h.additionCount,additionStart:w,additionLines:v,deletionCount:h.deletionCount,deletionStart:S,deletionLines:C,deletionLineIndex:u,additionLineIndex:p,hunkContent:[],hunkContext:t2(h.hunkContext),hunkSpecs:mn(g),noEOFCRAdditions:!1,noEOFCRDeletions:!1},k=0,P=0;for(let T=1;T<m.length;T++){let L=m[T];if(k>=I.additionCount&&P>=I.deletionCount&&!L.startsWith("\\")){if(a&&AY(L)&&!NY(L))throw Error("parsePatchContent: hunk has more lines than expected");break}let E=L[0];if(E!=="+"&&E!=="-"&&E!==" "&&E!=="\\"){if(a)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${E}", full line: "${L}"`),console.error("processFile: invalid rawLine:",L);continue}let A=OY(E);if(A==="addition"){if(a&&k>=I.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let R=tS(L);(y==null||y.type!=="change")&&(y=nS("change",u,p),I.hunkContent.push(y)),p++,k++,d&&l.additionLines.push(R),y.additions++,v++,b="addition"}else if(A==="deletion"){if(a&&P>=I.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let R=tS(L);(y==null||y.type!=="change")&&(y=nS("change",u,p),I.hunkContent.push(y)),u++,P++,d&&l.deletionLines.push(R),y.deletions++,C++,b="deletion"}else if(A==="context"){if(a&&(P>=I.deletionCount||k>=I.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let R=tS(L);(y==null||y.type!=="context")&&(y=nS("context",u,p),I.hunkContent.push(y)),p++,u++,k++,P++,d&&(l.deletionLines.push(R),l.additionLines.push(R)),y.lines++,b="context"}else if(A==="metadata"&&y!=null){if(y.type==="context"?(I.noEOFCRAdditions=!0,I.noEOFCRDeletions=!0):b==="deletion"?I.noEOFCRDeletions=!0:b==="addition"&&(I.noEOFCRAdditions=!0),d&&(b==="addition"||b==="context")){let R=l.additionLines.length-1;R>=0&&(l.additionLines[R]=Zb(l.additionLines[R]))}if(d&&(b==="deletion"||b==="context")){let R=l.deletionLines.length-1;R>=0&&(l.deletionLines[R]=Zb(l.deletionLines[R]))}}}if(a&&(k!==I.additionCount||P!==I.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");I.additionLines=v,I.deletionLines=C,I.collapsedBefore=Math.max(I.additionStart-1-s,0),l.hunks.push(I),s=I.additionStart+I.additionCount-1;for(let T of I.hunkContent)T.type==="context"?(I.splitLineCount+=T.lines,I.unifiedLineCount+=T.lines):(I.splitLineCount+=Math.max(T.additions,T.deletions),I.unifiedLineCount+=T.deletions+T.additions);I.splitLineStart=l.splitLineCount+I.collapsedBefore,I.unifiedLineStart=l.unifiedLineCount+I.collapsedBefore,l.splitLineCount+=I.collapsedBefore+I.splitLineCount,l.unifiedLineCount+=I.collapsedBefore+I.unifiedLineCount}if(l!=null){if(a&&d&&!n&&l.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(l.hunks.length>0&&!d&&l.additionLines.length>0&&l.deletionLines.length>0){let f=l.hunks[l.hunks.length-1],m=f.additionStart+f.additionCount-1,g=l.additionLines.length,h=Math.max(g-m,0);l.splitLineCount+=h,l.unifiedLineCount+=h}return n||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type="rename-changed":l.type="rename-pure":(o==null||o.contents==="")&&r!=null&&r.contents!==""?l.type="new":o!=null&&o.contents!==""&&(r==null||r.contents==="")&&(l.type="deleted")),l.type!=="rename-pure"&&l.type!=="rename-changed"&&(l.prevName=void 0),XF(l),l}}function n2(e,t,n=!1){let o=[],r=LY(e)?e.split(qF):[e];for(let a of r)try{o.push(TY(a,t!=null?`${t}-${o.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return o}function LY(e){return e.startsWith("From ")||e.includes(`
|
|
3826
3826
|
From `)}function JF(e){let t=o2(e);for(let n=0;n<t.length;n++)t[n]=mn(t[n]);return t}function o2(e){if(e.length===0)return[""];let t=[],n=0;for(;;){let o=e.indexOf(`
|
|
@@ -3833,7 +3833,7 @@ From `)}function JF(e){let t=o2(e);for(let n=0;n<t.length;n++)t[n]=mn(t[n]);retu
|
|
|
3833
3833
|
diff --git`)}function s2(e,t){if(e.length===0)return[""];let n=`
|
|
3834
3834
|
${t}`,o=e.startsWith(t)?0:e2(e,n,0);if(o===-1)return[e];let r=[];o>0&&r.push(e.slice(0,o));let a=o;for(;;){let s=e2(e,n,a+1);if(s===-1)break;r.push(e.slice(a,s)),a=s}return r.push(e.slice(a)),r}function e2(e,t,n){let o=e.indexOf(t,n);return o===-1?-1:o+1}function t2(e){return e==null?e:mn(e)}function OY(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function tS(e){let t=e.slice(1);return mn(t===""?`
|
|
3835
3835
|
`:t)}function nS(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}var i2={light:"vscode-light-modern",dark:"vscode-dark-modern"};function d2(e){return e==="dark"?i2.dark:i2.light}var c2=2166136261,u2=16777619,FY=2654435769,BY=2246822507;function l2(e,t=c2,n=u2){let o=t>>>0;for(let r=0;r<e.length;r+=1)o^=e.charCodeAt(r),o=Math.imul(o,n)>>>0;return o>>>0}function zY(e,t="diff-panel"){let n=e.trim(),o=l2(n,c2,u2).toString(36),r=l2(n,FY,BY).toString(36);return`${t}:${n.length}:${o}:${r}`}function rS(e){if(!e.isPartial)return e;let t=0,n=0,o=e.hunks.map(r=>{let a={...r,splitLineStart:t,unifiedLineStart:n};return t+=r.splitLineCount,n+=r.unifiedLineCount,a});return{...e,hunks:o,splitLineCount:t,unifiedLineCount:n,...e.cacheKey?{cacheKey:`${e.cacheKey}:compact-partial`}:{}}}function p2(e,t="diff-panel",n={}){if(!e)return null;let o=e.trim();if(o.length===0)return null;try{let a=n2(o,zY(o,t)).flatMap(s=>n.compactPartialHunkOffsets?s.files.map(rS):s.files);return a.length>0?{kind:"files",files:a}:{kind:"raw",text:o,reason:"Unsupported diff format. Showing raw patch."}}catch{return{kind:"raw",text:o,reason:"Failed to parse patch. Showing raw patch."}}}function f2(e){let t=e.cacheKey;return t?t.endsWith(":hydrated")?t.slice(0,-9):t:`${e.prevName??"none"}:${e.name}`}function m2({fileChange:e,onOpenDiff:t}){let{t:n}=de(),[o,r]=G(!1),a=K(()=>UF(e),[e]),s=$F(e);return x("div",{className:"min-w-0",children:[x("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[c("span",{className:"min-w-0 shrink truncate font-mono text-ui-sm text-foreground/85",children:e.path}),c("span",{className:"shrink-0 font-mono text-ui-sm text-muted-foreground tabular-nums",children:n("approval.diff.stat",{additions:s.additions,deletions:s.deletions})}),a===null?c("span",{className:"text-ui-sm text-muted-foreground",children:e.omitted==="too-large"?n("approval.diff.tooLarge"):n("approval.diff.unavailable")}):x(J,{size:"micro",variant:"ghost-muted",className:"font-normal","aria-expanded":o,onClick:()=>r(i=>!i),children:[o?c(qt,{className:"size-3 shrink-0"}):c(Cn,{className:"size-3 shrink-0"}),c("span",{children:n(o?"approval.diff.hide":"approval.diff.show")})]}),t?c(J,{size:"micro",variant:"ghost-muted",className:"font-normal",onClick:()=>t(e.path),children:n("approval.diff.open")}):null]}),o&&a!==null?c(HY,{path:e.path,unifiedDiff:a}):null]})}function HY({path:e,unifiedDiff:t}){let n=_t().theme.useResolvedTheme(),o=K(()=>{let r=p2(t,`approval:${n}`,{compactPartialHunkOffsets:!0});return r?.kind==="files"?r.files.map(a=>({id:f2(rS(a)),type:"diff",fileDiff:a,collapsed:!1})):[]},[n,t]);return o.length===0?c("pre",{"aria-label":e,className:"mt-1 max-h-56 overflow-auto rounded-md border border-border/60 bg-background/60 p-2 font-mono text-ui-sm leading-relaxed text-muted-foreground/90 [scrollbar-width:thin]",tabIndex:0,children:t}):c("div",{className:"mt-1 overflow-hidden rounded-md border border-border/60",children:c(bI,{className:"max-h-56 overflow-auto [scrollbar-gutter:stable]",items:o,options:{diffStyle:"unified",lineDiffType:"none",overflow:"wrap",theme:d2(n),themeType:n,stickyHeaders:!1}})})}var UY="block max-h-20 min-w-0 overflow-auto whitespace-pre font-mono text-ui-sm text-foreground/85 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5",g2=le(function({approval:t,pendingCount:n,onOpenDiff:o,actions:r,className:a}){let{t:s}=de(),i=FF(t),{body:l}=i,d=KF(i.fileChanges);return c(Dp,{state:"pending",className:a,title:BF(i,s),meta:n>1?`1/${n}`:void 0,actions:r,children:x("div",{"aria-label":zF(i.kind,s),className:"flex min-w-0 flex-col gap-1",role:"group",children:[l.shape==="none"?null:c("code",{"aria-label":HF(l.shape,s),className:j(UY,l.shape==="path"||l.shape==="url"?"truncate":null),"data-approval-detail":"complete",tabIndex:0,children:l.shape==="command"?l.command:l.shape==="path"?l.path:l.shape==="url"?l.url:l.shape==="query"?l.query:l.text}),i.description===null?null:c("span",{className:"min-w-0 text-ui-sm text-muted-foreground",children:i.description}),i.fileChanges.map((u,p)=>c(m2,{fileChange:u,onOpenDiff:o},d[p])),i.args.length===0?null:x("details",{className:"min-w-0","data-approval-args":"true",children:[c("summary",{className:"cursor-pointer text-ui-sm text-muted-foreground",children:s("approval.body.detailsSummary")}),c("dl",{"aria-label":s("approval.body.argumentsLabel"),className:"mt-1 grid max-h-32 min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 overflow-auto rounded-md border border-border/60 bg-background/60 p-2 text-ui-sm [scrollbar-width:thin]",tabIndex:0,children:i.args.map(u=>x("div",{className:"col-span-2 grid grid-cols-subgrid",children:[c("dt",{className:"font-mono text-muted-foreground",children:u.name}),c("dd",{className:"min-w-0 font-mono whitespace-pre-wrap wrap-break-word text-foreground/85",children:u.value})]},u.name))})]})]})})});var aS=le(function(t){return c(g2,{...t})});W();var sS=le(function(t){let{t:n}=de(),[o,r]=G(!1),[a,s]=G(!1),i=t.decision,l=i.requestId;if(l===null)return null;let d=p=>p.key===void 0?p.text:n(p.key,{...p.params,defaultValue:p.text}),u=i.askedBy.kind==="plugin"?i.askedBy.pluginId:null;return x("div",{className:j("flex min-w-0 flex-col gap-1 px-3 py-1.5 sm:px-4",t.className),"data-composer-pending-decision":"true",children:[x("div",{className:"flex min-w-0 items-baseline gap-2",children:[c("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:d(i.title)}),u===null?null:c("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:u})]}),i.body.map((p,f)=>c("span",{className:"min-w-0 text-[11px] text-muted-foreground",children:d(p)},`${String(f)}:${p.key??p.text}`)),i.detail===null?null:c("button",{type:"button",className:"min-w-0 truncate text-left font-mono text-[11px] text-muted-foreground",onClick:()=>r(p=>!p),children:o?i.detail.text.slice(0,4e3):i.detail.text.split(`
|
|
3836
|
-
`)[0]}),c("div",{className:"flex min-w-0 flex-wrap items-center gap-1 pt-0.5",children:i.options.map(p=>c(J,{size:"xs",variant:p.tone==="primary"?"default":p.tone==="danger"?"destructive":"outline",disabled:a,onClick:()=>{s(!0),t.onRespond(l,p.id)},children:d(p.label)},p.id))})]})});function KY(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function iS(e,t){if(t?.attachmentsBlocked)return null;let n=KY(t?.customAnswer);if(e.allowFreeform!==!1&&n)return n;let o=zx(e,t?.selectedOptionLabels),r=e.allowFreeform!==!1&&(t?.attachmentCount??0)>0;return e.multiSelect?o.length>0?o:r?"":null:o[0]??(r?"":null)}function $Y(e,t){let n={};for(let o of e){let r=iS(o,t[o.id]);if(r===null)return null;n[o.id]=r}return n}function qY(e,t){return e.reduce((n,o)=>iS(o,t[o.id])!==null?n+1:n,0)}function h2(e,t,n){let o=e.length===0?0:Math.max(0,Math.min(n,e.length-1)),r=e[o]??null,a=r?t[r.id]:void 0,s=r?iS(r,a):null,i=r?.allowFreeform===!1?"":a?.customAnswer??"",l=qY(e,t),d=e.length===0?!0:o>=e.length-1;return{questionIndex:o,activeQuestion:r,activeDraft:a,selectedOptionLabels:r?zx(r,a?.selectedOptionLabels):[],customAnswer:i,resolvedAnswer:s,usingCustomAnswer:i.trim().length>0,answeredQuestionCount:l,isLastQuestion:d,isComplete:$Y(e,t)!==null,canAdvance:s!==null}}var VY={approve:{label:"pendingUserInput.planApprove",description:"pendingUserInput.planApproveHint"},revise:{label:"pendingUserInput.planRevise",description:"pendingUserInput.planReviseHint"},stop:{label:"pendingUserInput.planStop",description:"pendingUserInput.planStopHint"}};function v2(e,t,n){let o=t.kind==="plan"&&n.planAction!==void 0?VY[n.planAction]:void 0;return o===void 0?{label:n.label,description:n.description??""}:{label:e(o.label),description:e(o.description)}}W();var y2=le(function({pendingUserInputs:t,respondingRequestIds:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s}){if(t.length===0)return null;let i=t[0];return i?c(WY,{prompt:i,isResponding:n.includes(i.requestId),answers:o,questionIndex:r,onToggleOption:a,onAdvance:s},i.requestId):null}),WY=le(function({prompt:t,isResponding:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s}){let{t:i}=de(),l=_t(),d=h2(t.questions,o,r),u=d.activeQuestion,p=N(null),f=N(s),[m,g]=G(null),[h,v]=G(null),C=h!==null&&h===u?.id;$(()=>{f.current=s},[s]),$(()=>{if(!(!u||u.multiSelect||!m)){if(m.questionId!==u.id){g(null);return}d.customAnswer.trim().length===0&&d.selectedOptionLabels.includes(m.optionLabel)&&g(null)}},[u,m,d.customAnswer,d.selectedOptionLabels]),$(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);let y=M((I,k)=>{if(u?.multiSelect){a(I,k);return}g({questionId:I,optionLabel:k}),a(I,k),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{p.current=null,f.current()},200)},[u,a]);if(l.pane.useKeydown(I=>{if(!u||n||C||I.metaKey||I.ctrlKey||I.altKey||I.isComposing||I.keyCode===229||rs(I.target))return;let k=xv(I.key,u.options.length);if(k===null)return;let P=u.options[k];P&&(I.preventDefault(),y(u.id,Cd(P)))},{target:"document"}),!u)return null;let b=d.customAnswer.trim().length>0,w=m?.questionId===u.id?m.optionLabel:null,S=w!==null?[w]:b?[]:d.selectedOptionLabels;return x(Dp,{state:"pending",className:"px-3 py-2 sm:px-4",title:u.header,meta:t.questions.length>1?`${r+1}/${t.questions.length}`:void 0,collapse:{collapsed:C,onCollapsedChange:I=>{v(I?u.id:null)},hint:u.question,toggleLabel:i(C?"pendingUserInput.showQuestion":"pendingUserInput.hideQuestion")},children:[c("div",{className:"max-h-[min(45vh,28rem)] overflow-y-auto overscroll-contain break-words text-chat text-foreground","data-pending-user-input-body":u.kind??"question",tabIndex:0,children:u.kind==="plan"?c(Zn,{text:u.question,cwd:void 0,isStreaming:!1}):c("p",{className:"whitespace-pre-wrap font-medium",children:u.question})}),u.multiSelect?c("p",{className:"text-chat-row text-muted-foreground",children:i("pendingUserInput.selectOneOrMore")}):null,c(gI,{mode:u.multiSelect?"multiple":"single","aria-label":u.header,disabled:n,selected:S,onToggle:I=>{y(u.id,I)},onReselect:I=>{y(u.id,I)},options:u.options.map((I,k)=>{let P=v2(i,u,I);return{value:Cd(I),label:P.label,...P.description&&P.description!==P.label?{description:P.description}:{},...k<9?{trailing:c(ul,{children:k+1})}:{}}})},u.id)]})});W();var C2=le(function({planTitle:t}){let{t:n}=de();return c("div",{className:"px-3 py-2 sm:px-4",children:x("div",{className:"flex flex-wrap items-center gap-2",children:[c("span",{className:"text-xs font-medium text-muted-foreground",children:n("plan.ready")}),t?c("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground/85",children:t}):null]})})});function x2(e){if(e.occupant.kind!=="approval")return null;let{approval:t}=e.occupant;return c(NF,{requestId:t.requestId,isResponding:e.respondingRequestIds.includes(t.requestId),options:t.options,keybindings:e.keybindings,declineReasonRelay:t.declineReasonRelay,onRespondToApproval:e.onRespondToApproval})}function b2(e){return e.occupant.kind!=="user-input"?null:c(y2,{pendingUserInputs:[e.occupant.userInput],respondingRequestIds:e.respondingRequestIds,answers:e.activePendingDraftAnswers,questionIndex:e.activePendingQuestionIndex,onToggleOption:e.onSelectActivePendingUserInputOption,onAdvance:e.onAdvanceActivePendingUserInput})}var S2={approval:{expanded:e=>e.occupant.kind!=="approval"?null:c(aS,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:x2(e),className:"px-3 py-2 sm:px-4"}),collapsed:e=>e.occupant.kind!=="approval"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(aS,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:x2(e),className:"px-3 pt-2 pb-3 sm:px-4"})})},decision:{expanded:e=>e.occupant.kind!=="decision"?null:c(sS,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision}),collapsed:e=>e.occupant.kind!=="decision"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(sS,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision,className:"pt-2 pb-3"})})},"user-input":{expanded:b2,collapsed:e=>x("div",{"data-chat-composer-collapsed-controls":"true",children:[b2(e),e.collapsedPendingRow]})},"plan-follow-up":{expanded:e=>e.activeProposedPlan===null?null:c(C2,{planTitle:AF(e.activeProposedPlan.planMarkdown)??null},e.activeProposedPlan.id),collapsed:null}};function I2(e,t){let n=S2[e.occupant.kind],o=t?n.collapsed:n.expanded;return o===null?null:o(e)}var yNe=Object.keys(S2);function w2(e){let{composerOccupant:t,showComposerTopDrawer:n,hasBlockingComposerTopDrawer:o,isTasksDrawerOpen:r,isComposerCollapsedMobile:a,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,badges:y,pendingPrimaryAction:b,isSendBusy:w,sendDisabledReason:S,environmentUnavailable:I,noProviderAvailable:k,projectSelectionRequired:P,previousUserInputQuestion:T,handleInterruptPrimaryAction:L,handleImplementPlanInNewThreadPrimaryAction:E}=e,{inlineTasksBadge:A,inlineStashBadge:R,visibleTasksProgress:F,visibleTaskSteps:H,dismissTasks:z,toggleTasksDrawer:_}=y;return x(ge,{children:[n&&(!r||o)?c("div",{className:"chat-composer-top-drawer","data-chat-composer-top-drawer":"true","data-variant":t?.kind==="approval"?"warning":"info","data-occupant":t?.kind??"none",children:t===null?null:I2({occupant:t,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,collapsedPendingRow:c(MF,{activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,inlineTasksBadge:A,inlineStashBadge:R,pendingPrimaryAction:b,isSendBusy:w,sendDisabledReason:S,isEnvironmentUnavailable:I!==null||k||P,onPreviousActivePendingUserInputQuestion:T,handleInterruptPrimaryAction:L,handleImplementPlanInNewThreadPrimaryAction:E})},a)}):null,r&&!o&&F&&H?c(eD,{onDismiss:z,onCollapse:_,progress:F,steps:H}):null]})}function T2(e,t){return{images:e.images,terminalContexts:e.terminalContexts,elementContexts:e.elementContexts,previewAnnotations:e.previewAnnotations,reviewComments:e.reviewComments,nonPersistedImageIds:e.nonPersistedImageIds,activeProvider:e.activeProvider,nativeModeByProvider:e.nativeModeByProvider,selectedPluginActionKey:e.selectedPluginActionKey,promptHasText:e.prompt.trim().length>0,hasSendableContent:t({prompt:e.prompt,imageCount:e.images.length,terminalContexts:e.terminalContexts,elementContextCount:e.elementContexts.length+e.previewAnnotations.length+e.reviewComments.length}).hasSendableContent}}function P2(e){let t=e.draft.useStore;return{setComposerDraftPrompt:t(n=>n.setPrompt),setComposerDraftNativeMode:t(n=>n.setNativeMode),addComposerDraftImage:t(n=>n.addImage),addComposerDraftImages:t(n=>n.addImages),removeComposerDraftImage:t(n=>n.removeImage),insertComposerDraftTerminalContext:t(n=>n.insertTerminalContext),removeComposerDraftElementContext:t(n=>n.removeElementContext),removeComposerDraftPreviewAnnotation:t(n=>n.removePreviewAnnotation),removeComposerDraftReviewComment:t(n=>n.removeReviewComment),clearComposerDraftPromptAndImages:t(n=>n.clearComposerPromptAndImages)}}W();function k2(e){let{onComposerPaste:t,submitComposer:n,exitShellCommandMode:o}=e,r=N({onComposerPaste:t,submitComposer:n,exitShellCommandMode:o});r.current={onComposerPaste:t,submitComposer:n,exitShellCommandMode:o};let a=M(l=>{r.current.onComposerPaste(l)},[]),s=M((l,d)=>{r.current.submitComposer(l,d)},[]),i=M(()=>r.current.exitShellCommandMode(),[]);return{handleComposerPaste:a,handleComposerSubmit:s,handleUnclaimedEscape:i}}W();var L2=ut(null);function R2({children:e}){let{data:t,target:n,threadKey:o}=Yo(),r=t.useComposerStatus({target:n,threadKey:o});return c(L2.Provider,{value:r,children:e})}function E2(){let e=Nt(L2);if(e===null)throw new Error("Composer status has not been provided.");return e}var M2=le(function(t){let n=f_(),{data:o,target:r,threadKey:a}=Yo(),{activePendingApproval:s,pendingUserInputs:i,activePendingProgress:l,activePendingResolvedAnswers:d,activePendingIsResponding:u,activePendingDraftAnswers:p,activePendingQuestionIndex:f,questionAttachmentsSupported:m,respondingRequestIds:g,occupants:h,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,changeUserInputCustomAnswer:b,advanceUserInput:w,previousUserInputQuestion:S}=o.useComposerPending({target:r,threadKey:a}),{runtimeMode:I,interactionMode:k,lockedProvider:P,providerStatuses:T,activeProjectDefaultModelSelection:L,projectId:E,activeThreadModelSelection:A}=o.useComposerModelContext(r),{activeThreadId:R,activeThread:F,isLocalDraftThread:H,projectSelectionRequired:z,phase:_,isSendBusy:Q,sendDisabledReason:D,unavailableAgentInstanceId:O=null,noAgentChosen:re=!1,isPreparingWorktree:U,worktreeSetup:ne=null,environmentUnavailable:X,compactDisabled:q,compactDisabledReason:V}=E2(),{t:Z}=de(),{composerDraftTarget:ae,environmentId:ee,attachmentUploadsCapabilityKnown:oe,supportsAttachmentUploads:se,routeKind:Ce,routeThreadRef:xe,draftId:Le,forceExpandedOnMobile:tt,settings:je,keybindings:he,terminalOpen:Re,gitCwd:ve,promptRef:Pe,composerRef:ce,composerImagesRef:Y,composerTerminalContextsRef:ye,composerElementContextsRef:fe,sendContextRef:Ve,onSend:We,onInterrupt:nt,interruptArmed:ot=!1,stopping:dt=!1,onCompactContext:Xt,onImplementPlanInNewThread:$t,onProviderInstanceSelect:Et,onModelSelectionChosen:ie,handleRuntimeModeChange:Se,handleInteractionModeChange:ke,handleNativeModeChange:_e,focusComposer:Tt,setThreadError:Pt}=t,zn=o.useComposerPlan(r),It=zn.proposedPlan,rn=zn.tasksProgress,Ct=zn.taskSteps,kt=i.length===0&&k==="plan"&&It!==null,Lt=N(null),{pendingPrimaryAction:Ft,onSelectActivePendingUserInputOption:tn,onRespondToApproval:wt,onRespondToComposerDecision:an,onAdvanceActivePendingUserInput:Jt}=V_({t:Z,threadId:r.threadId,setThreadError:Pt,promptRef:Pe,promptInputRef:Lt,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,advanceUserInput:w,activePendingProgress:l,activePendingIsResponding:u,activePendingResolvedAnswers:d}),rt=t.api,{limits:Wt}=t.attachments,Te=rt.draft.useThreadDraftSelector(ae,Mo=>T2(Mo,rt.chat.deriveComposerSendState)),$e=i[0]??null,{questionAttachmentTarget:ct,attachmentTarget:at,attachmentDocumentKey:ft}=H_({supported:m,attachments:t.attachments,environmentId:ee,threadId:R,requestId:$e?.requestId??null,question:l?.activeQuestion??null,responding:u,composerDraftTarget:ae}),xt=rt.draft.useThreadDraftSelector(at,z_),Mt=xt.images,Gt=Te.terminalContexts,gn=Te.elementContexts,Xn=Te.previewAnnotations,dn=Te.reviewComments,so=xt.nonPersistedImageIds,Jn=rt.uploads.useStore(Mo=>Mo.uploadsByImageId),io=!oe&&Mt.length>0?Z("attachments.capabilityUnknown"):se?b_({imageIds:Mt.map(Mo=>Mo.id),uploadsByImageId:Jn,environmentId:ee},Z):null,{setComposerDraftPrompt:Ie,setComposerDraftNativeMode:st,addComposerDraftImage:At,addComposerDraftImages:ht,removeComposerDraftImage:hn,insertComposerDraftTerminalContext:In,removeComposerDraftElementContext:sn,removeComposerDraftPreviewAnnotation:nn,removeComposerDraftReviewComment:lo,clearComposerDraftPromptAndImages:on}=P2(rt);$(()=>{if(oe){if(!se){for(let Mo of Mt)rt.uploads.release(Mo.id);return}rt.draft.restoreAttachments();for(let Mo of Mt)rt.uploads.start({environmentId:ee,image:Mo})}},[oe,Mt,ee,se]);let wo=l!==null,_r=wD({api:rt,t:Z,settings:je,composerDraft:Te,composerDraftTarget:ae,environmentId:ee,gitCwd:ve,routeKind:Ce,threadId:r.threadId,activeThread:F,isLocalDraftThread:H,unavailableAgentInstanceId:O,agentNotChosen:re,runtimeMode:I,lockedProvider:P,providerStatuses:T,projectId:E,activeProjectDefaultModelSelection:L,activeThreadModelSelection:A,compactDisabledReason:V,externalSendDisabledReason:D,attachmentBlockReason:io,answeringQuestion:wo,setComposerDraftNativeMode:st,handleNativeModeChange:_e,onProviderInstanceSelect:Et,onModelSelectionChosen:ie}),{selectedInstanceId:Fa,noProviderAvailable:ks,selectedProvider:Ke,composerModelOptions:Ls,selectedModel:Dr,selectedProviderModels:Ba,sendDisabledReason:Wi,isSendDisabled:za,setModelSendBlockShown:To,isModelSendBlocked:Ha}=_r,Vo=x_(ee,ae),[Zr,ea]=G(!1),[Po,ko]=G(null),[Gi,qe]=G(null),[Lo,Rs]=G(!1),[ji,Qi]=G(!1),[Nd,Yi]=G(null),[ta,Ua]=G({key:0,active:!1}),Ro=N(Vo);ue(()=>{Ro.current!==Vo&&(Ro.current=Vo,ea(!1),ko(null),Rs(!1),Qi(!1),Yi(null),Ua({key:ta.key,active:!1}))},[Vo,ta.key]);let Or=Vf("max-sm"),na=N(null),_d=N(null),oa=N(null),Es=N(null),Bt=N(new Map),{isComposerCollapsedMobile:Eo,blurMobileComposerAfterSend:wh,expandMobileComposer:Dd,scheduleComposerCollapseCheck:Th,handleFormFocusCapture:Ms}=q_({isMobileViewport:Or,forceExpandedOnMobile:tt,composerEditorRef:na,composerSurfaceRef:Es,composerFormRef:oa}),Ph=M(()=>{ea(!0)},[]),Xi=M(Mo=>{ke(Mo)},[ke]),Qe=s!==null,zt=l?.activeQuestion?.allowFreeform===!1,vn=h[0]??null,{showTopDrawer:Hn,showCollapsedPromptRow:up,hasBlocking:hS}=C_(vn?.kind??null,Eo),wB=kt||l!==null,{isComposerFooterCompact:TB,isComposerPrimaryActionsCompact:PB}=w_(oa,wB),kB=TD({api:rt,settings:je,routeKind:Ce,routeThreadRef:xe,draftId:Le,selectedProvider:Ke,selectedInstanceId:Fa,selectedModel:Dr,selectedProviderModels:Ba,composerModelOptions:Ls});$(()=>{ko(null)},[gn,Xn,dn,Gt,Dr,_r.selectedModelOptionsForDispatch,Ke]),$_({composerImages:Mt,composerImagesRef:Y,composerTerminalContexts:Gt,composerTerminalContextsRef:ye,composerElementContexts:gn,composerElementContextsRef:fe});let As=X_({api:rt,t:Z,limits:Wt,composerDraftTarget:ae,composerDraft:Te,composerDocumentKey:Vo,promptRef:Pe,promptInputRef:Lt,pendingImageCompressionsRef:Bt,setComposerDraftPrompt:Ie,setModelSendBlockShown:To,onSend:We,onCompactContext:Xt,blurMobileComposerAfterSend:wh,isMobileViewport:Or,isComposerApprovalState:Qe,activePendingApproval:s,activePendingProgress:l,activePendingResolvedAnswers:d,pendingUserInputCount:i.length,activeThreadId:R,phase:_,isSendBusy:Q,environmentUnavailable:X,compactDisabled:q,noProviderAvailable:ks,isSendDisabled:za,sendDisabledReason:Wi,isModelSendBlocked:Ha,showPlanFollowUpPrompt:kt}),Od=O_({api:rt,t:Z,limits:Wt,promptRef:Pe,promptInputRef:Lt,composerEditorRef:na,composerImagesRef:Y,composerDraftTarget:ae,setComposerDraftPrompt:Ie,addComposerDraftImages:ht,clearComposerDraftPromptAndImages:on,setIsStashMenuOpen:Rs,setStashPulse:Ua,isComposerCollapsedMobile:Eo,expandMobileComposer:Dd,keybindings:he,terminalOpen:Re,isComposerModelPickerOpen:Zr,hasPendingUserInputs:i.length>0,isComposerApprovalState:Qe,projectSelectionRequired:z,answeringQuestion:wo}),kh=tD({activeThreadId:R,activeThread:F,activeTasksProgress:rn,activeTaskSteps:Ct,isTasksDrawerOpen:ji,setIsTasksDrawerOpen:Qi,dismissedTasksTurnId:Nd,setDismissedTasksTurnId:Yi,stashQueue:Od.stashQueue,isStashMenuOpen:Lo,stashPulse:ta,toggleInlineStashMenu:Od.toggleInlineStashMenu,isComposerApprovalState:Qe,externalDrawerAttached:n,showComposerTopDrawer:Hn,isComposerCollapsedMobile:Eo,hasBlockingComposerTopDrawer:hS}),LB=M(Mo=>{ko(null),As.revalidatePromptLength(Mo),Rs(!1)},[As.revalidatePromptLength]),{addComposerImages:vS,removeComposerImage:RB,onComposerAttachmentInputChange:EB}=B_({api:rt,t:Z,limits:Wt,setThreadError:Pt,activeThreadId:R,answerQuestionsFirst:i.length>0&&ct===null,attachmentTarget:at,attachmentDocumentKey:ft,supportsAttachmentUploads:se,attachmentUploadsCapabilityKnown:oe,pendingImageCompressionsRef:Bt,addComposerDraftImage:At,addComposerDraftImages:ht,removeComposerDraftImage:hn}),{onComposerPaste:MB,insertComposerTextAtEnd:AB,addDroppedFolders:NB,isDragOverComposer:_B,composerMentionDragHandlers:DB,onComposerMentionDragLeaveCapture:OB}=D_({api:rt,t:Z,addComposerImages:vS,attachments:t.attachments,promptRef:Pe,promptInputRef:Lt,composerEditorRef:na,composerFormRef:oa,composerThreadKey:a,attachmentDocumentKey:ft,attachmentImagesRef:Y,limits:Wt,supportsAttachmentUploads:se,attachmentUploadsCapabilityKnown:oe,composerDocumentKey:Vo,isComposerApprovalState:Qe,pasteBlocked:i.length>0&&ct===null,hasPendingUserInputs:i.length>0,projectSelectionRequired:z,environmentId:ee}),yS=M(()=>{nt()},[nt]),CS=M(()=>{$t()},[$t]),{handleComposerPaste:FB,handleComposerSubmit:BB,handleUnclaimedEscape:zB}=k2({onComposerPaste:MB,submitComposer:As.submitComposerOrShellCommand,exitShellCommandMode:As.exitShellCommandMode});return K_({composerRef:ce,sendContextRef:Ve,api:rt,t:Z,limits:Wt,composerData:o,refs:{composerEditorRef:na,promptInputRef:Lt,promptRef:Pe,composerImagesRef:Y,composerTerminalContextsRef:ye,composerElementContextsRef:fe},composerDraftTarget:ae,activeThread:F,addComposerImages:vS,addDroppedFolders:NB,focusComposer:Tt,insertComposerTextAtEnd:AB,insertComposerDraftTerminalContext:In,composerPreviewAnnotations:Xn,composerReviewComments:dn,isComposerApprovalState:Qe,pendingUserInputCount:i.length,projectSelectionRequired:z,noProviderAvailable:ks,modelState:_r,handleRuntimeModeChange:Se,runtimeMode:I,setIsComposerModelPickerOpen:ea,setProviderInputSubmissionError:ko}),c(EF,{formRef:oa,onSubmit:As.submitComposerOrShellCommand,onFocusCapture:Ms,onBlurCapture:Th,dragHandlers:DB,onDragLeaveCapture:OB,badges:kh,stashQueueLength:Od.stashQueue.length,isStashMenuOpen:Lo,stashPulse:ta,toggleStashMenu:Od.toggleStashMenu,drawers:c(w2,{composerOccupant:vn,showComposerTopDrawer:Hn,hasBlockingComposerTopDrawer:hS,isTasksDrawerOpen:ji,isComposerCollapsedMobile:Eo,respondingRequestIds:g,keybindings:he,onRespondToApproval:wt,onRespondToDecision:an,activePendingDraftAnswers:p,activePendingQuestionIndex:f,onSelectActivePendingUserInputOption:tn,onAdvanceActivePendingUserInput:Jt,activeProposedPlan:It,activePendingProgress:l,isPendingUserInputChoiceOnly:zt,expandMobileComposer:Dd,badges:kh,pendingPrimaryAction:Ft,isSendBusy:Q,sendDisabledReason:Wi,environmentUnavailable:X,noProviderAvailable:ks,projectSelectionRequired:z,previousUserInputQuestion:S,handleInterruptPrimaryAction:yS,handleImplementPlanInNewThreadPrimaryAction:CS}),children:c(RF,{props:t,composerDraft:Te,model:_r,traits:kB,submit:As,stash:Od,badges:kh,uploadsByImageId:Jn,composerImages:Mt,nonPersistedComposerImageIds:so,removeComposerImage:RB,removeComposerDraftPreviewAnnotation:nn,removeComposerDraftReviewComment:lo,removeComposerDraftElementContext:sn,onComposerAttachmentInputChange:EB,surfaceRef:Es,composerAttachmentInputRef:_d,promptInputRef:Lt,composerEditorRef:na,composerMenuAnchor:Gi,setComposerMenuAnchor:qe,composerDocumentKey:Vo,isComposerCollapsedMobile:Eo,expandMobileComposer:Dd,isDragOverComposer:_B,isComposerApprovalState:Qe,showCollapsedMobilePromptRow:up,activePendingProgress:l,pendingUserInputs:i,changeUserInputCustomAnswer:b,pendingPrimaryAction:Ft,approvalDetail:s?.detail??null,handleComposerPaste:FB,handleComposerSubmit:BB,onPromptEdited:LB,handleUnclaimedEscape:zB,openModelPicker:Ph,switchInteractionMode:Xi,providerInputSubmissionError:Po,isStashMenuOpen:Lo,isComposerFooterCompact:TB,isComposerPrimaryActionsCompact:PB,isMobileViewport:Or,isComposerModelPickerOpen:Zr,setIsComposerModelPickerOpen:ea,showPlanFollowUpPrompt:kt,compactDisabled:q,compactThreadContext:As.compactThreadContext,status:{projectSelectionRequired:z,isSendBusy:Q,environmentUnavailable:X,interruptArmed:ot,stopping:dt,agentNotChosen:re,unavailableAgentInstanceId:O,lockedProvider:P,phase:_,isPreparingWorktree:U,worktreeSetup:ne,activeThread:F,interactionMode:k,runtimeMode:I},actions:{previousUserInputQuestion:S,handleInterruptPrimaryAction:yS,handleImplementPlanInNewThreadPrimaryAction:CS}})})});function A2(e){let{composerRef:t,...n}=e;return c(Ig,{value:n.api,children:c(M2,{...n,composerRef:t})})}function Ad({section:e,resetKey:t,children:n}){return c(Tl,{resetKey:t,fallback:o=>GY(e,o),children:n})}function GY(e,t){return c(jY,{section:e,error:t})}function jY({section:e,error:t}){let{t:n}=Ye();return x("div",{role:"status","data-conversation-section-error":e,className:e==="composer"||e==="queue"?"pointer-events-auto mx-auto flex w-full max-w-3xl items-start gap-2 rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm":"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",children:[c(Zt,{"aria-hidden":!0,className:"size-4 shrink-0 text-destructive-foreground"}),x("div",{className:"min-w-0",children:[c("p",{className:"font-medium text-foreground",children:n(`timeline.sectionUnavailable.${e}`)}),c("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:n("timeline.sectionUnavailableHint",{reason:t.message})})]})]})}function N2({hostVersion:e,scopeClass:t}){let{t:n}=Ye();return x("div",{role:"status","data-conversation-host-data-mismatch":!0,className:j("flex min-h-0 min-w-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",t),children:[c(Zt,{"aria-hidden":!0,className:"size-5 text-destructive-foreground"}),c("p",{className:"font-medium text-foreground",children:n("timeline.hostDataMismatchTitle")}),c("p",{className:"max-w-md text-muted-foreground",children:n("timeline.hostDataMismatchDescription",{host:e??0,plugin:Hd})})]})}W();function _2(e){let t=pn();$(()=>{let n=e.current;if(!n)return;let o=r=>{let a=r.detail?.reference;a&&t.openThread({environmentId:a.environmentId,threadId:a.threadId})};return n.addEventListener(Ji,o),()=>n.removeEventListener(Ji,o)},[t,e])}function D2({data:e,target:t,slots:n,children:o}){return c(MI,{data:e,target:t,children:c(vv,{value:n,children:o})})}function O2(e){let{data:t}=e;return t?.version!==Hd?c(N2,{hostVersion:t?.version??null,scopeClass:e.scopeClass}):c(wp.Provider,{value:e.scope.active,children:c(XY,{...e,data:t})})}var QY=le(function({threadKey:t,onModeChange:n,summaryContext:o}){let[r]=vt("turn-navigator",t,null),a=M(s=>{n("chat"),r?.onSelect(s)},[n,r]);return r===null?null:c(KI,{...r,placement:"inline",onSelect:a,summaryContext:o})});function YY({slots:e,children:t}){let{data:n,target:o,threadKey:r}=Yo(),a=n.useComposerPending({target:o,threadKey:r});return e?.renderSlotChain("conversation.composer",{occupants:a.occupants},t)??t}function XY(e){let{scope:t,mode:n,timeline:o,trajectory:r,composer:a,data:s}=e,[,i]=vt("turn-navigator",t.threadKey,null),l=a.draftHero.active,d=a.sessionActions,u=a.terminalControl,p=a.agentsControl,{mode:f,onModeChange:m}=n,g=K(()=>({data:s,target:{environmentId:t.environmentId,threadId:t.threadId},threadKey:t.threadKey,openTrajectory:()=>m("trajectory"),onOpenFileDiff:o.onOpenFileDiff}),[s,t.environmentId,t.threadId,t.threadKey,m,o.onOpenFileDiff]),h=K(()=>l?x(ge,{children:[d,c("div",{className:"min-w-0 flex-1"}),u]}):x(ge,{children:[d,c(PI,{mode:f,onModeChange:m}),c("div",{className:"min-w-0 flex-1"}),u,p,c(QY,{threadKey:t.threadKey,onModeChange:m,summaryContext:g})]}),[l,d,u,p,f,m,t.threadKey,g]),{belowSlot:v,draftHero:C,onOverlayElementChange:y,sessionActions:b,terminalControl:w,agentsControl:S,contextStrip:I,...k}=a,P=c(A2,{...k,attachments:e.attachments,firstRow:h}),T=K(()=>({environmentId:t.environmentId,threadId:t.threadId}),[t.environmentId,t.threadId]),[L,E]=G(null),A=M(se=>E(se?{key:t.threadKey,value:se}:null),[t.threadKey]),R=L?.key===t.threadKey?L.value:null,[F,H]=vt("trajectory-reveal",t.threadKey,null),z=M(se=>{n.onModeChange("chat"),H(Ce=>({rowId:se,nonce:(Ce?.nonce??0)+1}))},[n,H]),_=M(()=>H(null),[H]),Q=N(null);_2(Q);let{t:D}=de(),O=N(a.api);O.current=a.api;let re=M(se=>O.current.notify.warning(D(`timeline.quote.${se}`)),[D]),U=M(()=>O.current.notify.warning(D("forkRelations.messageMissing")),[D]),[ne,X]=vt("timeline-quote-reveal",t.threadKey,null);$(()=>{let se=Q.current;if(!se)return;let Ce=xe=>{let Le=xe.detail?.quote;if(Le){if(Le.environmentId!==T.environmentId||Le.threadId!==T.threadId){re("otherThread");return}n.onModeChange("chat"),X({quote:Le})}};return se.addEventListener(vp,Ce),()=>se.removeEventListener(vp,Ce)},[n,X,T.environmentId,T.threadId,re]);let q=M(se=>{X(null),se==="message-missing"&&re("messageMissing"),se==="passage-missing"&&re("passageMissing")},[X,re]),V=K(()=>({data:s,target:T,threadKey:t.threadKey}),[s,T,t.threadKey]),{controlRef:Z,...ae}=o,ee=s.useChatWindow({target:T,threadKey:t.threadKey,visible:t.visible&&n.mode==="chat"}),oe=eP({inputKey:t.threadKey,visible:t.visible,endInset:o.contentInsetEndAdjustment,derive:e.derive,onReturnToLatest:ee.onReturnToLatest,controlRef:Z});return c(D2,{slots:a.slots,data:s,target:T,children:x("div",{ref:Q,className:j("relative flex min-h-0 min-w-0 flex-1 flex-col",e.scopeClass),"data-conversation-surface":!0,children:[s.useMessageReveal?c(JY,{read:s.useMessageReveal,target:T,onChange:A,active:t.active&&t.visible,onModeChange:n.onModeChange},t.threadKey):null,c(ZY,{data:s,target:T,threadKey:t.threadKey,environmentId:t.environmentId,threadId:t.threadId,slots:a.slots}),c(qI,{data:s,target:T,threadKey:t.threadKey,surfaceRef:Q}),c(kI,{chat:x(Ad,{section:"chat",resetKey:t.threadKey,children:[c(j0,{data:s,target:T,visible:t.visible,...ae,paneActive:t.active,liveFollowEnabled:oe.liveFollowEnabled,scrollerRef:oe.bindTimelineHandle,onRowsChange:oe.onRowsChange,onIsAtEndChange:oe.onIsAtEndChange,onManualNavigation:oe.onManualNavigation,onDisclosureNavigation:oe.onDisclosureNavigation,loadEarlier:ee.loadEarlier,loadLater:ee.loadLater,pagingBlockedByInteraction:ee.pagingBlockedByInteraction,restoringHistory:ee.restoringHistory??!1,onVisibleTurnRangeChange:ee.onVisibleTurnRangeChange,onReturnToLatest:ee.loadLater===null?null:oe.returnToEnd,onTurnNavigatorChange:i,revealMessageRequest:F,messageReveal:t.active?R:null,onMessageRevealMissing:U,revealQuoteRequest:ne,onRevealQuoteDone:q,onRevealMessageHandled:_}),c(Y0,{data:s,target:T,bottomInset:o.contentInsetEndAdjustment,showScrollToEnd:oe.showScrollToEnd,onScrollToEnd:oe.returnToEnd})]},"chat"),mode:n.mode,trajectory:c(Ad,{section:"trajectory",resetKey:t.threadKey,children:c(uP,{data:s,target:T,inputKey:t.threadKey,paneVisible:t.visible&&n.mode==="trajectory",timestampFormat:r.timestampFormat,onOpenInChat:z,onOpenFileDiff:o.onOpenFileDiff})},"trajectory"),visible:t.visible}),c(y_,{api:a.api,data:s,draftId:a.draftId,target:T,threadKey:t.threadKey,belowSlot:a.belowSlot,composer:c(Ad,{section:"composer",resetKey:t.threadKey,children:c(Ef,{value:V,children:c(R2,{children:c(YY,{slots:a.slots,children:P})})})}),draftHero:a.draftHero,slots:a.slots,environmentId:t.environmentId,threadId:t.threadId,onOverlayElementChange:a.onOverlayElementChange,questions:c(Ad,{section:"composer",resetKey:t.threadKey,children:c(s_,{data:s,target:T})}),queue:c(Ad,{section:"queue",resetKey:t.threadKey,children:c(a_,{data:s,target:T,inputKey:t.threadKey,attachments:e.attachments})})})]})})}function JY({read:e,target:t,onChange:n,active:o,onModeChange:r}){let a=e(t);return $(()=>{n(a)},[a,n]),$(()=>()=>n(null),[n]),$(()=>{o&&a.request&&r("chat")},[o,a.request,r]),null}function ZY(e){let n=e.data.useComposerStatus({target:e.target,threadKey:e.threadKey}).activeThread?.presetId??null;return c("div",{className:"max-h-[min(280px,36vh)] min-h-0 shrink overflow-y-auto empty:hidden","data-conversation-views":!0,children:e.slots?.renderSlot("conversation.view",{environmentId:e.environmentId,threadId:e.threadId,presetId:n})},e.threadKey)}W();W();function lS(e){return e.turnOutline??e.turns.map((t,n)=>({messageId:t.messageId,ordinal:Math.max(e.turnCount,e.turns.length)-e.turns.length+n+1,...t.error!==null?{failed:!0}:{},...n===e.turns.length-1&&e.status==="waiting"?{waiting:!0}:{}}))}function F2(e,t,n){let o=lS(e),r=[],a=[],s=()=>{if(a.length>=3)r.push({kind:"group",turns:a});else for(let i of a)r.push({kind:"turn",turn:i});a=[]};return o.forEach((i,l)=>{l===0||l===o.length-1||i.failed||i.waiting||i.forkSource||t.has(i.messageId)||n.has(`${e.threadId}:${i.messageId}`)?(s(),r.push({kind:"turn",turn:i})):a.push(i)}),s(),r}var Ar=264,Jr=136,yh=20,B2=16,z2=16,eX=(Ar+yh)/3,tX=Ar/2,nX={cards:[],edges:[],ticks:[],width:0,height:0};function dS(e){return`${e}:thread`}function Ch(e,t){return`${e}:turn:${t}`}function H2(e){if(e.threads.length===0)return nX;let t=[...e.threads].sort((y,b)=>y.createdAt.localeCompare(b.createdAt)||y.threadId.localeCompare(b.threadId)),n=new Map,o=[],r=0,a=null;t.forEach((y,b)=>{let w=e.dayOf(y.createdAt);if(b>0&&(r+=eX+(w===a?0:tX)),w!==a){let S=t[b-1],I=S===void 0?0:Date.parse(y.createdAt)-Date.parse(S.createdAt);o.push({x:r,at:y.createdAt,...I>864e5?{gapDays:Math.floor(I/864e5)}:{}})}a=w,n.set(y.threadId,r)});let s=new Map(t.map(y=>[y.threadId,y])),i=new Map;for(let y of t){if(y.forkedFrom===null)continue;let b=i.get(y.forkedFrom.sourceThreadId)??new Set;b.add(y.forkedFrom.sourceMessageId),i.set(y.forkedFrom.sourceThreadId,b)}let l=new Map(t.map(y=>[y.threadId,F2(y,i.get(y.threadId)??new Set,e.revealed??new Set)])),d=new Map,u=[],p=new Map,f=0,m=[];for(let y of t){let b=n.get(y.threadId)??0,w=oX(y,e.expanded,l.get(y.threadId)??[]),S=y.forkedFrom===null?void 0:s.get(y.forkedFrom.sourceThreadId),I=S!==void 0?d.get(S.threadId):void 0,k=I===void 0?0:I+1;for(;k<m.length&&(m[k]??0)+yh>b;)k+=1;m[k]=b+w,d.set(y.threadId,k),f=Math.max(f,b+w)}let g=Math.max(1,m.length),h=z2*2+g*Jr+(g-1)*B2;for(let y of t){let b=z2+(d.get(y.threadId)??0)*(Jr+B2),w=n.get(y.threadId)??0,S=rX(y,e.expanded,l.get(y.threadId)??[],w,b);u.push(...S),S[0]!==void 0&&p.set(y.threadId,S[0])}let v=[],C=new Map(u.map(y=>[y.id,y]));for(let y of t){let b=y.forkedFrom,w=p.get(y.threadId);if(b===null||w===void 0)continue;let S=C.get(Ch(b.sourceThreadId,b.sourceMessageId))??p.get(b.sourceThreadId);S!==void 0&&v.push({id:`${S.id}->${w.id}`,path:aX(S,w),sourceThreadId:b.sourceThreadId,childThreadId:y.threadId})}return{cards:u,edges:v,ticks:o,width:f,height:h}}function U2(e,t){return t.has(e.threadId)&&lS(e).length>0}function oX(e,t,n){let o=U2(e,t)?n.length:1;return o*Ar+(o-1)*yh}function rX(e,t,n,o,r){return U2(e,t)?n.map((a,s)=>{let i=a.kind==="turn"?a.turn:a.turns[0];if(i===void 0)throw new Error("Empty turn group");return{id:a.kind==="group"?`${e.threadId}:group:${i.messageId}`:Ch(e.threadId,i.messageId),kind:a.kind,threadId:e.threadId,turnIndex:i.ordinal-1,messageId:i.messageId,...a.kind==="group"?{groupedMessageIds:a.turns.map(l=>l.messageId)}:{},x:o+s*(Ar+yh),y:r}}):[{id:dS(e.threadId),kind:"thread",threadId:e.threadId,turnIndex:-1,x:o,y:r}]}function aX(e,t){let n=e.x+Ar/2,o=e.y+Jr,r=t.x,a=t.y+Jr/2,s=Math.max(24,(a-o)/2);return`M ${n} ${o} C ${n} ${o+s}, ${r-s} ${a}, ${r} ${a}`}function K2(e,t,n,o=240){if(n.width===0||n.height===0)return!1;let r=e.x*t.scale+t.x,a=e.y*t.scale+t.y;return r+Ar*t.scale>=-o&&a+Jr*t.scale>=-o&&r<=n.width+o&&a<=n.height+o}var Nr=24;function cp(e){return{left:0,top:36}}function cS(e,t,n=1){let o=cp(t),r=t.width-o.left-Nr*2,a=e.cards.at(-1),s=a===void 0?e.width:a.x+Ar,i=s*n<=r?o.left+Nr:t.width-Nr-s*n,l=Math.min(o.top+Nr/2,t.height-Nr-(a===void 0?0:a.y+Jr)*n);return{x:i,y:l,scale:n}}function q2(e,t,n){return{...e,x:e.x+(n.width-t.width)/2,y:e.y+(n.height-t.height)/2}}function V2(e,t){let n=cp(t);if(e.width===0||t.width===0)return{x:n.left+Nr,y:n.top+Nr/2,scale:1};let o=Y2(Math.min((t.width-n.left-Nr*2)/e.width,(t.height-n.top-Nr*2)/Math.max(1,e.height)),.25,1);return{x:n.left+Nr,y:n.top+Nr/2,scale:o}}function W2(e,t,n){let o=cp(n),r=o.left+(n.width-o.left)/2,a=o.top+(n.height-o.top)/2;return{scale:t.scale,x:r-(e.x+Ar/2)*t.scale,y:a-(e.y+Jr/2)*t.scale}}function xh(e,t,n){let o=Y2(e.scale*t,.25,4),r=(n.x-e.x)/e.scale,a=(n.y-e.y)/e.scale;return{scale:o,x:n.x-r*o,y:n.y-a*o}}function G2(e){return e.ctrlKey||e.metaKey}function j2(e,t,n=48){switch(t){case"ArrowLeft":return{...e,x:e.x+n};case"ArrowRight":return{...e,x:e.x-n};case"ArrowUp":return{...e,y:e.y+n};case"ArrowDown":return{...e,y:e.y-n};default:return null}}function uS(e,t){return t?e<=.55:e<.5}function Q2(e,t,n){return{...e,x:e.x+(t.x-n.x)*e.scale,y:e.y+(t.y-n.y)*e.scale}}function Y2(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}W();function pS(e){return e.archived?"map.status.archived":iX[e.status]}var iX={running:"map.status.running",waiting:"map.status.waiting",failed:"map.status.failed",done:"map.status.done"};function lX(e){return e===void 0?"":(e.answer||e.error||e.question).trim()}var X2=le(function(t){let{t:n,thread:o}=t,r=t.formatTitle?.(o.title)??o.title,a=lX(o.turns.at(-1)),s=o.loaded?o.turns.length>0:o.turnCount>0;return x("article",{className:"session-map-card","data-status":o.archived?"archived":o.status,"data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":r||n("settings.hiddenUntitled"),style:{left:t.card.x,top:t.card.y},onPointerDown:i=>i.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:i=>{i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),t.onSelect(o.threadId)))},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:r||n("settings.hiddenUntitled")})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,x("p",{className:"session-map-meta",children:[c("span",{className:"session-map-status",children:n(pS(o))}),o.loaded?c("span",{children:n("map.turns",{count:o.turnCount})}):null,c("span",{children:t.updatedLabel})]}),o.loaded?c("p",{className:"session-map-preview",children:a||n("map.noReply")}):c("p",{className:"session-map-preview","data-pending":"","aria-hidden":!0}),x("footer",{onClick:i=>i.stopPropagation(),children:[s?c(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onExpand(t.card),children:n("map.expand")}):null,c(J,{type:"button",size:"xs",variant:"outline",onClick:()=>t.onOpen(o.threadId),children:n("map.open")}),x(Me,{children:[c(Ne,{render:c(J,{type:"button",size:"icon-xs",variant:"ghost","aria-label":n("map.hide"),onClick:()=>t.onHide(o.threadId)}),children:c(Yd,{})}),c(Ae,{side:"top",children:n("map.hide")})]})]})]})}),J2=le(function(t){let{t:n,thread:o,card:r}=t,a=t.formatTitle?.(o.title)??o.title,s=o.turns.find(u=>u.messageId===r.messageId),i=o.turnOutline?.find(u=>u.messageId===r.messageId),l=r.turnIndex+1,d=(s?.answer||s?.error||"").trim();return x("article",{className:"session-map-card","data-turn":"","data-status":o.archived?"archived":i?.failed?"failed":i?.waiting?"waiting":l===o.turnCount?o.status:"done","data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":n("map.turnLabel",{index:l,title:a}),style:{left:r.x,top:r.y},onPointerDown:u=>u.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onSelect(o.threadId)))},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-ordinal",children:n("map.turnOrdinal",{index:l})}),x("strong",{children:[c("span",{className:"session-map-turn-question",children:s?.question||n(s===void 0?"map.loading":"map.noQuestion")}),c("span",{className:"session-map-compact-title",children:a||n("settings.hiddenUntitled")})]})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,c("p",{className:"session-map-preview","data-error":s?.error!=null&&s.answer.length===0?"":void 0,"data-pending":s===void 0?"":void 0,children:s===void 0?null:d||n("map.noReply")}),x("footer",{onClick:u=>u.stopPropagation(),children:[r.turnIndex===0?c(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onCollapse(r),children:n("map.collapse")}):null,x(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>{r.messageId!==void 0&&t.onFork(o.threadId,r.messageId)},children:[c(rc,{}),n("map.fork")]})]})]})}),Z2=le(function(t){return x("article",{className:"session-map-card session-map-group",tabIndex:0,"aria-label":t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0}),onClick:()=>t.onReveal(t.card),onKeyDown:n=>{n.target===n.currentTarget&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onReveal(t.card))},"data-status":t.thread.archived?"archived":"done","data-dimmed":t.dimmed?"":void 0,"data-selected":t.selected?"":void 0,onPointerDown:n=>n.stopPropagation(),onPointerEnter:()=>t.onHover(t.thread.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(t.thread.threadId),onBlur:()=>t.onHover(null),style:{left:t.card.x,top:t.card.y},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:(t.formatTitle?.(t.thread.title)??t.thread.title)||t.t("settings.hiddenUntitled")})]}),c(J,{type:"button",size:"sm",variant:"ghost",onClick:n=>{n.stopPropagation(),t.onReveal(t.card)},children:t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0})})]})});function eB({text:e}){return e.length===0?null:c(Zn,{className:"session-map-md",text:e})}var dX=3;function tB(e){let{t,thread:n}=e,o=e.formatTitle?.(n.title)??n.title,a=(e.fuller??n).turns.slice(-dX);return x("aside",{className:"session-map-panel","aria-label":o||t("settings.hiddenUntitled"),children:[x("header",{children:[c("strong",{children:o||t("settings.hiddenUntitled")}),c(J,{type:"button",size:"icon-xs",variant:"ghost","aria-label":t("map.closePanel"),onClick:e.onClose,children:c(Ht,{})})]}),x("p",{className:"session-map-meta","data-status":n.archived?"archived":n.status,children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-status",children:t(pS(n))})]}),x("p",{className:"session-map-meta",children:[c("span",{children:t("map.created",{time:e.formatTime(n.createdAt)})}),c("span",{children:t("map.updated",{time:e.formatTime(n.updatedAt)})}),n.loaded?c("span",{children:t("map.turns",{count:n.turnCount})}):null]}),c(J,{type:"button",size:"sm",onClick:()=>e.onOpen(n.threadId),children:t("map.open")}),c("h3",{children:t("map.recent")}),e.notice!==null?c(Za,{title:e.notice}):null,!n.loaded&&e.fuller===null?c(Hr,{"aria-label":t("map.loading")}):a.length===0?c(Za,{title:t("map.noTurns")}):c("ol",{className:"session-map-turns",children:a.map(s=>x("li",{children:[c("p",{className:"session-map-question",children:s.question}),s.answer.length>0?c(eB,{text:s.answer}):s.error!==null?c("p",{className:"session-map-error",children:s.error}):c("p",{className:"session-map-muted",children:t("map.noReply")}),s.answerTruncated||s.questionTruncated?c("p",{className:"session-map-muted",children:t("map.truncated")}):null]},s.messageId))})]})}W();function nB(e){let t=new Map,n=new Map;for(let o of e){if(o.forkedFrom===null)continue;let r=o.forkedFrom.sourceThreadId;t.set(o.threadId,r);let a=n.get(r)??new Set;a.add(o.threadId),n.set(r,a)}return{count:o=>n.get(o)?.size??0,family:o=>{if(o===null)return new Set;let r=t.get(o);return new Set([o,...r===void 0?[]:[r],...n.get(o)??[]])}}}function oB(e,t,n,o,r){return t!==null&&!n.has(e)||o&&!r.has(e)}function rB(e,t,n){if(e.ticks.length===0)return[];let o=0;for(let s=1;s<e.ticks.length&&!(e.ticks[s].x*t.scale+t.x>0);s+=1)o=s;let r=e.ticks[o],a=e.ticks[o+1];return[{...r,gapDays:void 0,sticky:!0,left:Math.min(0,a===void 0?0:a.x*t.scale+t.x-112)},...e.ticks.slice(o+1).flatMap(s=>{let i=s.x*t.scale+t.x;return i<=n.width?[{...s,sticky:!1,left:i}]:[]})]}function aB(e){let t=N(null),n=N(null),o=N(!1),[r,a]=G(null),s=K(()=>nB(Array.from(e.threads.values())),[e.threads]),i=K(()=>s.family(e.selectedThreadId),[s,e.selectedThreadId]),l=N(e.camera),d=N(e.onCamera),u=N(e.onFrame);l.current=e.camera,d.current=e.onCamera,u.current=e.onFrame;let p=N(()=>{}),f=N(null);$(()=>{let S=t.current;if(S===null)return;let I=null,k=0,P=()=>{k=0;let R=I;I=null,R!==null&&d.current(R)},T=R=>{l.current=R,I=R;let F=n.current;F!==null&&(F.style.transform=fS(R),F.style.setProperty("--map-scale",String(R.scale)),o.current=uS(R.scale,o.current),F.toggleAttribute("data-compact",o.current)),k===0&&(k=window.requestAnimationFrame(P))};p.current=T;let L=R=>{R.preventDefault();let F=l.current;if(!G2(R)){T({...F,x:F.x-R.deltaX,y:F.y-R.deltaY});return}let H=S.getBoundingClientRect();T(xh(F,R.deltaY<0?1.08:.92,{x:R.clientX-H.left,y:R.clientY-H.top}))},E=()=>u.current({width:S.clientWidth,height:S.clientHeight});E();let A=new ResizeObserver(E);return A.observe(S),S.addEventListener("wheel",L,{passive:!1}),()=>{A.disconnect(),S.removeEventListener("wheel",L),k!==0&&window.cancelAnimationFrame(k)}},[]),$(()=>{if(f.current!==null)return;let S=n.current;S!==null&&(S.style.transform=fS(e.camera),S.style.setProperty("--map-scale",String(e.camera.scale)),o.current=uS(e.camera.scale,o.current),S.toggleAttribute("data-compact",o.current))},[e.camera]);let m=K(()=>e.layout.cards.filter(S=>K2(S,e.camera,e.frame)),[e.layout,e.camera,e.frame]),g=K(()=>{let S=new Set;for(let I of m)e.threads.get(I.threadId)?.loaded===!1&&S.add(I.threadId);return[...S].sort().join(`
|
|
3836
|
+
`)[0]}),c("div",{className:"flex min-w-0 flex-wrap items-center gap-1 pt-0.5",children:i.options.map(p=>c(J,{size:"xs",variant:p.tone==="primary"?"default":p.tone==="danger"?"destructive":"outline",disabled:a,onClick:()=>{s(!0),t.onRespond(l,p.id)},children:d(p.label)},p.id))})]})});function KY(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function iS(e,t){if(t?.attachmentsBlocked)return null;let n=KY(t?.customAnswer);if(e.allowFreeform!==!1&&n)return n;let o=zx(e,t?.selectedOptionLabels),r=e.allowFreeform!==!1&&(t?.attachmentCount??0)>0;return e.multiSelect?o.length>0?o:r?"":null:o[0]??(r?"":null)}function $Y(e,t){let n={};for(let o of e){let r=iS(o,t[o.id]);if(r===null)return null;n[o.id]=r}return n}function qY(e,t){return e.reduce((n,o)=>iS(o,t[o.id])!==null?n+1:n,0)}function h2(e,t,n){let o=e.length===0?0:Math.max(0,Math.min(n,e.length-1)),r=e[o]??null,a=r?t[r.id]:void 0,s=r?iS(r,a):null,i=r?.allowFreeform===!1?"":a?.customAnswer??"",l=qY(e,t),d=e.length===0?!0:o>=e.length-1;return{questionIndex:o,activeQuestion:r,activeDraft:a,selectedOptionLabels:r?zx(r,a?.selectedOptionLabels):[],customAnswer:i,resolvedAnswer:s,usingCustomAnswer:i.trim().length>0,answeredQuestionCount:l,isLastQuestion:d,isComplete:$Y(e,t)!==null,canAdvance:s!==null}}var VY={approve:{label:"pendingUserInput.planApprove",description:"pendingUserInput.planApproveHint"},revise:{label:"pendingUserInput.planRevise",description:"pendingUserInput.planReviseHint"},stop:{label:"pendingUserInput.planStop",description:"pendingUserInput.planStopHint"}};function v2(e,t,n){let o=t.kind==="plan"&&n.planAction!==void 0?VY[n.planAction]:void 0;return o===void 0?{label:n.label,description:n.description??""}:{label:e(o.label),description:e(o.description)}}W();var y2=le(function({pendingUserInputs:t,respondingRequestIds:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s}){if(t.length===0)return null;let i=t[0];return i?c(WY,{prompt:i,isResponding:n.includes(i.requestId),answers:o,questionIndex:r,onToggleOption:a,onAdvance:s},i.requestId):null}),WY=le(function({prompt:t,isResponding:n,answers:o,questionIndex:r,onToggleOption:a,onAdvance:s}){let{t:i}=de(),l=_t(),d=h2(t.questions,o,r),u=d.activeQuestion,p=N(null),f=N(s),[m,g]=G(null),[h,v]=G(null),C=h!==null&&h===u?.id;$(()=>{f.current=s},[s]),$(()=>{if(!(!u||u.multiSelect||!m)){if(m.questionId!==u.id){g(null);return}d.customAnswer.trim().length===0&&d.selectedOptionLabels.includes(m.optionLabel)&&g(null)}},[u,m,d.customAnswer,d.selectedOptionLabels]),$(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);let y=M((I,k)=>{if(u?.multiSelect){a(I,k);return}g({questionId:I,optionLabel:k}),a(I,k),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{p.current=null,f.current()},200)},[u,a]);if(l.pane.useKeydown(I=>{if(!u||n||C||I.metaKey||I.ctrlKey||I.altKey||I.isComposing||I.keyCode===229||rs(I.target))return;let k=xv(I.key,u.options.length);if(k===null)return;let P=u.options[k];P&&(I.preventDefault(),y(u.id,Cd(P)))},{target:"document"}),!u)return null;let b=d.customAnswer.trim().length>0,w=m?.questionId===u.id?m.optionLabel:null,S=w!==null?[w]:b?[]:d.selectedOptionLabels;return x(Dp,{state:"pending",className:"px-3 py-2 sm:px-4",title:u.header,meta:t.questions.length>1?`${r+1}/${t.questions.length}`:void 0,collapse:{collapsed:C,onCollapsedChange:I=>{v(I?u.id:null)},hint:u.question,toggleLabel:i(C?"pendingUserInput.showQuestion":"pendingUserInput.hideQuestion")},children:[c("div",{className:"max-h-[min(45vh,28rem)] overflow-y-auto overscroll-contain break-words text-chat text-foreground","data-pending-user-input-body":u.kind??"question",tabIndex:0,children:u.kind==="plan"?c(Zn,{text:u.question,cwd:void 0,isStreaming:!1}):c("p",{className:"whitespace-pre-wrap font-medium",children:u.question})}),u.multiSelect?c("p",{className:"text-chat-row text-muted-foreground",children:i("pendingUserInput.selectOneOrMore")}):null,c(gI,{mode:u.multiSelect?"multiple":"single","aria-label":u.header,disabled:n,selected:S,onToggle:I=>{y(u.id,I)},onReselect:I=>{y(u.id,I)},options:u.options.map((I,k)=>{let P=v2(i,u,I);return{value:Cd(I),label:P.label,...P.description&&P.description!==P.label?{description:P.description}:{},...k<9?{trailing:c(ul,{children:k+1})}:{}}})},u.id)]})});W();var C2=le(function({planTitle:t}){let{t:n}=de();return c("div",{className:"px-3 py-2 sm:px-4",children:x("div",{className:"flex flex-wrap items-center gap-2",children:[c("span",{className:"text-xs font-medium text-muted-foreground",children:n("plan.ready")}),t?c("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground/85",children:t}):null]})})});function x2(e){if(e.occupant.kind!=="approval")return null;let{approval:t}=e.occupant;return c(NF,{requestId:t.requestId,isResponding:e.respondingRequestIds.includes(t.requestId),options:t.options,keybindings:e.keybindings,declineReasonRelay:t.declineReasonRelay,onRespondToApproval:e.onRespondToApproval})}function b2(e){return e.occupant.kind!=="user-input"?null:c(y2,{pendingUserInputs:[e.occupant.userInput],respondingRequestIds:e.respondingRequestIds,answers:e.activePendingDraftAnswers,questionIndex:e.activePendingQuestionIndex,onToggleOption:e.onSelectActivePendingUserInputOption,onAdvance:e.onAdvanceActivePendingUserInput})}var S2={approval:{expanded:e=>e.occupant.kind!=="approval"?null:c(aS,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:x2(e),className:"px-3 py-2 sm:px-4"}),collapsed:e=>e.occupant.kind!=="approval"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(aS,{approval:e.occupant.approval,pendingCount:e.occupant.pendingCount,actions:x2(e),className:"px-3 pt-2 pb-3 sm:px-4"})})},decision:{expanded:e=>e.occupant.kind!=="decision"?null:c(sS,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision}),collapsed:e=>e.occupant.kind!=="decision"?null:c("div",{"data-chat-composer-collapsed-controls":"true",children:c(sS,{decision:e.occupant.decision.card,onRespond:e.onRespondToDecision,className:"pt-2 pb-3"})})},"user-input":{expanded:b2,collapsed:e=>x("div",{"data-chat-composer-collapsed-controls":"true",children:[b2(e),e.collapsedPendingRow]})},"plan-follow-up":{expanded:e=>e.activeProposedPlan===null?null:c(C2,{planTitle:AF(e.activeProposedPlan.planMarkdown)??null},e.activeProposedPlan.id),collapsed:null}};function I2(e,t){let n=S2[e.occupant.kind],o=t?n.collapsed:n.expanded;return o===null?null:o(e)}var SNe=Object.keys(S2);function w2(e){let{composerOccupant:t,showComposerTopDrawer:n,hasBlockingComposerTopDrawer:o,isTasksDrawerOpen:r,isComposerCollapsedMobile:a,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,badges:y,pendingPrimaryAction:b,isSendBusy:w,sendDisabledReason:S,environmentUnavailable:I,noProviderAvailable:k,projectSelectionRequired:P,previousUserInputQuestion:T,handleInterruptPrimaryAction:L,handleImplementPlanInNewThreadPrimaryAction:E}=e,{inlineTasksBadge:A,inlineStashBadge:R,visibleTasksProgress:F,visibleTaskSteps:H,dismissTasks:z,toggleTasksDrawer:_}=y;return x(ge,{children:[n&&(!r||o)?c("div",{className:"chat-composer-top-drawer","data-chat-composer-top-drawer":"true","data-variant":t?.kind==="approval"?"warning":"info","data-occupant":t?.kind??"none",children:t===null?null:I2({occupant:t,respondingRequestIds:s,keybindings:i,onRespondToApproval:l,onRespondToDecision:d,activePendingDraftAnswers:u,activePendingQuestionIndex:p,onSelectActivePendingUserInputOption:f,onAdvanceActivePendingUserInput:m,activeProposedPlan:g,collapsedPendingRow:c(MF,{activePendingProgress:h,isPendingUserInputChoiceOnly:v,expandMobileComposer:C,inlineTasksBadge:A,inlineStashBadge:R,pendingPrimaryAction:b,isSendBusy:w,sendDisabledReason:S,isEnvironmentUnavailable:I!==null||k||P,onPreviousActivePendingUserInputQuestion:T,handleInterruptPrimaryAction:L,handleImplementPlanInNewThreadPrimaryAction:E})},a)}):null,r&&!o&&F&&H?c(eD,{onDismiss:z,onCollapse:_,progress:F,steps:H}):null]})}function T2(e,t){return{images:e.images,terminalContexts:e.terminalContexts,elementContexts:e.elementContexts,previewAnnotations:e.previewAnnotations,reviewComments:e.reviewComments,nonPersistedImageIds:e.nonPersistedImageIds,activeProvider:e.activeProvider,nativeModeByProvider:e.nativeModeByProvider,selectedPluginActionKey:e.selectedPluginActionKey,promptHasText:e.prompt.trim().length>0,hasSendableContent:t({prompt:e.prompt,imageCount:e.images.length,terminalContexts:e.terminalContexts,elementContextCount:e.elementContexts.length+e.previewAnnotations.length+e.reviewComments.length}).hasSendableContent}}function P2(e){let t=e.draft.useStore;return{setComposerDraftPrompt:t(n=>n.setPrompt),setComposerDraftNativeMode:t(n=>n.setNativeMode),addComposerDraftImage:t(n=>n.addImage),addComposerDraftImages:t(n=>n.addImages),removeComposerDraftImage:t(n=>n.removeImage),insertComposerDraftTerminalContext:t(n=>n.insertTerminalContext),removeComposerDraftElementContext:t(n=>n.removeElementContext),removeComposerDraftPreviewAnnotation:t(n=>n.removePreviewAnnotation),removeComposerDraftReviewComment:t(n=>n.removeReviewComment),clearComposerDraftPromptAndImages:t(n=>n.clearComposerPromptAndImages)}}W();function k2(e){let{onComposerPaste:t,submitComposer:n,exitShellCommandMode:o}=e,r=N({onComposerPaste:t,submitComposer:n,exitShellCommandMode:o});r.current={onComposerPaste:t,submitComposer:n,exitShellCommandMode:o};let a=M(l=>{r.current.onComposerPaste(l)},[]),s=M((l,d)=>{r.current.submitComposer(l,d)},[]),i=M(()=>r.current.exitShellCommandMode(),[]);return{handleComposerPaste:a,handleComposerSubmit:s,handleUnclaimedEscape:i}}W();var L2=ut(null);function R2({children:e}){let{data:t,target:n,threadKey:o}=Yo(),r=t.useComposerStatus({target:n,threadKey:o});return c(L2.Provider,{value:r,children:e})}function E2(){let e=Nt(L2);if(e===null)throw new Error("Composer status has not been provided.");return e}var M2=le(function(t){let n=f_(),{data:o,target:r,threadKey:a}=Yo(),{activePendingApproval:s,pendingUserInputs:i,activePendingProgress:l,activePendingResolvedAnswers:d,activePendingIsResponding:u,activePendingDraftAnswers:p,activePendingQuestionIndex:f,questionAttachmentsSupported:m,respondingRequestIds:g,occupants:h,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,changeUserInputCustomAnswer:b,advanceUserInput:w,previousUserInputQuestion:S}=o.useComposerPending({target:r,threadKey:a}),{runtimeMode:I,interactionMode:k,lockedProvider:P,providerStatuses:T,activeProjectDefaultModelSelection:L,projectId:E,activeThreadModelSelection:A}=o.useComposerModelContext(r),{activeThreadId:R,activeThread:F,isLocalDraftThread:H,projectSelectionRequired:z,phase:_,isSendBusy:Q,sendDisabledReason:D,unavailableAgentInstanceId:O=null,noAgentChosen:re=!1,isPreparingWorktree:U,worktreeSetup:ne=null,environmentUnavailable:X,compactDisabled:q,compactDisabledReason:V}=E2(),{t:Z}=de(),{composerDraftTarget:ae,environmentId:ee,attachmentUploadsCapabilityKnown:oe,supportsAttachmentUploads:se,routeKind:Ce,routeThreadRef:xe,draftId:Le,forceExpandedOnMobile:tt,settings:je,keybindings:he,terminalOpen:Re,gitCwd:ve,promptRef:Pe,composerRef:ce,composerImagesRef:Y,composerTerminalContextsRef:ye,composerElementContextsRef:fe,sendContextRef:Ve,onSend:We,onInterrupt:nt,interruptArmed:ot=!1,stopping:dt=!1,onCompactContext:Xt,onImplementPlanInNewThread:$t,onProviderInstanceSelect:Et,onModelSelectionChosen:ie,handleRuntimeModeChange:Se,handleInteractionModeChange:ke,handleNativeModeChange:_e,focusComposer:Tt,setThreadError:Pt}=t,zn=o.useComposerPlan(r),It=zn.proposedPlan,rn=zn.tasksProgress,Ct=zn.taskSteps,kt=i.length===0&&k==="plan"&&It!==null,Lt=N(null),{pendingPrimaryAction:Ft,onSelectActivePendingUserInputOption:tn,onRespondToApproval:wt,onRespondToComposerDecision:an,onAdvanceActivePendingUserInput:Jt}=V_({t:Z,threadId:r.threadId,setThreadError:Pt,promptRef:Pe,promptInputRef:Lt,respondToApproval:v,respondToDecision:C,selectUserInputOption:y,advanceUserInput:w,activePendingProgress:l,activePendingIsResponding:u,activePendingResolvedAnswers:d}),rt=t.api,{limits:Wt}=t.attachments,Te=rt.draft.useThreadDraftSelector(ae,Mo=>T2(Mo,rt.chat.deriveComposerSendState)),$e=i[0]??null,{questionAttachmentTarget:ct,attachmentTarget:at,attachmentDocumentKey:ft}=H_({supported:m,attachments:t.attachments,environmentId:ee,threadId:R,requestId:$e?.requestId??null,question:l?.activeQuestion??null,responding:u,composerDraftTarget:ae}),xt=rt.draft.useThreadDraftSelector(at,z_),Mt=xt.images,Gt=Te.terminalContexts,gn=Te.elementContexts,Xn=Te.previewAnnotations,dn=Te.reviewComments,so=xt.nonPersistedImageIds,Jn=rt.uploads.useStore(Mo=>Mo.uploadsByImageId),io=!oe&&Mt.length>0?Z("attachments.capabilityUnknown"):se?b_({imageIds:Mt.map(Mo=>Mo.id),uploadsByImageId:Jn,environmentId:ee},Z):null,{setComposerDraftPrompt:Ie,setComposerDraftNativeMode:st,addComposerDraftImage:At,addComposerDraftImages:ht,removeComposerDraftImage:hn,insertComposerDraftTerminalContext:In,removeComposerDraftElementContext:sn,removeComposerDraftPreviewAnnotation:nn,removeComposerDraftReviewComment:lo,clearComposerDraftPromptAndImages:on}=P2(rt);$(()=>{if(oe){if(!se){for(let Mo of Mt)rt.uploads.release(Mo.id);return}rt.draft.restoreAttachments();for(let Mo of Mt)rt.uploads.start({environmentId:ee,image:Mo})}},[oe,Mt,ee,se]);let wo=l!==null,_r=wD({api:rt,t:Z,settings:je,composerDraft:Te,composerDraftTarget:ae,environmentId:ee,gitCwd:ve,routeKind:Ce,threadId:r.threadId,activeThread:F,isLocalDraftThread:H,unavailableAgentInstanceId:O,agentNotChosen:re,runtimeMode:I,lockedProvider:P,providerStatuses:T,projectId:E,activeProjectDefaultModelSelection:L,activeThreadModelSelection:A,compactDisabledReason:V,externalSendDisabledReason:D,attachmentBlockReason:io,answeringQuestion:wo,setComposerDraftNativeMode:st,handleNativeModeChange:_e,onProviderInstanceSelect:Et,onModelSelectionChosen:ie}),{selectedInstanceId:Fa,noProviderAvailable:ks,selectedProvider:Ke,composerModelOptions:Ls,selectedModel:Dr,selectedProviderModels:Ba,sendDisabledReason:Wi,isSendDisabled:za,setModelSendBlockShown:To,isModelSendBlocked:Ha}=_r,Vo=x_(ee,ae),[Zr,ea]=G(!1),[Po,ko]=G(null),[Gi,qe]=G(null),[Lo,Rs]=G(!1),[ji,Qi]=G(!1),[Nd,Yi]=G(null),[ta,Ua]=G({key:0,active:!1}),Ro=N(Vo);ue(()=>{Ro.current!==Vo&&(Ro.current=Vo,ea(!1),ko(null),Rs(!1),Qi(!1),Yi(null),Ua({key:ta.key,active:!1}))},[Vo,ta.key]);let Or=Vf("max-sm"),na=N(null),_d=N(null),oa=N(null),Es=N(null),Bt=N(new Map),{isComposerCollapsedMobile:Eo,blurMobileComposerAfterSend:wh,expandMobileComposer:Dd,scheduleComposerCollapseCheck:Th,handleFormFocusCapture:Ms}=q_({isMobileViewport:Or,forceExpandedOnMobile:tt,composerEditorRef:na,composerSurfaceRef:Es,composerFormRef:oa}),Ph=M(()=>{ea(!0)},[]),Xi=M(Mo=>{ke(Mo)},[ke]),Qe=s!==null,zt=l?.activeQuestion?.allowFreeform===!1,vn=h[0]??null,{showTopDrawer:Hn,showCollapsedPromptRow:up,hasBlocking:hS}=C_(vn?.kind??null,Eo),wB=kt||l!==null,{isComposerFooterCompact:TB,isComposerPrimaryActionsCompact:PB}=w_(oa,wB),kB=TD({api:rt,settings:je,routeKind:Ce,routeThreadRef:xe,draftId:Le,selectedProvider:Ke,selectedInstanceId:Fa,selectedModel:Dr,selectedProviderModels:Ba,composerModelOptions:Ls});$(()=>{ko(null)},[gn,Xn,dn,Gt,Dr,_r.selectedModelOptionsForDispatch,Ke]),$_({composerImages:Mt,composerImagesRef:Y,composerTerminalContexts:Gt,composerTerminalContextsRef:ye,composerElementContexts:gn,composerElementContextsRef:fe});let As=X_({api:rt,t:Z,limits:Wt,composerDraftTarget:ae,composerDraft:Te,composerDocumentKey:Vo,promptRef:Pe,promptInputRef:Lt,pendingImageCompressionsRef:Bt,setComposerDraftPrompt:Ie,setModelSendBlockShown:To,onSend:We,onCompactContext:Xt,blurMobileComposerAfterSend:wh,isMobileViewport:Or,isComposerApprovalState:Qe,activePendingApproval:s,activePendingProgress:l,activePendingResolvedAnswers:d,pendingUserInputCount:i.length,activeThreadId:R,phase:_,isSendBusy:Q,environmentUnavailable:X,compactDisabled:q,noProviderAvailable:ks,isSendDisabled:za,sendDisabledReason:Wi,isModelSendBlocked:Ha,showPlanFollowUpPrompt:kt}),Od=O_({api:rt,t:Z,limits:Wt,promptRef:Pe,promptInputRef:Lt,composerEditorRef:na,composerImagesRef:Y,composerDraftTarget:ae,setComposerDraftPrompt:Ie,addComposerDraftImages:ht,clearComposerDraftPromptAndImages:on,setIsStashMenuOpen:Rs,setStashPulse:Ua,isComposerCollapsedMobile:Eo,expandMobileComposer:Dd,keybindings:he,terminalOpen:Re,isComposerModelPickerOpen:Zr,hasPendingUserInputs:i.length>0,isComposerApprovalState:Qe,projectSelectionRequired:z,answeringQuestion:wo}),kh=tD({activeThreadId:R,activeThread:F,activeTasksProgress:rn,activeTaskSteps:Ct,isTasksDrawerOpen:ji,setIsTasksDrawerOpen:Qi,dismissedTasksTurnId:Nd,setDismissedTasksTurnId:Yi,stashQueue:Od.stashQueue,isStashMenuOpen:Lo,stashPulse:ta,toggleInlineStashMenu:Od.toggleInlineStashMenu,isComposerApprovalState:Qe,externalDrawerAttached:n,showComposerTopDrawer:Hn,isComposerCollapsedMobile:Eo,hasBlockingComposerTopDrawer:hS}),LB=M(Mo=>{ko(null),As.revalidatePromptLength(Mo),Rs(!1)},[As.revalidatePromptLength]),{addComposerImages:vS,removeComposerImage:RB,onComposerAttachmentInputChange:EB}=B_({api:rt,t:Z,limits:Wt,setThreadError:Pt,activeThreadId:R,answerQuestionsFirst:i.length>0&&ct===null,attachmentTarget:at,attachmentDocumentKey:ft,supportsAttachmentUploads:se,attachmentUploadsCapabilityKnown:oe,pendingImageCompressionsRef:Bt,addComposerDraftImage:At,addComposerDraftImages:ht,removeComposerDraftImage:hn}),{onComposerPaste:MB,insertComposerTextAtEnd:AB,addDroppedFolders:NB,isDragOverComposer:_B,composerMentionDragHandlers:DB,onComposerMentionDragLeaveCapture:OB}=D_({api:rt,t:Z,addComposerImages:vS,attachments:t.attachments,promptRef:Pe,promptInputRef:Lt,composerEditorRef:na,composerFormRef:oa,composerThreadKey:a,attachmentDocumentKey:ft,attachmentImagesRef:Y,limits:Wt,supportsAttachmentUploads:se,attachmentUploadsCapabilityKnown:oe,composerDocumentKey:Vo,isComposerApprovalState:Qe,pasteBlocked:i.length>0&&ct===null,hasPendingUserInputs:i.length>0,projectSelectionRequired:z,environmentId:ee}),yS=M(()=>{nt()},[nt]),CS=M(()=>{$t()},[$t]),{handleComposerPaste:FB,handleComposerSubmit:BB,handleUnclaimedEscape:zB}=k2({onComposerPaste:MB,submitComposer:As.submitComposerOrShellCommand,exitShellCommandMode:As.exitShellCommandMode});return K_({composerRef:ce,sendContextRef:Ve,api:rt,t:Z,limits:Wt,composerData:o,refs:{composerEditorRef:na,promptInputRef:Lt,promptRef:Pe,composerImagesRef:Y,composerTerminalContextsRef:ye,composerElementContextsRef:fe},composerDraftTarget:ae,activeThread:F,addComposerImages:vS,addDroppedFolders:NB,focusComposer:Tt,insertComposerTextAtEnd:AB,insertComposerDraftTerminalContext:In,composerPreviewAnnotations:Xn,composerReviewComments:dn,isComposerApprovalState:Qe,pendingUserInputCount:i.length,projectSelectionRequired:z,noProviderAvailable:ks,modelState:_r,handleRuntimeModeChange:Se,runtimeMode:I,setIsComposerModelPickerOpen:ea,setProviderInputSubmissionError:ko}),c(EF,{formRef:oa,onSubmit:As.submitComposerOrShellCommand,onFocusCapture:Ms,onBlurCapture:Th,dragHandlers:DB,onDragLeaveCapture:OB,badges:kh,stashQueueLength:Od.stashQueue.length,isStashMenuOpen:Lo,stashPulse:ta,toggleStashMenu:Od.toggleStashMenu,drawers:c(w2,{composerOccupant:vn,showComposerTopDrawer:Hn,hasBlockingComposerTopDrawer:hS,isTasksDrawerOpen:ji,isComposerCollapsedMobile:Eo,respondingRequestIds:g,keybindings:he,onRespondToApproval:wt,onRespondToDecision:an,activePendingDraftAnswers:p,activePendingQuestionIndex:f,onSelectActivePendingUserInputOption:tn,onAdvanceActivePendingUserInput:Jt,activeProposedPlan:It,activePendingProgress:l,isPendingUserInputChoiceOnly:zt,expandMobileComposer:Dd,badges:kh,pendingPrimaryAction:Ft,isSendBusy:Q,sendDisabledReason:Wi,environmentUnavailable:X,noProviderAvailable:ks,projectSelectionRequired:z,previousUserInputQuestion:S,handleInterruptPrimaryAction:yS,handleImplementPlanInNewThreadPrimaryAction:CS}),children:c(RF,{props:t,composerDraft:Te,model:_r,traits:kB,submit:As,stash:Od,badges:kh,uploadsByImageId:Jn,composerImages:Mt,nonPersistedComposerImageIds:so,removeComposerImage:RB,removeComposerDraftPreviewAnnotation:nn,removeComposerDraftReviewComment:lo,removeComposerDraftElementContext:sn,onComposerAttachmentInputChange:EB,surfaceRef:Es,composerAttachmentInputRef:_d,promptInputRef:Lt,composerEditorRef:na,composerMenuAnchor:Gi,setComposerMenuAnchor:qe,composerDocumentKey:Vo,isComposerCollapsedMobile:Eo,expandMobileComposer:Dd,isDragOverComposer:_B,isComposerApprovalState:Qe,showCollapsedMobilePromptRow:up,activePendingProgress:l,pendingUserInputs:i,changeUserInputCustomAnswer:b,pendingPrimaryAction:Ft,approvalDetail:s?.detail??null,handleComposerPaste:FB,handleComposerSubmit:BB,onPromptEdited:LB,handleUnclaimedEscape:zB,openModelPicker:Ph,switchInteractionMode:Xi,providerInputSubmissionError:Po,isStashMenuOpen:Lo,isComposerFooterCompact:TB,isComposerPrimaryActionsCompact:PB,isMobileViewport:Or,isComposerModelPickerOpen:Zr,setIsComposerModelPickerOpen:ea,showPlanFollowUpPrompt:kt,compactDisabled:q,compactThreadContext:As.compactThreadContext,status:{projectSelectionRequired:z,isSendBusy:Q,environmentUnavailable:X,interruptArmed:ot,stopping:dt,agentNotChosen:re,unavailableAgentInstanceId:O,lockedProvider:P,phase:_,isPreparingWorktree:U,worktreeSetup:ne,activeThread:F,interactionMode:k,runtimeMode:I},actions:{previousUserInputQuestion:S,handleInterruptPrimaryAction:yS,handleImplementPlanInNewThreadPrimaryAction:CS}})})});function A2(e){let{composerRef:t,...n}=e;return c(Ig,{value:n.api,children:c(M2,{...n,composerRef:t})})}function Ad({section:e,resetKey:t,children:n}){return c(Tl,{resetKey:t,fallback:o=>GY(e,o),children:n})}function GY(e,t){return c(jY,{section:e,error:t})}function jY({section:e,error:t}){let{t:n}=Ye();return x("div",{role:"status","data-conversation-section-error":e,className:e==="composer"||e==="queue"?"pointer-events-auto mx-auto flex w-full max-w-3xl items-start gap-2 rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm":"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",children:[c(Zt,{"aria-hidden":!0,className:"size-4 shrink-0 text-destructive-foreground"}),x("div",{className:"min-w-0",children:[c("p",{className:"font-medium text-foreground",children:n(`timeline.sectionUnavailable.${e}`)}),c("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:n("timeline.sectionUnavailableHint",{reason:t.message})})]})]})}function N2({hostVersion:e,scopeClass:t}){let{t:n}=Ye();return x("div",{role:"status","data-conversation-host-data-mismatch":!0,className:j("flex min-h-0 min-w-0 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center text-sm",t),children:[c(Zt,{"aria-hidden":!0,className:"size-5 text-destructive-foreground"}),c("p",{className:"font-medium text-foreground",children:n("timeline.hostDataMismatchTitle")}),c("p",{className:"max-w-md text-muted-foreground",children:n("timeline.hostDataMismatchDescription",{host:e??0,plugin:Hd})})]})}W();function _2(e){let t=pn();$(()=>{let n=e.current;if(!n)return;let o=r=>{let a=r.detail?.reference;a&&t.openThread({environmentId:a.environmentId,threadId:a.threadId})};return n.addEventListener(Ji,o),()=>n.removeEventListener(Ji,o)},[t,e])}function D2({data:e,target:t,slots:n,children:o}){return c(MI,{data:e,target:t,children:c(vv,{value:n,children:o})})}function O2(e){let{data:t}=e;return t?.version!==Hd?c(N2,{hostVersion:t?.version??null,scopeClass:e.scopeClass}):c(wp.Provider,{value:e.scope.active,children:c(XY,{...e,data:t})})}var QY=le(function({threadKey:t,onModeChange:n,summaryContext:o}){let[r]=vt("turn-navigator",t,null),a=M(s=>{n("chat"),r?.onSelect(s)},[n,r]);return r===null?null:c(KI,{...r,placement:"inline",onSelect:a,summaryContext:o})});function YY({slots:e,children:t}){let{data:n,target:o,threadKey:r}=Yo(),a=n.useComposerPending({target:o,threadKey:r});return e?.renderSlotChain("conversation.composer",{occupants:a.occupants},t)??t}function XY(e){let{scope:t,mode:n,timeline:o,trajectory:r,composer:a,data:s}=e,[,i]=vt("turn-navigator",t.threadKey,null),l=a.draftHero.active,d=a.sessionActions,u=a.terminalControl,p=a.agentsControl,{mode:f,onModeChange:m}=n,g=K(()=>({data:s,target:{environmentId:t.environmentId,threadId:t.threadId},threadKey:t.threadKey,openTrajectory:()=>m("trajectory"),onOpenFileDiff:o.onOpenFileDiff}),[s,t.environmentId,t.threadId,t.threadKey,m,o.onOpenFileDiff]),h=K(()=>l?x(ge,{children:[d,c("div",{className:"min-w-0 flex-1"}),u]}):x(ge,{children:[d,c(PI,{mode:f,onModeChange:m}),c("div",{className:"min-w-0 flex-1"}),u,p,c(QY,{threadKey:t.threadKey,onModeChange:m,summaryContext:g})]}),[l,d,u,p,f,m,t.threadKey,g]),{belowSlot:v,draftHero:C,onOverlayElementChange:y,sessionActions:b,terminalControl:w,agentsControl:S,contextStrip:I,...k}=a,P=c(A2,{...k,attachments:e.attachments,firstRow:h}),T=K(()=>({environmentId:t.environmentId,threadId:t.threadId}),[t.environmentId,t.threadId]),[L,E]=G(null),A=M(se=>E(se?{key:t.threadKey,value:se}:null),[t.threadKey]),R=L?.key===t.threadKey?L.value:null,[F,H]=vt("trajectory-reveal",t.threadKey,null),z=M(se=>{n.onModeChange("chat"),H(Ce=>({rowId:se,nonce:(Ce?.nonce??0)+1}))},[n,H]),_=M(()=>H(null),[H]),Q=N(null);_2(Q);let{t:D}=de(),O=N(a.api);O.current=a.api;let re=M(se=>O.current.notify.warning(D(`timeline.quote.${se}`)),[D]),U=M(()=>O.current.notify.warning(D("forkRelations.messageMissing")),[D]),[ne,X]=vt("timeline-quote-reveal",t.threadKey,null);$(()=>{let se=Q.current;if(!se)return;let Ce=xe=>{let Le=xe.detail?.quote;if(Le){if(Le.environmentId!==T.environmentId||Le.threadId!==T.threadId){re("otherThread");return}n.onModeChange("chat"),X({quote:Le})}};return se.addEventListener(vp,Ce),()=>se.removeEventListener(vp,Ce)},[n,X,T.environmentId,T.threadId,re]);let q=M(se=>{X(null),se==="message-missing"&&re("messageMissing"),se==="passage-missing"&&re("passageMissing")},[X,re]),V=K(()=>({data:s,target:T,threadKey:t.threadKey}),[s,T,t.threadKey]),{controlRef:Z,...ae}=o,ee=s.useChatWindow({target:T,threadKey:t.threadKey,visible:t.visible&&n.mode==="chat"}),oe=eP({inputKey:t.threadKey,visible:t.visible,endInset:o.contentInsetEndAdjustment,derive:e.derive,onReturnToLatest:ee.onReturnToLatest,controlRef:Z});return c(D2,{slots:a.slots,data:s,target:T,children:x("div",{ref:Q,className:j("relative flex min-h-0 min-w-0 flex-1 flex-col",e.scopeClass),"data-conversation-surface":!0,children:[s.useMessageReveal?c(JY,{read:s.useMessageReveal,target:T,onChange:A,active:t.active&&t.visible,onModeChange:n.onModeChange},t.threadKey):null,c(ZY,{data:s,target:T,threadKey:t.threadKey,environmentId:t.environmentId,threadId:t.threadId,slots:a.slots}),c(qI,{data:s,target:T,threadKey:t.threadKey,surfaceRef:Q}),c(kI,{chat:x(Ad,{section:"chat",resetKey:t.threadKey,children:[c(j0,{data:s,target:T,visible:t.visible,...ae,paneActive:t.active,liveFollowEnabled:oe.liveFollowEnabled,scrollerRef:oe.bindTimelineHandle,onRowsChange:oe.onRowsChange,onIsAtEndChange:oe.onIsAtEndChange,onManualNavigation:oe.onManualNavigation,onDisclosureNavigation:oe.onDisclosureNavigation,loadEarlier:ee.loadEarlier,loadLater:ee.loadLater,pagingBlockedByInteraction:ee.pagingBlockedByInteraction,restoringHistory:ee.restoringHistory??!1,onVisibleTurnRangeChange:ee.onVisibleTurnRangeChange,onReturnToLatest:ee.loadLater===null?null:oe.returnToEnd,onTurnNavigatorChange:i,revealMessageRequest:F,messageReveal:t.active?R:null,onMessageRevealMissing:U,revealQuoteRequest:ne,onRevealQuoteDone:q,onRevealMessageHandled:_}),c(Y0,{data:s,target:T,bottomInset:o.contentInsetEndAdjustment,showScrollToEnd:oe.showScrollToEnd,onScrollToEnd:oe.returnToEnd})]},"chat"),mode:n.mode,trajectory:c(Ad,{section:"trajectory",resetKey:t.threadKey,children:c(uP,{data:s,target:T,inputKey:t.threadKey,paneVisible:t.visible&&n.mode==="trajectory",timestampFormat:r.timestampFormat,onOpenInChat:z,onOpenFileDiff:o.onOpenFileDiff})},"trajectory"),visible:t.visible}),c(y_,{api:a.api,data:s,draftId:a.draftId,target:T,threadKey:t.threadKey,belowSlot:a.belowSlot,composer:c(Ad,{section:"composer",resetKey:t.threadKey,children:c(Ef,{value:V,children:c(R2,{children:c(YY,{slots:a.slots,children:P})})})}),draftHero:a.draftHero,slots:a.slots,environmentId:t.environmentId,threadId:t.threadId,onOverlayElementChange:a.onOverlayElementChange,questions:c(Ad,{section:"composer",resetKey:t.threadKey,children:c(s_,{data:s,target:T})}),queue:c(Ad,{section:"queue",resetKey:t.threadKey,children:c(a_,{data:s,target:T,inputKey:t.threadKey,attachments:e.attachments})})})]})})}function JY({read:e,target:t,onChange:n,active:o,onModeChange:r}){let a=e(t);return $(()=>{n(a)},[a,n]),$(()=>()=>n(null),[n]),$(()=>{o&&a.request&&r("chat")},[o,a.request,r]),null}function ZY(e){let n=e.data.useComposerStatus({target:e.target,threadKey:e.threadKey}).activeThread?.presetId??null;return c("div",{className:"max-h-[min(280px,36vh)] min-h-0 shrink overflow-y-auto empty:hidden","data-conversation-views":!0,children:e.slots?.renderSlot("conversation.view",{environmentId:e.environmentId,threadId:e.threadId,presetId:n})},e.threadKey)}W();W();function lS(e){return e.turnOutline??e.turns.map((t,n)=>({messageId:t.messageId,ordinal:Math.max(e.turnCount,e.turns.length)-e.turns.length+n+1,...t.error!==null?{failed:!0}:{},...n===e.turns.length-1&&e.status==="waiting"?{waiting:!0}:{}}))}function F2(e,t,n){let o=lS(e),r=[],a=[],s=()=>{if(a.length>=3)r.push({kind:"group",turns:a});else for(let i of a)r.push({kind:"turn",turn:i});a=[]};return o.forEach((i,l)=>{l===0||l===o.length-1||i.failed||i.waiting||i.forkSource||t.has(i.messageId)||n.has(`${e.threadId}:${i.messageId}`)?(s(),r.push({kind:"turn",turn:i})):a.push(i)}),s(),r}var Ar=264,Jr=136,yh=20,B2=16,z2=16,eX=(Ar+yh)/3,tX=Ar/2,nX={cards:[],edges:[],ticks:[],width:0,height:0};function dS(e){return`${e}:thread`}function Ch(e,t){return`${e}:turn:${t}`}function H2(e){if(e.threads.length===0)return nX;let t=[...e.threads].sort((y,b)=>y.createdAt.localeCompare(b.createdAt)||y.threadId.localeCompare(b.threadId)),n=new Map,o=[],r=0,a=null;t.forEach((y,b)=>{let w=e.dayOf(y.createdAt);if(b>0&&(r+=eX+(w===a?0:tX)),w!==a){let S=t[b-1],I=S===void 0?0:Date.parse(y.createdAt)-Date.parse(S.createdAt);o.push({x:r,at:y.createdAt,...I>864e5?{gapDays:Math.floor(I/864e5)}:{}})}a=w,n.set(y.threadId,r)});let s=new Map(t.map(y=>[y.threadId,y])),i=new Map;for(let y of t){if(y.forkedFrom===null)continue;let b=i.get(y.forkedFrom.sourceThreadId)??new Set;b.add(y.forkedFrom.sourceMessageId),i.set(y.forkedFrom.sourceThreadId,b)}let l=new Map(t.map(y=>[y.threadId,F2(y,i.get(y.threadId)??new Set,e.revealed??new Set)])),d=new Map,u=[],p=new Map,f=0,m=[];for(let y of t){let b=n.get(y.threadId)??0,w=oX(y,e.expanded,l.get(y.threadId)??[]),S=y.forkedFrom===null?void 0:s.get(y.forkedFrom.sourceThreadId),I=S!==void 0?d.get(S.threadId):void 0,k=I===void 0?0:I+1;for(;k<m.length&&(m[k]??0)+yh>b;)k+=1;m[k]=b+w,d.set(y.threadId,k),f=Math.max(f,b+w)}let g=Math.max(1,m.length),h=z2*2+g*Jr+(g-1)*B2;for(let y of t){let b=z2+(d.get(y.threadId)??0)*(Jr+B2),w=n.get(y.threadId)??0,S=rX(y,e.expanded,l.get(y.threadId)??[],w,b);u.push(...S),S[0]!==void 0&&p.set(y.threadId,S[0])}let v=[],C=new Map(u.map(y=>[y.id,y]));for(let y of t){let b=y.forkedFrom,w=p.get(y.threadId);if(b===null||w===void 0)continue;let S=C.get(Ch(b.sourceThreadId,b.sourceMessageId))??p.get(b.sourceThreadId);S!==void 0&&v.push({id:`${S.id}->${w.id}`,path:aX(S,w),sourceThreadId:b.sourceThreadId,childThreadId:y.threadId})}return{cards:u,edges:v,ticks:o,width:f,height:h}}function U2(e,t){return t.has(e.threadId)&&lS(e).length>0}function oX(e,t,n){let o=U2(e,t)?n.length:1;return o*Ar+(o-1)*yh}function rX(e,t,n,o,r){return U2(e,t)?n.map((a,s)=>{let i=a.kind==="turn"?a.turn:a.turns[0];if(i===void 0)throw new Error("Empty turn group");return{id:a.kind==="group"?`${e.threadId}:group:${i.messageId}`:Ch(e.threadId,i.messageId),kind:a.kind,threadId:e.threadId,turnIndex:i.ordinal-1,messageId:i.messageId,...a.kind==="group"?{groupedMessageIds:a.turns.map(l=>l.messageId)}:{},x:o+s*(Ar+yh),y:r}}):[{id:dS(e.threadId),kind:"thread",threadId:e.threadId,turnIndex:-1,x:o,y:r}]}function aX(e,t){let n=e.x+Ar/2,o=e.y+Jr,r=t.x,a=t.y+Jr/2,s=Math.max(24,(a-o)/2);return`M ${n} ${o} C ${n} ${o+s}, ${r-s} ${a}, ${r} ${a}`}function K2(e,t,n,o=240){if(n.width===0||n.height===0)return!1;let r=e.x*t.scale+t.x,a=e.y*t.scale+t.y;return r+Ar*t.scale>=-o&&a+Jr*t.scale>=-o&&r<=n.width+o&&a<=n.height+o}var Nr=24;function cp(e){return{left:0,top:36}}function cS(e,t,n=1){let o=cp(t),r=t.width-o.left-Nr*2,a=e.cards.at(-1),s=a===void 0?e.width:a.x+Ar,i=s*n<=r?o.left+Nr:t.width-Nr-s*n,l=Math.min(o.top+Nr/2,t.height-Nr-(a===void 0?0:a.y+Jr)*n);return{x:i,y:l,scale:n}}function q2(e,t,n){return{...e,x:e.x+(n.width-t.width)/2,y:e.y+(n.height-t.height)/2}}function V2(e,t){let n=cp(t);if(e.width===0||t.width===0)return{x:n.left+Nr,y:n.top+Nr/2,scale:1};let o=Y2(Math.min((t.width-n.left-Nr*2)/e.width,(t.height-n.top-Nr*2)/Math.max(1,e.height)),.25,1);return{x:n.left+Nr,y:n.top+Nr/2,scale:o}}function W2(e,t,n){let o=cp(n),r=o.left+(n.width-o.left)/2,a=o.top+(n.height-o.top)/2;return{scale:t.scale,x:r-(e.x+Ar/2)*t.scale,y:a-(e.y+Jr/2)*t.scale}}function xh(e,t,n){let o=Y2(e.scale*t,.25,4),r=(n.x-e.x)/e.scale,a=(n.y-e.y)/e.scale;return{scale:o,x:n.x-r*o,y:n.y-a*o}}function G2(e){return e.ctrlKey||e.metaKey}function j2(e,t,n=48){switch(t){case"ArrowLeft":return{...e,x:e.x+n};case"ArrowRight":return{...e,x:e.x-n};case"ArrowUp":return{...e,y:e.y+n};case"ArrowDown":return{...e,y:e.y-n};default:return null}}function uS(e,t){return t?e<=.55:e<.5}function Q2(e,t,n){return{...e,x:e.x+(t.x-n.x)*e.scale,y:e.y+(t.y-n.y)*e.scale}}function Y2(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}W();function pS(e){return e.archived?"map.status.archived":iX[e.status]}var iX={running:"map.status.running",waiting:"map.status.waiting",failed:"map.status.failed",done:"map.status.done"};function lX(e){return e===void 0?"":(e.answer||e.error||e.question).trim()}var X2=le(function(t){let{t:n,thread:o}=t,r=t.formatTitle?.(o.title)??o.title,a=lX(o.turns.at(-1)),s=o.loaded?o.turns.length>0:o.turnCount>0;return x("article",{className:"session-map-card","data-status":o.archived?"archived":o.status,"data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":r||n("settings.hiddenUntitled"),style:{left:t.card.x,top:t.card.y},onPointerDown:i=>i.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:i=>{i.target===i.currentTarget&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),t.onSelect(o.threadId)))},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:r||n("settings.hiddenUntitled")})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,x("p",{className:"session-map-meta",children:[c("span",{className:"session-map-status",children:n(pS(o))}),o.loaded?c("span",{children:n("map.turns",{count:o.turnCount})}):null,c("span",{children:t.updatedLabel})]}),o.loaded?c("p",{className:"session-map-preview",children:a||n("map.noReply")}):c("p",{className:"session-map-preview","data-pending":"","aria-hidden":!0}),x("footer",{onClick:i=>i.stopPropagation(),children:[s?c(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onExpand(t.card),children:n("map.expand")}):null,c(J,{type:"button",size:"xs",variant:"outline",onClick:()=>t.onOpen(o.threadId),children:n("map.open")}),x(Me,{children:[c(Ne,{render:c(J,{type:"button",size:"icon-xs",variant:"ghost","aria-label":n("map.hide"),onClick:()=>t.onHide(o.threadId)}),children:c(Yd,{})}),c(Ae,{side:"top",children:n("map.hide")})]})]})]})}),J2=le(function(t){let{t:n,thread:o,card:r}=t,a=t.formatTitle?.(o.title)??o.title,s=o.turns.find(u=>u.messageId===r.messageId),i=o.turnOutline?.find(u=>u.messageId===r.messageId),l=r.turnIndex+1,d=(s?.answer||s?.error||"").trim();return x("article",{className:"session-map-card","data-turn":"","data-status":o.archived?"archived":i?.failed?"failed":i?.waiting?"waiting":l===o.turnCount?o.status:"done","data-selected":t.selected?"":void 0,"data-matched":t.matched?"":void 0,"data-current-match":t.current?"":void 0,"data-dimmed":t.dimmed?"":void 0,onPointerEnter:()=>t.onHover(o.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(o.threadId),onBlur:()=>t.onHover(null),tabIndex:0,"aria-label":n("map.turnLabel",{index:l,title:a}),style:{left:r.x,top:r.y},onPointerDown:u=>u.stopPropagation(),onClick:()=>t.onSelect(o.threadId),onKeyDown:u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onSelect(o.threadId)))},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-ordinal",children:n("map.turnOrdinal",{index:l})}),x("strong",{children:[c("span",{className:"session-map-turn-question",children:s?.question||n(s===void 0?"map.loading":"map.noQuestion")}),c("span",{className:"session-map-compact-title",children:a||n("settings.hiddenUntitled")})]})]}),t.forkCount>0?c("span",{className:"session-map-forks",children:n("map.forks",{count:t.forkCount})}):null,c("p",{className:"session-map-preview","data-error":s?.error!=null&&s.answer.length===0?"":void 0,"data-pending":s===void 0?"":void 0,children:s===void 0?null:d||n("map.noReply")}),x("footer",{onClick:u=>u.stopPropagation(),children:[r.turnIndex===0?c(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>t.onCollapse(r),children:n("map.collapse")}):null,x(J,{type:"button",size:"xs",variant:"ghost",onClick:()=>{r.messageId!==void 0&&t.onFork(o.threadId,r.messageId)},children:[c(rc,{}),n("map.fork")]})]})]})}),Z2=le(function(t){return x("article",{className:"session-map-card session-map-group",tabIndex:0,"aria-label":t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0}),onClick:()=>t.onReveal(t.card),onKeyDown:n=>{n.target===n.currentTarget&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onReveal(t.card))},"data-status":t.thread.archived?"archived":"done","data-dimmed":t.dimmed?"":void 0,"data-selected":t.selected?"":void 0,onPointerDown:n=>n.stopPropagation(),onPointerEnter:()=>t.onHover(t.thread.threadId),onPointerLeave:()=>t.onHover(null),onFocus:()=>t.onHover(t.thread.threadId),onBlur:()=>t.onHover(null),style:{left:t.card.x,top:t.card.y},children:[x("header",{children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("strong",{children:(t.formatTitle?.(t.thread.title)??t.thread.title)||t.t("settings.hiddenUntitled")})]}),c(J,{type:"button",size:"sm",variant:"ghost",onClick:n=>{n.stopPropagation(),t.onReveal(t.card)},children:t.t("map.otherTurns",{count:t.card.groupedMessageIds?.length??0})})]})});function eB({text:e}){return e.length===0?null:c(Zn,{className:"session-map-md",text:e})}var dX=3;function tB(e){let{t,thread:n}=e,o=e.formatTitle?.(n.title)??n.title,a=(e.fuller??n).turns.slice(-dX);return x("aside",{className:"session-map-panel","aria-label":o||t("settings.hiddenUntitled"),children:[x("header",{children:[c("strong",{children:o||t("settings.hiddenUntitled")}),c(J,{type:"button",size:"icon-xs",variant:"ghost","aria-label":t("map.closePanel"),onClick:e.onClose,children:c(Ht,{})})]}),x("p",{className:"session-map-meta","data-status":n.archived?"archived":n.status,children:[c("span",{className:"session-map-dot","aria-hidden":!0}),c("span",{className:"session-map-status",children:t(pS(n))})]}),x("p",{className:"session-map-meta",children:[c("span",{children:t("map.created",{time:e.formatTime(n.createdAt)})}),c("span",{children:t("map.updated",{time:e.formatTime(n.updatedAt)})}),n.loaded?c("span",{children:t("map.turns",{count:n.turnCount})}):null]}),c(J,{type:"button",size:"sm",onClick:()=>e.onOpen(n.threadId),children:t("map.open")}),c("h3",{children:t("map.recent")}),e.notice!==null?c(Za,{title:e.notice}):null,!n.loaded&&e.fuller===null?c(Hr,{"aria-label":t("map.loading")}):a.length===0?c(Za,{title:t("map.noTurns")}):c("ol",{className:"session-map-turns",children:a.map(s=>x("li",{children:[c("p",{className:"session-map-question",children:s.question}),s.answer.length>0?c(eB,{text:s.answer}):s.error!==null?c("p",{className:"session-map-error",children:s.error}):c("p",{className:"session-map-muted",children:t("map.noReply")}),s.answerTruncated||s.questionTruncated?c("p",{className:"session-map-muted",children:t("map.truncated")}):null]},s.messageId))})]})}W();function nB(e){let t=new Map,n=new Map;for(let o of e){if(o.forkedFrom===null)continue;let r=o.forkedFrom.sourceThreadId;t.set(o.threadId,r);let a=n.get(r)??new Set;a.add(o.threadId),n.set(r,a)}return{count:o=>n.get(o)?.size??0,family:o=>{if(o===null)return new Set;let r=t.get(o);return new Set([o,...r===void 0?[]:[r],...n.get(o)??[]])}}}function oB(e,t,n,o,r){return t!==null&&!n.has(e)||o&&!r.has(e)}function rB(e,t,n){if(e.ticks.length===0)return[];let o=0;for(let s=1;s<e.ticks.length&&!(e.ticks[s].x*t.scale+t.x>0);s+=1)o=s;let r=e.ticks[o],a=e.ticks[o+1];return[{...r,gapDays:void 0,sticky:!0,left:Math.min(0,a===void 0?0:a.x*t.scale+t.x-112)},...e.ticks.slice(o+1).flatMap(s=>{let i=s.x*t.scale+t.x;return i<=n.width?[{...s,sticky:!1,left:i}]:[]})]}function aB(e){let t=N(null),n=N(null),o=N(!1),[r,a]=G(null),s=K(()=>nB(Array.from(e.threads.values())),[e.threads]),i=K(()=>s.family(e.selectedThreadId),[s,e.selectedThreadId]),l=N(e.camera),d=N(e.onCamera),u=N(e.onFrame);l.current=e.camera,d.current=e.onCamera,u.current=e.onFrame;let p=N(()=>{}),f=N(null);$(()=>{let S=t.current;if(S===null)return;let I=null,k=0,P=()=>{k=0;let R=I;I=null,R!==null&&d.current(R)},T=R=>{l.current=R,I=R;let F=n.current;F!==null&&(F.style.transform=fS(R),F.style.setProperty("--map-scale",String(R.scale)),o.current=uS(R.scale,o.current),F.toggleAttribute("data-compact",o.current)),k===0&&(k=window.requestAnimationFrame(P))};p.current=T;let L=R=>{R.preventDefault();let F=l.current;if(!G2(R)){T({...F,x:F.x-R.deltaX,y:F.y-R.deltaY});return}let H=S.getBoundingClientRect();T(xh(F,R.deltaY<0?1.08:.92,{x:R.clientX-H.left,y:R.clientY-H.top}))},E=()=>u.current({width:S.clientWidth,height:S.clientHeight});E();let A=new ResizeObserver(E);return A.observe(S),S.addEventListener("wheel",L,{passive:!1}),()=>{A.disconnect(),S.removeEventListener("wheel",L),k!==0&&window.cancelAnimationFrame(k)}},[]),$(()=>{if(f.current!==null)return;let S=n.current;S!==null&&(S.style.transform=fS(e.camera),S.style.setProperty("--map-scale",String(e.camera.scale)),o.current=uS(e.camera.scale,o.current),S.toggleAttribute("data-compact",o.current))},[e.camera]);let m=K(()=>e.layout.cards.filter(S=>K2(S,e.camera,e.frame)),[e.layout,e.camera,e.frame]),g=K(()=>{let S=new Set;for(let I of m)e.threads.get(I.threadId)?.loaded===!1&&S.add(I.threadId);return[...S].sort().join(`
|
|
3837
3837
|
`)},[m,e.threads]),h=N(e.onVisible);h.current=e.onVisible,$(()=>{g.length>0&&h.current(g.split(`
|
|
3838
3838
|
`))},[g]);let v=K(()=>{let S=new Map;for(let I of m){if(I.kind!=="turn"||I.messageId===void 0||e.threads.get(I.threadId)?.turns.some(P=>P.messageId===I.messageId))continue;let k=S.get(I.threadId)??[];k.push(I.messageId),S.set(I.threadId,k)}return S},[m,e.threads]),C=JSON.stringify(Array.from(v)),y=N(e.onVisibleTurns);y.current=e.onVisibleTurns,$(()=>{for(let[S,I]of v)y.current(S,I)},[C]);let b=cp(e.frame),{camera:w}=e;return x("div",{ref:t,className:"session-map-stage",tabIndex:0,"aria-label":e.t("map.pan"),onKeyDown:S=>{if(S.target!==S.currentTarget)return;let I=j2(l.current,S.key);I!==null&&(S.preventDefault(),e.onCamera(I))},onPointerDown:S=>{S.button===0&&(f.current={x:l.current.x,y:l.current.y,px:S.clientX,py:S.clientY},S.currentTarget.setPointerCapture(S.pointerId))},onPointerMove:S=>{let I=f.current;I!==null&&p.current({...l.current,x:I.x+S.clientX-I.px,y:I.y+S.clientY-I.py})},onPointerUp:S=>{f.current=null,S.currentTarget.hasPointerCapture(S.pointerId)&&S.currentTarget.releasePointerCapture(S.pointerId)},children:[x("div",{ref:n,className:"session-map-world","data-compact":o.current?"":void 0,style:{transform:fS(w),"--map-scale":w.scale},children:[c("svg",{className:"session-map-edges",width:"1",height:"1","aria-hidden":!0,children:e.layout.edges.filter(S=>[e.selectedThreadId,r].some(I=>I!==null&&(S.sourceThreadId===I||S.childThreadId===I))).map(S=>c("path",{d:S.path},S.id))}),m.map(S=>{let I=e.threads.get(S.threadId);if(I===void 0)return null;let k={formatTitle:e.formatTitle,selected:e.selectedThreadId===I.threadId,matched:e.matches.has(I.threadId),current:e.currentMatch===I.threadId,dimmed:oB(I.threadId,e.selectedThreadId,i,e.searching,e.matches),forkCount:s.count(I.threadId),onHover:a};return S.kind==="group"?c(Z2,{...k,t:e.t,card:S,thread:I,onReveal:e.onReveal},S.id):S.kind==="thread"?c(X2,{...k,t:e.t,card:S,thread:I,updatedLabel:e.formatTime(I.updatedAt),onSelect:e.onSelect,onExpand:e.onExpand,onOpen:e.onOpen,onHide:e.onHide},S.id):c(J2,{...k,t:e.t,card:S,thread:I,onSelect:e.onSelect,onCollapse:e.onCollapse,onFork:e.onFork},S.id)})]}),c("div",{className:"session-map-ruler",style:{left:b.left,height:b.top},"aria-hidden":!0,children:rB(e.layout,w,e.frame).map(S=>x("span",{"data-sticky-day":S.sticky?"":void 0,style:{left:S.left,...S.sticky?{width:112}:{}},children:[S.gapDays===void 0?null:c("small",{className:"session-map-gap",children:e.t("map.gapDays",{count:S.gapDays})}),e.formatDay(S.at)]},S.at))}),e.children]})}function fS(e){return`translate(${e.x}px, ${e.y}px) scale(${e.scale})`}function sB(e){let{t}=e,n=e.width<720;return x("header",{className:"session-map-bar",children:[c("span",{className:"session-map-count","aria-live":"polite",children:e.pending?t("map.loading"):t("map.sessions",{count:e.count})}),x("div",{className:"session-map-actions",children:[x("div",{className:"session-map-search",children:[c(sI,{value:e.query,size:"sm","aria-label":t("map.search"),placeholder:t("map.search"),onValueChange:e.onQuery,onKeyDown:o=>{o.key!=="Enter"||e.matches===0||(o.preventDefault(),e.onNextMatch(o.shiftKey))}}),e.query.trim()?c("span",{className:"session-map-muted","aria-live":"polite",children:e.matches===0?t("map.searchNone"):t("map.searchCount",{index:e.matchIndex%e.matches+1,count:e.matches})}):null]}),n?null:x(Pp,{className:"session-map-check",children:[c(kp,{checked:e.showArchived,"aria-label":t("map.showArchived"),onCheckedChange:e.onShowArchived}),c("span",{children:t("map.showArchived")})]}),x("div",{className:"session-map-zoom",children:[c(J,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.zoomOut"),onClick:()=>e.onZoom(1/1.2),children:c($s,{})}),x("span",{"aria-label":t("map.zoom",{percent:Math.round(e.scale*100)}),children:[Math.round(e.scale*100),"%"]}),c(J,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.zoomIn"),onClick:()=>e.onZoom(1.2),children:c(vc,{})})]}),n?x(Un,{children:[c(qn,{render:c(J,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("map.more")}),children:c(co,{})}),x($n,{align:"end",children:[x(Kn,{role:"menuitemcheckbox","aria-checked":e.showArchived,onClick:()=>e.onShowArchived(!e.showArchived),children:[e.showArchived?c(Dn,{}):null,t("map.showArchived")]}),x(Kn,{onClick:e.onFit,children:[c(tl,{}),t("map.fit")]}),x(Kn,{onClick:e.onLatest,children:[c(nl,{}),t("map.latest")]})]})]}):[{key:"map.fit",icon:c(tl,{}),click:e.onFit},{key:"map.latest",icon:c(nl,{}),click:e.onLatest}].map(o=>x(Me,{children:[c(Ne,{render:c(J,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t(o.key),onClick:o.click}),children:o.icon}),c(Ae,{children:t(o.key)})]},o.key))]})]})}function iB(e,t,n){let o=t.trim().toLocaleLowerCase();return o.length===0?[]:e.filter(r=>{let a=r.turns.at(-1);return`${r.title}
|
|
3839
3839
|
${n?.(r.title)??r.title}
|