@datalayer/agent-runtimes 1.6.30 → 1.6.32

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.
@@ -90,7 +90,7 @@ ${Au?"@layer popover-polyfill {":""}
90
90
  ${Au?"}":""}
91
91
  `}var popoverStyleSheet=null;function injectStyles(Au){const lo=getStyles();if(popoverStyleSheet===null)try{popoverStyleSheet=new CSSStyleSheet,popoverStyleSheet.replaceSync(lo)}catch{popoverStyleSheet=!1}if(popoverStyleSheet===!1){const $u=document.createElement("style");$u.textContent=lo,Au instanceof Document?Au.head.prepend($u):Au.prepend($u)}else Au.adoptedStyleSheets=[popoverStyleSheet,...Au.adoptedStyleSheets]}function apply$1(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||ToggleEvent;function Au(Mu){return Mu?.includes(":popover-open")&&(Mu=Mu.replace(nonEscapedPopoverSelector,"$1.\\:popover-open")),Mu}patchSelectorFn(Document.prototype,"querySelector",Au),patchSelectorFn(Document.prototype,"querySelectorAll",Au),patchSelectorFn(Element.prototype,"querySelector",Au),patchSelectorFn(Element.prototype,"querySelectorAll",Au),patchSelectorFn(Element.prototype,"matches",Au),patchSelectorFn(Element.prototype,"closest",Au),patchSelectorFn(DocumentFragment.prototype,"querySelectorAll",Au),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const Mu=(this.getAttribute("popover")||"").toLowerCase();return Mu===""||Mu=="auto"?"auto":"manual"},set(Mu){Mu===null?this.removeAttribute("popover"):this.setAttribute("popover",Mu)}},showPopover:{enumerable:!0,configurable:!0,value(){showPopover(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){hidePopover(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(Mu){visibilityState.get(this)==="showing"&&Mu===void 0||Mu===!1?hidePopover(this,!0,!0):(Mu===void 0||Mu===!0)&&showPopover(this)}}});const lo=Element.prototype.attachShadow;lo&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(Mu){const Lu=lo.call(this,Mu);return injectStyles(Lu),Lu}}});const $u=HTMLElement.prototype.attachInternals;$u&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const Mu=$u.call(this);return Mu.shadowRoot&&injectStyles(Mu.shadowRoot),Mu}}});const Ru=new WeakMap;function Iu(Mu){Object.defineProperties(Mu.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(Lu){if(Lu===null)this.removeAttribute("popovertarget"),Ru.delete(this);else if(Lu instanceof Element)this.setAttribute("popovertarget",""),Ru.set(this,Lu);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;const Lu=Ru.get(this);if(Lu&&Lu.isConnected)return Lu;if(Lu&&!Lu.isConnected)return Ru.delete(this),null;const Bu=getRootNode$1(this),ju=this.getAttribute("popovertarget");return(Bu instanceof Document||Bu instanceof ShadowRoot2)&&ju&&Bu.getElementById(ju)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const Lu=(this.getAttribute("popovertargetaction")||"").toLowerCase();return Lu==="show"||Lu==="hide"?Lu:"toggle"},set(Lu){this.setAttribute("popovertargetaction",Lu)}}})}Iu(HTMLButtonElement),Iu(HTMLInputElement);const Pu=Mu=>{const Lu=Mu.composedPath(),Bu=Lu[0];if(!(Bu instanceof Element)||Bu?.shadowRoot)return;const ju=getRootNode$1(Bu);if(!(ju instanceof ShadowRoot2||ju instanceof Document))return;const Fu=Lu.find(zu=>zu.matches?.("[popovertargetaction],[popovertarget]"));if(Fu){popoverTargetAttributeActivationBehavior(Fu),Mu.preventDefault();return}},Ou=Mu=>{const Lu=Mu.key,Bu=Mu.target;!Mu.defaultPrevented&&Bu&&(Lu==="Escape"||Lu==="Esc")&&hideAllPopoversUntil(Bu.ownerDocument,!0,!0)};(Mu=>{Mu.addEventListener("click",Pu),Mu.addEventListener("keydown",Ou),Mu.addEventListener("pointerdown",lightDismissOpenPopovers),Mu.addEventListener("pointerup",lightDismissOpenPopovers)})(document),injectStyles(document)}var classes$A={Tooltip:"prc-TooltipV2-Tooltip-cYMVY",KeybindingHintContainer:"prc-TooltipV2-KeybindingHintContainer-iabqv",HasTextBefore:"prc-TooltipV2-HasTextBefore-cCzYC"},classes$z={InternalVisuallyHidden:"prc-src-InternalVisuallyHidden-nlR9R"};function VisuallyHidden(Au){const lo=distExports.c(14);let $u,Ru,Iu,Pu,Ou;lo[0]!==Au?({isVisible:Iu,children:$u,as:Ou,className:Ru,...Pu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5]);const Du=Ou===void 0?"span":Ou,Mu=!Iu;let Lu;lo[6]!==Ru||lo[7]!==Mu?(Lu=clsx(Ru,{[classes$z.InternalVisuallyHidden]:Mu}),lo[6]=Ru,lo[7]=Mu,lo[8]=Lu):Lu=lo[8];let Bu;return lo[9]!==Du||lo[10]!==$u||lo[11]!==Pu||lo[12]!==Lu?(Bu=jsxRuntimeExports.jsx(BoxWithFallback,{as:Du,className:Lu,...Pu,children:$u}),lo[9]=Du,lo[10]=$u,lo[11]=Pu,lo[12]=Lu,lo[13]=Bu):Bu=lo[13],Bu}const canUseDOM$1=!!(typeof window<"u"&&window.document&&window.document.createElement);function useIsMacOS(){const Au=distExports.c(2),[lo,$u]=reactExports.useState(_temp$5);let Ru,Iu;return Au[0]===Symbol.for("react.memo_cache_sentinel")?(Ru=()=>$u(isMacOS$1()),Iu=[],Au[0]=Ru,Au[1]=Iu):(Ru=Au[0],Iu=Au[1]),reactExports.useEffect(Ru,Iu),lo}function _temp$5(){return canUseDOM$1?isMacOS$1():!1}const capitalize=([Au,...lo])=>{var $u;return(($u=Au?.toUpperCase())!==null&&$u!==void 0?$u:"")+lo.join("").toLowerCase()},condensedKeyName=(Au,lo)=>{var $u;return($u={alt:lo?"⌥":"Alt",control:"⌃",shift:"⇧",meta:lo?"⌘":"Win",mod:lo?"⌘":"⌃",pageup:"PgUp",pagedown:"PgDn",arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→",plus:"+",backspace:"⌫",delete:"Del",space:"␣",tab:"⇥",enter:"⏎",escape:"Esc",function:"Fn",capslock:"CapsLock",insert:"Ins",printscreen:"PrtScn"}[Au])!==null&&$u!==void 0?$u:capitalize(Au)},fullKeyName=(Au,lo)=>{var $u;return($u={alt:lo?"Option":"Alt",mod:lo?"Command":"Control","+":"Plus",pageup:"Page Up",pagedown:"Page Down",arrowup:"Up Arrow",arrowdown:"Down Arrow",arrowleft:"Left Arrow",arrowright:"Right Arrow",capslock:"Caps Lock",printscreen:"Print Screen"}[Au])!==null&&$u!==void 0?$u:capitalize(Au)},accessibleKeyName=(Au,lo)=>{var $u;return($u={alt:lo?"option":"alt",meta:lo?"command":"Windows",mod:lo?"command":"control",pageup:"page up",pagedown:"page down",arrowup:"up arrow",arrowdown:"down arrow",arrowleft:"left arrow",arrowright:"right arrow",capslock:"caps lock",printscreen:"print screen","`":"backtick","~":"tilde","!":"exclamation point","@":"at","#":"hash",$:"dollar sign","%":"percent","^":"caret","&":"ampersand","*":"asterisk","(":"left parenthesis",")":"right parenthesis",_:"underscore","-":"dash","+":"plus","=":"equals","[":"left bracket","{":"left curly brace","]":"right bracket","}":"right curly brace","\\":"backslash","|":"pipe",";":"semicolon",":":"colon","'":"single quote",'"':"double quote",",":"comma","<":"left angle bracket",".":"period",">":"right angle bracket","/":"forward slash","?":"question mark"," ":"space"}[Au])!==null&&$u!==void 0?$u:Au.toLowerCase()},Key=Au=>{const lo=distExports.c(14),{name:$u,format:Ru}=Au,Iu=useIsMacOS();let Pu;lo[0]!==Iu||lo[1]!==$u?(Pu=accessibleKeyName($u,Iu),lo[0]=Iu,lo[1]=$u,lo[2]=Pu):Pu=lo[2];let Ou;lo[3]!==Pu?(Ou=jsxRuntimeExports.jsx(VisuallyHidden,{children:Pu}),lo[3]=Pu,lo[4]=Ou):Ou=lo[4];let Du;lo[5]!==Ru||lo[6]!==Iu||lo[7]!==$u?(Du=Ru==="condensed"?condensedKeyName($u,Iu):fullKeyName($u,Iu),lo[5]=Ru,lo[6]=Iu,lo[7]=$u,lo[8]=Du):Du=lo[8];let Mu;lo[9]!==Du?(Mu=jsxRuntimeExports.jsx("span",{"aria-hidden":!0,children:Du}),lo[9]=Du,lo[10]=Mu):Mu=lo[10];let Lu;return lo[11]!==Ou||lo[12]!==Mu?(Lu=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Ou,Mu]}),lo[11]=Ou,lo[12]=Mu,lo[13]=Lu):Lu=lo[13],Lu};var classes$y={Text:"prc-Text-Text-0ima0"};const Text$3=reactExports.forwardRef((Au,lo)=>{const $u=distExports.c(14);let Ru,Iu,Pu,Ou,Du;$u[0]!==Au?({as:Ou,className:Ru,size:Pu,weight:Du,...Iu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5]);const Mu=Ou===void 0?"span":Ou,Lu=vM.useRef(null);useRefObjectAsForwardedRef(lo,Lu);let Bu;$u[6]!==Ru?(Bu=clsx(Ru,classes$y.Text),$u[6]=Ru,$u[7]=Bu):Bu=$u[7];let ju;return $u[8]!==Mu||$u[9]!==Iu||$u[10]!==Pu||$u[11]!==Bu||$u[12]!==Du?(ju=jsxRuntimeExports.jsx(BoxWithFallback,{as:Mu,className:Bu,"data-size":Pu,"data-weight":Du,...Iu,ref:Lu}),$u[8]=Mu,$u[9]=Iu,$u[10]=Pu,$u[11]=Bu,$u[12]=Du,$u[13]=ju):ju=$u[13],ju});Text$3.displayName="Text";const keySortPriorities={control:1,meta:2,alt:3,option:4,shift:5,function:6},keySortPriority=Au=>{var lo;return(lo=keySortPriorities[Au])!==null&&lo!==void 0?lo:1/0},compareLowercaseKeys=(Au,lo)=>keySortPriority(Au)-keySortPriority(lo),splitChord=Au=>Au.split("+").map(lo=>lo.toLowerCase()).sort(compareLowercaseKeys),backgroundColors={normal:"var(--bgColor-transparent)",onEmphasis:"var(--counter-bgColor-emphasis)",onPrimary:"var(--button-primary-bgColor-active)"},Chord=Au=>{const lo=distExports.c(17),{keys:$u,format:Ru,variant:Iu,size:Pu}=Au,Ou=Ru===void 0?"condensed":Ru,Du=Iu===void 0?"normal":Iu,Mu=Pu===void 0?"normal":Pu,Lu=backgroundColors[Du],Bu=Du==="normal"?"var(--fgColor-muted)":"var(--fgColor-onEmphasis)",ju=Du==="normal"?"var(--borderColor-default)":"transparent",Fu=Mu==="small"?1:2,zu=Mu==="small"?"11px":0,Uu=Mu==="small"?"2px":1,Hu=Mu==="small"?"8px":"10px",Vu=Mu==="small"?"var(--base-size-16)":"var(--base-size-20)";let Gu;lo[0]!==Hu||lo[1]!==Vu||lo[2]!==Lu||lo[3]!==Bu||lo[4]!==ju||lo[5]!==Fu||lo[6]!==zu||lo[7]!==Uu?(Gu={display:"inline-flex",bg:Lu,color:Bu,border:"1px solid",borderColor:ju,borderRadius:Fu,fontWeight:"normal",fontFamily:"normal",fontSize:zu,p:Uu,gap:"0.5ch",boxShadow:"none",verticalAlign:"baseline",overflow:"hidden",lineHeight:Hu,minWidth:Vu,justifyContent:"center"},lo[0]=Hu,lo[1]=Vu,lo[2]=Lu,lo[3]=Bu,lo[4]=ju,lo[5]=Fu,lo[6]=zu,lo[7]=Uu,lo[8]=Gu):Gu=lo[8];let Wu;if(lo[9]!==Ou||lo[10]!==$u){let Ju;lo[12]!==Ou?(Ju=(Yu,Xu)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Xu>0&&Ou==="full"?jsxRuntimeExports.jsx("span",{"aria-hidden":!0,children:" + "}):" ",jsxRuntimeExports.jsx(Key,{name:Yu,format:Ou})]},Xu),lo[12]=Ou,lo[13]=Ju):Ju=lo[13],Wu=splitChord($u).map(Ju),lo[9]=Ou,lo[10]=$u,lo[11]=Wu}else Wu=lo[11];let Zu;return lo[14]!==Gu||lo[15]!==Wu?(Zu=jsxRuntimeExports.jsx(Text$3,{sx:Gu,children:Wu}),lo[14]=Gu,lo[15]=Wu,lo[16]=Zu):Zu=lo[16],Zu},accessibleChordString=(Au,lo)=>splitChord(Au).map($u=>accessibleKeyName($u,lo)).join(" "),splitSequence=Au=>Au.split(" "),Sequence=({keys:Au,...lo})=>splitSequence(Au).map(($u,Ru)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Ru>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VisuallyHidden,{children:"then"})," "]}),jsxRuntimeExports.jsx(Chord,{keys:$u,...lo})]},Ru)),accessibleSequenceString=(Au,lo)=>splitSequence(Au).map($u=>accessibleChordString($u,lo)).join(" then ");var classes$x={KeybindingHint:"prc-KeybindingHint-KeybindingHint-0pyit"};const Kbd=Au=>{const lo=distExports.c(5),{children:$u,className:Ru}=Au;let Iu;lo[0]!==Ru?(Iu=clsx(Ru,classes$x.KeybindingHint),lo[0]=Ru,lo[1]=Iu):Iu=lo[1];let Pu;return lo[2]!==$u||lo[3]!==Iu?(Pu=jsxRuntimeExports.jsx(Text$3,{as:"kbd",className:Iu,"data-testid":"keybinding-hint",children:$u}),lo[2]=$u,lo[3]=Iu,lo[4]=Pu):Pu=lo[4],Pu},KeybindingHint=reactExports.memo(Au=>{const lo=distExports.c(8);let $u,Ru;lo[0]!==Au?({className:$u,...Ru}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru):($u=lo[1],Ru=lo[2]);let Iu;lo[3]!==Ru?(Iu=jsxRuntimeExports.jsx(Sequence,{...Ru}),lo[3]=Ru,lo[4]=Iu):Iu=lo[4];let Pu;return lo[5]!==$u||lo[6]!==Iu?(Pu=jsxRuntimeExports.jsx(Kbd,{className:$u,children:Iu}),lo[5]=$u,lo[6]=Iu,lo[7]=Pu):Pu=lo[7],Pu});KeybindingHint.displayName="KeybindingHint";const getAccessibleKeybindingHintString=accessibleSequenceString,directionToPosition={nw:{side:"outside-top",align:"end"},n:{side:"outside-top",align:"center"},ne:{side:"outside-top",align:"start"},e:{side:"outside-right",align:"center"},se:{side:"outside-bottom",align:"start"},s:{side:"outside-bottom",align:"center"},sw:{side:"outside-bottom",align:"end"},w:{side:"outside-left",align:"center"}},positionToDirection={"outside-top-end":"nw","outside-top-center":"n","outside-top-start":"ne","outside-right-center":"e","outside-bottom-start":"se","outside-bottom-center":"s","outside-bottom-end":"sw","outside-left-center":"w"},interactiveElements=["a[href]","button:not([disabled])","summary","select","input:not([type=hidden])","textarea"],isInteractive=Au=>interactiveElements.some(lo=>Au.matches(lo))||Au.hasAttribute("role")&&Au.getAttribute("role")==="button",TooltipContext$1=vM.createContext({}),Tooltip=vM.forwardRef(({direction:Au="s",text:lo,type:$u="description",children:Ru,id:Iu,className:Pu,keybindingHint:Ou,...Du},Mu)=>{const Lu=useId(Iu),Bu=reactExports.Children.only(Ru),ju=useProvidedRefOrCreate(Mu),Fu=reactExports.useRef(null),[zu,Uu]=reactExports.useState(Au),[Hu,Vu]=reactExports.useState(!1),Gu=vM.useRef(null),{safeSetTimeout:Wu,safeClearTimeout:Zu}=useSafeTimeout(),Ju=()=>{try{if(Fu.current&&ju.current&&Fu.current.hasAttribute("popover")&&!Fu.current.matches(":popover-open")){const nd=Fu.current,od=ju.current;nd.showPopover(),Vu(!0);const sd={side:directionToPosition[Au].side,align:directionToPosition[Au].align},{top:ad,left:pd,anchorAlign:bd,anchorSide:wd}=getAnchoredPosition(nd,od,sd),_d=positionToDirection[`${wd}-${bd}`];Uu(_d),nd.style.top=`${ad}px`,nd.style.left=`${pd}px`}}catch(nd){if(!(nd&&typeof nd=="object"&&"message"in nd&&typeof nd.message=="string"&&nd.message.includes("not a valid selector")))throw nd}},Yu=()=>{Gu.current&&(Zu(Gu.current),Gu.current=null);try{Fu.current&&ju.current&&Fu.current.hasAttribute("popover")&&Fu.current.matches(":popover-open")&&Fu.current.hidePopover(),Vu(!1)}catch(nd){if(!(nd&&typeof nd=="object"&&"message"in nd&&typeof nd.message=="string"&&nd.message.includes("not a valid selector")))throw nd}},Xu=reactExports.useMemo(()=>({tooltipId:Lu}),[Lu]);reactExports.useEffect(()=>{if(!Fu.current||!ju.current)return;isInteractive(ju.current);const nd=ju.current.childNodes;Array.from(nd).some(sd=>sd instanceof HTMLElement&&isInteractive(sd)||Array.from(sd.childNodes).some(ad=>ad instanceof HTMLElement&&isInteractive(ad))),$u==="label"&&(ju.current.hasAttribute("aria-label"),Array.from(ju.current.childNodes).some(sd=>sd instanceof HTMLElement&&sd.hasAttribute("aria-label"))),typeof window<"u"&&(isSupported()||apply$1()),Fu.current.setAttribute("popover","auto")},[Fu,ju,Au,$u]),useOnEscapePress(nd=>{Hu&&(nd.stopImmediatePropagation(),nd.preventDefault(),Yu())},[Hu]);const ed=useIsMacOS(),td="aria-label"in Du;return jsxRuntimeExports.jsx(TooltipContext$1.Provider,{value:Xu,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[vM.isValidElement(Bu)&&vM.cloneElement(Bu,{ref:ju,"aria-describedby":(()=>{if($u!=="description")return Bu.props["aria-describedby"];const nd=Bu.props["aria-describedby"];return nd?`${nd} ${Lu}`:Lu})(),"aria-labelledby":$u==="label"?Lu:Bu.props["aria-labelledby"],onBlur:nd=>{var od,sd;Yu(),(od=(sd=Bu.props).onBlur)===null||od===void 0||od.call(sd,nd)},onTouchEnd:nd=>{var od,sd;(od=(sd=Bu.props).onTouchEnd)===null||od===void 0||od.call(sd,nd),Wu(()=>Yu(),10)},onFocus:nd=>{var od,sd;try{if(!nd.target.matches(":focus-visible"))return}catch{}Ju(),(od=(sd=Bu.props).onFocus)===null||od===void 0||od.call(sd,nd)},onMouseOverCapture:nd=>{Gu.current=Wu(()=>{var od,sd;Ju(),(od=(sd=Bu.props).onMouseEnter)===null||od===void 0||od.call(sd,nd)},50)},onMouseLeave:nd=>{var od,sd;Yu(),(od=(sd=Bu.props).onMouseLeave)===null||od===void 0||od.call(sd,nd)}}),jsxRuntimeExports.jsx(BoxWithFallback,{as:"span",className:clsx(Pu,classes$A.Tooltip),ref:Fu,"data-direction":zu,...Du,role:$u==="description"?"tooltip":void 0,"aria-hidden":!0,onMouseEnter:Ju,onMouseLeave:Yu,id:td||!Ou?Lu:void 0,children:Ou?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{id:td?void 0:Lu,children:[lo,jsxRuntimeExports.jsxs(VisuallyHidden,{children:["(",getAccessibleKeybindingHintString(Ou,ed),")"]})]}),jsxRuntimeExports.jsx("span",{className:clsx(classes$A.KeybindingHintContainer,lo&&classes$A.HasTextBefore),"aria-hidden":!0,children:jsxRuntimeExports.jsx(KeybindingHint,{keys:Ou,format:"condensed",variant:"onEmphasis",size:"small"})})]}):lo})]})})});qe$4.span.withConfig({displayName:"Tooltip__TooltipBase",componentId:"sc-17tf59c-0"})(["position:relative;display:inline-block;&::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 ",";-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,",");text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--tooltip-bgColor,",");border-radius:",";opacity:0;}@keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}&:hover,&:active,&:focus,&:focus-within{&::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0s;}}&.tooltipped-no-delay:hover,&.tooltipped-no-delay:active,&.tooltipped-no-delay:focus,&.tooltipped-no-delay:focus-within{&::after{animation-delay:0s;}}&.tooltipped-multiline:hover,&.tooltipped-multiline:active,&.tooltipped-multiline:focus,&.tooltipped-multiline:focus-within{&::after{display:table-cell;}}&.tooltipped-s,&.tooltipped-se,&.tooltipped-sw{&::after{top:100%;right:50%;margin-top:6px;}}&.tooltipped-se{&::after{right:auto;left:50%;margin-left:-",";}}&.tooltipped-sw::after{margin-right:-",";}&.tooltipped-n,&.tooltipped-ne,&.tooltipped-nw{&::after{right:50%;bottom:100%;margin-bottom:6px;}}&.tooltipped-ne{&::after{right:auto;left:50%;margin-left:-",";}}&.tooltipped-nw::after{margin-right:-",";}&.tooltipped-s::after,&.tooltipped-n::after{transform:translateX(50%);}&.tooltipped-w{&::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%);}}&.tooltipped-e{&::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%);}}&.tooltipped-multiline{&::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}&.tooltipped-s::after,&.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%);}&.tooltipped-w::after,&.tooltipped-e::after{right:100%;}}&.tooltipped-align-right-2::after{right:0;margin-right:0;}&.tooltipped-align-left-2::after{left:0;margin-left:0;}",";"],get("fonts.normal"),get("colors.fg.onEmphasis"),get("colors.neutral.emphasisPlus"),get("radii.2"),get("space.3"),get("space.3"),get("space.3"),get("space.3"),sx);const TooltipContext=vM.createContext({}),IconButton=reactExports.forwardRef(({sx:Au=defaultSxProp,icon:lo,"aria-label":$u,description:Ru,disabled:Iu,tooltipDirection:Pu,unsafeDisableTooltip:Ou=!1,keyshortcuts:Du,keybindingHint:Mu,className:Lu,...Bu},ju)=>{let Fu=Au;const{size:zu="medium"}=Bu;Au!==null&&Object.keys(Au).length>0&&(Fu=generateCustomSxProp({size:zu},Au));const{tooltipId:Uu}=vM.useContext(TooltipContext$1),{tooltipId:Hu}=vM.useContext(TooltipContext);if(Ou||Iu||$u===void 0||$u===""||(Uu||Hu))return jsxRuntimeExports.jsx(ButtonBase,{icon:lo,className:clsx(Lu,classes$E.IconButton),"data-component":"IconButton",sx:Fu,type:"button","aria-label":$u,disabled:Iu,...Bu,ref:ju});{const Wu=Ru??$u;return jsxRuntimeExports.jsx(Tooltip,{ref:ju,text:Wu,type:Ru?void 0:"label",direction:Pu,keybindingHint:Mu??Du,children:jsxRuntimeExports.jsx(ButtonBase,{icon:lo,className:clsx(Lu,classes$E.IconButton),"data-component":"IconButton",sx:Fu,type:"button","aria-keyshortcuts":Du??void 0,"aria-label":Ru?$u:void 0,...Bu})})}});function useFocusTrap(Au,lo=[]){const $u=useProvidedRefOrCreate(Au?.containerRef),Ru=useProvidedRefOrCreate(Au?.initialFocusRef),Iu=Au?.disabled,Pu=vM.useRef(),Ou=vM.useRef(null);!Ou.current&&!(Au!=null&&Au.disabled)&&(Ou.current=document.activeElement);function Du(){var Mu;(Mu=Pu.current)===null||Mu===void 0||Mu.abort(),Au!=null&&Au.returnFocusRef&&Au.returnFocusRef.current instanceof HTMLElement?Au.returnFocusRef.current.focus():Au!=null&&Au.restoreFocusOnCleanUp&&Ou.current instanceof HTMLElement&&(Ou.current.focus(),Ou.current=null)}return vM.useEffect(()=>{if($u.current instanceof HTMLElement)if(Iu)Du();else{var Mu;return Pu.current=focusTrap($u.current,(Mu=Ru.current)!==null&&Mu!==void 0?Mu:void 0),()=>{Du()}}},[$u,Ru,Iu,...lo]),{containerRef:$u,initialFocusRef:Ru}}function _typeof$9(Au){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(lo){return typeof lo}:function(lo){return lo&&typeof Symbol=="function"&&lo.constructor===Symbol&&lo!==Symbol.prototype?"symbol":typeof lo},_typeof$9(Au)}var _excluded$2=["aria-hidden","aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"];function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(Au){for(var lo=1;lo<arguments.length;lo++){var $u=arguments[lo];for(var Ru in $u)({}).hasOwnProperty.call($u,Ru)&&(Au[Ru]=$u[Ru])}return Au},_extends$1.apply(null,arguments)}function ownKeys$3(Au,lo){var $u=Object.keys(Au);if(Object.getOwnPropertySymbols){var Ru=Object.getOwnPropertySymbols(Au);lo&&(Ru=Ru.filter(function(Iu){return Object.getOwnPropertyDescriptor(Au,Iu).enumerable})),$u.push.apply($u,Ru)}return $u}function _objectSpread$2(Au){for(var lo=1;lo<arguments.length;lo++){var $u=arguments[lo]!=null?arguments[lo]:{};lo%2?ownKeys$3(Object($u),!0).forEach(function(Ru){_defineProperty$3(Au,Ru,$u[Ru])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Au,Object.getOwnPropertyDescriptors($u)):ownKeys$3(Object($u)).forEach(function(Ru){Object.defineProperty(Au,Ru,Object.getOwnPropertyDescriptor($u,Ru))})}return Au}function _defineProperty$3(Au,lo,$u){return(lo=_toPropertyKey$8(lo))in Au?Object.defineProperty(Au,lo,{value:$u,enumerable:!0,configurable:!0,writable:!0}):Au[lo]=$u,Au}function _toPropertyKey$8(Au){var lo=_toPrimitive$8(Au,"string");return _typeof$9(lo)=="symbol"?lo:lo+""}function _toPrimitive$8(Au,lo){if(_typeof$9(Au)!="object"||!Au)return Au;var $u=Au[Symbol.toPrimitive];if($u!==void 0){var Ru=$u.call(Au,lo);if(_typeof$9(Ru)!="object")return Ru;throw new TypeError("@@toPrimitive must return a primitive value.")}return(lo==="string"?String:Number)(Au)}function _objectWithoutProperties$1(Au,lo){if(Au==null)return{};var $u,Ru,Iu=_objectWithoutPropertiesLoose$1(Au,lo);if(Object.getOwnPropertySymbols){var Pu=Object.getOwnPropertySymbols(Au);for(Ru=0;Ru<Pu.length;Ru++)$u=Pu[Ru],lo.indexOf($u)===-1&&{}.propertyIsEnumerable.call(Au,$u)&&(Iu[$u]=Au[$u])}return Iu}function _objectWithoutPropertiesLoose$1(Au,lo){if(Au==null)return{};var $u={};for(var Ru in Au)if({}.hasOwnProperty.call(Au,Ru)){if(lo.indexOf(Ru)!==-1)continue;$u[Ru]=Au[Ru]}return $u}var sizeMap$3={small:16,medium:32,large:64};function renderOcticon(Au,lo,$u,Ru,Iu){var Pu=Au["aria-hidden"],Ou=Au["aria-label"],Du=Au["aria-labelledby"],Mu=Au.tabIndex,Lu=Au.className,Bu=Lu===void 0?"":Lu,ju=Au.fill,Fu=ju===void 0?"currentColor":ju,zu=Au.size,Uu=zu===void 0?16:zu,Hu=Au.verticalAlign,Vu=Hu===void 0?"text-bottom":Hu,Gu=Au.id,Wu=Au.title,Zu=Au.style,Ju=_objectWithoutProperties$1(Au,_excluded$2),Yu=sizeMap$3[Uu]||Uu,Xu=closestNaturalHeight(Iu,Yu),ed=Ru[Xu].width,td=Yu*(ed/Xu),nd=Ru[Xu].path,od=Ou||Du,sd=Pu===void 0?od?void 0:"true":Pu,ad=od&&sd!=="true"?"img":void 0;return vM.createElement("svg",_extends$1({ref:lo,"data-component":"Octicon"},Ju,{"aria-hidden":sd,tabIndex:Mu,focusable:Mu>=0?"true":"false","aria-label":Ou,"aria-labelledby":Du,className:"".concat($u," ").concat(Bu).trim(),role:ad,viewBox:"0 0 ".concat(ed," ").concat(Xu),width:td,height:Yu,fill:Fu,id:Gu,display:"inline-block",overflow:"visible",style:_objectSpread$2({verticalAlign:Vu},Zu)}),Wu?vM.createElement("title",null,Wu):null,nd)}function closestNaturalHeight(Au,lo){return Au.map(function($u){return parseInt($u,10)}).reduce(function($u,Ru){return Ru<=lo?Ru:$u},Au[0])}var heights$1t=["16","24"],svgDataByHeight$1t={16:{width:16,path:vM.createElement("path",{d:"M10.628 7.25a2.25 2.25 0 1 1 0 1.5H8.622a2.25 2.25 0 0 1-2.513 1.466L5.03 12.124a2.25 2.25 0 1 1-1.262-.814l1.035-1.832A2.245 2.245 0 0 1 4.25 8c0-.566.209-1.082.553-1.478L3.768 4.69a2.25 2.25 0 1 1 1.262-.814l1.079 1.908A2.25 2.25 0 0 1 8.622 7.25ZM2.5 2.5a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm4 4.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.25 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm-9.5 5.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:vM.createElement("path",{d:"M19.375 8.5a3.25 3.25 0 1 1-3.163 4h-3a3.252 3.252 0 0 1-4.443 2.509L7.214 17.76a3.25 3.25 0 1 1-1.342-.674l1.672-2.957A3.238 3.238 0 0 1 6.75 12c0-.907.371-1.727.97-2.316L6.117 6.846A3.253 3.253 0 0 1 1.875 3.75a3.25 3.25 0 1 1 5.526 2.32l1.603 2.836A3.25 3.25 0 0 1 13.093 11h3.119a3.252 3.252 0 0 1 3.163-2.5ZM10 10.25a1.75 1.75 0 1 0-.001 3.499A1.75 1.75 0 0 0 10 10.25ZM5.125 2a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5Zm12.5 9.75a1.75 1.75 0 1 0 3.5 0 1.75 1.75 0 0 0-3.5 0Zm-14.25 8.5a1.75 1.75 0 1 0 3.501-.001 1.75 1.75 0 0 0-3.501.001Z"})}},AiModelIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-ai-model",svgDataByHeight$1t,heights$1t)});AiModelIcon.displayName="AiModelIcon";var heights$1s=["16","24"],svgDataByHeight$1s={16:{width:16,path:vM.createElement("path",{d:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M13 17.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.25-8.25a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 1.5 0v-4.5Z"}),vM.createElement("path",{d:"M9.836 3.244c.963-1.665 3.365-1.665 4.328 0l8.967 15.504c.963 1.667-.24 3.752-2.165 3.752H3.034c-1.926 0-3.128-2.085-2.165-3.752Zm3.03.751a1.002 1.002 0 0 0-1.732 0L2.168 19.499A1.002 1.002 0 0 0 3.034 21h17.932a1.002 1.002 0 0 0 .866-1.5L12.866 3.994Z"}))}},AlertIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-alert",svgDataByHeight$1s,heights$1s)});AlertIcon.displayName="AlertIcon";var heights$1r=["12","16","24"],svgDataByHeight$1r={12:{width:12,path:vM.createElement("path",{d:"M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})},16:{width:16,path:vM.createElement("path",{d:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575ZM8 5a.75.75 0 0 0-.75.75v2.5a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8 5Zm1 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M9.836 3.244c.963-1.665 3.365-1.665 4.328 0l8.967 15.504c.963 1.667-.24 3.752-2.165 3.752H3.034c-1.926 0-3.128-2.085-2.165-3.752ZM12 8.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-4.5A.75.75 0 0 0 12 8.5Zm1 9a1 1 0 1 0-2 0 1 1 0 0 0 2 0Z"})}},AlertFillIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-alert-fill",svgDataByHeight$1r,heights$1r)});AlertFillIcon.displayName="AlertFillIcon";var heights$1q=["16","24"],svgDataByHeight$1q={16:{width:16,path:vM.createElement("path",{d:"M8.22 2.97a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l2.97-2.97H3.75a.75.75 0 0 1 0-1.5h7.44L8.22 4.03a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement("path",{d:"M13.22 19.03a.75.75 0 0 1 0-1.06L18.19 13H3.75a.75.75 0 0 1 0-1.5h14.44l-4.97-4.97a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l6.25 6.25a.75.75 0 0 1 0 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0Z"})}},ArrowRightIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-arrow-right",svgDataByHeight$1q,heights$1q)});ArrowRightIcon.displayName="ArrowRightIcon";var heights$1p=["16","24"],svgDataByHeight$1p={16:{width:16,path:vM.createElement("path",{d:"M5 5.782V2.5h-.25a.75.75 0 0 1 0-1.5h6.5a.75.75 0 0 1 0 1.5H11v3.282l3.666 5.76C15.619 13.04 14.543 15 12.767 15H3.233c-1.776 0-2.852-1.96-1.899-3.458Zm-2.4 6.565a.75.75 0 0 0 .633 1.153h9.534a.75.75 0 0 0 .633-1.153L12.225 10.5h-8.45ZM9.5 2.5h-3V6c0 .143-.04.283-.117.403L4.73 9h6.54L9.617 6.403A.746.746 0 0 1 9.5 6Z"})},24:{width:24,path:vM.createElement("path",{d:"M8 8.807V3.5h-.563a.75.75 0 0 1 0-1.5h9.125a.75.75 0 0 1 0 1.5H16v5.307l5.125 9.301c.964 1.75-.302 3.892-2.299 3.892H5.174c-1.998 0-3.263-2.142-2.3-3.892ZM4.189 18.832a1.123 1.123 0 0 0 .985 1.668h13.652a1.123 1.123 0 0 0 .985-1.668L17.7 15H6.3ZM14.5 3.5h-5V9a.75.75 0 0 1-.093.362L7.127 13.5h9.746l-2.28-4.138A.75.75 0 0 1 14.5 9Z"})}},BeakerIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-beaker",svgDataByHeight$1p,heights$1p)});BeakerIcon.displayName="BeakerIcon";var heights$1o=["16","24"],svgDataByHeight$1o={16:{width:16,path:vM.createElement("path",{d:"M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 1c3.681 0 7 2.565 7 6v4.539c0 .642.189 1.269.545 1.803l2.2 3.298A1.517 1.517 0 0 1 20.482 19H15.5a3.5 3.5 0 1 1-7 0H3.519a1.518 1.518 0 0 1-1.265-2.359l2.2-3.299A3.25 3.25 0 0 0 5 11.539V7c0-3.435 3.318-6 7-6ZM6.5 7v4.539a4.75 4.75 0 0 1-.797 2.635l-2.2 3.298-.003.01.001.007.004.006.006.004.007.001h16.964l.007-.001.006-.004.004-.006.001-.006a.017.017 0 0 0-.003-.01l-2.199-3.299a4.753 4.753 0 0 1-.798-2.635V7c0-2.364-2.383-4.5-5.5-4.5S6.5 4.636 6.5 7ZM14 19h-4a2 2 0 1 0 4 0Z"})}},BellIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-bell",svgDataByHeight$1o,heights$1o)});BellIcon.displayName="BellIcon";var heights$1n=["16","24"],svgDataByHeight$1n={16:{width:16,path:vM.createElement("path",{d:"M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"})},24:{width:24,path:vM.createElement("path",{d:"M0 3.75A.75.75 0 0 1 .75 3h7.497c1.566 0 2.945.8 3.751 2.014A4.495 4.495 0 0 1 15.75 3h7.5a.75.75 0 0 1 .75.75v15.063a.752.752 0 0 1-.755.75l-7.682-.052a3 3 0 0 0-2.142.878l-.89.891a.75.75 0 0 1-1.061 0l-.902-.901a2.996 2.996 0 0 0-2.121-.879H.75a.75.75 0 0 1-.75-.75Zm12.75 15.232a4.503 4.503 0 0 1 2.823-.971l6.927.047V4.5h-6.75a3 3 0 0 0-3 3ZM11.247 7.497a3 3 0 0 0-3-2.997H1.5V18h6.947c1.018 0 2.006.346 2.803.98Z"})}},BookIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-book",svgDataByHeight$1n,heights$1n)});BookIcon.displayName="BookIcon";var heights$1m=["16","24"],svgDataByHeight$1m={16:{width:16,path:vM.createElement("path",{d:"M6.75 0h2.5C10.216 0 11 .784 11 1.75V3h3.25c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25v-8.5C0 3.784.784 3 1.75 3H5V1.75C5 .784 5.784 0 6.75 0ZM3.5 9.5a3.49 3.49 0 0 1-2-.627v4.377c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V8.873a3.49 3.49 0 0 1-2 .627Zm-1.75-5a.25.25 0 0 0-.25.25V6a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2V4.75a.25.25 0 0 0-.25-.25H1.75ZM9.5 3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25V3Z"})},24:{width:24,path:vM.createElement("path",{d:"M7.5 1.75C7.5.784 8.284 0 9.25 0h5.5c.966 0 1.75.784 1.75 1.75V4h4.75c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 21.25 22H2.75A1.75 1.75 0 0 1 1 20.25V5.75C1 4.784 1.784 4 2.75 4H7.5Zm-5 10.24v8.26c0 .138.112.25.25.25h18.5a.25.25 0 0 0 .25-.25v-8.26A4.235 4.235 0 0 1 18.75 13H5.25a4.235 4.235 0 0 1-2.75-1.01Zm19-3.24v-3a.25.25 0 0 0-.25-.25H2.75a.25.25 0 0 0-.25.25v3a2.75 2.75 0 0 0 2.75 2.75h13.5a2.75 2.75 0 0 0 2.75-2.75Zm-6.5-7a.25.25 0 0 0-.25-.25h-5.5a.25.25 0 0 0-.25.25V4h6Z"})}},BriefcaseIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-briefcase",svgDataByHeight$1m,heights$1m)});BriefcaseIcon.displayName="BriefcaseIcon";var heights$1l=["16","24"],svgDataByHeight$1l={16:{width:16,path:vM.createElement("path",{d:"M8.75 8.582v5.668a.75.75 0 0 1-1.5 0V8.582a1.75 1.75 0 1 1 1.5 0Zm3.983-7.125a.75.75 0 0 1 1.06.026A7.976 7.976 0 0 1 16 7c0 2.139-.84 4.083-2.207 5.517a.75.75 0 1 1-1.086-1.034A6.474 6.474 0 0 0 14.5 7a6.474 6.474 0 0 0-1.793-4.483.75.75 0 0 1 .026-1.06Zm-9.466 0c.3.286.312.76.026 1.06A6.474 6.474 0 0 0 1.5 7a6.47 6.47 0 0 0 1.793 4.483.75.75 0 0 1-1.086 1.034A7.973 7.973 0 0 1 0 7c0-2.139.84-4.083 2.207-5.517a.75.75 0 0 1 1.06-.026Zm8.556 2.321A4.988 4.988 0 0 1 13 7a4.988 4.988 0 0 1-1.177 3.222.75.75 0 1 1-1.146-.967A3.487 3.487 0 0 0 11.5 7c0-.86-.309-1.645-.823-2.255a.75.75 0 0 1 1.146-.967Zm-6.492.958A3.48 3.48 0 0 0 4.5 7a3.48 3.48 0 0 0 .823 2.255.75.75 0 0 1-1.146.967A4.981 4.981 0 0 1 3 7a4.982 4.982 0 0 1 1.188-3.236.75.75 0 1 1 1.143.972Z"})},24:{width:24,path:vM.createElement("path",{d:"M20.485 2.515a.75.75 0 0 0-1.06 1.06A10.465 10.465 0 0 1 22.5 11c0 2.9-1.174 5.523-3.075 7.424a.75.75 0 0 0 1.06 1.061A11.965 11.965 0 0 0 24 11c0-3.314-1.344-6.315-3.515-8.485Zm-15.91 1.06a.75.75 0 0 0-1.06-1.06A11.965 11.965 0 0 0 0 11c0 3.313 1.344 6.314 3.515 8.485a.75.75 0 0 0 1.06-1.06A10.465 10.465 0 0 1 1.5 11c0-2.9 1.174-5.524 3.075-7.425ZM8.11 7.11a.75.75 0 0 0-1.06-1.06A6.98 6.98 0 0 0 5 11a6.98 6.98 0 0 0 2.05 4.95.75.75 0 0 0 1.06-1.061 5.48 5.48 0 0 1-1.61-3.89 5.48 5.48 0 0 1 1.61-3.888Zm8.84-1.06a.75.75 0 1 0-1.06 1.06A5.48 5.48 0 0 1 17.5 11a5.48 5.48 0 0 1-1.61 3.889.75.75 0 1 0 1.06 1.06A6.98 6.98 0 0 0 19 11a6.98 6.98 0 0 0-2.05-4.949ZM14 11a2 2 0 0 1-1.25 1.855v8.395a.75.75 0 0 1-1.5 0v-8.395A2 2 0 1 1 14 11Z"})}},BroadcastIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-broadcast",svgDataByHeight$1l,heights$1l)});BroadcastIcon.displayName="BroadcastIcon";var heights$1k=["16","24"],svgDataByHeight$1k={16:{width:16,path:vM.createElement("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25ZM14.5 6h-13v7.25c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm-6-3.5v2h6V2.75a.25.25 0 0 0-.25-.25ZM5 2.5v2h2v-2Zm-3.25 0a.25.25 0 0 0-.25.25V4.5h2v-2Z"})},24:{width:24,path:vM.createElement("path",{d:"M0 3.75C0 2.784.784 2 1.75 2h20.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 22.25 22H1.75A1.75 1.75 0 0 1 0 20.25ZM22.5 7h-21v13.25c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25Zm-10-3.5v2h10V3.75a.25.25 0 0 0-.25-.25ZM7 3.5v2h4v-2Zm-5.25 0a.25.25 0 0 0-.25.25V5.5h4v-2Z"})}},BrowserIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-browser",svgDataByHeight$1k,heights$1k)});BrowserIcon.displayName="BrowserIcon";var heights$1j=["16","24"],svgDataByHeight$1j={16:{width:16,path:vM.createElement("path",{d:"M4.72.22a.75.75 0 0 1 1.06 0l1 .999a3.488 3.488 0 0 1 2.441 0l.999-1a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.775.776c.616.63.995 1.493.995 2.444v.327c0 .1-.009.197-.025.292.408.14.764.392 1.029.722l1.968-.787a.75.75 0 0 1 .556 1.392L13 7.258V9h2.25a.75.75 0 0 1 0 1.5H13v.5c0 .409-.049.806-.141 1.186l2.17.868a.75.75 0 0 1-.557 1.392l-2.184-.873A4.997 4.997 0 0 1 8 16a4.997 4.997 0 0 1-4.288-2.427l-2.183.873a.75.75 0 0 1-.558-1.392l2.17-.868A5.036 5.036 0 0 1 3 11v-.5H.75a.75.75 0 0 1 0-1.5H3V7.258L.971 6.446a.75.75 0 0 1 .558-1.392l1.967.787c.265-.33.62-.583 1.03-.722a1.677 1.677 0 0 1-.026-.292V4.5c0-.951.38-1.814.995-2.444L4.72 1.28a.75.75 0 0 1 0-1.06Zm.53 6.28a.75.75 0 0 0-.75.75V11a3.5 3.5 0 1 0 7 0V7.25a.75.75 0 0 0-.75-.75ZM6.173 5h3.654A.172.172 0 0 0 10 4.827V4.5a2 2 0 1 0-4 0v.327c0 .096.077.173.173.173Z"})},24:{width:24,path:vM.createElement("path",{d:"M7.72.22a.75.75 0 0 1 1.06 0l1.204 1.203A4.98 4.98 0 0 1 12 1c.717 0 1.4.151 2.016.423L15.22.22a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-.971.972A4.991 4.991 0 0 1 17 6v1.104a2.755 2.755 0 0 1 1.917 1.974l1.998-.999a.75.75 0 0 1 .67 1.342L19 10.714V13.5l3.25.003a.75.75 0 0 1 0 1.5L19 15.001V16c0 .568-.068 1.134-.204 1.686l.04.018 2.75 1.375a.75.75 0 1 1-.671 1.342l-2.638-1.319A6.998 6.998 0 0 1 12 23a6.998 6.998 0 0 1-6.197-3.742l-2.758 1.181a.752.752 0 0 1-1.064-.776.752.752 0 0 1 .474-.602l2.795-1.199A6.976 6.976 0 0 1 5 16v-.996H1.75a.75.75 0 0 1 0-1.5H5v-2.79L2.415 9.42a.75.75 0 0 1 .67-1.342l1.998.999A2.756 2.756 0 0 1 7 7.104V6a4.99 4.99 0 0 1 1.69-3.748l-.97-.972a.75.75 0 0 1 0-1.06ZM6.5 9.75V16a5.5 5.5 0 1 0 11 0V9.75c0-.69-.56-1.25-1.25-1.25h-8.5c-.69 0-1.25.56-1.25 1.25ZM8.5 7h7V6a3.5 3.5 0 1 0-7 0Z"})}},BugIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-bug",svgDataByHeight$1j,heights$1j)});BugIcon.displayName="BugIcon";var heights$1i=["16","24"],svgDataByHeight$1i={16:{width:16,path:vM.createElement("path",{d:"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M21.03 5.72a.75.75 0 0 1 0 1.06l-11.5 11.5a.747.747 0 0 1-1.072-.012l-5.5-5.75a.75.75 0 1 1 1.084-1.036l4.97 5.195L19.97 5.72a.75.75 0 0 1 1.06 0Z"})}},CheckIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-check",svgDataByHeight$1i,heights$1i)});CheckIcon.displayName="CheckIcon";var heights$1h=["16","24"],svgDataByHeight$1h={16:{width:16,path:vM.createElement("path",{d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm1.5 0a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm10.28-1.72-4.5 4.5a.75.75 0 0 1-1.06 0l-2-2a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018l1.47 1.47 3.97-3.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M17.28 9.28a.75.75 0 0 0-1.06-1.06l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l6.5-6.5Z"}),vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"}))}},CheckCircleIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-check-circle",svgDataByHeight$1h,heights$1h)});CheckCircleIcon.displayName="CheckCircleIcon";var heights$1g=["12","16","24"],svgDataByHeight$1g={12:{width:12,path:vM.createElement("path",{d:"M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"})},16:{width:16,path:vM.createElement("path",{d:"M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm16.28-2.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018l-5.97 5.97-2.47-2.47a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l3 3a.75.75 0 0 0 1.06 0Z"})}},CheckCircleFillIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-check-circle-fill",svgDataByHeight$1g,heights$1g)});CheckCircleFillIcon.displayName="CheckCircleFillIcon";var heights$1f=["16","24"],svgDataByHeight$1f={16:{width:16,path:vM.createElement("path",{d:"M2.5 1.75v11.5c0 .138.112.25.25.25h3.17a.75.75 0 0 1 0 1.5H2.75A1.75 1.75 0 0 1 1 13.25V1.75C1 .784 1.784 0 2.75 0h8.5C12.216 0 13 .784 13 1.75v7.736a.75.75 0 0 1-1.5 0V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13.274 9.537v-.001l-4.557 4.45a.75.75 0 0 1-1.055-.008l-1.943-1.95a.75.75 0 0 1 1.062-1.058l1.419 1.425 4.026-3.932a.75.75 0 1 1 1.048 1.074ZM4.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM4 7.75A.75.75 0 0 1 4.75 7h2a.75.75 0 0 1 0 1.5h-2A.75.75 0 0 1 4 7.75Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M3.5 3.75a.25.25 0 0 1 .25-.25h13.5a.25.25 0 0 1 .25.25v10a.75.75 0 0 0 1.5 0v-10A1.75 1.75 0 0 0 17.25 2H3.75A1.75 1.75 0 0 0 2 3.75v16.5c0 .966.784 1.75 1.75 1.75h7a.75.75 0 0 0 0-1.5h-7a.25.25 0 0 1-.25-.25V3.75Z"}),vM.createElement("path",{d:"M6.25 7a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5Zm-.75 4.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm16.28 4.53a.75.75 0 1 0-1.06-1.06l-4.97 4.97-1.97-1.97a.75.75 0 1 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5.5-5.5Z"}))}},ChecklistIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-checklist",svgDataByHeight$1f,heights$1f)});ChecklistIcon.displayName="ChecklistIcon";var heights$1e=["12","16","24"],svgDataByHeight$1e={12:{width:12,path:vM.createElement("path",{d:"M6 8.825c-.2 0-.4-.1-.5-.2l-3.3-3.3c-.3-.3-.3-.8 0-1.1.3-.3.8-.3 1.1 0l2.7 2.7 2.7-2.7c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1l-3.2 3.2c-.2.2-.4.3-.6.3Z"})},16:{width:16,path:vM.createElement("path",{d:"M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M5.22 8.22a.749.749 0 0 0 0 1.06l6.25 6.25a.749.749 0 0 0 1.06 0l6.25-6.25a.749.749 0 1 0-1.06-1.06L12 13.939 6.28 8.22a.749.749 0 0 0-1.06 0Z"})}},ChevronDownIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-chevron-down",svgDataByHeight$1e,heights$1e)});ChevronDownIcon.displayName="ChevronDownIcon";var heights$1d=["12","16","24"],svgDataByHeight$1d={12:{width:12,path:vM.createElement("path",{d:"M4.7 10c-.2 0-.4-.1-.5-.2-.3-.3-.3-.8 0-1.1L6.9 6 4.2 3.3c-.3-.3-.3-.8 0-1.1.3-.3.8-.3 1.1 0l3.3 3.2c.3.3.3.8 0 1.1L5.3 9.7c-.2.2-.4.3-.6.3Z"})},16:{width:16,path:vM.createElement("path",{d:"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement("path",{d:"M8.72 18.78a.75.75 0 0 1 0-1.06L14.44 12 8.72 6.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018l6.25 6.25a.75.75 0 0 1 0 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0Z"})}},ChevronRightIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-chevron-right",svgDataByHeight$1d,heights$1d)});ChevronRightIcon.displayName="ChevronRightIcon";var heights$1c=["16","24"],svgDataByHeight$1c={16:{width:16,path:vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM3.965 13.096a6.5 6.5 0 0 0 9.131-9.131ZM1.5 8a6.474 6.474 0 0 0 1.404 4.035l9.131-9.131A6.499 6.499 0 0 0 1.5 8Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM5.834 19.227A9.464 9.464 0 0 0 12 21.5a9.5 9.5 0 0 0 9.5-9.5 9.464 9.464 0 0 0-2.273-6.166ZM2.5 12a9.464 9.464 0 0 0 2.273 6.166L18.166 4.773A9.463 9.463 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"})}},CircleSlashIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-circle-slash",svgDataByHeight$1c,heights$1c)});CircleSlashIcon.displayName="CircleSlashIcon";var heights$1b=["16","24"],svgDataByHeight$1b={16:{width:16,path:vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7-3.25v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5a.75.75 0 0 1 1.5 0Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M12.5 7.25a.75.75 0 0 0-1.5 0v5.5c0 .27.144.518.378.651l3.5 2a.75.75 0 0 0 .744-1.302L12.5 12.315V7.25Z"}),vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"}))}},ClockIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-clock",svgDataByHeight$1b,heights$1b)});ClockIcon.displayName="ClockIcon";var heights$1a=["16","24"],svgDataByHeight$1a={16:{width:16,path:vM.createElement("path",{d:"m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement("path",{d:"M15.22 4.97a.75.75 0 0 1 1.06 0l6.5 6.5a.75.75 0 0 1 0 1.06l-6.5 6.5a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L21.19 12l-5.97-5.97a.75.75 0 0 1 0-1.06Zm-6.44 0a.75.75 0 0 1 0 1.06L2.81 12l5.97 5.97a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-6.5-6.5a.75.75 0 0 1 0-1.06l6.5-6.5a.75.75 0 0 1 1.06 0Z"})}},CodeIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-code",svgDataByHeight$1a,heights$1a)});CodeIcon.displayName="CodeIcon";var heights$19=["16","24"],svgDataByHeight$19={16:{width:16,path:vM.createElement("path",{d:"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"}),vM.createElement("path",{d:"M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"}))}},CodeReviewIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-code-review",svgDataByHeight$19,heights$19)});CodeReviewIcon.displayName="CodeReviewIcon";var heights$18=["16","24"],svgDataByHeight$18={16:{width:16,path:vM.createElement("path",{d:"M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"}),vM.createElement("path",{d:"M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"}))}},CommentDiscussionIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-comment-discussion",svgDataByHeight$18,heights$18)});CommentDiscussionIcon.displayName="CommentDiscussionIcon";var heights$17=["16","24"],svgDataByHeight$17={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"}),vM.createElement("path",{d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M7.024 3.75c0-.966.784-1.75 1.75-1.75H20.25c.966 0 1.75.784 1.75 1.75v11.498a1.75 1.75 0 0 1-1.75 1.75H8.774a1.75 1.75 0 0 1-1.75-1.75Zm1.75-.25a.25.25 0 0 0-.25.25v11.498c0 .139.112.25.25.25H20.25a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"}),vM.createElement("path",{d:"M1.995 10.749a1.75 1.75 0 0 1 1.75-1.751H5.25a.75.75 0 1 1 0 1.5H3.745a.25.25 0 0 0-.25.25L3.5 20.25c0 .138.111.25.25.25h9.5a.25.25 0 0 0 .25-.25v-1.51a.75.75 0 1 1 1.5 0v1.51A1.75 1.75 0 0 1 13.25 22h-9.5A1.75 1.75 0 0 1 2 20.25l-.005-9.501Z"}))}},CopyIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-copy",svgDataByHeight$17,heights$17)});CopyIcon.displayName="CopyIcon";var heights$16=["16","24"],svgDataByHeight$16={16:{width:16,path:vM.createElement("path",{d:"M6.5.75V2h3V.75a.75.75 0 0 1 1.5 0V2h1.25c.966 0 1.75.784 1.75 1.75V5h1.25a.75.75 0 0 1 0 1.5H14v3h1.25a.75.75 0 0 1 0 1.5H14v1.25A1.75 1.75 0 0 1 12.25 14H11v1.25a.75.75 0 0 1-1.5 0V14h-3v1.25a.75.75 0 0 1-1.5 0V14H3.75A1.75 1.75 0 0 1 2 12.25V11H.75a.75.75 0 0 1 0-1.5H2v-3H.75a.75.75 0 0 1 0-1.5H2V3.75C2 2.784 2.784 2 3.75 2H5V.75a.75.75 0 0 1 1.5 0Zm5.75 11.75a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25ZM5.75 5h4.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1-.75-.75v-4.5A.75.75 0 0 1 5.75 5Zm.75 4.5h3v-3h-3Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M8.75 8h6.5a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-.75.75h-6.5a.75.75 0 0 1-.75-.75v-6.5A.75.75 0 0 1 8.75 8Zm.75 6.5h5v-5h-5Z"}),vM.createElement("path",{d:"M15.25 1a.75.75 0 0 1 .75.75V4h2.25c.966 0 1.75.784 1.75 1.75V8h2.25a.75.75 0 0 1 0 1.5H20v5h2.25a.75.75 0 0 1 0 1.5H20v2.25A1.75 1.75 0 0 1 18.25 20H16v2.25a.75.75 0 0 1-1.5 0V20h-5v2.25a.75.75 0 0 1-1.5 0V20H5.75A1.75 1.75 0 0 1 4 18.25V16H1.75a.75.75 0 0 1 0-1.5H4v-5H1.75a.75.75 0 0 1 0-1.5H4V5.75C4 4.784 4.784 4 5.75 4H8V1.75a.75.75 0 0 1 1.5 0V4h5V1.75a.75.75 0 0 1 .75-.75Zm3 17.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25Z"}))}},CpuIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-cpu",svgDataByHeight$16,heights$16)});CpuIcon.displayName="CpuIcon";var heights$15=["16","24"],svgDataByHeight$15={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"}),vM.createElement("path",{d:"M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M15.25 14a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5h-3.5Z"}),vM.createElement("path",{d:"M1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25V4.75C0 3.784.784 3 1.75 3Zm-.25 7v9.25c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V10Zm0-5.25V8.5h21V4.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"}))}},CreditCardIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-credit-card",svgDataByHeight$15,heights$15)});CreditCardIcon.displayName="CreditCardIcon";var heights$14=["16","24"],svgDataByHeight$14={16:{width:16,path:vM.createElement("path",{d:"M1 3.5c0-.626.292-1.165.7-1.59.406-.422.956-.767 1.579-1.041C4.525.32 6.195 0 8 0c1.805 0 3.475.32 4.722.869.622.274 1.172.62 1.578 1.04.408.426.7.965.7 1.591v9c0 .626-.292 1.165-.7 1.59-.406.422-.956.767-1.579 1.041C11.476 15.68 9.806 16 8 16c-1.805 0-3.475-.32-4.721-.869-.623-.274-1.173-.62-1.579-1.04-.408-.426-.7-.965-.7-1.591Zm1.5 0c0 .133.058.318.282.551.227.237.591.483 1.101.707C4.898 5.205 6.353 5.5 8 5.5c1.646 0 3.101-.295 4.118-.742.508-.224.873-.471 1.1-.708.224-.232.282-.417.282-.55 0-.133-.058-.318-.282-.551-.227-.237-.591-.483-1.101-.707C11.102 1.795 9.647 1.5 8 1.5c-1.646 0-3.101.295-4.118.742-.508.224-.873.471-1.1.708-.224.232-.282.417-.282.55Zm0 4.5c0 .133.058.318.282.551.227.237.591.483 1.101.707C4.898 9.705 6.353 10 8 10c1.646 0 3.101-.295 4.118-.742.508-.224.873-.471 1.1-.708.224-.232.282-.417.282-.55V5.724c-.241.15-.503.286-.778.407C11.475 6.68 9.805 7 8 7c-1.805 0-3.475-.32-4.721-.869a6.15 6.15 0 0 1-.779-.407Zm0 2.225V12.5c0 .133.058.318.282.55.227.237.592.484 1.1.708 1.016.447 2.471.742 4.118.742 1.647 0 3.102-.295 4.117-.742.51-.224.874-.47 1.101-.707.224-.233.282-.418.282-.551v-2.275c-.241.15-.503.285-.778.406-1.247.549-2.917.869-4.722.869-1.805 0-3.475-.32-4.721-.869a6.327 6.327 0 0 1-.779-.406Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 1.25c2.487 0 4.773.402 6.466 1.079.844.337 1.577.758 2.112 1.264.536.507.922 1.151.922 1.907v12.987l-.026.013h.026c0 .756-.386 1.4-.922 1.907-.535.506-1.268.927-2.112 1.264-1.693.677-3.979 1.079-6.466 1.079s-4.774-.402-6.466-1.079c-.844-.337-1.577-.758-2.112-1.264C2.886 19.9 2.5 19.256 2.5 18.5h.026l-.026-.013V5.5c0-.756.386-1.4.922-1.907.535-.506 1.268-.927 2.112-1.264C7.226 1.652 9.513 1.25 12 1.25ZM4 14.371v4.116l-.013.013H4c0 .211.103.487.453.817.351.332.898.666 1.638.962 1.475.589 3.564.971 5.909.971 2.345 0 4.434-.381 5.909-.971.739-.296 1.288-.63 1.638-.962.349-.33.453-.607.453-.817h.013L20 18.487v-4.116a7.85 7.85 0 0 1-1.534.8c-1.693.677-3.979 1.079-6.466 1.079s-4.774-.402-6.466-1.079a7.843 7.843 0 0 1-1.534-.8ZM20 12V7.871a7.85 7.85 0 0 1-1.534.8C16.773 9.348 14.487 9.75 12 9.75s-4.774-.402-6.466-1.079A7.85 7.85 0 0 1 4 7.871V12c0 .21.104.487.453.817.35.332.899.666 1.638.961 1.475.59 3.564.972 5.909.972 2.345 0 4.434-.382 5.909-.972.74-.295 1.287-.629 1.638-.96.35-.33.453-.607.453-.818ZM4 5.5c0 .211.103.487.453.817.351.332.898.666 1.638.962 1.475.589 3.564.971 5.909.971 2.345 0 4.434-.381 5.909-.971.739-.296 1.288-.63 1.638-.962.349-.33.453-.607.453-.817 0-.211-.103-.487-.453-.817-.351-.332-.898-.666-1.638-.962-1.475-.589-3.564-.971-5.909-.971-2.345 0-4.434.381-5.909.971-.739.296-1.288.63-1.638.962C4.104 5.013 4 5.29 4 5.5Z"})}},DatabaseIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-database",svgDataByHeight$14,heights$14)});DatabaseIcon.displayName="DatabaseIcon";var heights$13=["16","24"],svgDataByHeight$13={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M5.75 7.5a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5a.75.75 0 0 1 .75-.75Zm5.25.75a.75.75 0 0 0-1.5 0v1.5a.75.75 0 0 0 1.5 0v-1.5Z"}),vM.createElement("path",{d:"M6.25 0h2A.75.75 0 0 1 9 .75V3.5h3.25a2.25 2.25 0 0 1 2.25 2.25V8h.75a.75.75 0 0 1 0 1.5h-.75v2.75a2.25 2.25 0 0 1-2.25 2.25h-8.5a2.25 2.25 0 0 1-2.25-2.25V9.5H.75a.75.75 0 0 1 0-1.5h.75V5.75A2.25 2.25 0 0 1 3.75 3.5H7.5v-2H6.25a.75.75 0 0 1 0-1.5ZM3 5.75v6.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-6.5a.75.75 0 0 0-.75-.75h-8.5a.75.75 0 0 0-.75.75Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M8.75 11a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Zm7.25.75a.75.75 0 0 0-1.5 0v3.5a.75.75 0 0 0 1.5 0v-3.5Z"}),vM.createElement("path",{d:"M9.813 1h2.437a.75.75 0 0 1 .75.75V5h6.75A2.25 2.25 0 0 1 22 7.25v5.25h1.25a.75.75 0 0 1 0 1.5H22v5.75A2.25 2.25 0 0 1 19.75 22H4.25A2.25 2.25 0 0 1 2 19.75V14H.75a.75.75 0 0 1 0-1.5H2V7.25A2.25 2.25 0 0 1 4.25 5h7.25V2.5H9.813A.75.75 0 0 1 9.812 1ZM3.5 7.25v12.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V7.25a.75.75 0 0 0-.75-.75H4.25a.75.75 0 0 0-.75.75Z"}))}},DependabotIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-dependabot",svgDataByHeight$13,heights$13)});DependabotIcon.displayName="DependabotIcon";var heights$12=["16","24"],svgDataByHeight$12={16:{width:16,path:vM.createElement("path",{d:"M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"})},24:{width:24,path:vM.createElement("path",{d:"M8.954 17H2.75A1.75 1.75 0 0 1 1 15.25V3.75C1 2.784 1.784 2 2.75 2h18.5c.966 0 1.75.784 1.75 1.75v11.5A1.75 1.75 0 0 1 21.25 17h-6.204c.171 1.375.805 2.652 1.769 3.757A.752.752 0 0 1 16.25 22h-8.5a.75.75 0 0 1-.565-1.243c.964-1.105 1.598-2.382 1.769-3.757ZM21.5 3.75a.25.25 0 0 0-.25-.25H2.75a.25.25 0 0 0-.25.25v11.5c0 .138.112.25.25.25h18.5a.25.25 0 0 0 .25-.25ZM13.537 17h-3.074c-.126 1.266-.564 2.445-1.223 3.5h5.52c-.659-1.055-1.098-2.234-1.223-3.5Z"})}},DeviceDesktopIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-device-desktop",svgDataByHeight$12,heights$12)});DeviceDesktopIcon.displayName="DeviceDesktopIcon";var heights$11=["16","24"],svgDataByHeight$11={16:{width:16,path:vM.createElement("path",{d:"M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M10.25 5.25A.75.75 0 0 1 11 4.5h2A.75.75 0 0 1 13 6h-2a.75.75 0 0 1-.75-.75ZM12 19.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),vM.createElement("path",{d:"M4 2.75C4 1.784 4.784 1 5.75 1h12.5c.966 0 1.75.784 1.75 1.75v18.5A1.75 1.75 0 0 1 18.25 23H5.75A1.75 1.75 0 0 1 4 21.25Zm1.75-.25a.25.25 0 0 0-.25.25v18.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V2.75a.25.25 0 0 0-.25-.25Z"}))}},DeviceMobileIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-device-mobile",svgDataByHeight$11,heights$11)});DeviceMobileIcon.displayName="DeviceMobileIcon";var heights$10=["16","24"],svgDataByHeight$10={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"}),vM.createElement("path",{d:"M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M4.75 17.25a.75.75 0 0 1 .75.75v2.25c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V18a.75.75 0 0 1 1.5 0v2.25A1.75 1.75 0 0 1 18.25 22H5.75A1.75 1.75 0 0 1 4 20.25V18a.75.75 0 0 1 .75-.75Z"}),vM.createElement("path",{d:"M5.22 9.97a.749.749 0 0 1 1.06 0l4.97 4.969V2.75a.75.75 0 0 1 1.5 0v12.189l4.97-4.969a.749.749 0 1 1 1.06 1.06l-6.25 6.25a.749.749 0 0 1-1.06 0l-6.25-6.25a.749.749 0 0 1 0-1.06Z"}))}},DownloadIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-download",svgDataByHeight$10,heights$10)});DownloadIcon.displayName="DownloadIcon";var heights$$=["16","24"],svgDataByHeight$$={16:{width:16,path:vM.createElement("path",{d:"M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"})},24:{width:24,path:vM.createElement("path",{d:"M3 3a2 2 0 0 1 2-2h9.982a2 2 0 0 1 1.414.586l4.018 4.018A2 2 0 0 1 21 7.018V21a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v18a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5V8.5h-4a2 2 0 0 1-2-2v-4Zm10 0v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 0-.146-.336l-4.018-4.018A.5.5 0 0 0 15 2.5Z"})}},FileIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-file",svgDataByHeight$$,heights$$)});FileIcon.displayName="FileIcon";var heights$_=["16","24"],svgDataByHeight$_={16:{width:16,path:vM.createElement("path",{d:"M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M12 15c.199 0 .389.079.53.22l3.25 3.25a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L12 16.81l-2.72 2.72a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25A.749.749 0 0 1 12 15Z"}),vM.createElement("path",{d:"M12.53 8.78a.75.75 0 0 1-1.06 0L8.22 5.53a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L12 7.19l2.72-2.72a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734ZM12 15.75a.75.75 0 0 1 .75.75v5.75a.75.75 0 0 1-1.5 0V16.5a.75.75 0 0 1 .75-.75Z"}),vM.createElement("path",{d:"M12 8.5a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 1.5 0v6a.75.75 0 0 1-.75.75ZM2.75 12a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Z"}))}},FoldIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-fold",svgDataByHeight$_,heights$_)});FoldIcon.displayName="FoldIcon";var heights$Z=["16","24"],svgDataByHeight$Z={16:{width:16,path:vM.createElement("path",{d:"M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-1.5 0a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"}),vM.createElement("path",{d:"M12 1c.266 0 .532.009.797.028.763.055 1.345.617 1.512 1.304l.352 1.45c.019.078.09.171.225.221.247.089.49.19.728.302.13.061.246.044.315.002l1.275-.776c.603-.368 1.411-.353 1.99.147.402.349.78.726 1.128 1.129.501.578.515 1.386.147 1.99l-.776 1.274c-.042.069-.058.185.002.315.112.238.213.481.303.728.048.135.142.205.22.225l1.45.352c.687.167 1.249.749 1.303 1.512.038.531.038 1.063 0 1.594-.054.763-.616 1.345-1.303 1.512l-1.45.352c-.078.019-.171.09-.221.225-.089.248-.19.491-.302.728-.061.13-.044.246-.002.315l.776 1.275c.368.603.353 1.411-.147 1.99-.349.402-.726.78-1.129 1.128-.578.501-1.386.515-1.99.147l-1.274-.776c-.069-.042-.185-.058-.314.002a8.606 8.606 0 0 1-.729.303c-.135.048-.205.142-.225.22l-.352 1.45c-.167.687-.749 1.249-1.512 1.303-.531.038-1.063.038-1.594 0-.763-.054-1.345-.616-1.512-1.303l-.352-1.45c-.019-.078-.09-.171-.225-.221a8.138 8.138 0 0 1-.728-.302c-.13-.061-.246-.044-.315-.002l-1.275.776c-.603.368-1.411.353-1.99-.147-.402-.349-.78-.726-1.128-1.129-.501-.578-.515-1.386-.147-1.99l.776-1.274c.042-.069.058-.185-.002-.314a8.606 8.606 0 0 1-.303-.729c-.048-.135-.142-.205-.22-.225l-1.45-.352c-.687-.167-1.249-.749-1.304-1.512a11.158 11.158 0 0 1 0-1.594c.055-.763.617-1.345 1.304-1.512l1.45-.352c.078-.019.171-.09.221-.225.089-.248.19-.491.302-.728.061-.13.044-.246.002-.315l-.776-1.275c-.368-.603-.353-1.411.147-1.99.349-.402.726-.78 1.129-1.128.578-.501 1.386-.515 1.99-.147l1.274.776c.069.042.185.058.315-.002.238-.112.481-.213.728-.303.135-.048.205-.142.225-.22l.352-1.45c.167-.687.749-1.249 1.512-1.304C11.466 1.01 11.732 1 12 1Zm-.69 1.525c-.055.004-.135.05-.161.161l-.353 1.45a1.832 1.832 0 0 1-1.172 1.277 7.147 7.147 0 0 0-.6.249 1.833 1.833 0 0 1-1.734-.074l-1.274-.776c-.098-.06-.186-.036-.228 0a9.774 9.774 0 0 0-.976.976c-.036.042-.06.131 0 .228l.776 1.274c.314.529.342 1.18.074 1.734a7.147 7.147 0 0 0-.249.6 1.831 1.831 0 0 1-1.278 1.173l-1.45.351c-.11.027-.156.107-.16.162a9.63 9.63 0 0 0 0 1.38c.004.055.05.135.161.161l1.45.353a1.832 1.832 0 0 1 1.277 1.172c.074.204.157.404.249.6.268.553.24 1.204-.074 1.733l-.776 1.275c-.06.098-.036.186 0 .228.301.348.628.675.976.976.042.036.131.06.228 0l1.274-.776a1.83 1.83 0 0 1 1.734-.075c.196.093.396.176.6.25a1.831 1.831 0 0 1 1.173 1.278l.351 1.45c.027.11.107.156.162.16a9.63 9.63 0 0 0 1.38 0c.055-.004.135-.05.161-.161l.353-1.45a1.834 1.834 0 0 1 1.172-1.278 6.82 6.82 0 0 0 .6-.248 1.831 1.831 0 0 1 1.733.074l1.275.776c.098.06.186.036.228 0 .348-.301.675-.628.976-.976.036-.042.06-.131 0-.228l-.776-1.275a1.834 1.834 0 0 1-.075-1.733c.093-.196.176-.396.25-.6a1.831 1.831 0 0 1 1.278-1.173l1.45-.351c.11-.027.156-.107.16-.162a9.63 9.63 0 0 0 0-1.38c-.004-.055-.05-.135-.161-.161l-1.45-.353c-.626-.152-1.08-.625-1.278-1.172a6.576 6.576 0 0 0-.248-.6 1.833 1.833 0 0 1 .074-1.734l.776-1.274c.06-.098.036-.186 0-.228a9.774 9.774 0 0 0-.976-.976c-.042-.036-.131-.06-.228 0l-1.275.776a1.831 1.831 0 0 1-1.733.074 6.88 6.88 0 0 0-.6-.249 1.835 1.835 0 0 1-1.173-1.278l-.351-1.45c-.027-.11-.107-.156-.162-.16a9.63 9.63 0 0 0-1.38 0Z"}))}},GearIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-gear",svgDataByHeight$Z,heights$Z)});GearIcon.displayName="GearIcon";var heights$Y=["16","24"],svgDataByHeight$Y={16:{width:16,path:vM.createElement("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M15 4.75a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM2.5 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 6.5Z"}),vM.createElement("path",{d:"M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z"}),vM.createElement("path",{d:"M17.5 8.75v-1H19v1a3.75 3.75 0 0 1-3.75 3.75h-7a1.75 1.75 0 0 0-1.75 1.75H5A3.25 3.25 0 0 1 8.25 11h7a2.25 2.25 0 0 0 2.25-2.25Z"}))}},GitBranchIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-git-branch",svgDataByHeight$Y,heights$Y)});GitBranchIcon.displayName="GitBranchIcon";var heights$X=["16","24"],svgDataByHeight$X={16:{width:16,path:vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1Zm3.241 10.5v-.001c-.1-2.708-.992-4.904-1.89-6.452a13.919 13.919 0 0 0-1.304-1.88L12 3.11l-.047.059c-.354.425-.828 1.06-1.304 1.88-.898 1.547-1.79 3.743-1.89 6.451Zm-12.728 0h4.745c.1-3.037 1.1-5.49 2.093-7.204.39-.672.78-1.233 1.119-1.673C6.11 3.329 2.746 7 2.513 11.5Zm18.974 0C21.254 7 17.89 3.329 13.53 2.623c.339.44.729 1.001 1.119 1.673.993 1.714 1.993 4.167 2.093 7.204ZM8.787 13c.182 2.478 1.02 4.5 1.862 5.953.382.661.818 1.29 1.304 1.88l.047.057.047-.059c.354-.425.828-1.06 1.304-1.88.842-1.451 1.679-3.471 1.862-5.951Zm-1.504 0H2.552a9.505 9.505 0 0 0 7.918 8.377 15.773 15.773 0 0 1-1.119-1.673C8.413 18.085 7.47 15.807 7.283 13Zm9.434 0c-.186 2.807-1.13 5.085-2.068 6.704-.39.672-.78 1.233-1.118 1.673A9.506 9.506 0 0 0 21.447 13Z"})}},GlobeIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-globe",svgDataByHeight$X,heights$X)});GlobeIcon.displayName="GlobeIcon";var heights$W=["16","24"],svgDataByHeight$W={16:{width:16,path:vM.createElement("path",{d:"M10 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0-4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm5-9a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement("path",{d:"M9 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm7-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm7-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 18a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm6 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})}},GrabberIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-grabber",svgDataByHeight$W,heights$W)});GrabberIcon.displayName="GrabberIcon";var heights$V=["16","24"],svgDataByHeight$V={16:{width:16,path:vM.createElement("path",{d:"M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M2.5 2.75a.75.75 0 0 0-1.5 0v18.5c0 .414.336.75.75.75H20a.75.75 0 0 0 0-1.5H2.5V2.75Z"}),vM.createElement("path",{d:"M22.28 7.78a.75.75 0 0 0-1.06-1.06l-5.72 5.72-3.72-3.72a.75.75 0 0 0-1.06 0l-6 6a.75.75 0 1 0 1.06 1.06l5.47-5.47 3.72 3.72a.75.75 0 0 0 1.06 0l6.25-6.25Z"}))}},GraphIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-graph",svgDataByHeight$V,heights$V)});GraphIcon.displayName="GraphIcon";var heights$U=["16","24"],svgDataByHeight$U={16:{width:16,path:vM.createElement("path",{d:"m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"})},24:{width:24,path:vM.createElement("path",{d:"m12 20.703.343.667a.748.748 0 0 1-.686 0l-.003-.002-.007-.003-.025-.013a31.138 31.138 0 0 1-5.233-3.576C3.8 15.573 1 12.332 1 8.514v-.001C1 5.053 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262a31.148 31.148 0 0 1-5.233 3.576l-.025.013-.007.003-.002.001ZM6.736 4C4.657 4 2.5 5.88 2.5 8.514c0 3.107 2.324 5.96 4.861 8.12a29.655 29.655 0 0 0 4.566 3.175l.073.041.073-.04c.271-.153.661-.38 1.13-.674.94-.588 2.19-1.441 3.436-2.502 2.537-2.16 4.861-5.013 4.861-8.12C21.5 5.88 19.343 4 17.264 4c-2.106 0-3.801 1.389-4.553 3.643a.751.751 0 0 1-1.422 0C10.537 5.389 8.841 4 6.736 4Z"})}},HeartIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-heart",svgDataByHeight$U,heights$U)});HeartIcon.displayName="HeartIcon";var heights$T=["16","24"],svgDataByHeight$T={16:{width:16,path:vM.createElement("path",{d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M13 7.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-3 3.75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v4.25h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5h.75V12h-.75a.75.75 0 0 1-.75-.75Z"}),vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"}))}},InfoIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-info",svgDataByHeight$T,heights$T)});InfoIcon.displayName="InfoIcon";var heights$S=["16","24"],svgDataByHeight$S={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"}))},24:{width:24,path:vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"})}},IssueOpenedIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-issue-opened",svgDataByHeight$S,heights$S)});IssueOpenedIcon.displayName="IssueOpenedIcon";var heights$R=["16","24"],svgDataByHeight$R={16:{width:16,path:vM.createElement("path",{d:"M10.5 0a5.499 5.499 0 1 1-1.288 10.848l-.932.932a.749.749 0 0 1-.53.22H7v.75a.749.749 0 0 1-.22.53l-.5.5a.749.749 0 0 1-.53.22H5v.75a.749.749 0 0 1-.22.53l-.5.5a.749.749 0 0 1-.53.22h-2A1.75 1.75 0 0 1 0 14.25v-2c0-.199.079-.389.22-.53l4.932-4.932A5.5 5.5 0 0 1 10.5 0Zm-4 5.5c-.001.431.069.86.205 1.269a.75.75 0 0 1-.181.768L1.5 12.56v1.69c0 .138.112.25.25.25h1.69l.06-.06v-1.19a.75.75 0 0 1 .75-.75h1.19l.06-.06v-1.19a.75.75 0 0 1 .75-.75h1.19l1.023-1.025a.75.75 0 0 1 .768-.18A4 4 0 1 0 6.5 5.5ZM11 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M16.75 8.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"}),vM.createElement("path",{d:"M15.75 0a8.25 8.25 0 1 1-2.541 16.101l-1.636 1.636a1.744 1.744 0 0 1-1.237.513H9.25a.25.25 0 0 0-.25.25v1.448a.876.876 0 0 1-.256.619l-.214.213a.75.75 0 0 1-.545.22H5.25a.25.25 0 0 0-.25.25v1A1.75 1.75 0 0 1 3.25 24h-1.5A1.75 1.75 0 0 1 0 22.25v-2.836c0-.464.185-.908.513-1.236l7.386-7.388A8.249 8.249 0 0 1 15.75 0ZM9 8.25a6.733 6.733 0 0 0 .463 2.462.75.75 0 0 1-.168.804l-7.722 7.721a.25.25 0 0 0-.073.177v2.836c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-1c0-.966.784-1.75 1.75-1.75H7.5v-1c0-.966.784-1.75 1.75-1.75h1.086a.25.25 0 0 0 .177-.073l1.971-1.972a.75.75 0 0 1 .804-.168A6.75 6.75 0 1 0 9 8.25Z"}))}},KeyIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-key",svgDataByHeight$R,heights$R)});KeyIcon.displayName="KeyIcon";var heights$Q=["16","24"],svgDataByHeight$Q={16:{width:16,path:vM.createElement("path",{d:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 2.5c-3.81 0-6.5 2.743-6.5 6.119 0 1.536.632 2.572 1.425 3.56.172.215.347.422.527.635l.096.112c.21.25.427.508.63.774.404.531.783 1.128.995 1.834a.75.75 0 0 1-1.436.432c-.138-.46-.397-.89-.753-1.357a18.111 18.111 0 0 0-.582-.714l-.092-.11c-.18-.212-.37-.436-.555-.667C4.87 12.016 4 10.651 4 8.618 4 4.363 7.415 1 12 1s8 3.362 8 7.619c0 2.032-.87 3.397-1.755 4.5-.185.23-.375.454-.555.667l-.092.109c-.21.248-.405.481-.582.714-.356.467-.615.898-.753 1.357a.751.751 0 0 1-1.437-.432c.213-.706.592-1.303.997-1.834.202-.266.419-.524.63-.774l.095-.112c.18-.213.355-.42.527-.634.793-.99 1.425-2.025 1.425-3.561C18.5 5.243 15.81 2.5 12 2.5ZM8.75 18h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5Zm.75 3.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75Z"})}},LightBulbIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-light-bulb",svgDataByHeight$Q,heights$Q)});LightBulbIcon.displayName="LightBulbIcon";var heights$P=["16","24"],svgDataByHeight$P={16:{width:16,path:vM.createElement("path",{d:"M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M15.5 2.25a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-1.5 0V4.06l-6.22 6.22a.75.75 0 1 1-1.06-1.06L19.94 3h-3.69a.75.75 0 0 1-.75-.75Z"}),vM.createElement("path",{d:"M2.5 4.25c0-.966.784-1.75 1.75-1.75h8.5a.75.75 0 0 1 0 1.5h-8.5a.25.25 0 0 0-.25.25v15.5c0 .138.112.25.25.25h15.5a.25.25 0 0 0 .25-.25v-8.5a.75.75 0 0 1 1.5 0v8.5a1.75 1.75 0 0 1-1.75 1.75H4.25a1.75 1.75 0 0 1-1.75-1.75V4.25Z"}))}},LinkExternalIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-link-external",svgDataByHeight$P,heights$P)});LinkExternalIcon.displayName="LinkExternalIcon";var heights$O=["16","24"],svgDataByHeight$O={16:{width:16,path:vM.createElement("path",{d:"M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement("path",{d:"M8.75 5.5h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5Zm0 6h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5Zm0 6h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5ZM5 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM4 7a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 12a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})}},ListUnorderedIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-list-unordered",svgDataByHeight$O,heights$O)});ListUnorderedIcon.displayName="ListUnorderedIcon";var heights$N=["16","24"],svgDataByHeight$N={16:{width:16,path:vM.createElement("path",{d:"M1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25v-8.5C0 2.784.784 2 1.75 2ZM1.5 12.251c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V5.809L8.38 9.397a.75.75 0 0 1-.76 0L1.5 5.809v6.442Zm13-8.181v-.32a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25v.32L8 7.88Z"})},24:{width:24,path:vM.createElement("path",{d:"M1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 18.75v-14C0 3.784.784 3 1.75 3ZM1.5 7.412V18.75c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V7.412l-9.52 6.433c-.592.4-1.368.4-1.96 0Zm0-2.662v.852l10.36 7a.25.25 0 0 0 .28 0l10.36-7V4.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"})}},MailIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-mail",svgDataByHeight$N,heights$N)});MailIcon.displayName="MailIcon";var heights$M=["16","24"],svgDataByHeight$M={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M3.25 9a.75.75 0 0 1 .75.75c0 2.142.456 3.828.733 4.653a.122.122 0 0 0 .05.064.212.212 0 0 0 .117.033h1.31c.085 0 .18-.042.258-.152a.45.45 0 0 0 .075-.366A16.743 16.743 0 0 1 6 9.75a.75.75 0 0 1 1.5 0c0 1.588.25 2.926.494 3.85.293 1.113-.504 2.4-1.783 2.4H4.9c-.686 0-1.35-.41-1.589-1.12A16.4 16.4 0 0 1 2.5 9.75.75.75 0 0 1 3.25 9Z"}),vM.createElement("path",{d:"M0 6a4 4 0 0 1 4-4h2.75a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-.75.75H4a4 4 0 0 1-4-4Zm4-2.5a2.5 2.5 0 1 0 0 5h2v-5Z"}),vM.createElement("path",{d:"M15.59.082A.75.75 0 0 1 16 .75v10.5a.75.75 0 0 1-1.189.608l-.002-.001h.001l-.014-.01a5.775 5.775 0 0 0-.422-.25 10.63 10.63 0 0 0-1.469-.64C11.576 10.484 9.536 10 6.75 10a.75.75 0 0 1 0-1.5c2.964 0 5.174.516 6.658 1.043.423.151.787.302 1.092.443V2.014c-.305.14-.669.292-1.092.443C11.924 2.984 9.713 3.5 6.75 3.5a.75.75 0 0 1 0-1.5c2.786 0 4.826-.484 6.155-.957.665-.236 1.154-.47 1.47-.64.144-.077.284-.161.421-.25l.014-.01a.75.75 0 0 1 .78-.061Z"}))},24:{width:24,path:vM.createElement("path",{d:"M22 1.75v14.5a.75.75 0 0 1-.399.662c-.384.204-.783-.035-1.139-.248l-.003-.002c-.09-.054-.177-.107-.261-.15a15.53 15.53 0 0 0-2-.849c-1.738-.607-4.321-1.223-7.703-1.251a.833.833 0 0 1 .005.088c0 2.279.494 4.279.906 5.547.368 1.131-.438 2.453-1.732 2.453H7.661c-.696 0-1.36-.42-1.6-1.129C5.684 20.255 5 17.811 5 14.75v-.457A5.5 5.5 0 0 1 6.5 3.5h3.75c3.505 0 6.175-.61 7.955-1.21a15.88 15.88 0 0 0 2.002-.82 9.21 9.21 0 0 0 .49-.262c.048-.028.095-.055.142-.085A.751.751 0 0 1 22 1.75ZM10.5 12.912c3.564.029 6.313.678 8.193 1.335.737.258 1.34.517 1.807.74V2.993c-.467.216-1.073.467-1.815.718-1.878.634-4.624 1.26-8.185 1.288ZM6.5 5a4 4 0 0 0 0 8H9V5Zm0 9.75c0 2.847.638 5.123.982 6.141.018.051.074.109.179.109h2.013c.087 0 .179-.043.249-.147a.396.396 0 0 0 .057-.343C9.537 19.148 9 16.986 9 14.5H6.5Z"})}},MegaphoneIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-megaphone",svgDataByHeight$M,heights$M)});MegaphoneIcon.displayName="MegaphoneIcon";var heights$L=["16","24"],svgDataByHeight$L={16:{width:16,path:vM.createElement("path",{d:"M7.693 1.066a.747.747 0 0 1 .614 0l7.25 3.25a.75.75 0 0 1 0 1.368L13 6.831v2.794c0 1.024-.81 1.749-1.66 2.173-.893.447-2.075.702-3.34.702-.278 0-.55-.012-.816-.036a.75.75 0 0 1 .133-1.494c.22.02.45.03.683.03 1.082 0 2.025-.221 2.67-.543.69-.345.83-.682.83-.832V7.503L8.307 8.934a.747.747 0 0 1-.614 0L4 7.28v1.663c.296.105.575.275.812.512.438.438.688 1.059.688 1.796v3a.75.75 0 0 1-.75.75h-3a.75.75 0 0 1-.75-.75v-3c0-.737.25-1.358.688-1.796.237-.237.516-.407.812-.512V6.606L.443 5.684a.75.75 0 0 1 0-1.368ZM2.583 5 8 7.428 13.416 5 8 2.572ZM2.5 11.25v2.25H4v-2.25c0-.388-.125-.611-.25-.735a.697.697 0 0 0-.5-.203.707.707 0 0 0-.5.203c-.125.124-.25.347-.25.735Z"})},24:{width:24,path:vM.createElement("path",{d:"M12.292 2.06v-.001l11.25 4.75a.749.749 0 0 1 0 1.382L19 10.108V15a.75.75 0 0 1-.11.391h-.001a2.84 2.84 0 0 1-.392.482c-.249.256-.625.58-1.163.896-1.08.638-2.776 1.23-5.334 1.23-.673 0-1.286-.041-1.846-.113a.75.75 0 0 1 .192-1.487c.492.063 1.042.1 1.654.1 2.317 0 3.746-.533 4.572-1.021.31-.178.596-.397.849-.65l.079-.085V10.74l-5.208 2.2a.75.75 0 0 1-.584 0L5.75 10.424v3.17c.502.129.96.391 1.327.758.579.578.923 1.41.923 2.428v4.5a.761.761 0 0 1-.345.634 2.157 2.157 0 0 1-.21.117 3.923 3.923 0 0 1-.52.213A6.121 6.121 0 0 1 5 22.532a6.092 6.092 0 0 1-1.925-.288 4.065 4.065 0 0 1-.52-.213 1.816 1.816 0 0 1-.22-.124.757.757 0 0 1-.335-.624v-4.5c0-1.02.344-1.85.923-2.43a2.904 2.904 0 0 1 1.327-.757V9.793L.458 8.19a.75.75 0 0 1 0-1.38l11.25-4.75a.75.75 0 0 1 .584 0ZM12 11.436 21.322 7.5 12 3.564 2.678 7.5ZM5 15c-.377 0-.745.141-1.017.413-.265.265-.483.7-.483 1.368v4.022c.299.105.797.228 1.5.228s1.201-.123 1.5-.228V16.78c0-.669-.218-1.103-.483-1.368A1.433 1.433 0 0 0 5 15Z"})}},MortarBoardIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-mortar-board",svgDataByHeight$L,heights$L)});MortarBoardIcon.displayName="MortarBoardIcon";var heights$K=["16","24"],svgDataByHeight$K={16:{width:16,path:vM.createElement("path",{d:"M8 2.75v10.5a.751.751 0 0 1-1.238.57L3.473 11H1.75A1.75 1.75 0 0 1 0 9.25v-2.5C0 5.784.784 5 1.75 5h1.722l3.29-2.82A.75.75 0 0 1 8 2.75Zm3.28 2.47L13 6.94l1.72-1.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L14.06 8l1.72 1.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L13 9.06l-1.72 1.72a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L11.94 8l-1.72-1.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-7.042 1.1a.752.752 0 0 1-.488.18h-2a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2c.179 0 .352.064.488.18L6.5 11.62V4.38Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 3.75v16.5a.75.75 0 0 1-1.255.555L5.46 16H2.75A1.75 1.75 0 0 1 1 14.25v-4.5C1 8.784 1.784 8 2.75 8h2.71l5.285-4.805A.75.75 0 0 1 12 3.75ZM6.255 9.305a.748.748 0 0 1-.505.195h-3a.25.25 0 0 0-.25.25v4.5c0 .138.112.25.25.25h3c.187 0 .367.069.505.195l4.245 3.86V5.445ZM16.28 8.22a.75.75 0 1 0-1.06 1.06L17.94 12l-2.72 2.72a.75.75 0 1 0 1.06 1.06L19 13.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L20.06 12l2.72-2.72a.75.75 0 0 0-1.06-1.06L19 10.94l-2.72-2.72Z"})}},MuteIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-mute",svgDataByHeight$K,heights$K)});MuteIcon.displayName="MuteIcon";var heights$J=["16","24"],svgDataByHeight$J={16:{width:16,path:vM.createElement("path",{d:"M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25Zm1.75-.25a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25ZM3.5 6.25a.75.75 0 0 1 .75-.75h7a.75.75 0 0 1 0 1.5h-7a.75.75 0 0 1-.75-.75Zm.75 2.25h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1 0-1.5Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M0 4.75C0 3.784.784 3 1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V4.75a.25.25 0 0 0-.25-.25Z"}),vM.createElement("path",{d:"M5 8.75A.75.75 0 0 1 5.75 8h11.5a.75.75 0 0 1 0 1.5H5.75A.75.75 0 0 1 5 8.75Zm0 4a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1-.75-.75Z"}))}},NoteIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-note",svgDataByHeight$J,heights$J)});NoteIcon.displayName="NoteIcon";var heights$I=["16","24"],svgDataByHeight$I={16:{width:16,path:vM.createElement("path",{d:"M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M6.25 12a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5ZM5.5 9.25a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75ZM6.25 5a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5ZM9 12.75a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Zm.75-4.25a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5ZM9 5.75A.75.75 0 0 1 9.75 5h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 9 5.75ZM13.25 12a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5Zm-.75-2.75a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75ZM13.25 5a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5Z"}),vM.createElement("path",{d:"M2 20V3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v17c0 .173-.022.34-.063.5H20a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.2-.4l-.5-.375a.75.75 0 0 1 .9-1.2l.5.375c.504.378.8.97.8 1.6v8a2 2 0 0 1-2 2h-3.562a.767.767 0 0 1-.166-.018c-.089.012-.18.018-.272.018h-3.75a.75.75 0 0 1-.75-.75V19h-3v2.25a.75.75 0 0 1-.75.75H4a2 2 0 0 1-2-2Zm2 .5h3v-2.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 .75.75v2.25h3a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5H4a.5.5 0 0 0-.5.5v17a.5.5 0 0 0 .5.5Z"}))}},OrganizationIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-organization",svgDataByHeight$I,heights$I)});OrganizationIcon.displayName="OrganizationIcon";var heights$H=["16","24"],svgDataByHeight$H={16:{width:16,path:vM.createElement("path",{d:"m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"})},24:{width:24,path:vM.createElement("path",{d:"M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"})}},PackageIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-package",svgDataByHeight$H,heights$H)});PackageIcon.displayName="PackageIcon";var heights$G=["16","24"],svgDataByHeight$G={16:{width:16,path:vM.createElement("path",{d:"M.989 8 .064 2.68a1.342 1.342 0 0 1 1.85-1.462l13.402 5.744a1.13 1.13 0 0 1 0 2.076L1.913 14.782a1.343 1.343 0 0 1-1.85-1.463L.99 8Zm.603-5.288L2.38 7.25h4.87a.75.75 0 0 1 0 1.5H2.38l-.788 4.538L13.929 8Z"})},24:{width:24,path:vM.createElement("path",{d:"M1.513 1.96a1.374 1.374 0 0 1 1.499-.21l19.335 9.215a1.147 1.147 0 0 1 0 2.07L3.012 22.25a1.374 1.374 0 0 1-1.947-1.46L2.49 12 1.065 3.21a1.375 1.375 0 0 1 .448-1.25Zm2.375 10.79-1.304 8.042L21.031 12 2.584 3.208l1.304 8.042h7.362a.75.75 0 0 1 0 1.5Z"})}},PaperAirplaneIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-paper-airplane",svgDataByHeight$G,heights$G)});PaperAirplaneIcon.displayName="PaperAirplaneIcon";var heights$F=["16","24"],svgDataByHeight$F={16:{width:16,path:vM.createElement("path",{d:"M12.212 3.02a1.753 1.753 0 0 0-2.478.003l-5.83 5.83a3.007 3.007 0 0 0-.88 2.127c0 .795.315 1.551.88 2.116.567.567 1.333.89 2.126.89.79 0 1.548-.321 2.116-.89l5.48-5.48a.75.75 0 0 1 1.061 1.06l-5.48 5.48a4.492 4.492 0 0 1-3.177 1.33c-1.2 0-2.345-.487-3.187-1.33a4.483 4.483 0 0 1-1.32-3.177c0-1.195.475-2.341 1.32-3.186l5.83-5.83a3.25 3.25 0 0 1 5.553 2.297c0 .863-.343 1.691-.953 2.301L7.439 12.39c-.375.377-.884.59-1.416.593a1.998 1.998 0 0 1-1.412-.593 1.992 1.992 0 0 1 0-2.828l5.48-5.48a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-5.48 5.48a.492.492 0 0 0 0 .707.499.499 0 0 0 .352.154.51.51 0 0 0 .356-.154l5.833-5.827a1.755 1.755 0 0 0 0-2.481Z"})},24:{width:24,path:vM.createElement("path",{d:"M19.187 3.588a2.75 2.75 0 0 0-3.889 0L5.575 13.31a4.5 4.5 0 0 0 6.364 6.364l8.662-8.662a.75.75 0 0 1 1.061 1.06L13 20.735a6 6 0 0 1-8.485-8.485l9.723-9.723a4.247 4.247 0 0 1 4.124-1.139 4.247 4.247 0 0 1 3.025 3.025 4.247 4.247 0 0 1-1.139 4.124l-9.193 9.193a2.64 2.64 0 0 1-1.858.779 2.626 2.626 0 0 1-1.854-.779c-.196-.196-.338-.47-.43-.726a2.822 2.822 0 0 1-.168-.946c0-.7.284-1.373.775-1.864l8.132-8.131a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734l-8.131 8.132a1.148 1.148 0 0 0-.336.803c.003.204.053.405.146.587.01.018.018.028.02.032.22.215.501.332.786.332.29 0 .58-.121.798-.34l9.192-9.192a2.75 2.75 0 0 0 0-3.89Z"})}},PaperclipIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-paperclip",svgDataByHeight$F,heights$F)});PaperclipIcon.displayName="PaperclipIcon";var heights$E=["16","24"],svgDataByHeight$E={16:{width:16,path:vM.createElement("path",{d:"M5 2h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Zm5 0h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z"})},24:{width:24,path:vM.createElement("path",{d:"M9 3H7.5A1.5 1.5 0 0 0 6 4.5v15A1.5 1.5 0 0 0 7.5 21H9a1.5 1.5 0 0 0 1.5-1.5v-15A1.5 1.5 0 0 0 9 3Zm7.5 0H15a1.5 1.5 0 0 0-1.5 1.5v15A1.5 1.5 0 0 0 15 21h1.5a1.5 1.5 0 0 0 1.5-1.5v-15A1.5 1.5 0 0 0 16.5 3Z"})}},PauseIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-pause",svgDataByHeight$E,heights$E)});PauseIcon.displayName="PauseIcon";var heights$D=["16","24"],svgDataByHeight$D={16:{width:16,path:vM.createElement("path",{d:"M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"})},24:{width:24,path:vM.createElement("path",{d:"M17.263 2.177a1.75 1.75 0 0 1 2.474 0l2.586 2.586a1.75 1.75 0 0 1 0 2.474L19.53 10.03l-.012.013L8.69 20.378a1.753 1.753 0 0 1-.699.409l-5.523 1.68a.748.748 0 0 1-.747-.188.748.748 0 0 1-.188-.747l1.673-5.5a1.75 1.75 0 0 1 .466-.756L14.476 4.963ZM4.708 16.361a.26.26 0 0 0-.067.108l-1.264 4.154 4.177-1.271a.253.253 0 0 0 .1-.059l10.273-9.806-2.94-2.939-10.279 9.813ZM19 8.44l2.263-2.262a.25.25 0 0 0 0-.354l-2.586-2.586a.25.25 0 0 0-.354 0L16.061 5.5Z"})}},PencilIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-pencil",svgDataByHeight$D,heights$D)});PencilIcon.displayName="PencilIcon";var heights$C=["16","24"],svgDataByHeight$C={16:{width:16,path:vM.createElement("path",{d:"M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"})},24:{width:24,path:vM.createElement("path",{d:"M3.5 8a5.5 5.5 0 1 1 8.596 4.547 9.005 9.005 0 0 1 5.9 8.18.751.751 0 0 1-1.5.045 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.499-.044 9.005 9.005 0 0 1 5.9-8.181A5.496 5.496 0 0 1 3.5 8ZM9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8.29 4c-.148 0-.292.01-.434.03a.75.75 0 1 1-.212-1.484 4.53 4.53 0 0 1 3.38 8.097 6.69 6.69 0 0 1 3.956 6.107.75.75 0 0 1-1.5 0 5.193 5.193 0 0 0-3.696-4.972l-.534-.16v-1.676l.41-.209A3.03 3.03 0 0 0 17.29 8Z"})}},PeopleIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-people",svgDataByHeight$C,heights$C)});PeopleIcon.displayName="PeopleIcon";var heights$B=["16","24"],svgDataByHeight$B={16:{width:16,path:vM.createElement("path",{d:"M10.561 8.073a6.005 6.005 0 0 1 3.432 5.142.75.75 0 1 1-1.498.07 4.5 4.5 0 0 0-8.99 0 .75.75 0 0 1-1.498-.07 6.004 6.004 0 0 1 3.431-5.142 3.999 3.999 0 1 1 5.123 0ZM10.5 5a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 2.5a5.5 5.5 0 0 1 3.096 10.047 9.005 9.005 0 0 1 5.9 8.181.75.75 0 1 1-1.499.044 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.5-.045 9.005 9.005 0 0 1 5.9-8.18A5.5 5.5 0 0 1 12 2.5ZM8 8a4 4 0 1 0 8 0 4 4 0 0 0-8 0Z"})}},PersonIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-person",svgDataByHeight$B,heights$B)});PersonIcon.displayName="PersonIcon";var heights$A=["16","24"],svgDataByHeight$A={16:{width:16,path:vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M9.5 15.584V8.416a.5.5 0 0 1 .77-.42l5.576 3.583a.5.5 0 0 1 0 .842l-5.576 3.584a.5.5 0 0 1-.77-.42Z"}),vM.createElement("path",{d:"M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11-9.5A9.5 9.5 0 0 0 2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5Z"}))}},PlayIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-play",svgDataByHeight$A,heights$A)});PlayIcon.displayName="PlayIcon";var heights$z=["16","24"],svgDataByHeight$z={16:{width:16,path:vM.createElement("path",{d:"M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z"})},24:{width:24,path:vM.createElement("path",{d:"M11.75 4.5a.75.75 0 0 1 .75.75V11h5.75a.75.75 0 0 1 0 1.5H12.5v5.75a.75.75 0 0 1-1.5 0V12.5H5.25a.75.75 0 0 1 0-1.5H11V5.25a.75.75 0 0 1 .75-.75Z"})}},PlusIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-plus",svgDataByHeight$z,heights$z)});PlusIcon.displayName="PlusIcon";var heights$y=["16","24"],svgDataByHeight$y={16:{width:16,path:vM.createElement("path",{d:"M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"})},24:{width:24,path:vM.createElement("path",{d:"M9.002 2.5a.75.75 0 0 1 .691.464l6.302 15.305 2.56-6.301a.75.75 0 0 1 .695-.468h4a.75.75 0 0 1 0 1.5h-3.495l-3.06 7.532a.75.75 0 0 1-1.389.004L8.997 5.21l-3.054 7.329A.75.75 0 0 1 5.25 13H.75a.75.75 0 0 1 0-1.5h4l3.558-8.538a.75.75 0 0 1 .694-.462Z"})}},PulseIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-pulse",svgDataByHeight$y,heights$y)});PulseIcon.displayName="PulseIcon";var heights$x=["16","24"],svgDataByHeight$x={16:{width:16,path:vM.createElement("path",{d:"M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M20.322.75h1.176a1.75 1.75 0 0 1 1.75 1.749v1.177a10.75 10.75 0 0 1-2.925 7.374l-1.228 1.304a23.699 23.699 0 0 1-1.596 1.542v5.038c0 .615-.323 1.184-.85 1.5l-4.514 2.709a.75.75 0 0 1-1.12-.488l-.963-4.572a1.305 1.305 0 0 1-.14-.129L8.04 15.96l-1.994-1.873a1.305 1.305 0 0 1-.129-.14l-4.571-.963a.75.75 0 0 1-.49-1.12l2.71-4.514c.316-.527.885-.85 1.5-.85h5.037a23.668 23.668 0 0 1 1.542-1.594l1.304-1.23A10.753 10.753 0 0 1 20.321.75Zm-6.344 4.018v-.001l-1.304 1.23a22.275 22.275 0 0 0-3.255 3.851l-2.193 3.29 1.859 1.744a.545.545 0 0 1 .034.034l1.743 1.858 3.288-2.192a22.263 22.263 0 0 0 3.854-3.257l1.228-1.303a9.251 9.251 0 0 0 2.517-6.346V2.5a.25.25 0 0 0-.25-.25h-1.177a9.252 9.252 0 0 0-6.344 2.518ZM6.5 21c-1.209 1.209-3.901 1.445-4.743 1.49a.236.236 0 0 1-.18-.067.236.236 0 0 1-.067-.18c.045-.842.281-3.534 1.49-4.743.9-.9 2.6-.9 3.5 0 .9.9.9 2.6 0 3.5Zm-.592-8.588L8.17 9.017c.23-.346.47-.685.717-1.017H5.066a.25.25 0 0 0-.214.121l-2.167 3.612ZM16 15.112c-.333.248-.672.487-1.018.718l-3.393 2.262.678 3.223 3.612-2.167a.25.25 0 0 0 .121-.214ZM17.5 8a1.5 1.5 0 1 1-3.001-.001A1.5 1.5 0 0 1 17.5 8Z"})}},RocketIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-rocket",svgDataByHeight$x,heights$x)});RocketIcon.displayName="RocketIcon";var heights$w=["16","24"],svgDataByHeight$w={16:{width:16,path:vM.createElement("path",{d:"M16 10.75v2.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25v-2.5C0 9.784.784 9 1.75 9h12.5c.966 0 1.75.784 1.75 1.75Zm0-8v2.5A1.75 1.75 0 0 1 14.25 7H1.75A1.75 1.75 0 0 1 0 5.25v-2.5C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75Zm-1.75-.25H1.75a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Zm0 8H1.75a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Z"})},24:{width:24,path:vM.createElement("path",{d:"M22 3.75v5.5A1.75 1.75 0 0 1 20.25 11H3.75A1.75 1.75 0 0 1 2 9.25v-5.5C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75Zm0 11v5.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25v-5.5c0-.966.784-1.75 1.75-1.75h16.5c.966 0 1.75.784 1.75 1.75ZM20.25 3.5H3.75a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25Zm0 11H3.75a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25Z"})}},RowsIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-rows",svgDataByHeight$w,heights$w)});RowsIcon.displayName="RowsIcon";var heights$v=["16","24"],svgDataByHeight$v={16:{width:16,path:vM.createElement("path",{d:"M2.002 2.725a.75.75 0 0 1 .797-.699C8.79 2.42 13.58 7.21 13.974 13.201a.75.75 0 0 1-1.497.098 10.502 10.502 0 0 0-9.776-9.776.747.747 0 0 1-.7-.798ZM2.84 7.05h-.002a7.002 7.002 0 0 1 6.113 6.111.75.75 0 0 1-1.49.178 5.503 5.503 0 0 0-4.8-4.8.75.75 0 0 1 .179-1.489ZM2 13a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M3.5 3.25a.75.75 0 0 1 .75-.75C14.053 2.5 22 10.447 22 20.25a.75.75 0 0 1-1.5 0C20.5 11.275 13.225 4 4.25 4a.75.75 0 0 1-.75-.75Zm.75 6.25C10.187 9.5 15 14.313 15 20.25a.75.75 0 0 1-1.5 0A9.25 9.25 0 0 0 4.25 11a.75.75 0 0 1 0-1.5ZM3.5 19a2 2 0 1 1 3.999-.001A2 2 0 0 1 3.5 19Z"})}},RssIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-rss",svgDataByHeight$v,heights$v)});RssIcon.displayName="RssIcon";var heights$u=["16","24"],svgDataByHeight$u={16:{width:16,path:vM.createElement("path",{d:"M1.75 10a.75.75 0 0 1 .75.75v2.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 0 1.5h-2.5A1.75 1.75 0 0 1 1 13.25v-2.5a.75.75 0 0 1 .75-.75Zm12.5 0a.75.75 0 0 1 .75.75v2.5A1.75 1.75 0 0 1 13.25 15h-2.5a.75.75 0 0 1 0-1.5h2.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 .75-.75ZM2.75 2.5a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0v-2.5C1 1.784 1.784 1 2.75 1h2.5a.75.75 0 0 1 0 1.5ZM10 1.75a.75.75 0 0 1 .75-.75h2.5c.966 0 1.75.784 1.75 1.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.25.25 0 0 0-.25-.25h-2.5a.75.75 0 0 1-.75-.75Z"})},24:{width:24,path:vM.createElement("path",{d:"M3.75 15a.75.75 0 0 1 .75.75v3.5c0 .138.112.25.25.25h3.5a.75.75 0 0 1 0 1.5h-3.5A1.75 1.75 0 0 1 3 19.25v-3.5a.75.75 0 0 1 .75-.75Zm16.5 0a.75.75 0 0 1 .75.75v3.5A1.75 1.75 0 0 1 19.25 21h-3.5a.75.75 0 0 1 0-1.5h3.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 .75-.75ZM4.75 4.5a.25.25 0 0 0-.25.25v3.5a.75.75 0 0 1-1.5 0v-3.5C3 3.784 3.784 3 4.75 3h3.5a.75.75 0 0 1 0 1.5ZM15 3.75a.75.75 0 0 1 .75-.75h3.5c.966 0 1.75.784 1.75 1.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1-.75-.75Z"})}},ScreenFullIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-screen-full",svgDataByHeight$u,heights$u)});ScreenFullIcon.displayName="ScreenFullIcon";var heights$t=["16","24"],svgDataByHeight$t={16:{width:16,path:vM.createElement("path",{d:"M10.75 1a.75.75 0 0 1 .75.75v2.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 0 1.5h-2.5A1.75 1.75 0 0 1 10 4.25v-2.5a.75.75 0 0 1 .75-.75Zm-5.5 0a.75.75 0 0 1 .75.75v2.5A1.75 1.75 0 0 1 4.25 6h-2.5a.75.75 0 0 1 0-1.5h2.5a.25.25 0 0 0 .25-.25v-2.5A.75.75 0 0 1 5.25 1ZM1 10.75a.75.75 0 0 1 .75-.75h2.5c.966 0 1.75.784 1.75 1.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.25.25 0 0 0-.25-.25h-2.5a.75.75 0 0 1-.75-.75Zm9 1c0-.966.784-1.75 1.75-1.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Z"})},24:{width:24,path:vM.createElement("path",{d:"M15.75 3a.75.75 0 0 1 .75.75v3.5c0 .138.112.25.25.25h3.5a.75.75 0 0 1 0 1.5h-3.5A1.75 1.75 0 0 1 15 7.25v-3.5a.75.75 0 0 1 .75-.75Zm-7.5 0a.75.75 0 0 1 .75.75v3.5A1.75 1.75 0 0 1 7.25 9h-3.5a.75.75 0 0 1 0-1.5h3.5a.25.25 0 0 0 .25-.25v-3.5A.75.75 0 0 1 8.25 3ZM3 15.75a.75.75 0 0 1 .75-.75h3.5c.966 0 1.75.784 1.75 1.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1-.75-.75Zm12 1c0-.966.784-1.75 1.75-1.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v3.5a.75.75 0 0 1-1.5 0Z"})}},ScreenNormalIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-screen-normal",svgDataByHeight$t,heights$t)});ScreenNormalIcon.displayName="ScreenNormalIcon";var heights$s=["16","24"],svgDataByHeight$s={16:{width:16,path:vM.createElement("path",{d:"M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"})},24:{width:24,path:vM.createElement("path",{d:"M10.25 2a8.25 8.25 0 0 1 6.34 13.53l5.69 5.69a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-5.69-5.69A8.25 8.25 0 1 1 10.25 2ZM3.5 10.25a6.75 6.75 0 1 0 13.5 0 6.75 6.75 0 0 0-13.5 0Z"})}},SearchIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-search",svgDataByHeight$s,heights$s)});SearchIcon.displayName="SearchIcon";var heights$r=["16","24"],svgDataByHeight$r={16:{width:16,path:vM.createElement("path",{d:"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M10.75 6.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5ZM6 7.25a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 6 7.25Zm4 9a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-3.25-.75a.75.75 0 0 0 0 1.5h.5a.75.75 0 0 0 0-1.5h-.5Z"}),vM.createElement("path",{d:"M3.25 2h17.5c.966 0 1.75.784 1.75 1.75v7c0 .372-.116.716-.314 1 .198.284.314.628.314 1v7a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75v-7c0-.358.109-.707.314-1a1.741 1.741 0 0 1-.314-1v-7C1.5 2.784 2.284 2 3.25 2Zm0 10.5a.25.25 0 0 0-.25.25v7c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-7a.25.25 0 0 0-.25-.25Zm0-1.5h17.5a.25.25 0 0 0 .25-.25v-7a.25.25 0 0 0-.25-.25H3.25a.25.25 0 0 0-.25.25v7c0 .138.112.25.25.25Z"}))}},ServerIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-server",svgDataByHeight$r,heights$r)});ServerIcon.displayName="ServerIcon";var heights$q=["16","24"],svgDataByHeight$q={16:{width:16,path:vM.createElement("path",{d:"M15 3a3 3 0 0 1-5.175 2.066l-3.92 2.179a2.994 2.994 0 0 1 0 1.51l3.92 2.179a3 3 0 1 1-.73 1.31l-3.92-2.178a3 3 0 1 1 0-4.133l3.92-2.178A3 3 0 1 1 15 3Zm-1.5 10a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 13.5 13Zm-9-5a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 4.5 8Zm9-5a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 13.5 3Z"})},24:{width:24,path:vM.createElement("path",{d:"M20 5.5a3.498 3.498 0 0 1-6.062 2.385l-5.112 3.021a3.498 3.498 0 0 1 0 2.188l5.112 3.021a3.5 3.5 0 1 1-.764 1.29l-5.112-3.02a3.499 3.499 0 1 1-3.843-5.642 3.499 3.499 0 0 1 3.843.872l5.112-3.021A3.5 3.5 0 1 1 20 5.5Zm-1.5 13a2 2 0 1 0-3.999-.001 2 2 0 0 0 3.999.001Zm0-13a2 2 0 1 0-3.999-.001A2 2 0 0 0 18.5 5.5ZM5.5 14a2 2 0 1 0 .001-3.999A2 2 0 0 0 5.5 14Z"})}},ShareAndroidIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-share-android",svgDataByHeight$q,heights$q)});ShareAndroidIcon.displayName="ShareAndroidIcon";var heights$p=["16","24"],svgDataByHeight$p={16:{width:16,path:vM.createElement("path",{d:"M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M13 15.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.25-8.25a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 1.5 0v-4.5Z"}),vM.createElement("path",{d:"M11.46.637a1.748 1.748 0 0 1 1.08 0l8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.77 10.705-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.771 20.704 2 16.19 2 10V4.976c0-.76.49-1.43 1.21-1.664Zm.617 1.426a.253.253 0 0 0-.154 0L3.673 4.74a.25.25 0 0 0-.173.237V10c0 5.461 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.46 20.5 10V4.976a.25.25 0 0 0-.173-.237Z"}))}},ShieldIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-shield",svgDataByHeight$p,heights$p)});ShieldIcon.displayName="ShieldIcon";var heights$o=["16","24"],svgDataByHeight$o={16:{width:16,path:vM.createElement("path",{d:"m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"}),vM.createElement("path",{d:"m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"}))}},ShieldCheckIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-shield-check",svgDataByHeight$o,heights$o)});ShieldCheckIcon.displayName="ShieldCheckIcon";var heights$n=["16","24"],svgDataByHeight$n={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"m4.177 7.823 2.396-2.396A.25.25 0 0 1 7 5.604v4.792a.25.25 0 0 1-.427.177L4.177 8.177a.25.25 0 0 1 0-.354Z"}),vM.createElement("path",{d:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25H9.5v-13Zm12.5 13a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H11v13Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M11.28 9.53 8.81 12l2.47 2.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-3-3a.75.75 0 0 1 0-1.06l3-3a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734Z"}),vM.createElement("path",{d:"M3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25V3.75C2 2.784 2.784 2 3.75 2ZM3.5 3.75v16.5c0 .138.112.25.25.25H15v-17H3.75a.25.25 0 0 0-.25.25Zm13 16.75h3.75a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25H16.5Z"}))}},SidebarExpandIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-sidebar-expand",svgDataByHeight$n,heights$n)});SidebarExpandIcon.displayName="SidebarExpandIcon";var heights$m=["16","24"],svgDataByHeight$m={16:{width:16,path:vM.createElement("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm9.78-2.22-5.5 5.5a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l5.5-5.5a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M17.28 7.78a.75.75 0 0 0-1.06-1.06l-9.5 9.5a.75.75 0 1 0 1.06 1.06l9.5-9.5Z"}),vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"}))}},SkipIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-skip",svgDataByHeight$m,heights$m)});SkipIcon.displayName="SkipIcon";var heights$l=["16","24"],svgDataByHeight$l={16:{width:16,path:vM.createElement("path",{d:"M15 2.75a.75.75 0 0 1-.75.75h-4a.75.75 0 0 1 0-1.5h4a.75.75 0 0 1 .75.75Zm-8.5.75v1.25a.75.75 0 0 0 1.5 0v-4a.75.75 0 0 0-1.5 0V2H1.75a.75.75 0 0 0 0 1.5H6.5Zm1.25 5.25a.75.75 0 0 0 0-1.5h-6a.75.75 0 0 0 0 1.5h6ZM15 8a.75.75 0 0 1-.75.75H11.5V10a.75.75 0 1 1-1.5 0V6a.75.75 0 0 1 1.5 0v1.25h2.75A.75.75 0 0 1 15 8Zm-9 5.25v-2a.75.75 0 0 0-1.5 0v1.25H1.75a.75.75 0 0 0 0 1.5H4.5v1.25a.75.75 0 0 0 1.5 0v-2Zm9 0a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h6a.75.75 0 0 1 .75.75Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M11 18.25a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1-.75-.75Zm-8-12a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 3 6.25Zm13 6a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75ZM8.75 16a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75Z"}),vM.createElement("path",{d:"M3 18.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm0-6a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1-.75-.75ZM16.75 10a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75ZM14 6.25a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1-.75-.75ZM11.25 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75Z"}))}},SlidersIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-sliders",svgDataByHeight$l,heights$l)});SlidersIcon.displayName="SlidersIcon";var heights$k=["16","24"],svgDataByHeight$k={16:{width:16,path:vM.createElement("path",{d:"M7.53 1.282a.5.5 0 0 1 .94 0l.478 1.306a7.492 7.492 0 0 0 4.464 4.464l1.305.478a.5.5 0 0 1 0 .94l-1.305.478a7.492 7.492 0 0 0-4.464 4.464l-.478 1.305a.5.5 0 0 1-.94 0l-.478-1.305a7.492 7.492 0 0 0-4.464-4.464L1.282 8.47a.5.5 0 0 1 0-.94l1.306-.478a7.492 7.492 0 0 0 4.464-4.464Z"})},24:{width:24,path:vM.createElement("path",{d:"M11.296 1.924c.24-.656 1.168-.656 1.408 0l.717 1.958a11.25 11.25 0 0 0 6.697 6.697l1.958.717c.657.24.657 1.168 0 1.408l-1.958.717a11.25 11.25 0 0 0-6.697 6.697l-.717 1.958c-.24.657-1.168.657-1.408 0l-.717-1.958a11.25 11.25 0 0 0-6.697-6.697l-1.958-.717c-.656-.24-.656-1.168 0-1.408l1.958-.717a11.25 11.25 0 0 0 6.697-6.697l.717-1.958Z"})}},SparkleFillIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-sparkle-fill",svgDataByHeight$k,heights$k)});SparkleFillIcon.displayName="SparkleFillIcon";var heights$j=["16","24"],svgDataByHeight$j={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm0-1.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13Z"}),vM.createElement("path",{d:"M5 5.75A.75.75 0 0 1 5.75 5h4.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1-.75-.75Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M12 23C5.925 23 1 18.075 1 12S5.925 1 12 1s11 4.925 11 11-4.925 11-11 11Zm0-1.5a9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12a9.5 9.5 0 0 0 9.5 9.5Z"}),vM.createElement("path",{d:"M7 8.75C7 7.784 7.784 7 8.75 7h6.5c.966 0 1.75.784 1.75 1.75v6.5A1.75 1.75 0 0 1 15.25 17h-6.5A1.75 1.75 0 0 1 7 15.25v-6.5Z"}))}},SquareCircleIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-square-circle",svgDataByHeight$j,heights$j)});SquareCircleIcon.displayName="SquareCircleIcon";var heights$i=["16","24"],svgDataByHeight$i={16:{width:16,path:vM.createElement("path",{d:"M5.75 4h4.5c.966 0 1.75.784 1.75 1.75v4.5A1.75 1.75 0 0 1 10.25 12h-4.5A1.75 1.75 0 0 1 4 10.25v-4.5C4 4.784 4.784 4 5.75 4Z"})},24:{width:24,path:vM.createElement("path",{d:"M7.75 6h8.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 16.25 18h-8.5A1.75 1.75 0 0 1 6 16.25v-8.5C6 6.784 6.784 6 7.75 6Z"})}},SquareFillIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-square-fill",svgDataByHeight$i,heights$i)});SquareFillIcon.displayName="SquareFillIcon";var heights$h=["16","24"],svgDataByHeight$h={16:{width:16,path:vM.createElement("path",{d:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M12 7a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 12 7Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),vM.createElement("path",{d:"M7.328 1.47a.749.749 0 0 1 .53-.22h8.284c.199 0 .389.079.53.22l5.858 5.858c.141.14.22.33.22.53v8.284a.749.749 0 0 1-.22.53l-5.858 5.858a.749.749 0 0 1-.53.22H7.858a.749.749 0 0 1-.53-.22L1.47 16.672a.749.749 0 0 1-.22-.53V7.858c0-.199.079-.389.22-.53Zm.84 1.28L2.75 8.169v7.662l5.419 5.419h7.662l5.419-5.418V8.168L15.832 2.75Z"}))}},StopIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-stop",svgDataByHeight$h,heights$h)});StopIcon.displayName="StopIcon";var heights$g=["16","24"],svgDataByHeight$g={16:{width:16,path:vM.createElement("path",{d:"M8 12a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm5.657-8.157a.75.75 0 0 1 0 1.061l-1.061 1.06a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.06-1.06a.75.75 0 0 1 1.06 0Zm-9.193 9.193a.75.75 0 0 1 0 1.06l-1.06 1.061a.75.75 0 1 1-1.061-1.06l1.06-1.061a.75.75 0 0 1 1.061 0ZM8 0a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 8 0ZM3 8a.75.75 0 0 1-.75.75H.75a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 3 8Zm13 0a.75.75 0 0 1-.75.75h-1.5a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 16 8Zm-8 5a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 8 13Zm3.536-1.464a.75.75 0 0 1 1.06 0l1.061 1.06a.75.75 0 0 1-1.06 1.061l-1.061-1.06a.75.75 0 0 1 0-1.061ZM2.343 2.343a.75.75 0 0 1 1.061 0l1.06 1.061a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-1.06-1.06a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement("path",{d:"M12 19a7 7 0 1 1 0-14 7 7 0 0 1 0 14Zm0-1.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 1 0 0 11Zm-5.657.157a.75.75 0 0 1 0 1.06l-1.768 1.768a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.767-1.768a.75.75 0 0 1 1.061 0ZM3.515 3.515a.75.75 0 0 1 1.06 0l1.768 1.768a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L3.515 4.575a.75.75 0 0 1 0-1.06ZM12 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 12 0ZM4 12a.75.75 0 0 1-.75.75H.75a.75.75 0 0 1 0-1.5h2.5A.75.75 0 0 1 4 12Zm8 8a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5A.75.75 0 0 1 12 20Zm12-8a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h2.5A.75.75 0 0 1 24 12Zm-6.343 5.657a.75.75 0 0 1 1.06 0l1.768 1.768a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-1.768-1.767a.75.75 0 0 1 0-1.061Zm2.828-14.142a.75.75 0 0 1 0 1.06l-1.768 1.768a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l1.767-1.768a.75.75 0 0 1 1.061 0Z"})}},SunIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-sun",svgDataByHeight$g,heights$g)});SunIcon.displayName="SunIcon";var heights$f=["16","24"],svgDataByHeight$f={16:{width:16,path:vM.createElement("path",{d:"M1.705 8.005a.75.75 0 0 1 .834.656 5.5 5.5 0 0 0 9.592 2.97l-1.204-1.204a.25.25 0 0 1 .177-.427h3.646a.25.25 0 0 1 .25.25v3.646a.25.25 0 0 1-.427.177l-1.38-1.38A7.002 7.002 0 0 1 1.05 8.84a.75.75 0 0 1 .656-.834ZM8 2.5a5.487 5.487 0 0 0-4.131 1.869l1.204 1.204A.25.25 0 0 1 4.896 6H1.25A.25.25 0 0 1 1 5.75V2.104a.25.25 0 0 1 .427-.177l1.38 1.38A7.002 7.002 0 0 1 14.95 7.16a.75.75 0 0 1-1.49.178A5.5 5.5 0 0 0 8 2.5Z"})},24:{width:24,path:vM.createElement("path",{d:"M3.38 8A9.502 9.502 0 0 1 12 2.5a9.502 9.502 0 0 1 9.215 7.182.75.75 0 1 0 1.456-.364C21.473 4.539 17.15 1 12 1a10.995 10.995 0 0 0-9.5 5.452V4.75a.75.75 0 0 0-1.5 0V8.5a1 1 0 0 0 1 1h3.75a.75.75 0 0 0 0-1.5H3.38Zm-.595 6.318a.75.75 0 0 0-1.455.364C2.527 19.461 6.85 23 12 23c4.052 0 7.592-2.191 9.5-5.451v1.701a.75.75 0 0 0 1.5 0V15.5a1 1 0 0 0-1-1h-3.75a.75.75 0 0 0 0 1.5h2.37A9.502 9.502 0 0 1 12 21.5c-4.446 0-8.181-3.055-9.215-7.182Z"})}},SyncIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-sync",svgDataByHeight$f,heights$f)});SyncIcon.displayName="SyncIcon";var heights$e=["16","24"],svgDataByHeight$e={16:{width:16,path:vM.createElement("path",{d:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"})},24:{width:24,path:vM.createElement("path",{d:"M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25ZM9 9v11.5h11.25a.25.25 0 0 0 .25-.25V9Zm11.5-1.5V3.75a.25.25 0 0 0-.25-.25H9v4ZM3.5 9v11.25c0 .138.112.25.25.25H7.5V9Zm4-1.5v-4H3.75a.25.25 0 0 0-.25.25V7.5Z"})}},TableIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-table",svgDataByHeight$e,heights$e)});TableIcon.displayName="TableIcon";var heights$d=["16","24"],svgDataByHeight$d={16:{width:16,path:vM.createElement("path",{d:"M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M7.75 6.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"}),vM.createElement("path",{d:"M2.5 1h8.44a1.5 1.5 0 0 1 1.06.44l10.25 10.25a1.5 1.5 0 0 1 0 2.12l-8.44 8.44a1.5 1.5 0 0 1-2.12 0L1.44 12A1.497 1.497 0 0 1 1 10.94V2.5A1.5 1.5 0 0 1 2.5 1Zm0 1.5v8.44l10.25 10.25 8.44-8.44L10.94 2.5Z"}))}},TagIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-tag",svgDataByHeight$d,heights$d)});TagIcon.displayName="TagIcon";var heights$c=["16","24"],svgDataByHeight$c={16:{width:16,path:vM.createElement("path",{d:"M2 2h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Zm4.655 8.595a.75.75 0 0 1 0 1.06L4.03 14.28a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.095-2.095a.75.75 0 0 1 1.06 0ZM9.75 2.5h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5Zm0 5h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5Zm0 5h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5Zm-7.25-9v3h3v-3Z"})},24:{width:24,path:vM.createElement("path",{d:"M3 6a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Zm1.5 4.5h4v-4h-4Zm8.25-5a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5h-7.5Zm0 6a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5h-7.5Zm0 6a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5h-7.5Zm-2.97-2.53a.75.75 0 0 1 0 1.06l-3.5 3.5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47 2.97-2.97a.75.75 0 0 1 1.06 0Z"})}},TasklistIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-tasklist",svgDataByHeight$c,heights$c)});TasklistIcon.displayName="TasklistIcon";var heights$b=["16","24"],svgDataByHeight$b={16:{width:16,path:vM.createElement("path",{d:"M14.184 1.143v-.001l1.422 2.464a1.75 1.75 0 0 1-.757 2.451L3.104 11.713a1.75 1.75 0 0 1-2.275-.702l-.447-.775a1.75 1.75 0 0 1 .53-2.32L11.682.573a1.748 1.748 0 0 1 2.502.57Zm-4.709 9.32h-.001l2.644 3.863a.75.75 0 1 1-1.238.848l-1.881-2.75v2.826a.75.75 0 0 1-1.5 0v-2.826l-1.881 2.75a.75.75 0 1 1-1.238-.848l2.049-2.992a.746.746 0 0 1 .293-.253l1.809-.87a.749.749 0 0 1 .944.252ZM9.436 3.92h-.001l-4.97 3.39.942 1.63 5.42-2.61Zm3.091-2.108h.001l-1.85 1.26 1.505 2.605 2.016-.97a.247.247 0 0 0 .13-.151.247.247 0 0 0-.022-.199l-1.422-2.464a.253.253 0 0 0-.161-.119.254.254 0 0 0-.197.038ZM1.756 9.157a.25.25 0 0 0-.075.33l.447.775a.25.25 0 0 0 .325.1l1.598-.769-.83-1.436-1.465 1Z"})},24:{width:24,path:vM.createElement("path",{d:"M.408 15.13a2 2 0 0 1 .59-2.642L17.038 1.33a1.999 1.999 0 0 1 2.85.602l2.828 4.644a2 2 0 0 1-.851 2.847l-17.762 8.43a2 2 0 0 1-2.59-.807Zm5.263-4.066 1.987 3.44 8.712-4.135-2.857-4.76Zm12.06-1.34.001-.001 3.49-1.656a.498.498 0 0 0 .212-.712l-2.826-4.644a.503.503 0 0 0-.713-.151l-3.148 2.19Zm-13.295 2.2L1.854 13.72a.5.5 0 0 0-.147.66l1.105 1.915a.5.5 0 0 0 .648.201l2.838-1.347ZM17.155 22.87a.75.75 0 0 0 .226-1.036l-4-6.239a.75.75 0 0 0-.941-.278l-2.75 1.25a.75.75 0 0 0-.318.274l-3.25 4.989a.75.75 0 0 0 1.256.819l3.131-4.806.51-.232v5.64a.75.75 0 1 0 1.5 0v-6.22l3.6 5.613a.75.75 0 0 0 1.036.226Z"})}},TelescopeIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-telescope",svgDataByHeight$b,heights$b)});TelescopeIcon.displayName="TelescopeIcon";var heights$a=["16","24"],svgDataByHeight$a={16:{width:16,path:vM.createElement("path",{d:"M7.653 15.369a.75.75 0 0 1-.776.371l-.238-.04a3.25 3.25 0 0 1-2.591-4.099L4.506 10h-.665A3.25 3.25 0 0 1 .723 5.833l1.135-3.859A2.75 2.75 0 0 1 4.482 0H9.43c.78.003 1.538.25 2.168.702A1.752 1.752 0 0 1 12.989 0h1.272A1.75 1.75 0 0 1 16 1.75v6.5A1.75 1.75 0 0 1 14.25 10h-3.417a.25.25 0 0 0-.217.127ZM11.25 2.351l-.396-.33a2.248 2.248 0 0 0-1.44-.521H4.496a1.25 1.25 0 0 0-1.199.897L2.162 6.256A1.75 1.75 0 0 0 3.841 8.5H5.5a.75.75 0 0 1 .721.956l-.731 2.558a1.75 1.75 0 0 0 1.127 2.14L9.31 9.389a1.75 1.75 0 0 1 1.523-.889h.417Zm1.5 6.149h1.5a.25.25 0 0 0 .25-.25v-6.5a.25.25 0 0 0-.25-.25H13a.25.25 0 0 0-.25.25Z"})},24:{width:24,path:vM.createElement("path",{d:"M10.651 21.622a.748.748 0 0 1-.808.361l-.127-.027a3.875 3.875 0 0 1-2.879-4.97L7.473 15H6.336c-2.645 0-4.513-2.591-3.676-5.1l1.559-4.678A3.25 3.25 0 0 1 7.302 3h5.289c1.031 0 2.029.354 2.828.999A1.75 1.75 0 0 1 17 3h2.25c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 19.25 15h-4.67a.251.251 0 0 0-.217.126l-3.712 6.496ZM15.25 5.84l-.684-.598a2.999 2.999 0 0 0-1.975-.742H7.302a1.75 1.75 0 0 0-1.66 1.197l-1.559 4.677A2.375 2.375 0 0 0 6.336 13.5H8.5a.75.75 0 0 1 .714.979l-.948 2.964a2.375 2.375 0 0 0 1.373 2.927l3.422-5.988a1.749 1.749 0 0 1 1.519-.882h.67V5.84Zm1.5 7.66h2.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H17a.25.25 0 0 0-.25.25v8.75Z"})}},ThumbsdownIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-thumbsdown",svgDataByHeight$a,heights$a)});ThumbsdownIcon.displayName="ThumbsdownIcon";var heights$9=["16","24"],svgDataByHeight$9={16:{width:16,path:vM.createElement("path",{d:"M8.347.631A.75.75 0 0 1 9.123.26l.238.04a3.25 3.25 0 0 1 2.591 4.098L11.494 6h.665a3.25 3.25 0 0 1 3.118 4.167l-1.135 3.859A2.751 2.751 0 0 1 11.503 16H6.586a3.75 3.75 0 0 1-2.184-.702A1.75 1.75 0 0 1 3 16H1.75A1.75 1.75 0 0 1 0 14.25v-6.5C0 6.784.784 6 1.75 6h3.417a.25.25 0 0 0 .217-.127ZM4.75 13.649l.396.33c.404.337.914.521 1.44.521h4.917a1.25 1.25 0 0 0 1.2-.897l1.135-3.859A1.75 1.75 0 0 0 12.159 7.5H10.5a.75.75 0 0 1-.721-.956l.731-2.558a1.75 1.75 0 0 0-1.127-2.14L6.69 6.611a1.75 1.75 0 0 1-1.523.889H4.75ZM3.25 7.5h-1.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25H3a.25.25 0 0 0 .25-.25Z"})},24:{width:24,path:vM.createElement("path",{d:"M13.349 2.378a.748.748 0 0 1 .808-.361l.127.027a3.875 3.875 0 0 1 2.879 4.97L16.527 9h1.137c2.645 0 4.513 2.591 3.676 5.1l-1.559 4.678A3.25 3.25 0 0 1 16.698 21h-5.289a4.503 4.503 0 0 1-2.828-.999A1.75 1.75 0 0 1 7 21H4.75A1.75 1.75 0 0 1 3 19.25v-8.5C3 9.784 3.784 9 4.75 9h4.67a.251.251 0 0 0 .217-.126l3.712-6.496ZM8.75 18.16l.683.598a3.003 3.003 0 0 0 1.976.742h5.289a1.75 1.75 0 0 0 1.66-1.197l1.559-4.677a2.375 2.375 0 0 0-2.253-3.126H15.5a.75.75 0 0 1-.714-.979l.948-2.964a2.375 2.375 0 0 0-1.373-2.927l-3.422 5.988a1.749 1.749 0 0 1-1.519.882h-.67v7.66Zm-1.5-7.66h-2.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25H7a.25.25 0 0 0 .25-.25V10.5Z"})}},ThumbsupIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-thumbsup",svgDataByHeight$9,heights$9)});ThumbsupIcon.displayName="ThumbsupIcon";var heights$8=["16","24"],svgDataByHeight$8={16:{width:16,path:vM.createElement("path",{d:"M5.433 2.304A4.492 4.492 0 0 0 3.5 6c0 1.598.832 3.002 2.09 3.802.518.328.929.923.902 1.64v.008l-.164 3.337a.75.75 0 1 1-1.498-.073l.163-3.33c.002-.085-.05-.216-.207-.316A5.996 5.996 0 0 1 2 6a5.993 5.993 0 0 1 2.567-4.92 1.482 1.482 0 0 1 1.673-.04c.462.296.76.827.76 1.423v2.82c0 .082.041.16.11.206l.75.51a.25.25 0 0 0 .28 0l.75-.51A.249.249 0 0 0 9 5.282V2.463c0-.596.298-1.127.76-1.423a1.482 1.482 0 0 1 1.673.04A5.993 5.993 0 0 1 14 6a5.996 5.996 0 0 1-2.786 5.068c-.157.1-.209.23-.207.315l.163 3.33a.752.752 0 0 1-1.094.714.75.75 0 0 1-.404-.64l-.164-3.345c-.027-.717.384-1.312.902-1.64A4.495 4.495 0 0 0 12.5 6a4.492 4.492 0 0 0-1.933-3.696c-.024.017-.067.067-.067.16v2.818a1.75 1.75 0 0 1-.767 1.448l-.75.51a1.75 1.75 0 0 1-1.966 0l-.75-.51A1.75 1.75 0 0 1 5.5 5.282V2.463c0-.092-.043-.142-.067-.159Z"})},24:{width:24,path:vM.createElement("path",{d:"M7.875 2.292a.114.114 0 0 0-.032.018A7.239 7.239 0 0 0 4.75 8.25a7.248 7.248 0 0 0 3.654 6.297c.57.327.982.955.941 1.682v.002l-.317 6.058a.75.75 0 1 1-1.498-.078l.317-6.062v-.004c.006-.09-.047-.215-.188-.296A8.749 8.749 0 0 1 3.25 8.25a8.738 8.738 0 0 1 3.732-7.169 1.547 1.547 0 0 1 1.709-.064c.484.292.809.835.809 1.46v4.714a.25.25 0 0 0 .119.213l2.25 1.385c.08.05.182.05.262 0l2.25-1.385a.25.25 0 0 0 .119-.213V2.478c0-.626.325-1.169.81-1.461a1.547 1.547 0 0 1 1.708.064 8.741 8.741 0 0 1 3.732 7.17 8.747 8.747 0 0 1-4.41 7.598c-.14.081-.193.206-.188.296v.004l.318 6.062a.75.75 0 1 1-1.498.078l-.317-6.058v-.002c-.041-.727.37-1.355.94-1.682A7.247 7.247 0 0 0 19.25 8.25a7.239 7.239 0 0 0-3.093-5.94.114.114 0 0 0-.032-.018l-.01-.001c-.003 0-.014 0-.031.01-.036.022-.084.079-.084.177V7.19c0 .608-.315 1.172-.833 1.49l-2.25 1.385a1.75 1.75 0 0 1-1.834 0l-2.25-1.384A1.752 1.752 0 0 1 8 7.192V2.477c0-.098-.048-.155-.084-.176a.068.068 0 0 0-.031-.011l-.01.001Z"})}},ToolsIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-tools",svgDataByHeight$8,heights$8)});ToolsIcon.displayName="ToolsIcon";var heights$7=["16","24"],svgDataByHeight$7={16:{width:16,path:vM.createElement("path",{d:"M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M16 1.75V3h5.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H8V1.75C8 .784 8.784 0 9.75 0h4.5C15.216 0 16 .784 16 1.75Zm-6.5 0V3h5V1.75a.25.25 0 0 0-.25-.25h-4.5a.25.25 0 0 0-.25.25ZM4.997 6.178a.75.75 0 1 0-1.493.144L4.916 20.92a1.75 1.75 0 0 0 1.742 1.58h10.684a1.75 1.75 0 0 0 1.742-1.581l1.413-14.597a.75.75 0 0 0-1.494-.144l-1.412 14.596a.25.25 0 0 1-.249.226H6.658a.25.25 0 0 1-.249-.226L4.997 6.178Z"}),vM.createElement("path",{d:"M9.206 7.501a.75.75 0 0 1 .793.705l.5 8.5A.75.75 0 1 1 9 16.794l-.5-8.5a.75.75 0 0 1 .705-.793Zm6.293.793A.75.75 0 1 0 14 8.206l-.5 8.5a.75.75 0 0 0 1.498.088l.5-8.5Z"}))}},TrashIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-trash",svgDataByHeight$7,heights$7)});TrashIcon.displayName="TrashIcon";var heights$6=["16","24"],svgDataByHeight$6={16:{width:16,path:vM.createElement("path",{d:"m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"})},24:{width:24,path:vM.createElement("path",{d:"M11.646 15.146 5.854 9.354a.5.5 0 0 1 .353-.854h11.586a.5.5 0 0 1 .353.854l-5.793 5.792a.5.5 0 0 1-.707 0Z"})}},TriangleDownIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-triangle-down",svgDataByHeight$6,heights$6)});TriangleDownIcon.displayName="TriangleDownIcon";var heights$5=["16","24"],svgDataByHeight$5={16:{width:16,path:vM.createElement("path",{d:"M7.563 2.069A.75.75 0 0 1 8 2.75v10.5a.751.751 0 0 1-1.238.57L3.472 11H1.75A1.75 1.75 0 0 1 0 9.25v-2.5C0 5.784.784 5 1.75 5h1.723l3.289-2.82a.75.75 0 0 1 .801-.111ZM6.5 4.38 4.238 6.319a.748.748 0 0 1-.488.181h-2a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2c.179 0 .352.064.488.18L6.5 11.62Zm6.096-2.038a.75.75 0 0 1 1.06 0 8 8 0 0 1 0 11.314.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042 6.5 6.5 0 0 0 0-9.193.75.75 0 0 1 0-1.06Zm-1.06 2.121-.001.001a5 5 0 0 1 0 7.07.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734 3.5 3.5 0 0 0 0-4.95.75.75 0 1 1 1.061-1.061Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M11.553 3.064A.75.75 0 0 1 12 3.75v16.5a.75.75 0 0 1-1.255.555L5.46 16H2.75A1.75 1.75 0 0 1 1 14.25v-4.5C1 8.784 1.784 8 2.75 8h2.71l5.285-4.805a.752.752 0 0 1 .808-.13ZM10.5 5.445l-4.245 3.86a.748.748 0 0 1-.505.195h-3a.25.25 0 0 0-.25.25v4.5c0 .138.112.25.25.25h3c.187 0 .367.069.505.195l4.245 3.86Zm8.218-1.223a.75.75 0 0 1 1.06 0c4.296 4.296 4.296 11.26 0 15.556a.75.75 0 0 1-1.06-1.06 9.5 9.5 0 0 0 0-13.436.75.75 0 0 1 0-1.06Z"}),vM.createElement("path",{d:"M16.243 7.757a.75.75 0 1 0-1.061 1.061 4.5 4.5 0 0 1 0 6.364.75.75 0 0 0 1.06 1.06 6 6 0 0 0 0-8.485Z"}))}},UnmuteIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-unmute",svgDataByHeight$5,heights$5)});UnmuteIcon.displayName="UnmuteIcon";var heights$4=["16","24"],svgDataByHeight$4={16:{width:16,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"}),vM.createElement("path",{d:"M11.78 4.72a.749.749 0 1 1-1.06 1.06L8.75 3.811V9.5a.75.75 0 0 1-1.5 0V3.811L5.28 5.78a.749.749 0 1 1-1.06-1.06l3.25-3.25a.749.749 0 0 1 1.06 0l3.25 3.25Z"}))},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M4 20.25V18a.75.75 0 0 1 1.5 0v2.25c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V18a.75.75 0 0 1 1.5 0v2.25A1.75 1.75 0 0 1 18.25 22H5.75A1.75 1.75 0 0 1 4 20.25Z"}),vM.createElement("path",{d:"M5.22 9.53a.749.749 0 0 1 0-1.06l6.25-6.25a.749.749 0 0 1 1.06 0l6.25 6.25a.749.749 0 1 1-1.06 1.06l-4.97-4.969V16.75a.75.75 0 0 1-1.5 0V4.561L6.28 9.53a.749.749 0 0 1-1.06 0Z"}))}},UploadIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-upload",svgDataByHeight$4,heights$4)});UploadIcon.displayName="UploadIcon";var heights$3=["12","16","24"],svgDataByHeight$3={12:{width:12,path:vM.createElement("path",{d:"M2.22 2.22a.749.749 0 0 1 1.06 0L6 4.939 8.72 2.22a.749.749 0 1 1 1.06 1.06L7.061 6 9.78 8.72a.749.749 0 1 1-1.06 1.06L6 7.061 3.28 9.78a.749.749 0 1 1-1.06-1.06L4.939 6 2.22 3.28a.749.749 0 0 1 0-1.06Z"})},16:{width:16,path:vM.createElement("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})},24:{width:24,path:vM.createElement("path",{d:"M5.72 5.72a.75.75 0 0 1 1.06 0L12 10.94l5.22-5.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L13.06 12l5.22 5.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L12 13.06l-5.22 5.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.94 12 5.72 6.78a.75.75 0 0 1 0-1.06Z"})}},XIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-x",svgDataByHeight$3,heights$3)});XIcon.displayName="XIcon";var heights$2=["16","24"],svgDataByHeight$2={16:{width:16,path:vM.createElement("path",{d:"M2.344 2.343h-.001a8 8 0 0 1 11.314 11.314A8.002 8.002 0 0 1 .234 10.089a8 8 0 0 1 2.11-7.746Zm1.06 10.253a6.5 6.5 0 1 0 9.108-9.275 6.5 6.5 0 0 0-9.108 9.275ZM6.03 4.97 8 6.94l1.97-1.97a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l1.97 1.97a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-1.97 1.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L6.94 8 4.97 6.03a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018Z"})},24:{width:24,path:vM.createElement(vM.Fragment,null,vM.createElement("path",{d:"M9.036 7.976a.75.75 0 0 0-1.06 1.06L10.939 12l-2.963 2.963a.75.75 0 1 0 1.06 1.06L12 13.06l2.963 2.964a.75.75 0 0 0 1.061-1.06L13.061 12l2.963-2.964a.75.75 0 1 0-1.06-1.06L12 10.939 9.036 7.976Z"}),vM.createElement("path",{d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z"}))}},XCircleIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-x-circle",svgDataByHeight$2,heights$2)});XCircleIcon.displayName="XCircleIcon";var heights$1=["12","16","24"],svgDataByHeight$1={12:{width:12,path:vM.createElement("path",{d:"M1.757 10.243a6.001 6.001 0 1 1 8.488-8.486 6.001 6.001 0 0 1-8.488 8.486ZM6 4.763l-2-2L2.763 4l2 2-2 2L4 9.237l2-2 2 2L9.237 8l-2-2 2-2L8 2.763Z"})},16:{width:16,path:vM.createElement("path",{d:"M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"})},24:{width:24,path:vM.createElement("path",{d:"M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm8.036-4.024a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L10.939 12l-2.963 2.963a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L12 13.06l2.963 2.964a.75.75 0 0 0 1.061-1.06L13.061 12l2.963-2.964a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L12 10.939Z"})}},XCircleFillIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-x-circle-fill",svgDataByHeight$1,heights$1)});XCircleFillIcon.displayName="XCircleFillIcon";var heights=["16","24"],svgDataByHeight={16:{width:16,path:vM.createElement("path",{d:"M9.504.43a1.516 1.516 0 0 1 2.437 1.713L10.415 5.5h2.123c1.57 0 2.346 1.909 1.22 3.004l-7.34 7.142a1.249 1.249 0 0 1-.871.354h-.302a1.25 1.25 0 0 1-1.157-1.723L5.633 10.5H3.462c-1.57 0-2.346-1.909-1.22-3.004L9.503.429Zm1.047 1.074L3.286 8.571A.25.25 0 0 0 3.462 9H6.75a.75.75 0 0 1 .694 1.034l-1.713 4.188 6.982-6.793A.25.25 0 0 0 12.538 7H9.25a.75.75 0 0 1-.683-1.06l2.008-4.418.003-.006a.036.036 0 0 0-.004-.009l-.006-.006-.008-.001c-.003 0-.006.002-.009.004Z"})},24:{width:24,path:vM.createElement("path",{d:"M15.716 1.329a1.341 1.341 0 0 1 2.109 1.55L15.147 9h4.161c1.623 0 2.372 2.016 1.143 3.075L8.102 22.721a1.148 1.148 0 0 1-1.81-1.317L8.996 15H4.674c-1.619 0-2.37-2.008-1.148-3.07l12.19-10.6Zm.452 1.595L4.51 13.061a.25.25 0 0 0 .164.439h5.45a.749.749 0 0 1 .692 1.041l-2.559 6.066 11.215-9.668a.25.25 0 0 0-.164-.439H14a.75.75 0 0 1-.687-1.05Z"})}},ZapIcon=vM.forwardRef(function(Au,lo){return renderOcticon(Au,lo,"octicon octicon-zap",svgDataByHeight,heights)});ZapIcon.displayName="ZapIcon";function useFocusZone(Au={},lo=[]){const $u=useProvidedRefOrCreate(Au.containerRef),Ru=!!Au.activeDescendantFocus,Iu=typeof Au.activeDescendantFocus=="boolean"||!Au.activeDescendantFocus?void 0:Au.activeDescendantFocus,Pu=useProvidedRefOrCreate(Iu),Ou=Au.disabled,Du=vM.useRef();return reactExports.useEffect(()=>{if($u.current instanceof HTMLElement&&(!Ru||Pu.current instanceof HTMLElement))if(Ou){var Lu;(Lu=Du.current)===null||Lu===void 0||Lu.abort()}else{var Mu;const Bu={...Au,activeDescendantControl:(Mu=Pu.current)!==null&&Mu!==void 0?Mu:void 0};return Du.current=focusZone($u.current,Bu),()=>{var ju;(ju=Du.current)===null||ju===void 0||ju.abort()}}},[Ou,...lo]),{containerRef:$u,activeDescendantControlRef:Pu}}const useIsomorphicLayoutEffect$2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect,PRIMER_PORTAL_ROOT_ID$2="__primerPortalRoot__",DEFAULT_PORTAL_CONTAINER_NAME="__default__",portalRootRegistry={};function registerPortalRoot(Au,lo=DEFAULT_PORTAL_CONTAINER_NAME){portalRootRegistry[lo]=Au}function ensureDefaultPortal(){const Au=portalRootRegistry[DEFAULT_PORTAL_CONTAINER_NAME];if(!Au||!document.body.contains(Au)){let lo=document.getElementById(PRIMER_PORTAL_ROOT_ID$2);if(!(lo instanceof Element)){lo=document.createElement("div"),lo.setAttribute("id",PRIMER_PORTAL_ROOT_ID$2),lo.style.position="absolute",lo.style.top="0",lo.style.left="0",lo.style.width="100%";const $u=document.querySelector("[data-portal-root]");$u?$u.appendChild(lo):document.body.appendChild(lo)}registerPortalRoot(lo)}}const Portal=({children:Au,onMount:lo,containerName:$u})=>{const Ru=vM.useRef(null);if(!Ru.current){const Pu=document.createElement("div");Pu.style.position="relative",Pu.style.zIndex="1",Ru.current=Pu}const Iu=Ru.current;return useIsomorphicLayoutEffect$2(()=>{let Pu=$u;Pu===void 0&&(Pu=DEFAULT_PORTAL_CONTAINER_NAME,ensureDefaultPortal());const Ou=portalRootRegistry[Pu];if(!Ou)throw new Error(`Portal container '${$u}' is not yet registered. Container must be registered with registerPortal before use.`);return Ou.appendChild(Iu),lo?.(),()=>{Ou.removeChild(Iu)}},[Iu]),reactDomExports.createPortal(Au,Iu)};var classes$w={Backdrop:"prc-Dialog-Backdrop-ugYqZ",Dialog:"prc-Dialog-Dialog-luvDS",DisableScroll:"prc-Dialog-DisableScroll-F6LZa",DialogOverflowWrapper:"prc-Dialog-DialogOverflowWrapper-oDYJo",Footer:"prc-Dialog-Footer-jQfN4",Header:"prc-Dialog-Header-cjbcl",Title:"prc-Dialog-Title-oQ-W6",Subtitle:"prc-Dialog-Subtitle-sITpo",Body:"prc-Dialog-Body-LCvER"};function useOverflow(Au){const lo=distExports.c(4),[$u,Ru]=reactExports.useState(!1);let Iu;lo[0]!==Au.current?(Iu=()=>{if(Au.current===null)return;const Ou=new ResizeObserver(Du=>{for(const Mu of Du)if(Mu.target.scrollHeight>Mu.target.clientHeight||Mu.target.scrollWidth>Mu.target.clientWidth){Ru(!0);break}});return Ou.observe(Au.current),()=>{Ou.disconnect()}},lo[0]=Au.current,lo[1]=Iu):Iu=lo[1];let Pu;return lo[2]!==Au?(Pu=[Au],lo[2]=Au,lo[3]=Pu):Pu=lo[3],reactExports.useEffect(Iu,Pu),$u}const defaultStyles={position:"relative",overflow:"auto"};function ScrollableRegion(Au){const lo=distExports.c(13);let $u,Ru,Iu,Pu;lo[0]!==Au?({"aria-label":Ru,"aria-labelledby":Iu,children:$u,...Pu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4]);const Ou=vM.useRef(null),Du=useOverflow(Ou);let Mu;lo[5]!==Du||lo[6]!==Ru||lo[7]!==Iu?(Mu=Du?{"aria-label":Ru,"aria-labelledby":Iu,role:"region",tabIndex:0}:{},lo[5]=Du,lo[6]=Ru,lo[7]=Iu,lo[8]=Mu):Mu=lo[8];const Lu=Mu;let Bu;return lo[9]!==$u||lo[10]!==Lu||lo[11]!==Pu?(Bu=jsxRuntimeExports.jsx(Box$1,{...Pu,...Lu,ref:Ou,sx:defaultStyles,children:$u}),lo[9]=$u,lo[10]=Lu,lo[11]=Pu,lo[12]=Bu):Bu=lo[12],Bu}const DefaultHeader=Au=>{const lo=distExports.c(16),{dialogLabelId:$u,title:Ru,subtitle:Iu,dialogDescriptionId:Pu,onClose:Ou}=Au;let Du;lo[0]!==Ou?(Du=()=>{Ou("close-button")},lo[0]=Ou,lo[1]=Du):Du=lo[1];const Mu=Du,Lu=Ru??"Dialog";let Bu;lo[2]!==$u||lo[3]!==Lu?(Bu=jsxRuntimeExports.jsx(Dialog$1.Title,{id:$u,children:Lu}),lo[2]=$u,lo[3]=Lu,lo[4]=Bu):Bu=lo[4];let ju;lo[5]!==Pu||lo[6]!==Iu?(ju=Iu&&jsxRuntimeExports.jsx(Dialog$1.Subtitle,{id:Pu,children:Iu}),lo[5]=Pu,lo[6]=Iu,lo[7]=ju):ju=lo[7];let Fu;lo[8]!==Bu||lo[9]!==ju?(Fu=jsxRuntimeExports.jsxs(Box$1,{display:"flex",px:2,py:"6px",flexDirection:"column",flexGrow:1,children:[Bu,ju]}),lo[8]=Bu,lo[9]=ju,lo[10]=Fu):Fu=lo[10];let zu;lo[11]!==Mu?(zu=jsxRuntimeExports.jsx(Dialog$1.CloseButton,{onClose:Mu}),lo[11]=Mu,lo[12]=zu):zu=lo[12];let Uu;return lo[13]!==Fu||lo[14]!==zu?(Uu=jsxRuntimeExports.jsx(Dialog$1.Header,{children:jsxRuntimeExports.jsxs(Box$1,{display:"flex",children:[Fu,zu]})}),lo[13]=Fu,lo[14]=zu,lo[15]=Uu):Uu=lo[15],Uu},DefaultBody=Au=>{const lo=distExports.c(2),{children:$u}=Au;let Ru;return lo[0]!==$u?(Ru=jsxRuntimeExports.jsx(Dialog$1.Body,{children:$u}),lo[0]=$u,lo[1]=Ru):Ru=lo[1],Ru},DefaultFooter=Au=>{const lo=distExports.c(4),{footerButtons:$u}=Au;let Ru;lo[0]===Symbol.for("react.memo_cache_sentinel")?(Ru={bindKeys:FocusKeys.ArrowHorizontal|FocusKeys.Tab,focusInStrategy:"closest"},lo[0]=Ru):Ru=lo[0];const{containerRef:Iu}=useFocusZone(Ru);let Pu;return lo[1]!==$u||lo[2]!==Iu?(Pu=$u?jsxRuntimeExports.jsx(Dialog$1.Footer,{ref:Iu,children:jsxRuntimeExports.jsx(Dialog$1.Buttons,{buttons:$u})}):null,lo[1]=$u,lo[2]=Iu,lo[3]=Pu):Pu=lo[3],Pu},defaultPosition={narrow:"center",regular:"center"},defaultFooterButtons=[],_Dialog=vM.forwardRef((Au,lo)=>{const{title:$u="Dialog",subtitle:Ru="",renderHeader:Iu,renderBody:Pu,renderFooter:Ou,onClose:Du,role:Mu="dialog",width:Lu="xlarge",height:Bu="auto",footerButtons:ju=defaultFooterButtons,position:Fu=defaultPosition,returnFocusRef:zu,initialFocusRef:Uu,sx:Hu,className:Vu}=Au,Gu=useId(),Wu=useId(),Zu=reactExports.useRef(null);for(const bd of ju)bd.autoFocus&&(bd.ref=Zu);const[Ju,Yu]=reactExports.useState(!1),Xu={...Au,title:$u,subtitle:Ru,role:Mu,dialogLabelId:Gu,dialogDescriptionId:Wu},ed=reactExports.useCallback(bd=>{bd.target===bd.currentTarget&&Ju&&Du("escape")},[Du,Ju]),td=reactExports.useRef(null);useRefObjectAsForwardedRef(lo,td);const nd=reactExports.useRef(null);useFocusTrap({containerRef:td,initialFocusRef:Uu??Zu,restoreFocusOnCleanUp:!(zu!=null&&zu.current),returnFocusRef:zu}),useOnEscapePress(bd=>{Du("escape"),bd.preventDefault()},[Du]),vM.useEffect(()=>{var bd;const wd=window.innerWidth-document.body.clientWidth;(bd=td.current)===null||bd===void 0||bd.classList.add(classes$w.DisableScroll),document.body.style.setProperty("--prc-dialog-scrollgutter",`${wd}px`)},[]);const od=(Iu??DefaultHeader)(Xu),sd=(Pu??DefaultBody)(Xu),ad=(Ou??DefaultFooter)(Xu),pd=typeof Fu=="string"?{"data-position-regular":Fu}:Object.fromEntries(Object.entries(Fu).map(([bd,wd])=>[`data-position-${bd}`,wd]));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(BoxWithFallback,{as:"div",ref:nd,className:classes$w.Backdrop,...pd,onClick:ed,onMouseDown:bd=>{Yu(bd.target===bd.currentTarget)},children:jsxRuntimeExports.jsxs(BoxWithFallback,{as:"div",ref:td,role:Mu,"aria-labelledby":Gu,"aria-describedby":Wu,"aria-modal":!0,...pd,"data-width":Lu,"data-height":Bu,sx:Hu,className:clsx(Vu,classes$w.Dialog),children:[od,jsxRuntimeExports.jsx(ScrollableRegion,{"aria-labelledby":Gu,className:classes$w.DialogOverflowWrapper,children:sd}),ad]})})})})});_Dialog.displayName="Dialog";const Header=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,classes$w.Header),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"div",ref:$u,className:Ou,...Pu}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});Header.displayName="Dialog.Header";const Title$1=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,classes$w.Title),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"h1",ref:$u,className:Ou,...Pu}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});Title$1.displayName="Dialog.Title";const Subtitle=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,classes$w.Subtitle),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"h2",ref:$u,className:Ou,...Pu}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});Subtitle.displayName="Dialog.Subtitle";const Body=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,classes$w.Body),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"div",ref:$u,className:Ou,...Pu}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});Body.displayName="Dialog.Body";const Footer=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,classes$w.Footer),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"div",ref:$u,className:Ou,...Pu}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});Footer.displayName="Dialog.Footer";const Buttons=({buttons:Au})=>{var lo;const $u=useProvidedRefOrCreate((lo=Au.find(Ou=>Ou.autoFocus))===null||lo===void 0?void 0:lo.ref);let Ru=0;const[Iu,Pu]=reactExports.useState(0);return reactExports.useEffect(()=>{if(Iu===1){var Ou;(Ou=$u.current)===null||Ou===void 0||Ou.focus()}else Pu(Iu+1)},[$u,Iu]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Au.map((Ou,Du)=>{const{content:Mu,buttonType:Lu="default",autoFocus:Bu=!1,...ju}=Ou;return jsxRuntimeExports.jsx(ButtonComponent,{...ju,variant:Lu==="normal"?"default":Lu,ref:Bu&&Ru===0?(Ru++,$u):null,children:Mu},Du)})})},CloseButton=Au=>{const lo=distExports.c(2),{onClose:$u}=Au;let Ru;return lo[0]!==$u?(Ru=jsxRuntimeExports.jsx(IconButton,{icon:XIcon,"aria-label":"Close",onClick:$u,variant:"invisible"}),lo[0]=$u,lo[1]=Ru):Ru=lo[1],Ru},Dialog$1=Object.assign(_Dialog,{Header,Title:Title$1,Subtitle,Body,Footer,Buttons,CloseButton});function useResizeObserver(Au,lo,$u=[]){const[Ru,Iu]=reactExports.useState(null),Pu=reactExports.useRef(Au);useIsomorphicLayoutEffect$2(()=>{Pu.current=Au}),useIsomorphicLayoutEffect$2(()=>{const Ou=lo&&"current"in lo?lo.current:document.documentElement;if(Ou)if(typeof ResizeObserver=="function"){const Du=new ResizeObserver(Mu=>{Pu.current(Mu)});return Du.observe(Ou),()=>{Du.disconnect()}}else{const Du=()=>{const Mu=Ou.getBoundingClientRect();(Mu.width!==Ru?.width||Mu.height!==Ru.height)&&Pu.current([{contentRect:Mu}]),Iu(Mu)};return window.addEventListener("resize",Du),()=>{window.removeEventListener("resize",Du)}}},[lo?.current,...$u])}function useMedia(Au,lo){const $u=distExports.c(12),Ru=reactExports.useContext(MatchMediaContext);let Iu;$u[0]!==lo||$u[1]!==Ru||$u[2]!==Au?(Iu=()=>Ru[Au]!==void 0?Ru[Au]:lo,$u[0]=lo,$u[1]=Ru,$u[2]=Au,$u[3]=Iu):Iu=$u[3];const[Pu,Ou]=vM.useState(Iu);let Du,Mu;$u[4]!==Ru||$u[5]!==Au?(Du=()=>{Ru[Au]!==void 0&&Ou(Ru[Au])},Mu=[Ru,Au],$u[4]=Ru,$u[5]=Au,$u[6]=Du,$u[7]=Mu):(Du=$u[6],Mu=$u[7]),reactExports.useEffect(Du,Mu);let Lu,Bu;return $u[8]!==Ru||$u[9]!==Au?(Lu=()=>{if(Ru[Au]!==void 0)return;const ju=function(Uu){Ou(Uu.matches)},Fu=window.matchMedia(Au);return Fu.addEventListener?Fu.addEventListener("change",ju):Fu.addListener(ju),Ou(Fu.matches),()=>{Fu.addEventListener?Fu.removeEventListener("change",ju):Fu.removeListener(ju)}},Bu=[Ru,Au],$u[8]=Ru,$u[9]=Au,$u[10]=Lu,$u[11]=Bu):(Lu=$u[10],Bu=$u[11]),reactExports.useEffect(Lu,Bu),Pu}const MatchMediaContext=reactExports.createContext({}),viewportRanges={narrow:"(max-width: calc(768px - 0.02px))",regular:"(min-width: 768px)",wide:"(min-width: 1400px)"};function isResponsiveValue(Au){return typeof Au=="object"&&Object.keys(Au).some(lo=>["narrow","regular","wide"].includes(lo))}function useResponsiveValue(Au,lo){const $u=useMedia(viewportRanges.narrow,!1),Ru=useMedia(viewportRanges.regular,!1),Iu=useMedia(viewportRanges.wide,!1);if(isResponsiveValue(Au)){const Pu=Au;return $u&&"narrow"in Pu?Pu.narrow:Iu&&"wide"in Pu?Pu.wide:Ru&&"regular"in Pu?Pu.regular:lo}else return Au}const t$5=new Set(["children","localName","ref","style","className"]),e$3=new WeakMap,n$3=(Au,lo,$u,Ru,Iu)=>{const Pu=Iu?.[lo];Pu===void 0||$u===Ru?$u==null&&lo in HTMLElement.prototype?Au.removeAttribute(lo):Au[lo]=$u:((Ou,Du,Mu)=>{let Lu=e$3.get(Ou);Lu===void 0&&e$3.set(Ou,Lu=new Map);let Bu=Lu.get(Du);Mu!==void 0?Bu===void 0?(Lu.set(Du,Bu={handleEvent:Mu}),Ou.addEventListener(Du,Bu)):Bu.handleEvent=Mu:Bu!==void 0&&(Lu.delete(Du),Ou.removeEventListener(Du,Bu))})(Au,Pu,$u)},s$6=(Au,lo)=>{typeof Au=="function"?Au(lo):Au.current=lo};function i$4(Au=window.React,lo,$u,Ru,Iu){let Pu,Ou,Du;{const zu=Au;({tagName:Ou,elementClass:Du,events:Ru,displayName:Iu}=zu),Pu=zu.react}const Mu=Pu.Component,Lu=Pu.createElement,Bu=new Set(Object.keys(Ru??{}));class ju extends Mu{constructor(){super(...arguments),this.o=null}t(Uu){if(this.o!==null)for(const Hu in this.i)n$3(this.o,Hu,this.props[Hu],Uu?Uu[Hu]:void 0,Ru)}componentDidMount(){var Uu;this.t(),(Uu=this.o)===null||Uu===void 0||Uu.removeAttribute("defer-hydration")}componentDidUpdate(Uu){this.t(Uu)}render(){const{_$Gl:Uu,...Hu}=this.props;this.h!==Uu&&(this.u=Gu=>{Uu!==null&&s$6(Uu,Gu),this.o=Gu,this.h=Uu}),this.i={};const Vu={ref:this.u};for(const[Gu,Wu]of Object.entries(Hu))t$5.has(Gu)?Vu[Gu==="className"?"class":Gu]=Wu:Bu.has(Gu)||Gu in Du.prototype?this.i[Gu]=Wu:Vu[Gu]=Wu;return Vu.suppressHydrationWarning=!0,Lu(Ou,Vu)}}ju.displayName=Iu??Du.name;const Fu=Pu.forwardRef(((zu,Uu)=>Lu(ju,{...zu,_$Gl:Uu},zu?.children)));return Fu.displayName=ju.displayName,Fu}const rename=Au=>Au[0].toUpperCase()+Au.slice(1).replace(/(-\w)/g,lo=>lo[1].toUpperCase()),createComponent=(Au,lo,$u=void 0)=>Object.assign(Object.assign(qe$4(i$4({tagName:lo,elementClass:Au,react:vM,events:$u})),{displayName:rename(lo)})(sx),{displayName:rename(lo)}),ActionListContainerContext=vM.createContext({});function useSlots(Au,lo){const $u=mapValues$1(lo,()=>{}),Ru=[],Iu=Object.keys(lo),Pu=Object.values(lo);return vM.Children.forEach(Au,Ou=>{if(!vM.isValidElement(Ou)){Ru.push(Ou);return}const Du=Pu.findIndex(Lu=>{if(Array.isArray(Lu)){const[Bu,ju]=Lu;return Ou.type===Bu&&ju(Ou.props)}else return Ou.type===Lu});if(Du===-1){Ru.push(Ou);return}const Mu=Iu[Du];$u[Mu]||($u[Mu]=Ou)}),[$u,Ru]}function mapValues$1(Au,lo){return Object.keys(Au).reduce(($u,Ru)=>($u[Ru]=lo(Au[Ru]),$u),{})}const ItemContext=vM.createContext({}),ListContext=vM.createContext({});var classes$v={ActionListHeader:"prc-ActionList-ActionListHeader-lEr8v"},classes$u={Heading:"prc-Heading-Heading-6CmGO"};const Heading$2=reactExports.forwardRef(({as:Au="h2",className:lo,variant:$u,...Ru},Iu)=>{const Pu=vM.useRef(null);return useRefObjectAsForwardedRef(Iu,Pu),Ru.sx?jsxRuntimeExports.jsx(Box$1,{as:Au,className:clsx(lo,classes$u.Heading),"data-variant":$u,...Ru,ref:Pu}):jsxRuntimeExports.jsx(Au,{className:clsx(lo,classes$u.Heading),"data-variant":$u,...Ru,ref:Pu})});Heading$2.displayName="Heading";const Heading$1=reactExports.forwardRef(({as:Au,size:lo,children:$u,visuallyHidden:Ru=!1,className:Iu,...Pu},Ou)=>{var Du;const Mu=vM.useRef(null);useRefObjectAsForwardedRef(Ou,Mu);const{headingId:Lu,variant:Bu}=vM.useContext(ListContext),{container:ju}=vM.useContext(ActionListContainerContext);return jsxRuntimeExports.jsx(VisuallyHidden,{isVisible:!Ru,children:jsxRuntimeExports.jsx(Heading$2,{as:Au,variant:lo,ref:Mu,id:(Du=Pu.id)!==null&&Du!==void 0?Du:Lu,className:clsx(Iu,classes$v.ActionListHeader),"data-list-variant":Bu,...Pu,children:$u})})});Heading$1.displayName="ActionList.Heading";var classes$t={ActionList:"prc-ActionList-ActionList-X4RiC",ActionListItem:"prc-ActionList-ActionListItem-uq6I7",ActionListSubContent:"prc-ActionList-ActionListSubContent-lP9xj",Divider:"prc-ActionList-Divider-rsZFG",ItemLabel:"prc-ActionList-ItemLabel-TmBhn",TrailingAction:"prc-ActionList-TrailingAction-RmUk1",TrailingVisual:"prc-ActionList-TrailingVisual-XocgV",InactiveWarning:"prc-ActionList-InactiveWarning-YRMKV",ActionListContent:"prc-ActionList-ActionListContent-sg9-x",Spacer:"prc-ActionList-Spacer-dydlX",MultiSelectCheckbox:"prc-ActionList-MultiSelectCheckbox-nK6PJ",Description:"prc-ActionList-Description-G0lJ3",SingleSelectCheckmark:"prc-ActionList-SingleSelectCheckmark-Vqn87",ExpandIcon:"prc-ActionList-ExpandIcon-SKUGP",SubGroup:"prc-ActionList-SubGroup-24eK2",LeadingAction:"prc-ActionList-LeadingAction-Oy04M",LeadingVisual:"prc-ActionList-LeadingVisual-dxXxW",ItemDescriptionWrap:"prc-ActionList-ItemDescriptionWrap-VJA7h",VisualWrap:"prc-ActionList-VisualWrap-rfjV-",TrailingActionButton:"prc-ActionList-TrailingActionButton-i2wnc",InactiveButtonWrap:"prc-ActionList-InactiveButtonWrap-T6Jfa",InactiveButtonReset:"prc-ActionList-InactiveButtonReset-3lIQX"};const List$1=vM.forwardRef(({variant:Au="inset",selectionVariant:lo,showDividers:$u=!1,role:Ru,disableFocusZone:Iu=!1,className:Pu,...Ou},Du)=>{var Mu;const[Lu,Bu]=useSlots(Ou.children,{heading:Heading$1}),ju=useId(),{listRole:Fu,listLabelledBy:zu,selectionVariant:Uu,enableFocusZone:Hu,container:Vu}=vM.useContext(ActionListContainerContext),Gu=Lu.heading?(Mu=Lu.heading.props.id)!==null&&Mu!==void 0?Mu:ju:zu,Wu=Ru||Fu,Zu=useProvidedRefOrCreate(Du);let Ju=!1;return Hu!==void 0?Ju=Hu:Wu&&!Iu&&(Ju=["menu","menubar","listbox"].includes(Wu)),useFocusZone({disabled:!Ju,containerRef:Zu,bindKeys:FocusKeys.ArrowVertical|FocusKeys.HomeAndEnd|FocusKeys.PageUpDown,focusOutBehavior:Wu==="menu"||Vu==="SelectPanel"||Vu==="FilteredActionList"?"wrap":void 0}),jsxRuntimeExports.jsxs(ListContext.Provider,{value:{variant:Au,selectionVariant:lo||Uu,showDividers:$u,role:Wu,headingId:ju},children:[Lu.heading,jsxRuntimeExports.jsx(BoxWithFallback,{as:"ul",className:clsx(classes$t.ActionList,Pu),role:Wu,"aria-labelledby":Gu,ref:Zu,"data-dividers":$u,"data-variant":Au,...Ou,children:Bu})]})});List$1.displayName="ActionList";var groupClasses={Group:"prc-ActionList-Group-fXpF9",GroupHeadingWrap:"prc-ActionList-GroupHeadingWrap-pfbd9",GroupList:"prc-ActionList-GroupList-sj8d3",GroupHeading:"prc-ActionList-GroupHeading-eahp0"};const Heading=({as:Au="h3",className:lo,children:$u,id:Ru,...Iu})=>jsxRuntimeExports.jsx(BoxWithFallback,{as:Au,className:lo,id:Ru,...Iu,children:$u});Heading.displayName="Heading";const HeadingWrap=({as:Au="div",children:lo,className:$u,...Ru})=>vM.createElement(Au,{...Ru,className:$u},lo),GroupContext=vM.createContext({groupHeadingId:void 0,selectionVariant:void 0}),Group$1=({title:Au,variant:lo="subtle",auxiliaryText:$u,selectionVariant:Ru,role:Iu,className:Pu,"aria-label":Ou,...Du})=>{var Mu;const Lu=useId(),{role:Bu}=vM.useContext(ListContext),[ju,Fu]=useSlots(Du.children,{groupHeading:GroupHeading});let zu;if(ju.groupHeading){var Uu;zu=(Uu=ju.groupHeading.props.id)!==null&&Uu!==void 0?Uu:Lu}return Au&&(zu=Lu),jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",className:clsx(Pu,groupClasses.Group),role:Bu?"none":void 0,...Du,children:jsxRuntimeExports.jsxs(GroupContext.Provider,{value:{selectionVariant:Ru,groupHeadingId:zu},children:[Au&&!ju.groupHeading?jsxRuntimeExports.jsx(GroupHeading,{variant:lo,auxiliaryText:$u,_internalBackwardCompatibleTitle:Au}):null,!Au&&ju.groupHeading?vM.cloneElement(ju.groupHeading):null,jsxRuntimeExports.jsx("ul",{"aria-labelledby":Bu?void 0:zu,"aria-label":Ou??(Bu?Au??((Mu=ju.groupHeading)===null||Mu===void 0?void 0:Mu.props.children):void 0),role:Iu||Bu&&"group",className:groupClasses.GroupList,children:ju.groupHeading?Fu:Du.children})]})})};Group$1.displayName="Group";const GroupHeading=({as:Au,variant:lo="subtle",_internalBackwardCompatibleTitle:$u,auxiliaryText:Ru,children:Iu,className:Pu,sx:Ou,headingWrapElement:Du="div",...Mu})=>{const{role:Lu}=vM.useContext(ListContext),{groupHeadingId:Bu}=vM.useContext(GroupContext);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Lu&&Lu!=="list"?jsxRuntimeExports.jsxs(HeadingWrap,{role:"presentation",className:groupClasses.GroupHeadingWrap,"aria-hidden":"true","data-variant":lo,"data-component":"GroupHeadingWrap",as:Du,...Mu,children:[jsxRuntimeExports.jsx("span",{className:clsx(Pu,groupClasses.GroupHeading),id:Bu,children:$u??Iu}),Ru&&jsxRuntimeExports.jsx("div",{className:classes$t.Description,children:Ru})]}):jsxRuntimeExports.jsxs(HeadingWrap,{className:groupClasses.GroupHeadingWrap,"data-variant":lo,as:Du,"data-component":"GroupHeadingWrap",children:[jsxRuntimeExports.jsx(Heading,{className:clsx(Pu,groupClasses.GroupHeading),as:Au||"h3",id:Bu,sx:Ou,...Mu,children:$u??Iu}),Ru&&jsxRuntimeExports.jsx("div",{className:classes$t.Description,children:Ru})]})})};GroupHeading.displayName="ActionList.GroupHeading";Group$1.displayName="ActionList.Group";var classes$s={Truncate:"prc-Truncate-Truncate-A9Wn6"};const Truncate=vM.forwardRef(function({as:lo,children:$u,className:Ru,title:Iu,inline:Pu,expandable:Ou,maxWidth:Du=125,style:Mu,sx:Lu,...Bu},ju){return jsxRuntimeExports.jsx(BoxWithFallback,{...Bu,ref:ju,as:lo,className:clsx(Ru,classes$s.Truncate),"data-expandable":Ou,"data-inline":Pu,title:Iu,style:{...Mu,"--truncate-max-width":typeof Du=="number"?`${Du}px`:typeof Du=="string"?Du:void 0},sx:Lu,children:$u})}),Description=({variant:Au="inline",sx:lo,className:$u,truncate:Ru,...Iu})=>{const{blockDescriptionId:Pu,inlineDescriptionId:Ou}=vM.useContext(ItemContext),Du=vM.useRef(null),[Mu,Lu]=vM.useState("");vM.useEffect(()=>{if(Ru&&Du.current){const ju=Du.current.textContent||"";Lu(ju)}},[Ru,Iu.children]);const Bu=typeof Iu.children=="string"?Iu.children:Mu;return Au==="block"||!Ru?jsxRuntimeExports.jsx(BoxWithFallback,{as:"span",sx:lo,id:Au==="block"?Pu:Ou,className:clsx($u,classes$t.Description),"data-component":"ActionList.Description",children:Iu.children}):jsxRuntimeExports.jsx(Truncate,{ref:Du,id:Ou,className:clsx($u,classes$t.Description),sx:lo,title:Bu,inline:!0,maxWidth:"100%","data-component":"ActionList.Description",children:Iu.children})},VisualContainer=({className:Au,...lo})=>jsxRuntimeExports.jsx(BoxWithFallback,{as:"span",className:clsx(Au,classes$t.VisualWrap),...lo});VisualContainer.displayName="VisualContainer";const LeadingVisual=({className:Au,...lo})=>jsxRuntimeExports.jsx(VisualContainer,{className:clsx(Au,classes$t.LeadingVisual),...lo,children:lo.children});LeadingVisual.displayName="LeadingVisual";const TrailingVisual=({className:Au,...lo})=>{const{trailingVisualId:$u}=vM.useContext(ItemContext);return jsxRuntimeExports.jsx(VisualContainer,{className:clsx(Au,classes$t.TrailingVisual),id:$u,...lo,children:lo.children})};TrailingVisual.displayName="TrailingVisual";const VisualOrIndicator=({children:Au,labelId:lo,loading:$u,inactiveText:Ru,itemHasLeadingVisual:Iu,position:Pu,className:Ou})=>{const Du=Pu==="leading"?LeadingVisual:TrailingVisual;return!$u&&!Ru||Iu&&Pu==="trailing"||!Iu&&Pu==="leading"?Au:Ru?jsxRuntimeExports.jsx("span",{className:classes$t.InactiveButtonWrap,children:jsxRuntimeExports.jsx(Tooltip,{text:Ru,type:"description",children:jsxRuntimeExports.jsx("button",{type:"button",className:classes$t.InactiveButtonReset,"aria-labelledby":lo,children:jsxRuntimeExports.jsx(Du,{children:jsxRuntimeExports.jsx(AlertIcon,{})})})})}):jsxRuntimeExports.jsx(Du,{className:Ou,children:jsxRuntimeExports.jsx(StyledSpinner,{size:"small"})})};LeadingVisual.displayName="ActionList.LeadingVisual";TrailingVisual.displayName="ActionList.TrailingVisual";const CheckboxOrRadioGroupContext=vM.createContext({});var classes$r={Body:"prc-CheckboxOrRadioGroup-Body-cNQoa",GroupFieldset:"prc-CheckboxOrRadioGroup-GroupFieldset-0NZzG",GroupLegend:"prc-CheckboxOrRadioGroup-GroupLegend-HW4-c",CheckboxOrRadioGroupCaption:"prc-CheckboxOrRadioGroup-CheckboxOrRadioGroupCaption-9GgyY",RadioGroupLabel:"prc-CheckboxOrRadioGroup-RadioGroupLabel-anQ3U",GroupLabelChildren:"prc-CheckboxOrRadioGroup-GroupLabelChildren-j5sBI"};const CheckboxOrRadioGroupCaption=({className:Au,children:lo,sx:$u})=>{const{captionId:Ru}=vM.useContext(CheckboxOrRadioGroupContext);return jsxRuntimeExports.jsx(Text$3,{className:clsx(Au,classes$r.CheckboxOrRadioGroupCaption),id:Ru,sx:$u,children:lo})};CheckboxOrRadioGroupCaption.displayName="CheckboxOrRadioGroupCaption";function getResponsiveAttributes(Au,lo){if(lo!=null)return Object.fromEntries(typeof lo=="object"?Object.entries(lo).map(([$u,Ru])=>serialize$4(`data-${Au}-${$u}`,Ru)):[serialize$4(`data-${Au}`,lo)])}function serialize$4(Au,lo){return[Au,lo]}var classes$q={Stack:"prc-Stack-Stack-WJVsK",StackItem:"prc-Stack-StackItem-CweWT"};const Stack$2=reactExports.forwardRef((Au,lo)=>{const $u=distExports.c(37);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu;$u[0]!==Au?({as:Ru,children:Iu,align:Mu,direction:Lu,gap:Ou,justify:Bu,padding:ju,wrap:Fu,className:Pu,...Du}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju,$u[10]=Fu):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9],Fu=$u[10]);const zu=Mu===void 0?"stretch":Mu,Uu=Lu===void 0?"vertical":Lu,Hu=Bu===void 0?"start":Bu,Vu=ju===void 0?"none":ju,Gu=Fu===void 0?"nowrap":Fu;let Wu;$u[11]!==Pu?(Wu=clsx(Pu,classes$q.Stack),$u[11]=Pu,$u[12]=Wu):Wu=$u[12];let Zu;$u[13]!==Ou?(Zu=getResponsiveAttributes("gap",Ou),$u[13]=Ou,$u[14]=Zu):Zu=$u[14];let Ju;$u[15]!==Uu?(Ju=getResponsiveAttributes("direction",Uu),$u[15]=Uu,$u[16]=Ju):Ju=$u[16];let Yu;$u[17]!==zu?(Yu=getResponsiveAttributes("align",zu),$u[17]=zu,$u[18]=Yu):Yu=$u[18];let Xu;$u[19]!==Gu?(Xu=getResponsiveAttributes("wrap",Gu),$u[19]=Gu,$u[20]=Xu):Xu=$u[20];let ed;$u[21]!==Hu?(ed=getResponsiveAttributes("justify",Hu),$u[21]=Hu,$u[22]=ed):ed=$u[22];let td;$u[23]!==Vu?(td=getResponsiveAttributes("padding",Vu),$u[23]=Vu,$u[24]=td):td=$u[24];let nd;return $u[25]!==Ru||$u[26]!==Iu||$u[27]!==lo||$u[28]!==Du||$u[29]!==Xu||$u[30]!==ed||$u[31]!==td||$u[32]!==Wu||$u[33]!==Zu||$u[34]!==Ju||$u[35]!==Yu?(nd=jsxRuntimeExports.jsx(BoxWithFallback,{as:Ru,ref:lo,...Du,className:Wu,...Zu,...Ju,...Yu,...Xu,...ed,...td,children:Iu}),$u[25]=Ru,$u[26]=Iu,$u[27]=lo,$u[28]=Du,$u[29]=Xu,$u[30]=ed,$u[31]=td,$u[32]=Wu,$u[33]=Zu,$u[34]=Ju,$u[35]=Yu,$u[36]=nd):nd=$u[36],nd}),StackItem$1=reactExports.forwardRef((Au,lo)=>{const $u=distExports.c(21);let Ru,Iu,Pu,Ou,Du,Mu;$u[0]!==Au?({as:Ru,children:Iu,grow:Ou,shrink:Mu,className:Pu,...Du}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6]);let Lu;$u[7]!==Pu?(Lu=clsx(Pu,classes$q.StackItem),$u[7]=Pu,$u[8]=Lu):Lu=$u[8];let Bu;$u[9]!==Ou?(Bu=getResponsiveAttributes("grow",Ou),$u[9]=Ou,$u[10]=Bu):Bu=$u[10];let ju;$u[11]!==Mu?(ju=getResponsiveAttributes("shrink",Mu),$u[11]=Mu,$u[12]=ju):ju=$u[12];let Fu;return $u[13]!==Ru||$u[14]!==Iu||$u[15]!==lo||$u[16]!==Du||$u[17]!==Lu||$u[18]!==Bu||$u[19]!==ju?(Fu=jsxRuntimeExports.jsx(BoxWithFallback,{as:Ru,ref:lo,...Du,className:Lu,...Bu,...ju,children:Iu}),$u[13]=Ru,$u[14]=Iu,$u[15]=lo,$u[16]=Du,$u[17]=Lu,$u[18]=Bu,$u[19]=ju,$u[20]=Fu):Fu=$u[20],Fu}),Stack$1=Object.assign(Stack$2,{Item:StackItem$1}),CheckboxOrRadioGroupLabel=({children:Au,className:lo,visuallyHidden:$u=!1,sx:Ru})=>{const{required:Iu,disabled:Pu}=vM.useContext(CheckboxOrRadioGroupContext);return jsxRuntimeExports.jsx(VisuallyHidden,{className:clsx(lo,classes$r.RadioGroupLabel),isVisible:!$u,title:Iu?"required field":void 0,"data-label-disabled":Pu?"":void 0,sx:Ru,children:Iu?jsxRuntimeExports.jsxs(Stack$1,{direction:"horizontal",gap:"none",children:[jsxRuntimeExports.jsx("div",{className:classes$r.GroupLabelChildren,children:Au}),jsxRuntimeExports.jsx("span",{children:"*"})]}):Au})};CheckboxOrRadioGroupLabel.displayName="CheckboxOrRadioGroupLabel";var classes$p={InputValidation:"prc-components-InputValidation-GjS0D",ValidationIcon:"prc-components-ValidationIcon-Kdbbr",ValidationText:"prc-components-ValidationText-jjsBp"};const validationIconMap={success:CheckCircleFillIcon,error:AlertFillIcon},InputValidation=Au=>{const lo=distExports.c(14),{children:$u,className:Ru,id:Iu,validationStatus:Pu,sx:Ou}=Au,Du=Pu?validationIconMap[Pu]:void 0;let Mu;lo[0]!==Ru?(Mu=clsx(Ru,classes$p.InputValidation),lo[0]=Ru,lo[1]=Mu):Mu=lo[1];let Lu;lo[2]!==Du?(Lu=Du?jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:classes$p.ValidationIcon,style:{"--inputValidation-iconSize":16},children:jsxRuntimeExports.jsx(Du,{size:12,fill:"currentColor"})}):null,lo[2]=Du,lo[3]=Lu):Lu=lo[3];let Bu;lo[4]===Symbol.for("react.memo_cache_sentinel")?(Bu={"--inputValidation-lineHeight":1.3333333333333333},lo[4]=Bu):Bu=lo[4];let ju;lo[5]!==$u||lo[6]!==Iu?(ju=jsxRuntimeExports.jsx("span",{id:Iu,className:classes$p.ValidationText,style:Bu,children:$u}),lo[5]=$u,lo[6]=Iu,lo[7]=ju):ju=lo[7];let Fu;return lo[8]!==Ou||lo[9]!==Mu||lo[10]!==Lu||lo[11]!==ju||lo[12]!==Pu?(Fu=jsxRuntimeExports.jsxs(Text$3,{className:Mu,"data-validation-status":Pu,sx:Ou,children:[Lu,ju]}),lo[8]=Ou,lo[9]=Mu,lo[10]=Lu,lo[11]=ju,lo[12]=Pu,lo[13]=Fu):Fu=lo[13],Fu},CheckboxOrRadioGroupValidation=({children:Au,variant:lo,sx:$u})=>{const{validationMessageId:Ru=""}=vM.useContext(CheckboxOrRadioGroupContext);return jsxRuntimeExports.jsx(InputValidation,{validationStatus:lo,id:Ru,sx:$u,children:Au})};CheckboxOrRadioGroupValidation.displayName="CheckboxOrRadioGroupValidation";function useRenderForcingRef(Au){const[lo,$u]=reactExports.useState(Au||null),Ru=reactExports.useRef(null);Ru.current=lo;const Iu=reactExports.useCallback(Pu=>{Ru.current=Pu,$u(Pu)},[Ru]);return[Ru,Iu]}const fadeIn=We$4(["0%{opacity:0;transform:translateY(-100%);}100%{opacity:1;transform:translateY(0);}"]),AnimatedElement=qe$4.div.withConfig({displayName:"ValidationAnimationContainer__AnimatedElement",componentId:"sc-8z5a3g-0"})(["animation:",";@media (prefers-reduced-motion){animation:none;}"],Au=>Au.show&&Ae$4(["170ms "," cubic-bezier(0.44,0.74,0.36,1);"],fadeIn)),ValidationAnimationContainer=Au=>{const lo=distExports.c(10),{show:$u,children:Ru}=Au,[Iu,Pu]=reactExports.useState($u);let Ou,Du;lo[0]!==$u?(Ou=()=>{$u&&Pu(!0)},Du=[$u],lo[0]=$u,lo[1]=Ou,lo[2]=Du):(Ou=lo[1],Du=lo[2]),reactExports.useEffect(Ou,Du);let Mu;lo[3]!==$u?(Mu=()=>{$u||Pu(!1)},lo[3]=$u,lo[4]=Mu):Mu=lo[4];const Lu=Mu;let Bu;return lo[5]!==Ru||lo[6]!==Lu||lo[7]!==Iu||lo[8]!==$u?(Bu=Iu?jsxRuntimeExports.jsx(Box$1,{height:$u?"auto":0,overflow:"hidden",children:jsxRuntimeExports.jsx(AnimatedElement,{show:$u,onAnimationEnd:Lu,children:Ru})}):null,lo[5]=Ru,lo[6]=Lu,lo[7]=Iu,lo[8]=$u,lo[9]=Bu):Bu=lo[9],Bu},CheckboxOrRadioGroup=({"aria-labelledby":Au,children:lo,disabled:$u=!1,id:Ru,required:Iu=!1,className:Pu,sx:Ou})=>{const[Du,Mu]=useSlots(lo,{caption:CheckboxOrRadioGroupCaption,label:CheckboxOrRadioGroupLabel,validation:CheckboxOrRadioGroupValidation}),Lu=vM.Children.toArray(lo).find(Vu=>vM.isValidElement(Vu)&&Vu.type===CheckboxOrRadioGroupLabel),Bu=vM.Children.toArray(lo).find(Vu=>vM.isValidElement(Vu)&&Vu.type===CheckboxOrRadioGroupValidation?Vu:null),ju=vM.Children.toArray(lo).find(Vu=>vM.isValidElement(Vu)&&Vu.type===CheckboxOrRadioGroupCaption?Vu:null),Fu=useId(Ru),zu=Bu?`${Fu}-validationMessage`:void 0,Uu=ju?`${Fu}-caption`:void 0;!Lu&&!Au&&console.warn("A choice group must be labelled using a `CheckboxOrRadioGroup.Label` child, or by passing `aria-labelledby` to the CheckboxOrRadioGroup component.");const Hu=vM.isValidElement(Lu)&&!Lu.props.visuallyHidden;return jsxRuntimeExports.jsx(CheckboxOrRadioGroupContext.Provider,{value:{disabled:$u,required:Iu,captionId:Uu,validationMessageId:zu},children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(BoxWithFallback,{className:clsx(Pu,classes$r.GroupFieldset),"data-validation":Bu?"":void 0,...Lu?{as:"fieldset",disabled:$u}:{},sx:Ou,children:[Lu?jsxRuntimeExports.jsxs("legend",{className:classes$r.GroupLegend,"data-legend-visible":Hu?"":void 0,children:[Du.label,Du.caption,vM.isValidElement(Du.validation)&&Du.validation.props.children&&jsxRuntimeExports.jsx(VisuallyHidden,{children:Du.validation.props.children})]}):Du.caption,jsxRuntimeExports.jsx("div",{className:classes$r.Body,...Lu?{}:{"aria-labelledby":Au,"aria-describedby":[zu,Uu].filter(Boolean).join(" "),as:"div",role:"group"},children:vM.Children.toArray(Mu).filter(Vu=>vM.isValidElement(Vu))})]}),Bu&&jsxRuntimeExports.jsx(ValidationAnimationContainer,{"aria-hidden":!!Lu,show:!0,children:Du.validation})]})})};CheckboxOrRadioGroup.displayName="CheckboxOrRadioGroup";var CheckboxOrRadioGroup$1=Object.assign(CheckboxOrRadioGroup,{Caption:CheckboxOrRadioGroupCaption,Label:CheckboxOrRadioGroupLabel,Validation:CheckboxOrRadioGroupValidation});const RadioGroupContext=reactExports.createContext(null),RadioGroup=Au=>{const lo=distExports.c(23);let $u,Ru,Iu,Pu,Ou;lo[0]!==Au?({children:$u,disabled:Ru,onChange:Pu,name:Iu,...Ou}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5]);const[Du,Mu]=useRenderForcingRef(null);let Lu;lo[6]!==Mu?(Lu=Hu=>{const{value:Vu,checked:Gu}=Hu.currentTarget;if(Gu){Mu(Vu);return}},lo[6]=Mu,lo[7]=Lu):Lu=lo[7];const Bu=Lu;let ju;lo[8]!==Pu||lo[9]!==Du||lo[10]!==Bu?(ju=Hu=>{Pu&&(Bu(Hu),Pu(Du.current,Hu))},lo[8]=Pu,lo[9]=Du,lo[10]=Bu,lo[11]=ju):ju=lo[11];let Fu;lo[12]!==Ru||lo[13]!==Iu||lo[14]!==ju?(Fu={disabled:Ru,name:Iu,onChange:ju},lo[12]=Ru,lo[13]=Iu,lo[14]=ju,lo[15]=Fu):Fu=lo[15];let zu;lo[16]!==$u||lo[17]!==Ru||lo[18]!==Ou?(zu=jsxRuntimeExports.jsx(CheckboxOrRadioGroup$1,{disabled:Ru,...Ou,children:$u}),lo[16]=$u,lo[17]=Ru,lo[18]=Ou,lo[19]=zu):zu=lo[19];let Uu;return lo[20]!==Fu||lo[21]!==zu?(Uu=jsxRuntimeExports.jsx(RadioGroupContext.Provider,{value:Fu,children:zu}),lo[20]=Fu,lo[21]=zu,lo[22]=Uu):Uu=lo[22],Uu};var RadioGroup$1=Object.assign(RadioGroup,{Caption:CheckboxOrRadioGroupCaption,Label:CheckboxOrRadioGroupLabel,Validation:CheckboxOrRadioGroupValidation}),sharedClasses={Input:"prc-Checkbox-Input-mxggT"},classes$o={Radio:"prc-Radio-Radio-Ly4MR"};const Radio=vM.forwardRef((Au,lo)=>{const $u=distExports.c(26);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;$u[0]!==Au?({checked:Ru,disabled:Pu,name:Ou,onChange:Du,required:Mu,value:ju,className:Iu,"aria-hidden":Bu,...Lu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9]);const Fu=Bu===void 0?!1:Bu,zu=reactExports.useContext(RadioGroupContext);let Uu;$u[10]!==Du||$u[11]!==zu?(Uu=Ju=>{zu?.onChange&&zu.onChange(Ju),Du&&Du(Ju)},$u[10]=Du,$u[11]=zu,$u[12]=Uu):Uu=$u[12];const Hu=Uu,Vu=Ou||zu?.name;!Vu&&!Fu&&console.warn("A radio input must have a `name` attribute. Pass `name` as a prop directly to each Radio, or nest them in a `RadioGroup` component with a `name` prop");const Gu=Ru?"true":"false";let Wu;$u[13]!==Iu?(Wu=clsx(Iu,sharedClasses.Input,classes$o.Radio),$u[13]=Iu,$u[14]=Wu):Wu=$u[14];let Zu;return $u[15]!==Ru||$u[16]!==Pu||$u[17]!==Hu||$u[18]!==Vu||$u[19]!==lo||$u[20]!==Mu||$u[21]!==Lu||$u[22]!==Gu||$u[23]!==Wu||$u[24]!==ju?(Zu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"input",type:"radio",value:ju,name:Vu,ref:lo,disabled:Pu,checked:Ru,"aria-checked":Gu,required:Mu,onChange:Hu,className:Wu,...Lu}),$u[15]=Ru,$u[16]=Pu,$u[17]=Hu,$u[18]=Vu,$u[19]=lo,$u[20]=Mu,$u[21]=Lu,$u[22]=Gu,$u[23]=Wu,$u[24]=ju,$u[25]=Zu):Zu=$u[25],Zu});Radio.displayName="Radio";const Selection=({selected:Au,className:lo})=>{const{selectionVariant:$u,role:Ru}=vM.useContext(ListContext),{selectionVariant:Iu}=vM.useContext(GroupContext);let Pu;return typeof Iu<"u"?Pu=Iu:Pu=$u,Pu?Pu==="radio"?jsxRuntimeExports.jsx(VisualContainer,{className:lo,"data-component":"ActionList.Selection",children:jsxRuntimeExports.jsx(Radio,{value:"unused",checked:Au,"aria-hidden":!0,tabIndex:-1,hidden:!0})}):Pu==="single"||Ru==="menu"?jsxRuntimeExports.jsx(VisualContainer,{className:lo,"data-component":"ActionList.Selection",children:jsxRuntimeExports.jsx(CheckIcon,{className:classes$t.SingleSelectCheckmark})}):jsxRuntimeExports.jsx(VisualContainer,{className:lo,"data-component":"ActionList.Selection",children:jsxRuntimeExports.jsx("div",{className:classes$t.MultiSelectCheckbox})}):null};Selection.displayName="Selection";const TrailingAction=reactExports.forwardRef(({as:Au="button",icon:lo,label:$u,href:Ru=null,className:Iu,loading:Pu,...Ou},Du)=>jsxRuntimeExports.jsx("span",{className:clsx(Iu,classes$t.TrailingAction),children:lo?jsxRuntimeExports.jsx(IconButton,{as:Au,"aria-label":$u,icon:lo,variant:"invisible",tooltipDirection:"w",href:Ru,loading:Pu,"data-loading":!!Pu,ref:Du,className:classes$t.TrailingActionButton,...Ou}):jsxRuntimeExports.jsx(ButtonComponent,{variant:"invisible",as:Au,href:Ru,loading:Pu,"data-loading":!!Pu,ref:Du,className:classes$t.TrailingActionButton,...Ou,children:$u})})),SubItem=({children:Au})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Au});SubItem.displayName="ActionList.SubItem";const ButtonItemContainerNoBox=vM.forwardRef(({children:Au,style:lo,...$u},Ru)=>jsxRuntimeExports.jsx("button",{type:"button",ref:Ru,style:lo,...$u,children:Au})),DivItemContainerNoBox=vM.forwardRef(({children:Au,...lo},$u)=>jsxRuntimeExports.jsx("div",{ref:$u,...lo,children:Au})),Item$1=vM.forwardRef(({variant:Au="default",size:lo="medium",disabled:$u=!1,inactiveText:Ru,selected:Iu=void 0,active:Pu=!1,onSelect:Ou,sx:Du,id:Mu,role:Lu,loading:Bu,_PrivateItemWrapper:ju,className:Fu,groupId:zu,renderItem:Uu,handleAddItem:Hu,...Vu},Gu)=>{var Wu,Zu,Ju;const Yu={leadingVisual:LeadingVisual,trailingVisual:TrailingVisual,trailingAction:TrailingAction,subItem:SubItem},[Xu,ed]=useSlots(Vu.children,{...Yu,description:Description}),td={description:void 0,...Xu},{container:nd,afterSelect:od,selectionAttribute:sd,defaultTrailingVisual:ad}=vM.useContext(ActionListContainerContext),pd=ad?jsxRuntimeExports.jsx(TrailingVisual,{children:ad}):null,bd=(Wu=td.trailingVisual)!==null&&Wu!==void 0?Wu:pd,{role:wd,selectionVariant:_d}=vM.useContext(ListContext),{selectionVariant:yd}=vM.useContext(GroupContext),Sd=!!Ru,kd=nd==="ActionMenu"||nd==="SelectPanel"||nd==="FilteredActionList",md=Sd&&!(wd!==void 0&&["menu","listbox"].includes(wd)),dd=vM.useCallback((zd,Pd)=>{typeof Ou=="function"&&Ou(zd),!zd.defaultPrevented&&typeof Pd=="function"&&Pd(zd)},[Ou]),vd=yd||_d;let ld;nd==="ActionMenu"?vd==="single"?ld="menuitemradio":vd==="multiple"?ld="menuitemcheckbox":ld="menuitem":wd==="listbox"&&vd!==void 0&&!Lu&&(ld="option");const ud=Lu||ld;let hd;ud==="menuitemradio"||ud==="menuitemcheckbox"?hd="aria-checked":ud==="option"&&(hd="aria-selected");const gd=sd||hd,Ed=Lu==="option"||Lu==="menuitem"||Lu==="menuitemradio"||Lu==="menuitemcheckbox",Rd=wd&&["listbox","menu","list"].includes(wd)||Sd||Ed,jd=!Rd&&!ju,Cd=vM.useCallback(zd=>{$u||Sd||Bu||dd(zd,od)},[dd,$u,Sd,od,Bu]),$d=vM.useCallback(zd=>{$u||Sd||Bu||[" ","Enter"].includes(zd.key)&&(zd.key===" "&&(zd.preventDefault(),zd.defaultPrevented=!1),dd(zd,od))},[dd,$u,Bu,Sd,od]),Id=useId(Mu),Vd=`${Id}--label`,Dd=`${Id}--inline-description`,Wd=`${Id}--block-description`,oh=`${Id}--trailing-visual`,rh=Sd&&!md?`${Id}--warning-message`:void 0,ah=ju||(Rd?DivItemContainerNoBox:ButtonItemContainerNoBox),vh=gd&&ud&&["menuitemradio","menuitemcheckbox","option"].includes(ud);let Jd;md&&(Jd=!0);const Qd=(Zu=(Ju=td.description)===null||Ju===void 0?void 0:Ju.props.variant)!==null&&Zu!==void 0?Zu:"inline",sh={onClick:Cd,onKeyPress:jd?void 0:$d,"aria-disabled":$u?!0:void 0,"data-inactive":Sd?!0:void 0,"data-loading":Bu&&!Sd?!0:void 0,tabIndex:Jd?void 0:0,"aria-labelledby":`${Vd} ${td.trailingVisual?oh:""} ${td.description&&Qd==="inline"?Dd:""}`,"aria-describedby":[td.description&&Qd==="block"?Wd:void 0,rh??void 0].filter(String).join(" ").trim()||void 0,...vh&&{[gd]:Iu},role:ud,id:Id},Oh=ju?{role:ud?"none":void 0,...Vu}:Rd&&{...sh,...Vu,ref:Gu}||{},qd=ju?sh:!Rd&&{...sh,...Vu,ref:Gu};return jsxRuntimeExports.jsx(ItemContext.Provider,{value:{variant:Au,size:lo,disabled:$u,inactive:!!Ru,inlineDescriptionId:Dd,blockDescriptionId:Wd,trailingVisualId:oh},children:jsxRuntimeExports.jsxs(BoxWithFallback,{...Oh,as:"li",sx:Du,ref:Rd?Gu:null,"data-variant":Au==="danger"?Au:void 0,"data-active":Pu?!0:void 0,"data-inactive":Ru?!0:void 0,"data-has-subitem":td.subItem?!0:void 0,"data-has-description":!!td.description,className:clsx(classes$t.ActionListItem,Fu),children:[jsxRuntimeExports.jsxs(ah,{...qd,className:classes$t.ActionListContent,"data-size":lo,children:[jsxRuntimeExports.jsx("span",{className:classes$t.Spacer}),jsxRuntimeExports.jsx(Selection,{selected:Iu,className:classes$t.LeadingAction}),jsxRuntimeExports.jsx(VisualOrIndicator,{inactiveText:md?Ru:void 0,itemHasLeadingVisual:!!td.leadingVisual,labelId:Vd,loading:Bu,position:"leading",children:td.leadingVisual}),jsxRuntimeExports.jsxs("span",{className:classes$t.ActionListSubContent,"data-component":"ActionList.Item--DividerContainer",children:[jsxRuntimeExports.jsxs(ConditionalWrapper,{if:!!td.description,className:classes$t.ItemDescriptionWrap,"data-description-variant":Qd,children:[jsxRuntimeExports.jsxs("span",{id:Vd,className:classes$t.ItemLabel,children:[ed,Bu===!0&&!Sd&&jsxRuntimeExports.jsx(VisuallyHidden,{children:"Loading"})]}),td.description]}),jsxRuntimeExports.jsx(VisualOrIndicator,{inactiveText:md?Ru:void 0,itemHasLeadingVisual:!!td.leadingVisual,labelId:Vd,loading:Bu,position:"trailing",children:bd}),!md&&Ru?jsxRuntimeExports.jsx("span",{className:classes$t.InactiveWarning,id:rh,children:Ru}):null]})]}),!Sd&&!Bu&&!kd&&!!td.trailingAction&&td.trailingAction,td.subItem]})})});Item$1.displayName="ActionList.Item";var classes$n={Link:"prc-Link-Link-85e08"};const Link$1=reactExports.forwardRef(({as:Au="a",className:lo,inline:$u,underline:Ru,hoverColor:Iu,...Pu},Ou)=>{const Du=vM.useRef(null);return useRefObjectAsForwardedRef(Ou,Du),Pu.sx?jsxRuntimeExports.jsx(Box$1,{as:Au,className:clsx(lo,classes$n.Link),"data-muted":Pu.muted,"data-inline":$u,"data-underline":Ru,"data-hover-color":Iu,...Pu,ref:Du}):jsxRuntimeExports.jsx(Au,{className:clsx(lo,classes$n.Link),"data-muted":Pu.muted,"data-inline":$u,"data-underline":Ru,"data-hover-color":Iu,...Pu,ref:Du})});Link$1.displayName="Link";const LinkItem=vM.forwardRef(({sx:Au,active:lo,inactiveText:$u,variant:Ru,size:Iu,as:Pu,className:Ou,...Du},Mu)=>jsxRuntimeExports.jsx(Item$1,{className:Ou,active:lo,inactiveText:$u,"data-inactive":$u?!0:void 0,variant:Ru,size:Iu,sx:Au,_PrivateItemWrapper:({children:Lu,onClick:Bu,...ju})=>{const Fu=zu=>{Bu&&Bu(zu),Du.onClick&&Du.onClick(zu)};return $u?jsxRuntimeExports.jsx("span",{...ju,children:Lu}):jsxRuntimeExports.jsx(Link$1,{as:Pu,...ju,...Du,onClick:Fu,ref:Mu,children:Lu})},children:Du.children}));LinkItem.displayName="ActionList.LinkItem";const Divider$1=({sx:Au,className:lo})=>jsxRuntimeExports.jsx(BoxWithFallback,{className:clsx(lo,classes$t.Divider),as:"li","aria-hidden":"true",sx:Au,"data-component":"ActionList.Divider"});Divider$1.displayName="Divider";const ActionList=Object.assign(List$1,{Group:Group$1,Item:Item$1,LinkItem,Divider:Divider$1,Description,LeadingVisual,TrailingVisual,Heading:Heading$1,GroupHeading,TrailingAction});var classes$m={Label:"prc-Label-Label--LG6X"};const Label=vM.forwardRef(function(lo,$u){const Ru=distExports.c(23);let Iu,Pu,Ou,Du,Mu;Ru[0]!==lo?({as:Iu,size:Du,variant:Mu,className:Pu,...Ou}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du,Ru[5]=Mu):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4],Mu=Ru[5]);const Lu=Du===void 0?"small":Du,Bu=Mu===void 0?"default":Mu,ju=Iu||"span";if(Ou.sx){let Uu;Ru[6]!==Pu?(Uu=clsx(Pu,classes$m.Label),Ru[6]=Pu,Ru[7]=Uu):Uu=Ru[7];let Hu;return Ru[8]!==ju||Ru[9]!==$u||Ru[10]!==Ou||Ru[11]!==Lu||Ru[12]!==Uu||Ru[13]!==Bu?(Hu=jsxRuntimeExports.jsx(Box$1,{as:ju,className:Uu,"data-size":Lu,"data-variant":Bu,ref:$u,...Ou}),Ru[8]=ju,Ru[9]=$u,Ru[10]=Ou,Ru[11]=Lu,Ru[12]=Uu,Ru[13]=Bu,Ru[14]=Hu):Hu=Ru[14],Hu}let Fu;Ru[15]!==Pu?(Fu=clsx(Pu,classes$m.Label),Ru[15]=Pu,Ru[16]=Fu):Fu=Ru[16];let zu;return Ru[17]!==ju||Ru[18]!==Ou||Ru[19]!==Lu||Ru[20]!==Fu||Ru[21]!==Bu?(zu=jsxRuntimeExports.jsx(ju,{className:Fu,"data-size":Lu,"data-variant":Bu,...Ou}),Ru[17]=ju,Ru[18]=Ou,Ru[19]=Lu,Ru[20]=Fu,Ru[21]=Bu,Ru[22]=zu):zu=Ru[22],zu});var styles$6={ActionMenuContainer:"prc-ActionMenu-ActionMenuContainer-XdFHv"};function useProvidedStateOrCreate(Au,lo,$u){const Ru=distExports.c(5),[Iu,Pu]=reactExports.useState($u),Ou=Au??Iu;let Du;Ru[0]!==lo?(Du=Bu=>{Pu(Bu),lo&&lo(Bu)},Ru[0]=lo,Ru[1]=Du):Du=Ru[1];const Mu=Du;let Lu;return Ru[2]!==Mu||Ru[3]!==Ou?(Lu=[Ou,Mu],Ru[2]=Mu,Ru[3]=Ou,Ru[4]=Lu):Lu=Ru[4],Lu}const useMenuInitialFocus=(Au,lo,$u)=>{const[Ru,Iu]=vM.useState(void 0);vM.useEffect(function(){const Ou=$u?.current,Du=Lu=>{Lu.detail!==0&&Iu("mouse-click")},Mu=Lu=>{["Space","Enter","ArrowDown","ArrowUp"].includes(Lu.code)&&Iu(Lu.code)};return Ou?.addEventListener("click",Du),Ou?.addEventListener("keydown",Mu),()=>{Ou?.removeEventListener("click",Du),Ou?.removeEventListener("keydown",Mu)}},[$u]),vM.useEffect(function(){if(!Au||!(lo!=null&&lo.current))return;const Ou=iterateFocusableElements(lo.current);if(Ru==="mouse-click")if($u!=null&&$u.current)$u.current.focus();else throw new Error("For focus management, please attach anchorRef");else if(Ru&&["ArrowDown","Space","Enter"].includes(Ru)){const Du=Ou.next().value;setTimeout(()=>Du?.focus())}else if(Ru==="ArrowUp"){const Du=[...Ou],Mu=Du[Du.length-1];setTimeout(()=>Mu.focus())}else{const Du=Ou.next().value;setTimeout(()=>Du?.focus())}},[Au,Ru,$u])},useMnemonics=(Au,lo)=>{const $u=distExports.c(9),Ru=useProvidedRefOrCreate(lo);let Iu,Pu;$u[0]!==Ru||$u[1]!==Au?(Iu=function(){if(!Au||!Ru.current)return;const Bu=Ru.current;[...iterateFocusableElements(Bu)].map(_temp$4)},Pu=[Au,Ru],$u[0]=Ru,$u[1]=Au,$u[2]=Iu,$u[3]=Pu):(Iu=$u[2],Pu=$u[3]),vM.useEffect(Iu,Pu);let Ou;$u[4]!==Ru||$u[5]!==Au?(Ou=[Au,Ru],$u[4]=Ru,$u[5]=Au,$u[6]=Ou):Ou=$u[6],vM.useEffect(function(){if(!Au||!Ru.current)return;const Bu=Ru.current,ju=Fu=>{var zu;const Uu=document.activeElement;if(Uu.tagName==="INPUT"||Uu.tagName==="TEXTAREA"||Fu.ctrlKey||Fu.altKey||Fu.metaKey||!Du(Fu))return;Fu.stopPropagation();const Vu=Fu.key.toLowerCase();let Gu;const Zu=[...iterateFocusableElements(Bu)].filter(Yu=>{var Xu;const ed=(Xu=Yu.getAttribute("aria-keyshortcuts"))===null||Xu===void 0?void 0:Xu.split(" ").map(_temp2$3);return ed&&ed.includes(Vu)}),Ju=Zu.indexOf(Uu);Ju===Zu.length-1?Gu=Zu[0]:Gu=Zu.find((Yu,Xu)=>Xu>Ju),(zu=Gu)===null||zu===void 0||zu.focus()};return Bu.addEventListener("keydown",ju),()=>Bu.removeEventListener("keydown",ju)},Ou);const Du=_temp3$2;let Mu;return $u[7]!==Ru?(Mu={containerRef:Ru},$u[7]=Ru,$u[8]=Mu):Mu=$u[8],Mu};function _temp$4(Au){var lo;if(Au.getAttribute("aria-keyshortcuts"))return;const $u=(lo=Au.textContent)===null||lo===void 0?void 0:lo.toLowerCase()[0];$u&&Au.setAttribute("aria-keyshortcuts",$u)}function _temp2$3(Au){return Au.toLowerCase()}function _temp3$2(Au){return Au.key.length===1&&/[a-z\d]/i.test(Au.key)}const useMenuKeyboardNavigation=(Au,lo,$u,Ru,Iu)=>{const Pu=Iu===void 0?!1:Iu;useMenuInitialFocus(Au,$u,Ru),useMnemonics(Au,$u),useCloseMenuOnTab(Au,lo,$u,Ru),useMoveFocusToMenuItem(Au,$u,Ru),useCloseSubmenuOnArrow(Au,Pu,lo,$u)},useCloseMenuOnTab=(Au,lo,$u,Ru)=>{const Iu=distExports.c(10);let Pu;Iu[0]!==Ru?.current||Iu[1]!==$u?.current||Iu[2]!==lo||Iu[3]!==Au?(Pu=()=>{const Du=$u?.current,Mu=Ru?.current,Lu=Bu=>{Au&&Bu.key==="Tab"&&lo?.("tab")};return Du?.addEventListener("keydown",Lu),Mu?.addEventListener("keydown",Lu),()=>{Du?.removeEventListener("keydown",Lu),Mu?.removeEventListener("keydown",Lu)}},Iu[0]=Ru?.current,Iu[1]=$u?.current,Iu[2]=lo,Iu[3]=Au,Iu[4]=Pu):Pu=Iu[4];let Ou;Iu[5]!==Ru||Iu[6]!==$u||Iu[7]!==lo||Iu[8]!==Au?(Ou=[Au,lo,$u,Ru],Iu[5]=Ru,Iu[6]=$u,Iu[7]=lo,Iu[8]=Au,Iu[9]=Ou):Ou=Iu[9],vM.useEffect(Pu,Ou)},useCloseSubmenuOnArrow=(Au,lo,$u,Ru)=>{const Iu=distExports.c(10);let Pu;Iu[0]!==Ru?.current||Iu[1]!==lo||Iu[2]!==$u||Iu[3]!==Au?(Pu=()=>{const Du=Ru?.current,Mu=Lu=>{Au&&lo&&Lu.key==="ArrowLeft"&&$u?.("arrow-left")};return Du?.addEventListener("keydown",Mu),()=>{Du?.removeEventListener("keydown",Mu)}},Iu[0]=Ru?.current,Iu[1]=lo,Iu[2]=$u,Iu[3]=Au,Iu[4]=Pu):Pu=Iu[4];let Ou;Iu[5]!==Ru||Iu[6]!==lo||Iu[7]!==$u||Iu[8]!==Au?(Ou=[Au,$u,Ru,lo],Iu[5]=Ru,Iu[6]=lo,Iu[7]=$u,Iu[8]=Au,Iu[9]=Ou):Ou=Iu[9],vM.useEffect(Pu,Ou)},useMoveFocusToMenuItem=(Au,lo,$u)=>{const Ru=distExports.c(8);let Iu;Ru[0]!==$u?.current||Ru[1]!==lo?.current||Ru[2]!==Au?(Iu=()=>{const Ou=lo?.current,Du=$u?.current,Mu=Lu=>{if(!Au||!Ou)return;const Bu=iterateFocusableElements(Ou);if(Lu.key==="ArrowDown"){const ju=Bu.next().value;setTimeout(()=>ju?.focus())}else if(Lu.key==="ArrowUp"){const ju=[...Bu],Fu=ju[ju.length-1];setTimeout(()=>Fu.focus())}};return Du?.addEventListener("keydown",Mu),()=>Du?.addEventListener("keydown",Mu)},Ru[0]=$u?.current,Ru[1]=lo?.current,Ru[2]=Au,Ru[3]=Iu):Iu=Ru[3];let Pu;Ru[4]!==$u||Ru[5]!==lo||Ru[6]!==Au?(Pu=[Au,lo,$u],Ru[4]=$u,Ru[5]=lo,Ru[6]=Au,Ru[7]=Pu):Pu=Ru[7],vM.useEffect(Iu,Pu)};var classes$l={ResponsiveCloseButtonContainer:"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-NL5kN",ResponsiveCloseButton:"prc-AnchoredOverlay-ResponsiveCloseButton-Rr-c2"};function useAnchoredPosition(Au,lo=[]){const $u=useProvidedRefOrCreate(Au?.floatingElementRef),Ru=useProvidedRefOrCreate(Au?.anchorElementRef),Iu=vM.useRef(Au?.onPositionChange),[Pu,Ou]=vM.useState(void 0),[Du,Mu]=vM.useState(void 0),Lu=(Fu,zu)=>Fu&&["outside-top","inside-top"].includes(Fu.anchorSide)&&(Fu.anchorSide!==zu.anchorSide||Fu.top<zu.top),Bu=()=>{let Fu=!1;return Mu(zu=>{var Uu,Hu;return zu&&zu>((Uu=(Hu=$u.current)===null||Hu===void 0?void 0:Hu.clientHeight)!==null&&Uu!==void 0?Uu:0)&&(requestAnimationFrame(()=>{$u.current.style.height=`${zu}px`}),Fu=!0),zu}),Fu},ju=vM.useCallback(()=>{var Fu;if($u.current instanceof Element&&Ru.current instanceof Element){const Uu=getAnchoredPosition($u.current,Ru.current,Au);Ou(Hu=>{if(Au!=null&&Au.pinPosition&&Lu(Hu,Uu)){var Vu,Gu,Wu,Zu;if(((Vu=(Gu=Ru.current)===null||Gu===void 0?void 0:Gu.getBoundingClientRect().top)!==null&&Vu!==void 0?Vu:0)>((Wu=(Zu=$u.current)===null||Zu===void 0?void 0:Zu.clientHeight)!==null&&Wu!==void 0?Wu:0)&&Bu())return Hu}if(Hu&&Hu.anchorSide===Uu.anchorSide){var Ju;(Ju=Iu.current)===null||Ju===void 0||Ju.call(Iu,Uu)}return Uu})}else{var zu;Ou(void 0),(zu=Iu.current)===null||zu===void 0||zu.call(Iu,void 0)}Mu((Fu=$u.current)===null||Fu===void 0?void 0:Fu.clientHeight)},[$u,Ru,...lo]);return useIsomorphicLayoutEffect$2(()=>{Iu.current=Au?.onPositionChange},[Au?.onPositionChange]),useIsomorphicLayoutEffect$2(ju,[ju]),useResizeObserver(ju),useResizeObserver(ju,$u),{floatingElementRef:$u,anchorElementRef:Ru,position:Pu}}var classes$k={Overlay:"prc-Overlay-Overlay-dVyJl"};class FeatureFlagScope{static create(lo){return new FeatureFlagScope(lo)}static merge(lo,$u){const Ru=new FeatureFlagScope;for(const[Iu,Pu]of lo.flags)Ru.flags.set(Iu,Pu);for(const[Iu,Pu]of $u.flags)Ru.flags.set(Iu,Pu);return Ru}constructor(lo={}){this.flags=new Map;for(const[$u,Ru]of Object.entries(lo))this.flags.set($u,Ru??!1)}enable(lo){this.flags.set(lo,!0)}disable(lo){this.flags.set(lo,!1)}enabled(lo){var $u;return($u=this.flags.get(lo))!==null&&$u!==void 0?$u:!1}}const DefaultFeatureFlags=FeatureFlagScope.create({primer_react_action_list_item_as_button:!1,primer_react_overlay_overflow:!1,primer_react_segmented_control_tooltip:!1,primer_react_select_panel_fullscreen_on_narrow:!1,primer_react_select_panel_order_selected_at_top:!1,primer_react_select_panel_remove_active_descendant:!1}),FeatureFlagContext=reactExports.createContext(DefaultFeatureFlags);function useFeatureFlag(Au){const lo=distExports.c(3),$u=reactExports.useContext(FeatureFlagContext);let Ru;return lo[0]!==$u||lo[1]!==Au?(Ru=$u.enabled(Au),lo[0]=$u,lo[1]=Au,lo[2]=Ru):Ru=lo[2],Ru}const animationDuration=200;function getSlideAnimationStartingVector(Au){return Au!=null&&Au.endsWith("bottom")?{x:0,y:-1}:Au!=null&&Au.endsWith("top")?{x:0,y:1}:Au!=null&&Au.endsWith("right")?{x:-1,y:0}:Au!=null&&Au.endsWith("left")?{x:1,y:0}:{x:0,y:0}}const BaseOverlay=vM.forwardRef(({visibility:Au,height:lo,width:$u,top:Ru,left:Iu,right:Pu,bottom:Ou,position:Du,style:Mu,className:Lu,maxHeight:Bu,maxWidth:ju,...Fu},zu)=>jsxRuntimeExports.jsx(BoxWithFallback,{as:"div",...Fu,ref:zu,style:{left:Iu,right:Pu,top:Ru,bottom:Ou,position:Du,...Mu},[`data-width-${$u}`]:"",[`data-max-width-${ju}`]:ju?"":void 0,[`data-height-${lo}`]:"",[`data-max-height-${Bu}`]:Bu?"":void 0,[`data-visibility-${Au}`]:"",[`data-overflow-${Fu.overflow}`]:Fu.overflow?"":void 0,className:clsx(Lu,classes$k.Overlay)})),Overlay$1=vM.forwardRef((Au,lo)=>{const $u=distExports.c(51);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu,Zu;$u[0]!==Au?({anchorSide:Ru,height:Hu,ignoreClickRefs:Iu,initialFocusRef:Pu,left:Ou,onClickOutside:Du,onEscape:Mu,portalContainerName:Lu,preventOverflow:Vu,preventFocusOnOpen:Bu,returnFocusRef:zu,right:Uu,role:Gu,visibility:Wu,width:Zu,responsiveVariant:Fu,...ju}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju,$u[10]=Fu,$u[11]=zu,$u[12]=Uu,$u[13]=Hu,$u[14]=Vu,$u[15]=Gu,$u[16]=Wu,$u[17]=Zu):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9],Fu=$u[10],zu=$u[11],Uu=$u[12],Hu=$u[13],Vu=$u[14],Gu=$u[15],Wu=$u[16],Zu=$u[17]);const Ju=Hu===void 0?"auto":Hu,Yu=Vu===void 0?!0:Vu,Xu=Gu===void 0?"none":Gu,ed=Wu===void 0?"visible":Wu,td=Zu===void 0?"auto":Zu,nd=reactExports.useRef(null);useRefObjectAsForwardedRef(lo,nd);const{theme:od}=useTheme();let sd;$u[18]!==od?(sd=get("space.2")(od).replace("px",""),$u[18]=od,$u[19]=sd):sd=$u[19];const ad=parseInt(sd);let pd;$u[20]!==od?(pd=get("animation.easeOutCubic")(od),$u[20]=od,$u[21]=pd):pd=$u[21];const bd=pd;let wd;$u[22]!==Iu||$u[23]!==Pu||$u[24]!==Du||$u[25]!==Mu||$u[26]!==Bu||$u[27]!==zu?(wd={overlayRef:nd,returnFocusRef:zu,onEscape:Mu,ignoreClickRefs:Iu,onClickOutside:Du,initialFocusRef:Pu,preventFocusOnOpen:Bu},$u[22]=Iu,$u[23]=Pu,$u[24]=Du,$u[25]=Mu,$u[26]=Bu,$u[27]=zu,$u[28]=wd):wd=$u[28],useOverlay(wd);let _d,yd;$u[29]!==Ju?(yd=()=>{var hd;Ju==="initial"&&(hd=nd.current)!==null&&hd!==void 0&&hd.clientHeight&&(nd.current.style.height=`${nd.current.clientHeight}px`)},_d=[Ju],$u[29]=Ju,$u[30]=_d,$u[31]=yd):(_d=$u[30],yd=$u[31]),reactExports.useEffect(yd,_d);let Sd,kd;$u[32]!==Ru||$u[33]!==ad||$u[34]!==bd||$u[35]!==ed?(Sd=()=>{var hd;const{x:gd,y:Ed}=getSlideAnimationStartingVector(Ru);!gd&&!Ed||!((hd=nd.current)!==null&&hd!==void 0&&hd.animate)||ed==="hidden"||nd.current.animate({transform:[`translate(${ad*gd}px, ${ad*Ed}px)`,"translate(0, 0)"]},{duration:animationDuration,easing:bd})},kd=[Ru,ad,bd,ed],$u[32]=Ru,$u[33]=ad,$u[34]=bd,$u[35]=ed,$u[36]=Sd,$u[37]=kd):(Sd=$u[36],kd=$u[37]),useIsomorphicLayoutEffect$2(Sd,kd);const md=Ou===void 0&&Uu===void 0?0:Ou,vd=useFeatureFlag("primer_react_overlay_overflow")||!Yu?!0:void 0;let ld;$u[38]!==Ju||$u[39]!==md||$u[40]!==ju||$u[41]!==Fu||$u[42]!==Uu||$u[43]!==Xu||$u[44]!==vd||$u[45]!==ed||$u[46]!==td?(ld=jsxRuntimeExports.jsx(BaseOverlay,{role:Xu,width:td,"data-reflow-container":vd,ref:nd,left:md,right:Uu,height:Ju,visibility:ed,"data-responsive":Fu,...ju}),$u[38]=Ju,$u[39]=md,$u[40]=ju,$u[41]=Fu,$u[42]=Uu,$u[43]=Xu,$u[44]=vd,$u[45]=ed,$u[46]=td,$u[47]=ld):ld=$u[47];let ud;return $u[48]!==Lu||$u[49]!==ld?(ud=jsxRuntimeExports.jsx(Portal,{containerName:Lu,children:ld}),$u[48]=Lu,$u[49]=ld,$u[50]=ud):ud=$u[50],ud}),defaultVariant$2={regular:"anchored",narrow:"anchored"},defaultCloseButtonProps={},AnchoredOverlay=({renderAnchor:Au,anchorRef:lo,anchorId:$u,children:Ru,open:Iu,onOpen:Pu,onClose:Ou,height:Du,width:Mu,overlayProps:Lu,focusTrapSettings:Bu,focusZoneSettings:ju,side:Fu=Lu?.anchorSide||"outside-bottom",align:zu="start",alignmentOffset:Uu,anchorOffset:Hu,className:Vu,pinPosition:Gu,variant:Wu=defaultVariant$2,preventOverflow:Zu=!0,onPositionChange:Ju,displayCloseButton:Yu=!0,closeButtonProps:Xu=defaultCloseButtonProps})=>{const ed=useProvidedRefOrCreate(lo),[td,nd]=useRenderForcingRef(),od=useId($u),sd=reactExports.useCallback(()=>Ou?.("click-outside"),[Ou]),ad=reactExports.useCallback(()=>Ou?.("escape"),[Ou]),pd=reactExports.useCallback(dd=>{dd.defaultPrevented||!Iu&&["ArrowDown","ArrowUp"," ","Enter"].includes(dd.key)&&(Pu?.("anchor-key-press",dd),dd.preventDefault())},[Iu,Pu]),bd=reactExports.useCallback(dd=>{dd.defaultPrevented||dd.button!==0||(Iu?Ou?.("anchor-click"):Pu?.("anchor-click"))},[Iu,Pu,Ou]),wd=dd=>{Ju&&dd&&Ju({position:dd})},{position:_d}=useAnchoredPosition({anchorElementRef:ed,floatingElementRef:td,pinPosition:Gu,side:Fu,align:zu,alignmentOffset:Uu,anchorOffset:Hu,onPositionChange:wd},[td.current]);reactExports.useEffect(()=>{!Iu&&td.current&&nd(null)},[Iu,td,nd]),useFocusZone({containerRef:td,disabled:!Iu||!_d,...ju}),useFocusTrap({containerRef:td,disabled:!Iu||!_d,...Bu});const yd=useResponsiveValue(Wu,"anchored"),Sd=Ou&&Wu.narrow==="fullscreen"&&Yu,kd=Xu["aria-labelledby"],md=Xu["aria-label"];return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Au&&Au({ref:ed,id:od,"aria-haspopup":"true","aria-expanded":Iu,tabIndex:0,onClick:bd,onKeyDown:pd}),Iu?jsxRuntimeExports.jsxs(Overlay$1,{returnFocusRef:ed,onClickOutside:sd,ignoreClickRefs:[ed],onEscape:ad,ref:nd,role:"none",visibility:_d?"visible":"hidden",height:Du,width:Mu,top:yd==="anchored"?_d?.top||0:void 0,left:yd==="anchored"?_d?.left||0:void 0,responsiveVariant:Wu.narrow==="fullscreen"?"fullscreen":void 0,"data-variant":yd,anchorSide:_d?.anchorSide,className:Vu,preventOverflow:Zu,...Lu,children:[Sd?jsxRuntimeExports.jsx("div",{className:classes$l.ResponsiveCloseButtonContainer,children:jsxRuntimeExports.jsx(IconButton,{...Xu,type:"button",variant:"invisible",icon:XIcon,...kd?{"aria-labelledby":kd,"aria-label":void 0}:{"aria-label":md??"Close","aria-labelledby":void 0},className:clsx(classes$l.ResponsiveCloseButton,Xu.className),onClick:()=>{Ou("close")}})}):null,Ru]}):null]})};AnchoredOverlay.displayName="AnchoredOverlay";const MenuContext=vM.createContext({renderAnchor:null,open:!1}),mergeAnchorHandlers=(Au,lo)=>{const $u={...Au};if(typeof lo.onClick=="function"){const Ru=Au.onClick,Iu=Pu=>{var Ou;(Ou=lo.onClick)===null||Ou===void 0||Ou.call(lo,Pu),Ru?.(Pu)};$u.onClick=Iu}if(typeof lo.onKeyDown=="function"){const Ru=Au.onKeyDown,Iu=Pu=>{var Ou;(Ou=lo.onKeyDown)===null||Ou===void 0||Ou.call(lo,Pu),Ru?.(Pu)};$u.onKeyDown=Iu}return $u},Menu$1=({anchorRef:Au,open:lo,onOpenChange:$u,children:Ru})=>{const Iu=reactExports.useContext(MenuContext),[Pu,Ou]=useProvidedStateOrCreate(lo,$u,!1),Du=vM.useCallback(()=>Ou(!0),[Ou]),Mu=useResponsiveValue({narrow:!0},!1),Lu=vM.useCallback(Vu=>{var Gu;if(!(Mu&&lo&&Vu==="tab"))switch(Ou(!1),Vu){case"tab":case"item-select":(Gu=Iu.onClose)===null||Gu===void 0||Gu.call(Iu,Vu)}},[Ou,Iu,lo,Mu]),Bu=vM.Children.toArray(Ru).find(Vu=>vM.isValidElement(Vu)&&(Vu.type===MenuButton||Vu.type===Anchor$1)),ju=vM.isValidElement(Bu)?Bu.props.id:void 0,Fu=useProvidedRefOrCreate(Au),zu=useId(ju);let Uu=null;const Hu=vM.Children.map(Ru,Vu=>{if(Vu.type===Tooltip){const Gu=Vu.props.children;return Gu.type===MenuButton&&(Uu=Wu=>{const Zu=vM.cloneElement(Gu,mergeAnchorHandlers({...Wu},Gu.props));return vM.cloneElement(Vu,{children:Zu,ref:Fu})}),null}else if(Vu.type===Anchor$1){const Gu=Vu.props.children;return(Gu!==void 0?Gu.type===Tooltip:!1)?Gu.props.children!==null&&(Uu=Zu=>{const Ju=Gu.props.children,Yu=vM.cloneElement(Ju,mergeAnchorHandlers({...Zu},Ju.props)),Xu=vM.cloneElement(Gu,{children:Yu});return vM.cloneElement(Vu,{children:Xu,ref:Fu})}):Uu=Zu=>vM.cloneElement(Vu,Zu),null}else return Vu.type===MenuButton?(Uu=Gu=>vM.cloneElement(Vu,mergeAnchorHandlers(Gu,Vu.props)),null):Vu});return jsxRuntimeExports.jsx(MenuContext.Provider,{value:{anchorRef:Fu,renderAnchor:Uu,anchorId:zu,open:Pu,onOpen:Du,onClose:Lu,isSubmenu:Iu.isSubmenu!==void 0},children:Hu})};Menu$1.displayName="Menu";const Anchor$1=vM.forwardRef(({children:Au,...lo},$u)=>{const{onOpen:Ru,isSubmenu:Iu}=vM.useContext(MenuContext),Pu=reactExports.useCallback(Bu=>{Iu&&Bu.key==="ArrowRight"&&!Bu.defaultPrevented&&Ru?.("anchor-key-press")},[Iu,Ru]),Ou=Bu=>{var ju,Fu,zu;(ju=(Fu=Au.props).onClick)===null||ju===void 0||ju.call(Fu,Bu),(zu=lo.onClick)===null||zu===void 0||zu.call(lo,Bu)},Du=Bu=>{var ju,Fu,zu;(ju=(Fu=Au.props).onKeyDown)===null||ju===void 0||ju.call(Fu,Bu),Pu(Bu),(zu=lo.onKeyDown)===null||zu===void 0||zu.call(lo,Bu)},Mu=reactExports.useContext(ActionListContainerContext),Lu=reactExports.useMemo(()=>Iu?{...Mu,defaultTrailingVisual:jsxRuntimeExports.jsx(ChevronRightIcon,{}),afterSelect:()=>Ru?.("anchor-click")}:Mu,[Iu,Ru,Mu]);return jsxRuntimeExports.jsx(ActionListContainerContext.Provider,{value:Lu,children:vM.cloneElement(Au,{...lo,ref:$u,onClick:Ou,onKeyDown:Du})})}),MenuButton=vM.forwardRef(({...Au},lo)=>jsxRuntimeExports.jsx(Anchor$1,{ref:lo,children:jsxRuntimeExports.jsx(ButtonComponent,{type:"button",trailingAction:TriangleDownIcon,...Au})})),defaultVariant$1={regular:"anchored",narrow:"anchored"},Overlay=({children:Au,align:lo="start",side:$u,onPositionChange:Ru,"aria-labelledby":Iu,variant:Pu=defaultVariant$1,...Ou})=>{const{anchorRef:Du,renderAnchor:Mu,anchorId:Lu,open:Bu,onOpen:ju,onClose:Fu,isSubmenu:zu=!1}=vM.useContext(MenuContext),Uu=vM.useRef(null);useMenuKeyboardNavigation(Bu,Fu,Uu,Du,zu);const Hu=useResponsiveValue({narrow:!0},!1),Vu=useResponsiveValue(Pu,{regular:"anchored",narrow:"anchored"}),Gu=!!Hu&&Pu.narrow==="fullscreen",[Wu,Zu]=reactExports.useState(null);return reactExports.useEffect(()=>{if(Du!=null&&Du.current){const Ju=Du.current.getAttribute("aria-labelledby");Ju&&Zu(Ju)}},[Du]),jsxRuntimeExports.jsx(AnchoredOverlay,{anchorRef:Du,renderAnchor:Mu,anchorId:Lu,open:Bu,onOpen:ju,onClose:Fu,align:lo,side:$u??(zu?"outside-right":"outside-bottom"),overlayProps:Ou,focusZoneSettings:Gu?{disabled:!0}:{focusOutBehavior:"wrap"},onPositionChange:Ru,variant:Pu,children:jsxRuntimeExports.jsx("div",{ref:Uu,className:styles$6.ActionMenuContainer,"data-variant":Vu,children:jsxRuntimeExports.jsx(ActionListContainerContext.Provider,{value:{container:"ActionMenu",listRole:"menu",listLabelledBy:Iu||Wu||Lu,selectionAttribute:"aria-checked",afterSelect:()=>Fu?.("item-select"),enableFocusZone:Gu},children:Au})})})};Overlay.displayName="Overlay";Menu$1.displayName="ActionMenu";const ActionMenu=Object.assign(Menu$1,{Button:MenuButton,Anchor:Anchor$1,Overlay,Divider:Divider$1});var classes$j={SkeletonBox:"prc-Skeleton-SkeletonBox-nSZk3"};const SkeletonBox=vM.forwardRef(function(lo,$u){const Ru=distExports.c(17);let Iu,Pu,Ou,Du,Mu;Ru[0]!==lo?({height:Pu,width:Mu,className:Iu,style:Du,...Ou}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du,Ru[5]=Mu):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4],Mu=Ru[5]);const Lu=$u;let Bu;Ru[6]!==Iu?(Bu=clsx(Iu,classes$j.SkeletonBox),Ru[6]=Iu,Ru[7]=Bu):Bu=Ru[7];const ju=Du;let Fu;Ru[8]!==Pu||Ru[9]!==ju||Ru[10]!==Mu?(Fu=merge$4(ju,{height:Pu,width:Mu}),Ru[8]=Pu,Ru[9]=ju,Ru[10]=Mu,Ru[11]=Fu):Fu=Ru[11];let zu;return Ru[12]!==Ou||Ru[13]!==Lu||Ru[14]!==Bu||Ru[15]!==Fu?(zu=jsxRuntimeExports.jsx("div",{ref:Lu,className:Bu,style:Fu,...Ou}),Ru[12]=Ou,Ru[13]=Lu,Ru[14]=Bu,Ru[15]=Fu,Ru[16]=zu):zu=Ru[16],zu});var classes$i={Flash:"prc-Flash-Flash-3q4Aj"};const Flash=vM.forwardRef(function(lo,$u){const Ru=distExports.c(17);let Iu,Pu,Ou,Du,Mu,Lu;Ru[0]!==lo?({as:Iu,className:Pu,variant:Lu,full:Ou,sx:Mu,...Du}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du,Ru[5]=Mu,Ru[6]=Lu):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4],Mu=Ru[5],Lu=Ru[6]);const Bu=Lu===void 0?"default":Lu;let ju;Ru[7]!==Pu?(ju=clsx(classes$i.Flash,Pu),Ru[7]=Pu,Ru[8]=ju):ju=Ru[8];const Fu=Ou?"":void 0;let zu;return Ru[9]!==Iu||Ru[10]!==$u||Ru[11]!==Du||Ru[12]!==Mu||Ru[13]!==ju||Ru[14]!==Fu||Ru[15]!==Bu?(zu=jsxRuntimeExports.jsx(BoxWithFallback,{...Du,ref:$u,as:Iu,className:ju,"data-full":Fu,"data-variant":Bu,sx:Mu}),Ru[9]=Iu,Ru[10]=$u,Ru[11]=Du,Ru[12]=Mu,Ru[13]=ju,Ru[14]=Fu,Ru[15]=Bu,Ru[16]=zu):zu=Ru[16],zu}),StyledLabelGroupContainer=qe$4.div.withConfig({displayName:"LabelGroup__StyledLabelGroupContainer",componentId:"sc-6tqg8q-0"})(["display:flex;flex-wrap:nowrap;gap:",";line-height:1;max-width:100%;overflow:hidden;&[data-overflow='inline']{flex-wrap:wrap;}&[data-list]{padding-inline-start:0;margin-block-start:0;margin-block-end:0;list-style-type:none;}",";"],get("space.1"),sx),ItemWrapper=qe$4.div.withConfig({displayName:"LabelGroup__ItemWrapper",componentId:"sc-6tqg8q-1"})(["display:flex;align-items:center;min-height:28px;&.ItemWrapper--hidden{order:9999;pointer-events:none;visibility:hidden;}"]),getOverlayWidth=(Au,lo,$u)=>{var Ru;return $u+Au.right-(((Ru=lo.current)===null||Ru===void 0?void 0:Ru.getBoundingClientRect().left)||0)},InlineToggle=Au=>{const lo=distExports.c(7),{collapseButtonRef:$u,collapseInlineExpandedChildren:Ru,expandButtonRef:Iu,hiddenItemIds:Pu,isOverflowShown:Ou,showAllTokensInline:Du}=Au;let Mu;return lo[0]!==$u||lo[1]!==Ru||lo[2]!==Iu||lo[3]!==Pu||lo[4]!==Ou||lo[5]!==Du?(Mu=Ou?jsxRuntimeExports.jsx(ButtonComponent,{ref:$u,onClick:Ru,size:"small",variant:"invisible",children:"Show less"}):Pu.length?jsxRuntimeExports.jsxs(ButtonComponent,{ref:Iu,variant:"invisible",size:"small",onClick:Du,children:[jsxRuntimeExports.jsxs(VisuallyHidden,{children:["Show +",Pu.length," more"]}),jsxRuntimeExports.jsxs("span",{"aria-hidden":"true",children:["+",Pu.length]})]}):null,lo[0]=$u,lo[1]=Ru,lo[2]=Iu,lo[3]=Pu,lo[4]=Ou,lo[5]=Du,lo[6]=Mu):Mu=lo[6],Mu},OverlayToggle=Au=>{const lo=distExports.c(9),{children:$u,closeOverflowOverlay:Ru,expandButtonRef:Iu,hiddenItemIds:Pu,isOverflowShown:Ou,openOverflowOverlay:Du,overlayPaddingPx:Mu,overlayWidth:Lu}=Au;let Bu;return lo[0]!==$u||lo[1]!==Ru||lo[2]!==Iu||lo[3]!==Pu.length||lo[4]!==Ou||lo[5]!==Du||lo[6]!==Mu||lo[7]!==Lu?(Bu=Pu.length?jsxRuntimeExports.jsx(AnchoredOverlay,{open:Ou,onOpen:Du,onClose:Ru,width:"auto",height:"auto",align:"start",side:"inside-right",anchorRef:Iu,anchorOffset:Mu*-1,alignmentOffset:Mu*-1,renderAnchor:ju=>jsxRuntimeExports.jsxs(ButtonComponent,{variant:"invisible",size:"small",...ju,ref:Iu,children:[jsxRuntimeExports.jsxs(VisuallyHidden,{children:["Show +",Pu.length," more"]}),jsxRuntimeExports.jsxs("span",{"aria-hidden":"true",children:["+",Pu.length]})]}),focusZoneSettings:{disabled:!0},children:jsxRuntimeExports.jsxs(Box$1,{alignItems:"flex-start",display:"flex",width:Lu,padding:`${Mu}px`,children:[jsxRuntimeExports.jsx(Box$1,{display:"flex",flexWrap:"wrap",sx:{gap:1},children:$u}),jsxRuntimeExports.jsx(IconButton,{onClick:Ru,icon:XIcon,"aria-label":"Close",variant:"invisible",sx:{flexShrink:0}})]})}):null,lo[0]=$u,lo[1]=Ru,lo[2]=Iu,lo[3]=Pu.length,lo[4]=Ou,lo[5]=Du,lo[6]=Mu,lo[7]=Lu,lo[8]=Bu):Bu=lo[8],Bu},LabelGroup=({children:Au,visibleChildCount:lo,overflowStyle:$u="overlay",sx:Ru,as:Iu="ul",className:Pu})=>{const Ou=vM.useRef(null),Du=vM.useRef(null),Mu=vM.useRef(void 0),[Lu,Bu]=vM.useState({}),[ju,Fu]=vM.useState(!1),[zu,Uu]=vM.useState({width:0,right:0,height:0,x:0,y:0,top:0,left:0,bottom:0,toJSON:()=>{}}),{theme:Hu}=useTheme(),Vu=parseInt(get("space.2")(Hu),10),Gu=Object.keys(Lu).filter(sd=>!Lu[sd]),Wu=Gu.length&&$u==="overlay"?getOverlayWidth(zu,Ou,Vu):void 0,Zu=vM.useCallback(sd=>{if(sd!==null){const ad=sd.getBoundingClientRect();(ad.width!==zu.width||ad.right!==zu.right)&&Uu(ad),Zu.current=sd}},[zu]),Ju=vM.useCallback(sd=>{var ad;const pd=((ad=Ou.current)===null||ad===void 0?void 0:ad.children)||[],bd={};for(const wd of pd){const _d=wd.getAttribute("data-index");_d&&(bd[_d]=parseInt(_d,10)<sd)}Bu(bd)},[]),Yu=vM.useCallback(()=>Fu(!0),[Fu]),Xu=vM.useCallback(()=>{Fu(!1)},[Fu]),ed=vM.useCallback(()=>{Fu(!1),lo&&typeof lo=="number"&&Ju(lo),setTimeout(()=>{var sd;(sd=Zu.current)===null||sd===void 0||sd.focus()},10)},[Zu,Ju,lo]),td=vM.useCallback(()=>{Bu({}),Fu(!0)},[Bu,Fu]);vM.useEffect(()=>{if(!(!lo||ju))if(lo==="auto"){const ad=new IntersectionObserver(pd=>{const bd={};for(const wd of pd){const _d=wd.target.getAttribute("data-index");_d&&(bd[_d]=wd.isIntersecting)}Bu(wd=>({...wd,...bd}))},{root:Ou.current,rootMargin:`0px -${zu.width}px 0px 0px`,threshold:1});for(const pd of((sd=Ou.current)===null||sd===void 0?void 0:sd.children)||[]){var sd;pd.getAttribute("data-index")&&ad.observe(pd)}return()=>ad.disconnect()}else Ju(lo)},[zu,lo,Ju,ju]),vM.useEffect(()=>{$u!=="overlay"&&Gu.length&&(Mu.current=parseInt(Gu[0],10))},[Gu,$u,ju]),vM.useEffect(()=>{if($u==="overlay")return;const sd=document.querySelector(`[data-index="${Mu.current}"]`),ad=sd?getFocusableChild(sd):null;if(ju)if(ad)ad.focus();else{var pd;(pd=Du.current)===null||pd===void 0||pd.focus()}},[$u,ju]);const nd=Iu==="ul"||Iu==="ol",od=nd?"li":vM.Fragment;return lo?jsxRuntimeExports.jsxs(StyledLabelGroupContainer,{ref:Ou,"data-overflow":$u==="inline"&&ju?"inline":void 0,"data-list":nd||void 0,sx:Ru,className:Pu,as:Iu,children:[vM.Children.map(Au,(sd,ad)=>jsxRuntimeExports.jsx(ItemWrapper,{"data-index":ad,className:Gu.includes(ad.toString())?"ItemWrapper--hidden":void 0,as:nd?"li":"span",children:sd},ad)),jsxRuntimeExports.jsx(od,{children:$u==="inline"?jsxRuntimeExports.jsx(InlineToggle,{collapseButtonRef:Du,collapseInlineExpandedChildren:ed,expandButtonRef:Zu,hiddenItemIds:Gu,isOverflowShown:ju,showAllTokensInline:td,totalLength:vM.Children.toArray(Au).length}):jsxRuntimeExports.jsx(OverlayToggle,{closeOverflowOverlay:Xu,expandButtonRef:Zu,hiddenItemIds:Gu,isOverflowShown:ju,openOverflowOverlay:Yu,overlayPaddingPx:Vu,overlayWidth:Wu,totalLength:vM.Children.toArray(Au).length,children:Au})})]}):jsxRuntimeExports.jsx(StyledLabelGroupContainer,{"data-overflow":"inline","data-list":nd||void 0,sx:Ru,as:Iu,className:Pu,children:nd?vM.Children.map(Au,(sd,ad)=>jsxRuntimeExports.jsx("li",{children:sd},ad)):Au})};LabelGroup.displayName="LabelGroup";var __classPrivateFieldSet$2=function(Au,lo,$u,Ru,Iu){if(Ru==="m")throw new TypeError("Private method is not writable");if(Ru==="a"&&!Iu)throw new TypeError("Private accessor was defined without a setter");if(typeof lo=="function"?Au!==lo||!Iu:!lo.has(Au))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ru==="a"?Iu.call(Au,$u):Iu?Iu.value=$u:lo.set(Au,$u),$u},__classPrivateFieldGet$2=function(Au,lo,$u,Ru){if($u==="a"&&!Ru)throw new TypeError("Private accessor was defined without a getter");if(typeof lo=="function"?Au!==lo||!Ru:!lo.has(Au))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $u==="m"?Ru:$u==="a"?Ru.call(Au):Ru?Ru.value:lo.get(Au)},_DurationFormat_options;class ListFormatPonyFill{formatToParts(lo){const $u=[];for(const Ru of lo)$u.push({type:"element",value:Ru}),$u.push({type:"literal",value:", "});return $u.slice(0,-1)}}const ListFormat=typeof Intl<"u"&&Intl.ListFormat||ListFormatPonyFill,partsTable=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],twoDigitFormatOptions={minimumIntegerDigits:2};class DurationFormat{constructor(lo,$u={}){_DurationFormat_options.set(this,void 0);let Ru=String($u.style||"short");Ru!=="long"&&Ru!=="short"&&Ru!=="narrow"&&Ru!=="digital"&&(Ru="short");let Iu=Ru==="digital"?"numeric":Ru;const Pu=$u.hours||Iu;Iu=Pu==="2-digit"?"numeric":Pu;const Ou=$u.minutes||Iu;Iu=Ou==="2-digit"?"numeric":Ou;const Du=$u.seconds||Iu;Iu=Du==="2-digit"?"numeric":Du;const Mu=$u.milliseconds||Iu;__classPrivateFieldSet$2(this,_DurationFormat_options,{locale:lo,style:Ru,years:$u.years||Ru==="digital"?"short":Ru,yearsDisplay:$u.yearsDisplay==="always"?"always":"auto",months:$u.months||Ru==="digital"?"short":Ru,monthsDisplay:$u.monthsDisplay==="always"?"always":"auto",weeks:$u.weeks||Ru==="digital"?"short":Ru,weeksDisplay:$u.weeksDisplay==="always"?"always":"auto",days:$u.days||Ru==="digital"?"short":Ru,daysDisplay:$u.daysDisplay==="always"?"always":"auto",hours:Pu,hoursDisplay:$u.hoursDisplay==="always"||Ru==="digital"?"always":"auto",minutes:Ou,minutesDisplay:$u.minutesDisplay==="always"||Ru==="digital"?"always":"auto",seconds:Du,secondsDisplay:$u.secondsDisplay==="always"||Ru==="digital"?"always":"auto",milliseconds:Mu,millisecondsDisplay:$u.millisecondsDisplay==="always"?"always":"auto"},"f")}resolvedOptions(){return __classPrivateFieldGet$2(this,_DurationFormat_options,"f")}formatToParts(lo){const $u=[],Ru=__classPrivateFieldGet$2(this,_DurationFormat_options,"f"),Iu=Ru.style,Pu=Ru.locale;for(const[Ou,Du]of partsTable){const Mu=lo[Ou];if(Ru[`${Ou}Display`]==="auto"&&!Mu)continue;const Lu=Ru[Ou],Bu=Lu==="2-digit"?twoDigitFormatOptions:Lu==="numeric"?{}:{style:"unit",unit:Du,unitDisplay:Lu};let ju=new Intl.NumberFormat(Pu,Bu).format(Mu);Ou==="months"&&(Lu==="narrow"||Iu==="narrow"&&ju.endsWith("m"))&&(ju=ju.replace(/(\d+)m$/,"$1mo")),$u.push(ju)}return new ListFormat(Pu,{type:"unit",style:Iu==="digital"?"short":Iu}).formatToParts($u)}format(lo){return this.formatToParts(lo).map($u=>$u.value).join("")}}_DurationFormat_options=new WeakMap;const durationRe=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,unitNames=["year","month","week","day","hour","minute","second","millisecond"],isDuration=Au=>durationRe.test(Au);class Duration{constructor(lo=0,$u=0,Ru=0,Iu=0,Pu=0,Ou=0,Du=0,Mu=0){this.years=lo,this.months=$u,this.weeks=Ru,this.days=Iu,this.hours=Pu,this.minutes=Ou,this.seconds=Du,this.milliseconds=Mu,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=this.sign===0}abs(){return new Duration(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(lo){var $u;if(typeof lo=="string"){const Ru=String(lo).trim(),Iu=Ru.startsWith("-")?-1:1,Pu=($u=Ru.match(durationRe))===null||$u===void 0?void 0:$u.slice(1).map(Ou=>(Number(Ou)||0)*Iu);return Pu?new Duration(...Pu):new Duration}else if(typeof lo=="object"){const{years:Ru,months:Iu,weeks:Pu,days:Ou,hours:Du,minutes:Mu,seconds:Lu,milliseconds:Bu}=lo;return new Duration(Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu)}throw new RangeError("invalid duration")}static compare(lo,$u){const Ru=Date.now(),Iu=Math.abs(applyDuration(Ru,Duration.from(lo)).getTime()-Ru),Pu=Math.abs(applyDuration(Ru,Duration.from($u)).getTime()-Ru);return Iu>Pu?-1:Iu<Pu?1:0}toLocaleString(lo,$u){return new DurationFormat(lo,$u).format(this)}}function applyDuration(Au,lo){const $u=new Date(Au);return lo.sign<0?($u.setUTCSeconds($u.getUTCSeconds()+lo.seconds),$u.setUTCMinutes($u.getUTCMinutes()+lo.minutes),$u.setUTCHours($u.getUTCHours()+lo.hours),$u.setUTCDate($u.getUTCDate()+lo.weeks*7+lo.days),$u.setUTCMonth($u.getUTCMonth()+lo.months),$u.setUTCFullYear($u.getUTCFullYear()+lo.years)):($u.setUTCFullYear($u.getUTCFullYear()+lo.years),$u.setUTCMonth($u.getUTCMonth()+lo.months),$u.setUTCDate($u.getUTCDate()+lo.weeks*7+lo.days),$u.setUTCHours($u.getUTCHours()+lo.hours),$u.setUTCMinutes($u.getUTCMinutes()+lo.minutes),$u.setUTCSeconds($u.getUTCSeconds()+lo.seconds)),$u}function elapsedTime(Au,lo="second",$u=Date.now()){const Ru=Au.getTime()-$u;if(Ru===0)return new Duration;const Iu=Math.sign(Ru),Pu=Math.abs(Ru),Ou=Math.floor(Pu/1e3),Du=Math.floor(Ou/60),Mu=Math.floor(Du/60),Lu=Math.floor(Mu/24),Bu=Math.floor(Lu/30),ju=Math.floor(Bu/12),Fu=unitNames.indexOf(lo)||unitNames.length;return new Duration(Fu>=0?ju*Iu:0,Fu>=1?(Bu-ju*12)*Iu:0,0,Fu>=3?(Lu-Bu*30)*Iu:0,Fu>=4?(Mu-Lu*24)*Iu:0,Fu>=5?(Du-Mu*60)*Iu:0,Fu>=6?(Ou-Du*60)*Iu:0,Fu>=7?(Pu-Ou*1e3)*Iu:0)}function roundToSingleUnit(Au,{relativeTo:lo=Date.now()}={}){if(lo=new Date(lo),Au.blank)return Au;const $u=Au.sign;let Ru=Math.abs(Au.years),Iu=Math.abs(Au.months),Pu=Math.abs(Au.weeks),Ou=Math.abs(Au.days),Du=Math.abs(Au.hours),Mu=Math.abs(Au.minutes),Lu=Math.abs(Au.seconds),Bu=Math.abs(Au.milliseconds);Bu>=900&&(Lu+=Math.round(Bu/1e3)),(Lu||Mu||Du||Ou||Pu||Iu||Ru)&&(Bu=0),Lu>=55&&(Mu+=Math.round(Lu/60)),(Mu||Du||Ou||Pu||Iu||Ru)&&(Lu=0),Mu>=55&&(Du+=Math.round(Mu/60)),(Du||Ou||Pu||Iu||Ru)&&(Mu=0),Ou&&Du>=12&&(Ou+=Math.round(Du/24)),!Ou&&Du>=21&&(Ou+=Math.round(Du/24)),(Ou||Pu||Iu||Ru)&&(Du=0);const ju=lo.getFullYear(),Fu=lo.getMonth(),zu=lo.getDate();if(Ou>=27||Ru+Iu+Ou){const Uu=new Date(lo);Uu.setDate(1),Uu.setMonth(Fu+Iu*$u+1),Uu.setDate(0);const Hu=Math.max(0,zu-Uu.getDate()),Vu=new Date(lo);Vu.setFullYear(ju+Ru*$u),Vu.setDate(zu-Hu),Vu.setMonth(Fu+Iu*$u),Vu.setDate(zu-Hu+Ou*$u);const Gu=Vu.getFullYear()-lo.getFullYear(),Wu=Vu.getMonth()-lo.getMonth(),Zu=Math.abs(Math.round((Number(Vu)-Number(lo))/864e5))+Hu,Ju=Math.abs(Gu*12+Wu);Zu<27?(Ou>=6?(Pu+=Math.round(Ou/7),Ou=0):Ou=Zu,Iu=Ru=0):Ju<=11?(Iu=Ju,Ru=0):(Iu=0,Ru=Gu*$u),(Iu||Ru)&&(Ou=0)}return Ru&&(Iu=0),Pu>=4&&(Iu+=Math.round(Pu/4)),(Iu||Ru)&&(Pu=0),Ou&&Pu&&!Iu&&!Ru&&(Pu+=Math.round(Ou/7),Ou=0),new Duration(Ru*$u,Iu*$u,Pu*$u,Ou*$u,Du*$u,Mu*$u,Lu*$u,Bu*$u)}function getRelativeTimeUnit(Au,lo){const $u=roundToSingleUnit(Au,lo);if($u.blank)return[0,"second"];for(const Ru of unitNames){if(Ru==="millisecond")continue;const Iu=$u[`${Ru}s`];if(Iu)return[Iu,Ru]}return[0,"second"]}var __classPrivateFieldGet$1=function(Au,lo,$u,Ru){if($u==="a"&&!Ru)throw new TypeError("Private accessor was defined without a getter");if(typeof lo=="function"?Au!==lo||!Ru:!lo.has(Au))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $u==="m"?Ru:$u==="a"?Ru.call(Au):Ru?Ru.value:lo.get(Au)},__classPrivateFieldSet$1=function(Au,lo,$u,Ru,Iu){if(typeof lo=="function"?Au!==lo||!0:!lo.has(Au))throw new TypeError("Cannot write private member to an object whose class did not declare it");return lo.set(Au,$u),$u},_RelativeTimeElement_instances,_RelativeTimeElement_customTitle,_RelativeTimeElement_updating,_RelativeTimeElement_lang_get,_RelativeTimeElement_renderRoot,_RelativeTimeElement_getFormattedTitle,_RelativeTimeElement_resolveFormat,_RelativeTimeElement_getDurationFormat,_RelativeTimeElement_getRelativeFormat,_RelativeTimeElement_getDateTimeFormat,_RelativeTimeElement_isToday,_RelativeTimeElement_isCurrentYear,_RelativeTimeElement_getUserPreferredAbsoluteTimeFormat,_RelativeTimeElement_updateRenderRootContent,_RelativeTimeElement_shouldDisplayUserPreferredAbsoluteTime,_RelativeTimeElement_onRelativeTimeUpdated;const HTMLElement$1=globalThis.HTMLElement||null,emptyDuration=new Duration,microEmptyDuration=new Duration(0,0,0,0,0,1);class RelativeTimeUpdatedEvent extends Event{constructor(lo,$u,Ru,Iu){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=lo,this.newText=$u,this.oldTitle=Ru,this.newTitle=Iu}}function getUnitFactor(Au){if(!Au.date)return 1/0;if(Au.format==="duration"||Au.format==="elapsed"){const $u=Au.precision;if($u==="second")return 1e3;if($u==="minute")return 60*1e3}const lo=Math.abs(Date.now()-Au.date.getTime());return lo<60*1e3?1e3:lo<3600*1e3?60*1e3:3600*1e3}const dateObserver=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(Au){if(this.elements.has(Au))return;this.elements.add(Au);const lo=Au.date;if(lo&&lo.getTime()){const $u=getUnitFactor(Au),Ru=Date.now()+$u;Ru<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),$u),this.time=Ru)}}unobserve(Au){this.elements.has(Au)&&this.elements.delete(Au)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let Au=1/0;for(const lo of this.elements)Au=Math.min(Au,getUnitFactor(lo)),lo.update();this.time=Math.min(3600*1e3,Au),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class RelativeTimeElement extends HTMLElement$1{constructor(){super(...arguments),_RelativeTimeElement_instances.add(this),_RelativeTimeElement_customTitle.set(this,!1),_RelativeTimeElement_updating.set(this,!1),_RelativeTimeElement_renderRoot.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),_RelativeTimeElement_onRelativeTimeUpdated.set(this,null)}static define(lo="relative-time",$u=customElements){return $u.define(lo,this),this}get timeZone(){var lo;return((lo=this.closest("[time-zone]"))===null||lo===void 0?void 0:lo.getAttribute("time-zone"))||this.ownerDocument.documentElement.getAttribute("time-zone")||void 0}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title","aria-hidden","time-zone"]}get onRelativeTimeUpdated(){return __classPrivateFieldGet$1(this,_RelativeTimeElement_onRelativeTimeUpdated,"f")}set onRelativeTimeUpdated(lo){__classPrivateFieldGet$1(this,_RelativeTimeElement_onRelativeTimeUpdated,"f")&&this.removeEventListener("relative-time-updated",__classPrivateFieldGet$1(this,_RelativeTimeElement_onRelativeTimeUpdated,"f")),__classPrivateFieldSet$1(this,_RelativeTimeElement_onRelativeTimeUpdated,typeof lo=="object"||typeof lo=="function"?lo:null),typeof lo=="function"&&this.addEventListener("relative-time-updated",lo)}get second(){const lo=this.getAttribute("second");if(lo==="numeric"||lo==="2-digit")return lo}set second(lo){this.setAttribute("second",lo||"")}get minute(){const lo=this.getAttribute("minute");if(lo==="numeric"||lo==="2-digit")return lo}set minute(lo){this.setAttribute("minute",lo||"")}get hour(){const lo=this.getAttribute("hour");if(lo==="numeric"||lo==="2-digit")return lo}set hour(lo){this.setAttribute("hour",lo||"")}get weekday(){const lo=this.getAttribute("weekday");if(lo==="long"||lo==="short"||lo==="narrow")return lo;if(this.format==="datetime"&&lo!=="")return this.formatStyle}set weekday(lo){this.setAttribute("weekday",lo||"")}get day(){var lo;const $u=(lo=this.getAttribute("day"))!==null&&lo!==void 0?lo:"numeric";if($u==="numeric"||$u==="2-digit")return $u}set day(lo){this.setAttribute("day",lo||"")}get month(){const lo=this.format;let $u=this.getAttribute("month");if($u!==""&&($u??($u=lo==="datetime"?this.formatStyle:"short"),$u==="numeric"||$u==="2-digit"||$u==="short"||$u==="long"||$u==="narrow"))return $u}set month(lo){this.setAttribute("month",lo||"")}get year(){var lo;const $u=this.getAttribute("year");if($u==="numeric"||$u==="2-digit")return $u;if(!this.hasAttribute("year")&&new Date().getUTCFullYear()!==((lo=this.date)===null||lo===void 0?void 0:lo.getUTCFullYear()))return"numeric"}set year(lo){this.setAttribute("year",lo||"")}get timeZoneName(){const lo=this.getAttribute("time-zone-name");if(lo==="long"||lo==="short"||lo==="shortOffset"||lo==="longOffset"||lo==="shortGeneric"||lo==="longGeneric")return lo}set timeZoneName(lo){this.setAttribute("time-zone-name",lo||"")}get prefix(){var lo;return(lo=this.getAttribute("prefix"))!==null&&lo!==void 0?lo:this.format==="datetime"?"":"on"}set prefix(lo){this.setAttribute("prefix",lo)}get threshold(){const lo=this.getAttribute("threshold");return lo&&isDuration(lo)?lo:"P30D"}set threshold(lo){this.setAttribute("threshold",lo)}get tense(){const lo=this.getAttribute("tense");return lo==="past"?"past":lo==="future"?"future":"auto"}set tense(lo){this.setAttribute("tense",lo)}get precision(){const lo=this.getAttribute("precision");return unitNames.includes(lo)?lo:this.format==="micro"?"minute":"second"}set precision(lo){this.setAttribute("precision",lo)}get format(){const lo=this.getAttribute("format");return lo==="datetime"?"datetime":lo==="relative"?"relative":lo==="duration"?"duration":lo==="micro"?"micro":lo==="elapsed"?"elapsed":"auto"}set format(lo){this.setAttribute("format",lo)}get formatStyle(){const lo=this.getAttribute("format-style");if(lo==="long")return"long";if(lo==="short")return"short";if(lo==="narrow")return"narrow";const $u=this.format;return $u==="elapsed"||$u==="micro"?"narrow":$u==="datetime"?"short":"long"}set formatStyle(lo){this.setAttribute("format-style",lo)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(lo){this.toggleAttribute("no-title",lo)}get datetime(){return this.getAttribute("datetime")||""}set datetime(lo){this.setAttribute("datetime",lo)}get date(){const lo=Date.parse(this.datetime);return Number.isNaN(lo)?null:new Date(lo)}set date(lo){this.datetime=lo?.toISOString()||""}connectedCallback(){this.update()}disconnectedCallback(){dateObserver.unobserve(this)}attributeChangedCallback(lo,$u,Ru){$u!==Ru&&(lo==="title"&&__classPrivateFieldSet$1(this,_RelativeTimeElement_customTitle,Ru!==null&&(this.date&&__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getFormattedTitle).call(this,this.date))!==Ru),!__classPrivateFieldGet$1(this,_RelativeTimeElement_updating,"f")&&!(lo==="title"&&__classPrivateFieldGet$1(this,_RelativeTimeElement_customTitle,"f"))&&__classPrivateFieldSet$1(this,_RelativeTimeElement_updating,(async()=>{await Promise.resolve(),this.update(),__classPrivateFieldSet$1(this,_RelativeTimeElement_updating,!1,"f")})()))}update(){const lo=__classPrivateFieldGet$1(this,_RelativeTimeElement_renderRoot,"f").textContent||this.textContent||"",$u=this.getAttribute("title")||"";let Ru=$u;const Iu=this.date;if(typeof Intl>"u"||!Intl.DateTimeFormat||!Iu){__classPrivateFieldGet$1(this,_RelativeTimeElement_renderRoot,"f").textContent=lo;return}const Pu=Date.now();__classPrivateFieldGet$1(this,_RelativeTimeElement_customTitle,"f")||(Ru=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getFormattedTitle).call(this,Iu)||"",Ru&&!this.noTitle&&this.setAttribute("title",Ru));const Ou=elapsedTime(Iu,this.precision,Pu),Du=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_resolveFormat).call(this,Ou);let Mu=lo;const Lu=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_shouldDisplayUserPreferredAbsoluteTime).call(this,Du);Lu?Mu=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getUserPreferredAbsoluteTimeFormat).call(this,Iu):Du==="duration"?Mu=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getDurationFormat).call(this,Ou):Du==="relative"?Mu=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getRelativeFormat).call(this,Ou):Mu=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_getDateTimeFormat).call(this,Iu),Mu?__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_updateRenderRootContent).call(this,Mu):this.shadowRoot===__classPrivateFieldGet$1(this,_RelativeTimeElement_renderRoot,"f")&&this.textContent&&__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_updateRenderRootContent).call(this,this.textContent),(Mu!==lo||Ru!==$u)&&this.dispatchEvent(new RelativeTimeUpdatedEvent(lo,Mu,$u,Ru)),Du==="relative"||Du==="duration"||Lu&&(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_isToday).call(this,Iu)||__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_isCurrentYear).call(this,Iu))?dateObserver.observe(this):dateObserver.unobserve(this)}}_RelativeTimeElement_customTitle=new WeakMap,_RelativeTimeElement_updating=new WeakMap,_RelativeTimeElement_renderRoot=new WeakMap,_RelativeTimeElement_onRelativeTimeUpdated=new WeakMap,_RelativeTimeElement_instances=new WeakSet,_RelativeTimeElement_lang_get=function(){var lo;const $u=((lo=this.closest("[lang]"))===null||lo===void 0?void 0:lo.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale($u??"").toString()}catch{return"default"}},_RelativeTimeElement_getFormattedTitle=function(lo){return new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone}).format(lo)},_RelativeTimeElement_resolveFormat=function(lo){const $u=this.format;if($u==="datetime")return"datetime";if($u==="duration"||$u==="elapsed"||$u==="micro")return"duration";if(($u==="auto"||$u==="relative")&&typeof Intl<"u"&&Intl.RelativeTimeFormat){const Ru=this.tense;if(Ru==="past"||Ru==="future"||Duration.compare(lo,this.threshold)===1)return"relative"}return"datetime"},_RelativeTimeElement_getDurationFormat=function(lo){const $u=__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),Ru=this.format,Iu=this.formatStyle,Pu=this.tense;let Ou=emptyDuration;Ru==="micro"?(lo=roundToSingleUnit(lo),Ou=microEmptyDuration,lo.months===0&&(this.tense==="past"&&lo.sign!==-1||this.tense==="future"&&lo.sign!==1)&&(lo=microEmptyDuration)):(Pu==="past"&&lo.sign!==-1||Pu==="future"&&lo.sign!==1)&&(lo=Ou);const Du=`${this.precision}sDisplay`;return lo.blank?Ou.toLocaleString($u,{style:Iu,[Du]:"always"}):lo.abs().toLocaleString($u,{style:Iu})},_RelativeTimeElement_getRelativeFormat=function(lo){const $u=new Intl.RelativeTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{numeric:"auto",style:this.formatStyle}),Ru=this.tense;Ru==="future"&&lo.sign!==1&&(lo=emptyDuration),Ru==="past"&&lo.sign!==-1&&(lo=emptyDuration);const[Iu,Pu]=getRelativeTimeUnit(lo);return Pu==="second"&&Iu<10?$u.format(0,this.precision==="millisecond"?"second":this.precision):$u.format(Iu,Pu)},_RelativeTimeElement_getDateTimeFormat=function(lo){const $u=new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:this.timeZone});return`${this.prefix} ${$u.format(lo)}`.trim()},_RelativeTimeElement_isToday=function(lo){const $u=new Date,Ru=new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit"});return Ru.format($u)===Ru.format(lo)},_RelativeTimeElement_isCurrentYear=function(lo){const $u=new Date,Ru=new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{timeZone:this.timeZone,year:"numeric"});return Ru.format($u)===Ru.format(lo)},_RelativeTimeElement_getUserPreferredAbsoluteTimeFormat=function(lo){const $u={hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone};if(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_isToday).call(this,lo)){let Pu=new Intl.RelativeTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),{numeric:"auto"}).format(0,"day");Pu=Pu.charAt(0).toLocaleUpperCase(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get))+Pu.slice(1);const Ou=new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),$u).format(lo);return`${Pu} ${Ou}`}const Ru=Object.assign(Object.assign({},$u),{day:"numeric",month:"short"});return __classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"m",_RelativeTimeElement_isCurrentYear).call(this,lo)?new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),Ru).format(lo):new Intl.DateTimeFormat(__classPrivateFieldGet$1(this,_RelativeTimeElement_instances,"a",_RelativeTimeElement_lang_get),Object.assign(Object.assign({},Ru),{year:"numeric"})).format(lo)},_RelativeTimeElement_updateRenderRootContent=function(lo){if(this.hasAttribute("aria-hidden")&&this.getAttribute("aria-hidden")==="true"){const $u=document.createElement("span");$u.setAttribute("aria-hidden","true"),$u.textContent=lo,__classPrivateFieldGet$1(this,_RelativeTimeElement_renderRoot,"f").replaceChildren($u)}else __classPrivateFieldGet$1(this,_RelativeTimeElement_renderRoot,"f").textContent=lo},_RelativeTimeElement_shouldDisplayUserPreferredAbsoluteTime=function(lo){var $u;return lo==="duration"?!1:this.ownerDocument.documentElement.getAttribute("data-prefers-absolute-time")==="true"||(($u=this.ownerDocument.body)===null||$u===void 0?void 0:$u.getAttribute("data-prefers-absolute-time"))==="true"};const root$9=typeof globalThis<"u"?globalThis:window;try{root$9.RelativeTimeElement=RelativeTimeElement.define()}catch(Au){if(!(root$9.DOMException&&Au instanceof DOMException&&Au.name==="NotSupportedError")&&!(Au instanceof ReferenceError))throw Au}const RelativeTimeComponent=createComponent(RelativeTimeElement,"relative-time"),localeOptions={month:"short",day:"numeric",year:"numeric"};function RelativeTime(Au){const lo=distExports.c(16);let $u,Ru,Iu,Pu,Ou;if(lo[0]!==Au?({date:Ru,datetime:Iu,children:$u,noTitle:Pu,...Ou}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5]),Iu){let ju;lo[6]!==Iu?(ju=new Date(Iu),lo[6]=Iu,lo[7]=ju):ju=lo[7],Ru=ju}const Du=Pu?"":void 0;let Mu;if(lo[8]!==$u||lo[9]!==Ru){var Lu;Mu=$u||((Lu=Ru)===null||Lu===void 0?void 0:Lu.toLocaleDateString("en",localeOptions))||"",lo[8]=$u,lo[9]=Ru,lo[10]=Mu}else Mu=lo[10];let Bu;return lo[11]!==Ru||lo[12]!==Ou||lo[13]!==Du||lo[14]!==Mu?(Bu=jsxRuntimeExports.jsx(RelativeTimeComponent,{...Ou,date:Ru,"no-title":Du,children:Mu}),lo[11]=Ru,lo[12]=Ou,lo[13]=Du,lo[14]=Mu,lo[15]=Bu):Bu=lo[15],Bu}const Icon$3=vM.forwardRef((Au,lo)=>{const $u=distExports.c(7);let Ru,Iu;$u[0]!==Au?({icon:Ru,...Iu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu):(Ru=$u[1],Iu=$u[2]);let Pu;return $u[3]!==Ru||$u[4]!==lo||$u[5]!==Iu?(Pu=jsxRuntimeExports.jsx(Ru,{...Iu,ref:lo}),$u[3]=Ru,$u[4]=lo,$u[5]=Iu,$u[6]=Pu):Pu=$u[6],Pu}),Octicon=qe$4(Icon$3).withConfig({shouldForwardProp(Au){return Au!=="sx"}}).withConfig({displayName:"Octicon",componentId:"sc-9kayk9-0"})(["",""],({color:Au,sx:lo})=>sx({sx:{color:Au,...lo}})),globalFocusStyle=Ae$4(["box-shadow:none;outline:2px solid ",";"],get("colors.accent.fg")),getGlobalFocusStyles=Au=>Ae$4(["&:focus:not(:disabled){",";outline-offset:",";&:not(:focus-visible){outline:solid 1px transparent;}}&:focus-visible:not(:disabled){",";outline-offset:",";}"],globalFocusStyle,Au,globalFocusStyle,Au),TRANSITION_DURATION="80ms",EASE_OUT_QUAD_CURVE="cubic-bezier(0.5, 1, 0.89, 1)",sizeVariants=variant({prop:"size",variants:{small:{height:"24px",width:"48px"}}}),CircleIcon=Au=>{const lo=distExports.c(4),{size:$u}=Au,Ru=$u==="small"?"12":"16",Iu=$u==="small"?"12":"16";let Pu;lo[0]===Symbol.for("react.memo_cache_sentinel")?(Pu=jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M8 12.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z"}),lo[0]=Pu):Pu=lo[0];let Ou;return lo[1]!==Ru||lo[2]!==Iu?(Ou=jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:Ru,height:Iu,viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Pu}),lo[1]=Ru,lo[2]=Iu,lo[3]=Ou):Ou=lo[3],Ou},LineIcon=Au=>{const lo=distExports.c(4),{size:$u}=Au,Ru=$u==="small"?"12":"16",Iu=$u==="small"?"12":"16";let Pu;lo[0]===Symbol.for("react.memo_cache_sentinel")?(Pu=jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v11.5a.75.75 0 0 1-1.5 0V2.75A.75.75 0 0 1 8 2Z"}),lo[0]=Pu):Pu=lo[0];let Ou;return lo[1]!==Ru||lo[2]!==Iu?(Ou=jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:Ru,height:Iu,viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Pu}),lo[1]=Ru,lo[2]=Iu,lo[3]=Ou):Ou=lo[3],Ou},SwitchButton=qe$4.button.withConfig({displayName:"ToggleSwitch__SwitchButton",componentId:"sc-e6gszy-0"})(["vertical-align:middle;cursor:pointer;user-select:none;appearance:none;text-decoration:none;padding:0;transition-property:background-color,border-color;transition-duration:",";transition-timing-function:",";border-radius:",";border-style:solid;border-width:1px;display:block;height:32px;width:64px;position:relative;overflow:hidden;",";@media (pointer:coarse){&:before{content:'';position:absolute;left:0;right:0;transform:translateY(-50%);top:50%;min-height:44px;}}@media (prefers-reduced-motion){transition:none;*{transition:none;}}&:hover:not(:disabled):not([aria-disabled='true']),&:focus:focus-visible{background-color:",";}&:active,&:active:focus-visible{background-color:",";}"," "," ",""],TRANSITION_DURATION,EASE_OUT_QUAD_CURVE,get("radii.2"),getGlobalFocusStyles("3px"),get("colors.switchTrack.hoverBg"),get("colors.switchTrack.activeBg"),Au=>Au["aria-disabled"]?Ae$4(["@media (forced-colors:active){border-color:GrayText;}background-color:",";border-color:transparent;cursor:not-allowed;transition-property:none;"],get("colors.switchTrack.disabledBg")):Au.checked?Ae$4(["background-color:",";border-color:var(--control-checked-borderColor-rest,transparent);&:hover:not(:disabled):not([aria-disabled='true']),&:focus:focus-visible{background-color:",";}&:active,&:active:focus-visible{background-color:",";}"],get("colors.switchTrack.checked.bg"),get("colors.switchTrack.checked.hoverBg"),get("colors.switchTrack.checked.activeBg")):Ae$4(["background-color:",";border-color:var(--controlTrack-borderColor-rest,transparent);&:active{background-color:",";}"],get("colors.switchTrack.bg"),get("colors.switchTrack.activeBg")),sx,sizeVariants),ToggleKnob=qe$4.div.withConfig({displayName:"ToggleSwitch__ToggleKnob",componentId:"sc-e6gszy-1"})(["background-color:",";border-width:1px;border-style:solid;border-color:",";border-radius:calc("," - 1px);width:50%;position:absolute;top:0;bottom:0;transition-property:transform;transition-duration:",";transition-timing-function:",";transform:",";z-index:1;@media (prefers-reduced-motion){transition:none;}",""],get("colors.switchKnob.bg"),Au=>Au["aria-disabled"]?get("colors.switchTrack.disabledBg"):get("colors.switchKnob.border"),get("radii.2"),TRANSITION_DURATION,EASE_OUT_QUAD_CURVE,Au=>`translateX(${Au.checked?"100%":"0px"})`,Au=>{if(Au["aria-disabled"])return Ae$4(["@media (forced-colors:active){color:GrayText;}border-color:",";"],get("colors.switchTrack.disabledBg"));if(Au.checked)return Ae$4(["border-color:",";"],get("colors.switchKnob.checked.border"))}),hiddenTextStyles={visibility:"hidden",height:0},ToggleSwitch=vM.forwardRef(function(lo,$u){const Ru=distExports.c(94);let Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu;Ru[0]!==lo?({"aria-labelledby":Pu,"aria-describedby":Iu,defaultChecked:Du,disabled:Mu,loading:Lu,checked:Ou,onChange:Bu,onClick:ju,buttonType:Uu,size:Hu,statusLabelPosition:Vu,loadingLabelDelay:Gu,loadingLabel:Wu,sx:zu,...Fu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du,Ru[5]=Mu,Ru[6]=Lu,Ru[7]=Bu,Ru[8]=ju,Ru[9]=Fu,Ru[10]=zu,Ru[11]=Uu,Ru[12]=Hu,Ru[13]=Vu,Ru[14]=Gu,Ru[15]=Wu):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4],Mu=Ru[5],Lu=Ru[6],Bu=Ru[7],ju=Ru[8],Fu=Ru[9],zu=Ru[10],Uu=Ru[11],Hu=Ru[12],Vu=Ru[13],Gu=Ru[14],Wu=Ru[15]);const Zu=Uu===void 0?"button":Uu,Ju=Hu===void 0?"medium":Hu,Yu=Vu===void 0?"start":Vu,Xu=Gu===void 0?2e3:Gu,ed=Wu===void 0?"Loading":Wu,td=typeof Ou<"u",[nd,od]=useProvidedStateOrCreate(Ou,Bu,!!Du),sd=!Mu&&!Lu,[ad,pd]=vM.useState(!1),bd=useId("loadingLabel"),{safeSetTimeout:wd}=useSafeTimeout();let _d;Ru[16]!==Mu||Ru[17]!==td||Ru[18]!==nd||Ru[19]!==Lu||Ru[20]!==ju||Ru[21]!==od?(_d=Kd=>{Mu||Lu||(td||od(!nd),ju&&ju(Kd))},Ru[16]=Mu,Ru[17]=td,Ru[18]=nd,Ru[19]=Lu,Ru[20]=ju,Ru[21]=od,Ru[22]=_d):_d=Ru[22];const yd=_d;let Sd,kd;Ru[23]!==Ou||Ru[24]!==Mu||Ru[25]!==td||Ru[26]!==Bu?(Sd=()=>{Bu&&td&&!Mu&&Bu(!!Ou)},kd=[Bu,Ou,td,Mu],Ru[23]=Ou,Ru[24]=Mu,Ru[25]=td,Ru[26]=Bu,Ru[27]=Sd,Ru[28]=kd):(Sd=Ru[27],kd=Ru[28]),reactExports.useEffect(Sd,kd);let md,dd;Ru[29]!==ad||Ru[30]!==Lu||Ru[31]!==Xu||Ru[32]!==wd?(md=()=>{!Lu&&ad?pd(!1):Lu&&!ad&&wd(()=>{pd(!0)},Xu)},dd=[Lu,ad,Xu,wd],Ru[29]=ad,Ru[30]=Lu,Ru[31]=Xu,Ru[32]=wd,Ru[33]=md,Ru[34]=dd):(md=Ru[33],dd=Ru[34]),reactExports.useEffect(md,dd);let vd=bd;Iu&&(vd=`${vd} ${Iu}`);const ld=Yu==="start"?"row":"row-reverse",ud=ad&&ed;let hd;Ru[35]!==bd||Ru[36]!==ud?(hd=jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx(AriaStatus,{announceOnShow:!0,id:bd,children:ud})}),Ru[35]=bd,Ru[36]=ud,Ru[37]=hd):hd=Ru[37];let gd;Ru[38]!==Lu?(gd=Lu?jsxRuntimeExports.jsx(StyledSpinner,{size:"small",srText:null}):null,Ru[38]=Lu,Ru[39]=gd):gd=Ru[39];const Ed=sd?"fg.default":"fg.muted",Td=Ju==="small"?0:1,Rd=sd?"pointer":"not-allowed";let jd;Ru[40]!==Rd?(jd={position:"relative",cursor:Rd},Ru[40]=Rd,Ru[41]=jd):jd=Ru[41];const Cd=nd?null:hiddenTextStyles;let $d;Ru[42]!==Cd?($d=jsxRuntimeExports.jsx(Box$1,{textAlign:"right",sx:Cd,children:"On"}),Ru[42]=Cd,Ru[43]=$d):$d=Ru[43];const Id=nd?hiddenTextStyles:null;let Vd;Ru[44]!==Id?(Vd=jsxRuntimeExports.jsx(Box$1,{textAlign:"right",sx:Id,children:"Off"}),Ru[44]=Id,Ru[45]=Vd):Vd=Ru[45];let Dd;Ru[46]!==yd||Ru[47]!==Ed||Ru[48]!==Td||Ru[49]!==jd||Ru[50]!==$d||Ru[51]!==Vd?(Dd=jsxRuntimeExports.jsxs(Text$3,{color:Ed,fontSize:Td,mx:2,"aria-hidden":"true",sx:jd,onClick:yd,children:[$d,Vd]}),Ru[46]=yd,Ru[47]=Ed,Ru[48]=Td,Ru[49]=jd,Ru[50]=$d,Ru[51]=Vd,Ru[52]=Dd):Dd=Ru[52];const Wd=ad||Iu?vd:void 0,oh=!sd,rh=sd?"switchTrack.checked.fg":"switchTrack.checked.disabledFg",Eh=`translateX(${nd?"0":"-100%"})`;let ah;Ru[53]!==Eh?(ah={transform:Eh,transitionProperty:"transform",transitionDuration:TRANSITION_DURATION},Ru[53]=Eh,Ru[54]=ah):ah=Ru[54];let yh;Ru[55]!==Ju?(yh=jsxRuntimeExports.jsx(LineIcon,{size:Ju}),Ru[55]=Ju,Ru[56]=yh):yh=Ru[56];let vh;Ru[57]!==rh||Ru[58]!==ah||Ru[59]!==yh?(vh=jsxRuntimeExports.jsx(Box$1,{flexGrow:1,flexShrink:0,flexBasis:"50%",color:rh,lineHeight:"0",sx:ah,children:yh}),Ru[57]=rh,Ru[58]=ah,Ru[59]=yh,Ru[60]=vh):vh=Ru[60];const Jd=sd?"switchTrack.fg":"switchTrack.disabledFg",Qd=`translateX(${nd?"100%":"0"})`;let sh;Ru[61]!==Qd?(sh={transform:Qd,transitionProperty:"transform",transitionDuration:TRANSITION_DURATION},Ru[61]=Qd,Ru[62]=sh):sh=Ru[62];let Oh;Ru[63]!==Ju?(Oh=jsxRuntimeExports.jsx(CircleIcon,{size:Ju}),Ru[63]=Ju,Ru[64]=Oh):Oh=Ru[64];let qd;Ru[65]!==Jd||Ru[66]!==sh||Ru[67]!==Oh?(qd=jsxRuntimeExports.jsx(Box$1,{flexGrow:1,flexShrink:0,flexBasis:"50%",color:Jd,lineHeight:"0",sx:sh,children:Oh}),Ru[65]=Jd,Ru[66]=sh,Ru[67]=Oh,Ru[68]=qd):qd=Ru[68];let zd;Ru[69]!==vh||Ru[70]!==qd?(zd=jsxRuntimeExports.jsxs(Box$1,{"aria-hidden":"true",display:"flex",alignItems:"center",width:"100%",height:"100%",overflow:"hidden",children:[vh,qd]}),Ru[69]=vh,Ru[70]=qd,Ru[71]=zd):zd=Ru[71];const Pd=!sd;let Od;Ru[72]!==nd||Ru[73]!==Pd?(Od=jsxRuntimeExports.jsx(ToggleKnob,{"aria-hidden":"true","aria-disabled":Pd,checked:nd}),Ru[72]=nd,Ru[73]=Pd,Ru[74]=Od):Od=Ru[74];let Gd;Ru[75]!==Pu||Ru[76]!==Zu||Ru[77]!==yd||Ru[78]!==nd||Ru[79]!==$u||Ru[80]!==Ju||Ru[81]!==Wd||Ru[82]!==oh||Ru[83]!==zd||Ru[84]!==Od?(Gd=jsxRuntimeExports.jsxs(SwitchButton,{ref:$u,type:Zu,onClick:yd,"aria-labelledby":Pu,"aria-describedby":Wd,"aria-pressed":nd,checked:nd,size:Ju,"aria-disabled":oh,children:[zd,Od]}),Ru[75]=Pu,Ru[76]=Zu,Ru[77]=yd,Ru[78]=nd,Ru[79]=$u,Ru[80]=Ju,Ru[81]=Wd,Ru[82]=oh,Ru[83]=zd,Ru[84]=Od,Ru[85]=Gd):Gd=Ru[85];let Md;return Ru[86]!==Fu||Ru[87]!==zu||Ru[88]!==ld||Ru[89]!==hd||Ru[90]!==gd||Ru[91]!==Dd||Ru[92]!==Gd?(Md=jsxRuntimeExports.jsxs(Box$1,{display:"inline-flex",alignItems:"center",flexDirection:ld,sx:zu,...Fu,children:[hd,gd,Dd,Gd]}),Ru[86]=Fu,Ru[87]=zu,Ru[88]=ld,Ru[89]=hd,Ru[90]=gd,Ru[91]=Dd,Ru[92]=Gd,Ru[93]=Md):Md=Ru[93],Md});var all$7=compose$1(space$1,typography,color$1,layout,flexbox,border,background,position$4,grid,shadow,buttonStyle,textStyle,colorStyle),regex$2=new RegExp("^("+all$7.propNames.join("|")+")$"),omit$1=function(lo){var $u={};for(var Ru in lo)regex$2.test(Ru)||($u[Ru]=lo[Ru]);return $u},classes$h={TokenBase:"prc-Token-TokenBase-PfQzJ"};const tokenSizes={small:"16px",medium:"20px",large:"24px",xlarge:"32px"},defaultTokenSize="medium",isTokenInteractive=({as:Au="span",onClick:lo,onFocus:$u,tabIndex:Ru=-1,disabled:Iu})=>Iu?!1:!!($u||lo||Ru>-1||["a","button"].includes(Au)),TokenBase=vM.forwardRef((Au,lo)=>{const $u=distExports.c(26);let Ru,Iu,Pu,Ou,Du,Mu,Lu;if($u[0]!==Au){const{onRemove:Wu,onKeyDown:Zu,id:Ju,className:Yu,size:Xu,isSelected:ed,as:td,...nd}=Au;Ou=Wu,Pu=Zu,Iu=Ju,Ru=Yu,Mu=Xu,Lu=td,Du=nd,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu}else Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7];const Bu=Mu===void 0?defaultTokenSize:Mu,ju=Lu===void 0?"span":Lu;let Fu;$u[8]!==Pu||$u[9]!==Ou?(Fu=Wu=>{Pu&&Pu(Wu),(Wu.key==="Backspace"||Wu.key==="Delete")&&Ou&&Ou()},$u[8]=Pu,$u[9]=Ou,$u[10]=Fu):Fu=$u[10];let zu;$u[11]!==Ru?(zu=clsx(classes$h.TokenBase,Ru),$u[11]=Ru,$u[12]=zu):zu=$u[12];let Uu;$u[13]!==Du?(Uu=isTokenInteractive(Du),$u[13]=Du,$u[14]=Uu):Uu=$u[14];let Hu;if($u[15]!==Iu){var Vu;Hu=(Vu=Iu)===null||Vu===void 0?void 0:Vu.toString(),$u[15]=Iu,$u[16]=Hu}else Hu=$u[16];let Gu;return $u[17]!==ju||$u[18]!==lo||$u[19]!==Du||$u[20]!==Bu||$u[21]!==Fu||$u[22]!==zu||$u[23]!==Uu||$u[24]!==Hu?(Gu=jsxRuntimeExports.jsx(BoxWithFallback,{as:ju,onKeyDown:Fu,className:zu,"data-cursor-is-interactive":Uu,"data-size":Bu,id:Hu,...Du,ref:lo}),$u[17]=ju,$u[18]=lo,$u[19]=Du,$u[20]=Bu,$u[21]=Fu,$u[22]=zu,$u[23]=Uu,$u[24]=Hu,$u[25]=Gu):Gu=$u[25],Gu});var classes$g={TokenButton:"prc-Token-TokenButton-F4Y8h"};const getTokenButtonIconSize=Au=>parseInt(tokenSizes[Au||defaultTokenSize],10)*.75,RemoveTokenButton=({"aria-label":Au,isParentInteractive:lo,size:$u=defaultTokenSize,className:Ru,borderOffset:Iu=0,as:Pu,...Ou})=>(delete Ou.children,jsxRuntimeExports.jsx(BoxWithFallback,{as:lo?"span":"button",tabIndex:lo?-1:void 0,"aria-label":lo?Au:"Remove token","data-size":$u,className:clsx(classes$g.TokenButton,Ru),style:{transform:`translate(${Iu}px, -${Iu}px)`},...Ou,children:jsxRuntimeExports.jsx(XIcon,{size:getTokenButtonIconSize($u)})}));RemoveTokenButton.displayName="RemoveTokenButton";var classes$f={TokenTextContainer:"prc-Token-TokenTextContainer--rlDJ"};const TokenTextContainer=Au=>{const lo=distExports.c(7);let $u,Ru;lo[0]!==Au?({children:$u,...Ru}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru):($u=lo[1],Ru=lo[2]);let Iu;lo[3]===Symbol.for("react.memo_cache_sentinel")?(Iu=clsx(classes$f.TokenTextContainer),lo[3]=Iu):Iu=lo[3];let Pu;return lo[4]!==$u||lo[5]!==Ru?(Pu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"span",className:Iu,...Ru,children:$u}),lo[4]=$u,lo[5]=Ru,lo[6]=Pu):Pu=lo[6],Pu};var classes$e={Token:"prc-Token-Token-L2-At",LeadingVisualContainer:"prc-Token-LeadingVisualContainer-YTg7O",LargeLeadingVisual:"prc-Token-LargeLeadingVisual-UdxDk"};const tokenBorderWidthPx=1,LeadingVisualContainer=Au=>{const lo=distExports.c(7),{children:$u,size:Ru}=Au;let Iu;lo[0]!==Ru?(Iu=Ru&&["large","xlarge"].includes(Ru),lo[0]=Ru,lo[1]=Iu):Iu=lo[1];let Pu;lo[2]!==Iu?(Pu=clsx(classes$e.LeadingVisualContainer,{[classes$e.LargeLeadingVisual]:Iu}),lo[2]=Iu,lo[3]=Pu):Pu=lo[3];let Ou;return lo[4]!==$u||lo[5]!==Pu?(Ou=jsxRuntimeExports.jsx("div",{className:Pu,children:$u}),lo[4]=$u,lo[5]=Pu,lo[6]=Ou):Ou=lo[6],Ou},Token$3=reactExports.forwardRef((Au,lo)=>{const $u=distExports.c(66);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu;$u[0]!==Au?({as:Iu,onRemove:Bu,id:Mu,leadingVisual:Ru,text:Uu,size:zu,hideRemoveButton:Ou,href:Du,onClick:Lu,className:Pu,style:Fu,...ju}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju,$u[10]=Fu,$u[11]=zu,$u[12]=Uu):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9],Fu=$u[10],zu=$u[11],Uu=$u[12]);const Hu=zu===void 0?defaultTokenSize:zu;let Vu;$u[13]!==Ou||$u[14]!==Bu||$u[15]!==Au?(Vu=isTokenInteractive(Au)&&!!Bu&&!Ou,$u[13]=Ou,$u[14]=Bu,$u[15]=Au,$u[16]=Vu):Vu=$u[16];const Gu=Vu;let Wu;$u[17]!==Bu?(Wu=Sd=>{Sd.stopPropagation(),Bu&&Bu()},$u[17]=Bu,$u[18]=Wu):Wu=$u[18];const Zu=Wu;let Ju;$u[19]!==Iu||$u[20]!==Du||$u[21]!==Lu?(Ju={as:Iu,href:Du,onClick:Lu},$u[19]=Iu,$u[20]=Du,$u[21]=Lu,$u[22]=Ju):Ju=$u[22];const Yu=Ju;let Xu;if($u[23]!==Mu){var ed;Xu=(ed=Mu)===null||ed===void 0?void 0:ed.toString(),$u[23]=Mu,$u[24]=Xu}else Xu=$u[24];let td;$u[25]!==Pu?(td=clsx(Pu,classes$e.Token),$u[25]=Pu,$u[26]=td):td=$u[26];const nd=!(Ou||!Bu);let od;$u[27]!==Gu||$u[28]!==Yu?(od=Gu?{}:Yu,$u[27]=Gu,$u[28]=Yu,$u[29]=od):od=$u[29];let sd;$u[30]!==Fu?(sd={borderWidth:`${tokenBorderWidthPx}px`,...Fu},$u[30]=Fu,$u[31]=sd):sd=$u[31];let ad;$u[32]!==Ru||$u[33]!==Hu?(ad=Ru?jsxRuntimeExports.jsx(LeadingVisualContainer,{size:Hu,children:jsxRuntimeExports.jsx(Ru,{})}):null,$u[32]=Ru,$u[33]=Hu,$u[34]=ad):ad=$u[34];let pd;$u[35]!==Gu||$u[36]!==Yu?(pd=Gu?Yu:{},$u[35]=Gu,$u[36]=Yu,$u[37]=pd):pd=$u[37];let bd;$u[38]!==Bu?(bd=Bu&&jsxRuntimeExports.jsx(VisuallyHidden,{children:" (press backspace or delete to remove)"}),$u[38]=Bu,$u[39]=bd):bd=$u[39];let wd;$u[40]!==pd||$u[41]!==bd||$u[42]!==Uu?(wd=jsxRuntimeExports.jsxs(TokenTextContainer,{...pd,children:[Uu,bd]}),$u[40]=pd,$u[41]=bd,$u[42]=Uu,$u[43]=wd):wd=$u[43];let _d;$u[44]!==Gu||$u[45]!==Ou||$u[46]!==Bu||$u[47]!==Zu||$u[48]!==Au||$u[49]!==Hu?(_d=!Ou&&Bu?jsxRuntimeExports.jsx(RemoveTokenButton,{borderOffset:tokenBorderWidthPx,onClick:Zu,size:Hu,isParentInteractive:isTokenInteractive(Au),"aria-hidden":Gu?"true":"false"}):null,$u[44]=Gu,$u[45]=Ou,$u[46]=Bu,$u[47]=Zu,$u[48]=Au,$u[49]=Hu,$u[50]=_d):_d=$u[50];let yd;return $u[51]!==lo||$u[52]!==Bu||$u[53]!==Au.isSelected||$u[54]!==ju||$u[55]!==Hu||$u[56]!==wd||$u[57]!==_d||$u[58]!==Xu||$u[59]!==td||$u[60]!==nd||$u[61]!==od||$u[62]!==sd||$u[63]!==ad||$u[64]!==Uu?(yd=jsxRuntimeExports.jsxs(TokenBase,{onRemove:Bu,id:Xu,className:td,text:Uu,size:Hu,"data-is-selected":Au.isSelected,"data-is-remove-btn":nd,...od,...ju,ref:lo,style:sd,children:[ad,wd,_d]}),$u[51]=lo,$u[52]=Bu,$u[53]=Au.isSelected,$u[54]=ju,$u[55]=Hu,$u[56]=wd,$u[57]=_d,$u[58]=Xu,$u[59]=td,$u[60]=nd,$u[61]=od,$u[62]=sd,$u[63]=ad,$u[64]=Uu,$u[65]=yd):yd=$u[65],yd});Token$3.displayName="Token";var styles$5={TextInputBaseWrapper:"prc-components-TextInputBaseWrapper-ueK9q",TextInputWrapper:"prc-components-TextInputWrapper-i1ofR"};const TextInputBaseWrapper=vM.forwardRef(function(lo,$u){const Ru=distExports.c(37);let Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu;Ru[0]!==lo?({className:Pu,style:Hu,variant:Gu,size:Uu,isInputFocused:Lu,hasTrailingAction:Mu,validationStatus:Vu,disabled:Du,contrast:Ou,monospace:Fu,block:Iu,width:Wu,minWidth:ju,maxWidth:Bu,...zu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du,Ru[5]=Mu,Ru[6]=Lu,Ru[7]=Bu,Ru[8]=ju,Ru[9]=Fu,Ru[10]=zu,Ru[11]=Uu,Ru[12]=Hu,Ru[13]=Vu,Ru[14]=Gu,Ru[15]=Wu):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4],Mu=Ru[5],Lu=Ru[6],Bu=Ru[7],ju=Ru[8],Fu=Ru[9],zu=Ru[10],Uu=Ru[11],Hu=Ru[12],Vu=Ru[13],Gu=Ru[14],Wu=Ru[15]);let Zu;Ru[16]!==Pu?(Zu=clsx(Pu,styles$5.TextInputBaseWrapper),Ru[16]=Pu,Ru[17]=Zu):Zu=Ru[17];const Ju=Iu||void 0,Yu=Ou||void 0,Xu=Du||void 0,ed=Lu||void 0,td=Fu||void 0,nd=Uu||void 0,od=Mu||void 0,sd=Vu||void 0,ad=Gu||void 0;let pd;Ru[18]!==Bu||Ru[19]!==ju||Ru[20]!==Hu||Ru[21]!==Wu?(pd=typeof Wu=="string"||typeof ju=="string"||typeof Bu=="string"?{width:Wu,maxWidth:Bu,minWidth:ju,...Hu}:Hu,Ru[18]=Bu,Ru[19]=ju,Ru[20]=Hu,Ru[21]=Wu,Ru[22]=pd):pd=Ru[22];let bd;return Ru[23]!==$u||Ru[24]!==zu||Ru[25]!==Zu||Ru[26]!==ad||Ru[27]!==pd||Ru[28]!==Ju||Ru[29]!==Yu||Ru[30]!==Xu||Ru[31]!==ed||Ru[32]!==td||Ru[33]!==nd||Ru[34]!==od||Ru[35]!==sd?(bd=jsxRuntimeExports.jsx(BoxWithFallback,{as:"span",ref:$u,className:Zu,"data-block":Ju,"data-contrast":Yu,"data-disabled":Xu,"data-focused":ed,"data-monospace":td,"data-size":nd,"data-trailing-action":od,"data-validation":sd,"data-variant":ad,style:pd,...zu}),Ru[23]=$u,Ru[24]=zu,Ru[25]=Zu,Ru[26]=ad,Ru[27]=pd,Ru[28]=Ju,Ru[29]=Yu,Ru[30]=Xu,Ru[31]=ed,Ru[32]=td,Ru[33]=nd,Ru[34]=od,Ru[35]=sd,Ru[36]=bd):bd=Ru[36],bd});TextInputBaseWrapper.displayName="TextInputBaseWrapper";const TextInputWrapper=vM.forwardRef(function(lo,$u){const Ru=distExports.c(13);let Iu,Pu,Ou,Du;Ru[0]!==lo?({className:Iu,hasLeadingVisual:Pu,hasTrailingVisual:Ou,...Du}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu,Ru[3]=Ou,Ru[4]=Du):(Iu=Ru[1],Pu=Ru[2],Ou=Ru[3],Du=Ru[4]);let Mu;Ru[5]!==Iu?(Mu=clsx(Iu,styles$5.TextInputWrapper),Ru[5]=Iu,Ru[6]=Mu):Mu=Ru[6];const Lu=Pu||void 0,Bu=Ou||void 0;let ju;return Ru[7]!==$u||Ru[8]!==Du||Ru[9]!==Mu||Ru[10]!==Lu||Ru[11]!==Bu?(ju=jsxRuntimeExports.jsx(TextInputBaseWrapper,{ref:$u,className:Mu,"data-leading-visual":Lu,"data-trailing-visual":Bu,...Du}),Ru[7]=$u,Ru[8]=Du,Ru[9]=Mu,Ru[10]=Lu,Ru[11]=Bu,Ru[12]=ju):ju=Ru[12],ju});var styles$4={Input:"prc-components-Input-Ic-y8"};const UnstyledTextInput=vM.forwardRef(function(lo,$u){const Ru=distExports.c(9);let Iu,Pu;Ru[0]!==lo?({className:Iu,...Pu}=lo,Ru[0]=lo,Ru[1]=Iu,Ru[2]=Pu):(Iu=Ru[1],Pu=Ru[2]);let Ou;Ru[3]!==Iu?(Ou=clsx(Iu,styles$4.Input),Ru[3]=Iu,Ru[4]=Ou):Ou=Ru[4];let Du;return Ru[5]!==$u||Ru[6]!==Pu||Ru[7]!==Ou?(Du=jsxRuntimeExports.jsx(BoxWithFallback,{as:"input",ref:$u,...Pu,className:Ou}),Ru[5]=$u,Ru[6]=Pu,Ru[7]=Ou,Ru[8]=Du):Du=Ru[8],Du});UnstyledTextInput.displayName="UnstyledTextInput";var styles$3={Spinner:"prc-components-Spinner-Azb7p",SpinnerLeading:"prc-components-SpinnerLeading-s-LyA",SpinnerHidden:"prc-components-SpinnerHidden-GG1PJ",SpinnerVisible:"prc-components-SpinnerVisible-w5g8l",Box:"prc-components-Box-QK3tG"};const TextInputInnerVisualSlot=Au=>{const lo=distExports.c(17),{children:$u,hasLoadingIndicator:Ru,showLoadingIndicator:Iu,visualPosition:Pu,id:Ou}=Au,Du=Pu==="leading";if(!$u&&!Ru||Du&&!$u&&!Iu)return null;if(!Ru){let Vu;return lo[0]!==$u||lo[1]!==Ou?(Vu=jsxRuntimeExports.jsx("span",{className:"TextInput-icon",id:Ou,"aria-hidden":"true",children:$u}),lo[0]=$u,lo[1]=Ou,lo[2]=Vu):Vu=lo[2],Vu}let Mu;lo[3]!==$u||lo[4]!==Iu?(Mu=$u&&jsxRuntimeExports.jsx("div",{className:clsx(Iu?styles$3.SpinnerHidden:styles$3.SpinnerVisible),children:$u}),lo[3]=$u,lo[4]=Iu,lo[5]=Mu):Mu=lo[5];const Lu=Iu?styles$3.SpinnerVisible:styles$3.SpinnerHidden,Bu=$u&&styles$3.Spinner,ju=$u&&Du&&styles$3.SpinnerLeading;let Fu;lo[6]!==Lu||lo[7]!==Bu||lo[8]!==ju?(Fu=clsx(Lu,Bu,ju),lo[6]=Lu,lo[7]=Bu,lo[8]=ju,lo[9]=Fu):Fu=lo[9];const zu=$u?void 0:"small";let Uu;lo[10]!==Fu||lo[11]!==zu?(Uu=jsxRuntimeExports.jsx(StyledSpinner,{srText:null,className:Fu,size:zu}),lo[10]=Fu,lo[11]=zu,lo[12]=Uu):Uu=lo[12];let Hu;return lo[13]!==Ou||lo[14]!==Mu||lo[15]!==Uu?(Hu=jsxRuntimeExports.jsx("span",{className:"TextInput-icon",children:jsxRuntimeExports.jsxs("div",{className:styles$3.Box,id:Ou,children:[Mu,Uu]})}),lo[13]=Ou,lo[14]=Mu,lo[15]=Uu,lo[16]=Hu):Hu=lo[16],Hu};var styles$2={TextInputWrapper:"prc-TextInputWithTokens-TextInputWrapper-kj1cB",UnstyledTextInput:"prc-TextInputWithTokens-UnstyledTextInput-F582M",InputWrapper:"prc-TextInputWithTokens-InputWrapper-wloGg",Container:"prc-TextInputWithTokens-Container-mBzq-"};const overflowCountFontSizeMap={small:0,medium:1,large:1,xlarge:2};function TextInputWithTokensInnerComponent(Au,lo){const $u=distExports.c(139);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu,Zu,Ju,Yu,Xu,ed,td,nd,od,sd;$u[0]!==Au?({icon:Ru,leadingVisual:Iu,trailingVisual:Pu,loading:Bu,loaderPosition:Wu,contrast:Mu,className:Du,block:Ou,disabled:Lu,sx:Gu,tokens:ed,onTokenRemove:Uu,tokenComponent:Zu,preventTokenWrapping:Ju,size:Yu,hideTokenRemoveButtons:Xu,maxHeight:ju,width:sd,minWidth:zu,maxWidth:Fu,validationStatus:td,variant:nd,visibleTokenCount:od,style:Vu,...Hu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju,$u[10]=Fu,$u[11]=zu,$u[12]=Uu,$u[13]=Hu,$u[14]=Vu,$u[15]=Gu,$u[16]=Wu,$u[17]=Zu,$u[18]=Ju,$u[19]=Yu,$u[20]=Xu,$u[21]=ed,$u[22]=td,$u[23]=nd,$u[24]=od,$u[25]=sd):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9],Fu=$u[10],zu=$u[11],Uu=$u[12],Hu=$u[13],Vu=$u[14],Gu=$u[15],Wu=$u[16],Zu=$u[17],Ju=$u[18],Yu=$u[19],Xu=$u[20],ed=$u[21],td=$u[22],nd=$u[23],od=$u[24],sd=$u[25]);const ad=Wu===void 0?"auto":Wu,pd=Zu===void 0?Token$3:Zu,bd=Ju===void 0?!1:Ju,wd=Yu===void 0?"xlarge":Yu,_d=Xu===void 0?!1:Xu;let yd;$u[26]!==Hu?(yd=omit$1(Hu),$u[26]=Hu,$u[27]=yd):yd=$u[27];let Sd,kd,md,dd;$u[28]!==yd?({onBlur:kd,onFocus:md,onKeyDown:dd,...Sd}=yd,$u[28]=yd,$u[29]=Sd,$u[30]=kd,$u[31]=md,$u[32]=dd):(Sd=$u[29],kd=$u[30],md=$u[31],dd=$u[32]);const vd=reactExports.useRef(null);useRefObjectAsForwardedRef(lo,vd);const[ld,ud]=reactExports.useState(),[hd,gd]=reactExports.useState(!!od);let Ed;$u[33]!==ld?(Ed=[ld],$u[33]=ld,$u[34]=Ed):Ed=$u[34];const{containerRef:Td}=useFocusZone({focusOutBehavior:"wrap",bindKeys:FocusKeys.ArrowHorizontal|FocusKeys.HomeAndEnd,focusableElementFilter:_temp$3,getNextFocusable:np=>{var hp;if(!ld&&ld!==0)return;let gp=ld+1;return np==="next"&&(gp=gp+1),np==="previous"&&(gp=gp-1),gp>ed.length||gp<1?vd.current||void 0:(hp=Rd.current)===null||hp===void 0?void 0:hp.children[gp]}},Ed),Rd=Td;let jd;$u[35]!==Rd||$u[36]!==Uu||$u[37]!==ld?(jd=np=>{Uu(np),setTimeout(()=>{var hp,gp;const Jh=(hp=Rd.current)===null||hp===void 0?void 0:hp.children[ld||0],_p=Jh&&isFocusable$2(Jh)?Jh:Array.from(((gp=Rd.current)===null||gp===void 0?void 0:gp.children)||[]).find(_temp2$2);if(_p)_p.focus();else{var sp;(sp=vd.current)===null||sp===void 0||sp.focus()}},0)},$u[35]=Rd,$u[36]=Uu,$u[37]=ld,$u[38]=jd):jd=$u[38];const Cd=jd;let $d;$u[39]!==Lu?($d=np=>()=>{Lu||ud(np)},$u[39]=Lu,$u[40]=$d):$d=$u[40];const Id=$d;let Vd;$u[41]!==Rd||$u[42]!==od?(Vd=()=>{ud(void 0),setTimeout(()=>{var np;!((np=Rd.current)!==null&&np!==void 0&&np.contains(document.activeElement))&&od&&gd(!0)},0)},$u[41]=Rd,$u[42]=od,$u[43]=Vd):Vd=$u[43];const Dd=Vd;let Wd;$u[44]===Symbol.for("react.memo_cache_sentinel")?(Wd=np=>{if(np.key==="Escape"){var hp;(hp=vd.current)===null||hp===void 0||hp.focus()}},$u[44]=Wd):Wd=$u[44];const oh=Wd;let rh;$u[45]!==md||$u[46]!==od?(rh=np=>{md&&md(np),ud(void 0),od&&gd(!1)},$u[45]=md,$u[46]=od,$u[47]=rh):rh=$u[47];const Eh=rh;let ah;$u[48]!==Rd||$u[49]!==kd||$u[50]!==od?(ah=np=>{kd&&kd(np),setTimeout(()=>{var hp;!((hp=Rd.current)!==null&&hp!==void 0&&hp.contains(document.activeElement))&&od&&gd(!0)},0)},$u[48]=Rd,$u[49]=kd,$u[50]=od,$u[51]=ah):ah=$u[51];const yh=ah;let vh;$u[52]!==Cd||$u[53]!==dd||$u[54]!==ed?(vh=np=>{var hp;if(dd&&dd(np),(hp=vd.current)!==null&&hp!==void 0&&hp.value)return;const gp=ed[ed.length-1];np.key==="Backspace"&&gp&&(Cd(gp.id),vd.current&&(vd.current.value=`${gp.text} `),setTimeout(()=>{var Jh;(Jh=vd.current)===null||Jh===void 0||Jh.select()},0))},$u[52]=Cd,$u[53]=dd,$u[54]=ed,$u[55]=vh):vh=$u[55];const Jd=vh;let Qd;$u[56]===Symbol.for("react.memo_cache_sentinel")?(Qd=()=>{var np;(np=vd.current)===null||np===void 0||np.focus()},$u[56]=Qd):Qd=$u[56];const sh=Qd,Oh=_temp3$1;let qd;$u[57]!==ed||$u[58]!==hd||$u[59]!==od?(qd=hd?ed.slice(0,od):ed,$u[57]=ed,$u[58]=hd,$u[59]=od,$u[60]=qd):qd=$u[60];const zd=qd;let Pd;$u[61]===Symbol.for("react.memo_cache_sentinel")?(Pd={small:"small",medium:"small",large:"medium",xlarge:"medium"},$u[61]=Pd):Pd=$u[61];const Od=Pd,Gd=Bu&&(ad==="leading"||!!(Iu&&ad!=="trailing")),Md=Bu&&(ad==="trailing"||ad==="auto"&&!Iu),Kd=!!(Iu||Gd),Xd=!!(Pu||Md),ph=Od[wd],_h=!!(bd||ju)||void 0;let Sh;$u[62]!==Du?(Sh=clsx(Du,styles$2.TextInputWrapper),$u[62]=Du,$u[63]=Sh):Sh=$u[63];let Wh;$u[64]!==ju||$u[65]!==Vu?(Wh=ju?{maxHeight:ju,...Vu}:Vu,$u[64]=ju,$u[65]=Vu,$u[66]=Wh):Wh=$u[66];let Nd;$u[67]!==Ru||$u[68]!==Iu?(Nd=Ru&&!Iu&&jsxRuntimeExports.jsx(Ru,{className:"TextInput-icon"}),$u[67]=Ru,$u[68]=Iu,$u[69]=Nd):Nd=$u[69];const xd=typeof Bu=="boolean";let Hd;$u[70]!==Iu?(Hd=typeof Iu!="string"&&reactIsExports.isValidElementType(Iu)?jsxRuntimeExports.jsx(Iu,{}):Iu,$u[70]=Iu,$u[71]=Hd):Hd=$u[71];let Zd;$u[72]!==Gd||$u[73]!==xd||$u[74]!==Hd?(Zd=jsxRuntimeExports.jsx(TextInputInnerVisualSlot,{hasLoadingIndicator:xd,visualPosition:"leading",showLoadingIndicator:Gd,children:Hd}),$u[72]=Gd,$u[73]=xd,$u[74]=Hd,$u[75]=Zd):Zd=$u[75];const gh=Rd,Ch=td==="error"?"true":"false";let wh;$u[76]!==Lu||$u[77]!==yh||$u[78]!==Eh||$u[79]!==Jd||$u[80]!==Sd||$u[81]!==Ch?(wh=jsxRuntimeExports.jsx("div",{className:styles$2.InputWrapper,children:jsxRuntimeExports.jsx(UnstyledTextInput,{ref:vd,disabled:Lu,onFocus:Eh,onBlur:yh,onKeyDown:Jd,type:"text",className:styles$2.UnstyledTextInput,"aria-invalid":Ch,...Sd})}),$u[76]=Lu,$u[77]=yh,$u[78]=Eh,$u[79]=Jd,$u[80]=Sd,$u[81]=Ch,$u[82]=wh):wh=$u[82];let Th;if($u[83]!==pd||$u[84]!==Lu||$u[85]!==Dd||$u[86]!==Id||$u[87]!==Cd||$u[88]!==_d||$u[89]!==ld||$u[90]!==wd||$u[91]!==zd){let np;$u[93]!==pd||$u[94]!==Lu||$u[95]!==Dd||$u[96]!==Id||$u[97]!==Cd||$u[98]!==_d||$u[99]!==ld||$u[100]!==wd?(np=(hp,gp)=>{const{id:Jh,..._p}=hp;return jsxRuntimeExports.jsx(pd,{disabled:Lu,onFocus:Id(gp),onBlur:Dd,onKeyUp:oh,onClick:Oh,isSelected:ld===gp,onRemove:()=>{Cd(Jh)},hideRemoveButton:Lu||_d,size:wd,tabIndex:0,..._p},Jh)},$u[93]=pd,$u[94]=Lu,$u[95]=Dd,$u[96]=Id,$u[97]=Cd,$u[98]=_d,$u[99]=ld,$u[100]=wd,$u[101]=np):np=$u[101],Th=zd.map(np),$u[83]=pd,$u[84]=Lu,$u[85]=Dd,$u[86]=Id,$u[87]=Cd,$u[88]=_d,$u[89]=ld,$u[90]=wd,$u[91]=zd,$u[92]=Th}else Th=$u[92];let $h;$u[102]!==wd||$u[103]!==ed||$u[104]!==hd||$u[105]!==zd.length?($h=hd&&ed.length-zd.length?jsxRuntimeExports.jsxs(Text$3,{color:"fg.muted",fontSize:overflowCountFontSizeMap[wd],children:["+",ed.length-zd.length]}):null,$u[102]=wd,$u[103]=ed,$u[104]=hd,$u[105]=zd.length,$u[106]=$h):$h=$u[106];let xh;$u[107]!==bd||$u[108]!==gh||$u[109]!==wh||$u[110]!==Th||$u[111]!==$h?(xh=jsxRuntimeExports.jsxs("div",{ref:gh,className:styles$2.Container,"data-prevent-token-wrapping":bd,children:[wh,Th,$h]}),$u[107]=bd,$u[108]=gh,$u[109]=wh,$u[110]=Th,$u[111]=$h,$u[112]=xh):xh=$u[112];const Ph=typeof Bu=="boolean";let Kh;$u[113]!==Pu?(Kh=typeof Pu!="string"&&reactIsExports.isValidElementType(Pu)?jsxRuntimeExports.jsx(Pu,{}):Pu,$u[113]=Pu,$u[114]=Kh):Kh=$u[114];let Dh;$u[115]!==Md||$u[116]!==Ph||$u[117]!==Kh?(Dh=jsxRuntimeExports.jsx(TextInputInnerVisualSlot,{hasLoadingIndicator:Ph,visualPosition:"trailing",showLoadingIndicator:Md,children:Kh}),$u[115]=Md,$u[116]=Ph,$u[117]=Kh,$u[118]=Dh):Dh=$u[118];let ep;return $u[119]!==Ou||$u[120]!==Mu||$u[121]!==Lu||$u[122]!==Fu||$u[123]!==zu||$u[124]!==Gu||$u[125]!==Kd||$u[126]!==Xd||$u[127]!==ph||$u[128]!==_h||$u[129]!==Sh||$u[130]!==Wh||$u[131]!==Nd||$u[132]!==Zd||$u[133]!==xh||$u[134]!==Dh||$u[135]!==td||$u[136]!==nd||$u[137]!==sd?(ep=jsxRuntimeExports.jsxs(TextInputWrapper,{block:Ou,contrast:Mu,disabled:Lu,hasLeadingVisual:Kd,hasTrailingVisual:Xd,width:sd,minWidth:zu,maxWidth:Fu,size:ph,validationStatus:td,variant:nd,onClick:sh,"data-token-wrapping":_h,className:Sh,style:Wh,sx:Gu,children:[Nd,Zd,xh,Dh]}),$u[119]=Ou,$u[120]=Mu,$u[121]=Lu,$u[122]=Fu,$u[123]=zu,$u[124]=Gu,$u[125]=Kd,$u[126]=Xd,$u[127]=ph,$u[128]=_h,$u[129]=Sh,$u[130]=Wh,$u[131]=Nd,$u[132]=Zd,$u[133]=xh,$u[134]=Dh,$u[135]=td,$u[136]=nd,$u[137]=sd,$u[138]=ep):ep=$u[138],ep}function _temp3$1(Au){Au.stopPropagation()}function _temp2$2(Au){return isFocusable$2(Au)}function _temp$3(Au){return!Au.getAttributeNames().includes("aria-hidden")}const TextInputWithTokens=vM.forwardRef(TextInputWithTokensInnerComponent);TextInputWithTokens.displayName="TextInputWithTokens";const CheckboxGroupContext=reactExports.createContext({});var classes$d={Checkbox:"prc-Checkbox-Checkbox-gIwWX"};const Checkbox=vM.forwardRef(({checked:Au,className:lo,defaultChecked:$u,indeterminate:Ru,disabled:Iu,onChange:Pu,sx:Ou,required:Du,validationStatus:Mu,value:Lu,...Bu},ju)=>{const Fu=useProvidedRefOrCreate(ju),zu=reactExports.useContext(CheckboxGroupContext),Hu={type:"checkbox",disabled:Iu,ref:Fu,checked:Ru?!1:Au,defaultChecked:$u,required:Du,"aria-required":Du?"true":"false","aria-invalid":Mu==="error"?"true":"false",onChange:Vu=>{zu.onChange&&zu.onChange(Vu),Pu&&Pu(Vu)},value:Lu,name:Lu,...Bu};return useIsomorphicLayoutEffect$2(()=>{Fu.current&&(Fu.current.indeterminate=Ru||!1)},[Ru,Au,Fu]),reactExports.useEffect(()=>{const{current:Vu}=Fu;Vu&&(Ru?Vu.setAttribute("aria-checked","mixed"):Vu.setAttribute("aria-checked",Vu.checked?"true":"false"))}),Ou?jsxRuntimeExports.jsx(Box$1,{as:"input",...Hu,className:clsx(lo,sharedClasses.Input,classes$d.Checkbox),sx:Ou}):jsxRuntimeExports.jsx("input",{...Hu,className:clsx(lo,sharedClasses.Input,classes$d.Checkbox)})});Checkbox.displayName="Checkbox";var classes$c={TextArea:"prc-Textarea-TextArea-13q4j"};const DEFAULT_TEXTAREA_ROWS=7,DEFAULT_TEXTAREA_COLS=30,DEFAULT_TEXTAREA_RESIZE="both",Textarea=vM.forwardRef((Au,lo)=>{const $u=distExports.c(39);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu;$u[0]!==Au?({value:Gu,disabled:Ou,sx:Fu,required:Lu,validationStatus:Vu,rows:zu,cols:Uu,resize:Hu,block:Ru,contrast:Pu,className:Iu,minHeight:Mu,maxHeight:Du,style:ju,...Bu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju,$u[10]=Fu,$u[11]=zu,$u[12]=Uu,$u[13]=Hu,$u[14]=Vu,$u[15]=Gu):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9],Fu=$u[10],zu=$u[11],Uu=$u[12],Hu=$u[13],Vu=$u[14],Gu=$u[15]);const Wu=zu===void 0?DEFAULT_TEXTAREA_ROWS:zu,Zu=Uu===void 0?DEFAULT_TEXTAREA_COLS:Uu,Ju=Hu===void 0?DEFAULT_TEXTAREA_RESIZE:Hu,Yu=Vu==="error"?"true":"false";let Xu;$u[16]!==Du||$u[17]!==Mu||$u[18]!==ju?(Xu={minHeight:Mu,maxHeight:Du,...ju},$u[16]=Du,$u[17]=Mu,$u[18]=ju,$u[19]=Xu):Xu=$u[19];let ed;$u[20]!==Zu||$u[21]!==Ou||$u[22]!==lo||$u[23]!==Lu||$u[24]!==Ju||$u[25]!==Bu||$u[26]!==Wu||$u[27]!==Yu||$u[28]!==Xu||$u[29]!==Gu?(ed=jsxRuntimeExports.jsx("textarea",{value:Gu,"data-resize":Ju,"aria-required":Lu,"aria-invalid":Yu,ref:lo,disabled:Ou,rows:Wu,cols:Zu,className:classes$c.TextArea,style:Xu,...Bu}),$u[20]=Zu,$u[21]=Ou,$u[22]=lo,$u[23]=Lu,$u[24]=Ju,$u[25]=Bu,$u[26]=Wu,$u[27]=Yu,$u[28]=Xu,$u[29]=Gu,$u[30]=ed):ed=$u[30];let td;return $u[31]!==Ru||$u[32]!==Iu||$u[33]!==Pu||$u[34]!==Ou||$u[35]!==Fu||$u[36]!==ed||$u[37]!==Vu?(td=jsxRuntimeExports.jsx(TextInputBaseWrapper,{sx:Fu,validationStatus:Vu,disabled:Ou,block:Ru,contrast:Pu,className:Iu,children:ed}),$u[31]=Ru,$u[32]=Iu,$u[33]=Pu,$u[34]=Ou,$u[35]=Fu,$u[36]=ed,$u[37]=Vu,$u[38]=td):td=$u[38],td});Textarea.displayName="Textarea";const AutocompleteContext=reactExports.createContext(null);var styles$1={Invisible:"prc-components-Invisible-uIWry",TextInputAction:"prc-components-TextInputAction-YT3YI",ConditionalTooltip:"prc-components-ConditionalTooltip-6cihH"};const ConditionalTooltip=Au=>{const lo=distExports.c(6),{"aria-label":$u,children:Ru,tooltipDirection:Iu}=Au;let Pu;lo[0]!==$u||lo[1]!==Ru||lo[2]!==Iu?(Pu=$u?jsxRuntimeExports.jsx(Tooltip,{text:$u,direction:Iu,className:styles$1.ConditionalTooltip,children:Ru}):Ru,lo[0]=$u,lo[1]=Ru,lo[2]=Iu,lo[3]=Pu):Pu=lo[3];let Ou;return lo[4]!==Pu?(Ou=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Pu}),lo[4]=Pu,lo[5]=Ou):Ou=lo[5],Ou},TextInputAction=reactExports.forwardRef((Au,lo)=>{const $u=distExports.c(32);let Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;$u[0]!==Au?({"aria-label":Ru,"aria-labelledby":Iu,tooltipDirection:ju,children:Pu,icon:Du,sx:Lu,className:Ou,variant:Bu,...Mu}=Au,$u[0]=Au,$u[1]=Ru,$u[2]=Iu,$u[3]=Pu,$u[4]=Ou,$u[5]=Du,$u[6]=Mu,$u[7]=Lu,$u[8]=Bu,$u[9]=ju):(Ru=$u[1],Iu=$u[2],Pu=$u[3],Ou=$u[4],Du=$u[5],Mu=$u[6],Lu=$u[7],Bu=$u[8],ju=$u[9]);const Fu=Bu===void 0?"invisible":Bu,zu=Fu==="invisible"&&styles$1.Invisible;let Uu;$u[10]!==Ou||$u[11]!==zu?(Uu=clsx(zu,Ou),$u[10]=Ou,$u[11]=zu,$u[12]=Uu):Uu=$u[12];let Hu;$u[13]!==Lu?(Hu=Lu||{},$u[13]=Lu,$u[14]=Hu):Hu=$u[14];let Vu;$u[15]!==Uu||$u[16]!==Hu?(Vu={className:Uu,sx:Hu},$u[15]=Uu,$u[16]=Hu,$u[17]=Vu):Vu=$u[17];const Gu=Vu;(Du&&!Ru||!Pu&&!Ru)&&console.warn("Use the `aria-label` prop to provide an accessible label for assistive technology");let Wu;$u[18]!==Ru||$u[19]!==Iu?(Wu=Ru?{"aria-label":Ru}:Iu?{"aria-labelledby":Iu}:{"aria-label":""},$u[18]=Ru,$u[19]=Iu,$u[20]=Wu):Wu=$u[20];const Zu=Wu;let Ju;$u[21]===Symbol.for("react.memo_cache_sentinel")?(Ju=clsx("TextInput-action",styles$1.TextInputAction),$u[21]=Ju):Ju=$u[21];let Yu;if($u[22]!==Zu||$u[23]!==Ru||$u[24]!==Pu||$u[25]!==lo||$u[26]!==Du||$u[27]!==Mu||$u[28]!==Gu||$u[29]!==ju||$u[30]!==Fu){var Xu;Yu=jsxRuntimeExports.jsx("span",{className:Ju,children:Du&&!Pu&&Ru?jsxRuntimeExports.jsx(IconButton,{...Zu,tooltipDirection:(Xu=ju)!==null&&Xu!==void 0?Xu:"s",variant:Fu,type:"button",icon:Du,size:"small",...Gu,...Mu,ref:lo}):jsxRuntimeExports.jsx(ConditionalTooltip,{"aria-label":Ru,children:jsxRuntimeExports.jsx(ButtonComponent,{variant:Fu,type:"button",...Gu,...Mu,ref:lo,children:Pu})})}),$u[22]=Zu,$u[23]=Ru,$u[24]=Pu,$u[25]=lo,$u[26]=Du,$u[27]=Mu,$u[28]=Gu,$u[29]=ju,$u[30]=Fu,$u[31]=Yu}else Yu=$u[31];return Yu}),TextInput=vM.forwardRef(({icon:Au,leadingVisual:lo,trailingVisual:$u,trailingAction:Ru,block:Iu,className:Pu,contrast:Ou,disabled:Du,loading:Mu,loaderPosition:Lu="auto",loaderText:Bu="Loading",monospace:ju,validationStatus:Fu,sx:zu,size:Uu,onFocus:Hu,onBlur:Vu,width:Gu,minWidth:Wu,maxWidth:Zu,variant:Ju,type:Yu="text",required:Xu,...ed},td)=>{const[nd,od]=reactExports.useState(!1),sd=useProvidedRefOrCreate(td),ad=clsx(Pu,"TextInput-wrapper"),pd=Mu&&(Lu==="leading"||!!(lo&&Lu!=="trailing")),bd=Mu&&(Lu==="trailing"||Lu==="auto"&&!lo),wd=()=>{var vd;(vd=sd.current)===null||vd===void 0||vd.focus()},_d=reactExports.useId(),yd=reactExports.useId(),Sd=reactExports.useId(),kd=clsx(ed["aria-describedby"],lo&&_d,$u&&yd,Mu&&Sd)||void 0,md=reactExports.useCallback(vd=>{od(!0),Hu&&Hu(vd)},[Hu]),dd=reactExports.useCallback(vd=>{od(!1),Vu&&Vu(vd)},[Vu]);return jsxRuntimeExports.jsxs(TextInputWrapper,{block:Iu,className:ad,validationStatus:Fu,contrast:Ou,disabled:Du,monospace:ju,sx:zu,size:Uu,width:Gu,minWidth:Wu,maxWidth:Zu,variant:Ju,hasLeadingVisual:!!(lo||pd),hasTrailingVisual:!!($u||bd),hasTrailingAction:!!Ru,isInputFocused:nd,onClick:wd,"aria-busy":!!Mu,children:[Au&&jsxRuntimeExports.jsx(Au,{className:"TextInput-icon"}),jsxRuntimeExports.jsx(TextInputInnerVisualSlot,{visualPosition:"leading",showLoadingIndicator:pd,hasLoadingIndicator:typeof Mu=="boolean",id:_d,children:typeof lo!="string"&&reactIsExports.isValidElementType(lo)?jsxRuntimeExports.jsx(lo,{}):lo}),jsxRuntimeExports.jsx(UnstyledTextInput,{ref:sd,disabled:Du,onFocus:md,onBlur:dd,type:Yu,"aria-required":Xu,"aria-invalid":Fu==="error"?"true":void 0,...ed,"aria-describedby":kd,"data-component":"input"}),Mu&&jsxRuntimeExports.jsx(VisuallyHidden,{id:Sd,children:Bu}),jsxRuntimeExports.jsx(TextInputInnerVisualSlot,{visualPosition:"trailing",showLoadingIndicator:bd,hasLoadingIndicator:typeof Mu=="boolean",id:yd,"data-testid":"text-input-trailing-visual",children:typeof $u!="string"&&reactIsExports.isValidElementType($u)?jsxRuntimeExports.jsx($u,{}):$u}),Ru]})});TextInput.displayName="TextInput";var TextInput$1=Object.assign(TextInput,{Action:TextInputAction});const ARROW_KEYS_NAV=new Set(["ArrowUp","ArrowDown"]),AutocompleteInput=vM.forwardRef(({as:Au=TextInput$1,onFocus:lo,onBlur:$u,onChange:Ru,onKeyDown:Iu,onKeyUp:Pu,onKeyPress:Ou,value:Du,openOnFocus:Mu=!1,...Lu},Bu)=>{const ju=reactExports.useContext(AutocompleteContext);if(ju===null)throw new Error("AutocompleteContext returned null values");const{activeDescendantRef:Fu,autocompleteSuggestion:zu="",id:Uu,inputRef:Hu,inputValue:Vu="",isMenuDirectlyActivated:Gu,setInputValue:Wu,setShowMenu:Zu,showMenu:Ju}=ju;useRefObjectAsForwardedRef(Bu,Hu);const[Yu,Xu]=reactExports.useState(!0),{safeSetTimeout:ed}=useSafeTimeout(),td=bd=>{lo?.(bd),Mu&&Zu(!0)},nd=reactExports.useCallback(bd=>{$u&&$u(bd),ed(()=>{document.activeElement!==Hu.current&&Zu(!1)},0)},[$u,Zu,Hu,ed]),od=bd=>{Ru&&Ru(bd),Wu(bd.currentTarget.value),Ju||Zu(!0)},sd=reactExports.useCallback(bd=>{var wd;Iu&&Iu(bd),bd.key==="Backspace"&&Xu(!1),bd.key==="Escape"&&(wd=Hu.current)!==null&&wd!==void 0&&wd.value&&(Wu(""),Hu.current.value=""),!Ju&&ARROW_KEYS_NAV.has(bd.key)&&!bd.altKey&&Zu(!0)},[Hu,Wu,Xu,Iu,Ju,Zu]),ad=reactExports.useCallback(bd=>{Pu&&Pu(bd),bd.key==="Backspace"&&Xu(!0)},[Xu,Pu]),pd=reactExports.useCallback(bd=>{if(Ou&&Ou(bd),Ju&&bd.key==="Enter"&&Fu.current){bd.preventDefault(),bd.nativeEvent.stopImmediatePropagation();const wd=new KeyboardEvent(bd.type,bd.nativeEvent);Fu.current.dispatchEvent(wd)}},[Fu,Ju,Ou]);return reactExports.useEffect(()=>{Hu.current&&(zu||(Hu.current.value=Vu),Yu&&zu&&(Vu||Gu)&&(Hu.current.value=zu,zu.toLowerCase().indexOf(Vu.toLowerCase())===0&&Hu.current.setSelectionRange(Vu.length,zu.length)))},[zu,Vu,Hu,Gu]),reactExports.useEffect(()=>{Wu(typeof Du<"u"?Du.toString():"")},[Du,Wu]),jsxRuntimeExports.jsx(Au,{onFocus:td,onBlur:nd,onChange:od,onKeyDown:sd,onKeyPress:pd,onKeyUp:ad,ref:Hu,"aria-controls":`${Uu}-listbox`,"aria-autocomplete":"both",role:"combobox","aria-expanded":Ju,"aria-haspopup":"listbox","aria-owns":`${Uu}-listbox`,autoComplete:"off",id:Uu,...Lu})});AutocompleteInput.displayName="AutocompleteInput";function throttle(Au,lo=0,{start:$u=!0,middle:Ru=!0,once:Iu=!1}={}){let Pu=$u,Ou=0,Du,Mu=!1;function Lu(...Bu){if(Mu)return;const ju=Date.now()-Ou;Ou=Date.now(),$u&&Ru&&ju>=lo&&(Pu=!0),Pu?(Pu=!1,Au.apply(this,Bu),Iu&&Lu.cancel()):(Ru&&ju<lo||!Ru)&&(clearTimeout(Du),Du=setTimeout(()=>{Ou=Date.now(),Au.apply(this,Bu),Iu&&Lu.cancel()},Ru?lo-ju:lo))}return Lu.cancel=()=>{clearTimeout(Du),Mu=!0},Lu}function debounce(Au,lo=0,{start:$u=!1,middle:Ru=!1,once:Iu=!1}={}){return throttle(Au,lo,{start:$u,middle:Ru,once:Iu})}var classes$b={SpinnerWrapper:"prc-Autocomplete-SpinnerWrapper-OvHpT",EmptyStateWrapper:"prc-Autocomplete-EmptyStateWrapper-tAx1w"};const getDefaultSortFn=Au=>(lo,$u)=>Au(lo)===Au($u)?0:Au(lo)?-1:1,menuScrollMargins$1={startMargin:0,endMargin:8};function getDefaultItemFilter(Au){return function(lo,$u){var Ru;return!!(!((Ru=lo.text)===null||Ru===void 0)&&Ru.toLowerCase().startsWith(Au.toLowerCase()))}}function getdefaultCheckedSelectionChange(Au){return function(lo){const{text:$u=""}=Array.isArray(lo)?lo.slice(-1)[0]:lo;Au($u)}}const isItemSelected=(Au,lo)=>lo.includes(Au);function getItemById(Au,lo){return lo.find($u=>$u.id===Au)}const debounceAnnouncement=debounce(Au=>{announce(Au)},250);function AutocompleteMenu(Au){const lo=reactExports.useContext(AutocompleteContext);if(lo===null)throw new Error("AutocompleteContext returned null values");const{activeDescendantRef:$u,id:Ru,inputRef:Iu,inputValue:Pu="",scrollContainerRef:Ou,setAutocompleteSuggestion:Du,setShowMenu:Mu,setInputValue:Lu,setIsMenuDirectlyActivated:Bu,setSelectedItemLength:ju,showMenu:Fu}=lo,{items:zu,selectedItemIds:Uu,sortOnCloseFn:Hu,emptyStateText:Vu="No selectable options",addNewItem:Gu,loading:Wu,selectionVariant:Zu="single",filterFn:Ju,"aria-labelledby":Yu,onOpenChange:Xu,onSelectedChange:ed,customScrollContainerRef:td}=Au,nd=reactExports.useRef(null),od=reactExports.useRef([]),[sd,ad]=reactExports.useState(),[pd,bd]=reactExports.useState(zu.map(({id:md})=>md)),wd=useId(Ru),_d=reactExports.useMemo(()=>zu.map(md=>({...md,role:"option",id:md.id,active:sd?.id===md.id,selected:Zu==="multiple"?Uu.includes(md.id):void 0,onAction:dd=>{const vd=Uu.filter(gd=>gd!==dd.id),ld=Uu.includes(dd.id)?vd:[...vd,dd.id];if((ed||getdefaultCheckedSelectionChange(Lu))(ld.map(gd=>getItemById(gd,zu))),Zu==="multiple")Lu(""),Du("");else{var hd;Mu(!1),(hd=Iu.current)===null||hd===void 0||hd.setSelectionRange(Iu.current.value.length,Iu.current.value.length)}}})),[sd,zu,Uu,Iu,ed,Zu,Du,Lu,Mu]),yd=reactExports.useMemo(()=>pd.reduce((md,dd,vd)=>(md[dd]=vd,md),{}),[pd]),Sd=reactExports.useMemo(()=>_d.filter(Ju||getDefaultItemFilter(Pu)).sort((md,dd)=>yd[md.id]-yd[dd.id]),[_d,yd,Ju,Pu]),kd=reactExports.useMemo(()=>[...Sd,...Gu?[{...Gu,role:"option",key:Gu.id,active:sd?.id===Gu.id,selected:Zu==="multiple"?Uu.includes(Gu.id):void 0,leadingVisual:()=>jsxRuntimeExports.jsx(PlusIcon,{}),onAction:md=>{Gu.handleAddItem({...md,id:md.id||wd,leadingVisual:void 0}),Zu==="multiple"&&(Lu(""),Du(""))}}]:[]],[Sd,Gu,Du,Zu,Lu,wd,sd,Uu]);if(vM.useEffect(()=>{od.current=kd}),vM.useEffect(()=>{kd.length===0&&debounceAnnouncement(Vu)},[kd,Vu]),useFocusZone({containerRef:nd,focusOutBehavior:"wrap",focusableElementFilter:md=>!(md instanceof HTMLInputElement),activeDescendantFocus:Iu,onActiveDescendantChanged:(md,dd,vd)=>{if($u.current=md||null,md){const ld=od.current.find(ud=>{var hd;return ud.id===((hd=md.closest("li"))===null||hd===void 0?void 0:hd.getAttribute("data-id"))});ad(ld),Bu(vd)}md&&td&&td.current&&vd?scrollIntoView$2(md,td.current,menuScrollMargins$1):md&&Ou.current&&vd&&scrollIntoView$2(md,Ou.current,menuScrollMargins$1)}},[Wu]),reactExports.useEffect(()=>{var md;sd!=null&&(md=sd.text)!==null&&md!==void 0&&md.startsWith(Pu)&&!Uu.includes(sd.id)?Du(sd.text):Du("")},[sd,Pu,Uu,Du]),reactExports.useEffect(()=>{const md=[...pd].sort(Hu||getDefaultSortFn(vd=>isItemSelected(vd,Uu))),dd=md.length===pd.length&&md.every((vd,ld)=>vd===pd[ld]);Fu===!1&&!dd&&bd(md),Xu&&Xu(!!Fu)},[Fu,Xu,Uu,Hu,pd]),reactExports.useEffect(()=>{Uu.length&&ju(Uu.length)},[Uu,ju]),Zu==="single"&&Uu.length>1)throw new Error('Autocomplete: selectionVariant "single" cannot be used with multiple selected items');return jsxRuntimeExports.jsx(VisuallyHidden,{isVisible:Fu,children:Wu?jsxRuntimeExports.jsx("div",{className:classes$b.SpinnerWrapper,children:jsxRuntimeExports.jsx(StyledSpinner,{})}):jsxRuntimeExports.jsx("div",{ref:nd,children:kd.length?jsxRuntimeExports.jsx(ActionList,{selectionVariant:Zu,role:"listbox",id:`${Ru}-listbox`,"aria-labelledby":Yu,children:kd.map(md=>{const{id:dd,onAction:vd,children:ld,text:ud,leadingVisual:hd,trailingVisual:gd,key:Ed,...Td}=md;return jsxRuntimeExports.jsxs(ActionList.Item,{onSelect:()=>vd(md),...Td,id:dd,"data-id":dd,children:[hd&&jsxRuntimeExports.jsx(ActionList.LeadingVisual,{children:reactIsExports.isElement(hd)?hd:jsxRuntimeExports.jsx(hd,{})}),ld??ud,gd&&jsxRuntimeExports.jsx(ActionList.TrailingVisual,{children:reactIsExports.isElement(gd)?gd:jsxRuntimeExports.jsx(gd,{})})]},Ed??dd)})}):Vu!==!1&&Vu!==null?jsxRuntimeExports.jsx("div",{className:classes$b.EmptyStateWrapper,children:Vu}):null})})}AutocompleteMenu.displayName="AutocompleteMenu";AutocompleteMenu.displayName="AutocompleteMenu";var classes$a={Overlay:"prc-Autocomplete-Overlay-4kapX"};function AutocompleteOverlay(Au){const lo=distExports.c(24);let $u,Ru,Iu,Pu;lo[0]!==Au?({menuAnchorRef:Ru,overlayProps:Pu,children:$u,...Iu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4]);const Ou=reactExports.useContext(AutocompleteContext);if(Ou===null)throw new Error("AutocompleteContext returned null values");let Du;lo[5]!==Iu||lo[6]!==Pu?(Du={...Pu,...Iu},lo[5]=Iu,lo[6]=Pu,lo[7]=Du):Du=lo[7];const Mu=Du,{inputRef:Lu,scrollContainerRef:Bu,selectedItemLength:ju,setShowMenu:Fu,showMenu:zu}=Ou,Uu=zu===void 0?!1:zu,Hu=Ru||Lu;let Vu;lo[8]!==Hu?(Vu={side:"outside-bottom",align:"start",anchorElementRef:Hu},lo[8]=Hu,lo[9]=Vu):Vu=lo[9];let Gu;lo[10]!==ju||lo[11]!==Uu?(Gu=[Uu,ju],lo[10]=ju,lo[11]=Uu,lo[12]=Gu):Gu=lo[12];const{floatingElementRef:Wu,position:Zu}=useAnchoredPosition(Vu,Gu);useRefObjectAsForwardedRef(Bu,Wu);let Ju;lo[13]!==Fu?(Ju=()=>{Fu(!1)},lo[13]=Fu,lo[14]=Ju):Ju=lo[14];const Yu=Ju;if(typeof window>"u")return null;let Xu;return lo[15]!==$u||lo[16]!==Yu||lo[17]!==Wu||lo[18]!==Lu||lo[19]!==Mu||lo[20]!==Zu?.left||lo[21]!==Zu?.top||lo[22]!==Uu?(Xu=Uu?jsxRuntimeExports.jsx(Overlay$1,{returnFocusRef:Lu,preventFocusOnOpen:!0,onClickOutside:Yu,onEscape:Yu,ref:Wu,top:Zu?.top,left:Zu?.left,className:classes$a.Overlay,...Mu,children:$u}):jsxRuntimeExports.jsx(VisuallyHidden,{"aria-hidden":"true",children:$u}),lo[15]=$u,lo[16]=Yu,lo[17]=Wu,lo[18]=Lu,lo[19]=Mu,lo[20]=Zu?.left,lo[21]=Zu?.top,lo[22]=Uu,lo[23]=Xu):Xu=lo[23],Xu}AutocompleteOverlay.displayName="AutocompleteOverlay";const initialState$2={inputValue:"",showMenu:!1,isMenuDirectlyActivated:!1,autocompleteSuggestion:"",selectedItemLength:0},reducer=(Au,lo)=>{const{type:$u,payload:Ru}=lo;switch($u){case"inputValue":return{...Au,inputValue:Ru};case"showMenu":return{...Au,showMenu:Ru};case"isMenuDirectlyActivated":return{...Au,isMenuDirectlyActivated:Ru};case"autocompleteSuggestion":return{...Au,autocompleteSuggestion:Ru};case"selectedItemLength":return{...Au,selectedItemLength:Ru};default:return Au}},Autocomplete=Au=>{const lo=distExports.c(15),{children:$u,id:Ru}=Au,Iu=reactExports.useRef(null),Pu=reactExports.useRef(null),Ou=reactExports.useRef(null),[Du,Mu]=reactExports.useReducer(reducer,initialState$2),{inputValue:Lu,showMenu:Bu,autocompleteSuggestion:ju,isMenuDirectlyActivated:Fu,selectedItemLength:zu}=Du;let Uu;lo[0]===Symbol.for("react.memo_cache_sentinel")?(Uu=sd=>{Mu({type:"inputValue",payload:sd})},lo[0]=Uu):Uu=lo[0];const Hu=Uu;let Vu;lo[1]===Symbol.for("react.memo_cache_sentinel")?(Vu=sd=>{Mu({type:"showMenu",payload:sd})},lo[1]=Vu):Vu=lo[1];const Gu=Vu;let Wu;lo[2]===Symbol.for("react.memo_cache_sentinel")?(Wu=sd=>{Mu({type:"autocompleteSuggestion",payload:sd})},lo[2]=Wu):Wu=lo[2];const Zu=Wu;let Ju;lo[3]===Symbol.for("react.memo_cache_sentinel")?(Ju=sd=>{Mu({type:"isMenuDirectlyActivated",payload:sd})},lo[3]=Ju):Ju=lo[3];const Yu=Ju;let Xu;lo[4]===Symbol.for("react.memo_cache_sentinel")?(Xu=sd=>{Mu({type:"selectedItemLength",payload:sd})},lo[4]=Xu):Xu=lo[4];const ed=Xu,td=useId(Ru);let nd;lo[5]!==ju||lo[6]!==td||lo[7]!==Lu||lo[8]!==Fu||lo[9]!==zu||lo[10]!==Bu?(nd={activeDescendantRef:Iu,autocompleteSuggestion:ju,id:td,inputRef:Ou,inputValue:Lu,isMenuDirectlyActivated:Fu,scrollContainerRef:Pu,selectedItemLength:zu,setAutocompleteSuggestion:Zu,setInputValue:Hu,setIsMenuDirectlyActivated:Yu,setShowMenu:Gu,setSelectedItemLength:ed,showMenu:Bu},lo[5]=ju,lo[6]=td,lo[7]=Lu,lo[8]=Fu,lo[9]=zu,lo[10]=Bu,lo[11]=nd):nd=lo[11];let od;return lo[12]!==$u||lo[13]!==nd?(od=jsxRuntimeExports.jsx(AutocompleteContext.Provider,{value:nd,children:$u}),lo[12]=$u,lo[13]=nd,lo[14]=od):od=lo[14],od};var Autocomplete$1=Object.assign(Autocomplete,{Context:AutocompleteContext,Input:AutocompleteInput,Menu:AutocompleteMenu,Overlay:AutocompleteOverlay}),classes$9={Select:"prc-Select-Select-F7Flx",TextInputWrapper:"prc-Select-TextInputWrapper-eBxmL",Disabled:"prc-Select-Disabled-EtgGW",ArrowIndicator:"prc-Select-ArrowIndicator-vtddB"};const ArrowIndicatorSVG=Au=>{const lo=distExports.c(3),{className:$u}=Au;let Ru;lo[0]===Symbol.for("react.memo_cache_sentinel")?(Ru=jsxRuntimeExports.jsx("path",{d:"m4.074 9.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.043 9H4.251a.25.25 0 0 0-.177.427ZM4.074 7.47 7.47 4.073a.25.25 0 0 1 .354 0L11.22 7.47a.25.25 0 0 1-.177.426H4.251a.25.25 0 0 1-.177-.426Z"}),lo[0]=Ru):Ru=lo[0];let Iu;return lo[1]!==$u?(Iu=jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:$u,children:Ru}),lo[1]=$u,lo[2]=Iu):Iu=lo[2],Iu},ArrowIndicator=Au=>{const lo=distExports.c(4),{className:$u}=Au;let Ru;lo[0]!==$u?(Ru=clsx(classes$9.ArrowIndicator,$u),lo[0]=$u,lo[1]=Ru):Ru=lo[1];let Iu;return lo[2]!==Ru?(Iu=jsxRuntimeExports.jsx(ArrowIndicatorSVG,{className:Ru}),lo[2]=Ru,lo[3]=Iu):Iu=lo[3],Iu},Select=vM.forwardRef((Au,lo)=>{var $u,Ru;const Iu=distExports.c(39);let Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu;Iu[0]!==Au?({block:Pu,children:Ou,className:Du,contrast:Mu,defaultValue:Lu,disabled:Bu,placeholder:ju,size:Uu,required:Fu,validationStatus:Vu,sx:Hu,...zu}=Au,Iu[0]=Au,Iu[1]=Pu,Iu[2]=Ou,Iu[3]=Du,Iu[4]=Mu,Iu[5]=Lu,Iu[6]=Bu,Iu[7]=ju,Iu[8]=Fu,Iu[9]=zu,Iu[10]=Uu,Iu[11]=Hu,Iu[12]=Vu):(Pu=Iu[1],Ou=Iu[2],Du=Iu[3],Mu=Iu[4],Lu=Iu[5],Bu=Iu[6],ju=Iu[7],Fu=Iu[8],zu=Iu[9],Uu=Iu[10],Hu=Iu[11],Vu=Iu[12]);const Gu=Vu==="error"?"true":"false",Wu=Bu&&classes$9.Disabled;let Zu;Iu[13]!==Du||Iu[14]!==Wu?(Zu=clsx(Du,classes$9.Select,Wu),Iu[13]=Du,Iu[14]=Wu,Iu[15]=Zu):Zu=Iu[15];const Ju=!!ju,Yu=($u=(Ru=Lu)!==null&&Ru!==void 0?Ru:ju)!==null&&$u!==void 0?$u:void 0;let Xu;Iu[16]!==ju||Iu[17]!==Fu?(Xu=ju&&jsxRuntimeExports.jsx("option",{value:"",disabled:Fu,hidden:Fu,children:ju}),Iu[16]=ju,Iu[17]=Fu,Iu[18]=Xu):Xu=Iu[18];let ed;Iu[19]!==Ou||Iu[20]!==Bu||Iu[21]!==lo||Iu[22]!==Fu||Iu[23]!==zu||Iu[24]!==Gu||Iu[25]!==Zu||Iu[26]!==Ju||Iu[27]!==Yu||Iu[28]!==Xu?(ed=jsxRuntimeExports.jsxs("select",{...zu,ref:lo,required:Fu,disabled:Bu,"aria-invalid":Gu,className:Zu,"data-hasplaceholder":Ju,defaultValue:Yu,children:[Xu,Ou]}),Iu[19]=Ou,Iu[20]=Bu,Iu[21]=lo,Iu[22]=Fu,Iu[23]=zu,Iu[24]=Gu,Iu[25]=Zu,Iu[26]=Ju,Iu[27]=Yu,Iu[28]=Xu,Iu[29]=ed):ed=Iu[29];let td;Iu[30]===Symbol.for("react.memo_cache_sentinel")?(td=jsxRuntimeExports.jsx(ArrowIndicator,{className:classes$9.ArrowIndicator}),Iu[30]=td):td=Iu[30];let nd;return Iu[31]!==Pu||Iu[32]!==Mu||Iu[33]!==Bu||Iu[34]!==Uu||Iu[35]!==Hu||Iu[36]!==ed||Iu[37]!==Vu?(nd=jsxRuntimeExports.jsxs(TextInputWrapper,{block:Pu,contrast:Mu,disabled:Bu,size:Uu,validationStatus:Vu,className:classes$9.TextInputWrapper,sx:Hu,children:[ed,td]}),Iu[31]=Pu,Iu[32]=Mu,Iu[33]=Bu,Iu[34]=Uu,Iu[35]=Hu,Iu[36]=ed,Iu[37]=Vu,Iu[38]=nd):nd=Iu[38],nd}),Option$1=Au=>{const lo=distExports.c(2);let $u;return lo[0]!==Au?($u=jsxRuntimeExports.jsx("option",{...Au}),lo[0]=Au,lo[1]=$u):$u=lo[1],$u},OptGroup=Au=>{const lo=distExports.c(2);let $u;return lo[0]!==Au?($u=jsxRuntimeExports.jsx("optgroup",{...Au}),lo[0]=Au,lo[1]=$u):$u=lo[1],$u};var Select$1=Object.assign(Select,{Option:Option$1,OptGroup}),classes$8={Caption:"prc-FormControl-Caption-tfuKU"};const FormControlContext=reactExports.createContext(null),FormControlContextProvider=FormControlContext.Provider;function useFormControlContext(){var Au;return(Au=reactExports.useContext(FormControlContext))!==null&&Au!==void 0?Au:{}}function FormControlCaption(Au){const lo=distExports.c(8),{id:$u,children:Ru,sx:Iu,className:Pu}=Au,{captionId:Ou,disabled:Du}=useFormControlContext(),Mu=$u??Ou;let Lu;lo[0]!==Pu?(Lu=clsx(Pu,classes$8.Caption),lo[0]=Pu,lo[1]=Lu):Lu=lo[1];const Bu=Du?"":void 0;let ju;return lo[2]!==Ru||lo[3]!==Iu||lo[4]!==Mu||lo[5]!==Lu||lo[6]!==Bu?(ju=jsxRuntimeExports.jsx(BoxWithFallback,{as:Text$3,id:Mu,className:Lu,"data-control-disabled":Bu,sx:Iu,children:Ru}),lo[2]=Ru,lo[3]=Iu,lo[4]=Mu,lo[5]=Lu,lo[6]=Bu,lo[7]=ju):ju=lo[7],ju}var classes$7={Label:"prc-components-Label-bE-kK",RequiredText:"prc-components-RequiredText-ztJvt"};function InputLabel(Au){const lo=distExports.c(30);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu;lo[0]!==Au?({children:$u,disabled:Iu,htmlFor:Pu,id:Ou,required:Mu,requiredText:Bu,requiredIndicator:Lu,visuallyHidden:zu,sx:ju,as:Fu,className:Ru,...Du}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu,lo[9]=Bu,lo[10]=ju,lo[11]=Fu,lo[12]=zu):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8],Bu=lo[9],ju=lo[10],Fu=lo[11],zu=lo[12]);const Uu=Fu===void 0?"label":Fu,Hu=Iu?"":void 0,Vu=zu?"":void 0;let Gu;lo[13]!==Ru?(Gu=clsx(Ru,classes$7.Label),lo[13]=Ru,lo[14]=Gu):Gu=lo[14];let Wu;if(lo[15]!==$u||lo[16]!==Mu||lo[17]!==Lu||lo[18]!==Bu){var Zu;Wu=Mu||Bu?jsxRuntimeExports.jsxs("span",{className:classes$7.RequiredText,children:[jsxRuntimeExports.jsx("span",{children:$u}),jsxRuntimeExports.jsx("span",{"aria-hidden":Lu?void 0:!0,children:(Zu=Bu)!==null&&Zu!==void 0?Zu:"*"})]}):$u,lo[15]=$u,lo[16]=Mu,lo[17]=Lu,lo[18]=Bu,lo[19]=Wu}else Wu=lo[19];let Ju;return lo[20]!==Uu||lo[21]!==Pu||lo[22]!==Ou||lo[23]!==Du||lo[24]!==ju||lo[25]!==Hu||lo[26]!==Vu||lo[27]!==Gu||lo[28]!==Wu?(Ju=jsxRuntimeExports.jsx(BoxWithFallback,{as:Uu,sx:ju,"data-control-disabled":Hu,"data-visually-hidden":Vu,htmlFor:Pu,id:Ou,className:Gu,...Du,children:Wu}),lo[20]=Uu,lo[21]=Pu,lo[22]=Ou,lo[23]=Du,lo[24]=ju,lo[25]=Hu,lo[26]=Vu,lo[27]=Gu,lo[28]=Wu,lo[29]=Ju):Ju=lo[29],Ju}const FormControlLabel=Au=>{const lo=distExports.c(27);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;lo[0]!==Au?({as:$u,children:Ru,htmlFor:Pu,id:Ou,visuallyHidden:ju,requiredIndicator:Bu,requiredText:Mu,sx:Lu,className:Iu,...Du}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu,lo[9]=Bu,lo[10]=ju):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8],Bu=lo[9],ju=lo[10]);const Fu=Bu===void 0?!0:Bu,{disabled:zu,id:Uu,required:Hu}=useFormControlContext();let Vu;lo[11]!==$u||lo[12]!==Iu||lo[13]!==zu||lo[14]!==Uu||lo[15]!==Pu||lo[16]!==Ou||lo[17]!==Du||lo[18]!==Hu||lo[19]!==Fu||lo[20]!==Mu||lo[21]!==Lu||lo[22]!==ju?(Vu=$u==="legend"||$u==="span"?{as:$u,id:Ou,className:Iu,visuallyHidden:ju,required:Hu,requiredText:Mu,requiredIndicator:Fu,disabled:zu,sx:Lu,...Du}:{as:$u,id:Ou,className:Iu,visuallyHidden:ju,htmlFor:Pu||Uu,required:Hu,requiredText:Mu,requiredIndicator:Fu,disabled:zu,sx:Lu,...Du},lo[11]=$u,lo[12]=Iu,lo[13]=zu,lo[14]=Uu,lo[15]=Pu,lo[16]=Ou,lo[17]=Du,lo[18]=Hu,lo[19]=Fu,lo[20]=Mu,lo[21]=Lu,lo[22]=ju,lo[23]=Vu):Vu=lo[23];const Gu=Vu;let Wu;return lo[24]!==Ru||lo[25]!==Gu?(Wu=jsxRuntimeExports.jsx(InputLabel,{...Gu,children:Ru}),lo[24]=Ru,lo[25]=Gu,lo[26]=Wu):Wu=lo[26],Wu},FormControlLeadingVisual=Au=>{const lo=distExports.c(5),{children:$u,sx:Ru}=Au,{disabled:Iu,captionId:Pu}=useFormControlContext(),Ou=Iu?"":void 0,Du=Pu?"":void 0;let Mu;return lo[0]!==$u||lo[1]!==Ru||lo[2]!==Ou||lo[3]!==Du?(Mu=jsxRuntimeExports.jsx(StyledLeadingVisual,{"data-control-disabled":Ou,"data-has-caption":Du,sx:Ru,children:$u}),lo[0]=$u,lo[1]=Ru,lo[2]=Ou,lo[3]=Du,lo[4]=Mu):Mu=lo[4],Mu},StyledLeadingVisual=qe$4.div.withConfig({displayName:"FormControlLeadingVisual__StyledLeadingVisual",componentId:"sc-1c26i0t-0"})(["--leadingVisual-size:",";color:var(--fgColor-default);display:flex;align-items:center;&:where([data-control-disabled]){color:var(--control-fgColor-disabled);}& > *{min-width:var(--leadingVisual-size);min-height:var(--leadingVisual-size);fill:currentColor;}&:where([data-has-caption]){--leadingVisual-size:",";}",""],get("fontSizes.2"),get("fontSizes.4"),sx),FormControlValidation=Au=>{const lo=distExports.c(6),{children:$u,className:Ru,variant:Iu,sx:Pu,id:Ou}=Au,{validationMessageId:Du}=useFormControlContext(),Mu=Ou||Du||"";let Lu;return lo[0]!==$u||lo[1]!==Ru||lo[2]!==Pu||lo[3]!==Mu||lo[4]!==Iu?(Lu=jsxRuntimeExports.jsx(InputValidation,{className:Ru,validationStatus:Iu,id:Mu,sx:Pu,children:$u}),lo[0]=$u,lo[1]=Ru,lo[2]=Pu,lo[3]=Mu,lo[4]=Iu,lo[5]=Lu):Lu=lo[5],Lu};var classes$6={ControlHorizontalLayout:"prc-FormControl-ControlHorizontalLayout-GkYZF",ControlVerticalLayout:"prc-FormControl-ControlVerticalLayout-wOp8f",ControlChoiceInputs:"prc-FormControl-ControlChoiceInputs-VxfAy",LabelContainer:"prc-FormControl-LabelContainer-lwQsw",LeadingVisual:"prc-FormControl-LeadingVisual-fEyC5"},classes$5={Overlay:"prc-SelectPanel-Overlay-arLk6",Wrapper:"prc-SelectPanel-Wrapper-43Iz8",Header:"prc-SelectPanel-Header-4dLqk",Title:"prc-SelectPanel-Title--CZN1",Subtitle:"prc-SelectPanel-Subtitle-tMSzu",Notice:"prc-SelectPanel-Notice-xDTd4",Footer:"prc-SelectPanel-Footer-78rgp",FilteredActionList:"prc-SelectPanel-FilteredActionList-wzS7m",Message:"prc-SelectPanel-Message-CSpwI",MessageTitle:"prc-SelectPanel-MessageTitle-o6PpS",MessageBody:"prc-SelectPanel-MessageBody-89DEz",MessageIcon:"prc-SelectPanel-MessageIcon-GS8ry",MessageAction:"prc-SelectPanel-MessageAction-qwola",ResponsiveCloseButton:"prc-SelectPanel-ResponsiveCloseButton-3mdX2",ResponsiveFooter:"prc-SelectPanel-ResponsiveFooter-e-JSD",SecondaryAction:"prc-SelectPanel-SecondaryAction-aWzLU",CancelSaveButtons:"prc-SelectPanel-CancelSaveButtons-kk2cT",ResponsiveSaveButton:"prc-SelectPanel-ResponsiveSaveButton-Ooz4Y",Backdrop:"prc-SelectPanel-Backdrop-7XJa-"};const SelectPanelMessage=({variant:Au,title:lo,children:$u,className:Ru,icon:Iu,action:Pu})=>{const Ou=Iu||(Au!=="empty"?AlertIcon:void 0);return jsxRuntimeExports.jsxs("div",{className:clsx(classes$5.Message,Ru),children:[Ou&&jsxRuntimeExports.jsx(Octicon,{icon:Ou,className:classes$5.MessageIcon,"data-variant":Au}),jsxRuntimeExports.jsx(Text$3,{className:classes$5.MessageTitle,children:lo}),jsxRuntimeExports.jsx(Text$3,{className:classes$5.MessageBody,children:$u}),Pu&&jsxRuntimeExports.jsx("div",{className:classes$5.MessageAction,children:Pu})]})};SelectPanelMessage.displayName="SelectPanelMessage";const LinkButton=reactExports.forwardRef(({children:Au,as:lo="a",sx:$u=defaultSxProp,...Ru},Iu)=>jsxRuntimeExports.jsx(ButtonBase,{as:lo,ref:Iu,sx:$u,...Ru,children:Au}));var classes$4={LoadingSkeleton:"prc-FilteredActionList-LoadingSkeleton-x9WXt"};class FilteredActionListLoadingType{constructor(lo,$u){this.name=lo,this.appearsInBody=$u}}const FilteredActionListLoadingTypes={bodySpinner:new FilteredActionListLoadingType("body-spinner",!0),bodySkeleton:new FilteredActionListLoadingType("body-skeleton",!0),input:new FilteredActionListLoadingType("input",!1)},SKELETON_ROW_HEIGHT=24,SKELETON_MIN_ROWS=3;function FilteredActionListBodyLoader(Au){const lo=distExports.c(4),{loadingType:$u,height:Ru}=Au;switch($u){case FilteredActionListLoadingTypes.bodySpinner:{let Iu;return lo[0]===Symbol.for("react.memo_cache_sentinel")?(Iu=jsxRuntimeExports.jsx(LoadingSpinner,{"data-testid":"filtered-action-list-spinner"}),lo[0]=Iu):Iu=lo[0],Iu}case FilteredActionListLoadingTypes.bodySkeleton:{const Iu=Ru<SKELETON_ROW_HEIGHT?SKELETON_MIN_ROWS:Ru/SKELETON_ROW_HEIGHT;let Pu;return lo[1]!==Iu?(Pu=jsxRuntimeExports.jsx(LoadingSkeleton,{"data-testid":"filtered-action-list-skeleton",rows:Iu}),lo[1]=Iu,lo[2]=Pu):Pu=lo[2],Pu}default:{let Iu;return lo[3]===Symbol.for("react.memo_cache_sentinel")?(Iu=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),lo[3]=Iu):Iu=lo[3],Iu}}}function LoadingSpinner(Au){const lo=distExports.c(5);let $u;lo[0]!==Au?({...$u}=Au,lo[0]=Au,lo[1]=$u):$u=lo[1];let Ru;lo[2]===Symbol.for("react.memo_cache_sentinel")?(Ru={alignContent:"center",textAlign:"center",height:"100%"},lo[2]=Ru):Ru=lo[2];let Iu;return lo[3]!==$u?(Iu=jsxRuntimeExports.jsx(Box$1,{p:3,flexGrow:1,sx:Ru,children:jsxRuntimeExports.jsx(StyledSpinner,{...$u})}),lo[3]=$u,lo[4]=Iu):Iu=lo[4],Iu}function LoadingSkeleton(Au){const lo=distExports.c(8);let $u,Ru;lo[0]!==Au?({rows:Ru,...$u}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru):($u=lo[1],Ru=lo[2]);const Iu=Ru===void 0?10:Ru;let Pu;lo[3]!==Iu?(Pu=Array.from({length:Iu},_temp$2),lo[3]=Iu,lo[4]=Pu):Pu=lo[4];let Ou;return lo[5]!==$u||lo[6]!==Pu?(Ou=jsxRuntimeExports.jsx(Box$1,{p:2,display:"flex",flexGrow:1,flexDirection:"column",children:jsxRuntimeExports.jsx(Stack$2,{direction:"vertical",justify:"center",gap:"condensed",...$u,children:Pu})}),lo[5]=$u,lo[6]=Pu,lo[7]=Ou):Ou=lo[7],Ou}function _temp$2(Au,lo){return jsxRuntimeExports.jsxs(Stack$2,{direction:"horizontal",gap:"condensed",align:"center",children:[jsxRuntimeExports.jsx(SkeletonBox,{width:"16px",height:"16px"}),jsxRuntimeExports.jsx(SkeletonBox,{height:"10px",width:`${Math.random()*60+20}%`,className:classes$4.LoadingSkeleton})]},lo)}_temp$2.displayName="_temp";function useScrollFlash(Au){reactExports.useEffect(()=>{const lo=Au.current;if(!lo)return;const $u=lo.scrollTop,Ru=lo.scrollHeight,Iu=$u<Math.min(1,Ru)?$u+1:$u-1;lo.scrollTop=Iu,lo.scrollTop=$u},[Au])}var classes$3={Container:"prc-FilteredActionList-Container-2A9NQ",ActionListItem:"prc-FilteredActionList-ActionListItem-39lnB",FullScreenTextInput:"prc-FilteredActionList-FullScreenTextInput-rCAiq",SelectAllContainer:"prc-FilteredActionList-SelectAllContainer-w5otq",SelectAllCheckbox:"prc-FilteredActionList-SelectAllCheckbox-dq2yL",SelectAllLabel:"prc-FilteredActionList-SelectAllLabel-l34LA"};const delayMs=500,useFirstRender=()=>{const Au=reactExports.useRef(!0);return reactExports.useEffect(()=>{Au.current=!1},[]),Au.current},getItemWithActiveDescendant=(Au,lo)=>{const $u=Au.current,Ru=$u?.querySelector("[data-is-active-descendant]");if(!$u||!(Ru!=null&&Ru.textContent))return;const Iu=$u.querySelectorAll('[role="option"]'),Pu=Array.from(Iu).indexOf(Ru),Ou=lo[Pu],Du=Ou?.text,Mu=Ou?.selected;return{index:Pu,text:Du,selected:Mu}},useAnnouncements=(Au,lo,$u,Ru,Iu,Pu)=>{const Ou=distExports.c(39),Du=Ru===void 0?!0:Ru,Mu=Iu===void 0?!1:Iu,Lu=useFeatureFlag("primer_react_select_panel_remove_active_descendant");let Bu;Ou[0]===Symbol.for("react.memo_cache_sentinel")?(Bu=document.querySelector("live-region"),Ou[0]=Bu):Bu=Ou[0];const ju=Bu;let Fu;Ou[1]!==Au?(Fu=Au.filter(_temp$1),Ou[1]=Au,Ou[2]=Fu):Fu=Ou[2];const zu=Fu.length;let Uu;Ou[3]!==Du?(Uu=(...ed)=>{const td=ed;if(Du)return announce(...td)},Ou[3]=Du,Ou[4]=Uu):Uu=Ou[4];const Hu=Uu;let Vu;Ou[5]!==Hu||Ou[6]!==$u.current||Ou[7]!==Au||Ou[8]!==lo||Ou[9]!==zu||Ou[10]!==Lu?(Vu=function(){const td=()=>{if(Lu){const od=`${Au.length} item${Au.length>1?"s":""} available, ${zu} selected.`;Hu(od,{delayMs,from:ju||void 0})}else window.requestAnimationFrame(()=>{const od=getItemWithActiveDescendant(lo,Au);if(!od)return;const{index:sd,text:ad,selected:pd}=od,bd=["Focus on filter text box and list of items",`Focused item: ${ad}`,`${pd?"selected":"not selected"}`,`${sd+1} of ${Au.length}`].join(", ");Hu(bd,{delayMs,from:ju||void 0})})},nd=$u.current;return nd?.addEventListener("focus",td),()=>nd?.removeEventListener("focus",td)},Ou[5]=Hu,Ou[6]=$u.current,Ou[7]=Au,Ou[8]=lo,Ou[9]=zu,Ou[10]=Lu,Ou[11]=Vu):Vu=Ou[11];let Gu;Ou[12]!==Hu||Ou[13]!==$u||Ou[14]!==Au||Ou[15]!==lo||Ou[16]!==zu||Ou[17]!==Lu?(Gu=[lo,$u,Au,ju,Hu,Lu,zu],Ou[12]=Hu,Ou[13]=$u,Ou[14]=Au,Ou[15]=lo,Ou[16]=zu,Ou[17]=Lu,Ou[18]=Gu):Gu=Ou[18],reactExports.useEffect(Vu,Gu);const Wu=useFirstRender();let Zu;Ou[19]!==Hu||Ou[20]!==Wu||Ou[21]!==Au||Ou[22]!==lo||Ou[23]!==Mu||Ou[24]!==Pu?.description||Ou[25]!==Pu?.title||Ou[26]!==zu||Ou[27]!==Lu?(Zu=function(){if(!Wu){if(ju?.clear(),Au.length===0&&!Mu){Hu(`${Pu?.title}. ${Pu?.description}`,{delayMs});return}if(Lu){const td=`${Au.length} item${Au.length>1?"s":""} available, ${zu} selected.`;Hu(td,{delayMs,from:ju||void 0})}else window.requestAnimationFrame(()=>{const td=getItemWithActiveDescendant(lo,Au);if(!td)return;const{index:nd,text:od,selected:sd}=td,ad=["List updated",`Focused item: ${od}`,`${sd?"selected":"not selected"}`,`${nd+1} of ${Au.length}`].join(", ");Hu(ad,{delayMs,from:ju||void 0})})}},Ou[19]=Hu,Ou[20]=Wu,Ou[21]=Au,Ou[22]=lo,Ou[23]=Mu,Ou[24]=Pu?.description,Ou[25]=Pu?.title,Ou[26]=zu,Ou[27]=Lu,Ou[28]=Zu):Zu=Ou[28];const Ju=Pu?.title,Yu=Pu?.description;let Xu;Ou[29]!==Hu||Ou[30]!==Wu||Ou[31]!==Au||Ou[32]!==lo||Ou[33]!==Mu||Ou[34]!==zu||Ou[35]!==Ju||Ou[36]!==Yu||Ou[37]!==Lu?(Xu=[Hu,Wu,Au,lo,ju,Lu,Ju,Yu,Mu,zu],Ou[29]=Hu,Ou[30]=Wu,Ou[31]=Au,Ou[32]=lo,Ou[33]=Mu,Ou[34]=zu,Ou[35]=Ju,Ou[36]=Yu,Ou[37]=Lu,Ou[38]=Xu):Xu=Ou[38],reactExports.useEffect(Zu,Xu)};function _temp$1(Au){return Au.selected}const menuScrollMargins={startMargin:0,endMargin:8},StyledHeader=qe$4.div.withConfig({displayName:"FilteredActionList__StyledHeader",componentId:"sc-1oqgb0s-0"})(["box-shadow:0 1px 0 ",";z-index:1;"],get("colors.border.default"));function FilteredActionList({loading:Au=!1,placeholderText:lo,filterValue:$u,loadingType:Ru=FilteredActionListLoadingTypes.bodySpinner,onFilterChange:Iu,onListContainerRefChanged:Pu,onInputRefChanged:Ou,items:Du,textInputProps:Mu,inputRef:Lu,sx:Bu,groupMetadata:ju,showItemDividers:Fu,message:zu,messageText:Uu,className:Hu,selectionVariant:Vu,announcementsEnabled:Gu=!0,fullScreenOnNarrow:Wu,onSelectAllChange:Zu,...Ju}){const[Yu,Xu]=useProvidedStateOrCreate($u,void 0,""),ed=reactExports.useCallback(Rd=>{const jd=Rd.target.value;Iu(jd,Rd),Xu(jd)},[Iu,Xu]),td=reactExports.useRef(null),nd=reactExports.useRef(null),od=reactExports.useRef(null),sd=useProvidedRefOrCreate(Lu),ad=useFeatureFlag("primer_react_select_panel_remove_active_descendant"),[pd,bd]=reactExports.useState(null),wd=reactExports.useRef(),_d=useId(),yd=useId(),[Sd,kd]=reactExports.useState(!1),md=Du.length>0&&Du.every(Rd=>Rd.selected),dd=!md&&Du.some(Rd=>Rd.selected),vd=md?"Deselect all":"Select all",ld=reactExports.useCallback(Rd=>{const jd=[];for(const Cd of Du)Cd.groupId===Rd&&jd.push(Cd);return jd},[Du]),ud=reactExports.useCallback(Rd=>{if(Rd.key==="ArrowDown"){if(nd.current){const jd=nd.current.querySelector('[role="option"]');jd?.focus(),Rd.preventDefault()}}else if(Rd.key==="Enter"){let jd;if(ju){let Cd=0;for(let Id=0;Id<ju.length&&!(ld(ju[Id].groupId).length>0);Id++)Cd++;const $d=ju[Cd].groupId;jd=Du.filter(Id=>Id.groupId===$d)[0]}else jd=Du[0];jd.onAction&&(jd.onAction(jd,Rd),Rd.preventDefault())}},[Du,ju,ld]),hd=reactExports.useCallback(Rd=>{if(Rd.key==="Enter"&&wd.current){Rd.preventDefault(),Rd.nativeEvent.stopImmediatePropagation();const jd=new KeyboardEvent(Rd.type,Rd.nativeEvent);wd.current.dispatchEvent(jd)}},[wd]),gd=reactExports.useCallback(Rd=>{bd(Rd),Pu?.(Rd)},[Pu]);reactExports.useEffect(()=>{Ou?.(sd)},[sd,Ou]),useFocusZone(ad?void 0:{containerRef:{current:pd},bindKeys:FocusKeys.ArrowVertical|FocusKeys.PageUpDown,focusOutBehavior:"wrap",focusableElementFilter:Rd=>!(Rd instanceof HTMLInputElement),activeDescendantFocus:sd,onActiveDescendantChanged:(Rd,jd,Cd)=>{wd.current=Rd,Rd&&od.current&&Cd&&scrollIntoView$2(Rd,od.current,menuScrollMargins)}},[pd,ad]),reactExports.useEffect(()=>{wd.current&&od.current&&scrollIntoView$2(wd.current,od.current,{...menuScrollMargins,behavior:"auto"})},[Du,sd]),reactExports.useEffect(()=>{if(ad){const Rd=td.current;if(!Rd)return;const jd=nd.current;if(!jd)return;const Cd=$d=>{($d.target===sd.current||jd.contains($d.target))&&kd(!!(sd.current&&sd.current===document.activeElement))};return Rd.addEventListener("focusin",Cd),()=>{Rd.removeEventListener("focusin",Cd)}}},[Du,sd,pd,ad]),reactExports.useEffect(()=>{ad&&!Au&&kd(!!(sd.current&&sd.current===document.activeElement))},[Au,sd,ad]),useAnnouncements(Du,ad?nd:{current:pd},sd,Gu,Au,Uu),useScrollFlash(od);const Ed=reactExports.useCallback(Rd=>{Zu&&Zu(Rd.target.checked)},[Zu]);function Td(){if(Au&&od.current&&Ru.appearsInBody)return jsxRuntimeExports.jsx(FilteredActionListBodyLoader,{loadingType:Ru,height:od.current.clientHeight});if(zu)return zu;let Rd=0;const jd=jsxRuntimeExports.jsx(ActionList,{ref:ad?nd:gd,showDividers:Fu,selectionVariant:Vu,...Ju,role:"listbox",id:_d,sx:{flexGrow:1},children:ju!=null&&ju.length?ju.map((Cd,$d)=>{var Id,Vd;return $d===Rd&&ld(Cd.groupId).length===0&&Rd++,jsxRuntimeExports.jsxs(ActionList.Group,{children:[jsxRuntimeExports.jsx(ActionList.GroupHeading,{variant:(Id=Cd.header)!==null&&Id!==void 0&&Id.variant?Cd.header.variant:void 0,children:(Vd=Cd.header)!==null&&Vd!==void 0&&Vd.title?Cd.header.title:`Group ${Cd.groupId}`}),ld(Cd.groupId).map(({key:Dd,...Wd},oh)=>{var rh,Eh;const ah=(rh=Dd??((Eh=Wd.id)===null||Eh===void 0?void 0:Eh.toString()))!==null&&rh!==void 0?rh:oh.toString();return jsxRuntimeExports.jsx(MappedActionListItem,{className:clsx(classes$3.ActionListItem,"className"in Wd?Wd.className:void 0),"data-input-focused":Sd?"":void 0,"data-first-child":$d===Rd&&oh===0?"":void 0,...Wd,renderItem:Ju.renderItem},ah)})]},$d)}):Du.map(({key:Cd,...$d},Id)=>{var Vd,Dd;const Wd=(Vd=Cd??((Dd=$d.id)===null||Dd===void 0?void 0:Dd.toString()))!==null&&Vd!==void 0?Vd:Id.toString();return jsxRuntimeExports.jsx(MappedActionListItem,{className:clsx(classes$3.ActionListItem,"className"in $d?$d.className:void 0),"data-input-focused":Sd?"":void 0,"data-first-child":Id===0?"":void 0,...$d,renderItem:Ju.renderItem},Wd)})});return ad?jsxRuntimeExports.jsx(ActionListContainerContext.Provider,{value:{container:"FilteredActionList",listRole:"listbox",selectionAttribute:"aria-selected",selectionVariant:Vu,enableFocusZone:!0},children:jd}):jd}return jsxRuntimeExports.jsxs(Box$1,{ref:td,display:"flex",flexDirection:"column",overflow:"hidden",sx:Bu,className:Hu,"data-testid":"filtered-action-list",children:[jsxRuntimeExports.jsx(StyledHeader,{children:jsxRuntimeExports.jsx(TextInput$1,{ref:sd,block:!0,width:"auto",color:"fg.default",value:Yu,onChange:ed,onKeyPress:hd,onKeyDown:ad?ud:()=>{},placeholder:lo,role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":_d,"aria-label":lo,"aria-describedby":yd,loaderPosition:"leading",loading:Au&&!Ru.appearsInBody,className:clsx(Mu?.className,Wu&&classes$3.FullScreenTextInput),...Mu})}),jsxRuntimeExports.jsx(VisuallyHidden$1,{id:yd,children:"Items will be filtered as you type"}),Zu!==void 0&&jsxRuntimeExports.jsxs("div",{className:classes$3.SelectAllContainer,children:[jsxRuntimeExports.jsx(Checkbox,{id:"select-all-checkbox",className:classes$3.SelectAllCheckbox,checked:md,indeterminate:dd,onChange:Ed}),jsxRuntimeExports.jsx("label",{className:classes$3.SelectAllLabel,htmlFor:"select-all-checkbox",children:vd})]}),jsxRuntimeExports.jsx("div",{ref:od,className:classes$3.Container,children:Td()})]})}FilteredActionList.displayName="FilteredActionList";function MappedActionListItem(Au){const lo=distExports.c(35);if(typeof Au.renderItem=="function"){let Wu;return lo[0]!==Au?(Wu=Au.renderItem(Au),lo[0]=Au,lo[1]=Wu):Wu=lo[1],Wu}let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu;lo[2]!==Au?({id:Mu,description:Ou,descriptionVariant:Du,text:ju,trailingVisual:Iu,leadingVisual:$u,trailingText:Fu,trailingIcon:Ru,onAction:Lu,children:Pu,...Bu}=Au,lo[2]=Au,lo[3]=$u,lo[4]=Ru,lo[5]=Iu,lo[6]=Pu,lo[7]=Ou,lo[8]=Du,lo[9]=Mu,lo[10]=Lu,lo[11]=Bu,lo[12]=ju,lo[13]=Fu):($u=lo[3],Ru=lo[4],Iu=lo[5],Pu=lo[6],Ou=lo[7],Du=lo[8],Mu=lo[9],Lu=lo[10],Bu=lo[11],ju=lo[12],Fu=lo[13]);let zu;lo[14]!==Au||lo[15]!==Lu?(zu=Wu=>{typeof Lu=="function"&&Lu(Au,Wu)},lo[14]=Au,lo[15]=Lu,lo[16]=zu):zu=lo[16];let Uu;lo[17]!==$u?(Uu=$u?jsxRuntimeExports.jsx(ActionList.LeadingVisual,{children:jsxRuntimeExports.jsx($u,{})}):null,lo[17]=$u,lo[18]=Uu):Uu=lo[18];let Hu;lo[19]!==Ou||lo[20]!==Du?(Hu=Ou?jsxRuntimeExports.jsx(ActionList.Description,{variant:Du,children:Ou}):null,lo[19]=Ou,lo[20]=Du,lo[21]=Hu):Hu=lo[21];let Vu;lo[22]!==Ru||lo[23]!==Iu||lo[24]!==Fu?(Vu=Iu?jsxRuntimeExports.jsx(ActionList.TrailingVisual,{children:typeof Iu!="string"&&reactIsExports.isValidElementType(Iu)?jsxRuntimeExports.jsx(Iu,{}):Iu}):Ru||Fu?jsxRuntimeExports.jsxs(ActionList.TrailingVisual,{children:[Fu,Ru&&jsxRuntimeExports.jsx(Ru,{})]}):null,lo[22]=Ru,lo[23]=Iu,lo[24]=Fu,lo[25]=Vu):Vu=lo[25];let Gu;return lo[26]!==Pu||lo[27]!==Mu||lo[28]!==Bu||lo[29]!==zu||lo[30]!==Uu||lo[31]!==Hu||lo[32]!==Vu||lo[33]!==ju?(Gu=jsxRuntimeExports.jsxs(ActionList.Item,{role:"option",onSelect:zu,"data-id":Mu,...Bu,children:[Uu,Pu,ju,Hu,Vu]}),lo[26]=Pu,lo[27]=Mu,lo[28]=Bu,lo[29]=zu,lo[30]=Uu,lo[31]=Hu,lo[32]=Vu,lo[33]=ju,lo[34]=Gu):Gu=lo[34],Gu}FilteredActionList.displayName="FilteredActionList";const SHORT_DELAY_MS=500,LONG_DELAY_MS=1e3,EMPTY_MESSAGE={title:"No items available",description:""},DefaultEmptyMessage=jsxRuntimeExports.jsx(SelectPanelMessage,{variant:"empty",title:EMPTY_MESSAGE.title,children:EMPTY_MESSAGE.description},"empty-message");async function announceText(Au,lo=SHORT_DELAY_MS){const $u=document.querySelector("live-region");$u?.clear(),await announce(Au,{delayMs:lo,from:$u||void 0})}async function announceLoading(){await announceText("Loading.")}function isMultiSelectVariant(Au){return Array.isArray(Au)}const focusZoneSettings={disabled:!0},areItemsEqual=(Au,lo)=>typeof Au.id<"u"?Au.id===lo.id:Au===lo,doesItemsIncludeItem=(Au,lo)=>Au.some($u=>areItemsEqual($u,lo)),defaultRenderAnchor=Au=>{const{children:lo,...$u}=Au;return jsxRuntimeExports.jsx(ButtonComponent,{trailingAction:TriangleDownIcon,...$u,children:lo})};defaultRenderAnchor.displayName="defaultRenderAnchor";function Panel$1({open:Au,onOpenChange:lo,renderAnchor:$u=defaultRenderAnchor,anchorRef:Ru,placeholder:Iu,placeholderText:Pu="Filter items",inputLabel:Ou=Pu,selected:Du,title:Mu=isMultiSelectVariant(Du)?"Select items":"Select an item",subtitle:Lu,onSelectedChange:Bu,filterValue:ju,onFilterChange:Fu,items:zu,footer:Uu,textInputProps:Hu,overlayProps:Vu,sx:Gu,loading:Wu,initialLoadingType:Zu="spinner",className:Ju,height:Yu,width:Xu,id:ed,message:td,notice:nd,onCancel:od,variant:sd="anchored",secondaryAction:ad,showSelectedOptionsFirst:pd=!0,disableFullscreenOnNarrow:bd,align:wd,showSelectAll:_d=!1,...yd}){var Sd;const kd=useId(),md=useId(),[dd,vd]=reactExports.useState(!1),[ld,ud]=reactExports.useState(!1),[hd,gd]=useProvidedStateOrCreate(ju,void 0,""),{safeSetTimeout:Ed,safeClearTimeout:Td}=useSafeTimeout(),Rd=reactExports.useRef(null),jd=Wu===void 0,Cd=!jd,[$d,Id]=vM.useState(null),[Vd,Dd]=reactExports.useState(null),[Wd,oh]=reactExports.useState(!1),rh=useResponsiveValue({narrow:!0,regular:!1,wide:!1},!1),[Eh,ah]=reactExports.useState([]),[yh,vh]=reactExports.useState([]),[Jd,Qd]=reactExports.useState(Au),sh=reactExports.useRef(0),Oh=reactExports.useRef(1),qd=reactExports.useRef(null),[zd,Pd]=reactExports.useState(!1),[Od,Gd]=reactExports.useState(void 0),Md=10,Kd=useFeatureFlag("primer_react_select_panel_fullscreen_on_narrow"),Xd=bd?!1:Kd,ph=useFeatureFlag("primer_react_select_panel_order_selected_at_top")&&pd,_h=sd==="modal"&&!isMultiSelectVariant(Du),[Sh,Wh]=reactExports.useState(_h?Du:void 0);reactExports.useEffect(()=>{Wh(_h?Du:void 0)},[_h,Au,Du]);const Nd=reactExports.useCallback(Rh=>{Dd(Rh),!Rh&&Wd&&oh(!1)},[Wd]),xd=reactExports.useCallback(Rh=>{Id(Rh)},[Id]),Hd=reactExports.useCallback(()=>{isMultiSelectVariant(Du)?ah(Du):ah(Du?[Du]:[])},[Du]),Zd=reactExports.useCallback((Rh,jh)=>{jd&&(Rd.current&&Td(Rd.current),dd?Rd.current=Ed(()=>{ud(!0),announceLoading()},LONG_DELAY_MS):(zu.length===0&&ud(!0),Rd.current=Ed(()=>{announceLoading()},LONG_DELAY_MS))),Fu(Rh,jh),gd(Rh),Rh||Hd()},[jd,Fu,gd,dd,Ed,Td,zu.length,Hd]),gh=reactExports.useCallback(Rh=>{if(!isMultiSelectVariant(Du))return;const jh=Bu,Bp=Du.filter(af=>!zu.some(ef=>areItemsEqual(ef,af)));jh(Rh?[...Bp,...zu]:Bp)},[zu,Bu,Du]);reactExports.useEffect(()=>{if(Au&&rh&&Xd){const Rh=document.body.style.overflow||"";return Rh==="hidden"?void 0:(document.body.style.overflow="hidden",()=>{document.body.style.overflow=Rh})}},[rh,Au,Xd]),reactExports.useEffect(()=>{if(Au&&zu.length===0&&!(ld||Wu)&&oh(!0),Cd){zu.length>0&&vd(!0);return}(ld||zu.length>0)&&(ud(!1),vd(!0)),Rd.current&&Td(Rd.current)},[zu]),reactExports.useEffect(()=>{if($d!=null&&$d.current){const Rh=$d.current;Au&&Rh.focus()}},[$d,Au]),reactExports.useEffect(()=>{Cd&&(ld?Rd.current=Ed(()=>{announceLoading()},LONG_DELAY_MS):Rd.current&&Td(Rd.current))},[ld,Cd,Ed,Td]),reactExports.useEffect(()=>{Cd||dd||Au&&zu.length===0&&Zd(hd,null)},[Au,dd,Zd,hd,zu,Cd,Vd]),reactExports.useEffect(()=>{if(!window.visualViewport||!Au||!rh)return;sh.current=window.visualViewport.height,Oh.current=window.visualViewport.scale;const Rh=debounce(()=>{if(window.visualViewport&&!(window.visualViewport.scale!==Oh.current)){const Bp=window.visualViewport.height,af=sh.current-Bp>Md;Pd(af),Gd(af?Bp:void 0)}},100);return window.visualViewport&&(window.visualViewport.addEventListener("resize",Rh),window.visualViewport.addEventListener("scroll",Rh)),()=>{window.visualViewport&&(window.visualViewport.removeEventListener("resize",Rh),window.visualViewport.removeEventListener("scroll",Rh)),Rh.cancel()}},[Au,rh]),reactExports.useEffect(()=>{Au&&nd&&(async()=>{if(!qd.current)return;const jh=document.querySelector("live-region");jh?.clear(),await announceFromElement(qd.current,{from:jh||void 0})})()},[nd,Au]);const Ch=useProvidedRefOrCreate(Ru),wh=reactExports.useCallback(Rh=>lo(!0,Rh),[lo]),Th=reactExports.useCallback(()=>{lo(!1,"cancel")},[lo]),$h=reactExports.useCallback(Rh=>{sd==="modal"&&Rh==="click-outside"&&od?.(),Rh==="close"?(od?.(),Th()):lo(!1,Rh)},[lo,sd,od,Th]),xh=reactExports.useMemo(()=>{if($u===null)return null;const Rh=Array.isArray(Du)?Du:[...Du?[Du]:[]];return jh=>$u({...jh,children:Rh.length?Rh.map(df=>df.text).join(", "):Iu})},[Iu,$u,Du]),Ph=reactExports.useCallback(Rh=>isMultiSelectVariant(Du)?doesItemsIncludeItem(Du,Rh):_h?Sh?.id!==void 0?Sh.id===Rh.id:Sh===Rh:Du?.id!==void 0?Du.id===Rh.id:Du===Rh,[Du,Sh,_h]),Kh=reactExports.useMemo(()=>zu.map(Rh=>({...Rh,role:"option",id:Rh.id,selected:"selected"in Rh&&Rh.selected===void 0?void 0:Ph(Rh),onAction:(jh,df)=>{var Bp;if((Bp=Rh.onAction)===null||Bp===void 0||Bp.call(Rh,jh,df),df.defaultPrevented)return;if(isMultiSelectVariant(Du)){const ef=Du.filter(Mf=>!areItemsEqual(Mf,Rh)),tp=doesItemsIncludeItem(Du,Rh)?ef:[...ef,Rh];Bu(tp);return}if(_h){Sh?.id===Rh.id?Wh(void 0):Wh(Rh);return}Bu(Rh===Du?void 0:Rh),$h("selection")}})).sort((Rh,jh)=>{if(ph){const df=Eh.some(af=>Object.entries(af).every(([ef,tp])=>ef==="selected"?!0:Rh[ef]===tp)),Bp=Eh.some(af=>Object.entries(af).every(([ef,tp])=>ef==="selected"?!0:jh[ef]===tp));if(df>Bp)return-1;if(df<Bp)return 1}return 0}),[$h,Bu,zu,Du,Ph,_h,Sh,ph,Eh]);yh!==zu&&(vh(zu),yh.length===0&&zu.length>0&&Hd()),Au!==Jd&&(Qd(Au),Hd());const Dh={initialFocusRef:$d||void 0},ep=reactExports.useMemo(()=>({sx:{m:2},contrast:!0,leadingVisual:SearchIcon,"aria-label":Ou,...Hu}),[Ou,Hu]),np=()=>dd?FilteredActionListLoadingTypes.input:Zu==="spinner"?FilteredActionListLoadingTypes.bodySpinner:FilteredActionListLoadingTypes.bodySkeleton,hp={info:jsxRuntimeExports.jsx(InfoIcon,{size:16}),warning:jsxRuntimeExports.jsx(AlertIcon,{size:16}),error:jsxRuntimeExports.jsx(StopIcon,{size:16})};function gp(){if(zu.length===0&&!td)return DefaultEmptyMessage;if(td)return jsxRuntimeExports.jsx(SelectPanelMessage,{title:td.title,variant:td.variant,icon:td.icon,action:td.action,children:td.body})}const Jh=sd==="modal",_p=sd!=="modal"&&Xd&&isMultiSelectVariant(Du)&&od!==void 0,sp=sd!=="modal"&&Xd&&isMultiSelectVariant(Du)&&od===void 0,cp=ad!==void 0||Jh||sp||_p,qh=ad!==void 0||Jh?"always":sp||_p?"only-small":void 0,zh=sp||_p?"only-big":Jh?"never":"always",Yh=sp&&ad===void 0?"only-small":"never",Df=(od!==void 0||!isMultiSelectVariant(Du))&&Xd,Cp=useResponsiveValue(Xd?{regular:"anchored",narrow:"fullscreen"}:void 0,"anchored");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AnchoredOverlay,{renderAnchor:xh,anchorRef:Ch,align:wd,open:Au,onOpen:wh,onClose:$h,overlayProps:{role:"dialog","aria-labelledby":kd,"aria-describedby":Lu?md:void 0,...Vu,...sd==="modal"?{top:"50vh",left:"50vw",anchorSide:void 0}:{},style:{transform:sd==="modal"?"translate(-50%, -50%)":void 0,...zd?{maxHeight:Od!==void 0?`${Od}px`:"auto"}:{}}},focusTrapSettings:Dh,focusZoneSettings,height:Yu,width:Xu,anchorId:ed,variant:Xd?{regular:"anchored",narrow:"fullscreen"}:void 0,pinPosition:!Yu,className:classes$5.Overlay,displayCloseButton:Df,closeButtonProps:{"aria-label":"Cancel and close"},children:jsxRuntimeExports.jsxs("div",{className:classes$5.Wrapper,"data-variant":sd,children:[jsxRuntimeExports.jsxs("div",{className:classes$5.Header,"data-variant":Cp,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Heading$2,{as:"h1",id:kd,className:classes$5.Title,children:Mu}),Lu?jsxRuntimeExports.jsx("div",{id:md,className:classes$5.Subtitle,children:Lu}):null]}),sd==="modal"&&!rh?jsxRuntimeExports.jsx(IconButton,{type:"button",variant:"invisible",icon:XIcon,"aria-label":"Cancel and close",className:classes$5.ResponsiveCloseButton,onClick:()=>{od?.(),Th()}}):null]}),nd&&jsxRuntimeExports.jsxs("div",{ref:qd,"data-variant":nd.variant,className:classes$5.Notice,children:[hp[nd.variant],jsxRuntimeExports.jsx("div",{children:nd.text})]}),jsxRuntimeExports.jsx(FilteredActionList,{filterValue:hd,onFilterChange:Zd,onListContainerRefChanged:Nd,onInputRefChanged:xd,placeholderText:Pu,...yd,variant:(Sd=yd.groupMetadata)!==null&&Sd!==void 0&&Sd.length?"horizontal-inset":"inset",role:"listbox","aria-labelledby":yd["aria-label"]?void 0:kd,"aria-multiselectable":isMultiSelectVariant(Du)?"true":"false",selectionVariant:_h?"radio":isMultiSelectVariant(Du)?"multiple":"single",items:Kh,textInputProps:ep,loading:Wu||ld&&!td,loadingType:np(),onSelectAllChange:_d?gh:void 0,message:gp(),messageText:{title:td?.title||EMPTY_MESSAGE.title,description:typeof td?.body=="string"?td.body:EMPTY_MESSAGE.description},fullScreenOnNarrow:Xd,sx:Gu,className:clsx(Ju,classes$5.FilteredActionList)}),Uu?jsxRuntimeExports.jsx("div",{className:classes$5.Footer,children:Uu}):cp?jsxRuntimeExports.jsxs("div",{"data-display-footer":qh,"data-stretch-secondary-action":zh,"data-stretch-save-button":Yh,className:clsx(classes$5.Footer,classes$5.ResponsiveFooter),children:[jsxRuntimeExports.jsx("div",{"data-stretch-secondary-action":zh,className:classes$5.SecondaryAction,children:ad}),Jh||_p?jsxRuntimeExports.jsxs("div",{"data-stretch-save-button":Yh,className:clsx(classes$5.CancelSaveButtons,{[classes$5.ResponsiveSaveButton]:_p}),children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"medium",onClick:()=>{od?.(),Th()},children:"Cancel"}),jsxRuntimeExports.jsx(ButtonComponent,{block:od===void 0,variant:"primary",size:"medium",onClick:()=>{_h&&Bu(Sh),$h(sd==="modal"?"selection":"click-outside")},children:"Save"})]}):null,sp?jsxRuntimeExports.jsx("div",{className:classes$5.ResponsiveSaveButton,"data-stretch-save-button":Yh,children:jsxRuntimeExports.jsx(ButtonComponent,{block:!0,variant:"primary",size:"medium",onClick:()=>{$h("click-outside")},children:"Save and close"})}):null]}):null]})}),sd==="modal"&&Au?jsxRuntimeExports.jsx("div",{className:classes$5.Backdrop}):null]})}const SecondaryButton=Au=>jsxRuntimeExports.jsx(ButtonComponent,{block:!0,...Au,children:Au.children});SecondaryButton.displayName="SecondaryButton";const SecondaryLink=Au=>jsxRuntimeExports.jsx(LinkButton,{...Au,variant:"invisible",block:!0,children:Au.children});SecondaryLink.displayName="SecondaryLink";const SelectPanel=Object.assign(Panel$1,{SecondaryActionButton:SecondaryButton,SecondaryActionLink:SecondaryLink}),FormControl=vM.forwardRef((Au,lo)=>{var $u,Ru;const Iu=distExports.c(27),{children:Pu,disabled:Ou,layout:Du,id:Mu,required:Lu,sx:Bu,className:ju}=Au,Fu=Du===void 0?"vertical":Du;let zu;Iu[0]===Symbol.for("react.memo_cache_sentinel")?(zu={caption:FormControlCaption,label:FormControlLabel,leadingVisual:FormControlLeadingVisual,validation:FormControlValidation},Iu[0]=zu):zu=Iu[0];const[Uu,Hu]=useSlots(Pu,zu),Vu=[Autocomplete$1,Checkbox,Radio,Select$1,TextInput$1,TextInputWithTokens,Textarea,SelectPanel],Wu=reactExports.useContext(CheckboxOrRadioGroupContext).disabled||Ou,Zu=useId(Mu),Ju=Uu.validation?`${Zu}-validationMessage`:void 0,Yu=Uu.caption?`${Zu}-caption`:void 0,Xu=($u=Uu.validation)===null||$u===void 0?void 0:$u.props.variant,ed=Hu.find(vd=>Vu.some(ld=>vM.isValidElement(vd)&&vd.type===ld));vM.isValidElement(ed)&&ed.props;const td=vM.isValidElement(ed)&&(ed.type===Checkbox||ed.type===Radio),nd=vM.isValidElement(ed)&&ed.type===Radio;Uu.label||console.error(`The input field with the id ${Zu} MUST have a FormControl.Label child.
92
92
 
93
- If you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`);const od=(Ru=Uu.label)===null||Ru===void 0?void 0:Ru.props.visuallyHidden,sd=classes$6,ad=vM.isValidElement(ed)?vM.cloneElement(ed,{id:Zu,disabled:Wu,required:Lu&&!nd,"aria-describedby":Yu}):null;let pd;Iu[1]!==Hu?(pd=Hu.filter(_temp2$1),Iu[1]=Hu,Iu[2]=pd):pd=Iu[2];let bd;Iu[3]!==sd.ControlChoiceInputs||Iu[4]!==ad||Iu[5]!==pd?(bd=jsxRuntimeExports.jsxs("div",{className:sd.ControlChoiceInputs,children:[ad,pd]}),Iu[3]=sd.ControlChoiceInputs,Iu[4]=ad,Iu[5]=pd,Iu[6]=bd):bd=Iu[6];let wd;Iu[7]!==Wu||Iu[8]!==Uu.caption||Iu[9]!==Uu.leadingVisual?(wd=Uu.leadingVisual?jsxRuntimeExports.jsx("div",{className:classes$6.LeadingVisual,"data-disabled":Wu?"":void 0,"data-has-caption":Uu.caption?"":void 0,children:Uu.leadingVisual}):null,Iu[7]=Wu,Iu[8]=Uu.caption,Iu[9]=Uu.leadingVisual,Iu[10]=wd):wd=Iu[10];let _d;Iu[11]!==Uu.caption||Iu[12]!==Uu.label?(_d=jsxRuntimeExports.jsxs("div",{className:classes$6.LabelContainer,children:[Uu.label,Uu.caption]}),Iu[11]=Uu.caption,Iu[12]=Uu.label,Iu[13]=_d):_d=Iu[13];let yd;Iu[14]!==bd||Iu[15]!==wd||Iu[16]!==_d?(yd=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[bd,wd,_d]}),Iu[14]=bd,Iu[15]=wd,Iu[16]=_d,Iu[17]=yd):yd=Iu[17];const Sd=yd;let kd;Iu[18]!==Yu||Iu[19]!==Wu||Iu[20]!==Zu||Iu[21]!==Lu||Iu[22]!==Ju?(kd={captionId:Yu,disabled:Wu,id:Zu,required:Lu,validationMessageId:Ju},Iu[18]=Yu,Iu[19]=Wu,Iu[20]=Zu,Iu[21]=Lu,Iu[22]=Ju,Iu[23]=kd):kd=Iu[23];const md=td||Fu==="horizontal"?jsxRuntimeExports.jsx(BoxWithFallback,{ref:lo,"data-has-leading-visual":Uu.leadingVisual?"":void 0,sx:Bu,className:clsx(ju,classes$6.ControlHorizontalLayout),children:Sd}):jsxRuntimeExports.jsxs(BoxWithFallback,{ref:lo,"data-has-label":od?void 0:"",sx:Bu,className:clsx(ju,classes$6.ControlVerticalLayout),children:[Uu.label,vM.isValidElement(ed)&&vM.cloneElement(ed,Object.assign({id:Zu,required:Lu,disabled:Wu,validationStatus:Xu,"aria-describedby":[Ju,Yu].filter(Boolean).join(" ")},ed.props)),Hu.filter(vd=>vM.isValidElement(vd)&&!Vu.some(ld=>vd.type===ld)),Uu.validation?jsxRuntimeExports.jsx(ValidationAnimationContainer,{show:!0,children:Uu.validation}):null,Uu.caption]});let dd;return Iu[24]!==kd||Iu[25]!==md?(dd=jsxRuntimeExports.jsx(FormControlContextProvider,{value:kd,children:md}),Iu[24]=kd,Iu[25]=md,Iu[26]=dd):dd=Iu[26],dd});var FormControl$1=Object.assign(FormControl,{Caption:FormControlCaption,Label:FormControlLabel,LeadingVisual:FormControlLeadingVisual,Validation:FormControlValidation});function _temp2$1(Au){return vM.isValidElement(Au)&&![Checkbox,Radio].some(lo=>Au.type===lo)}var classes$2={SegmentedControl:"prc-SegmentedControl-SegmentedControl-e7570",Item:"prc-SegmentedControl-Item-7Aq6h",Button:"prc-SegmentedControl-Button-ojWXD",IconButton:"prc-SegmentedControl-IconButton-O80Eh",Content:"prc-SegmentedControl-Content-gnQ4n",Text:"prc-SegmentedControl-Text-c5gSh",LeadingIcon:"prc-SegmentedControl-LeadingIcon-dAHA8"};const SegmentedControlButton=Au=>{const lo=distExports.c(28);let $u,Ru,Iu,Pu,Ou,Du;if(lo[0]!==Au){const{children:Wu,leadingIcon:Zu,selected:Ju,sx:Yu,className:Xu,defaultSelected:ed,...td}=Au;Ru=Wu,$u=Zu,Ou=Ju,Du=Yu,Iu=Xu,Pu=td,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du}else $u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6];let Mu;lo[7]===Symbol.for("react.memo_cache_sentinel")?(Mu=clsx(classes$2.Item),lo[7]=Mu):Mu=lo[7];const Lu=Ou?"":void 0;let Bu;lo[8]!==Iu?(Bu=clsx(classes$2.Button,Iu),lo[8]=Iu,lo[9]=Bu):Bu=lo[9];let ju;lo[10]===Symbol.for("react.memo_cache_sentinel")?(ju=clsx(classes$2.Content,"segmentedControl-content"),lo[10]=ju):ju=lo[10];let Fu;lo[11]!==$u?(Fu=$u&&jsxRuntimeExports.jsx("div",{className:classes$2.LeadingIcon,children:reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{})}),lo[11]=$u,lo[12]=Fu):Fu=lo[12];let zu;lo[13]===Symbol.for("react.memo_cache_sentinel")?(zu=clsx(classes$2.Text,"segmentedControl-text"),lo[13]=zu):zu=lo[13];let Uu;lo[14]!==Ru?(Uu=jsxRuntimeExports.jsx("div",{className:zu,"data-text":Ru,children:Ru}),lo[14]=Ru,lo[15]=Uu):Uu=lo[15];let Hu;lo[16]!==Fu||lo[17]!==Uu?(Hu=jsxRuntimeExports.jsxs("span",{className:ju,children:[Fu,Uu]}),lo[16]=Fu,lo[17]=Uu,lo[18]=Hu):Hu=lo[18];let Vu;lo[19]!==Pu||lo[20]!==Ou||lo[21]!==Bu||lo[22]!==Hu?(Vu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-current":Ou,className:Bu,type:"button",...Pu,children:Hu}),lo[19]=Pu,lo[20]=Ou,lo[21]=Bu,lo[22]=Hu,lo[23]=Vu):Vu=lo[23];let Gu;return lo[24]!==Du||lo[25]!==Lu||lo[26]!==Vu?(Gu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Du,className:Mu,"data-selected":Lu,children:Vu}),lo[24]=Du,lo[25]=Lu,lo[26]=Vu,lo[27]=Gu):Gu=lo[27],Gu},SegmentedControlIconButton=Au=>{const lo=distExports.c(50);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu;if(lo[0]!==Au?({"aria-label":Ru,icon:$u,selected:Du,sx:Mu,className:Iu,description:Pu,tooltipDirection:Lu,...Ou}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8]),useFeatureFlag("primer_react_segmented_control_tooltip")){let ju;lo[9]!==Iu?(ju=clsx(classes$2.Item,Iu),lo[9]=Iu,lo[10]=ju):ju=lo[10];const Fu=Du||void 0,zu=Pu?void 0:"label",Uu=Pu||Ru,Hu=Pu?Ru:void 0;let Vu;lo[11]===Symbol.for("react.memo_cache_sentinel")?(Vu=clsx(classes$2.Button,classes$2.IconButton),lo[11]=Vu):Vu=lo[11];let Gu;lo[12]===Symbol.for("react.memo_cache_sentinel")?(Gu=clsx(classes$2.Content,"segmentedControl-content"),lo[12]=Gu):Gu=lo[12];let Wu;lo[13]!==$u?(Wu=reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{}),lo[13]=$u,lo[14]=Wu):Wu=lo[14];let Zu;lo[15]!==Wu?(Zu=jsxRuntimeExports.jsx("span",{className:Gu,children:Wu}),lo[15]=Wu,lo[16]=Zu):Zu=lo[16];let Ju;lo[17]!==Ou||lo[18]!==Du||lo[19]!==Hu||lo[20]!==Zu?(Ju=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-current":Du,"aria-label":Hu,className:Vu,...Ou,children:Zu}),lo[17]=Ou,lo[18]=Du,lo[19]=Hu,lo[20]=Zu,lo[21]=Ju):Ju=lo[21];let Yu;lo[22]!==Ju||lo[23]!==zu||lo[24]!==Uu||lo[25]!==Lu?(Yu=jsxRuntimeExports.jsx(Tooltip,{type:zu,text:Uu,direction:Lu,children:Ju}),lo[22]=Ju,lo[23]=zu,lo[24]=Uu,lo[25]=Lu,lo[26]=Yu):Yu=lo[26];let Xu;return lo[27]!==Mu||lo[28]!==ju||lo[29]!==Yu||lo[30]!==Fu?(Xu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Mu,className:ju,"data-selected":Fu,children:Yu}),lo[27]=Mu,lo[28]=ju,lo[29]=Yu,lo[30]=Fu,lo[31]=Xu):Xu=lo[31],Xu}else{let ju;lo[32]!==Iu?(ju=clsx(classes$2.Item,Iu),lo[32]=Iu,lo[33]=ju):ju=lo[33];const Fu=Du||void 0;let zu;lo[34]===Symbol.for("react.memo_cache_sentinel")?(zu=clsx(classes$2.Button,classes$2.IconButton),lo[34]=zu):zu=lo[34];let Uu;lo[35]===Symbol.for("react.memo_cache_sentinel")?(Uu=clsx(classes$2.Content,"segmentedControl-content"),lo[35]=Uu):Uu=lo[35];let Hu;lo[36]!==$u?(Hu=reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{}),lo[36]=$u,lo[37]=Hu):Hu=lo[37];let Vu;lo[38]!==Hu?(Vu=jsxRuntimeExports.jsx("span",{className:Uu,children:Hu}),lo[38]=Hu,lo[39]=Vu):Vu=lo[39];let Gu;lo[40]!==Ru||lo[41]!==Ou||lo[42]!==Du||lo[43]!==Vu?(Gu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-label":Ru,"aria-current":Du,className:zu,...Ou,children:Vu}),lo[40]=Ru,lo[41]=Ou,lo[42]=Du,lo[43]=Vu,lo[44]=Gu):Gu=lo[44];let Wu;return lo[45]!==Mu||lo[46]!==ju||lo[47]!==Fu||lo[48]!==Gu?(Wu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Mu,className:ju,"data-selected":Fu,children:Gu}),lo[45]=Mu,lo[46]=ju,lo[47]=Fu,lo[48]=Gu,lo[49]=Wu):Wu=lo[49],Wu}},Root=Au=>{const lo=distExports.c(30);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;lo[0]!==Au?({"aria-label":$u,"aria-labelledby":Ru,children:Iu,fullWidth:Ou,onChange:Du,size:Lu,sx:Bu,variant:ju,className:Pu,...Mu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu,lo[9]=Bu,lo[10]=ju):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8],Bu=lo[9],ju=lo[10]);const Fu=ju===void 0?"default":ju,zu=reactExports.useRef(null),{theme:Uu}=useTheme();let Hu;lo[11]!==Iu||lo[12]!==Du?(Hu=Du===void 0||vM.Children.toArray(Iu).some(_temp),lo[11]=Iu,lo[12]=Du,lo[13]=Hu):Hu=lo[13];const Vu=Hu,Gu=useResponsiveValue(Fu,"default"),Wu=useResponsiveValue(Ou,!1);let Zu;if(lo[14]!==Iu){const nd=vM.Children.toArray(Iu).map(_temp2);Zu=nd.some(_temp3)?nd.indexOf(!0):0,lo[14]=Iu,lo[15]=Zu}else Zu=lo[15];const Ju=Zu,[Yu,Xu]=reactExports.useState(Ju),ed=Vu?Yu:Ju;let td;if(lo[16]!==$u||lo[17]!==Ru||lo[18]!==Iu||lo[19]!==Pu||lo[20]!==Wu||lo[21]!==Vu||lo[22]!==Du||lo[23]!==Gu||lo[24]!==Mu||lo[25]!==ed||lo[26]!==Lu||lo[27]!==Bu||lo[28]!==Uu?.colors){const nd=vM.isValidElement(vM.Children.toArray(Iu)[ed])?vM.Children.toArray(Iu)[ed]:void 0,od=_temp4,sd=_temp5;!$u&&!Ru&&console.warn("Use the `aria-label` or `aria-labelledby` prop to provide an accessible label for assistive technologies"),td=Gu==="dropdown"?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ActionMenu,{children:[jsxRuntimeExports.jsx(ActionMenu.Button,{"aria-label":$u&&`${sd(nd)}, ${$u}`,leadingVisual:od(nd),children:sd(nd)}),jsxRuntimeExports.jsx(ActionMenu.Overlay,{"aria-labelledby":Ru,children:jsxRuntimeExports.jsx(ActionList,{selectionVariant:"single",children:vM.Children.map(Iu,(ad,pd)=>{const bd=od(ad);return vM.isValidElement(ad)?jsxRuntimeExports.jsxs(ActionList.Item,{selected:pd===ed,onSelect:wd=>{Vu&&Xu(pd),Du&&Du(pd),ad.props.onClick&&ad.props.onClick(wd)},children:[bd," ",sd(ad)]},`segmented-control-action-btn-${pd}`):null})})})]})}):jsxRuntimeExports.jsx(BoxWithFallback,{as:"ul",sx:Bu,"aria-label":$u,"aria-labelledby":Ru,ref:zu,className:clsx(classes$2.SegmentedControl,Pu),"data-full-width":Wu||void 0,"data-size":Lu,...Mu,children:vM.Children.map(Iu,(ad,pd)=>{if(!vM.isValidElement(ad))return null;const bd={onClick:Du?wd=>{Du(pd),Vu&&Xu(pd),ad.props.onClick&&ad.props.onClick(wd)}:wd=>{ad.props.onClick&&ad.props.onClick(wd),Vu&&Xu(pd)},selected:pd===ed,style:{"--separator-color":pd===ed||pd===ed-1?"transparent":Uu?.colors.border.default,...ad.props.style},sx:ad.props.sx};if(Gu==="hideLabels"&&vM.isValidElement(ad)&&ad.type===SegmentedControlButton){const{"aria-label":wd,leadingIcon:_d,children:yd,...Sd}=ad.props,{sx:kd,...md}=bd;if(!_d)console.warn("A `leadingIcon` prop is required when hiding visible labels");else return jsxRuntimeExports.jsx(SegmentedControlIconButton,{"aria-label":wd||yd,icon:_d,sx:{...kd,width:Wu?"100%":"32px"},...md,...Sd})}return vM.cloneElement(ad,bd)})}),lo[16]=$u,lo[17]=Ru,lo[18]=Iu,lo[19]=Pu,lo[20]=Wu,lo[21]=Vu,lo[22]=Du,lo[23]=Gu,lo[24]=Mu,lo[25]=ed,lo[26]=Lu,lo[27]=Bu,lo[28]=Uu?.colors,lo[29]=td}else td=lo[29];return td};Root.displayName="SegmentedControl";const SegmentedControl=Object.assign(Root,{Button:SegmentedControlButton,IconButton:SegmentedControlIconButton});function _temp(Au){return vM.isValidElement(Au)&&Au.props.defaultSelected!==void 0}function _temp2(Au){return vM.isValidElement(Au)&&(Au.props.defaultSelected||Au.props.selected)}function _temp3(Au){return Au}function _temp4(Au){if(vM.isValidElement(Au)&&Au.type===SegmentedControlButton&&Au.props.leadingIcon){if(reactIsExports.isElement(Au.props.leadingIcon))return Au.props.leadingIcon;{const lo=Au.props.leadingIcon;return jsxRuntimeExports.jsx(lo,{})}}if(vM.isValidElement(Au)&&Au.type===SegmentedControlIconButton&&!reactIsExports.isElement(Au.props.icon)){const lo=Au.props.icon;return jsxRuntimeExports.jsx(lo,{})}return null}function _temp5(Au){return vM.isValidElement(Au)&&Au.type===SegmentedControlButton?Au.props.children:vM.isValidElement(Au)?Au.props["aria-label"]:null}var classes$1={SkeletonText:"prc-SkeletonText-SkeletonText-tW5nH",SkeletonTextWrapper:"prc-SkeletonText-SkeletonTextWrapper-3Z0sU"};function SkeletonText(Au){const lo=distExports.c(32);let $u,Ru,Iu,Pu,Ou,Du;lo[0]!==Au?({lines:Ou,maxWidth:Ru,size:Du,className:$u,style:Pu,...Iu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6]);const Mu=Ou===void 0?1:Ou,Lu=Du===void 0?"bodyMedium":Du;if(Mu<2){let zu;lo[7]!==$u?(zu=clsx($u,classes$1.SkeletonText),lo[7]=$u,lo[8]=zu):zu=lo[8];let Uu;lo[9]!==Ru||lo[10]!==Pu?(Uu={...Pu,maxWidth:Ru},lo[9]=Ru,lo[10]=Pu,lo[11]=Uu):Uu=lo[11];let Hu;return lo[12]!==Iu||lo[13]!==Lu||lo[14]!==zu||lo[15]!==Uu?(Hu=jsxRuntimeExports.jsx(SkeletonBox,{"data-component":"SkeletonText","data-text-skeleton-size":Lu,width:"100%",className:zu,style:Uu,...Iu}),lo[12]=Iu,lo[13]=Lu,lo[14]=zu,lo[15]=Uu,lo[16]=Hu):Hu=lo[16],Hu}let Bu;lo[17]!==Ru||lo[18]!==Pu?(Bu={...Pu,maxWidth:Ru},lo[17]=Ru,lo[18]=Pu,lo[19]=Bu):Bu=lo[19];let ju;if(lo[20]!==$u||lo[21]!==Mu||lo[22]!==Iu||lo[23]!==Lu){let zu;lo[25]!==$u||lo[26]!==Iu||lo[27]!==Lu?(zu=(Uu,Hu)=>jsxRuntimeExports.jsx(SkeletonBox,{"data-component":"SkeletonText","data-in-multiline":"true","data-text-skeleton-size":Lu,className:clsx($u,classes$1.SkeletonText),...Iu},Hu),lo[25]=$u,lo[26]=Iu,lo[27]=Lu,lo[28]=zu):zu=lo[28],ju=Array.from({length:Mu},zu),lo[20]=$u,lo[21]=Mu,lo[22]=Iu,lo[23]=Lu,lo[24]=ju}else ju=lo[24];let Fu;return lo[29]!==Bu||lo[30]!==ju?(Fu=jsxRuntimeExports.jsx("div",{"data-component":"multilineContainer",className:classes$1.SkeletonTextWrapper,style:Bu,children:ju}),lo[29]=Bu,lo[30]=ju,lo[31]=Fu):Fu=lo[31],Fu}const BOX_COLOR_VARS={"fg.default":"--fgColor-default","fg.muted":"--fgColor-muted","fg.subtle":"--fgColor-muted","fg.onEmphasis":"--fgColor-onEmphasis","canvas.default":"--bgColor-default","canvas.overlay":"--overlay-bgColor","canvas.inset":"--bgColor-inset","canvas.subtle":"--bgColor-muted","border.default":"--borderColor-default","border.muted":"--borderColor-muted","border.subtle":"--borderColor-muted","neutral.emphasisPlus":"--bgColor-emphasis","neutral.emphasis":"--bgColor-neutral-emphasis","neutral.muted":"--bgColor-neutral-muted","neutral.subtle":"--bgColor-neutral-muted","accent.fg":"--fgColor-accent","accent.emphasis":"--bgColor-accent-emphasis","accent.muted":"--borderColor-accent-muted","accent.subtle":"--bgColor-accent-muted","success.fg":"--fgColor-success","success.emphasis":"--bgColor-success-emphasis","success.muted":"--borderColor-success-muted","success.subtle":"--bgColor-success-muted","attention.fg":"--fgColor-attention","attention.emphasis":"--bgColor-attention-emphasis","attention.muted":"--borderColor-attention-muted","attention.subtle":"--bgColor-attention-muted","severe.fg":"--fgColor-severe","severe.emphasis":"--bgColor-severe-emphasis","severe.muted":"--borderColor-severe-muted","severe.subtle":"--bgColor-severe-muted","danger.fg":"--fgColor-danger","danger.emphasis":"--borderColor-danger-emphasis","danger.muted":"--borderColor-danger-muted","danger.subtle":"--bgColor-danger-muted","open.fg":"--fgColor-open","open.emphasis":"--bgColor-open-emphasis","open.muted":"--borderColor-open-muted","open.subtle":"--bgColor-open-muted","closed.fg":"--fgColor-closed","closed.emphasis":"--bgColor-closed-emphasis","closed.muted":"--borderColor-closed-muted","closed.subtle":"--bgColor-closed-muted","done.fg":"--fgColor-done","done.emphasis":"--bgColor-done-emphasis","done.muted":"--borderColor-done-muted","done.subtle":"--bgColor-done-muted","sponsors.fg":"--fgColor-sponsors","sponsors.emphasis":"--bgColor-sponsors-emphasis","sponsors.muted":"--borderColor-sponsors-muted","sponsors.subtle":"--bgColor-sponsors-muted","actionListItem.default.hoverBg":"--control-transparent-bgColor-hover","actionListItem.default.activeBg":"--control-transparent-bgColor-active"},BOX_SHADOW_VARS={"shadow.small":"--shadow-resting-small","shadow.medium":"--shadow-resting-medium","shadow.large":"--shadow-floating-large","shadow.extraLarge":"--shadow-floating-xlarge"},BOX_BREAKPOINTS=["544px","768px","1012px","1280px"],BOX_SPACE=["0","4px","8px","16px","24px","32px","40px","48px","64px","80px","96px","112px","128px"],BOX_FONT_SIZES=["12px","14px","16px","20px","24px","32px","40px","48px","56px"],BOX_RADII=["0","3px","6px","100px"],BOX_RADIUS_VARS={small:"--borderRadius-small",medium:"--borderRadius-medium",large:"--borderRadius-large",full:"--borderRadius-full",control:"--theme-radius-control",card:"--theme-radius-card",bubble:"--theme-radius-bubble",frame:"--theme-radius-frame",overlay:"--theme-radius-overlay"},BOX_BORDER_WIDTHS=["0","1px"],BOX_SIZES={small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},BOX_FONT_WEIGHT_VARS={light:"--base-text-weight-light",normal:"--base-text-weight-normal",medium:"--base-text-weight-medium",semibold:"--base-text-weight-medium",bold:"--base-text-weight-semibold"},BOX_LINE_HEIGHTS={condensedUltra:"1",condensed:"1.25",default:"1.5"},BOX_FONT_VARS={normal:"--fontStack-system",mono:"--fontStack-monospace"};[...Object.values(BOX_COLOR_VARS),...Object.values(BOX_SHADOW_VARS),...Object.values(BOX_RADIUS_VARS),...Object.values(BOX_FONT_WEIGHT_VARS),...Object.values(BOX_FONT_VARS)];const prop=(Au,lo)=>({css:Array.isArray(Au)?Au:[Au],scale:lo??"raw"}),BOX_STYLE_PROPS={m:prop("margin","signedSpace"),mt:prop("margin-top","signedSpace"),mr:prop("margin-right","signedSpace"),mb:prop("margin-bottom","signedSpace"),ml:prop("margin-left","signedSpace"),mx:prop(["margin-left","margin-right"],"signedSpace"),my:prop(["margin-top","margin-bottom"],"signedSpace"),margin:prop("margin","signedSpace"),marginTop:prop("margin-top","signedSpace"),marginRight:prop("margin-right","signedSpace"),marginBottom:prop("margin-bottom","signedSpace"),marginLeft:prop("margin-left","signedSpace"),marginX:prop(["margin-left","margin-right"],"signedSpace"),marginY:prop(["margin-top","margin-bottom"],"signedSpace"),p:prop("padding","space"),pt:prop("padding-top","space"),pr:prop("padding-right","space"),pb:prop("padding-bottom","space"),pl:prop("padding-left","space"),px:prop(["padding-left","padding-right"],"space"),py:prop(["padding-top","padding-bottom"],"space"),padding:prop("padding","space"),paddingTop:prop("padding-top","space"),paddingRight:prop("padding-right","space"),paddingBottom:prop("padding-bottom","space"),paddingLeft:prop("padding-left","space"),paddingX:prop(["padding-left","padding-right"],"space"),paddingY:prop(["padding-top","padding-bottom"],"space"),paddingBlock:prop("padding-block","space"),paddingInline:prop("padding-inline","space"),gap:prop("gap","space"),rowGap:prop("row-gap","space"),columnGap:prop("column-gap","space"),gridGap:prop("gap","space"),gridRowGap:prop("row-gap","space"),gridColumnGap:prop("column-gap","space"),scrollMarginTop:prop("scroll-margin-top"),color:prop("color","color"),bg:prop("background-color","color"),backgroundColor:prop("background-color","color"),fill:prop("fill","color"),stroke:prop("stroke","color"),outlineColor:prop("outline-color","color"),opacity:prop("opacity","unitless"),background:prop("background"),backgroundImage:prop("background-image"),backgroundSize:prop("background-size"),backgroundPosition:prop("background-position"),backgroundRepeat:prop("background-repeat"),border:prop("border"),borderTop:prop("border-top"),borderRight:prop("border-right"),borderBottom:prop("border-bottom"),borderLeft:prop("border-left"),borderX:prop(["border-left","border-right"]),borderY:prop(["border-top","border-bottom"]),borderColor:prop("border-color","color"),borderTopColor:prop("border-top-color","color"),borderRightColor:prop("border-right-color","color"),borderBottomColor:prop("border-bottom-color","color"),borderLeftColor:prop("border-left-color","color"),borderWidth:prop("border-width","borderWidth"),borderTopWidth:prop("border-top-width","borderWidth"),borderRightWidth:prop("border-right-width","borderWidth"),borderBottomWidth:prop("border-bottom-width","borderWidth"),borderLeftWidth:prop("border-left-width","borderWidth"),borderStyle:prop("border-style"),borderTopStyle:prop("border-top-style"),borderRightStyle:prop("border-right-style"),borderBottomStyle:prop("border-bottom-style"),borderLeftStyle:prop("border-left-style"),borderRadius:prop("border-radius","radius"),borderTopLeftRadius:prop("border-top-left-radius","radius"),borderTopRightRadius:prop("border-top-right-radius","radius"),borderBottomLeftRadius:prop("border-bottom-left-radius","radius"),borderBottomRightRadius:prop("border-bottom-right-radius","radius"),borderCollapse:prop("border-collapse"),borderSpacing:prop("border-spacing"),outline:prop("outline"),outlineOffset:prop("outline-offset"),boxShadow:prop("box-shadow","shadow"),textShadow:prop("text-shadow","shadow"),display:prop("display"),width:prop("width","size"),height:prop("height","size"),minWidth:prop("min-width","size"),maxWidth:prop("max-width","size"),minHeight:prop("min-height","size"),maxHeight:prop("max-height","size"),size:prop(["width","height"],"size"),overflow:prop("overflow"),overflowX:prop("overflow-x"),overflowY:prop("overflow-y"),overscrollBehavior:prop("overscroll-behavior"),overscrollBehaviorY:prop("overscroll-behavior-y"),scrollbarWidth:prop("scrollbar-width"),scrollbarGutter:prop("scrollbar-gutter"),verticalAlign:prop("vertical-align"),boxSizing:prop("box-sizing"),aspectRatio:prop("aspect-ratio","unitless"),visibility:prop("visibility"),objectFit:prop("object-fit"),objectPosition:prop("object-position"),float:prop("float"),isolation:prop("isolation"),tableLayout:prop("table-layout"),flex:prop("flex","unitless"),flexDirection:prop("flex-direction"),flexWrap:prop("flex-wrap"),flexFlow:prop("flex-flow"),flexGrow:prop("flex-grow","unitless"),flexShrink:prop("flex-shrink","unitless"),flexBasis:prop("flex-basis","size"),alignItems:prop("align-items"),alignContent:prop("align-content"),alignSelf:prop("align-self"),justifyContent:prop("justify-content"),justifyItems:prop("justify-items"),justifySelf:prop("justify-self"),placeItems:prop("place-items"),placeContent:prop("place-content"),placeSelf:prop("place-self"),order:prop("order","unitless"),gridTemplate:prop("grid-template"),gridTemplateColumns:prop("grid-template-columns"),gridTemplateRows:prop("grid-template-rows"),gridTemplateAreas:prop("grid-template-areas"),gridColumn:prop("grid-column","unitless"),gridRow:prop("grid-row","unitless"),gridColumnStart:prop("grid-column-start","unitless"),gridColumnEnd:prop("grid-column-end","unitless"),gridRowStart:prop("grid-row-start","unitless"),gridRowEnd:prop("grid-row-end","unitless"),gridArea:prop("grid-area","unitless"),gridAutoFlow:prop("grid-auto-flow"),gridAutoColumns:prop("grid-auto-columns"),gridAutoRows:prop("grid-auto-rows"),position:prop("position"),zIndex:prop("z-index","unitless"),top:prop("top","signedSpace"),right:prop("right","signedSpace"),bottom:prop("bottom","signedSpace"),left:prop("left","signedSpace"),inset:prop("inset"),font:prop("font"),fontFamily:prop("font-family","font"),fontSize:prop("font-size","fontSize"),fontWeight:prop("font-weight","fontWeight"),fontStyle:prop("font-style"),fontVariantNumeric:prop("font-variant-numeric"),lineHeight:prop("line-height","lineHeight"),letterSpacing:prop("letter-spacing"),textAlign:prop("text-align"),whiteSpace:prop("white-space"),textDecoration:prop("text-decoration"),textUnderlineOffset:prop("text-underline-offset"),textTransform:prop("text-transform"),textOverflow:prop("text-overflow"),textWrap:prop("text-wrap"),wordBreak:prop("word-break"),overflowWrap:prop("overflow-wrap"),wordWrap:prop("word-wrap"),WebkitLineClamp:prop("-webkit-line-clamp","unitless"),WebkitBoxOrient:prop("-webkit-box-orient"),listStyle:prop("list-style"),listStyleType:prop("list-style-type"),listStylePosition:prop("list-style-position"),cursor:prop("cursor"),pointerEvents:prop("pointer-events"),touchAction:prop("touch-action"),all:prop("all"),userSelect:prop("user-select"),appearance:prop("appearance"),transition:prop("transition"),transform:prop("transform"),transformOrigin:prop("transform-origin"),animation:prop("animation"),animationDelay:prop("animation-delay"),filter:prop("filter"),backdropFilter:prop("backdrop-filter"),mixBlendMode:prop("mix-blend-mode"),willChange:prop("will-change"),clipPath:prop("clip-path"),clip:prop("clip"),resize:prop("resize")},BOX_PSEUDO_PROPS={hover:":hover",focus:":focus",focusVisible:":focus-visible",focusWithin:":focus-within",active:":active"},BOX_REDUCED_MOTION="@media (prefers-reduced-motion: reduce)",px$1=Au=>Au===0?"0":`${Au}px`,fromList=(Au,lo)=>Number.isInteger(lo)&&lo>=0&&lo<Au.length?Au[lo]:px$1(lo),varOf=Au=>`var(${Au})`;function resolveBoxValue(Au,lo){if(typeof lo=="number")switch(Au){case"space":return fromList(BOX_SPACE,lo);case"signedSpace":if(lo<0){const $u=fromList(BOX_SPACE,-lo);return $u==="0"?"0":`-${$u}`}return fromList(BOX_SPACE,lo);case"fontSize":return fromList(BOX_FONT_SIZES,lo);case"radius":return fromList(BOX_RADII,lo);case"borderWidth":return fromList(BOX_BORDER_WIDTHS,lo);case"unitless":case"fontWeight":case"lineHeight":return String(lo);default:return px$1(lo)}switch(Au){case"color":return lo in BOX_COLOR_VARS?varOf(BOX_COLOR_VARS[lo]):lo;case"shadow":return lo in BOX_SHADOW_VARS?varOf(BOX_SHADOW_VARS[lo]):lo;case"radius":return lo in BOX_RADIUS_VARS?varOf(BOX_RADIUS_VARS[lo]):lo;case"fontWeight":return lo in BOX_FONT_WEIGHT_VARS?varOf(BOX_FONT_WEIGHT_VARS[lo]):lo;case"lineHeight":return lo in BOX_LINE_HEIGHTS?BOX_LINE_HEIGHTS[lo]:lo;case"font":return lo in BOX_FONT_VARS?varOf(BOX_FONT_VARS[lo]):lo;case"size":return lo in BOX_SIZES?BOX_SIZES[lo]:lo;default:return lo}}const isSet=Au=>Au!=null&&Au!==!1&&Au!==""&&(typeof Au=="string"||typeof Au=="number");function addDeclarations(Au,lo,$u){const{css:Ru,scale:Iu}=BOX_STYLE_PROPS[lo];(Array.isArray($u)?$u.slice(0,BOX_BREAKPOINTS.length+1):[$u]).forEach((Ou,Du)=>{if(!isSet(Ou))return;const Mu=resolveBoxValue(Iu,Ou);(Au[Du]??=[]).push(...Ru.map(Lu=>[Lu,Mu]))})}const UNITLESS=new Set(["animationIterationCount","aspectRatio","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom","WebkitLineClamp"]),kebab$1=Au=>Au.startsWith("--")?Au:Au.replace(/^(Webkit|Moz|ms)(?=[A-Z])/,lo=>`-${lo.toLowerCase()}`).replace(/[A-Z]/g,lo=>`-${lo.toLowerCase()}`),RESETS=["all"],keysOf=Au=>{const lo=Object.keys(Au),$u=lo.filter(Ru=>RESETS.includes(Ru));return $u.length===0?lo:[...$u,...lo.filter(Ru=>!$u.includes(Ru))]};function blockOf(Au,lo=!1){const $u=[];for(const Ru of keysOf(Au)){const Iu=Au[Ru];Ru in BOX_STYLE_PROPS?addDeclarations($u,Ru,Iu):lo&&(isSet(Iu)||Array.isArray(Iu))&&(Array.isArray(Iu)?Iu.slice(0,BOX_BREAKPOINTS.length+1):[Iu]).forEach((Ou,Du)=>{if(!isSet(Ou))return;const Mu=typeof Ou=="number"&&!UNITLESS.has(Ru)&&!Ru.startsWith("--")?px$1(Ou):String(Ou);($u[Du]??=[]).push([kebab$1(Ru),Mu])})}return $u}const MEDIA=Au=>`@media screen and (min-width: ${BOX_BREAKPOINTS[Au-1]})`,PLACEHOLDER$1="\0";function rulesOf(Au,lo,$u=[]){const Ru=[];return Au.forEach((Iu,Pu)=>{if(!Iu||Iu.length===0)return;const Ou=Iu.map(([Mu,Lu])=>`${Mu}:${Lu}`).join(";");let Du=`${lo}{${Ou}}`;Pu>0&&(Du=`${MEDIA(Pu)}{${Du}}`);for(const Mu of[...$u].reverse())Du=`${Mu}{${Du}}`;Ru.push(Du)}),Ru}function splitSelectors(Au){const lo=[];let $u=0,Ru=0;for(let Iu=0;Iu<Au.length;Iu++){const Pu=Au[Iu];Pu==="("||Pu==="["?$u++:Pu===")"||Pu==="]"?$u--:Pu===","&&$u===0&&(lo.push(Au.slice(Ru,Iu).trim()),Ru=Iu+1)}return lo.push(Au.slice(Ru).trim()),lo.filter(Boolean)}function nestSelectors(Au,lo){return Au.flatMap($u=>splitSelectors(lo).map(Ru=>Ru.includes("&")?Ru.split("&").join($u):Ru.startsWith(":")?`${$u}${Ru}`:`${$u} ${Ru}`))}function sxRules(Au,lo,$u){const Ru=rulesOf(blockOf(Au,!0),lo.join(","),$u);for(const[Iu,Pu]of Object.entries(Au)){if(!Pu||typeof Pu!="object"||Array.isArray(Pu))continue;const Ou=Pu;if(Iu.startsWith("@keyframes")){const Du=Object.entries(Ou).map(([Mu,Lu])=>{const Bu=blockOf(Lu??{},!0)[0]??[];return`${Mu}{${Bu.map(([ju,Fu])=>`${ju}:${Fu}`).join(";")}}`}).join("");Ru.push(`${Iu}{${Du}}`)}else Iu.startsWith("@")?Ru.push(...sxRules(Ou,lo,[...$u,Iu])):Ru.push(...sxRules(Ou,nestSelectors(lo,Iu),$u))}return Ru}function hash$1(Au){let lo=2166136261;for(let $u=0;$u<Au.length;$u++)lo^=Au.charCodeAt($u),lo=Math.imul(lo,16777619);return(lo>>>0).toString(36)}const registry$3=new Map;function boxClassOf(Au,lo){const $u=`.${PLACEHOLDER$1}`,Ru=rulesOf(blockOf(Au),$u);for(const[Mu,Lu]of Object.entries(BOX_PSEUDO_PROPS)){const Bu=Au[Mu];Bu&&typeof Bu=="object"&&Ru.push(...rulesOf(blockOf(Bu),`${$u}${Lu}`))}const Iu=Au.reducedMotion;if(Iu&&typeof Iu=="object"&&Ru.push(...rulesOf(blockOf(Iu),$u,[BOX_REDUCED_MOTION])),lo&&typeof lo=="object"&&Ru.push(...sxRules(lo,[$u],[])),Ru.length===0)return;const Pu=Ru.join(""),Ou=`bx-${hash$1(Pu)}${Pu.length.toString(36)}`;let Du=registry$3.get(Ou);return Du||(Du={className:Ou,rules:Ru.map(Mu=>Mu.split(PLACEHOLDER$1).join(Ou))},registry$3.set(Ou,Du)),Du}const STYLE_ATTRIBUTE="data-primer-addons-box",sheets=new WeakMap;function sheetOf(Au){let lo=sheets.get(Au);if(!lo||!lo.element.isConnected){const Ru=(Au instanceof Document?Au:Au.ownerDocument).createElement("style");Ru.setAttribute(STYLE_ATTRIBUTE,""),(Au instanceof Document?Au.head:Au).appendChild(Ru),lo={element:Ru,inserted:new Set},sheets.set(Au,lo)}return lo}function injectBoxClass(Au,lo){const $u=sheetOf(Au);if($u.inserted.has(lo.className))return;$u.inserted.add(lo.className);const Ru=$u.element.sheet;for(const Iu of lo.rules)try{Ru?Ru.insertRule(Iu,Ru.cssRules.length):$u.element.appendChild($u.element.ownerDocument.createTextNode(Iu))}catch{}}const useIsomorphicLayoutEffect$1=typeof window>"u"?reactExports.useEffect:reactExports.useLayoutEffect,STYLE_KEYS=new Set([...Object.keys(BOX_STYLE_PROPS),...Object.keys(BOX_PSEUDO_PROPS),"reducedMotion"]),REF_AS_PROP=Number.parseInt(reactExports.version,10)>=19,isPlainFunction=Au=>typeof Au=="function"&&!Au.prototype?.isReactComponent,SIZED_ELEMENTS=new Set(["img","svg","video","canvas","iframe","embed","object"]);function assignRef(Au,lo){typeof Au=="function"?Au(lo):Au&&(Au.current=lo)}const BoxImpl=reactExports.forwardRef(function(lo,$u){const{as:Ru,sx:Iu,className:Pu,...Ou}=lo,Du=Ru??"div",Mu=Iu,Lu={},Bu={};for(const Vu of Object.keys(Ou))(STYLE_KEYS.has(Vu)?Lu:Bu)[Vu]=Ou[Vu];if(typeof Du=="string"&&SIZED_ELEMENTS.has(Du))for(const Vu of["width","height"]){const Gu=Ou[Vu];(typeof Gu=="string"||typeof Gu=="number")&&(Bu[Vu]=Gu)}const ju=boxClassOf(Lu,Mu),Fu=reactExports.useRef(null),zu=reactExports.useCallback(Vu=>{Fu.current=Vu instanceof Element?Vu:null,assignRef($u,Vu)},[$u]);reactExports.useInsertionEffect(()=>{ju&&typeof document<"u"&&injectBoxClass(document,ju)},[ju]),useIsomorphicLayoutEffect$1(()=>{const Vu=Fu.current?.getRootNode();ju&&typeof ShadowRoot<"u"&&Vu instanceof ShadowRoot&&injectBoxClass(Vu,ju)},[ju]);const Uu=[ju?.className,Pu].filter(Boolean).join(" ")||void 0,Hu=REF_AS_PROP||!isPlainFunction(Du)?zu:$u||void 0;return jsxRuntimeExports.jsx(Du,{ref:Hu,className:Uu,...Bu})});BoxImpl.displayName="Box";const Box=BoxImpl,datalayerColors={black:"#000000",gray:"#595A5C",white:"#FFFFFF",greenBrand:"#16A085",greenAccent:"#1ABC9C",greenText:"#117A65",greenTint:"#E9F7F1",greenBright:"#2ECC71",greenHover:"#0E6655",attentionBrand:"#B08800",attentionAccent:"#D4A72C",attentionTint:"#FFF8C5",dangerBrand:"#D1242F",dangerAccent:"#FF6A69",dangerTint:"#FFE5E5",severeBrand:"#BC4C00",severeAccent:"#F0883E",severeTint:"#FFF1E5",doneBrand:"#0969DA",doneAccent:"#54AEFF",doneTint:"#DDF4FF",brightGlow:"#00D68F",brightPop:"#00E5FF",brightSpark:"#76FF03",brightBlaze:"#FF1744",brightSurge:"#2979FF",brightFlame:"#FF6D00",brightGold:"#FFD600",brightLightGlow:"#00BFA5",brightLightPop:"#00B0FF",brightLightSpark:"#64DD17",brightLightBlaze:"#FF1744",brightLightSurge:"#2979FF",brightLightFlame:"#FF6D00",brightLightGold:"#FFAB00"},spatialColors={black:"#0B1120",gray:"#8892B0",white:"#F8FAFF",indigoBrand:"#4F46E5",indigoAccent:"#6366F1",indigoText:"#3730A3",indigoTint:"#EEF2FF",indigoBright:"#818CF8",indigoHover:"#312E81",attentionBrand:"#C58A00",attentionAccent:"#F2C94C",attentionTint:"#FFF4CC",dangerBrand:"#E5484D",dangerAccent:"#FF7A7F",dangerTint:"#FFE3E6",severeBrand:"#C96A1B",severeAccent:"#F4A259",severeTint:"#FFF1E6",doneBrand:"#7C4DFF",doneAccent:"#A78BFA",doneTint:"#EEE8FF",brightGlow:"#7C4DFF",brightPop:"#448AFF",brightSpark:"#E040FB",brightBlaze:"#FF5252",brightSurge:"#00B0FF",brightFlame:"#FF9100",brightGold:"#FFEA00",brightLightGlow:"#7C4DFF",brightLightPop:"#448AFF",brightLightSpark:"#D500F9",brightLightBlaze:"#FF5252",brightLightSurge:"#00B0FF",brightLightFlame:"#FF9100",brightLightGold:"#FFC400"},lovelyColors={black:"#1A0A14",gray:"#9D7A8F",white:"#FFF5F7",roseBrand:"#DB2777",roseAccent:"#EC4899",roseText:"#9D174D",roseTint:"#FDF2F8",roseBright:"#F472B6",roseHover:"#831843",attentionBrand:"#B7791F",attentionAccent:"#F6AD55",attentionTint:"#FFF5E6",dangerBrand:"#D61F69",dangerAccent:"#FF5C8A",dangerTint:"#FFE6EF",severeBrand:"#C05621",severeAccent:"#ED8936",severeTint:"#FFF1E8",doneBrand:"#805AD5",doneAccent:"#B794F4",doneTint:"#F3E8FF",brightGlow:"#FF4081",brightPop:"#FF6E40",brightSpark:"#EA80FC",brightBlaze:"#FF1744",brightSurge:"#536DFE",brightFlame:"#FF6E40",brightGold:"#FFD740",brightLightGlow:"#FF4081",brightLightPop:"#FF6E40",brightLightSpark:"#EA80FC",brightLightBlaze:"#FF1744",brightLightSurge:"#536DFE",brightLightFlame:"#FF6E40",brightLightGold:"#FFD740"},matrixColors={black:"#0D0208",gray:"#4A7856",white:"#F0FFF0",greenBrand:"#16A085",greenAccent:"#1ABC9C",greenText:"#117A65",greenTint:"#E8F5E9",greenPhosphor:"#00FF41",greenGlow:"#39FF14",greenHover:"#0E6655",greenTerminal:"#003B00",attentionBrand:"#A78E00",attentionAccent:"#FFEA00",attentionTint:"#3A3400",dangerBrand:"#C62828",dangerAccent:"#FF1744",dangerTint:"#3A0F16",severeBrand:"#C75B12",severeAccent:"#FF8A00",severeTint:"#332000",doneBrand:"#008B8B",doneAccent:"#00E5FF",doneTint:"#042A2E",brightGlow:"#39FF14",brightPop:"#00FF88",brightSpark:"#CCFF00",brightBlaze:"#FF0040",brightSurge:"#00E5FF",brightFlame:"#FF6D00",brightGold:"#FFEA00",brightLightGlow:"#00E676",brightLightPop:"#1DE9B6",brightLightSpark:"#AEEA00",brightLightBlaze:"#FF1744",brightLightSurge:"#00B0FF",brightLightFlame:"#FF6D00",brightLightGold:"#FFAB00"},earthColors={black:"#0A1628",gray:"#5B6B7A",white:"#F7FAFC",oceanBrand:"#0369A1",oceanAccent:"#0EA5E9",oceanText:"#075985",oceanTint:"#E0F2FE",oceanBright:"#38BDF8",oceanHover:"#0C4A6E",forestBrand:"#15803D",forestAccent:"#22C55E",forestTint:"#DCFCE7",sunBrand:"#CA8A04",sunAccent:"#EAB308",sunTint:"#FEF9C3",earthWarm:"#92400E",earthSand:"#D97706",earthClay:"#B45309",attentionBrand:"#CA8A04",attentionAccent:"#EAB308",attentionTint:"#FEF9C3",dangerBrand:"#B42318",dangerAccent:"#EF4444",dangerTint:"#FEE4E2",severeBrand:"#B45309",severeAccent:"#F59E0B",severeTint:"#FFF1DA",doneBrand:"#1D4ED8",doneAccent:"#3B82F6",doneTint:"#DBEAFE",brightGlow:"#0EA5E9",brightPop:"#22C55E",brightSpark:"#EAB308",brightBlaze:"#EF4444",brightSurge:"#3B82F6",brightFlame:"#F59E0B",brightGold:"#FACC15",brightLightGlow:"#0284C7",brightLightPop:"#16A34A",brightLightSpark:"#CA8A04",brightLightBlaze:"#DC2626",brightLightSurge:"#2563EB",brightLightFlame:"#D97706",brightLightGold:"#A16207"},sandColors={black:"#201B0E",gray:"#6E6142",white:"#F7F1DF",sandBase:"#E2CA76",sandBrand:"#E2CA76",sandAccent:"#D4B85E",sandText:"#7A5E12",sandTint:"#F2E7C2",sandBright:"#ECD98F",sandHover:"#5C4710",attentionBrand:"#977E13",attentionAccent:"#D9B21E",attentionTint:"#F5EBC4",dangerBrand:"#A8412A",dangerAccent:"#D65C3F",dangerTint:"#F6DDD3",severeBrand:"#A5651A",severeAccent:"#D98A2E",severeTint:"#F6E5CC",doneBrand:"#6A548F",doneAccent:"#8A6FB0",doneTint:"#E9E2F2",brightGlow:"#E2CA76",brightPop:"#D9A85A",brightSpark:"#ECD98F",brightBlaze:"#E0703F",brightSurge:"#93A97F",brightFlame:"#E69430",brightGold:"#F0D45E",brightLightGlow:"#7A5E12",brightLightPop:"#A5661E",brightLightSpark:"#977E13",brightLightBlaze:"#B0432A",brightLightSurge:"#5E7050",brightLightFlame:"#A5651A",brightLightGold:"#8A6E10"},ivoryColors={black:"#211C15",gray:"#6F6353",white:"#FBF6EC",ivoryBase:"#E6D2B5",ivoryBrand:"#E6D2B5",ivoryAccent:"#D8C09B",ivoryText:"#6B5A3E",ivoryTint:"#F3E9D6",ivoryBright:"#EFDFC2",ivoryHover:"#52442D",attentionBrand:"#8A7320",attentionAccent:"#CBAA35",attentionTint:"#F4ECCD",dangerBrand:"#A34632",dangerAccent:"#CE6047",dangerTint:"#F5DFD8",severeBrand:"#9C6221",severeAccent:"#CE8637",severeTint:"#F4E6D2",doneBrand:"#6A5591",doneAccent:"#8B72B2",doneTint:"#EAE3F3",brightGlow:"#E6D2B5",brightPop:"#D8B27E",brightSpark:"#EFDFC2",brightBlaze:"#DD7048",brightSurge:"#98A783",brightFlame:"#E0912F",brightGold:"#EACF6A",brightLightGlow:"#6B5A3E",brightLightPop:"#9C6626",brightLightSpark:"#8A7320",brightLightBlaze:"#AB4229",brightLightSurge:"#5C6C4C",brightLightFlame:"#9C6221",brightLightGold:"#836A18"},sunColors={black:"#1F1904",gray:"#7A6A3A",white:"#FFF9EC",sunBase:"#FFC107",sunBrand:"#FFC107",sunAccent:"#F0A800",sunText:"#8A5300",sunTint:"#FFF1C6",sunBright:"#FFD54A",sunHover:"#6E4200",attentionBrand:"#9A7B00",attentionAccent:"#E0B400",attentionTint:"#FFF0BE",dangerBrand:"#B23A1E",dangerAccent:"#DE5A38",dangerTint:"#FADFD5",severeBrand:"#A85D0C",severeAccent:"#E08421",severeTint:"#FCE6CC",doneBrand:"#6A4E9E",doneAccent:"#8B72B8",doneTint:"#EAE3F5",brightGlow:"#FFC107",brightPop:"#FF9F1C",brightSpark:"#FFD54A",brightBlaze:"#FF6B35",brightSurge:"#4FB0C6",brightFlame:"#FF8500",brightGold:"#FFD700",brightLightGlow:"#8A5300",brightLightPop:"#B8560F",brightLightSpark:"#9A7B00",brightLightBlaze:"#B23A1E",brightLightSurge:"#2A7C8E",brightLightFlame:"#A85D0C",brightLightGold:"#8A6E00"},loopColors={black:"#131314",gray:"#6E6E73",white:"#FFFFFF",ink:"#1D1D1F",inkDark:"#F5F5F7",subtle:"#F5F5F7",subtleDark:"#1E1E20",grayDark:"#A1A1A6",loopBrand:"#7ADBB8",loopOn:"#06281E",loopAccent:"#4FC79C",loopBrandHover:"#6CCFAA",loopText:"#248462",loopRing:"#0F6B4F",loopTint:"#F0FAF6",loopStage:"#DDF5EC",loopBright:"#8FE5C6",loopHover:"#227C5C",loopStageDark:"#10261F",loopTintDark:"#17211D",successBrand:"#1F8A5B",successAccent:"#58C797",successTint:"#E4F5EC",attentionBrand:"#A66A12",attentionAccent:"#E0A54A",attentionTint:"#FBF0DC",dangerBrand:"#BF3F38",dangerAccent:"#F08A83",dangerTint:"#FBE7E5",severeBrand:"#B4571A",severeAccent:"#E8935A",severeTint:"#FBEADD",doneBrand:"#6B53C9",doneAccent:"#C0AEF6",doneTint:"#F6F3FE",brightGlow:"#7ADBB8",brightPop:"#8CCBF9",brightSpark:"#BEDC55",brightBlaze:"#F6A5C1",brightSurge:"#C0AEF6",brightFlame:"#F4A261",brightGold:"#F8D469",brightLightGlow:"#0F6B4F",brightLightPop:"#1F6FB0",brightLightSpark:"#5F7A00",brightLightBlaze:"#B83A6B",brightLightSurge:"#6B53C9",brightLightFlame:"#B4571A",brightLightGold:"#8A6A00"},metalColors={...loopColors,black:"#1C2A33",gray:"#6B7280",ink:"#2A2F37",inkDark:"#EEF2F7",subtle:"#F6F8FC",subtleDark:"#25343F",grayDark:"#C3CDD8",metalBrand:"#4C76BA",metalOn:"#FFFFFF",metalHover:"#3F68AC",metalActive:"#355A98",metalText:"#3A66AC",metalRing:"#264F8F",metalTint:"#F1F5FB",metalStage:"#E4ECF7",metalBright:"#8FB4E8",metalBrightHover:"#A9C6EE",metalOnDark:"#0B1A30",metalStageDark:"#152033",metalTintDark:"#141A23",line:"#E3E9F2",lineMuted:"#EDF1F7",controlLine:"#D6E0EE",lineDark:"#262D37",lineMutedDark:"#1E242C",sageFrom:"#8FA672",sageTo:"#4F7A5A",steelFrom:"#3F73B5",steelTo:"#2396D6",mauveFrom:"#A87890",mauveTo:"#B04A6E",clayFrom:"#C26A4E",clayTo:"#A04A2C",brightGlow:"#8FB4E8",brightPop:"#6FC3E8",brightSpark:"#A8C08A",brightBlaze:"#D98FAE",brightSurge:"#A9B4E6",brightFlame:"#E09272",brightGold:"#E6C878",brightLightGlow:"#3A66AC",brightLightPop:"#1F7FB8",brightLightSpark:"#56784A",brightLightBlaze:"#A8426A",brightLightSurge:"#5A5FB0",brightLightFlame:"#A64E2E",brightLightGold:"#8A6A1E"},vscodeVars={editorBackground:{variable:"editor-background",light:"#FFFFFF",dark:"#1F1F1F"},editorForeground:{variable:"editor-foreground",light:"#3B3B3B",dark:"#CCCCCC"},foreground:{variable:"foreground",light:"#3B3B3B",dark:"#CCCCCC"},descriptionForeground:{variable:"descriptionForeground",light:"#3B3B3BB3",dark:"#9D9D9D"},disabledForeground:{variable:"disabledForeground",light:"#3B3B3B80",dark:"#CCCCCC80"},sideBarBackground:{variable:"sideBar-background",light:"#F8F8F8",dark:"#181818"},editorWidgetBackground:{variable:"editorWidget-background",light:"#F8F8F8",dark:"#202020"},editorWidgetBorder:{variable:"editorWidget-border",light:"#E5E5E5",dark:"#313131"},panelBorder:{variable:"panel-border",light:"#E5E5E5",dark:"#2B2B2B"},widgetShadow:{variable:"widget-shadow",light:"#00000029",dark:"#0000005C"},focusBorder:{variable:"focusBorder",light:"#005FB8",dark:"#0078D4"},textLinkForeground:{variable:"textLink-foreground",light:"#005FB8",dark:"#4DAAFC"},buttonBackground:{variable:"button-background",light:"#005FB8",dark:"#0078D4"},buttonForeground:{variable:"button-foreground",light:"#FFFFFF",dark:"#FFFFFF"},buttonHoverBackground:{variable:"button-hoverBackground",light:"#0258A8",dark:"#026EC1"},buttonBorder:{variable:"button-border",light:"#0000001A",dark:"#FFFFFF12"},buttonSecondaryBackground:{variable:"button-secondaryBackground",light:"#E5E5E5",dark:"#313131"},buttonSecondaryForeground:{variable:"button-secondaryForeground",light:"#3B3B3B",dark:"#CCCCCC"},buttonSecondaryHoverBackground:{variable:"button-secondaryHoverBackground",light:"#CCCCCC",dark:"#3C3C3C"},inputBackground:{variable:"input-background",light:"#FFFFFF",dark:"#313131"},inputForeground:{variable:"input-foreground",light:"#3B3B3B",dark:"#CCCCCC"},inputBorder:{variable:"input-border",light:"#CECECE",dark:"#3C3C3C"},inputPlaceholderForeground:{variable:"input-placeholderForeground",light:"#767676",dark:"#989898"},listHoverBackground:{variable:"list-hoverBackground",light:"#F2F2F2",dark:"#2A2D2E"},listActiveSelectionBackground:{variable:"list-activeSelectionBackground",light:"#E8E8E8",dark:"#04395E"},errorForeground:{variable:"errorForeground",light:"#F85149",dark:"#F85149"},editorWarningForeground:{variable:"editorWarning-foreground",light:"#BF8803",dark:"#CCA700"},editorInfoForeground:{variable:"editorInfo-foreground",light:"#1A85FF",dark:"#3794FF"},testingIconPassed:{variable:"testing-iconPassed",light:"#388A34",dark:"#73C991"},terminalAnsiBlue:{variable:"terminal-ansiBlue",light:"#0451A5",dark:"#2472C8"},terminalAnsiGreen:{variable:"terminal-ansiGreen",light:"#107C10",dark:"#0DBC79"},terminalAnsiMagenta:{variable:"terminal-ansiMagenta",light:"#BC05BC",dark:"#BC3FBC"},terminalAnsiYellow:{variable:"terminal-ansiYellow",light:"#949800",dark:"#E5E510"},terminalAnsiRed:{variable:"terminal-ansiRed",light:"#CD3131",dark:"#CD3131"},terminalAnsiCyan:{variable:"terminal-ansiCyan",light:"#0598BC",dark:"#11A8CD"}};function vscodeVar(Au,lo){const $u=vscodeVars[Au];return`var(--vscode-${$u.variable}, ${$u[lo]})`}function vscodeTint(Au,lo,$u){return`color-mix(in srgb, ${vscodeVar(Au,lo)} ${$u}%, transparent)`}const vscodeSystemFont='system-ui, "Ubuntu", "Droid Sans", -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", sans-serif',vscodeFontFamily=`var(--vscode-font-family, ${vscodeSystemFont})`,vscodeMonoFontFamily='var(--vscode-editor-font-family, "Droid Sans Mono", "monospace", monospace)',vscodeFontSize="var(--vscode-font-size, 13px)",vscodeColors={black:vscodeVars.editorBackground.dark,gray:vscodeVars.descriptionForeground.dark,white:vscodeVars.editorBackground.light,vscodeBase:"#0078D4",vscodeBrand:"#0078D4",vscodeAccent:"#4DAAFC",vscodeText:"#005FB8",vscodeTint:"#E8F1FB",vscodeBright:"#4DAAFC",vscodeHover:"#026EC1",attentionBrand:vscodeVars.editorWarningForeground.light,attentionAccent:vscodeVars.editorWarningForeground.dark,attentionTint:"#FFF4CE",dangerBrand:vscodeVars.errorForeground.light,dangerAccent:vscodeVars.errorForeground.dark,dangerTint:"#FDE7E6",severeBrand:"#BC4C00",severeAccent:"#DB6D28",severeTint:"#FFE9D9",doneBrand:vscodeVars.terminalAnsiMagenta.light,doneAccent:vscodeVars.terminalAnsiMagenta.dark,doneTint:"#F5E1F5",brightGlow:"#4DAAFC",brightPop:"#0DBC79",brightSpark:"#11A8CD",brightBlaze:"#F14C4C",brightSurge:"#2472C8",brightFlame:"#E5E510",brightGold:"#FFCC00",brightLightGlow:"#005FB8",brightLightPop:"#107C10",brightLightSpark:"#0598BC",brightLightBlaze:"#CD3131",brightLightSurge:"#0451A5",brightLightFlame:"#949800",brightLightGold:"#9A7B00"},themeAccents={green:{accent:"#7ADBB8",on:"#06281E",stage:{light:"#DDF5EC",dark:"#10261F"},quiet:{light:"#F0FAF6",dark:"#17211D"},text:{light:"#248462",dark:"#8FE5C6"}},rose:{accent:"#F6A5C1",on:"#3A0A1C",stage:{light:"#FCE3EC",dark:"#2B141C"},quiet:{light:"#FDF2F6",dark:"#22181C"},text:{light:"#B83A6B",dark:"#F6A5C1"}},sky:{accent:"#8CCBF9",on:"#06243B",stage:{light:"#DFF0FD",dark:"#0F2333"},quiet:{light:"#F0F8FE",dark:"#161E25"},text:{light:"#1F6FB0",dark:"#8CCBF9"}},lime:{accent:"#BEDC55",on:"#1F2A00",stage:{light:"#EEF6CC",dark:"#1E2609"},quiet:{light:"#F7FBE6",dark:"#1C2014"},text:{light:"#5F7A00",dark:"#BEDC55"}},sun:{accent:"#F8D469",on:"#2E2200",stage:{light:"#FDF3CD",dark:"#2A2209"},quiet:{light:"#FEF9E7",dark:"#221F14"},text:{light:"#8A6A00",dark:"#F8D469"}},violet:{accent:"#C0AEF6",on:"#1C0F47",stage:{light:"#ECE7FD",dark:"#1B1533"},quiet:{light:"#F6F3FE",dark:"#1C1A27"},text:{light:"#6B53C9",dark:"#C0AEF6"}}},themeAccentNames=["green","rose","sky","lime","sun","violet"];function themeStageGradient(Au,lo){return`radial-gradient(140% 100% at 50% 0%, ${Au} 0%, ${lo} 100%)`}function themeAccentTints(Au){return{"--theme-accent":Au.accent,"--theme-accent-on":Au.on,"--theme-stage":Au.stage,"--theme-quiet":Au.quiet,"--theme-stage-gradient":themeStageGradient(Au.stage,Au.quiet)}}function themeTintVars(Au){return themeAccentTints({accent:Au.accent.emphasis,on:Au.btn.primary.text,stage:Au.accent.subtle??Au.canvas.subtle??Au.canvas.default,quiet:Au.canvas.subtle??Au.canvas.default})}function themeAccentVars(Au,lo="light"){const $u=themeAccents[Au];if(!$u)throw new Error(`There is no accent "${Au}"; the accents are ${themeAccentNames.join(", ")}.`);return{...themeAccentTints({accent:$u.accent,on:$u.on,stage:$u.stage[lo],quiet:$u.quiet[lo]}),"--bgColor-accent-emphasis":$u.accent,"--borderColor-accent-emphasis":$u.accent,"--fgColor-accent":$u.text[lo],"--fgColor-link":$u.text[lo],"--borderColor-accent-muted":$u.accent,"--bgColor-accent-muted":$u.quiet[lo],"--underlineNav-borderColor-active":$u.accent,"--button-primary-bgColor-rest":$u.accent,"--button-primary-borderColor-rest":$u.accent,"--button-primary-bgColor-hover":$u.accent,"--button-primary-borderColor-hover":$u.accent,"--button-primary-bgColor-active":$u.accent,"--button-primary-borderColor-active":$u.accent,"--button-primary-fgColor-rest":$u.on,"--button-primary-iconColor-rest":$u.on,"--buttonCounter-primary-fgColor-rest":$u.on,"--color-btn-primary-bg":$u.accent,"--color-btn-primary-hover-bg":$u.accent,"--control-checked-bgColor-rest":$u.accent,"--control-checked-bgColor-hover":$u.accent,"--control-checked-bgColor-active":$u.accent,"--control-checked-fgColor-rest":$u.on,"--controlKnob-borderColor-checked":$u.accent,"--datalayer-icon-fg":$u.text[lo]}}const hueNames=["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","stone"],baseHueColors={red:{light:"#B91C1C",dark:"#F87171"},orange:{light:"#C2410C",dark:"#FB923C"},amber:{light:"#B45309",dark:"#FBBF24"},yellow:{light:"#A16207",dark:"#FACC15"},lime:{light:"#4D7C0F",dark:"#A3E635"},green:{light:"#15803D",dark:"#4ADE80"},emerald:{light:"#047857",dark:"#34D399"},teal:{light:"#0F766E",dark:"#2DD4BF"},cyan:{light:"#0E7490",dark:"#22D3EE"},sky:{light:"#0369A1",dark:"#38BDF8"},blue:{light:"#1D4ED8",dark:"#60A5FA"},indigo:{light:"#4338CA",dark:"#818CF8"},violet:{light:"#6D28D9",dark:"#A78BFA"},purple:{light:"#7E22CE",dark:"#C084FC"},fuchsia:{light:"#A21CAF",dark:"#E879F9"},pink:{light:"#BE185D",dark:"#F472B6"},rose:{light:"#BE123C",dark:"#FB7185"},slate:{light:"#475569",dark:"#94A3B8"},gray:{light:"#4B5563",dark:"#9CA3AF"},stone:{light:"#57534E",dark:"#A8A29E"}},themeHueColors={loop:{green:{light:"#248462",dark:"#8FE5C6"},rose:{light:"#B83A6B",dark:"#F6A5C1"},sky:{light:"#1F6FB0",dark:"#8CCBF9"},lime:{light:"#5F7A00",dark:"#BEDC55"},yellow:{light:"#8A6A00",dark:"#F8D469"},violet:{light:"#6B53C9",dark:"#C0AEF6"},orange:{light:"#B4571A",dark:"#F4A261"}},vscode:{red:{light:"#CD3131",dark:"#F14C4C"},green:{light:"#107C10",dark:"#0DBC79"},yellow:{light:"#858800",dark:"#E5E510"},blue:{light:"#0451A5",dark:"#2472C8"},cyan:{light:"#0598BC",dark:"#11A8CD"},purple:{light:"#BC05BC",dark:"#BC3FBC"}}};function hueColorsOf(Au,lo){const $u=themeHueColors[Au]??{};return Object.fromEntries(hueNames.map(Ru=>[Ru,($u[Ru]??baseHueColors[Ru])[lo]]))}const datalayer={neutral:"#656D76",muted:"#8b949e",pending:"#d29922",warning:"#d29922",danger:"#d1242f",success:"#16A085",info:"#0969da",reservation:"#656D76",credits:"#16A085",inviteJoined:"#0969da",invitePending:"#cfd3d7"},spatial={neutral:"#8892B0",muted:"#6B7394",pending:"#E2B340",warning:"#E2B340",danger:"#FF5252",success:"#4F46E5",info:"#448AFF",reservation:"#8892B0",credits:"#4F46E5",inviteJoined:"#448AFF",invitePending:"#6B7394"},lovely={neutral:"#9D7A8F",muted:"#C9A2B8",pending:"#FFD740",warning:"#FFD740",danger:"#FF1744",success:"#DB2777",info:"#536DFE",reservation:"#9D7A8F",credits:"#DB2777",inviteJoined:"#536DFE",invitePending:"#C9A2B8"},matrix={neutral:"#5A6E3A",muted:"#7A9A50",pending:"#FFD600",warning:"#FFD600",danger:"#FF3D00",success:"#00C853",info:"#00E676",reservation:"#5A6E3A",credits:"#00C853",inviteJoined:"#00E676",invitePending:"#7A9A50"},indicatorColors={datalayer,spatial,lovely,matrix},defaultIndicatorColors=datalayer,primerComponentSelectors={button:'[class*="prc-Button-ButtonBase"]',textInput:'[class*="prc-components-TextInputBaseWrapper"]',textArea:'[class*="prc-Textarea-TextArea"]',segmentedControl:'[class*="prc-SegmentedControl-SegmentedControl"]',buttonGroup:'[class*="prc-ButtonGroup-ButtonGroup"]',underlineTab:'[class*="prc-components-UnderlineItem"]',toggleTrack:'[class*="ToggleSwitch__SwitchButton-"]',toggleKnob:'[class*="ToggleSwitch__ToggleKnob-"]',table:'[class*="prc-DataTable-Table-"]',tableHeader:'[class*="prc-DataTable-TableHeader-"]',tableCell:'[class*="prc-DataTable-TableCell-"]'},sel$1=primerComponentSelectors;function primerComponentsCss(Au={}){const lo=[];Au.radiusControl!==void 0&&lo.push(`:scope ${sel$1.button},
93
+ If you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`);const od=(Ru=Uu.label)===null||Ru===void 0?void 0:Ru.props.visuallyHidden,sd=classes$6,ad=vM.isValidElement(ed)?vM.cloneElement(ed,{id:Zu,disabled:Wu,required:Lu&&!nd,"aria-describedby":Yu}):null;let pd;Iu[1]!==Hu?(pd=Hu.filter(_temp2$1),Iu[1]=Hu,Iu[2]=pd):pd=Iu[2];let bd;Iu[3]!==sd.ControlChoiceInputs||Iu[4]!==ad||Iu[5]!==pd?(bd=jsxRuntimeExports.jsxs("div",{className:sd.ControlChoiceInputs,children:[ad,pd]}),Iu[3]=sd.ControlChoiceInputs,Iu[4]=ad,Iu[5]=pd,Iu[6]=bd):bd=Iu[6];let wd;Iu[7]!==Wu||Iu[8]!==Uu.caption||Iu[9]!==Uu.leadingVisual?(wd=Uu.leadingVisual?jsxRuntimeExports.jsx("div",{className:classes$6.LeadingVisual,"data-disabled":Wu?"":void 0,"data-has-caption":Uu.caption?"":void 0,children:Uu.leadingVisual}):null,Iu[7]=Wu,Iu[8]=Uu.caption,Iu[9]=Uu.leadingVisual,Iu[10]=wd):wd=Iu[10];let _d;Iu[11]!==Uu.caption||Iu[12]!==Uu.label?(_d=jsxRuntimeExports.jsxs("div",{className:classes$6.LabelContainer,children:[Uu.label,Uu.caption]}),Iu[11]=Uu.caption,Iu[12]=Uu.label,Iu[13]=_d):_d=Iu[13];let yd;Iu[14]!==bd||Iu[15]!==wd||Iu[16]!==_d?(yd=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[bd,wd,_d]}),Iu[14]=bd,Iu[15]=wd,Iu[16]=_d,Iu[17]=yd):yd=Iu[17];const Sd=yd;let kd;Iu[18]!==Yu||Iu[19]!==Wu||Iu[20]!==Zu||Iu[21]!==Lu||Iu[22]!==Ju?(kd={captionId:Yu,disabled:Wu,id:Zu,required:Lu,validationMessageId:Ju},Iu[18]=Yu,Iu[19]=Wu,Iu[20]=Zu,Iu[21]=Lu,Iu[22]=Ju,Iu[23]=kd):kd=Iu[23];const md=td||Fu==="horizontal"?jsxRuntimeExports.jsx(BoxWithFallback,{ref:lo,"data-has-leading-visual":Uu.leadingVisual?"":void 0,sx:Bu,className:clsx(ju,classes$6.ControlHorizontalLayout),children:Sd}):jsxRuntimeExports.jsxs(BoxWithFallback,{ref:lo,"data-has-label":od?void 0:"",sx:Bu,className:clsx(ju,classes$6.ControlVerticalLayout),children:[Uu.label,vM.isValidElement(ed)&&vM.cloneElement(ed,Object.assign({id:Zu,required:Lu,disabled:Wu,validationStatus:Xu,"aria-describedby":[Ju,Yu].filter(Boolean).join(" ")},ed.props)),Hu.filter(vd=>vM.isValidElement(vd)&&!Vu.some(ld=>vd.type===ld)),Uu.validation?jsxRuntimeExports.jsx(ValidationAnimationContainer,{show:!0,children:Uu.validation}):null,Uu.caption]});let dd;return Iu[24]!==kd||Iu[25]!==md?(dd=jsxRuntimeExports.jsx(FormControlContextProvider,{value:kd,children:md}),Iu[24]=kd,Iu[25]=md,Iu[26]=dd):dd=Iu[26],dd});var FormControl$1=Object.assign(FormControl,{Caption:FormControlCaption,Label:FormControlLabel,LeadingVisual:FormControlLeadingVisual,Validation:FormControlValidation});function _temp2$1(Au){return vM.isValidElement(Au)&&![Checkbox,Radio].some(lo=>Au.type===lo)}var classes$2={SegmentedControl:"prc-SegmentedControl-SegmentedControl-e7570",Item:"prc-SegmentedControl-Item-7Aq6h",Button:"prc-SegmentedControl-Button-ojWXD",IconButton:"prc-SegmentedControl-IconButton-O80Eh",Content:"prc-SegmentedControl-Content-gnQ4n",Text:"prc-SegmentedControl-Text-c5gSh",LeadingIcon:"prc-SegmentedControl-LeadingIcon-dAHA8"};const SegmentedControlButton=Au=>{const lo=distExports.c(28);let $u,Ru,Iu,Pu,Ou,Du;if(lo[0]!==Au){const{children:Wu,leadingIcon:Zu,selected:Ju,sx:Yu,className:Xu,defaultSelected:ed,...td}=Au;Ru=Wu,$u=Zu,Ou=Ju,Du=Yu,Iu=Xu,Pu=td,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du}else $u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6];let Mu;lo[7]===Symbol.for("react.memo_cache_sentinel")?(Mu=clsx(classes$2.Item),lo[7]=Mu):Mu=lo[7];const Lu=Ou?"":void 0;let Bu;lo[8]!==Iu?(Bu=clsx(classes$2.Button,Iu),lo[8]=Iu,lo[9]=Bu):Bu=lo[9];let ju;lo[10]===Symbol.for("react.memo_cache_sentinel")?(ju=clsx(classes$2.Content,"segmentedControl-content"),lo[10]=ju):ju=lo[10];let Fu;lo[11]!==$u?(Fu=$u&&jsxRuntimeExports.jsx("div",{className:classes$2.LeadingIcon,children:reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{})}),lo[11]=$u,lo[12]=Fu):Fu=lo[12];let zu;lo[13]===Symbol.for("react.memo_cache_sentinel")?(zu=clsx(classes$2.Text,"segmentedControl-text"),lo[13]=zu):zu=lo[13];let Uu;lo[14]!==Ru?(Uu=jsxRuntimeExports.jsx("div",{className:zu,"data-text":Ru,children:Ru}),lo[14]=Ru,lo[15]=Uu):Uu=lo[15];let Hu;lo[16]!==Fu||lo[17]!==Uu?(Hu=jsxRuntimeExports.jsxs("span",{className:ju,children:[Fu,Uu]}),lo[16]=Fu,lo[17]=Uu,lo[18]=Hu):Hu=lo[18];let Vu;lo[19]!==Pu||lo[20]!==Ou||lo[21]!==Bu||lo[22]!==Hu?(Vu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-current":Ou,className:Bu,type:"button",...Pu,children:Hu}),lo[19]=Pu,lo[20]=Ou,lo[21]=Bu,lo[22]=Hu,lo[23]=Vu):Vu=lo[23];let Gu;return lo[24]!==Du||lo[25]!==Lu||lo[26]!==Vu?(Gu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Du,className:Mu,"data-selected":Lu,children:Vu}),lo[24]=Du,lo[25]=Lu,lo[26]=Vu,lo[27]=Gu):Gu=lo[27],Gu},SegmentedControlIconButton=Au=>{const lo=distExports.c(50);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu;if(lo[0]!==Au?({"aria-label":Ru,icon:$u,selected:Du,sx:Mu,className:Iu,description:Pu,tooltipDirection:Lu,...Ou}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8]),useFeatureFlag("primer_react_segmented_control_tooltip")){let ju;lo[9]!==Iu?(ju=clsx(classes$2.Item,Iu),lo[9]=Iu,lo[10]=ju):ju=lo[10];const Fu=Du||void 0,zu=Pu?void 0:"label",Uu=Pu||Ru,Hu=Pu?Ru:void 0;let Vu;lo[11]===Symbol.for("react.memo_cache_sentinel")?(Vu=clsx(classes$2.Button,classes$2.IconButton),lo[11]=Vu):Vu=lo[11];let Gu;lo[12]===Symbol.for("react.memo_cache_sentinel")?(Gu=clsx(classes$2.Content,"segmentedControl-content"),lo[12]=Gu):Gu=lo[12];let Wu;lo[13]!==$u?(Wu=reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{}),lo[13]=$u,lo[14]=Wu):Wu=lo[14];let Zu;lo[15]!==Wu?(Zu=jsxRuntimeExports.jsx("span",{className:Gu,children:Wu}),lo[15]=Wu,lo[16]=Zu):Zu=lo[16];let Ju;lo[17]!==Ou||lo[18]!==Du||lo[19]!==Hu||lo[20]!==Zu?(Ju=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-current":Du,"aria-label":Hu,className:Vu,...Ou,children:Zu}),lo[17]=Ou,lo[18]=Du,lo[19]=Hu,lo[20]=Zu,lo[21]=Ju):Ju=lo[21];let Yu;lo[22]!==Ju||lo[23]!==zu||lo[24]!==Uu||lo[25]!==Lu?(Yu=jsxRuntimeExports.jsx(Tooltip,{type:zu,text:Uu,direction:Lu,children:Ju}),lo[22]=Ju,lo[23]=zu,lo[24]=Uu,lo[25]=Lu,lo[26]=Yu):Yu=lo[26];let Xu;return lo[27]!==Mu||lo[28]!==ju||lo[29]!==Yu||lo[30]!==Fu?(Xu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Mu,className:ju,"data-selected":Fu,children:Yu}),lo[27]=Mu,lo[28]=ju,lo[29]=Yu,lo[30]=Fu,lo[31]=Xu):Xu=lo[31],Xu}else{let ju;lo[32]!==Iu?(ju=clsx(classes$2.Item,Iu),lo[32]=Iu,lo[33]=ju):ju=lo[33];const Fu=Du||void 0;let zu;lo[34]===Symbol.for("react.memo_cache_sentinel")?(zu=clsx(classes$2.Button,classes$2.IconButton),lo[34]=zu):zu=lo[34];let Uu;lo[35]===Symbol.for("react.memo_cache_sentinel")?(Uu=clsx(classes$2.Content,"segmentedControl-content"),lo[35]=Uu):Uu=lo[35];let Hu;lo[36]!==$u?(Hu=reactIsExports.isElement($u)?$u:jsxRuntimeExports.jsx($u,{}),lo[36]=$u,lo[37]=Hu):Hu=lo[37];let Vu;lo[38]!==Hu?(Vu=jsxRuntimeExports.jsx("span",{className:Uu,children:Hu}),lo[38]=Hu,lo[39]=Vu):Vu=lo[39];let Gu;lo[40]!==Ru||lo[41]!==Ou||lo[42]!==Du||lo[43]!==Vu?(Gu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"button","aria-label":Ru,"aria-current":Du,className:zu,...Ou,children:Vu}),lo[40]=Ru,lo[41]=Ou,lo[42]=Du,lo[43]=Vu,lo[44]=Gu):Gu=lo[44];let Wu;return lo[45]!==Mu||lo[46]!==ju||lo[47]!==Fu||lo[48]!==Gu?(Wu=jsxRuntimeExports.jsx(BoxWithFallback,{as:"li",sx:Mu,className:ju,"data-selected":Fu,children:Gu}),lo[45]=Mu,lo[46]=ju,lo[47]=Fu,lo[48]=Gu,lo[49]=Wu):Wu=lo[49],Wu}},Root=Au=>{const lo=distExports.c(30);let $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;lo[0]!==Au?({"aria-label":$u,"aria-labelledby":Ru,children:Iu,fullWidth:Ou,onChange:Du,size:Lu,sx:Bu,variant:ju,className:Pu,...Mu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du,lo[7]=Mu,lo[8]=Lu,lo[9]=Bu,lo[10]=ju):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6],Mu=lo[7],Lu=lo[8],Bu=lo[9],ju=lo[10]);const Fu=ju===void 0?"default":ju,zu=reactExports.useRef(null),{theme:Uu}=useTheme();let Hu;lo[11]!==Iu||lo[12]!==Du?(Hu=Du===void 0||vM.Children.toArray(Iu).some(_temp),lo[11]=Iu,lo[12]=Du,lo[13]=Hu):Hu=lo[13];const Vu=Hu,Gu=useResponsiveValue(Fu,"default"),Wu=useResponsiveValue(Ou,!1);let Zu;if(lo[14]!==Iu){const nd=vM.Children.toArray(Iu).map(_temp2);Zu=nd.some(_temp3)?nd.indexOf(!0):0,lo[14]=Iu,lo[15]=Zu}else Zu=lo[15];const Ju=Zu,[Yu,Xu]=reactExports.useState(Ju),ed=Vu?Yu:Ju;let td;if(lo[16]!==$u||lo[17]!==Ru||lo[18]!==Iu||lo[19]!==Pu||lo[20]!==Wu||lo[21]!==Vu||lo[22]!==Du||lo[23]!==Gu||lo[24]!==Mu||lo[25]!==ed||lo[26]!==Lu||lo[27]!==Bu||lo[28]!==Uu?.colors){const nd=vM.isValidElement(vM.Children.toArray(Iu)[ed])?vM.Children.toArray(Iu)[ed]:void 0,od=_temp4,sd=_temp5;!$u&&!Ru&&console.warn("Use the `aria-label` or `aria-labelledby` prop to provide an accessible label for assistive technologies"),td=Gu==="dropdown"?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ActionMenu,{children:[jsxRuntimeExports.jsx(ActionMenu.Button,{"aria-label":$u&&`${sd(nd)}, ${$u}`,leadingVisual:od(nd),children:sd(nd)}),jsxRuntimeExports.jsx(ActionMenu.Overlay,{"aria-labelledby":Ru,children:jsxRuntimeExports.jsx(ActionList,{selectionVariant:"single",children:vM.Children.map(Iu,(ad,pd)=>{const bd=od(ad);return vM.isValidElement(ad)?jsxRuntimeExports.jsxs(ActionList.Item,{selected:pd===ed,onSelect:wd=>{Vu&&Xu(pd),Du&&Du(pd),ad.props.onClick&&ad.props.onClick(wd)},children:[bd," ",sd(ad)]},`segmented-control-action-btn-${pd}`):null})})})]})}):jsxRuntimeExports.jsx(BoxWithFallback,{as:"ul",sx:Bu,"aria-label":$u,"aria-labelledby":Ru,ref:zu,className:clsx(classes$2.SegmentedControl,Pu),"data-full-width":Wu||void 0,"data-size":Lu,...Mu,children:vM.Children.map(Iu,(ad,pd)=>{if(!vM.isValidElement(ad))return null;const bd={onClick:Du?wd=>{Du(pd),Vu&&Xu(pd),ad.props.onClick&&ad.props.onClick(wd)}:wd=>{ad.props.onClick&&ad.props.onClick(wd),Vu&&Xu(pd)},selected:pd===ed,style:{"--separator-color":pd===ed||pd===ed-1?"transparent":Uu?.colors.border.default,...ad.props.style},sx:ad.props.sx};if(Gu==="hideLabels"&&vM.isValidElement(ad)&&ad.type===SegmentedControlButton){const{"aria-label":wd,leadingIcon:_d,children:yd,...Sd}=ad.props,{sx:kd,...md}=bd;if(!_d)console.warn("A `leadingIcon` prop is required when hiding visible labels");else return jsxRuntimeExports.jsx(SegmentedControlIconButton,{"aria-label":wd||yd,icon:_d,sx:{...kd,width:Wu?"100%":"32px"},...md,...Sd})}return vM.cloneElement(ad,bd)})}),lo[16]=$u,lo[17]=Ru,lo[18]=Iu,lo[19]=Pu,lo[20]=Wu,lo[21]=Vu,lo[22]=Du,lo[23]=Gu,lo[24]=Mu,lo[25]=ed,lo[26]=Lu,lo[27]=Bu,lo[28]=Uu?.colors,lo[29]=td}else td=lo[29];return td};Root.displayName="SegmentedControl";const SegmentedControl=Object.assign(Root,{Button:SegmentedControlButton,IconButton:SegmentedControlIconButton});function _temp(Au){return vM.isValidElement(Au)&&Au.props.defaultSelected!==void 0}function _temp2(Au){return vM.isValidElement(Au)&&(Au.props.defaultSelected||Au.props.selected)}function _temp3(Au){return Au}function _temp4(Au){if(vM.isValidElement(Au)&&Au.type===SegmentedControlButton&&Au.props.leadingIcon){if(reactIsExports.isElement(Au.props.leadingIcon))return Au.props.leadingIcon;{const lo=Au.props.leadingIcon;return jsxRuntimeExports.jsx(lo,{})}}if(vM.isValidElement(Au)&&Au.type===SegmentedControlIconButton&&!reactIsExports.isElement(Au.props.icon)){const lo=Au.props.icon;return jsxRuntimeExports.jsx(lo,{})}return null}function _temp5(Au){return vM.isValidElement(Au)&&Au.type===SegmentedControlButton?Au.props.children:vM.isValidElement(Au)?Au.props["aria-label"]:null}var classes$1={SkeletonText:"prc-SkeletonText-SkeletonText-tW5nH",SkeletonTextWrapper:"prc-SkeletonText-SkeletonTextWrapper-3Z0sU"};function SkeletonText(Au){const lo=distExports.c(32);let $u,Ru,Iu,Pu,Ou,Du;lo[0]!==Au?({lines:Ou,maxWidth:Ru,size:Du,className:$u,style:Pu,...Iu}=Au,lo[0]=Au,lo[1]=$u,lo[2]=Ru,lo[3]=Iu,lo[4]=Pu,lo[5]=Ou,lo[6]=Du):($u=lo[1],Ru=lo[2],Iu=lo[3],Pu=lo[4],Ou=lo[5],Du=lo[6]);const Mu=Ou===void 0?1:Ou,Lu=Du===void 0?"bodyMedium":Du;if(Mu<2){let zu;lo[7]!==$u?(zu=clsx($u,classes$1.SkeletonText),lo[7]=$u,lo[8]=zu):zu=lo[8];let Uu;lo[9]!==Ru||lo[10]!==Pu?(Uu={...Pu,maxWidth:Ru},lo[9]=Ru,lo[10]=Pu,lo[11]=Uu):Uu=lo[11];let Hu;return lo[12]!==Iu||lo[13]!==Lu||lo[14]!==zu||lo[15]!==Uu?(Hu=jsxRuntimeExports.jsx(SkeletonBox,{"data-component":"SkeletonText","data-text-skeleton-size":Lu,width:"100%",className:zu,style:Uu,...Iu}),lo[12]=Iu,lo[13]=Lu,lo[14]=zu,lo[15]=Uu,lo[16]=Hu):Hu=lo[16],Hu}let Bu;lo[17]!==Ru||lo[18]!==Pu?(Bu={...Pu,maxWidth:Ru},lo[17]=Ru,lo[18]=Pu,lo[19]=Bu):Bu=lo[19];let ju;if(lo[20]!==$u||lo[21]!==Mu||lo[22]!==Iu||lo[23]!==Lu){let zu;lo[25]!==$u||lo[26]!==Iu||lo[27]!==Lu?(zu=(Uu,Hu)=>jsxRuntimeExports.jsx(SkeletonBox,{"data-component":"SkeletonText","data-in-multiline":"true","data-text-skeleton-size":Lu,className:clsx($u,classes$1.SkeletonText),...Iu},Hu),lo[25]=$u,lo[26]=Iu,lo[27]=Lu,lo[28]=zu):zu=lo[28],ju=Array.from({length:Mu},zu),lo[20]=$u,lo[21]=Mu,lo[22]=Iu,lo[23]=Lu,lo[24]=ju}else ju=lo[24];let Fu;return lo[29]!==Bu||lo[30]!==ju?(Fu=jsxRuntimeExports.jsx("div",{"data-component":"multilineContainer",className:classes$1.SkeletonTextWrapper,style:Bu,children:ju}),lo[29]=Bu,lo[30]=ju,lo[31]=Fu):Fu=lo[31],Fu}const BOX_COLOR_VARS={"fg.default":"--fgColor-default","fg.muted":"--fgColor-muted","fg.subtle":"--fgColor-muted","fg.onEmphasis":"--fgColor-onEmphasis","canvas.default":"--bgColor-default","canvas.overlay":"--overlay-bgColor","canvas.inset":"--bgColor-inset","canvas.subtle":"--bgColor-muted","border.default":"--borderColor-default","border.muted":"--borderColor-muted","border.subtle":"--borderColor-muted","neutral.emphasisPlus":"--bgColor-emphasis","neutral.emphasis":"--bgColor-neutral-emphasis","neutral.muted":"--bgColor-neutral-muted","neutral.subtle":"--bgColor-neutral-muted","accent.fg":"--fgColor-accent","accent.emphasis":"--bgColor-accent-emphasis","accent.muted":"--borderColor-accent-muted","accent.subtle":"--bgColor-accent-muted","success.fg":"--fgColor-success","success.emphasis":"--bgColor-success-emphasis","success.muted":"--borderColor-success-muted","success.subtle":"--bgColor-success-muted","attention.fg":"--fgColor-attention","attention.emphasis":"--bgColor-attention-emphasis","attention.muted":"--borderColor-attention-muted","attention.subtle":"--bgColor-attention-muted","severe.fg":"--fgColor-severe","severe.emphasis":"--bgColor-severe-emphasis","severe.muted":"--borderColor-severe-muted","severe.subtle":"--bgColor-severe-muted","danger.fg":"--fgColor-danger","danger.emphasis":"--borderColor-danger-emphasis","danger.muted":"--borderColor-danger-muted","danger.subtle":"--bgColor-danger-muted","open.fg":"--fgColor-open","open.emphasis":"--bgColor-open-emphasis","open.muted":"--borderColor-open-muted","open.subtle":"--bgColor-open-muted","closed.fg":"--fgColor-closed","closed.emphasis":"--bgColor-closed-emphasis","closed.muted":"--borderColor-closed-muted","closed.subtle":"--bgColor-closed-muted","done.fg":"--fgColor-done","done.emphasis":"--bgColor-done-emphasis","done.muted":"--borderColor-done-muted","done.subtle":"--bgColor-done-muted","sponsors.fg":"--fgColor-sponsors","sponsors.emphasis":"--bgColor-sponsors-emphasis","sponsors.muted":"--borderColor-sponsors-muted","sponsors.subtle":"--bgColor-sponsors-muted","actionListItem.default.hoverBg":"--control-transparent-bgColor-hover","actionListItem.default.activeBg":"--control-transparent-bgColor-active"},BOX_SHADOW_VARS={"shadow.small":"--shadow-resting-small","shadow.medium":"--shadow-resting-medium","shadow.large":"--shadow-floating-large","shadow.extraLarge":"--shadow-floating-xlarge"},BOX_BREAKPOINTS=["544px","768px","1012px","1280px"],BOX_SPACE=["0","4px","8px","16px","24px","32px","40px","48px","64px","80px","96px","112px","128px"],BOX_FONT_SIZES=["12px","14px","16px","20px","24px","32px","40px","48px","56px"],BOX_RADII=["0","3px","6px","100px"],BOX_RADIUS_VARS={small:"--borderRadius-small",medium:"--borderRadius-medium",large:"--borderRadius-large",full:"--borderRadius-full",control:"--theme-radius-control",card:"--theme-radius-card",bubble:"--theme-radius-bubble",frame:"--theme-radius-frame",overlay:"--theme-radius-overlay"},BOX_BORDER_WIDTHS=["0","1px"],BOX_SIZES={small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},BOX_FONT_WEIGHT_VARS={light:"--base-text-weight-light",normal:"--base-text-weight-normal",medium:"--base-text-weight-medium",semibold:"--base-text-weight-medium",bold:"--base-text-weight-semibold"},BOX_LINE_HEIGHTS={condensedUltra:"1",condensed:"1.25",default:"1.5"},BOX_FONT_VARS={normal:"--fontStack-system",mono:"--fontStack-monospace"};[...Object.values(BOX_COLOR_VARS),...Object.values(BOX_SHADOW_VARS),...Object.values(BOX_RADIUS_VARS),...Object.values(BOX_FONT_WEIGHT_VARS),...Object.values(BOX_FONT_VARS)];const prop=(Au,lo)=>({css:Array.isArray(Au)?Au:[Au],scale:lo??"raw"}),BOX_STYLE_PROPS={m:prop("margin","signedSpace"),mt:prop("margin-top","signedSpace"),mr:prop("margin-right","signedSpace"),mb:prop("margin-bottom","signedSpace"),ml:prop("margin-left","signedSpace"),mx:prop(["margin-left","margin-right"],"signedSpace"),my:prop(["margin-top","margin-bottom"],"signedSpace"),margin:prop("margin","signedSpace"),marginTop:prop("margin-top","signedSpace"),marginRight:prop("margin-right","signedSpace"),marginBottom:prop("margin-bottom","signedSpace"),marginLeft:prop("margin-left","signedSpace"),marginX:prop(["margin-left","margin-right"],"signedSpace"),marginY:prop(["margin-top","margin-bottom"],"signedSpace"),p:prop("padding","space"),pt:prop("padding-top","space"),pr:prop("padding-right","space"),pb:prop("padding-bottom","space"),pl:prop("padding-left","space"),px:prop(["padding-left","padding-right"],"space"),py:prop(["padding-top","padding-bottom"],"space"),padding:prop("padding","space"),paddingTop:prop("padding-top","space"),paddingRight:prop("padding-right","space"),paddingBottom:prop("padding-bottom","space"),paddingLeft:prop("padding-left","space"),paddingX:prop(["padding-left","padding-right"],"space"),paddingY:prop(["padding-top","padding-bottom"],"space"),paddingBlock:prop("padding-block","space"),paddingInline:prop("padding-inline","space"),gap:prop("gap","space"),rowGap:prop("row-gap","space"),columnGap:prop("column-gap","space"),gridGap:prop("gap","space"),gridRowGap:prop("row-gap","space"),gridColumnGap:prop("column-gap","space"),scrollMarginTop:prop("scroll-margin-top"),color:prop("color","color"),bg:prop("background-color","color"),backgroundColor:prop("background-color","color"),fill:prop("fill","color"),stroke:prop("stroke","color"),outlineColor:prop("outline-color","color"),opacity:prop("opacity","unitless"),background:prop("background"),backgroundImage:prop("background-image"),backgroundSize:prop("background-size"),backgroundPosition:prop("background-position"),backgroundRepeat:prop("background-repeat"),border:prop("border"),borderTop:prop("border-top"),borderRight:prop("border-right"),borderBottom:prop("border-bottom"),borderLeft:prop("border-left"),borderX:prop(["border-left","border-right"]),borderY:prop(["border-top","border-bottom"]),borderColor:prop("border-color","color"),borderTopColor:prop("border-top-color","color"),borderRightColor:prop("border-right-color","color"),borderBottomColor:prop("border-bottom-color","color"),borderLeftColor:prop("border-left-color","color"),borderWidth:prop("border-width","borderWidth"),borderTopWidth:prop("border-top-width","borderWidth"),borderRightWidth:prop("border-right-width","borderWidth"),borderBottomWidth:prop("border-bottom-width","borderWidth"),borderLeftWidth:prop("border-left-width","borderWidth"),borderStyle:prop("border-style"),borderTopStyle:prop("border-top-style"),borderRightStyle:prop("border-right-style"),borderBottomStyle:prop("border-bottom-style"),borderLeftStyle:prop("border-left-style"),borderRadius:prop("border-radius","radius"),borderTopLeftRadius:prop("border-top-left-radius","radius"),borderTopRightRadius:prop("border-top-right-radius","radius"),borderBottomLeftRadius:prop("border-bottom-left-radius","radius"),borderBottomRightRadius:prop("border-bottom-right-radius","radius"),borderCollapse:prop("border-collapse"),borderSpacing:prop("border-spacing"),outline:prop("outline"),outlineOffset:prop("outline-offset"),boxShadow:prop("box-shadow","shadow"),textShadow:prop("text-shadow","shadow"),display:prop("display"),width:prop("width","size"),height:prop("height","size"),minWidth:prop("min-width","size"),maxWidth:prop("max-width","size"),minHeight:prop("min-height","size"),maxHeight:prop("max-height","size"),size:prop(["width","height"],"size"),overflow:prop("overflow"),overflowX:prop("overflow-x"),overflowY:prop("overflow-y"),overscrollBehavior:prop("overscroll-behavior"),overscrollBehaviorY:prop("overscroll-behavior-y"),scrollbarWidth:prop("scrollbar-width"),scrollbarGutter:prop("scrollbar-gutter"),verticalAlign:prop("vertical-align"),boxSizing:prop("box-sizing"),aspectRatio:prop("aspect-ratio","unitless"),visibility:prop("visibility"),objectFit:prop("object-fit"),objectPosition:prop("object-position"),float:prop("float"),isolation:prop("isolation"),tableLayout:prop("table-layout"),flex:prop("flex","unitless"),flexDirection:prop("flex-direction"),flexWrap:prop("flex-wrap"),flexFlow:prop("flex-flow"),flexGrow:prop("flex-grow","unitless"),flexShrink:prop("flex-shrink","unitless"),flexBasis:prop("flex-basis","size"),alignItems:prop("align-items"),alignContent:prop("align-content"),alignSelf:prop("align-self"),justifyContent:prop("justify-content"),justifyItems:prop("justify-items"),justifySelf:prop("justify-self"),placeItems:prop("place-items"),placeContent:prop("place-content"),placeSelf:prop("place-self"),order:prop("order","unitless"),gridTemplate:prop("grid-template"),gridTemplateColumns:prop("grid-template-columns"),gridTemplateRows:prop("grid-template-rows"),gridTemplateAreas:prop("grid-template-areas"),gridColumn:prop("grid-column","unitless"),gridRow:prop("grid-row","unitless"),gridColumnStart:prop("grid-column-start","unitless"),gridColumnEnd:prop("grid-column-end","unitless"),gridRowStart:prop("grid-row-start","unitless"),gridRowEnd:prop("grid-row-end","unitless"),gridArea:prop("grid-area","unitless"),gridAutoFlow:prop("grid-auto-flow"),gridAutoColumns:prop("grid-auto-columns"),gridAutoRows:prop("grid-auto-rows"),position:prop("position"),zIndex:prop("z-index","unitless"),top:prop("top","signedSpace"),right:prop("right","signedSpace"),bottom:prop("bottom","signedSpace"),left:prop("left","signedSpace"),inset:prop("inset"),font:prop("font"),fontFamily:prop("font-family","font"),fontSize:prop("font-size","fontSize"),fontWeight:prop("font-weight","fontWeight"),fontStyle:prop("font-style"),fontVariantNumeric:prop("font-variant-numeric"),lineHeight:prop("line-height","lineHeight"),letterSpacing:prop("letter-spacing"),textAlign:prop("text-align"),whiteSpace:prop("white-space"),textDecoration:prop("text-decoration"),textUnderlineOffset:prop("text-underline-offset"),textTransform:prop("text-transform"),textOverflow:prop("text-overflow"),textWrap:prop("text-wrap"),wordBreak:prop("word-break"),overflowWrap:prop("overflow-wrap"),wordWrap:prop("word-wrap"),WebkitLineClamp:prop("-webkit-line-clamp","unitless"),WebkitBoxOrient:prop("-webkit-box-orient"),listStyle:prop("list-style"),listStyleType:prop("list-style-type"),listStylePosition:prop("list-style-position"),cursor:prop("cursor"),pointerEvents:prop("pointer-events"),touchAction:prop("touch-action"),all:prop("all"),userSelect:prop("user-select"),appearance:prop("appearance"),transition:prop("transition"),transform:prop("transform"),transformOrigin:prop("transform-origin"),animation:prop("animation"),animationDelay:prop("animation-delay"),filter:prop("filter"),backdropFilter:prop("backdrop-filter"),mixBlendMode:prop("mix-blend-mode"),willChange:prop("will-change"),clipPath:prop("clip-path"),clip:prop("clip"),resize:prop("resize")},BOX_PSEUDO_PROPS={hover:":hover",focus:":focus",focusVisible:":focus-visible",focusWithin:":focus-within",active:":active"},BOX_REDUCED_MOTION="@media (prefers-reduced-motion: reduce)",px$1=Au=>Au===0?"0":`${Au}px`,fromList=(Au,lo)=>Number.isInteger(lo)&&lo>=0&&lo<Au.length?Au[lo]:px$1(lo),varOf=Au=>`var(${Au})`;function resolveBoxValue(Au,lo){if(typeof lo=="number")switch(Au){case"space":return fromList(BOX_SPACE,lo);case"signedSpace":if(lo<0){const $u=fromList(BOX_SPACE,-lo);return $u==="0"?"0":`-${$u}`}return fromList(BOX_SPACE,lo);case"fontSize":return fromList(BOX_FONT_SIZES,lo);case"radius":return fromList(BOX_RADII,lo);case"borderWidth":return fromList(BOX_BORDER_WIDTHS,lo);case"unitless":case"fontWeight":case"lineHeight":return String(lo);default:return px$1(lo)}switch(Au){case"color":return lo in BOX_COLOR_VARS?varOf(BOX_COLOR_VARS[lo]):lo;case"shadow":return lo in BOX_SHADOW_VARS?varOf(BOX_SHADOW_VARS[lo]):lo;case"radius":return lo in BOX_RADIUS_VARS?varOf(BOX_RADIUS_VARS[lo]):lo;case"fontWeight":return lo in BOX_FONT_WEIGHT_VARS?varOf(BOX_FONT_WEIGHT_VARS[lo]):lo;case"lineHeight":return lo in BOX_LINE_HEIGHTS?BOX_LINE_HEIGHTS[lo]:lo;case"font":return lo in BOX_FONT_VARS?varOf(BOX_FONT_VARS[lo]):lo;case"size":return lo in BOX_SIZES?BOX_SIZES[lo]:lo;default:return lo}}const isSet=Au=>Au!=null&&Au!==!1&&Au!==""&&(typeof Au=="string"||typeof Au=="number");function addDeclarations(Au,lo,$u){const{css:Ru,scale:Iu}=BOX_STYLE_PROPS[lo];(Array.isArray($u)?$u.slice(0,BOX_BREAKPOINTS.length+1):[$u]).forEach((Ou,Du)=>{if(!isSet(Ou))return;const Mu=resolveBoxValue(Iu,Ou);(Au[Du]??=[]).push(...Ru.map(Lu=>[Lu,Mu]))})}const UNITLESS=new Set(["animationIterationCount","aspectRatio","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom","WebkitLineClamp"]),kebab$1=Au=>Au.startsWith("--")?Au:Au.replace(/^(Webkit|Moz|ms)(?=[A-Z])/,lo=>`-${lo.toLowerCase()}`).replace(/[A-Z]/g,lo=>`-${lo.toLowerCase()}`),RESETS=["all"],keysOf=Au=>{const lo=Object.keys(Au),$u=lo.filter(Ru=>RESETS.includes(Ru));return $u.length===0?lo:[...$u,...lo.filter(Ru=>!$u.includes(Ru))]};function blockOf(Au,lo=!1){const $u=[];for(const Ru of keysOf(Au)){const Iu=Au[Ru];Ru in BOX_STYLE_PROPS?addDeclarations($u,Ru,Iu):lo&&(isSet(Iu)||Array.isArray(Iu))&&(Array.isArray(Iu)?Iu.slice(0,BOX_BREAKPOINTS.length+1):[Iu]).forEach((Ou,Du)=>{if(!isSet(Ou))return;const Mu=typeof Ou=="number"&&!UNITLESS.has(Ru)&&!Ru.startsWith("--")?px$1(Ou):String(Ou);($u[Du]??=[]).push([kebab$1(Ru),Mu])})}return $u}const MEDIA=Au=>`@media screen and (min-width: ${BOX_BREAKPOINTS[Au-1]})`,PLACEHOLDER$1="\0";function rulesOf(Au,lo,$u=[]){const Ru=[];return Au.forEach((Iu,Pu)=>{if(!Iu||Iu.length===0)return;const Ou=Iu.map(([Mu,Lu])=>`${Mu}:${Lu}`).join(";");let Du=`${lo}{${Ou}}`;Pu>0&&(Du=`${MEDIA(Pu)}{${Du}}`);for(const Mu of[...$u].reverse())Du=`${Mu}{${Du}}`;Ru.push(Du)}),Ru}function splitSelectors(Au){const lo=[];let $u=0,Ru=0;for(let Iu=0;Iu<Au.length;Iu++){const Pu=Au[Iu];Pu==="("||Pu==="["?$u++:Pu===")"||Pu==="]"?$u--:Pu===","&&$u===0&&(lo.push(Au.slice(Ru,Iu).trim()),Ru=Iu+1)}return lo.push(Au.slice(Ru).trim()),lo.filter(Boolean)}function nestSelectors(Au,lo){return Au.flatMap($u=>splitSelectors(lo).map(Ru=>Ru.includes("&")?Ru.split("&").join($u):Ru.startsWith(":")?`${$u}${Ru}`:`${$u} ${Ru}`))}function sxRules(Au,lo,$u){const Ru=rulesOf(blockOf(Au,!0),lo.join(","),$u);for(const[Iu,Pu]of Object.entries(Au)){if(!Pu||typeof Pu!="object"||Array.isArray(Pu))continue;const Ou=Pu;if(Iu.startsWith("@keyframes")){const Du=Object.entries(Ou).map(([Mu,Lu])=>{const Bu=blockOf(Lu??{},!0)[0]??[];return`${Mu}{${Bu.map(([ju,Fu])=>`${ju}:${Fu}`).join(";")}}`}).join("");Ru.push(`${Iu}{${Du}}`)}else Iu.startsWith("@")?Ru.push(...sxRules(Ou,lo,[...$u,Iu])):Ru.push(...sxRules(Ou,nestSelectors(lo,Iu),$u))}return Ru}function hash$1(Au){let lo=2166136261;for(let $u=0;$u<Au.length;$u++)lo^=Au.charCodeAt($u),lo=Math.imul(lo,16777619);return(lo>>>0).toString(36)}const registry$3=new Map;function boxClassOf(Au,lo){const $u=`.${PLACEHOLDER$1}`,Ru=rulesOf(blockOf(Au),$u);for(const[Mu,Lu]of Object.entries(BOX_PSEUDO_PROPS)){const Bu=Au[Mu];Bu&&typeof Bu=="object"&&Ru.push(...rulesOf(blockOf(Bu),`${$u}${Lu}`))}const Iu=Au.reducedMotion;if(Iu&&typeof Iu=="object"&&Ru.push(...rulesOf(blockOf(Iu),$u,[BOX_REDUCED_MOTION])),lo&&typeof lo=="object"&&Ru.push(...sxRules(lo,[$u],[])),Ru.length===0)return;const Pu=Ru.join(""),Ou=`bx-${hash$1(Pu)}${Pu.length.toString(36)}`;let Du=registry$3.get(Ou);return Du||(Du={className:Ou,rules:Ru.map(Mu=>Mu.split(PLACEHOLDER$1).join(Ou))},registry$3.set(Ou,Du)),Du}const STYLE_ATTRIBUTE="data-primer-addons-box",sheets=new WeakMap;function sheetOf(Au){let lo=sheets.get(Au);if(!lo||!lo.element.isConnected){const Ru=(Au instanceof Document?Au:Au.ownerDocument).createElement("style");Ru.setAttribute(STYLE_ATTRIBUTE,""),(Au instanceof Document?Au.head:Au).appendChild(Ru),lo={element:Ru,inserted:new Set},sheets.set(Au,lo)}return lo}function injectBoxClass(Au,lo){const $u=sheetOf(Au);if($u.inserted.has(lo.className))return;$u.inserted.add(lo.className);const Ru=$u.element.sheet;for(const Iu of lo.rules)try{Ru?Ru.insertRule(Iu,Ru.cssRules.length):$u.element.appendChild($u.element.ownerDocument.createTextNode(Iu))}catch{}}const useIsomorphicLayoutEffect$1=typeof window>"u"?reactExports.useEffect:reactExports.useLayoutEffect,STYLE_KEYS=new Set([...Object.keys(BOX_STYLE_PROPS),...Object.keys(BOX_PSEUDO_PROPS),"reducedMotion"]),REF_AS_PROP=Number.parseInt(reactExports.version,10)>=19,isPlainFunction=Au=>typeof Au=="function"&&!Au.prototype?.isReactComponent,SIZED_ELEMENTS=new Set(["img","svg","video","canvas","iframe","embed","object"]);function assignRef(Au,lo){typeof Au=="function"?Au(lo):Au&&(Au.current=lo)}const BoxImpl=reactExports.forwardRef(function(lo,$u){const{as:Ru,sx:Iu,className:Pu,...Ou}=lo,Du=Ru??"div",Mu=Iu,Lu={},Bu={};for(const Vu of Object.keys(Ou))(STYLE_KEYS.has(Vu)?Lu:Bu)[Vu]=Ou[Vu];if(typeof Du=="string"&&SIZED_ELEMENTS.has(Du))for(const Vu of["width","height"]){const Gu=Ou[Vu];(typeof Gu=="string"||typeof Gu=="number")&&(Bu[Vu]=Gu)}const ju=boxClassOf(Lu,Mu),Fu=reactExports.useRef(null),zu=reactExports.useCallback(Vu=>{Fu.current=Vu instanceof Element?Vu:null,assignRef($u,Vu)},[$u]);reactExports.useInsertionEffect(()=>{ju&&typeof document<"u"&&injectBoxClass(document,ju)},[ju]),useIsomorphicLayoutEffect$1(()=>{const Vu=Fu.current?.getRootNode();ju&&typeof ShadowRoot<"u"&&Vu instanceof ShadowRoot&&injectBoxClass(Vu,ju)},[ju]);const Uu=[ju?.className,Pu].filter(Boolean).join(" ")||void 0,Hu=REF_AS_PROP||!isPlainFunction(Du)?zu:$u||void 0;return jsxRuntimeExports.jsx(Du,{ref:Hu,className:Uu,...Bu})});BoxImpl.displayName="Box";const Box=BoxImpl,datalayerColors={black:"#000000",gray:"#595A5C",white:"#FFFFFF",greenBrand:"#16A085",greenAccent:"#1ABC9C",greenText:"#117A65",greenTint:"#E9F7F1",greenBright:"#2ECC71",greenHover:"#0E6655",attentionBrand:"#B08800",attentionAccent:"#D4A72C",attentionTint:"#FFF8C5",dangerBrand:"#D1242F",dangerAccent:"#FF6A69",dangerTint:"#FFE5E5",severeBrand:"#BC4C00",severeAccent:"#F0883E",severeTint:"#FFF1E5",doneBrand:"#0969DA",doneAccent:"#54AEFF",doneTint:"#DDF4FF",brightGlow:"#00D68F",brightPop:"#00E5FF",brightSpark:"#76FF03",brightBlaze:"#FF1744",brightSurge:"#2979FF",brightFlame:"#FF6D00",brightGold:"#FFD600",brightLightGlow:"#00BFA5",brightLightPop:"#00B0FF",brightLightSpark:"#64DD17",brightLightBlaze:"#FF1744",brightLightSurge:"#2979FF",brightLightFlame:"#FF6D00",brightLightGold:"#FFAB00"},spatialColors={black:"#0B1120",gray:"#8892B0",white:"#F8FAFF",indigoBrand:"#4F46E5",indigoAccent:"#6366F1",indigoText:"#3730A3",indigoTint:"#EEF2FF",indigoBright:"#818CF8",indigoHover:"#312E81",attentionBrand:"#C58A00",attentionAccent:"#F2C94C",attentionTint:"#FFF4CC",dangerBrand:"#E5484D",dangerAccent:"#FF7A7F",dangerTint:"#FFE3E6",severeBrand:"#C96A1B",severeAccent:"#F4A259",severeTint:"#FFF1E6",doneBrand:"#7C4DFF",doneAccent:"#A78BFA",doneTint:"#EEE8FF",brightGlow:"#7C4DFF",brightPop:"#448AFF",brightSpark:"#E040FB",brightBlaze:"#FF5252",brightSurge:"#00B0FF",brightFlame:"#FF9100",brightGold:"#FFEA00",brightLightGlow:"#7C4DFF",brightLightPop:"#448AFF",brightLightSpark:"#D500F9",brightLightBlaze:"#FF5252",brightLightSurge:"#00B0FF",brightLightFlame:"#FF9100",brightLightGold:"#FFC400"},lovelyColors={black:"#1A0A14",gray:"#9D7A8F",white:"#FFF5F7",roseBrand:"#DB2777",roseAccent:"#EC4899",roseText:"#9D174D",roseTint:"#FDF2F8",roseBright:"#F472B6",roseHover:"#831843",attentionBrand:"#B7791F",attentionAccent:"#F6AD55",attentionTint:"#FFF5E6",dangerBrand:"#D61F69",dangerAccent:"#FF5C8A",dangerTint:"#FFE6EF",severeBrand:"#C05621",severeAccent:"#ED8936",severeTint:"#FFF1E8",doneBrand:"#805AD5",doneAccent:"#B794F4",doneTint:"#F3E8FF",brightGlow:"#FF4081",brightPop:"#FF6E40",brightSpark:"#EA80FC",brightBlaze:"#FF1744",brightSurge:"#536DFE",brightFlame:"#FF6E40",brightGold:"#FFD740",brightLightGlow:"#FF4081",brightLightPop:"#FF6E40",brightLightSpark:"#EA80FC",brightLightBlaze:"#FF1744",brightLightSurge:"#536DFE",brightLightFlame:"#FF6E40",brightLightGold:"#FFD740"},matrixColors={black:"#0D0208",gray:"#4A7856",white:"#F0FFF0",greenBrand:"#16A085",greenAccent:"#1ABC9C",greenText:"#117A65",greenTint:"#E8F5E9",greenPhosphor:"#00FF41",greenGlow:"#39FF14",greenHover:"#0E6655",greenTerminal:"#003B00",attentionBrand:"#A78E00",attentionAccent:"#FFEA00",attentionTint:"#3A3400",dangerBrand:"#C62828",dangerAccent:"#FF1744",dangerTint:"#3A0F16",severeBrand:"#C75B12",severeAccent:"#FF8A00",severeTint:"#332000",doneBrand:"#008B8B",doneAccent:"#00E5FF",doneTint:"#042A2E",brightGlow:"#39FF14",brightPop:"#00FF88",brightSpark:"#CCFF00",brightBlaze:"#FF0040",brightSurge:"#00E5FF",brightFlame:"#FF6D00",brightGold:"#FFEA00",brightLightGlow:"#00E676",brightLightPop:"#1DE9B6",brightLightSpark:"#AEEA00",brightLightBlaze:"#FF1744",brightLightSurge:"#00B0FF",brightLightFlame:"#FF6D00",brightLightGold:"#FFAB00"},earthColors={black:"#0A1628",gray:"#5B6B7A",white:"#F7FAFC",oceanBrand:"#0369A1",oceanAccent:"#0EA5E9",oceanText:"#075985",oceanTint:"#E0F2FE",oceanBright:"#38BDF8",oceanHover:"#0C4A6E",forestBrand:"#15803D",forestAccent:"#22C55E",forestTint:"#DCFCE7",sunBrand:"#CA8A04",sunAccent:"#EAB308",sunTint:"#FEF9C3",earthWarm:"#92400E",earthSand:"#D97706",earthClay:"#B45309",attentionBrand:"#CA8A04",attentionAccent:"#EAB308",attentionTint:"#FEF9C3",dangerBrand:"#B42318",dangerAccent:"#EF4444",dangerTint:"#FEE4E2",severeBrand:"#B45309",severeAccent:"#F59E0B",severeTint:"#FFF1DA",doneBrand:"#1D4ED8",doneAccent:"#3B82F6",doneTint:"#DBEAFE",brightGlow:"#0EA5E9",brightPop:"#22C55E",brightSpark:"#EAB308",brightBlaze:"#EF4444",brightSurge:"#3B82F6",brightFlame:"#F59E0B",brightGold:"#FACC15",brightLightGlow:"#0284C7",brightLightPop:"#16A34A",brightLightSpark:"#CA8A04",brightLightBlaze:"#DC2626",brightLightSurge:"#2563EB",brightLightFlame:"#D97706",brightLightGold:"#A16207"},sandColors={black:"#201B0E",gray:"#6E6142",white:"#F7F1DF",sandBase:"#E2CA76",sandBrand:"#E2CA76",sandAccent:"#D4B85E",sandText:"#7A5E12",sandTint:"#F2E7C2",sandBright:"#ECD98F",sandHover:"#5C4710",attentionBrand:"#977E13",attentionAccent:"#D9B21E",attentionTint:"#F5EBC4",dangerBrand:"#A8412A",dangerAccent:"#D65C3F",dangerTint:"#F6DDD3",severeBrand:"#A5651A",severeAccent:"#D98A2E",severeTint:"#F6E5CC",doneBrand:"#6A548F",doneAccent:"#8A6FB0",doneTint:"#E9E2F2",brightGlow:"#E2CA76",brightPop:"#D9A85A",brightSpark:"#ECD98F",brightBlaze:"#E0703F",brightSurge:"#93A97F",brightFlame:"#E69430",brightGold:"#F0D45E",brightLightGlow:"#7A5E12",brightLightPop:"#A5661E",brightLightSpark:"#977E13",brightLightBlaze:"#B0432A",brightLightSurge:"#5E7050",brightLightFlame:"#A5651A",brightLightGold:"#8A6E10"},ivoryColors={black:"#211C15",gray:"#6F6353",white:"#FBF6EC",ivoryBase:"#E6D2B5",ivoryBrand:"#E6D2B5",ivoryAccent:"#D8C09B",ivoryText:"#6B5A3E",ivoryTint:"#F3E9D6",ivoryBright:"#EFDFC2",ivoryHover:"#52442D",attentionBrand:"#8A7320",attentionAccent:"#CBAA35",attentionTint:"#F4ECCD",dangerBrand:"#A34632",dangerAccent:"#CE6047",dangerTint:"#F5DFD8",severeBrand:"#9C6221",severeAccent:"#CE8637",severeTint:"#F4E6D2",doneBrand:"#6A5591",doneAccent:"#8B72B2",doneTint:"#EAE3F3",brightGlow:"#E6D2B5",brightPop:"#D8B27E",brightSpark:"#EFDFC2",brightBlaze:"#DD7048",brightSurge:"#98A783",brightFlame:"#E0912F",brightGold:"#EACF6A",brightLightGlow:"#6B5A3E",brightLightPop:"#9C6626",brightLightSpark:"#8A7320",brightLightBlaze:"#AB4229",brightLightSurge:"#5C6C4C",brightLightFlame:"#9C6221",brightLightGold:"#836A18"},sunColors={black:"#1F1904",gray:"#7A6A3A",white:"#FFF9EC",sunBase:"#FFC107",sunBrand:"#FFC107",sunAccent:"#F0A800",sunText:"#8A5300",sunTint:"#FFF1C6",sunBright:"#FFD54A",sunHover:"#6E4200",attentionBrand:"#9A7B00",attentionAccent:"#E0B400",attentionTint:"#FFF0BE",dangerBrand:"#B23A1E",dangerAccent:"#DE5A38",dangerTint:"#FADFD5",severeBrand:"#A85D0C",severeAccent:"#E08421",severeTint:"#FCE6CC",doneBrand:"#6A4E9E",doneAccent:"#8B72B8",doneTint:"#EAE3F5",brightGlow:"#FFC107",brightPop:"#FF9F1C",brightSpark:"#FFD54A",brightBlaze:"#FF6B35",brightSurge:"#4FB0C6",brightFlame:"#FF8500",brightGold:"#FFD700",brightLightGlow:"#8A5300",brightLightPop:"#B8560F",brightLightSpark:"#9A7B00",brightLightBlaze:"#B23A1E",brightLightSurge:"#2A7C8E",brightLightFlame:"#A85D0C",brightLightGold:"#8A6E00"},loopColors={black:"#131314",gray:"#6E6E73",white:"#FFFFFF",ink:"#1D1D1F",inkDark:"#F5F5F7",subtle:"#F5F5F7",subtleDark:"#1E1E20",grayDark:"#A1A1A6",loopBrand:"#7ADBB8",loopOn:"#06281E",loopAccent:"#4FC79C",loopBrandHover:"#6CCFAA",loopText:"#248462",loopRing:"#0F6B4F",loopTint:"#F0FAF6",loopStage:"#DDF5EC",loopBright:"#8FE5C6",loopHover:"#227C5C",loopStageDark:"#10261F",loopTintDark:"#17211D",successBrand:"#1F8A5B",successAccent:"#58C797",successTint:"#E4F5EC",attentionBrand:"#A66A12",attentionAccent:"#E0A54A",attentionTint:"#FBF0DC",dangerBrand:"#BF3F38",dangerAccent:"#F08A83",dangerTint:"#FBE7E5",severeBrand:"#B4571A",severeAccent:"#E8935A",severeTint:"#FBEADD",doneBrand:"#6B53C9",doneAccent:"#C0AEF6",doneTint:"#F6F3FE",brightGlow:"#7ADBB8",brightPop:"#8CCBF9",brightSpark:"#BEDC55",brightBlaze:"#F6A5C1",brightSurge:"#C0AEF6",brightFlame:"#F4A261",brightGold:"#F8D469",brightLightGlow:"#0F6B4F",brightLightPop:"#1F6FB0",brightLightSpark:"#5F7A00",brightLightBlaze:"#B83A6B",brightLightSurge:"#6B53C9",brightLightFlame:"#B4571A",brightLightGold:"#8A6A00"},metalColors={...loopColors,black:"#1C2A33",gray:"#6B7280",ink:"#2A2F37",inkDark:"#EEF2F7",subtle:"#F6F8FC",subtleDark:"#25343F",grayDark:"#C3CDD8",metalBrand:"#4C76BA",metalOn:"#FFFFFF",metalHover:"#3F68AC",metalActive:"#355A98",metalText:"#3A66AC",metalRing:"#264F8F",metalTint:"#EDF4FC",metalStage:"#F2F7FC",metalTintLine:"#C4DAF0",metalBright:"#8FB4E8",metalBrightHover:"#A9C6EE",metalOnDark:"#0B1A30",metalStageDark:"#152033",metalTintDark:"#141A23",line:"#D8E5F2",lineMuted:"#E6EEF7",controlLine:"#D6E0EE",lineDark:"#262D37",lineMutedDark:"#1E242C",sageFrom:"#8FA672",sageTo:"#4F7A5A",steelFrom:"#3F73B5",steelTo:"#2396D6",mauveFrom:"#A87890",mauveTo:"#B04A6E",clayFrom:"#C26A4E",clayTo:"#A04A2C",brightGlow:"#8FB4E8",brightPop:"#6FC3E8",brightSpark:"#A8C08A",brightBlaze:"#D98FAE",brightSurge:"#A9B4E6",brightFlame:"#E09272",brightGold:"#E6C878",brightLightGlow:"#3A66AC",brightLightPop:"#1F7FB8",brightLightSpark:"#56784A",brightLightBlaze:"#A8426A",brightLightSurge:"#5A5FB0",brightLightFlame:"#A64E2E",brightLightGold:"#8A6A1E"},vscodeVars={editorBackground:{variable:"editor-background",light:"#FFFFFF",dark:"#1F1F1F"},editorForeground:{variable:"editor-foreground",light:"#3B3B3B",dark:"#CCCCCC"},foreground:{variable:"foreground",light:"#3B3B3B",dark:"#CCCCCC"},descriptionForeground:{variable:"descriptionForeground",light:"#3B3B3BB3",dark:"#9D9D9D"},disabledForeground:{variable:"disabledForeground",light:"#3B3B3B80",dark:"#CCCCCC80"},sideBarBackground:{variable:"sideBar-background",light:"#F8F8F8",dark:"#181818"},editorWidgetBackground:{variable:"editorWidget-background",light:"#F8F8F8",dark:"#202020"},editorWidgetBorder:{variable:"editorWidget-border",light:"#E5E5E5",dark:"#313131"},panelBorder:{variable:"panel-border",light:"#E5E5E5",dark:"#2B2B2B"},widgetShadow:{variable:"widget-shadow",light:"#00000029",dark:"#0000005C"},focusBorder:{variable:"focusBorder",light:"#005FB8",dark:"#0078D4"},textLinkForeground:{variable:"textLink-foreground",light:"#005FB8",dark:"#4DAAFC"},buttonBackground:{variable:"button-background",light:"#005FB8",dark:"#0078D4"},buttonForeground:{variable:"button-foreground",light:"#FFFFFF",dark:"#FFFFFF"},buttonHoverBackground:{variable:"button-hoverBackground",light:"#0258A8",dark:"#026EC1"},buttonBorder:{variable:"button-border",light:"#0000001A",dark:"#FFFFFF12"},buttonSecondaryBackground:{variable:"button-secondaryBackground",light:"#E5E5E5",dark:"#313131"},buttonSecondaryForeground:{variable:"button-secondaryForeground",light:"#3B3B3B",dark:"#CCCCCC"},buttonSecondaryHoverBackground:{variable:"button-secondaryHoverBackground",light:"#CCCCCC",dark:"#3C3C3C"},inputBackground:{variable:"input-background",light:"#FFFFFF",dark:"#313131"},inputForeground:{variable:"input-foreground",light:"#3B3B3B",dark:"#CCCCCC"},inputBorder:{variable:"input-border",light:"#CECECE",dark:"#3C3C3C"},inputPlaceholderForeground:{variable:"input-placeholderForeground",light:"#767676",dark:"#989898"},listHoverBackground:{variable:"list-hoverBackground",light:"#F2F2F2",dark:"#2A2D2E"},listActiveSelectionBackground:{variable:"list-activeSelectionBackground",light:"#E8E8E8",dark:"#04395E"},errorForeground:{variable:"errorForeground",light:"#F85149",dark:"#F85149"},editorWarningForeground:{variable:"editorWarning-foreground",light:"#BF8803",dark:"#CCA700"},editorInfoForeground:{variable:"editorInfo-foreground",light:"#1A85FF",dark:"#3794FF"},testingIconPassed:{variable:"testing-iconPassed",light:"#388A34",dark:"#73C991"},terminalAnsiBlue:{variable:"terminal-ansiBlue",light:"#0451A5",dark:"#2472C8"},terminalAnsiGreen:{variable:"terminal-ansiGreen",light:"#107C10",dark:"#0DBC79"},terminalAnsiMagenta:{variable:"terminal-ansiMagenta",light:"#BC05BC",dark:"#BC3FBC"},terminalAnsiYellow:{variable:"terminal-ansiYellow",light:"#949800",dark:"#E5E510"},terminalAnsiRed:{variable:"terminal-ansiRed",light:"#CD3131",dark:"#CD3131"},terminalAnsiCyan:{variable:"terminal-ansiCyan",light:"#0598BC",dark:"#11A8CD"}};function vscodeVar(Au,lo){const $u=vscodeVars[Au];return`var(--vscode-${$u.variable}, ${$u[lo]})`}function vscodeTint(Au,lo,$u){return`color-mix(in srgb, ${vscodeVar(Au,lo)} ${$u}%, transparent)`}const vscodeSystemFont='system-ui, "Ubuntu", "Droid Sans", -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", sans-serif',vscodeFontFamily=`var(--vscode-font-family, ${vscodeSystemFont})`,vscodeMonoFontFamily='var(--vscode-editor-font-family, "Droid Sans Mono", "monospace", monospace)',vscodeFontSize="var(--vscode-font-size, 13px)",vscodeColors={black:vscodeVars.editorBackground.dark,gray:vscodeVars.descriptionForeground.dark,white:vscodeVars.editorBackground.light,vscodeBase:"#0078D4",vscodeBrand:"#0078D4",vscodeAccent:"#4DAAFC",vscodeText:"#005FB8",vscodeTint:"#E8F1FB",vscodeBright:"#4DAAFC",vscodeHover:"#026EC1",attentionBrand:vscodeVars.editorWarningForeground.light,attentionAccent:vscodeVars.editorWarningForeground.dark,attentionTint:"#FFF4CE",dangerBrand:vscodeVars.errorForeground.light,dangerAccent:vscodeVars.errorForeground.dark,dangerTint:"#FDE7E6",severeBrand:"#BC4C00",severeAccent:"#DB6D28",severeTint:"#FFE9D9",doneBrand:vscodeVars.terminalAnsiMagenta.light,doneAccent:vscodeVars.terminalAnsiMagenta.dark,doneTint:"#F5E1F5",brightGlow:"#4DAAFC",brightPop:"#0DBC79",brightSpark:"#11A8CD",brightBlaze:"#F14C4C",brightSurge:"#2472C8",brightFlame:"#E5E510",brightGold:"#FFCC00",brightLightGlow:"#005FB8",brightLightPop:"#107C10",brightLightSpark:"#0598BC",brightLightBlaze:"#CD3131",brightLightSurge:"#0451A5",brightLightFlame:"#949800",brightLightGold:"#9A7B00"},themeAccents={green:{accent:"#7ADBB8",on:"#06281E",stage:{light:"#DDF5EC",dark:"#10261F"},quiet:{light:"#F0FAF6",dark:"#17211D"},text:{light:"#248462",dark:"#8FE5C6"}},rose:{accent:"#F6A5C1",on:"#3A0A1C",stage:{light:"#FCE3EC",dark:"#2B141C"},quiet:{light:"#FDF2F6",dark:"#22181C"},text:{light:"#B83A6B",dark:"#F6A5C1"}},sky:{accent:"#8CCBF9",on:"#06243B",stage:{light:"#DFF0FD",dark:"#0F2333"},quiet:{light:"#F0F8FE",dark:"#161E25"},text:{light:"#1F6FB0",dark:"#8CCBF9"}},lime:{accent:"#BEDC55",on:"#1F2A00",stage:{light:"#EEF6CC",dark:"#1E2609"},quiet:{light:"#F7FBE6",dark:"#1C2014"},text:{light:"#5F7A00",dark:"#BEDC55"}},sun:{accent:"#F8D469",on:"#2E2200",stage:{light:"#FDF3CD",dark:"#2A2209"},quiet:{light:"#FEF9E7",dark:"#221F14"},text:{light:"#8A6A00",dark:"#F8D469"}},violet:{accent:"#C0AEF6",on:"#1C0F47",stage:{light:"#ECE7FD",dark:"#1B1533"},quiet:{light:"#F6F3FE",dark:"#1C1A27"},text:{light:"#6B53C9",dark:"#C0AEF6"}}},themeAccentNames=["green","rose","sky","lime","sun","violet"];function themeStageGradient(Au,lo){return`radial-gradient(140% 100% at 50% 0%, ${Au} 0%, ${lo} 100%)`}function themeAccentTints(Au){return{"--theme-accent":Au.accent,"--theme-accent-on":Au.on,"--theme-stage":Au.stage,"--theme-quiet":Au.quiet,"--theme-stage-gradient":themeStageGradient(Au.stage,Au.quiet)}}function themeTintVars(Au){return themeAccentTints({accent:Au.accent.emphasis,on:Au.btn.primary.text,stage:Au.accent.subtle??Au.canvas.subtle??Au.canvas.default,quiet:Au.canvas.subtle??Au.canvas.default})}function themeAccentVars(Au,lo="light"){const $u=themeAccents[Au];if(!$u)throw new Error(`There is no accent "${Au}"; the accents are ${themeAccentNames.join(", ")}.`);return{...themeAccentTints({accent:$u.accent,on:$u.on,stage:$u.stage[lo],quiet:$u.quiet[lo]}),"--bgColor-accent-emphasis":$u.accent,"--borderColor-accent-emphasis":$u.accent,"--fgColor-accent":$u.text[lo],"--fgColor-link":$u.text[lo],"--borderColor-accent-muted":$u.accent,"--bgColor-accent-muted":$u.quiet[lo],"--underlineNav-borderColor-active":$u.accent,"--button-primary-bgColor-rest":$u.accent,"--button-primary-borderColor-rest":$u.accent,"--button-primary-bgColor-hover":$u.accent,"--button-primary-borderColor-hover":$u.accent,"--button-primary-bgColor-active":$u.accent,"--button-primary-borderColor-active":$u.accent,"--button-primary-fgColor-rest":$u.on,"--button-primary-iconColor-rest":$u.on,"--buttonCounter-primary-fgColor-rest":$u.on,"--color-btn-primary-bg":$u.accent,"--color-btn-primary-hover-bg":$u.accent,"--control-checked-bgColor-rest":$u.accent,"--control-checked-bgColor-hover":$u.accent,"--control-checked-bgColor-active":$u.accent,"--control-checked-fgColor-rest":$u.on,"--controlKnob-borderColor-checked":$u.accent,"--datalayer-icon-fg":$u.text[lo]}}const hueNames=["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","stone"],baseHueColors={red:{light:"#B91C1C",dark:"#F87171"},orange:{light:"#C2410C",dark:"#FB923C"},amber:{light:"#B45309",dark:"#FBBF24"},yellow:{light:"#A16207",dark:"#FACC15"},lime:{light:"#4D7C0F",dark:"#A3E635"},green:{light:"#15803D",dark:"#4ADE80"},emerald:{light:"#047857",dark:"#34D399"},teal:{light:"#0F766E",dark:"#2DD4BF"},cyan:{light:"#0E7490",dark:"#22D3EE"},sky:{light:"#0369A1",dark:"#38BDF8"},blue:{light:"#1D4ED8",dark:"#60A5FA"},indigo:{light:"#4338CA",dark:"#818CF8"},violet:{light:"#6D28D9",dark:"#A78BFA"},purple:{light:"#7E22CE",dark:"#C084FC"},fuchsia:{light:"#A21CAF",dark:"#E879F9"},pink:{light:"#BE185D",dark:"#F472B6"},rose:{light:"#BE123C",dark:"#FB7185"},slate:{light:"#475569",dark:"#94A3B8"},gray:{light:"#4B5563",dark:"#9CA3AF"},stone:{light:"#57534E",dark:"#A8A29E"}},themeHueColors={loop:{green:{light:"#248462",dark:"#8FE5C6"},rose:{light:"#B83A6B",dark:"#F6A5C1"},sky:{light:"#1F6FB0",dark:"#8CCBF9"},lime:{light:"#5F7A00",dark:"#BEDC55"},yellow:{light:"#8A6A00",dark:"#F8D469"},violet:{light:"#6B53C9",dark:"#C0AEF6"},orange:{light:"#B4571A",dark:"#F4A261"}},vscode:{red:{light:"#CD3131",dark:"#F14C4C"},green:{light:"#107C10",dark:"#0DBC79"},yellow:{light:"#858800",dark:"#E5E510"},blue:{light:"#0451A5",dark:"#2472C8"},cyan:{light:"#0598BC",dark:"#11A8CD"},purple:{light:"#BC05BC",dark:"#BC3FBC"}}};function hueColorsOf(Au,lo){const $u=themeHueColors[Au]??{};return Object.fromEntries(hueNames.map(Ru=>[Ru,($u[Ru]??baseHueColors[Ru])[lo]]))}const datalayer={neutral:"#656D76",muted:"#8b949e",pending:"#d29922",warning:"#d29922",danger:"#d1242f",success:"#16A085",info:"#0969da",reservation:"#656D76",credits:"#16A085",inviteJoined:"#0969da",invitePending:"#cfd3d7"},spatial={neutral:"#8892B0",muted:"#6B7394",pending:"#E2B340",warning:"#E2B340",danger:"#FF5252",success:"#4F46E5",info:"#448AFF",reservation:"#8892B0",credits:"#4F46E5",inviteJoined:"#448AFF",invitePending:"#6B7394"},lovely={neutral:"#9D7A8F",muted:"#C9A2B8",pending:"#FFD740",warning:"#FFD740",danger:"#FF1744",success:"#DB2777",info:"#536DFE",reservation:"#9D7A8F",credits:"#DB2777",inviteJoined:"#536DFE",invitePending:"#C9A2B8"},matrix={neutral:"#5A6E3A",muted:"#7A9A50",pending:"#FFD600",warning:"#FFD600",danger:"#FF3D00",success:"#00C853",info:"#00E676",reservation:"#5A6E3A",credits:"#00C853",inviteJoined:"#00E676",invitePending:"#7A9A50"},indicatorColors={datalayer,spatial,lovely,matrix},defaultIndicatorColors=datalayer,primerComponentSelectors={button:'[class*="prc-Button-ButtonBase"]',textInput:'[class*="prc-components-TextInputBaseWrapper"]',textArea:'[class*="prc-Textarea-TextArea"]',segmentedControl:'[class*="prc-SegmentedControl-SegmentedControl"]',buttonGroup:'[class*="prc-ButtonGroup-ButtonGroup"]',underlineTab:'[class*="prc-components-UnderlineItem"]',toggleTrack:'[class*="ToggleSwitch__SwitchButton-"]',toggleKnob:'[class*="ToggleSwitch__ToggleKnob-"]',table:'[class*="prc-DataTable-Table-"]',tableHeader:'[class*="prc-DataTable-TableHeader-"]',tableCell:'[class*="prc-DataTable-TableCell-"]'},sel$1=primerComponentSelectors;function primerComponentsCss(Au={}){const lo=[];Au.radiusControl!==void 0&&lo.push(`:scope ${sel$1.button},
94
94
  :scope ${sel$1.textInput}:not(:has(${sel$1.textArea})),
95
95
  :scope ${sel$1.segmentedControl},
96
96
  :scope ${sel$1.underlineTab},
@@ -120,7 +120,7 @@ ${Au}
120
120
  :scope strong {
121
121
  font-weight: var(--base-text-weight-semibold);
122
122
  }
123
- `,loopThemeStyles=buildThemeStyles(loopLight,loopDark,{fontFamily:loopFontFamily,css:loopOwnCss,shape:{radiusControl:loopShapeVars["--loop-radius-control"],radiusTable:loopShapeVars["--borderRadius-medium"],radiusOverlay:loopShapeVars["--loop-radius-card"],radiusCard:loopShapeVars["--loop-radius-card"],radiusBubble:loopShapeVars["--loop-radius-bubble"],radiusFrame:loopShapeVars["--loop-radius-frame"],shadow:loopShapeVars["--loop-shadow-frame"],motionStatus:loopMotionVars["--loop-motion-status"],motionMessage:loopMotionVars["--loop-motion-message"],motionPane:loopMotionVars["--loop-motion-pane"],motionEasing:loopMotionVars["--loop-motion-easing"],messageLink:"currentColor"},variables:{light:{...loopShapeVars,...loopTints("light"),...loopMotionVars,...loopShadows.light,...loopTypeVars(loopFontFamily),"--loop-hairline":loopHairline.light,"--borderColor-default":loopHairline.light,"--focus-outlineColor":loopFocusRing.light,"--underlineNav-borderColor-active":themeAccents.green.accent},dark:{...loopShapeVars,...loopTints("dark"),...loopMotionVars,...loopShadows.dark,...loopTypeVars(loopFontFamily),"--loop-hairline":loopHairline.dark,"--borderColor-default":loopHairline.dark,"--focus-outlineColor":loopFocusRing.dark,"--underlineNav-borderColor-active":themeAccents.green.accent}}});loopThemeStyles.css;const loopTheme={...theme$1,fontWeights:{light:loopFontWeights.regular,normal:loopFontWeights.regular,semibold:loopFontWeights.semibold,bold:loopFontWeights.semibold}},metalLight={...loopLight,canvas:{default:metalColors.white,subtle:metalColors.subtle},fg:{default:metalColors.ink,muted:metalColors.gray,onEmphasis:"#FFFFFF"},accent:{fg:metalColors.metalText,emphasis:metalColors.metalBrand,muted:metalColors.metalBrand,subtle:metalColors.metalTint},border:{default:metalColors.line,muted:metalColors.lineMuted},btn:{...loopLight.btn,text:metalColors.ink,bg:"#FFFFFF",border:metalColors.controlLine,hoverBg:"#F4F7FB",hoverBorder:"#C4D2E6",activeBg:"#E3E9F2",selectedBg:"#E3E9F2",counterBg:"rgba(34, 38, 43, 0.08)",primary:{...loopLight.btn.primary,text:metalColors.metalOn,bg:metalColors.metalBrand,border:metalColors.metalBrand,hoverBg:metalColors.metalHover,hoverBorder:metalColors.metalHover,selectedBg:metalColors.metalActive,disabledText:"rgba(255, 255, 255, 0.8)",disabledBg:"#B9CBE6",disabledBorder:"#B9CBE6",icon:metalColors.metalOn,counterBg:"rgba(255, 255, 255, 0.2)"},outline:{...loopLight.btn.outline,text:metalColors.metalText,hoverText:metalColors.metalOn,hoverBg:metalColors.metalBrand,hoverBorder:metalColors.metalBrand,hoverCounterBg:"rgba(255, 255, 255, 0.2)",selectedText:metalColors.metalOn,selectedBg:metalColors.metalActive,selectedBorder:metalColors.metalActive,disabledText:metalColors.gray,disabledBg:metalColors.subtle,counterFg:metalColors.metalText,hoverCounterFg:metalColors.metalOn,disabledCounterFg:metalColors.gray}}},metalDark={...loopDark,canvas:{default:metalColors.black,subtle:metalColors.subtleDark},fg:{default:metalColors.inkDark,muted:metalColors.grayDark,onEmphasis:"#FFFFFF"},accent:{fg:metalColors.metalBright,emphasis:metalColors.white,muted:metalColors.metalBright,subtle:metalColors.metalTintDark},border:{default:metalColors.lineDark,muted:metalColors.lineMutedDark},btn:{...loopDark.btn,text:metalColors.inkDark,bg:"rgba(255, 255, 255, 0.10)",border:"rgba(255, 255, 255, 0.22)",hoverBg:"rgba(255, 255, 255, 0.16)",hoverBorder:"rgba(255, 255, 255, 0.32)",activeBg:"rgba(255, 255, 255, 0.20)",selectedBg:"rgba(255, 255, 255, 0.20)",counterBg:"rgba(238, 242, 247, 0.12)",primary:{...loopDark.btn.primary,text:metalColors.metalOnDark,bg:metalColors.white,border:metalColors.white,hoverBg:"#E8EEF7",hoverBorder:"#E8EEF7",selectedBg:"#DCE5F2",disabledText:"rgba(11, 26, 48, 0.6)",disabledBg:"rgba(255, 255, 255, 0.35)",disabledBorder:"transparent",icon:metalColors.metalOnDark,counterBg:"rgba(11, 26, 48, 0.12)"},outline:{...loopDark.btn.outline,text:metalColors.metalBright,hoverText:metalColors.metalOnDark,hoverBg:metalColors.metalBright,hoverBorder:metalColors.metalBright,selectedText:metalColors.metalOnDark,selectedBg:metalColors.metalBrightHover,selectedBorder:metalColors.metalBrightHover,disabledText:"rgba(143, 180, 232, 0.5)",disabledBg:"rgba(143, 180, 232, 0.1)",disabledCounterBg:"rgba(143, 180, 232, 0.05)",counterBg:"rgba(143, 180, 232, 0.1)",counterFg:metalColors.metalBright,hoverCounterFg:metalColors.metalOnDark,disabledCounterFg:"rgba(143, 180, 232, 0.5)"}}},metalFontFamily='"Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',metalMonoFamily='"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',metalFontWeights={regular:400,medium:500},metalTypeVars=()=>{const{regular:Au,medium:lo}=metalFontWeights,{display:$u,title:Ru,heading:Iu}=loopTypeScale;return{...loopTypeVars(metalFontFamily),"--base-text-weight-medium":String(lo),"--base-text-weight-semibold":String(lo),"--text-display-weight":String(Au),"--text-display-shorthand":`${Au} ${$u.size}/${$u.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-large":`${Au} ${$u.size}/${$u.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-medium":`${Au} ${Ru.size}/${Ru.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-small":`${lo} ${Iu.size}/${Iu.lineHeight} ${metalFontFamily}`,"--loop-tracking-display":"-0.03em","--loop-tracking-title":"-0.02em","--fontStack-monospace":metalMonoFamily}},metalSurfaceVars={"--metal-gradient-sage":`linear-gradient(160deg, ${metalColors.sageFrom}, ${metalColors.sageTo})`,"--metal-gradient-steel":`linear-gradient(160deg, ${metalColors.steelFrom}, ${metalColors.steelTo})`,"--metal-gradient-mauve":`linear-gradient(160deg, ${metalColors.mauveFrom}, ${metalColors.mauveTo})`,"--metal-gradient-clay":`linear-gradient(160deg, ${metalColors.clayFrom}, ${metalColors.clayTo})`,"--metal-glass-bg":"rgba(255, 255, 255, 0.14)","--metal-glass-border":"rgba(255, 255, 255, 0.24)"},metalPage={light:["radial-gradient(rgba(76, 118, 186, 0.15) 1px, transparent 1.2px) 0 0 / 22px 22px","radial-gradient(1100px 620px at 88% -8%, #D6E4F7 0%, transparent 62%)","radial-gradient(900px 560px at -6% 4%, #E6F0EE 0%, transparent 60%)","#F7F9FD"].join(", "),dark:["radial-gradient(900px 640px at 6% -4%, #55794E 0%, transparent 62%)","radial-gradient(1000px 700px at 96% 4%, #2C6AA8 0%, transparent 60%)","radial-gradient(900px 640px at 92% 102%, #8E3F60 0%, transparent 60%)","radial-gradient(800px 560px at 8% 104%, #93492E 0%, transparent 58%)","#1C2A33"].join(", ")},metalHairline={light:"rgba(76, 118, 186, 0.20)",dark:"rgba(255, 255, 255, 0.18)"},metalPainted={light:{"--bgColor-default":"rgba(255, 255, 255, 0.82)","--bgColor-muted":"rgba(244, 247, 252, 0.72)","--bgColor-inset":"rgba(240, 244, 250, 0.72)","--overlay-bgColor":"#FFFFFF","--control-transparent-bgColor-selected":"#EDF1F6"},dark:{"--bgColor-default":"rgba(255, 255, 255, 0.07)","--bgColor-muted":"rgba(255, 255, 255, 0.05)","--bgColor-inset":"rgba(0, 0, 0, 0.14)","--overlay-bgColor":"#25343F","--fgColor-default":"#FFFFFF","--fgColor-muted":"rgba(255, 255, 255, 0.74)","--control-transparent-bgColor-selected":"rgba(255, 255, 255, 0.14)"}},metalShadows={light:{"--loop-shadow-frame":"none","--theme-shadow":"none","--shadow-resting-xsmall":"none","--shadow-resting-small":"none","--shadow-resting-medium":"none","--shadow-floating-small":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 6px 18px rgba(34, 52, 84, 0.08)","--shadow-floating-medium":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 10px 28px rgba(34, 52, 84, 0.10)","--shadow-floating-large":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 18px 48px rgba(34, 52, 84, 0.12)","--shadow-floating-xlarge":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 24px 64px rgba(34, 52, 84, 0.14)"},dark:{"--loop-shadow-frame":"none","--theme-shadow":"none","--shadow-resting-xsmall":"none","--shadow-resting-small":"none","--shadow-resting-medium":"none","--shadow-floating-small":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.3)","--shadow-floating-medium":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 10px 28px rgba(0, 0, 0, 0.35)","--shadow-floating-large":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 48px rgba(0, 0, 0, 0.4)","--shadow-floating-xlarge":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 24px 64px rgba(0, 0, 0, 0.45)"}},metalFocusRing={light:metalColors.metalRing,dark:metalColors.white},metalTints=Au=>themeAccentTints({accent:Au==="light"?metalColors.metalBrand:metalColors.white,on:Au==="light"?metalColors.metalOn:metalColors.metalOnDark,stage:Au==="light"?metalColors.metalStage:metalColors.metalStageDark,quiet:Au==="light"?metalColors.metalTint:metalColors.metalTintDark}),metalVariables=Au=>({...loopShapeVars,...metalTints(Au),...loopMotionVars,...metalShadows[Au],...metalTypeVars(),...metalSurfaceVars,...metalPainted[Au],"--metal-page":metalPage[Au],"--loop-hairline":metalHairline[Au],"--borderColor-default":metalHairline[Au],"--borderColor-muted":metalHairline[Au],"--focus-outlineColor":metalFocusRing[Au],"--underlineNav-borderColor-active":Au==="light"?metalColors.metalBrand:metalColors.white}),metalOwnCss=`
123
+ `,loopThemeStyles=buildThemeStyles(loopLight,loopDark,{fontFamily:loopFontFamily,css:loopOwnCss,shape:{radiusControl:loopShapeVars["--loop-radius-control"],radiusTable:loopShapeVars["--borderRadius-medium"],radiusOverlay:loopShapeVars["--loop-radius-card"],radiusCard:loopShapeVars["--loop-radius-card"],radiusBubble:loopShapeVars["--loop-radius-bubble"],radiusFrame:loopShapeVars["--loop-radius-frame"],shadow:loopShapeVars["--loop-shadow-frame"],motionStatus:loopMotionVars["--loop-motion-status"],motionMessage:loopMotionVars["--loop-motion-message"],motionPane:loopMotionVars["--loop-motion-pane"],motionEasing:loopMotionVars["--loop-motion-easing"],messageLink:"currentColor"},variables:{light:{...loopShapeVars,...loopTints("light"),...loopMotionVars,...loopShadows.light,...loopTypeVars(loopFontFamily),"--loop-hairline":loopHairline.light,"--borderColor-default":loopHairline.light,"--focus-outlineColor":loopFocusRing.light,"--underlineNav-borderColor-active":themeAccents.green.accent},dark:{...loopShapeVars,...loopTints("dark"),...loopMotionVars,...loopShadows.dark,...loopTypeVars(loopFontFamily),"--loop-hairline":loopHairline.dark,"--borderColor-default":loopHairline.dark,"--focus-outlineColor":loopFocusRing.dark,"--underlineNav-borderColor-active":themeAccents.green.accent}}});loopThemeStyles.css;const loopTheme={...theme$1,fontWeights:{light:loopFontWeights.regular,normal:loopFontWeights.regular,semibold:loopFontWeights.semibold,bold:loopFontWeights.semibold}},metalLight={...loopLight,canvas:{default:metalColors.white,subtle:metalColors.subtle},fg:{default:metalColors.ink,muted:metalColors.gray,onEmphasis:"#FFFFFF"},accent:{fg:metalColors.metalText,emphasis:metalColors.metalBrand,muted:metalColors.metalTintLine,subtle:metalColors.metalTint},border:{default:metalColors.line,muted:metalColors.lineMuted},btn:{...loopLight.btn,text:metalColors.ink,bg:"#FFFFFF",border:metalColors.controlLine,hoverBg:"#F4F7FB",hoverBorder:"#C4D2E6",activeBg:"#E3E9F2",selectedBg:"#E3E9F2",counterBg:"rgba(34, 38, 43, 0.08)",primary:{...loopLight.btn.primary,text:metalColors.metalOn,bg:metalColors.metalBrand,border:metalColors.metalBrand,hoverBg:metalColors.metalHover,hoverBorder:metalColors.metalHover,selectedBg:metalColors.metalActive,disabledText:"rgba(255, 255, 255, 0.8)",disabledBg:"#B9CBE6",disabledBorder:"#B9CBE6",icon:metalColors.metalOn,counterBg:"rgba(255, 255, 255, 0.2)"},outline:{...loopLight.btn.outline,text:metalColors.metalText,hoverText:metalColors.metalOn,hoverBg:metalColors.metalBrand,hoverBorder:metalColors.metalBrand,hoverCounterBg:"rgba(255, 255, 255, 0.2)",selectedText:metalColors.metalOn,selectedBg:metalColors.metalActive,selectedBorder:metalColors.metalActive,disabledText:metalColors.gray,disabledBg:metalColors.subtle,counterFg:metalColors.metalText,hoverCounterFg:metalColors.metalOn,disabledCounterFg:metalColors.gray}}},metalDark={...loopDark,canvas:{default:metalColors.black,subtle:metalColors.subtleDark},fg:{default:metalColors.inkDark,muted:metalColors.grayDark,onEmphasis:"#FFFFFF"},accent:{fg:metalColors.metalBright,emphasis:metalColors.metalBrand,muted:metalColors.metalBright,subtle:metalColors.metalTintDark},border:{default:metalColors.lineDark,muted:metalColors.lineMutedDark},btn:{...loopDark.btn,text:metalColors.inkDark,bg:"rgba(255, 255, 255, 0.10)",border:"rgba(255, 255, 255, 0.22)",hoverBg:"rgba(255, 255, 255, 0.16)",hoverBorder:"rgba(255, 255, 255, 0.32)",activeBg:"rgba(255, 255, 255, 0.20)",selectedBg:"rgba(255, 255, 255, 0.20)",counterBg:"rgba(238, 242, 247, 0.12)",primary:{...loopDark.btn.primary,text:metalColors.metalOnDark,bg:metalColors.white,border:metalColors.white,hoverBg:"#E8EEF7",hoverBorder:"#E8EEF7",selectedBg:"#DCE5F2",disabledText:"rgba(11, 26, 48, 0.6)",disabledBg:"rgba(255, 255, 255, 0.35)",disabledBorder:"transparent",icon:metalColors.metalOnDark,counterBg:"rgba(11, 26, 48, 0.12)"},outline:{...loopDark.btn.outline,text:metalColors.metalBright,hoverText:metalColors.metalOnDark,hoverBg:metalColors.metalBright,hoverBorder:metalColors.metalBright,selectedText:metalColors.metalOnDark,selectedBg:metalColors.metalBrightHover,selectedBorder:metalColors.metalBrightHover,disabledText:"rgba(143, 180, 232, 0.5)",disabledBg:"rgba(143, 180, 232, 0.1)",disabledCounterBg:"rgba(143, 180, 232, 0.05)",counterBg:"rgba(143, 180, 232, 0.1)",counterFg:metalColors.metalBright,hoverCounterFg:metalColors.metalOnDark,disabledCounterFg:"rgba(143, 180, 232, 0.5)"}}},metalFontFamily='"Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',metalMonoFamily='"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',metalFontWeights={regular:400,medium:500},metalTypeVars=()=>{const{regular:Au,medium:lo}=metalFontWeights,{display:$u,title:Ru,heading:Iu}=loopTypeScale;return{...loopTypeVars(metalFontFamily),"--base-text-weight-medium":String(lo),"--base-text-weight-semibold":String(lo),"--text-display-weight":String(Au),"--text-display-shorthand":`${Au} ${$u.size}/${$u.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-large":`${Au} ${$u.size}/${$u.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-medium":`${Au} ${Ru.size}/${Ru.lineHeight} ${metalFontFamily}`,"--text-title-shorthand-small":`${lo} ${Iu.size}/${Iu.lineHeight} ${metalFontFamily}`,"--loop-tracking-display":"-0.03em","--loop-tracking-title":"-0.02em","--fontStack-monospace":metalMonoFamily}},metalSurfaceVars={"--metal-gradient-sage":`linear-gradient(160deg, ${metalColors.sageFrom}, ${metalColors.sageTo})`,"--metal-gradient-steel":`linear-gradient(160deg, ${metalColors.steelFrom}, ${metalColors.steelTo})`,"--metal-gradient-mauve":`linear-gradient(160deg, ${metalColors.mauveFrom}, ${metalColors.mauveTo})`,"--metal-gradient-clay":`linear-gradient(160deg, ${metalColors.clayFrom}, ${metalColors.clayTo})`,"--metal-glass-bg":"rgba(255, 255, 255, 0.14)","--metal-glass-border":"rgba(255, 255, 255, 0.24)"},metalPage={light:["radial-gradient(rgba(76, 118, 186, 0.15) 1px, transparent 1.2px) 0 0 / 22px 22px","radial-gradient(900px 640px at 6% -4%, #C4DDBB 0%, transparent 62%)","radial-gradient(1000px 700px at 96% 4%, #AFCFF3 0%, transparent 60%)","radial-gradient(900px 640px at 92% 102%, #EDC3D6 0%, transparent 60%)","radial-gradient(800px 560px at 8% 104%, #F2CBB2 0%, transparent 58%)","#F7F9FD"].join(", "),dark:["radial-gradient(900px 640px at 6% -4%, #55794E 0%, transparent 62%)","radial-gradient(1000px 700px at 96% 4%, #2C6AA8 0%, transparent 60%)","radial-gradient(900px 640px at 92% 102%, #8E3F60 0%, transparent 60%)","radial-gradient(800px 560px at 8% 104%, #93492E 0%, transparent 58%)","#1C2A33"].join(", ")},metalHairline={light:"rgba(76, 138, 200, 0.26)",dark:"rgba(255, 255, 255, 0.18)"},metalPainted={light:{"--bgColor-default":"#FFFFFF","--bgColor-muted":"#F6F9FD","--bgColor-inset":"#F1F5FB","--overlay-bgColor":"#FFFFFF","--metal-primary-image":"linear-gradient(180deg, #5C86C8 0%, #3F68AC 100%)","--metal-primary-shadow":"inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(34, 52, 84, 0.18)","--control-transparent-bgColor-selected":"#EDF1F6"},dark:{"--bgColor-default":"rgba(30, 44, 54, 0.74)","--bgColor-muted":"rgba(255, 255, 255, 0.06)","--bgColor-inset":"rgba(0, 0, 0, 0.14)","--bgColor-accent-muted":"rgba(255, 255, 255, 0.09)","--borderColor-accent-muted":"rgba(255, 255, 255, 0.22)","--overlay-bgColor":"#25343F","--metal-primary-image":"none","--metal-primary-shadow":"none","--fgColor-default":"#FFFFFF","--fgColor-muted":"rgba(255, 255, 255, 0.74)","--control-transparent-bgColor-selected":"rgba(255, 255, 255, 0.14)"}},metalShadows={light:{"--loop-shadow-frame":"none","--theme-shadow":"none","--shadow-resting-xsmall":"none","--shadow-resting-small":"none","--shadow-resting-medium":"none","--shadow-floating-small":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 6px 18px rgba(34, 52, 84, 0.08)","--shadow-floating-medium":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 10px 28px rgba(34, 52, 84, 0.10)","--shadow-floating-large":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 18px 48px rgba(34, 52, 84, 0.12)","--shadow-floating-xlarge":"0 0 0 1px rgba(76, 118, 186, 0.16), 0 24px 64px rgba(34, 52, 84, 0.14)"},dark:{"--loop-shadow-frame":"none","--theme-shadow":"none","--shadow-resting-xsmall":"none","--shadow-resting-small":"none","--shadow-resting-medium":"none","--shadow-floating-small":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.3)","--shadow-floating-medium":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 10px 28px rgba(0, 0, 0, 0.35)","--shadow-floating-large":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 48px rgba(0, 0, 0, 0.4)","--shadow-floating-xlarge":"0 0 0 1px rgba(255, 255, 255, 0.16), 0 24px 64px rgba(0, 0, 0, 0.45)"}},metalFocusRing={light:metalColors.metalRing,dark:metalColors.white},metalTints=Au=>themeAccentTints({accent:Au==="light"?metalColors.metalBrand:metalColors.white,on:Au==="light"?metalColors.metalOn:metalColors.metalOnDark,stage:Au==="light"?metalColors.metalStage:metalColors.metalStageDark,quiet:Au==="light"?metalColors.metalTint:metalColors.metalTintDark}),metalVariables=Au=>({...loopShapeVars,...metalTints(Au),...loopMotionVars,...metalShadows[Au],...metalTypeVars(),...metalSurfaceVars,...metalPainted[Au],"--metal-page":metalPage[Au],"--loop-hairline":metalHairline[Au],"--borderColor-default":metalHairline[Au],"--borderColor-muted":metalHairline[Au],"--focus-outlineColor":metalFocusRing[Au],"--underlineNav-borderColor-active":Au==="light"?metalColors.metalBrand:metalColors.white}),metalOwnCss=`
124
124
  :scope {
125
125
  background: var(--metal-page);
126
126
  background-attachment: fixed;
@@ -148,10 +148,9 @@ ${Au}
148
148
  :scope [class*="CounterLabel"] {
149
149
  font-family: var(--fontStack-monospace);
150
150
  }
151
- :scope[data-color-mode="light"] [data-variant="primary"],
152
- [data-color-mode="light"] :scope [data-variant="primary"] {
153
- background-image: linear-gradient(180deg, #5C86C8 0%, #3F68AC 100%);
154
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(34, 52, 84, 0.18);
151
+ :scope [data-variant="primary"] {
152
+ background-image: var(--metal-primary-image);
153
+ box-shadow: var(--metal-primary-shadow);
155
154
  }
156
155
  `,metalThemeStyles=buildThemeStyles(metalLight,metalDark,{fontFamily:metalFontFamily,css:metalOwnCss,shape:{radiusControl:loopShapeVars["--loop-radius-control"],radiusTable:loopShapeVars["--borderRadius-medium"],radiusOverlay:loopShapeVars["--loop-radius-card"],radiusCard:loopShapeVars["--loop-radius-card"],radiusBubble:loopShapeVars["--loop-radius-bubble"],radiusFrame:loopShapeVars["--loop-radius-frame"],shadow:"none",motionStatus:loopMotionVars["--loop-motion-status"],motionMessage:loopMotionVars["--loop-motion-message"],motionPane:loopMotionVars["--loop-motion-pane"],motionEasing:loopMotionVars["--loop-motion-easing"],messageLink:"currentColor"},variables:{light:metalVariables("light"),dark:metalVariables("dark")}}),metalTheme={...theme$1,fontWeights:{light:metalFontWeights.regular,normal:metalFontWeights.regular,semibold:metalFontWeights.medium,bold:metalFontWeights.medium}},vscodeEditorsCss=`
157
156
  :scope {
@@ -1859,7 +1858,8 @@ ${Ou}
1859
1858
  `,{prompt:Ru,stopSequences:[`
1860
1859
  ${lo}:`]}}function getResponseMetadata2({id:Au,model:lo,created:$u}){return{id:Au??void 0,modelId:lo??void 0,timestamp:$u!=null?new Date($u*1e3):void 0}}function mapOpenAIFinishReason2(Au){switch(Au){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var openaiCompletionResponseSchema=lazySchema(()=>zodSchema(object({id:string$2().nullish(),created:number$2().nullish(),model:string$2().nullish(),choices:array(object({text:string$2(),finish_reason:string$2(),logprobs:object({tokens:array(string$2()),token_logprobs:array(number$2()),top_logprobs:array(record$2(string$2(),number$2())).nullish()}).nullish()})),usage:object({prompt_tokens:number$2(),completion_tokens:number$2(),total_tokens:number$2()}).nullish()}))),openaiCompletionChunkSchema=lazySchema(()=>zodSchema(union([object({id:string$2().nullish(),created:number$2().nullish(),model:string$2().nullish(),choices:array(object({text:string$2(),finish_reason:string$2().nullish(),index:number$2(),logprobs:object({tokens:array(string$2()),token_logprobs:array(number$2()),top_logprobs:array(record$2(string$2(),number$2())).nullish()}).nullish()})),usage:object({prompt_tokens:number$2(),completion_tokens:number$2(),total_tokens:number$2()}).nullish()}),openaiErrorDataSchema]))),openaiLanguageModelCompletionOptions=lazySchema(()=>zodSchema(object({echo:boolean$1().optional(),logitBias:record$2(string$2(),number$2()).optional(),suffix:string$2().optional(),user:string$2().optional(),logprobs:union([boolean$1(),number$2()]).optional()}))),OpenAICompletionLanguageModel=class Fw{constructor(lo,$u){this.specificationVersion="v4",this.supportedUrls={},this.modelId=lo,this.config=$u}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new Fw(lo.modelId,lo.config)}get provider(){return this.config.provider}async getArgs({prompt:lo,maxOutputTokens:$u,temperature:Ru,topP:Iu,topK:Pu,frequencyPenalty:Ou,presencePenalty:Du,stopSequences:Mu,responseFormat:Lu,tools:Bu,toolChoice:ju,seed:Fu,providerOptions:zu}){const Uu=[],Hu={...await parseProviderOptions({provider:"openai",providerOptions:zu,schema:openaiLanguageModelCompletionOptions}),...await parseProviderOptions({provider:this.providerOptionsName,providerOptions:zu,schema:openaiLanguageModelCompletionOptions})};Pu!=null&&Uu.push({type:"unsupported",feature:"topK"}),Bu?.length&&Uu.push({type:"unsupported",feature:"tools"}),ju!=null&&Uu.push({type:"unsupported",feature:"toolChoice"}),Lu!=null&&Lu.type!=="text"&&Uu.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});const{prompt:Vu,stopSequences:Gu}=convertToOpenAICompletionPrompt({prompt:lo}),Wu=[...Gu??[],...Mu??[]];return{args:{model:this.modelId,echo:Hu.echo,logit_bias:Hu.logitBias,logprobs:Hu?.logprobs===!0?0:Hu?.logprobs===!1?void 0:Hu?.logprobs,suffix:Hu.suffix,user:Hu.user,max_tokens:$u,temperature:Ru,top_p:Iu,frequency_penalty:Ou,presence_penalty:Du,seed:Fu,prompt:Vu,stop:Wu.length>0?Wu:void 0},warnings:Uu}}async doGenerate(lo){var $u,Ru,Iu;const{args:Pu,warnings:Ou}=await this.getArgs(lo),{responseHeaders:Du,value:Mu,rawValue:Lu}=await postJsonToApi({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:combineHeaders((Ru=($u=this.config).headers)==null?void 0:Ru.call($u),lo.headers),body:Pu,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiCompletionResponseSchema),abortSignal:lo.abortSignal,fetch:this.config.fetch}),Bu=Mu.choices[0],ju={openai:{}};return Bu.logprobs!=null&&(ju.openai.logprobs=Bu.logprobs),{content:[{type:"text",text:Bu.text}],usage:convertOpenAICompletionUsage(Mu.usage),finishReason:{unified:mapOpenAIFinishReason2(Bu.finish_reason),raw:(Iu=Bu.finish_reason)!=null?Iu:void 0},request:{body:Pu},response:{...getResponseMetadata2(Mu),headers:Du,body:Lu},providerMetadata:ju,warnings:Ou}}async doStream(lo){var $u,Ru;const{args:Iu,warnings:Pu}=await this.getArgs(lo),Ou={...Iu,stream:!0,stream_options:{include_usage:!0}},Du=this.config.url({path:"/completions",modelId:this.modelId}),{responseHeaders:Mu,value:Lu}=await postJsonToApi({url:Du,headers:combineHeaders((Ru=($u=this.config).headers)==null?void 0:Ru.call($u),lo.headers),body:Ou,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createEventSourceResponseHandler(openaiCompletionChunkSchema),abortSignal:lo.abortSignal,fetch:this.config.fetch}),Bu=await throwIfOpenAIStreamErrorBeforeOutput({stream:Lu,getError:Vu=>"error"in Vu?Vu.error:void 0,isOutputChunk:isOpenAICompletionOutputChunk,url:Du,requestBodyValues:Ou,responseHeaders:Mu});let ju={unified:"other",raw:void 0};const Fu={openai:{}};let zu,Uu=!0;return{stream:Bu.pipeThrough(new TransformStream({start(Vu){Vu.enqueue({type:"stream-start",warnings:Pu})},transform(Vu,Gu){if(lo.includeRawChunks&&Gu.enqueue({type:"raw",rawValue:Vu.rawValue}),!Vu.success){ju={unified:"error",raw:void 0},Gu.enqueue({type:"error",error:Vu.error});return}const Wu=Vu.value;if("error"in Wu){ju={unified:"error",raw:void 0},Gu.enqueue({type:"error",error:Wu.error});return}Uu&&(Uu=!1,Gu.enqueue({type:"response-metadata",...getResponseMetadata2(Wu)}),Gu.enqueue({type:"text-start",id:"0"})),Wu.usage!=null&&(zu=Wu.usage);const Zu=Wu.choices[0];Zu?.finish_reason!=null&&(ju={unified:mapOpenAIFinishReason2(Zu.finish_reason),raw:Zu.finish_reason}),Zu?.logprobs!=null&&(Fu.openai.logprobs=Zu.logprobs),Zu?.text!=null&&Zu.text.length>0&&Gu.enqueue({type:"text-delta",id:"0",delta:Zu.text})},flush(Vu){Uu||Vu.enqueue({type:"text-end",id:"0"}),Vu.enqueue({type:"finish",finishReason:ju,providerMetadata:Fu,usage:convertOpenAICompletionUsage(zu)})}})),request:{body:Ou},response:{headers:Mu}}}};function isOpenAICompletionOutputChunk(Au){return!("error"in Au)&&Au.choices.some(lo=>lo.text.length>0)}var openaiEmbeddingModelOptions=lazySchema(()=>zodSchema(object({dimensions:number$2().optional(),user:string$2().optional()}))),openaiTextEmbeddingResponseSchema=lazySchema(()=>zodSchema(object({data:array(object({embedding:array(number$2())})),usage:object({prompt_tokens:number$2()}).nullish()}))),OpenAIEmbeddingModel=class zw{constructor(lo,$u){this.specificationVersion="v4",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=lo,this.config=$u}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new zw(lo.modelId,lo.config)}get provider(){return this.config.provider}async doEmbed({values:lo,headers:$u,abortSignal:Ru,providerOptions:Iu}){var Pu,Ou,Du;if(lo.length>this.maxEmbeddingsPerCall)throw new TooManyEmbeddingValuesForCallError({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:lo});const Mu=(Pu=await parseProviderOptions({provider:"openai",providerOptions:Iu,schema:openaiEmbeddingModelOptions}))!=null?Pu:{},{responseHeaders:Lu,value:Bu,rawValue:ju}=await postJsonToApi({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:combineHeaders((Du=(Ou=this.config).headers)==null?void 0:Du.call(Ou),$u),body:{model:this.modelId,input:lo,encoding_format:"float",dimensions:Mu.dimensions,user:Mu.user},failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiTextEmbeddingResponseSchema),abortSignal:Ru,fetch:this.config.fetch});return{warnings:[],embeddings:Bu.data.map(Fu=>Fu.embedding),usage:Bu.usage?{tokens:Bu.usage.prompt_tokens}:void 0,response:{headers:Lu,body:ju}}}},openaiFilesResponseSchema=lazySchema(()=>zodSchema(object({id:string$2(),object:string$2().nullish(),bytes:number$2().nullish(),created_at:number$2().nullish(),filename:string$2().nullish(),purpose:string$2().nullish(),status:string$2().nullish(),expires_at:number$2().nullish()}))),openaiFilesOptionsSchema=lazySchema(()=>zodSchema(object({purpose:string$2().optional(),expiresAfter:number$2().optional()}))),OpenAIFiles=class{constructor(Au){this.config=Au,this.specificationVersion="v4"}get provider(){return this.config.provider}async uploadFile({data:Au,mediaType:lo,filename:$u,providerOptions:Ru}){var Iu,Pu,Ou;const Du=await parseProviderOptions({provider:"openai",providerOptions:Ru,schema:openaiFilesOptionsSchema}),Mu=convertInlineFileDataToUint8Array(Au),Lu=new Blob([Mu],{type:lo}),Bu=new FormData;$u!=null?Bu.append("file",Lu,$u):Bu.append("file",Lu),Bu.append("purpose",(Iu=Du?.purpose)!=null?Iu:"assistants"),Du?.expiresAfter!=null&&Bu.append("expires_after",String(Du.expiresAfter));const{value:ju}=await postFormDataToApi({url:`${this.config.baseURL}/files`,headers:combineHeaders(this.config.headers()),formData:Bu,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiFilesResponseSchema),fetch:this.config.fetch});return{warnings:[],providerReference:{openai:ju.id},...((Pu=ju.filename)!=null?Pu:$u)?{filename:(Ou=ju.filename)!=null?Ou:$u}:{},...lo!=null?{mediaType:lo}:{},providerMetadata:{openai:{...ju.filename!=null?{filename:ju.filename}:{},...ju.purpose!=null?{purpose:ju.purpose}:{},...ju.bytes!=null?{bytes:ju.bytes}:{},...ju.created_at!=null?{createdAt:ju.created_at}:{},...ju.status!=null?{status:ju.status}:{},...ju.expires_at!=null?{expiresAt:ju.expires_at}:{}}}}}},openaiImageResponseSchema=lazySchema(()=>zodSchema(object({created:number$2().nullish(),data:array(object({b64_json:string$2(),revised_prompt:string$2().nullish()})),background:string$2().nullish(),output_format:string$2().nullish(),size:string$2().nullish(),quality:string$2().nullish(),usage:object({input_tokens:number$2().nullish(),output_tokens:number$2().nullish(),total_tokens:number$2().nullish(),input_tokens_details:object({image_tokens:number$2().nullish(),text_tokens:number$2().nullish()}).nullish()}).nullish()}))),modelMaxImagesPerCall={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10,"gpt-image-1.5":10,"gpt-image-2":10,"chatgpt-image-latest":10},defaultResponseFormatPrefixes=["chatgpt-image-","gpt-image-"];function hasDefaultResponseFormat(Au){return defaultResponseFormatPrefixes.some(lo=>Au.startsWith(lo))}function getMaxImagesPerCall(Au){var lo;return(lo=modelMaxImagesPerCall[Au])!=null?lo:Au.startsWith("gpt-image-")?10:1}var baseImageModelOptionsObject=object({quality:_enum(["standard","hd","low","medium","high","auto"]).optional(),background:_enum(["transparent","opaque","auto"]).optional(),outputFormat:_enum(["png","jpeg","webp"]).optional(),outputCompression:number$2().int().min(0).max(100).optional(),user:string$2().optional()}),openaiImageModelGenerationOptions=lazySchema(()=>zodSchema(baseImageModelOptionsObject.extend({style:_enum(["vivid","natural"]).optional(),moderation:_enum(["auto","low"]).optional()}))),openaiImageModelEditOptions=lazySchema(()=>zodSchema(baseImageModelOptionsObject.extend({inputFidelity:_enum(["high","low"]).optional()}))),OpenAIImageModel=class Uw{constructor(lo,$u){this.modelId=lo,this.config=$u,this.specificationVersion="v4"}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new Uw(lo.modelId,lo.config)}get maxImagesPerCall(){return getMaxImagesPerCall(this.modelId)}get provider(){return this.config.provider}async doGenerate({prompt:lo,files:$u,mask:Ru,n:Iu,size:Pu,aspectRatio:Ou,seed:Du,providerOptions:Mu,headers:Lu,abortSignal:Bu}){var ju,Fu,zu,Uu,Hu,Vu,Gu,Wu,Zu,Ju,Yu,Xu,ed,td,nd;const od=[];Ou!=null&&od.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),Du!=null&&od.push({type:"unsupported",feature:"seed"});const sd=(zu=(Fu=(ju=this.config._internal)==null?void 0:ju.currentDate)==null?void 0:Fu.call(ju))!=null?zu:new Date;if($u!=null){const wd=(Uu=await parseProviderOptions({provider:"openai",providerOptions:Mu,schema:openaiImageModelEditOptions}))!=null?Uu:{},{value:_d,responseHeaders:yd}=await postFormDataToApi({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:combineHeaders((Vu=(Hu=this.config).headers)==null?void 0:Vu.call(Hu),Lu),formData:convertToFormData({model:this.modelId,prompt:lo,image:await Promise.all($u.map(Sd=>Sd.type==="file"?new Blob([Sd.data instanceof Uint8Array?new Blob([Sd.data],{type:Sd.mediaType}):new Blob([convertBase64ToUint8Array(Sd.data)],{type:Sd.mediaType})],{type:Sd.mediaType}):downloadBlob(Sd.url))),mask:Ru!=null?await fileToBlob(Ru):void 0,n:Iu,size:Pu,quality:wd.quality,background:wd.background,output_format:wd.outputFormat,output_compression:wd.outputCompression,input_fidelity:wd.inputFidelity,user:wd.user}),failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiImageResponseSchema),abortSignal:Bu,fetch:this.config.fetch});return{images:_d.data.map(Sd=>Sd.b64_json),warnings:od,usage:_d.usage!=null?{inputTokens:(Gu=_d.usage.input_tokens)!=null?Gu:void 0,outputTokens:(Wu=_d.usage.output_tokens)!=null?Wu:void 0,totalTokens:(Zu=_d.usage.total_tokens)!=null?Zu:void 0}:void 0,response:{timestamp:sd,modelId:this.modelId,headers:yd},providerMetadata:{openai:{images:_d.data.map((Sd,kd)=>{var md,dd,vd,ld,ud,hd;return{...Sd.revised_prompt?{revisedPrompt:Sd.revised_prompt}:{},created:(md=_d.created)!=null?md:void 0,size:(dd=_d.size)!=null?dd:void 0,quality:(vd=_d.quality)!=null?vd:void 0,background:(ld=_d.background)!=null?ld:void 0,outputFormat:(ud=_d.output_format)!=null?ud:void 0,...distributeTokenDetails((hd=_d.usage)==null?void 0:hd.input_tokens_details,kd,_d.data.length)}})}}}}const ad=(Ju=await parseProviderOptions({provider:"openai",providerOptions:Mu,schema:openaiImageModelGenerationOptions}))!=null?Ju:{},{value:pd,responseHeaders:bd}=await postJsonToApi({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:combineHeaders((Xu=(Yu=this.config).headers)==null?void 0:Xu.call(Yu),Lu),body:{model:this.modelId,prompt:lo,n:Iu,size:Pu,quality:ad.quality,style:ad.style,background:ad.background,moderation:ad.moderation,output_format:ad.outputFormat,output_compression:ad.outputCompression,user:ad.user,...hasDefaultResponseFormat(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiImageResponseSchema),abortSignal:Bu,fetch:this.config.fetch});return{images:pd.data.map(wd=>wd.b64_json),warnings:od,usage:pd.usage!=null?{inputTokens:(ed=pd.usage.input_tokens)!=null?ed:void 0,outputTokens:(td=pd.usage.output_tokens)!=null?td:void 0,totalTokens:(nd=pd.usage.total_tokens)!=null?nd:void 0}:void 0,response:{timestamp:sd,modelId:this.modelId,headers:bd},providerMetadata:{openai:{images:pd.data.map((wd,_d)=>{var yd,Sd,kd,md,dd,vd;return{...wd.revised_prompt?{revisedPrompt:wd.revised_prompt}:{},created:(yd=pd.created)!=null?yd:void 0,size:(Sd=pd.size)!=null?Sd:void 0,quality:(kd=pd.quality)!=null?kd:void 0,background:(md=pd.background)!=null?md:void 0,outputFormat:(dd=pd.output_format)!=null?dd:void 0,...distributeTokenDetails((vd=pd.usage)==null?void 0:vd.input_tokens_details,_d,pd.data.length)}})}}}}};function distributeTokenDetails(Au,lo,$u){if(Au==null)return{};const Ru={};if(Au.image_tokens!=null){const Iu=Math.floor(Au.image_tokens/$u),Pu=Au.image_tokens-Iu*($u-1);Ru.imageTokens=lo===$u-1?Pu:Iu}if(Au.text_tokens!=null){const Iu=Math.floor(Au.text_tokens/$u),Pu=Au.text_tokens-Iu*($u-1);Ru.textTokens=lo===$u-1?Pu:Iu}return Ru}async function fileToBlob(Au){if(!Au)return;if(Au.type==="url")return downloadBlob(Au.url);const lo=Au.data instanceof Uint8Array?Au.data:convertBase64ToUint8Array(Au.data);return new Blob([lo],{type:Au.mediaType})}var applyPatchInputSchema=lazySchema(()=>zodSchema(object({callId:string$2(),operation:discriminatedUnion("type",[object({type:literal("create_file"),path:string$2(),diff:string$2()}),object({type:literal("delete_file"),path:string$2()}),object({type:literal("update_file"),path:string$2(),diff:string$2()})])}))),applyPatchOutputSchema=lazySchema(()=>zodSchema(object({status:_enum(["completed","failed"]),output:string$2().optional()}))),applyPatchToolFactory=createProviderDefinedToolFactoryWithOutputSchema({id:"openai.apply_patch",inputSchema:applyPatchInputSchema,outputSchema:applyPatchOutputSchema}),applyPatch=applyPatchToolFactory,codeInterpreterInputSchema=lazySchema(()=>zodSchema(object({code:string$2().nullish(),containerId:string$2()}))),codeInterpreterOutputSchema=lazySchema(()=>zodSchema(object({outputs:array(discriminatedUnion("type",[object({type:literal("logs"),logs:string$2()}),object({type:literal("image"),url:string$2()})])).nullish()}))),codeInterpreterArgsSchema=lazySchema(()=>zodSchema(object({container:union([string$2(),object({fileIds:array(string$2()).optional()})]).optional()}))),codeInterpreterToolFactory=createProviderExecutedToolFactory({id:"openai.code_interpreter",inputSchema:codeInterpreterInputSchema,outputSchema:codeInterpreterOutputSchema}),codeInterpreter=(Au={})=>codeInterpreterToolFactory(Au),safetyCheckSchema=object({id:string$2(),code:string$2().optional(),message:string$2().optional()}),computerActionSchema=discriminatedUnion("type",[object({type:literal("click"),button:_enum(["left","right","wheel","back","forward"]),x:number$2(),y:number$2(),keys:array(string$2()).optional()}),object({type:literal("double_click"),x:number$2(),y:number$2(),keys:array(string$2()).optional()}),object({type:literal("drag"),path:array(object({x:number$2(),y:number$2()})),keys:array(string$2()).optional()}),object({type:literal("keypress"),keys:array(string$2())}),object({type:literal("move"),x:number$2(),y:number$2(),keys:array(string$2()).optional()}),object({type:literal("screenshot")}),object({type:literal("scroll"),x:number$2(),y:number$2(),scrollX:number$2(),scrollY:number$2(),keys:array(string$2()).optional()}),object({type:literal("type"),text:string$2()}),object({type:literal("wait")})]),computerInputSchema=lazySchema(()=>zodSchema(object({actions:array(computerActionSchema),pendingSafetyChecks:array(safetyCheckSchema),status:_enum(["in_progress","completed","incomplete"])}))),computerOutputSchema=lazySchema(()=>zodSchema(object({output:union([object({type:literal("computer_screenshot"),imageUrl:string$2(),fileId:string$2().optional(),detail:_enum(["auto","low","high","original"]).optional()}),object({type:literal("computer_screenshot"),fileId:string$2(),imageUrl:string$2().optional(),detail:_enum(["auto","low","high","original"]).optional()})]),acknowledgedSafetyChecks:array(safetyCheckSchema).optional()}))),computerToolFactory=createProviderDefinedToolFactoryWithOutputSchema({id:"openai.computer",inputSchema:computerInputSchema,outputSchema:computerOutputSchema}),computer=(Au={})=>computerToolFactory(Au),customArgsSchema=lazySchema(()=>zodSchema(object({description:string$2().optional(),format:union([object({type:literal("grammar"),syntax:_enum(["regex","lark"]),definition:string$2()}),object({type:literal("text")})]).optional()}))),customInputSchema=lazySchema(()=>zodSchema(string$2())),customToolFactory=createProviderDefinedToolFactory({id:"openai.custom",inputSchema:customInputSchema}),customTool=Au=>customToolFactory(Au),comparisonFilterSchema=object({key:string$2(),type:_enum(["eq","ne","gt","gte","lt","lte","in","nin"]),value:union([string$2(),number$2(),boolean$1(),array(string$2())])}),compoundFilterSchema=object({type:_enum(["and","or"]),filters:array(union([comparisonFilterSchema,lazy(()=>compoundFilterSchema)]))}),fileSearchArgsSchema=lazySchema(()=>zodSchema(object({vectorStoreIds:array(string$2()),maxNumResults:number$2().optional(),ranking:object({ranker:string$2().optional(),scoreThreshold:number$2().optional()}).optional(),filters:union([comparisonFilterSchema,compoundFilterSchema]).optional()}))),fileSearchOutputSchema=lazySchema(()=>zodSchema(object({queries:array(string$2()),results:array(object({attributes:record$2(string$2(),unknown$1()),fileId:string$2(),filename:string$2(),score:number$2(),text:string$2()})).nullable()}))),fileSearch=createProviderExecutedToolFactory({id:"openai.file_search",inputSchema:object({}),outputSchema:fileSearchOutputSchema}),imageGenerationArgsSchema=lazySchema(()=>zodSchema(object({background:_enum(["auto","opaque","transparent"]).optional(),inputFidelity:_enum(["low","high"]).optional(),inputImageMask:object({fileId:string$2().optional(),imageUrl:string$2().optional()}).optional(),model:string$2().optional(),moderation:_enum(["auto"]).optional(),outputCompression:number$2().int().min(0).max(100).optional(),outputFormat:_enum(["png","jpeg","webp"]).optional(),partialImages:number$2().int().min(0).max(3).optional(),quality:_enum(["auto","low","medium","high"]).optional(),size:_enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict())),imageGenerationInputSchema=lazySchema(()=>zodSchema(object({}))),imageGenerationOutputSchema=lazySchema(()=>zodSchema(object({result:string$2()}))),imageGenerationToolFactory=createProviderExecutedToolFactory({id:"openai.image_generation",inputSchema:imageGenerationInputSchema,outputSchema:imageGenerationOutputSchema}),imageGeneration=(Au={})=>imageGenerationToolFactory(Au),localShellInputSchema=lazySchema(()=>zodSchema(object({action:object({type:literal("exec"),command:array(string$2()),timeoutMs:number$2().optional(),user:string$2().optional(),workingDirectory:string$2().optional(),env:record$2(string$2(),string$2()).optional()})}))),localShellOutputSchema=lazySchema(()=>zodSchema(object({output:string$2()}))),localShell=createProviderDefinedToolFactoryWithOutputSchema({id:"openai.local_shell",inputSchema:localShellInputSchema,outputSchema:localShellOutputSchema}),shellInputSchema=lazySchema(()=>zodSchema(object({action:object({commands:array(string$2()),timeoutMs:number$2().optional(),maxOutputLength:number$2().optional()})}))),shellOutputSchema=lazySchema(()=>zodSchema(object({output:array(object({stdout:string$2(),stderr:string$2(),outcome:discriminatedUnion("type",[object({type:literal("timeout")}),object({type:literal("exit"),exitCode:number$2()})])}))}))),shellSkillsSchema=array(discriminatedUnion("type",[object({type:literal("skillReference"),providerReference:record$2(string$2(),string$2()),version:string$2().optional()}),object({type:literal("inline"),name:string$2(),description:string$2(),source:object({type:literal("base64"),mediaType:literal("application/zip"),data:string$2()})})])).optional(),shellArgsSchema=lazySchema(()=>zodSchema(object({environment:union([object({type:literal("containerAuto"),fileIds:array(string$2()).optional(),memoryLimit:_enum(["1g","4g","16g","64g"]).optional(),networkPolicy:discriminatedUnion("type",[object({type:literal("disabled")}),object({type:literal("allowlist"),allowedDomains:array(string$2()),domainSecrets:array(object({domain:string$2(),name:string$2(),value:string$2()})).optional()})]).optional(),skills:shellSkillsSchema}),object({type:literal("containerReference"),containerId:string$2()}),object({type:literal("local").optional(),skills:array(object({name:string$2(),description:string$2(),path:string$2()})).optional()})]).optional()}))),shell=createProviderDefinedToolFactoryWithOutputSchema({id:"openai.shell",inputSchema:shellInputSchema,outputSchema:shellOutputSchema}),toolSearchArgsSchema=lazySchema(()=>zodSchema(object({execution:_enum(["server","client"]).optional(),description:string$2().optional(),parameters:record$2(string$2(),unknown$1()).optional()}))),toolSearchInputSchema=lazySchema(()=>zodSchema(object({arguments:unknown$1().optional(),call_id:string$2().nullish()}))),toolSearchOutputSchema=lazySchema(()=>zodSchema(object({tools:array(record$2(string$2(),unknown$1()))}))),toolSearchToolFactory=createProviderDefinedToolFactoryWithOutputSchema({id:"openai.tool_search",inputSchema:toolSearchInputSchema,outputSchema:toolSearchOutputSchema}),toolSearch=(Au={})=>toolSearchToolFactory(Au),webSearchArgsSchema=lazySchema(()=>zodSchema(object({externalWebAccess:boolean$1().optional(),filters:object({allowedDomains:array(string$2()).optional()}).optional(),searchContextSize:_enum(["low","medium","high"]).optional(),userLocation:object({type:literal("approximate"),country:string$2().optional(),city:string$2().optional(),region:string$2().optional(),timezone:string$2().optional()}).optional()}))),webSearchInputSchema=lazySchema(()=>zodSchema(object({}))),webSearchOutputSchema=lazySchema(()=>zodSchema(object({action:discriminatedUnion("type",[object({type:literal("search"),query:string$2().optional(),queries:array(string$2()).optional()}),object({type:literal("openPage"),url:string$2().nullish()}),object({type:literal("findInPage"),url:string$2().nullish(),pattern:string$2().nullish()})]).optional(),sources:array(discriminatedUnion("type",[object({type:literal("url"),url:string$2()}),object({type:literal("api"),name:string$2()})])).optional()}))),webSearchToolFactory=createProviderExecutedToolFactory({id:"openai.web_search",inputSchema:webSearchInputSchema,outputSchema:webSearchOutputSchema}),webSearch=(Au={})=>webSearchToolFactory(Au),webSearchPreviewArgsSchema=lazySchema(()=>zodSchema(object({searchContextSize:_enum(["low","medium","high"]).optional(),userLocation:object({type:literal("approximate"),country:string$2().optional(),city:string$2().optional(),region:string$2().optional(),timezone:string$2().optional()}).optional()}))),webSearchPreviewInputSchema=lazySchema(()=>zodSchema(object({}))),webSearchPreviewOutputSchema=lazySchema(()=>zodSchema(object({action:discriminatedUnion("type",[object({type:literal("search"),query:string$2().optional()}),object({type:literal("openPage"),url:string$2().nullish()}),object({type:literal("findInPage"),url:string$2().nullish(),pattern:string$2().nullish()})]).optional()}))),webSearchPreview=createProviderExecutedToolFactory({id:"openai.web_search_preview",inputSchema:webSearchPreviewInputSchema,outputSchema:webSearchPreviewOutputSchema}),jsonValueSchema=lazy(()=>union([string$2(),number$2(),boolean$1(),_null(),array(jsonValueSchema),record$2(string$2(),jsonValueSchema)])),mcpArgsSchema=lazySchema(()=>zodSchema(object({serverLabel:string$2(),allowedTools:union([array(string$2()),object({readOnly:boolean$1().optional(),toolNames:array(string$2()).optional()})]).optional(),authorization:string$2().optional(),connectorId:string$2().optional(),headers:record$2(string$2(),string$2()).optional(),requireApproval:union([_enum(["always","never"]),object({never:object({toolNames:array(string$2()).optional()}).optional()})]).optional(),serverDescription:string$2().optional(),serverUrl:string$2().optional()}).refine(Au=>Au.serverUrl!=null||Au.connectorId!=null,"One of serverUrl or connectorId must be provided."))),mcpInputSchema=lazySchema(()=>zodSchema(object({}))),mcpOutputSchema=lazySchema(()=>zodSchema(object({type:literal("call"),serverLabel:string$2(),name:string$2(),arguments:string$2(),output:string$2().nullish(),error:union([string$2(),jsonValueSchema]).optional()}))),mcpToolFactory=createProviderExecutedToolFactory({id:"openai.mcp",inputSchema:mcpInputSchema,outputSchema:mcpOutputSchema}),mcp=Au=>mcpToolFactory(Au),programmaticToolCallingInputSchema=lazySchema(()=>zodSchema(object({code:string$2(),fingerprint:string$2()}))),programmaticToolCallingOutputSchema=lazySchema(()=>zodSchema(object({result:string$2(),status:_enum(["completed","incomplete"])}))),programmaticToolCallingFactory=createProviderExecutedToolFactory({id:"openai.programmatic_tool_calling",inputSchema:programmaticToolCallingInputSchema,outputSchema:programmaticToolCallingOutputSchema,supportsDeferredResults:!0}),programmaticToolCalling=()=>programmaticToolCallingFactory({}),openaiTools={applyPatch,customTool,codeInterpreter,computer,fileSearch,imageGeneration,localShell,shell,webSearchPreview,webSearch,mcp,programmaticToolCalling,toolSearch};function parseOpenAIRealtimeServerEvent(Au){var lo,$u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu,Zu;const Ju=Au,Yu=Ju.type;switch(Yu){case"session.created":return{type:"session-created",sessionId:(lo=Ju.session)==null?void 0:lo.id,raw:Au};case"session.updated":return{type:"session-updated",raw:Au};case"input_audio_buffer.speech_started":return{type:"speech-started",itemId:Ju.item_id,raw:Au};case"input_audio_buffer.speech_stopped":return{type:"speech-stopped",itemId:Ju.item_id,raw:Au};case"input_audio_buffer.committed":return{type:"audio-committed",itemId:Ju.item_id,previousItemId:Ju.previous_item_id,raw:Au};case"conversation.item.added":return{type:"conversation-item-added",itemId:(Ru=($u=Ju.item)==null?void 0:$u.id)!=null?Ru:Ju.item_id,item:Ju.item,raw:Au};case"conversation.item.input_audio_transcription.completed":return{type:"input-transcription-completed",itemId:Ju.item_id,transcript:(Iu=Ju.transcript)!=null?Iu:"",raw:Au};case"response.created":return{type:"response-created",responseId:(Ou=(Pu=Ju.response)==null?void 0:Pu.id)!=null?Ou:Ju.response_id,raw:Au};case"response.done":return{type:"response-done",responseId:(Mu=(Du=Ju.response)==null?void 0:Du.id)!=null?Mu:Ju.response_id,status:(Bu=(Lu=Ju.response)==null?void 0:Lu.status)!=null?Bu:"completed",raw:Au};case"response.output_item.added":return{type:"output-item-added",responseId:Ju.response_id,itemId:(Fu=(ju=Ju.item)==null?void 0:ju.id)!=null?Fu:Ju.item_id,raw:Au};case"response.output_item.done":return{type:"output-item-done",responseId:Ju.response_id,itemId:(Uu=(zu=Ju.item)==null?void 0:zu.id)!=null?Uu:Ju.item_id,raw:Au};case"response.content_part.added":return{type:"content-part-added",responseId:Ju.response_id,itemId:Ju.item_id,raw:Au};case"response.content_part.done":return{type:"content-part-done",responseId:Ju.response_id,itemId:Ju.item_id,raw:Au};case"response.output_audio.delta":return{type:"audio-delta",responseId:Ju.response_id,itemId:Ju.item_id,delta:Ju.delta,raw:Au};case"response.output_audio.done":return{type:"audio-done",responseId:Ju.response_id,itemId:Ju.item_id,raw:Au};case"response.output_audio_transcript.delta":return{type:"audio-transcript-delta",responseId:Ju.response_id,itemId:Ju.item_id,delta:Ju.delta,raw:Au};case"response.output_audio_transcript.done":return{type:"audio-transcript-done",responseId:Ju.response_id,itemId:Ju.item_id,transcript:Ju.transcript,raw:Au};case"response.output_text.delta":return{type:"text-delta",responseId:Ju.response_id,itemId:Ju.item_id,delta:Ju.delta,raw:Au};case"response.output_text.done":return{type:"text-done",responseId:Ju.response_id,itemId:Ju.item_id,text:Ju.text,raw:Au};case"response.function_call_arguments.delta":return{type:"function-call-arguments-delta",responseId:Ju.response_id,itemId:Ju.item_id,callId:Ju.call_id,delta:Ju.delta,raw:Au};case"response.function_call_arguments.done":return{type:"function-call-arguments-done",responseId:Ju.response_id,itemId:Ju.item_id,callId:Ju.call_id,name:Ju.name,arguments:Ju.arguments,raw:Au};case"error":return{type:"error",message:(Gu=(Vu=(Hu=Ju.error)==null?void 0:Hu.message)!=null?Vu:Ju.message)!=null?Gu:"Unknown error",code:(Zu=(Wu=Ju.error)==null?void 0:Wu.code)!=null?Zu:Ju.code,raw:Au};default:return{type:"custom",rawType:Yu,raw:Au}}}function serializeOpenAIRealtimeClientEvent(Au,lo){switch(Au.type){case"session-update":return{type:"session.update",session:buildOpenAISessionConfig(Au.config,lo)};case"input-audio-append":return{type:"input_audio_buffer.append",audio:Au.audio};case"input-audio-commit":return{type:"input_audio_buffer.commit"};case"input-audio-clear":return{type:"input_audio_buffer.clear"};case"conversation-item-create":{const $u=Au.item;switch($u.type){case"text-message":return{type:"conversation.item.create",item:{type:"message",role:$u.role,content:[{type:"input_text",text:$u.text}]}};case"audio-message":return{type:"conversation.item.create",item:{type:"message",role:$u.role,content:[{type:"input_audio",audio:$u.audio}]}};case"function-call-output":return{type:"conversation.item.create",item:{type:"function_call_output",call_id:$u.callId,output:$u.output}}}break}case"conversation-item-truncate":return{type:"conversation.item.truncate",item_id:Au.itemId,content_index:Au.contentIndex,audio_end_ms:Au.audioEndMs};case"response-create":return{type:"response.create",...Au.options!=null?{response:{...Au.options.modalities!=null?{output_modalities:Au.options.modalities}:{},...Au.options.instructions!=null?{instructions:Au.options.instructions}:{},...Au.options.metadata!=null?{metadata:Au.options.metadata}:{}}}:{}};case"response-cancel":return{type:"response.cancel"}}}function buildOpenAISessionConfig(Au,lo){var $u;const Ru={type:"realtime",model:lo};Au.instructions!=null&&(Ru.instructions=Au.instructions),Au.outputModalities!=null&&(Ru.output_modalities=Au.outputModalities);const Iu={};if(Au.inputAudioFormat!=null||Au.inputAudioTranscription!=null||Au.turnDetection!=null){const Pu={};if(Au.inputAudioFormat!=null&&(Pu.format={type:Au.inputAudioFormat.type,...Au.inputAudioFormat.rate!=null?{rate:Au.inputAudioFormat.rate}:{}}),Au.turnDetection!=null)if(Au.turnDetection.type==="disabled")Pu.turn_detection=null;else{const Ou={type:Au.turnDetection.type==="server-vad"?"server_vad":"semantic_vad"};Au.turnDetection.threshold!=null&&(Ou.threshold=Au.turnDetection.threshold),Au.turnDetection.silenceDurationMs!=null&&(Ou.silence_duration_ms=Au.turnDetection.silenceDurationMs),Au.turnDetection.prefixPaddingMs!=null&&(Ou.prefix_padding_ms=Au.turnDetection.prefixPaddingMs),Pu.turn_detection=Ou}Au.inputAudioTranscription!=null&&(Pu.transcription={model:($u=Au.inputAudioTranscription.model)!=null?$u:"gpt-realtime-whisper",...Au.inputAudioTranscription.language!=null?{language:Au.inputAudioTranscription.language}:{},...Au.inputAudioTranscription.prompt!=null?{prompt:Au.inputAudioTranscription.prompt}:{}}),Iu.input=Pu}if(Au.outputAudioFormat!=null||Au.voice!=null){const Pu={};Au.outputAudioFormat!=null&&(Pu.format={type:Au.outputAudioFormat.type,...Au.outputAudioFormat.rate!=null?{rate:Au.outputAudioFormat.rate}:{}}),Au.voice!=null&&(Pu.voice=Au.voice),Iu.output=Pu}return Object.keys(Iu).length>0&&(Ru.audio=Iu),Au.tools!=null&&Au.tools.length>0&&(Ru.tools=Au.tools.map(Pu=>({type:Pu.type,name:Pu.name,description:Pu.description,parameters:Pu.parameters})),Ru.tool_choice="auto"),Au.providerOptions!=null&&Object.assign(Ru,Au.providerOptions),Ru}var OpenAIRealtimeModel=class{constructor(Au,lo){this.specificationVersion="v4",this.modelId=Au,this.provider=lo.provider,this.config=lo}async doCreateClientSecret(Au){var lo;const $u=(lo=this.config.fetch)!=null?lo:fetch,Ru=`${this.config.baseURL}/realtime/client_secrets`,Iu=Au.sessionConfig!=null?buildOpenAISessionConfig(Au.sessionConfig,this.modelId):{type:"realtime",model:this.modelId},Pu=await $u(Ru,{method:"POST",headers:{...this.config.headers(),"Content-Type":"application/json"},body:JSON.stringify({session:Iu,...Au.expiresAfterSeconds!=null?{expires_after:{anchor:"created_at",seconds:Au.expiresAfterSeconds}}:{}})});if(!Pu.ok){const Du=await Pu.text();throw new Error(`OpenAI realtime client secret request failed: ${Pu.status} ${Du}`)}const Ou=await Pu.json();return{token:Ou.value,url:`wss://${new URL(this.config.baseURL).host}/v1/realtime?model=${encodeURIComponent(this.modelId)}`,expiresAt:Ou.expires_at}}getWebSocketConfig(Au){return{url:Au.url,protocols:["realtime",`openai-insecure-api-key.${Au.token}`]}}parseServerEvent(Au){return parseOpenAIRealtimeServerEvent(Au)}serializeClientEvent(Au){return serializeOpenAIRealtimeClientEvent(Au,this.modelId)}buildSessionConfig(Au){return buildOpenAISessionConfig(Au,this.modelId)}};function convertOpenAIResponsesUsage(Au){var lo,$u,Ru,Iu,Pu,Ou;if(Au==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const Du=Au.input_tokens,Mu=Au.output_tokens,Lu=($u=(lo=Au.input_tokens_details)==null?void 0:lo.cached_tokens)!=null?$u:0,Bu=(Iu=(Ru=Au.input_tokens_details)==null?void 0:Ru.cache_write_tokens)!=null?Iu:void 0,ju=(Ou=(Pu=Au.output_tokens_details)==null?void 0:Pu.reasoning_tokens)!=null?Ou:0;return{inputTokens:{total:Du,noCache:Du-Lu-(Bu??0),cacheRead:Lu,cacheWrite:Bu},outputTokens:{total:Mu,text:Mu-ju,reasoning:ju},raw:Au}}function serializeToolCallArguments2(Au){return JSON.stringify(Au===void 0?{}:Au)}function mapToolCaller(Au){return Au==null?void 0:Au.type==="program"?{type:"program",caller_id:Au.callerId}:Au}function getPromptCacheBreakpoint2(Au,lo){var $u;return($u=Au?.[lo])==null?void 0:$u.promptCacheBreakpoint}function isFileId(Au,lo){return lo?lo.some($u=>Au.startsWith($u)):!1}async function convertToOpenAIResponsesInput({prompt:Au,toolNameMapping:lo,systemMessageMode:$u,providerOptionsName:Ru,fileIdPrefixes:Iu,passThroughUnsupportedFiles:Pu=!1,store:Ou,hasConversation:Du=!1,hasPreviousResponseId:Mu=!1,hasLocalShellTool:Lu=!1,hasShellTool:Bu=!1,hasApplyPatchTool:ju=!1,hasComputerTool:Fu=!1,customProviderToolNames:zu}){var Uu,Hu,Vu,Gu,Wu,Zu,Ju,Yu,Xu,ed,td,nd,od,sd,ad,pd,bd,wd,_d,yd,Sd,kd,md,dd,vd,ld,ud,hd,gd,Ed,Td,Rd,jd,Cd,$d,Id,Vd,Dd;let Wd=[];const oh=[],rh=new Set;for(const{role:Eh,content:ah,providerOptions:yh}of Au)switch(Eh){case"system":{switch($u){case"system":{const vh=getPromptCacheBreakpoint2(yh,Ru);Wd.push({role:"system",content:vh==null?ah:[{type:"input_text",text:ah,prompt_cache_breakpoint:vh}]});break}case"developer":{const vh=getPromptCacheBreakpoint2(yh,Ru);Wd.push({role:"developer",content:vh==null?ah:[{type:"input_text",text:ah,prompt_cache_breakpoint:vh}]});break}case"remove":{oh.push({type:"other",message:"system messages are removed for this model"});break}default:{const vh=$u;throw new Error(`Unsupported system message mode: ${vh}`)}}break}case"user":{Wd.push({role:"user",content:ah.map((vh,Jd)=>{var Qd,sh,Oh,qd,zd;switch(vh.type){case"text":{const Pd=getPromptCacheBreakpoint2(vh.providerOptions,Ru);return{type:"input_text",text:vh.text,...Pd!=null&&{prompt_cache_breakpoint:Pd}}}case"file":{const Pd=getPromptCacheBreakpoint2(vh.providerOptions,Ru);switch(vh.data.type){case"reference":{const Od=resolveProviderReference({reference:vh.data.reference,provider:Ru});return getTopLevelMediaType(vh.mediaType)==="image"?{type:"input_image",file_id:Od,detail:(sh=(Qd=vh.providerOptions)==null?void 0:Qd[Ru])==null?void 0:sh.imageDetail,...Pd!=null&&{prompt_cache_breakpoint:Pd}}:{type:"input_file",file_id:Od,...Pd!=null&&{prompt_cache_breakpoint:Pd}}}case"text":throw new UnsupportedFunctionalityError({functionality:"text file parts"});case"url":case"data":{if(getTopLevelMediaType(vh.mediaType)==="image")return{type:"input_image",...vh.data.type==="url"?{image_url:vh.data.url.toString()}:typeof vh.data.data=="string"&&isFileId(vh.data.data,Iu)?{file_id:vh.data.data}:{image_url:`data:${resolveFullMediaType({part:vh})};base64,${convertToBase64(vh.data.data)}`},detail:(qd=(Oh=vh.providerOptions)==null?void 0:Oh[Ru])==null?void 0:qd.imageDetail,...Pd!=null&&{prompt_cache_breakpoint:Pd}};{if(vh.data.type==="url")return{type:"input_file",file_url:vh.data.url.toString(),...Pd!=null&&{prompt_cache_breakpoint:Pd}};const Gd=resolveFullMediaType({part:vh});if(Gd!=="application/pdf"&&!Pu)throw new UnsupportedFunctionalityError({functionality:`file part media type ${Gd}`});return{type:"input_file",...typeof vh.data.data=="string"&&isFileId(vh.data.data,Iu)?{file_id:vh.data.data}:{filename:(zd=vh.filename)!=null?zd:Gd==="application/pdf"?`part-${Jd}.pdf`:`part-${Jd}`,file_data:`data:${Gd};base64,${convertToBase64(vh.data.data)}`},...Pd!=null&&{prompt_cache_breakpoint:Pd}}}}}}}})});break}case"assistant":{const vh={};for(const Jd of ah)switch(Jd.type){case"text":{const Qd=(Uu=Jd.providerOptions)==null?void 0:Uu[Ru],sh=Qd?.itemId,Oh=Qd?.phase;if(Du&&sh!=null)break;if(Ou&&sh!=null){Wd.push({type:"item_reference",id:sh});break}Wd.push({role:"assistant",content:[{type:"output_text",text:Jd.text}],id:sh,...Oh!=null&&{phase:Oh}});break}case"tool-call":{const Qd=(Zu=(Vu=(Hu=Jd.providerOptions)==null?void 0:Hu[Ru])==null?void 0:Vu.itemId)!=null?Zu:(Wu=(Gu=Jd.providerMetadata)==null?void 0:Gu[Ru])==null?void 0:Wu.itemId,sh=(td=(Yu=(Ju=Jd.providerOptions)==null?void 0:Ju[Ru])==null?void 0:Yu.namespace)!=null?td:(ed=(Xu=Jd.providerMetadata)==null?void 0:Xu[Ru])==null?void 0:ed.namespace,Oh=(od=(nd=Jd.providerOptions)==null?void 0:nd[Ru])==null?void 0:od.caller;if(Du&&Qd!=null)break;const qd=lo.toProviderToolName(Jd.toolName);if(qd==="tool_search"){if(Ou&&Qd!=null){Wd.push({type:"item_reference",id:Qd});break}const Pd=typeof Jd.input=="string"?await parseJSON({text:Jd.input,schema:toolSearchInputSchema}):await validateTypes({value:Jd.input,schema:toolSearchInputSchema}),Od=Pd.call_id!=null?"client":"server";Wd.push({type:"tool_search_call",id:Qd??Jd.toolCallId,execution:Od,call_id:(sd=Pd.call_id)!=null?sd:null,status:"completed",arguments:Pd.arguments});break}if(qd==="programmatic_tool_calling"){if(Ou&&Qd!=null){Wd.push({type:"item_reference",id:Qd});break}const Pd=await validateTypes({value:Jd.input,schema:programmaticToolCallingInputSchema});Wd.push({type:"program",id:Qd??Jd.toolCallId,call_id:Jd.toolCallId,code:Pd.code,fingerprint:Pd.fingerprint});break}if(Jd.providerExecuted){Ou&&Qd!=null&&Wd.push({type:"item_reference",id:Qd});break}if(Mu&&Ou&&Qd!=null)break;const zd=Lu&&qd==="local_shell"||Bu&&qd==="shell"||ju&&qd==="apply_patch"||Fu&&qd==="computer"||((ad=zu?.has(qd))!=null?ad:!1);if(Ou&&Qd!=null&&zd){Wd.push({type:"item_reference",id:Qd});break}if(Lu&&qd==="local_shell"){const Pd=await validateTypes({value:Jd.input,schema:localShellInputSchema});Wd.push({type:"local_shell_call",call_id:Jd.toolCallId,id:Qd,action:{type:"exec",command:Pd.action.command,timeout_ms:Pd.action.timeoutMs,user:Pd.action.user,working_directory:Pd.action.workingDirectory,env:Pd.action.env}});break}if(Bu&&qd==="shell"){const Pd=await validateTypes({value:Jd.input,schema:shellInputSchema});Wd.push({type:"shell_call",call_id:Jd.toolCallId,id:Qd,status:"completed",action:{commands:Pd.action.commands,timeout_ms:Pd.action.timeoutMs,max_output_length:Pd.action.maxOutputLength}});break}if(ju&&qd==="apply_patch"){const Pd=await validateTypes({value:Jd.input,schema:applyPatchInputSchema});Wd.push({type:"apply_patch_call",call_id:Pd.callId,id:Qd,status:"completed",operation:Pd.operation});break}if(Fu&&qd==="computer"){const Pd=await validateTypes({value:Jd.input,schema:computerInputSchema});Wd.push({type:"computer_call",call_id:Jd.toolCallId,id:Qd,status:Pd.status,actions:Pd.actions.map(Od=>{switch(Od.type){case"click":case"double_click":case"move":return{...Od,keys:Od.keys};case"drag":return{...Od,keys:Od.keys};case"scroll":return{type:"scroll",x:Od.x,y:Od.y,scroll_x:Od.scrollX,scroll_y:Od.scrollY,keys:Od.keys};default:return Od}}),pending_safety_checks:Pd.pendingSafetyChecks.map(Od=>({id:Od.id,code:Od.code,message:Od.message}))});break}if(zu?.has(qd)){Wd.push({type:"custom_tool_call",call_id:Jd.toolCallId,name:qd,input:typeof Jd.input=="string"?Jd.input:JSON.stringify(Jd.input),id:Qd});break}Wd.push({type:"function_call",call_id:Jd.toolCallId,name:qd,arguments:serializeToolCallArguments2(Jd.input),...sh!=null&&{namespace:sh},...Oh!=null&&{caller:mapToolCaller(Oh)}});break}case"tool-result":{if(Jd.output.type==="execution-denied"||Jd.output.type==="json"&&typeof Jd.output.value=="object"&&Jd.output.value!=null&&"type"in Jd.output.value&&Jd.output.value.type==="execution-denied"||Du)break;const Qd=lo.toProviderToolName(Jd.toolName);if(Qd==="tool_search"){const sh=(Sd=(yd=(bd=(pd=Jd.providerOptions)==null?void 0:pd[Ru])==null?void 0:bd.itemId)!=null?yd:(_d=(wd=Jd.providerMetadata)==null?void 0:wd[Ru])==null?void 0:_d.itemId)!=null?Sd:Jd.toolCallId;if(Ou)Wd.push({type:"item_reference",id:sh});else if(Jd.output.type==="json"){const Oh=await validateTypes({value:Jd.output.value,schema:toolSearchOutputSchema});Wd.push({type:"tool_search_output",id:sh,execution:"server",call_id:null,status:"completed",tools:Oh.tools})}break}if(Qd==="programmatic_tool_calling"){const sh=(ud=(ld=(md=(kd=Jd.providerOptions)==null?void 0:kd[Ru])==null?void 0:md.itemId)!=null?ld:(vd=(dd=Jd.providerMetadata)==null?void 0:dd[Ru])==null?void 0:vd.itemId)!=null?ud:Jd.toolCallId;if(Ou)Wd.push({type:"item_reference",id:sh});else if(Jd.output.type==="json"){const Oh=await validateTypes({value:Jd.output.value,schema:programmaticToolCallingOutputSchema});Wd.push({type:"program_output",id:sh,call_id:Jd.toolCallId,result:Oh.result,status:Oh.status})}break}if(Bu&&Qd==="shell"){if(Jd.output.type==="json"){const sh=await validateTypes({value:Jd.output.value,schema:shellOutputSchema});Wd.push({type:"shell_call_output",call_id:Jd.toolCallId,output:sh.output.map(Oh=>({stdout:Oh.stdout,stderr:Oh.stderr,outcome:Oh.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:Oh.outcome.exitCode}}))})}break}if(Ou){const sh=(Ed=(gd=(hd=Jd.providerOptions)==null?void 0:hd[Ru])==null?void 0:gd.itemId)!=null?Ed:Jd.toolCallId;Wd.push({type:"item_reference",id:sh})}else oh.push({type:"other",message:`Results for OpenAI tool ${Jd.toolName} are not sent to the API when store is false`});break}case"reasoning":{const Qd=await parseProviderOptions({provider:Ru,providerOptions:Jd.providerOptions,schema:openaiResponsesReasoningProviderOptionsSchema}),sh=Qd?.itemId;if((Du||Mu)&&sh!=null)break;if(sh!=null){const Oh=vh[sh];if(Ou)Oh===void 0&&(Wd.push({type:"item_reference",id:sh}),vh[sh]={type:"reasoning",id:sh,summary:[]});else{const qd=[];Jd.text.length>0?qd.push({type:"summary_text",text:Jd.text}):Oh!==void 0&&oh.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(Jd)}.`}),Oh===void 0?(vh[sh]={type:"reasoning",id:sh,encrypted_content:Qd?.reasoningEncryptedContent,summary:qd},Wd.push(vh[sh])):(Oh.summary.push(...qd),Qd?.reasoningEncryptedContent!=null&&(Oh.encrypted_content=Qd.reasoningEncryptedContent))}}else{const Oh=Qd?.reasoningEncryptedContent;if(Oh!=null){const qd=[];Jd.text.length>0&&qd.push({type:"summary_text",text:Jd.text}),Wd.push({type:"reasoning",encrypted_content:Oh,summary:qd})}else oh.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(Jd)}.`})}break}case"custom":{if(Jd.kind==="openai.compaction"){const Qd=(Td=Jd.providerOptions)==null?void 0:Td[Ru],sh=Qd?.itemId;if(Du&&sh!=null)break;if(Ou&&sh!=null){Wd.push({type:"item_reference",id:sh});break}const Oh=Qd?.encryptedContent;sh!=null&&Wd.push({type:"compaction",id:sh,encrypted_content:Oh})}break}}break}case"tool":{for(const vh of ah){if(vh.type==="tool-approval-response"){const qd=vh;if(rh.has(qd.approvalId))continue;rh.add(qd.approvalId),Ou&&Wd.push({type:"item_reference",id:qd.approvalId}),Wd.push({type:"mcp_approval_response",approval_request_id:qd.approvalId,approve:qd.approved});continue}const Jd=vh.output;if(Jd.type==="execution-denied"&&((jd=(Rd=Jd.providerOptions)==null?void 0:Rd.openai)==null?void 0:jd.approvalId))continue;const Qd=lo.toProviderToolName(vh.toolName);if(Qd==="tool_search"&&Jd.type==="json"){const qd=await validateTypes({value:Jd.value,schema:toolSearchOutputSchema});Wd.push({type:"tool_search_output",execution:"client",call_id:vh.toolCallId,status:"completed",tools:qd.tools});continue}if(Lu&&Qd==="local_shell"&&Jd.type==="json"){const qd=await validateTypes({value:Jd.value,schema:localShellOutputSchema});Wd.push({type:"local_shell_call_output",call_id:vh.toolCallId,output:qd.output});continue}if(Bu&&Qd==="shell"&&Jd.type==="json"){const qd=await validateTypes({value:Jd.value,schema:shellOutputSchema});Wd.push({type:"shell_call_output",call_id:vh.toolCallId,output:qd.output.map(zd=>({stdout:zd.stdout,stderr:zd.stderr,outcome:zd.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:zd.outcome.exitCode}}))});continue}if(ju&&vh.toolName==="apply_patch"&&Jd.type==="json"){const qd=await validateTypes({value:Jd.value,schema:applyPatchOutputSchema});Wd.push({type:"apply_patch_call_output",call_id:vh.toolCallId,status:qd.status,output:qd.output});continue}if(Fu&&Qd==="computer"&&Jd.type==="json"){const qd=await validateTypes({value:Jd.value,schema:computerOutputSchema});Wd.push({type:"computer_call_output",call_id:vh.toolCallId,output:{type:"computer_screenshot",image_url:qd.output.imageUrl,file_id:qd.output.fileId,detail:qd.output.detail},acknowledged_safety_checks:(Cd=qd.acknowledgedSafetyChecks)==null?void 0:Cd.map(zd=>({id:zd.id,code:zd.code,message:zd.message}))});continue}if(zu?.has(Qd)){let qd;switch(Jd.type){case"text":case"error-text":qd=Jd.value;break;case"execution-denied":qd=($d=Jd.reason)!=null?$d:"Tool call execution denied.";break;case"json":case"error-json":qd=JSON.stringify(Jd.value);break;case"content":qd=Jd.value.map(zd=>{var Pd,Od,Gd;const Md=getPromptCacheBreakpoint2(zd.providerOptions,Ru);switch(zd.type){case"text":return{type:"input_text",text:zd.text,...Md!=null&&{prompt_cache_breakpoint:Md}};case"file":{const Kd=getTopLevelMediaType(zd.mediaType),Xd=(Od=(Pd=zd.providerOptions)==null?void 0:Pd[Ru])==null?void 0:Od.imageDetail;if(zd.data.type==="data"){const ph=resolveFullMediaType({part:zd});return Kd==="image"?{type:"input_image",image_url:`data:${ph};base64,${convertToBase64(zd.data.data)}`,detail:Xd,...Md!=null&&{prompt_cache_breakpoint:Md}}:{type:"input_file",filename:(Gd=zd.filename)!=null?Gd:"data",file_data:`data:${ph};base64,${convertToBase64(zd.data.data)}`,...Md!=null&&{prompt_cache_breakpoint:Md}}}if(zd.data.type==="url")return Kd==="image"?{type:"input_image",image_url:zd.data.url.toString(),detail:Xd,...Md!=null&&{prompt_cache_breakpoint:Md}}:{type:"input_file",file_url:zd.data.url.toString(),...Md!=null&&{prompt_cache_breakpoint:Md}};oh.push({type:"other",message:`unsupported custom tool content part type: ${zd.type} with data type: ${zd.data.type}`});return}default:oh.push({type:"other",message:`unsupported custom tool content part type: ${zd.type}`});return}}).filter(isNonNullable);break;default:qd=""}Wd.push({type:"custom_tool_call_output",call_id:vh.toolCallId,output:qd});continue}let sh;switch(Jd.type){case"text":case"error-text":sh=Jd.value;break;case"execution-denied":sh=(Id=Jd.reason)!=null?Id:"Tool call execution denied.";break;case"json":case"error-json":sh=JSON.stringify(Jd.value);break;case"content":sh=Jd.value.map(qd=>{var zd,Pd,Od;const Gd=getPromptCacheBreakpoint2(qd.providerOptions,Ru);switch(qd.type){case"text":return{type:"input_text",text:qd.text,...Gd!=null&&{prompt_cache_breakpoint:Gd}};case"file":{const Md=getTopLevelMediaType(qd.mediaType),Kd=(Pd=(zd=qd.providerOptions)==null?void 0:zd[Ru])==null?void 0:Pd.imageDetail;if(qd.data.type==="data"){const Xd=resolveFullMediaType({part:qd});return Md==="image"?{type:"input_image",image_url:`data:${Xd};base64,${convertToBase64(qd.data.data)}`,detail:Kd,...Gd!=null&&{prompt_cache_breakpoint:Gd}}:{type:"input_file",filename:(Od=qd.filename)!=null?Od:"data",file_data:`data:${Xd};base64,${convertToBase64(qd.data.data)}`,...Gd!=null&&{prompt_cache_breakpoint:Gd}}}if(qd.data.type==="url")return Md==="image"?{type:"input_image",image_url:qd.data.url.toString(),detail:Kd,...Gd!=null&&{prompt_cache_breakpoint:Gd}}:{type:"input_file",file_url:qd.data.url.toString(),...Gd!=null&&{prompt_cache_breakpoint:Gd}};oh.push({type:"other",message:`unsupported tool content part type: ${qd.type} with data type: ${qd.data.type}`});return}default:{oh.push({type:"other",message:`unsupported tool content part type: ${qd.type}`});return}}}).filter(isNonNullable);break}const Oh=mapToolCaller((Dd=(Vd=vh.providerOptions)==null?void 0:Vd[Ru])==null?void 0:Dd.caller);Wd.push({type:"function_call_output",call_id:vh.toolCallId,output:sh,...Oh!=null&&{caller:Oh}})}break}default:{const vh=Eh;throw new Error(`Unsupported role: ${vh}`)}}return!Ou&&Wd.some(Eh=>"type"in Eh&&Eh.type==="reasoning"&&Eh.encrypted_content==null)&&(oh.push({type:"other",message:"Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."}),Wd=Wd.filter(Eh=>!("type"in Eh)||Eh.type!=="reasoning"||Eh.encrypted_content!=null)),{input:Wd,warnings:oh}}var openaiResponsesReasoningProviderOptionsSchema=object({itemId:string$2().nullish(),reasoningEncryptedContent:string$2().nullish()});function mapOpenAIResponseFinishReason({finishReason:Au,hasFunctionCall:lo}){switch(Au){case void 0:case null:return lo?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return lo?"tool-calls":"other"}}var jsonValueSchema2=lazy(()=>union([string$2(),number$2(),boolean$1(),_null(),array(jsonValueSchema2),record$2(string$2(),jsonValueSchema2.optional())])),openaiResponsesComputerSafetyCheckSchema=object({id:string$2(),code:string$2().nullish(),message:string$2().nullish()}),openaiResponsesComputerActionSchema=discriminatedUnion("type",[object({type:literal("click"),button:_enum(["left","right","wheel","back","forward"]),x:number$2(),y:number$2(),keys:array(string$2()).nullish()}),object({type:literal("double_click"),x:number$2(),y:number$2(),keys:array(string$2()).nullish()}),object({type:literal("drag"),path:array(object({x:number$2(),y:number$2()})),keys:array(string$2()).nullish()}),object({type:literal("keypress"),keys:array(string$2())}),object({type:literal("move"),x:number$2(),y:number$2(),keys:array(string$2()).nullish()}),object({type:literal("screenshot")}),object({type:literal("scroll"),x:number$2(),y:number$2(),scroll_x:number$2(),scroll_y:number$2(),keys:array(string$2()).nullish()}),object({type:literal("type"),text:string$2()}),object({type:literal("wait")})]),openaiResponsesComputerCallSchema=object({type:literal("computer_call"),id:string$2(),call_id:string$2().nullish(),status:_enum(["in_progress","completed","incomplete"]),action:openaiResponsesComputerActionSchema.nullish(),actions:array(openaiResponsesComputerActionSchema).nullish(),pending_safety_checks:array(openaiResponsesComputerSafetyCheckSchema).nullish()}),openaiResponsesToolCallerSchema=discriminatedUnion("type",[object({type:literal("direct")}),object({type:literal("program"),caller_id:string$2()})]),openaiResponsesProgramSchema=object({type:literal("program"),id:string$2(),call_id:string$2(),code:string$2(),fingerprint:string$2()}),openaiResponsesProgramOutputSchema=object({type:literal("program_output"),id:string$2(),call_id:string$2(),result:string$2(),status:_enum(["completed","incomplete"])}),openaiResponsesNestedErrorChunkSchema=object({type:literal("error"),sequence_number:number$2(),error:object({type:string$2(),code:string$2(),message:string$2(),param:string$2().nullish()})}),openaiResponsesErrorChunkSchema=object({type:literal("error"),sequence_number:number$2(),code:string$2().nullish(),message:string$2(),param:string$2().nullish()}),openaiResponsesChunkSchema=lazySchema(()=>zodSchema(union([object({type:literal("response.output_text.delta"),item_id:string$2(),delta:string$2(),logprobs:array(object({token:string$2(),logprob:number$2(),top_logprobs:array(object({token:string$2(),logprob:number$2()}))})).nullish()}),object({type:_enum(["response.completed","response.incomplete"]),response:object({incomplete_details:object({reason:string$2()}).nullish(),usage:object({input_tokens:number$2(),input_tokens_details:object({cached_tokens:number$2().nullish(),cache_write_tokens:number$2().nullish(),orchestration_input_tokens:number$2().nullish(),orchestration_input_cached_tokens:number$2().nullish()}).nullish(),output_tokens:number$2(),output_tokens_details:object({reasoning_tokens:number$2().nullish(),orchestration_output_tokens:number$2().nullish()}).nullish()}),reasoning:object({context:string$2().nullish()}).nullish(),service_tier:string$2().nullish()})}),object({type:literal("response.failed"),sequence_number:number$2(),response:object({error:object({code:string$2().nullish(),message:string$2()}).nullish(),incomplete_details:object({reason:string$2()}).nullish(),usage:object({input_tokens:number$2(),input_tokens_details:object({cached_tokens:number$2().nullish(),cache_write_tokens:number$2().nullish(),orchestration_input_tokens:number$2().nullish(),orchestration_input_cached_tokens:number$2().nullish()}).nullish(),output_tokens:number$2(),output_tokens_details:object({reasoning_tokens:number$2().nullish(),orchestration_output_tokens:number$2().nullish()}).nullish()}).nullish(),reasoning:object({context:string$2().nullish()}).nullish(),service_tier:string$2().nullish()})}),object({type:literal("response.created"),response:object({id:string$2(),created_at:number$2(),model:string$2(),service_tier:string$2().nullish()})}),object({type:literal("response.output_item.added"),output_index:number$2(),item:discriminatedUnion("type",[object({type:literal("message"),id:string$2(),phase:_enum(["commentary","final_answer"]).nullish()}),object({type:literal("reasoning"),id:string$2(),encrypted_content:string$2().nullish()}),object({type:literal("function_call"),id:string$2(),call_id:string$2(),name:string$2(),arguments:string$2(),namespace:string$2().nullish(),caller:openaiResponsesToolCallerSchema.nullish()}),openaiResponsesProgramSchema,openaiResponsesProgramOutputSchema,object({type:literal("web_search_call"),id:string$2(),status:string$2()}),openaiResponsesComputerCallSchema,object({type:literal("file_search_call"),id:string$2()}),object({type:literal("image_generation_call"),id:string$2()}),object({type:literal("code_interpreter_call"),id:string$2(),container_id:string$2(),code:string$2().nullable(),outputs:array(discriminatedUnion("type",[object({type:literal("logs"),logs:string$2()}),object({type:literal("image"),url:string$2()})])).nullable(),status:string$2()}),object({type:literal("mcp_call"),id:string$2(),status:string$2(),approval_request_id:string$2().nullish()}),object({type:literal("mcp_list_tools"),id:string$2()}),object({type:literal("mcp_approval_request"),id:string$2()}),object({type:literal("apply_patch_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed"]),operation:discriminatedUnion("type",[object({type:literal("create_file"),path:string$2(),diff:string$2()}),object({type:literal("delete_file"),path:string$2()}),object({type:literal("update_file"),path:string$2(),diff:string$2()})])}),object({type:literal("custom_tool_call"),id:string$2(),call_id:string$2(),name:string$2(),input:string$2()}),object({type:literal("shell_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),action:object({commands:array(string$2())})}),object({type:literal("compaction"),id:string$2(),encrypted_content:string$2().nullish()}),object({type:literal("shell_call_output"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),output:array(object({stdout:string$2(),stderr:string$2(),outcome:discriminatedUnion("type",[object({type:literal("timeout")}),object({type:literal("exit"),exit_code:number$2()})])}))}),object({type:literal("tool_search_call"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),arguments:unknown$1()}),object({type:literal("tool_search_output"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),tools:array(record$2(string$2(),jsonValueSchema2.optional()))})])}),object({type:literal("response.output_item.done"),output_index:number$2(),item:discriminatedUnion("type",[object({type:literal("message"),id:string$2(),phase:_enum(["commentary","final_answer"]).nullish()}),object({type:literal("reasoning"),id:string$2(),encrypted_content:string$2().nullish()}),object({type:literal("function_call"),id:string$2(),call_id:string$2(),name:string$2(),arguments:string$2(),status:_enum(["in_progress","completed","incomplete"]),namespace:string$2().nullish(),caller:openaiResponsesToolCallerSchema.nullish()}),openaiResponsesProgramSchema,openaiResponsesProgramOutputSchema,object({type:literal("custom_tool_call"),id:string$2(),call_id:string$2(),name:string$2(),input:string$2(),status:literal("completed")}),object({type:literal("code_interpreter_call"),id:string$2(),code:string$2().nullable(),container_id:string$2(),outputs:array(discriminatedUnion("type",[object({type:literal("logs"),logs:string$2()}),object({type:literal("image"),url:string$2()})])).nullable()}),object({type:literal("image_generation_call"),id:string$2(),result:string$2()}),object({type:literal("web_search_call"),id:string$2(),status:string$2(),action:discriminatedUnion("type",[object({type:literal("search"),query:string$2().nullish(),queries:array(string$2()).nullish(),sources:array(discriminatedUnion("type",[object({type:literal("url"),url:string$2()}),object({type:literal("api"),name:string$2()})])).nullish()}),object({type:literal("open_page"),url:string$2().nullish()}),object({type:literal("find_in_page"),url:string$2().nullish(),pattern:string$2().nullish()})]).nullish()}),object({type:literal("file_search_call"),id:string$2(),queries:array(string$2()),results:array(object({attributes:record$2(string$2(),union([string$2(),number$2(),boolean$1()])),file_id:string$2(),filename:string$2(),score:number$2(),text:string$2()})).nullish()}),object({type:literal("local_shell_call"),id:string$2(),call_id:string$2(),action:object({type:literal("exec"),command:array(string$2()),timeout_ms:number$2().optional(),user:string$2().optional(),working_directory:string$2().optional(),env:record$2(string$2(),string$2()).optional()})}),openaiResponsesComputerCallSchema,object({type:literal("mcp_call"),id:string$2(),status:string$2(),arguments:string$2(),name:string$2(),server_label:string$2(),output:string$2().nullish(),error:union([string$2(),object({type:string$2().optional(),code:union([number$2(),string$2()]).optional(),message:string$2().optional()}).loose()]).nullish(),approval_request_id:string$2().nullish()}),object({type:literal("mcp_list_tools"),id:string$2(),server_label:string$2(),tools:array(object({name:string$2(),description:string$2().optional(),input_schema:any(),annotations:record$2(string$2(),unknown$1()).optional()})),error:union([string$2(),object({type:string$2().optional(),code:union([number$2(),string$2()]).optional(),message:string$2().optional()}).loose()]).optional()}),object({type:literal("mcp_approval_request"),id:string$2(),server_label:string$2(),name:string$2(),arguments:string$2(),approval_request_id:string$2().optional()}),object({type:literal("apply_patch_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed"]),operation:discriminatedUnion("type",[object({type:literal("create_file"),path:string$2(),diff:string$2()}),object({type:literal("delete_file"),path:string$2()}),object({type:literal("update_file"),path:string$2(),diff:string$2()})])}),object({type:literal("shell_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),action:object({commands:array(string$2())})}),object({type:literal("compaction"),id:string$2(),encrypted_content:string$2()}),object({type:literal("shell_call_output"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),output:array(object({stdout:string$2(),stderr:string$2(),outcome:discriminatedUnion("type",[object({type:literal("timeout")}),object({type:literal("exit"),exit_code:number$2()})])}))}),object({type:literal("tool_search_call"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),arguments:unknown$1()}),object({type:literal("tool_search_output"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),tools:array(record$2(string$2(),jsonValueSchema2.optional()))})])}),object({type:literal("response.function_call_arguments.delta"),item_id:string$2(),output_index:number$2(),delta:string$2()}),object({type:literal("response.custom_tool_call_input.delta"),item_id:string$2(),output_index:number$2(),delta:string$2()}),object({type:literal("response.image_generation_call.partial_image"),item_id:string$2(),output_index:number$2(),partial_image_b64:string$2()}),object({type:literal("response.code_interpreter_call_code.delta"),item_id:string$2(),output_index:number$2(),delta:string$2()}),object({type:literal("response.code_interpreter_call_code.done"),item_id:string$2(),output_index:number$2(),code:string$2()}),object({type:literal("response.output_text.annotation.added"),annotation:discriminatedUnion("type",[object({type:literal("url_citation"),start_index:number$2(),end_index:number$2(),url:string$2(),title:string$2()}),object({type:literal("file_citation"),file_id:string$2(),filename:string$2(),index:number$2()}),object({type:literal("container_file_citation"),container_id:string$2(),file_id:string$2(),filename:string$2(),start_index:number$2(),end_index:number$2()}),object({type:literal("file_path"),file_id:string$2(),index:number$2()})])}),object({type:literal("response.reasoning_summary_part.added"),item_id:string$2(),summary_index:number$2()}),object({type:literal("response.reasoning_summary_text.delta"),item_id:string$2(),summary_index:number$2(),delta:string$2()}),object({type:literal("response.reasoning_summary_part.done"),item_id:string$2(),summary_index:number$2()}),object({type:literal("response.apply_patch_call_operation_diff.delta"),item_id:string$2(),output_index:number$2(),delta:string$2(),obfuscation:string$2().nullish()}),object({type:literal("response.apply_patch_call_operation_diff.done"),item_id:string$2(),output_index:number$2(),diff:string$2()}),openaiResponsesNestedErrorChunkSchema,openaiResponsesErrorChunkSchema,object({type:string$2()}).loose().transform(Au=>({type:"unknown_chunk",message:Au.type}))]))),openaiResponsesResponseSchema=lazySchema(()=>zodSchema(object({id:string$2().optional(),created_at:number$2().optional(),error:object({message:string$2(),type:string$2(),param:string$2().nullish(),code:string$2()}).nullish(),model:string$2().optional(),output:array(discriminatedUnion("type",[object({type:literal("message"),role:literal("assistant"),id:string$2(),phase:_enum(["commentary","final_answer"]).nullish(),content:array(object({type:literal("output_text"),text:string$2(),logprobs:array(object({token:string$2(),logprob:number$2(),top_logprobs:array(object({token:string$2(),logprob:number$2()}))})).nullish(),annotations:array(discriminatedUnion("type",[object({type:literal("url_citation"),start_index:number$2(),end_index:number$2(),url:string$2(),title:string$2()}),object({type:literal("file_citation"),file_id:string$2(),filename:string$2(),index:number$2()}),object({type:literal("container_file_citation"),container_id:string$2(),file_id:string$2(),filename:string$2(),start_index:number$2(),end_index:number$2()}),object({type:literal("file_path"),file_id:string$2(),index:number$2()})]))}))}),object({type:literal("web_search_call"),id:string$2(),status:string$2(),action:discriminatedUnion("type",[object({type:literal("search"),query:string$2().nullish(),queries:array(string$2()).nullish(),sources:array(discriminatedUnion("type",[object({type:literal("url"),url:string$2()}),object({type:literal("api"),name:string$2()})])).nullish()}),object({type:literal("open_page"),url:string$2().nullish()}),object({type:literal("find_in_page"),url:string$2().nullish(),pattern:string$2().nullish()})]).nullish()}),object({type:literal("file_search_call"),id:string$2(),queries:array(string$2()),results:array(object({attributes:record$2(string$2(),union([string$2(),number$2(),boolean$1()])),file_id:string$2(),filename:string$2(),score:number$2(),text:string$2()})).nullish()}),object({type:literal("code_interpreter_call"),id:string$2(),code:string$2().nullable(),container_id:string$2(),outputs:array(discriminatedUnion("type",[object({type:literal("logs"),logs:string$2()}),object({type:literal("image"),url:string$2()})])).nullable()}),object({type:literal("image_generation_call"),id:string$2(),result:string$2()}),object({type:literal("local_shell_call"),id:string$2(),call_id:string$2(),action:object({type:literal("exec"),command:array(string$2()),timeout_ms:number$2().optional(),user:string$2().optional(),working_directory:string$2().optional(),env:record$2(string$2(),string$2()).optional()})}),object({type:literal("function_call"),call_id:string$2(),name:string$2(),arguments:string$2(),id:string$2(),namespace:string$2().nullish(),caller:openaiResponsesToolCallerSchema.nullish()}),openaiResponsesProgramSchema,openaiResponsesProgramOutputSchema,object({type:literal("custom_tool_call"),call_id:string$2(),name:string$2(),input:string$2(),id:string$2()}),openaiResponsesComputerCallSchema,object({type:literal("reasoning"),id:string$2(),encrypted_content:string$2().nullish(),summary:array(object({type:literal("summary_text"),text:string$2()}))}),object({type:literal("mcp_call"),id:string$2(),status:string$2(),arguments:string$2(),name:string$2(),server_label:string$2(),output:string$2().nullish(),error:union([string$2(),object({type:string$2().optional(),code:union([number$2(),string$2()]).optional(),message:string$2().optional()}).loose()]).nullish(),approval_request_id:string$2().nullish()}),object({type:literal("mcp_list_tools"),id:string$2(),server_label:string$2(),tools:array(object({name:string$2(),description:string$2().optional(),input_schema:any(),annotations:record$2(string$2(),unknown$1()).optional()})),error:union([string$2(),object({type:string$2().optional(),code:union([number$2(),string$2()]).optional(),message:string$2().optional()}).loose()]).optional()}),object({type:literal("mcp_approval_request"),id:string$2(),server_label:string$2(),name:string$2(),arguments:string$2(),approval_request_id:string$2().optional()}),object({type:literal("apply_patch_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed"]),operation:discriminatedUnion("type",[object({type:literal("create_file"),path:string$2(),diff:string$2()}),object({type:literal("delete_file"),path:string$2()}),object({type:literal("update_file"),path:string$2(),diff:string$2()})])}),object({type:literal("shell_call"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),action:object({commands:array(string$2())})}),object({type:literal("compaction"),id:string$2(),encrypted_content:string$2()}),object({type:literal("shell_call_output"),id:string$2(),call_id:string$2(),status:_enum(["in_progress","completed","incomplete"]),output:array(object({stdout:string$2(),stderr:string$2(),outcome:discriminatedUnion("type",[object({type:literal("timeout")}),object({type:literal("exit"),exit_code:number$2()})])}))}),object({type:literal("tool_search_call"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),arguments:unknown$1()}),object({type:literal("tool_search_output"),id:string$2(),execution:_enum(["server","client"]),call_id:string$2().nullable(),status:_enum(["in_progress","completed","incomplete"]),tools:array(record$2(string$2(),jsonValueSchema2.optional()))})])).optional(),service_tier:string$2().nullish(),reasoning:object({context:string$2().nullish()}).nullish(),incomplete_details:object({reason:string$2()}).nullish(),usage:object({input_tokens:number$2(),input_tokens_details:object({cached_tokens:number$2().nullish(),cache_write_tokens:number$2().nullish(),orchestration_input_tokens:number$2().nullish(),orchestration_input_cached_tokens:number$2().nullish()}).nullish(),output_tokens:number$2(),output_tokens_details:object({reasoning_tokens:number$2().nullish(),orchestration_output_tokens:number$2().nullish()}).nullish()}).optional()}))),TOP_LOGPROBS_MAX=20,openaiLanguageModelResponsesOptionsSchema=lazySchema(()=>zodSchema(object({conversation:string$2().nullish(),include:array(_enum(["reasoning.encrypted_content","file_search_call.results","web_search_call.results","message.output_text.logprobs"])).nullish(),instructions:string$2().nullish(),logprobs:union([boolean$1(),number$2().min(1).max(TOP_LOGPROBS_MAX)]).optional(),maxToolCalls:number$2().nullish(),metadata:any().nullish(),parallelToolCalls:boolean$1().nullish(),previousResponseId:string$2().nullish(),promptCacheKey:string$2().nullish(),promptCacheOptions:object({mode:_enum(["implicit","explicit"]).optional(),ttl:literal("30m").optional()}).optional(),promptCacheRetention:_enum(["in_memory","24h"]).nullish(),reasoningEffort:string$2().nullish(),reasoningMode:_enum(["standard","pro"]).optional(),reasoningContext:_enum(["auto","current_turn","all_turns"]).optional(),reasoningSummary:string$2().nullish(),safetyIdentifier:string$2().nullish(),serviceTier:_enum(["auto","flex","priority","default"]).nullish(),store:boolean$1().nullish(),passThroughUnsupportedFiles:boolean$1().optional(),strictJsonSchema:boolean$1().nullish(),textVerbosity:_enum(["low","medium","high"]).nullish(),truncation:_enum(["auto","disabled"]).nullish(),user:string$2().nullish(),systemMessageMode:_enum(["system","developer","remove"]).optional(),forceReasoning:boolean$1().optional(),contextManagement:array(object({type:literal("compaction"),compactThreshold:number$2()})).nullish(),allowedTools:object({toolNames:array(string$2()).min(1),mode:_enum(["auto","required"]).optional()}).optional()})));async function prepareResponsesTools({tools:Au,toolChoice:lo,allowedTools:$u,toolNameMapping:Ru,customProviderToolNames:Iu}){var Pu,Ou,Du;Au=Au?.length?Au:void 0;const Mu=[];if(Au==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Mu};const Lu=[],Bu=new Map,ju=Iu??new Set;for(const zu of Au)switch(zu.type){case"function":{const Uu=(Pu=zu.providerOptions)==null?void 0:Pu.openai,Hu=prepareFunctionTool({tool:zu,options:Uu}),Vu=Uu?.namespace;if(Vu==null)Lu.push(Hu);else{let Gu=Bu.get(Vu.name);if(Gu==null)Gu={type:"namespace",name:Vu.name,description:Vu.description,tools:[]},Bu.set(Vu.name,Gu),Lu.push(Gu);else if(Gu.description!==Vu.description)throw new UnsupportedFunctionalityError({functionality:`conflicting descriptions for OpenAI tool namespace "${Vu.name}"`});Gu.tools.push(Hu)}break}case"provider":{switch(zu.id){case"openai.file_search":{const Uu=await validateTypes({value:zu.args,schema:fileSearchArgsSchema});Lu.push({type:"file_search",vector_store_ids:Uu.vectorStoreIds,max_num_results:Uu.maxNumResults,ranking_options:Uu.ranking?{ranker:Uu.ranking.ranker,score_threshold:Uu.ranking.scoreThreshold}:void 0,filters:Uu.filters});break}case"openai.local_shell":{Lu.push({type:"local_shell"});break}case"openai.shell":{const Uu=await validateTypes({value:zu.args,schema:shellArgsSchema});Lu.push({type:"shell",...Uu.environment&&{environment:mapShellEnvironment(Uu.environment)}});break}case"openai.apply_patch":{Lu.push({type:"apply_patch"});break}case"openai.computer":{Lu.push({type:"computer"});break}case"openai.web_search_preview":{const Uu=await validateTypes({value:zu.args,schema:webSearchPreviewArgsSchema});Lu.push({type:"web_search_preview",search_context_size:Uu.searchContextSize,user_location:Uu.userLocation});break}case"openai.web_search":{const Uu=await validateTypes({value:zu.args,schema:webSearchArgsSchema});Lu.push({type:"web_search",filters:Uu.filters!=null?{allowed_domains:Uu.filters.allowedDomains}:void 0,external_web_access:Uu.externalWebAccess,search_context_size:Uu.searchContextSize,user_location:Uu.userLocation});break}case"openai.code_interpreter":{const Uu=await validateTypes({value:zu.args,schema:codeInterpreterArgsSchema});Lu.push({type:"code_interpreter",container:Uu.container==null?{type:"auto",file_ids:void 0}:typeof Uu.container=="string"?Uu.container:{type:"auto",file_ids:Uu.container.fileIds}});break}case"openai.image_generation":{const Uu=await validateTypes({value:zu.args,schema:imageGenerationArgsSchema});Lu.push({type:"image_generation",background:Uu.background,input_fidelity:Uu.inputFidelity,input_image_mask:Uu.inputImageMask?{file_id:Uu.inputImageMask.fileId,image_url:Uu.inputImageMask.imageUrl}:void 0,model:Uu.model,moderation:Uu.moderation,partial_images:Uu.partialImages,quality:Uu.quality,output_compression:Uu.outputCompression,output_format:Uu.outputFormat,size:Uu.size});break}case"openai.mcp":{const Uu=await validateTypes({value:zu.args,schema:mcpArgsSchema}),Hu=Wu=>({tool_names:Wu.toolNames}),Vu=Uu.requireApproval,Gu=Vu==null?void 0:typeof Vu=="string"?Vu:Vu.never!=null?{never:Hu(Vu.never)}:void 0;Lu.push({type:"mcp",server_label:Uu.serverLabel,allowed_tools:Array.isArray(Uu.allowedTools)?Uu.allowedTools:Uu.allowedTools?{read_only:Uu.allowedTools.readOnly,tool_names:Uu.allowedTools.toolNames}:void 0,authorization:Uu.authorization,connector_id:Uu.connectorId,headers:Uu.headers,require_approval:Gu??"never",server_description:Uu.serverDescription,server_url:Uu.serverUrl});break}case"openai.custom":{const Uu=await validateTypes({value:zu.args,schema:customArgsSchema});Lu.push({type:"custom",name:zu.name,description:Uu.description,format:Uu.format}),ju.add(zu.name);break}case"openai.programmatic_tool_calling":{Lu.push({type:"programmatic_tool_calling"});break}case"openai.tool_search":{const Uu=await validateTypes({value:zu.args,schema:toolSearchArgsSchema});Lu.push({type:"tool_search",...Uu.execution!=null?{execution:Uu.execution}:{},...Uu.description!=null?{description:Uu.description}:{},...Uu.parameters!=null?{parameters:Uu.parameters}:{}});break}}break}default:Mu.push({type:"unsupported",feature:`function tool ${zu}`});break}if($u!=null)return{tools:Lu,toolChoice:{type:"allowed_tools",mode:(Ou=$u.mode)!=null?Ou:"auto",tools:$u.toolNames.map(zu=>{var Uu;return{type:"function",name:(Uu=Ru?.toProviderToolName(zu))!=null?Uu:zu}})},toolWarnings:Mu};if(lo==null)return{tools:Lu,toolChoice:void 0,toolWarnings:Mu};const Fu=lo.type;switch(Fu){case"auto":case"none":case"required":return{tools:Lu,toolChoice:Fu,toolWarnings:Mu};case"tool":{const zu=(Du=Ru?.toProviderToolName(lo.toolName))!=null?Du:lo.toolName;return{tools:Lu,toolChoice:zu==="code_interpreter"||zu==="file_search"||zu==="image_generation"||zu==="web_search_preview"||zu==="web_search"||zu==="mcp"||zu==="apply_patch"||zu==="computer"||zu==="programmatic_tool_calling"?{type:zu}:ju.has(zu)?{type:"custom",name:zu}:{type:"function",name:zu},toolWarnings:Mu}}default:{const zu=Fu;throw new UnsupportedFunctionalityError({functionality:`tool choice type: ${zu}`})}}}function prepareFunctionTool({tool:Au,options:lo}){const $u=lo?.deferLoading;return{type:"function",name:Au.name,description:Au.description,parameters:Au.inputSchema,...Au.strict!=null?{strict:Au.strict}:{},...$u!=null?{defer_loading:$u}:{},...lo?.allowedCallers!=null?{allowed_callers:lo.allowedCallers}:{},...lo?.outputSchema!=null?{output_schema:lo.outputSchema}:{}}}function mapShellEnvironment(Au){if(Au.type==="containerReference")return{type:"container_reference",container_id:Au.containerId};if(Au.type==="containerAuto"){const $u=Au;return{type:"container_auto",file_ids:$u.fileIds,memory_limit:$u.memoryLimit,network_policy:$u.networkPolicy==null?void 0:$u.networkPolicy.type==="disabled"?{type:"disabled"}:{type:"allowlist",allowed_domains:$u.networkPolicy.allowedDomains,domain_secrets:$u.networkPolicy.domainSecrets},skills:mapShellSkills($u.skills)}}return{type:"local",skills:Au.skills}}function mapShellSkills(Au){return Au?.map(lo=>{var $u,Ru;return lo.type==="skillReference"?{type:"skill_reference",skill_id:resolveProviderReference({reference:($u=lo.providerReference)!=null?$u:{},provider:"openai"}),version:(Ru=lo.version)!=null?Ru:"latest"}:{type:"inline",name:lo.name,description:lo.description,source:{type:"base64",media_type:lo.source.mediaType,data:lo.source.data}}})}function extractApprovalRequestIdToToolCallIdMapping(Au){var lo,$u;const Ru={};for(const Iu of Au)if(Iu.role==="assistant")for(const Pu of Iu.content){if(Pu.type!=="tool-call")continue;const Ou=($u=(lo=Pu.providerOptions)==null?void 0:lo.openai)==null?void 0:$u.approvalRequestId;Ou!=null&&(Ru[Ou]=Pu.toolCallId)}return Ru}function mapComputerAction(Au){switch(Au.type){case"click":return{type:"click",button:Au.button,x:Au.x,y:Au.y,...Au.keys!=null&&{keys:Au.keys}};case"double_click":return{type:"double_click",x:Au.x,y:Au.y,...Au.keys!=null&&{keys:Au.keys}};case"drag":return{type:"drag",path:Au.path,...Au.keys!=null&&{keys:Au.keys}};case"keypress":return Au;case"move":return{type:"move",x:Au.x,y:Au.y,...Au.keys!=null&&{keys:Au.keys}};case"screenshot":return Au;case"scroll":return{type:"scroll",x:Au.x,y:Au.y,scrollX:Au.scroll_x,scrollY:Au.scroll_y,...Au.keys!=null&&{keys:Au.keys}};case"type":return Au;case"wait":return Au}}function mapComputerCallInput({action:Au,actions:lo,pending_safety_checks:$u,status:Ru}){var Iu;return{actions:(lo??(Au!=null?[Au]:[])).map(mapComputerAction),pendingSafetyChecks:(Iu=$u?.map(Pu=>({id:Pu.id,...Pu.code!=null&&{code:Pu.code},...Pu.message!=null&&{message:Pu.message}})))!=null?Iu:[],status:Ru}}var OpenAIResponsesLanguageModel=class Hw{constructor(lo,$u){this.specificationVersion="v4",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=lo,this.config=$u}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new Hw(lo.modelId,lo.config)}get provider(){return this.config.provider}async getArgs({maxOutputTokens:lo,temperature:$u,stopSequences:Ru,topP:Iu,topK:Pu,presencePenalty:Ou,frequencyPenalty:Du,seed:Mu,prompt:Lu,reasoning:Bu,providerOptions:ju,tools:Fu,toolChoice:zu,responseFormat:Uu}){var Hu,Vu,Gu,Wu,Zu,Ju,Yu,Xu,ed,td,nd,od;const sd=[],ad=getOpenAILanguageModelCapabilities(this.modelId);Pu!=null&&sd.push({type:"unsupported",feature:"topK"}),Mu!=null&&sd.push({type:"unsupported",feature:"seed"}),Ou!=null&&sd.push({type:"unsupported",feature:"presencePenalty"}),Du!=null&&sd.push({type:"unsupported",feature:"frequencyPenalty"}),Ru!=null&&sd.push({type:"unsupported",feature:"stopSequences"});const pd=this.config.provider.includes("azure")?"azure":"openai";let bd=await parseProviderOptions({provider:pd,providerOptions:ju,schema:openaiLanguageModelResponsesOptionsSchema});bd==null&&pd!=="openai"&&(bd=await parseProviderOptions({provider:"openai",providerOptions:ju,schema:openaiLanguageModelResponsesOptionsSchema}));const wd=(Hu=bd?.reasoningEffort)!=null?Hu:isCustomReasoning(Bu)?Bu:void 0,_d=bd?.reasoningSummary!==void 0?bd.reasoningSummary:wd!=null&&wd!=="none"?"detailed":void 0,yd=(Vu=bd?.forceReasoning)!=null?Vu:ad.isReasoningModel;bd?.conversation&&bd?.previousResponseId&&sd.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});const Sd=createToolNameMapping({tools:Fu,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.computer":"computer","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch","openai.tool_search":"tool_search","openai.programmatic_tool_calling":"programmatic_tool_calling"}}),kd=new Set,{tools:md,toolChoice:dd,toolWarnings:vd}=await prepareResponsesTools({tools:Fu,toolChoice:zu,allowedTools:(Gu=bd?.allowedTools)!=null?Gu:void 0,toolNameMapping:Sd,customProviderToolNames:kd}),{input:ld,warnings:ud}=await convertToOpenAIResponsesInput({prompt:Lu,toolNameMapping:Sd,systemMessageMode:(Wu=bd?.systemMessageMode)!=null?Wu:yd?"developer":ad.systemMessageMode,providerOptionsName:pd,fileIdPrefixes:this.config.fileIdPrefixes,passThroughUnsupportedFiles:(Zu=bd?.passThroughUnsupportedFiles)!=null?Zu:!1,store:(Ju=bd?.store)!=null?Ju:!0,hasConversation:bd?.conversation!=null,hasPreviousResponseId:bd?.previousResponseId!=null,hasLocalShellTool:Td("openai.local_shell"),hasShellTool:Td("openai.shell"),hasApplyPatchTool:Td("openai.apply_patch"),hasComputerTool:Td("openai.computer"),customProviderToolNames:kd.size>0?kd:void 0});sd.push(...ud);const hd=(Yu=bd?.strictJsonSchema)!=null?Yu:!0;let gd=bd?.include;function Ed(Dd){gd==null?gd=[Dd]:gd.includes(Dd)||(gd=[...gd,Dd])}function Td(Dd){return Fu?.find(Wd=>Wd.type==="provider"&&Wd.id===Dd)!=null}const Rd=typeof bd?.logprobs=="number"?bd?.logprobs:bd?.logprobs===!0?TOP_LOGPROBS_MAX:void 0;Rd&&Ed("message.output_text.logprobs");const jd=(Xu=Fu?.find(Dd=>Dd.type==="provider"&&(Dd.id==="openai.web_search"||Dd.id==="openai.web_search_preview")))==null?void 0:Xu.name;jd&&Ed("web_search_call.action.sources"),Td("openai.code_interpreter")&&Ed("code_interpreter_call.outputs");const Cd=bd?.store;Cd===!1&&yd&&Ed("reasoning.encrypted_content");const $d={model:this.modelId,input:ld,temperature:$u,top_p:Iu,max_output_tokens:lo,...(Uu?.type==="json"||bd?.textVerbosity)&&{text:{...Uu?.type==="json"&&{format:Uu.schema!=null?{type:"json_schema",strict:hd,name:(ed=Uu.name)!=null?ed:"response",description:Uu.description,schema:Uu.schema}:{type:"json_object"}},...bd?.textVerbosity&&{verbosity:bd.textVerbosity}}},conversation:bd?.conversation,max_tool_calls:bd?.maxToolCalls,metadata:bd?.metadata,parallel_tool_calls:bd?.parallelToolCalls,previous_response_id:bd?.previousResponseId,store:Cd,user:bd?.user,instructions:bd?.instructions,service_tier:bd?.serviceTier,include:gd,prompt_cache_key:bd?.promptCacheKey,prompt_cache_options:bd?.promptCacheOptions,prompt_cache_retention:bd?.promptCacheRetention,safety_identifier:bd?.safetyIdentifier,top_logprobs:Rd,truncation:bd?.truncation,...bd?.contextManagement&&{context_management:bd.contextManagement.map(Dd=>({type:Dd.type,compact_threshold:Dd.compactThreshold}))},...yd&&(wd!=null||_d!=null||bd?.reasoningMode!=null||bd?.reasoningContext!=null)&&{reasoning:{...wd!=null&&{effort:wd},..._d!=null&&{summary:_d},...bd?.reasoningMode!=null&&{mode:bd.reasoningMode},...bd?.reasoningContext!=null&&{context:bd.reasoningContext}}}};yd?wd==="none"&&ad.supportsNonReasoningParameters||($d.temperature!=null&&($d.temperature=void 0,sd.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),$d.top_p!=null&&($d.top_p=void 0,sd.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(bd?.reasoningEffort!=null&&sd.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),bd?.reasoningSummary!=null&&sd.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"}),bd?.reasoningMode!=null&&sd.push({type:"unsupported",feature:"reasoningMode",details:"reasoningMode is not supported for non-reasoning models"}),bd?.reasoningContext!=null&&sd.push({type:"unsupported",feature:"reasoningContext",details:"reasoningContext is not supported for non-reasoning models"})),bd?.serviceTier==="flex"&&!ad.supportsFlexProcessing&&(sd.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete $d.service_tier),bd?.serviceTier==="priority"&&!ad.supportsPriorityProcessing&&(sd.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete $d.service_tier);const Id=(od=(nd=(td=Fu?.find(Dd=>Dd.type==="provider"&&Dd.id==="openai.shell"))==null?void 0:td.args)==null?void 0:nd.environment)==null?void 0:od.type,Vd=Id==="containerAuto"||Id==="containerReference";return{webSearchToolName:jd,args:{...$d,tools:md,tool_choice:dd},warnings:[...sd,...vd],store:Cd,toolNameMapping:Sd,providerOptionsName:pd,isShellProviderExecuted:Vd}}async doGenerate(lo){var $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju,Fu,zu,Uu,Hu,Vu,Gu,Wu,Zu,Ju,Yu,Xu,ed,td,nd,od,sd,ad,pd,bd,wd,_d,yd;const{args:Sd,warnings:kd,webSearchToolName:md,toolNameMapping:dd,providerOptionsName:vd,isShellProviderExecuted:ld}=await this.getArgs(lo),ud=this.config.url({path:"/responses",modelId:this.modelId}),hd=extractApprovalRequestIdToToolCallIdMapping(lo.prompt),{responseHeaders:gd,value:Ed,rawValue:Td}=await postJsonToApi({url:ud,headers:combineHeaders((Ru=($u=this.config).headers)==null?void 0:Ru.call($u),lo.headers),body:Sd,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiResponsesResponseSchema),abortSignal:lo.abortSignal,fetch:this.config.fetch});if(Ed.error)throw new APICallError({message:Ed.error.message,url:ud,requestBodyValues:Sd,statusCode:400,responseHeaders:gd,responseBody:Td,isRetryable:!1});if(Ed.output==null){const Dd=(Iu=Ed.incomplete_details)==null?void 0:Iu.reason;throw new APICallError({message:Dd?`Responses API returned no output (${Dd})`:"Responses API returned no output",url:ud,requestBodyValues:Sd,statusCode:500,responseHeaders:gd,responseBody:Td,isRetryable:!1})}const Rd=[],jd=[];let Cd=!1;const $d=[];for(const Dd of Ed.output)switch(Dd.type){case"reasoning":{Dd.summary.length===0&&Dd.summary.push({type:"summary_text",text:""});for(const Wd of Dd.summary)Rd.push({type:"reasoning",text:Wd.text,providerMetadata:{[vd]:{itemId:Dd.id,reasoningEncryptedContent:(Pu=Dd.encrypted_content)!=null?Pu:null}}});break}case"image_generation_call":{Rd.push({type:"tool-call",toolCallId:Dd.id,toolName:dd.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),Rd.push({type:"tool-result",toolCallId:Dd.id,toolName:dd.toCustomToolName("image_generation"),result:{result:Dd.result}});break}case"tool_search_call":{const Wd=(Ou=Dd.call_id)!=null?Ou:Dd.id,oh=Dd.execution==="server";oh&&$d.push(Wd),Rd.push({type:"tool-call",toolCallId:Wd,toolName:dd.toCustomToolName("tool_search"),input:JSON.stringify({arguments:Dd.arguments,call_id:Dd.call_id}),...oh?{providerExecuted:!0}:{},providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"tool_search_output":{const Wd=(Mu=(Du=Dd.call_id)!=null?Du:$d.shift())!=null?Mu:Dd.id;Rd.push({type:"tool-result",toolCallId:Wd,toolName:dd.toCustomToolName("tool_search"),result:{tools:Dd.tools},providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"local_shell_call":{Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("local_shell"),input:JSON.stringify({action:Dd.action}),providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"shell_call":{Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("shell"),input:JSON.stringify({action:{commands:Dd.action.commands}}),...ld&&{providerExecuted:!0},providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"shell_call_output":{Rd.push({type:"tool-result",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("shell"),result:{output:Dd.output.map(Wd=>({stdout:Wd.stdout,stderr:Wd.stderr,outcome:Wd.outcome.type==="exit"?{type:"exit",exitCode:Wd.outcome.exit_code}:{type:"timeout"}}))}});break}case"message":{for(const Wd of Dd.content){(Bu=(Lu=lo.providerOptions)==null?void 0:Lu[vd])!=null&&Bu.logprobs&&Wd.logprobs&&jd.push(Wd.logprobs);const oh={itemId:Dd.id,...Dd.phase!=null&&{phase:Dd.phase},...Wd.annotations.length>0&&{annotations:Wd.annotations}};Rd.push({type:"text",text:Wd.text,providerMetadata:{[vd]:oh}});for(const rh of Wd.annotations)rh.type==="url_citation"?Rd.push({type:"source",sourceType:"url",id:(zu=(Fu=(ju=this.config).generateId)==null?void 0:Fu.call(ju))!=null?zu:generateId(),url:rh.url,title:rh.title}):rh.type==="file_citation"?Rd.push({type:"source",sourceType:"document",id:(Vu=(Hu=(Uu=this.config).generateId)==null?void 0:Hu.call(Uu))!=null?Vu:generateId(),mediaType:"text/plain",title:rh.filename,filename:rh.filename,providerMetadata:{[vd]:{type:rh.type,fileId:rh.file_id,index:rh.index}}}):rh.type==="container_file_citation"?Rd.push({type:"source",sourceType:"document",id:(Zu=(Wu=(Gu=this.config).generateId)==null?void 0:Wu.call(Gu))!=null?Zu:generateId(),mediaType:"text/plain",title:rh.filename,filename:rh.filename,providerMetadata:{[vd]:{type:rh.type,fileId:rh.file_id,containerId:rh.container_id}}}):rh.type==="file_path"&&Rd.push({type:"source",sourceType:"document",id:(Xu=(Yu=(Ju=this.config).generateId)==null?void 0:Yu.call(Ju))!=null?Xu:generateId(),mediaType:"application/octet-stream",title:rh.file_id,filename:rh.file_id,providerMetadata:{[vd]:{type:rh.type,fileId:rh.file_id,index:rh.index}}})}break}case"function_call":{Cd=!0,Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:Dd.name,input:Dd.arguments,providerMetadata:{[vd]:{itemId:Dd.id,...Dd.namespace!=null&&{namespace:Dd.namespace},...Dd.caller!=null&&{caller:Dd.caller.type==="program"?{type:"program",callerId:Dd.caller.caller_id}:Dd.caller}}}});break}case"program":{Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("programmatic_tool_calling"),input:JSON.stringify({code:Dd.code,fingerprint:Dd.fingerprint}),providerExecuted:!0,providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"program_output":{Rd.push({type:"tool-result",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("programmatic_tool_calling"),result:{result:Dd.result,status:Dd.status},providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"custom_tool_call":{Cd=!0;const Wd=dd.toCustomToolName(Dd.name);Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:Wd,input:JSON.stringify(Dd.input),providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"web_search_call":{Rd.push({type:"tool-call",toolCallId:Dd.id,toolName:dd.toCustomToolName(md??"web_search"),input:JSON.stringify({}),providerExecuted:!0}),Rd.push({type:"tool-result",toolCallId:Dd.id,toolName:dd.toCustomToolName(md??"web_search"),result:mapWebSearchOutput(Dd.action)});break}case"mcp_call":{const Wd=Dd.approval_request_id!=null&&(ed=hd[Dd.approval_request_id])!=null?ed:Dd.id,oh=`mcp.${Dd.name}`;Rd.push({type:"tool-call",toolCallId:Wd,toolName:oh,input:Dd.arguments,providerExecuted:!0,dynamic:!0}),Rd.push({type:"tool-result",toolCallId:Wd,toolName:oh,result:{type:"call",serverLabel:Dd.server_label,name:Dd.name,arguments:Dd.arguments,...Dd.output!=null?{output:Dd.output}:{},...Dd.error!=null?{error:Dd.error}:{}},providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"mcp_list_tools":break;case"mcp_approval_request":{const Wd=(td=Dd.approval_request_id)!=null?td:Dd.id,oh=(sd=(od=(nd=this.config).generateId)==null?void 0:od.call(nd))!=null?sd:generateId(),rh=`mcp.${Dd.name}`;Rd.push({type:"tool-call",toolCallId:oh,toolName:rh,input:Dd.arguments,providerExecuted:!0,dynamic:!0}),Rd.push({type:"tool-approval-request",approvalId:Wd,toolCallId:oh});break}case"computer_call":{if(Dd.call_id==null){Rd.push({type:"tool-call",toolCallId:Dd.id,toolName:dd.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),Rd.push({type:"tool-result",toolCallId:Dd.id,toolName:dd.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:Dd.status}});break}Cd=!0;const Wd=dd.toCustomToolName("computer");Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:Wd,input:JSON.stringify(mapComputerCallInput(Dd)),providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"file_search_call":{Rd.push({type:"tool-call",toolCallId:Dd.id,toolName:dd.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),Rd.push({type:"tool-result",toolCallId:Dd.id,toolName:dd.toCustomToolName("file_search"),result:{queries:Dd.queries,results:(pd=(ad=Dd.results)==null?void 0:ad.map(Wd=>({attributes:Wd.attributes,fileId:Wd.file_id,filename:Wd.filename,score:Wd.score,text:Wd.text})))!=null?pd:null}});break}case"code_interpreter_call":{Rd.push({type:"tool-call",toolCallId:Dd.id,toolName:dd.toCustomToolName("code_interpreter"),input:JSON.stringify({code:Dd.code,containerId:Dd.container_id}),providerExecuted:!0}),Rd.push({type:"tool-result",toolCallId:Dd.id,toolName:dd.toCustomToolName("code_interpreter"),result:{outputs:Dd.outputs}});break}case"apply_patch_call":{Rd.push({type:"tool-call",toolCallId:Dd.call_id,toolName:dd.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Dd.call_id,operation:Dd.operation}),providerMetadata:{[vd]:{itemId:Dd.id}}});break}case"compaction":{Rd.push({type:"custom",kind:"openai.compaction",providerMetadata:{[vd]:{type:"compaction",itemId:Dd.id,encryptedContent:Dd.encrypted_content}}});break}}const Id={[vd]:{responseId:Ed.id,...jd.length>0?{logprobs:jd}:{},...typeof Ed.service_tier=="string"?{serviceTier:Ed.service_tier}:{},...((bd=Ed.reasoning)==null?void 0:bd.context)!=null?{reasoningContext:Ed.reasoning.context}:{}}},Vd=Ed.usage;return{content:Rd,finishReason:{unified:mapOpenAIResponseFinishReason({finishReason:(wd=Ed.incomplete_details)==null?void 0:wd.reason,hasFunctionCall:Cd}),raw:(yd=(_d=Ed.incomplete_details)==null?void 0:_d.reason)!=null?yd:void 0},usage:convertOpenAIResponsesUsage(Vd),request:{body:Sd},response:{id:Ed.id,timestamp:new Date(Ed.created_at*1e3),modelId:Ed.model,headers:gd,body:Td},providerMetadata:Id,warnings:kd}}async doStream(lo){var $u,Ru;const{args:Iu,warnings:Pu,webSearchToolName:Ou,toolNameMapping:Du,store:Mu,providerOptionsName:Lu,isShellProviderExecuted:Bu}=await this.getArgs(lo),ju=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:Fu,value:zu}=await postJsonToApi({url:ju,headers:combineHeaders((Ru=($u=this.config).headers)==null?void 0:Ru.call($u),lo.headers),body:{...Iu,stream:!0},failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createEventSourceResponseHandler(openaiResponsesChunkSchema),abortSignal:lo.abortSignal,fetch:this.config.fetch}),Uu=await throwIfOpenAIStreamErrorBeforeOutput({stream:zu,getError:_d=>isErrorChunk(_d)||isResponseFailedChunk(_d)&&_d.response.error!=null?_d:void 0,isOutputChunk:isResponseOutputChunk,url:ju,requestBodyValues:Iu,responseHeaders:Fu}),Hu=this,Vu=extractApprovalRequestIdToToolCallIdMapping(lo.prompt),Gu=new Map;let Wu={unified:"other",raw:void 0},Zu;const Ju=[];let Yu=null;const Xu={},ed=[];let td,nd=!1;const od={};let sd,ad;const pd=[];let bd=!1;return{stream:Uu.pipeThrough(new TransformStream({start(_d){_d.enqueue({type:"stream-start",warnings:Pu})},transform(_d,yd){var Sd,kd,md,dd,vd,ld,ud,hd,gd,Ed,Td,Rd,jd,Cd,$d,Id,Vd,Dd,Wd,oh,rh,Eh,ah,yh,vh,Jd,Qd,sh,Oh,qd,zd,Pd,Od,Gd,Md,Kd,Xd,ph,_h,Sh,Wh;if(lo.includeRawChunks&&yd.enqueue({type:"raw",rawValue:_d.rawValue}),!_d.success){const xd=isOpenAIChatCompletionChunk(_d.rawValue)?createOpenAIResponsesChatCompletionsMismatchError({value:_d.rawValue,cause:_d.error,url:ju,requestBodyValues:Iu,responseHeaders:Fu}):_d.error;Wu={unified:"error",raw:void 0},yd.enqueue({type:"error",error:xd});return}const Nd=_d.value;if(isResponseOutputItemAddedChunk(Nd)){if(Nd.item.type==="function_call")Xu[Nd.output_index]={toolName:Nd.item.name,toolCallId:Nd.item.call_id},yd.enqueue({type:"tool-input-start",id:Nd.item.call_id,toolName:Nd.item.name});else if(Nd.item.type==="custom_tool_call"){const xd=Du.toCustomToolName(Nd.item.name);Xu[Nd.output_index]={toolName:xd,toolCallId:Nd.item.call_id},yd.enqueue({type:"tool-input-start",id:Nd.item.call_id,toolName:xd})}else if(Nd.item.type==="web_search_call")Xu[Nd.output_index]={toolName:Du.toCustomToolName(Ou??"web_search"),toolCallId:Nd.item.id},yd.enqueue({type:"tool-input-start",id:Nd.item.id,toolName:Du.toCustomToolName(Ou??"web_search"),providerExecuted:!0}),yd.enqueue({type:"tool-input-end",id:Nd.item.id}),yd.enqueue({type:"tool-call",toolCallId:Nd.item.id,toolName:Du.toCustomToolName(Ou??"web_search"),input:JSON.stringify({}),providerExecuted:!0});else if(Nd.item.type==="computer_call"){const xd=(Sd=Nd.item.call_id)!=null?Sd:Nd.item.id;Xu[Nd.output_index]={toolName:Du.toCustomToolName("computer"),toolCallId:xd},yd.enqueue({type:"tool-input-start",id:xd,toolName:Du.toCustomToolName("computer")})}else if(Nd.item.type==="code_interpreter_call")Xu[Nd.output_index]={toolName:Du.toCustomToolName("code_interpreter"),toolCallId:Nd.item.id,codeInterpreter:{containerId:Nd.item.container_id}},yd.enqueue({type:"tool-input-start",id:Nd.item.id,toolName:Du.toCustomToolName("code_interpreter"),providerExecuted:!0}),yd.enqueue({type:"tool-input-delta",id:Nd.item.id,delta:`{"containerId":"${Nd.item.container_id}","code":"`});else if(Nd.item.type==="file_search_call")yd.enqueue({type:"tool-call",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("file_search"),input:"{}",providerExecuted:!0});else if(Nd.item.type==="image_generation_call")yd.enqueue({type:"tool-call",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0});else if(Nd.item.type==="tool_search_call"){const xd=Nd.item.id,Hd=Du.toCustomToolName("tool_search"),Zd=Nd.item.execution==="server";Xu[Nd.output_index]={toolName:Hd,toolCallId:xd,toolSearchExecution:(kd=Nd.item.execution)!=null?kd:"server"},Zd&&yd.enqueue({type:"tool-input-start",id:xd,toolName:Hd,providerExecuted:!0})}else if(Nd.item.type!=="tool_search_output"){if(!(Nd.item.type==="mcp_call"||Nd.item.type==="mcp_list_tools"||Nd.item.type==="mcp_approval_request"))if(Nd.item.type==="apply_patch_call"){const{call_id:xd,operation:Hd}=Nd.item;if(Xu[Nd.output_index]={toolName:Du.toCustomToolName("apply_patch"),toolCallId:xd,applyPatch:{hasDiff:Hd.type==="delete_file",endEmitted:Hd.type==="delete_file"}},yd.enqueue({type:"tool-input-start",id:xd,toolName:Du.toCustomToolName("apply_patch")}),Hd.type==="delete_file"){const Zd=JSON.stringify({callId:xd,operation:Hd});yd.enqueue({type:"tool-input-delta",id:xd,delta:Zd}),yd.enqueue({type:"tool-input-end",id:xd})}else yd.enqueue({type:"tool-input-delta",id:xd,delta:`{"callId":"${escapeJSONDelta(xd)}","operation":{"type":"${escapeJSONDelta(Hd.type)}","path":"${escapeJSONDelta(Hd.path)}","diff":"`})}else Nd.item.type==="shell_call"?Xu[Nd.output_index]={toolName:Du.toCustomToolName("shell"),toolCallId:Nd.item.call_id}:Nd.item.type==="shell_call_output"||(Nd.item.type==="message"?(ed.splice(0,ed.length),td=(md=Nd.item.phase)!=null?md:void 0,yd.enqueue({type:"text-start",id:Nd.item.id,providerMetadata:{[Lu]:{itemId:Nd.item.id,...Nd.item.phase!=null&&{phase:Nd.item.phase}}}})):isResponseOutputItemAddedChunk(Nd)&&Nd.item.type==="reasoning"&&(od[Nd.item.id]={encryptedContent:Nd.item.encrypted_content,summaryParts:{0:"active"}},yd.enqueue({type:"reasoning-start",id:`${Nd.item.id}:0`,providerMetadata:{[Lu]:{itemId:Nd.item.id,reasoningEncryptedContent:(dd=Nd.item.encrypted_content)!=null?dd:null}}})))}}else if(isResponseOutputItemDoneChunk(Nd))if(Nd.item.type==="message"){const xd=(vd=Nd.item.phase)!=null?vd:td;td=void 0,yd.enqueue({type:"text-end",id:Nd.item.id,providerMetadata:{[Lu]:{itemId:Nd.item.id,...xd!=null&&{phase:xd},...ed.length>0&&{annotations:ed}}}})}else if(Nd.item.type==="function_call")Xu[Nd.output_index]=void 0,nd=!0,yd.enqueue({type:"tool-input-end",id:Nd.item.call_id,...Nd.item.namespace!=null&&{providerMetadata:{[Lu]:{namespace:Nd.item.namespace}}}}),yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:Nd.item.name,input:Nd.item.arguments,providerMetadata:{[Lu]:{itemId:Nd.item.id,...Nd.item.namespace!=null&&{namespace:Nd.item.namespace},...Nd.item.caller!=null&&{caller:Nd.item.caller.type==="program"?{type:"program",callerId:Nd.item.caller.caller_id}:Nd.item.caller}}}});else if(Nd.item.type==="program")yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:Du.toCustomToolName("programmatic_tool_calling"),input:JSON.stringify({code:Nd.item.code,fingerprint:Nd.item.fingerprint}),providerExecuted:!0,providerMetadata:{[Lu]:{itemId:Nd.item.id}}});else if(Nd.item.type==="program_output")yd.enqueue({type:"tool-result",toolCallId:Nd.item.call_id,toolName:Du.toCustomToolName("programmatic_tool_calling"),result:{result:Nd.item.result,status:Nd.item.status},providerMetadata:{[Lu]:{itemId:Nd.item.id}}});else if(Nd.item.type==="custom_tool_call"){Xu[Nd.output_index]=void 0,nd=!0;const xd=Du.toCustomToolName(Nd.item.name);yd.enqueue({type:"tool-input-end",id:Nd.item.call_id}),yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:xd,input:JSON.stringify(Nd.item.input),providerMetadata:{[Lu]:{itemId:Nd.item.id}}})}else if(Nd.item.type==="web_search_call")Xu[Nd.output_index]=void 0,yd.enqueue({type:"tool-result",toolCallId:Nd.item.id,toolName:Du.toCustomToolName(Ou??"web_search"),result:mapWebSearchOutput(Nd.item.action)});else if(Nd.item.type==="computer_call"){if(Xu[Nd.output_index]=void 0,Nd.item.call_id==null){yd.enqueue({type:"tool-input-end",id:Nd.item.id}),yd.enqueue({type:"tool-call",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),yd.enqueue({type:"tool-result",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:Nd.item.status}});return}nd=!0;const xd=Du.toCustomToolName("computer"),Hd=JSON.stringify(mapComputerCallInput(Nd.item));yd.enqueue({type:"tool-input-delta",id:Nd.item.call_id,delta:Hd}),yd.enqueue({type:"tool-input-end",id:Nd.item.call_id}),yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:xd,input:Hd,providerMetadata:{[Lu]:{itemId:Nd.item.id}}})}else if(Nd.item.type==="file_search_call")Xu[Nd.output_index]=void 0,yd.enqueue({type:"tool-result",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("file_search"),result:{queries:Nd.item.queries,results:(ud=(ld=Nd.item.results)==null?void 0:ld.map(xd=>({attributes:xd.attributes,fileId:xd.file_id,filename:xd.filename,score:xd.score,text:xd.text})))!=null?ud:null}});else if(Nd.item.type==="code_interpreter_call")Xu[Nd.output_index]=void 0,yd.enqueue({type:"tool-result",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("code_interpreter"),result:{outputs:Nd.item.outputs}});else if(Nd.item.type==="image_generation_call")yd.enqueue({type:"tool-result",toolCallId:Nd.item.id,toolName:Du.toCustomToolName("image_generation"),result:{result:Nd.item.result}});else if(Nd.item.type==="tool_search_call"){const xd=Xu[Nd.output_index],Hd=Nd.item.execution==="server";if(xd!=null){const Zd=Hd?xd.toolCallId:(hd=Nd.item.call_id)!=null?hd:Nd.item.id;Hd?pd.push(Zd):yd.enqueue({type:"tool-input-start",id:Zd,toolName:xd.toolName}),yd.enqueue({type:"tool-input-end",id:Zd}),yd.enqueue({type:"tool-call",toolCallId:Zd,toolName:xd.toolName,input:JSON.stringify({arguments:Nd.item.arguments,call_id:Hd?null:Zd}),...Hd?{providerExecuted:!0}:{},providerMetadata:{[Lu]:{itemId:Nd.item.id}}})}Xu[Nd.output_index]=void 0}else if(Nd.item.type==="tool_search_output"){const xd=(Ed=(gd=Nd.item.call_id)!=null?gd:pd.shift())!=null?Ed:Nd.item.id;yd.enqueue({type:"tool-result",toolCallId:xd,toolName:Du.toCustomToolName("tool_search"),result:{tools:Nd.item.tools},providerMetadata:{[Lu]:{itemId:Nd.item.id}}})}else if(Nd.item.type==="mcp_call"){Xu[Nd.output_index]=void 0;const xd=(Td=Nd.item.approval_request_id)!=null?Td:void 0,Hd=xd!=null&&(jd=(Rd=Gu.get(xd))!=null?Rd:Vu[xd])!=null?jd:Nd.item.id,Zd=`mcp.${Nd.item.name}`;yd.enqueue({type:"tool-call",toolCallId:Hd,toolName:Zd,input:Nd.item.arguments,providerExecuted:!0,dynamic:!0}),yd.enqueue({type:"tool-result",toolCallId:Hd,toolName:Zd,result:{type:"call",serverLabel:Nd.item.server_label,name:Nd.item.name,arguments:Nd.item.arguments,...Nd.item.output!=null?{output:Nd.item.output}:{},...Nd.item.error!=null?{error:Nd.item.error}:{}},providerMetadata:{[Lu]:{itemId:Nd.item.id}}})}else if(Nd.item.type==="mcp_list_tools")Xu[Nd.output_index]=void 0;else if(Nd.item.type==="apply_patch_call"){const xd=Xu[Nd.output_index];xd?.applyPatch&&!xd.applyPatch.endEmitted&&Nd.item.operation.type!=="delete_file"&&(xd.applyPatch.hasDiff||yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:escapeJSONDelta(Nd.item.operation.diff)}),yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:'"}}'}),yd.enqueue({type:"tool-input-end",id:xd.toolCallId}),xd.applyPatch.endEmitted=!0),xd&&Nd.item.status==="completed"&&yd.enqueue({type:"tool-call",toolCallId:xd.toolCallId,toolName:Du.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Nd.item.call_id,operation:Nd.item.operation}),providerMetadata:{[Lu]:{itemId:Nd.item.id}}}),Xu[Nd.output_index]=void 0}else if(Nd.item.type==="mcp_approval_request"){Xu[Nd.output_index]=void 0;const xd=(Id=($d=(Cd=Hu.config).generateId)==null?void 0:$d.call(Cd))!=null?Id:generateId(),Hd=(Vd=Nd.item.approval_request_id)!=null?Vd:Nd.item.id;Gu.set(Hd,xd);const Zd=`mcp.${Nd.item.name}`;yd.enqueue({type:"tool-call",toolCallId:xd,toolName:Zd,input:Nd.item.arguments,providerExecuted:!0,dynamic:!0}),yd.enqueue({type:"tool-approval-request",approvalId:Hd,toolCallId:xd})}else if(Nd.item.type==="local_shell_call")Xu[Nd.output_index]=void 0,yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:Du.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:Nd.item.action.command,timeoutMs:Nd.item.action.timeout_ms,user:Nd.item.action.user,workingDirectory:Nd.item.action.working_directory,env:Nd.item.action.env}}),providerMetadata:{[Lu]:{itemId:Nd.item.id}}});else if(Nd.item.type==="shell_call")Xu[Nd.output_index]=void 0,yd.enqueue({type:"tool-call",toolCallId:Nd.item.call_id,toolName:Du.toCustomToolName("shell"),input:JSON.stringify({action:{commands:Nd.item.action.commands}}),...Bu&&{providerExecuted:!0},providerMetadata:{[Lu]:{itemId:Nd.item.id}}});else if(Nd.item.type==="shell_call_output")yd.enqueue({type:"tool-result",toolCallId:Nd.item.call_id,toolName:Du.toCustomToolName("shell"),result:{output:Nd.item.output.map(xd=>({stdout:xd.stdout,stderr:xd.stderr,outcome:xd.outcome.type==="exit"?{type:"exit",exitCode:xd.outcome.exit_code}:{type:"timeout"}}))}});else if(Nd.item.type==="reasoning"){const xd=od[Nd.item.id],Hd=Object.entries(xd.summaryParts).filter(([Zd,gh])=>gh==="active"||gh==="can-conclude").map(([Zd])=>Zd);for(const Zd of Hd)yd.enqueue({type:"reasoning-end",id:`${Nd.item.id}:${Zd}`,providerMetadata:{[Lu]:{itemId:Nd.item.id,reasoningEncryptedContent:(Dd=Nd.item.encrypted_content)!=null?Dd:null}}});delete od[Nd.item.id]}else Nd.item.type==="compaction"&&yd.enqueue({type:"custom",kind:"openai.compaction",providerMetadata:{[Lu]:{type:"compaction",itemId:Nd.item.id,encryptedContent:Nd.item.encrypted_content}}});else if(isResponseFunctionCallArgumentsDeltaChunk(Nd)){const xd=Xu[Nd.output_index];xd!=null&&yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:Nd.delta})}else if(isResponseCustomToolCallInputDeltaChunk(Nd)){const xd=Xu[Nd.output_index];xd!=null&&yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:Nd.delta})}else if(isResponseApplyPatchCallOperationDiffDeltaChunk(Nd)){const xd=Xu[Nd.output_index];xd?.applyPatch&&(yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:escapeJSONDelta(Nd.delta)}),xd.applyPatch.hasDiff=!0)}else if(isResponseApplyPatchCallOperationDiffDoneChunk(Nd)){const xd=Xu[Nd.output_index];xd?.applyPatch&&!xd.applyPatch.endEmitted&&(xd.applyPatch.hasDiff||(yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:escapeJSONDelta(Nd.diff)}),xd.applyPatch.hasDiff=!0),yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:'"}}'}),yd.enqueue({type:"tool-input-end",id:xd.toolCallId}),xd.applyPatch.endEmitted=!0)}else if(isResponseImageGenerationCallPartialImageChunk(Nd))yd.enqueue({type:"tool-result",toolCallId:Nd.item_id,toolName:Du.toCustomToolName("image_generation"),result:{result:Nd.partial_image_b64},preliminary:!0});else if(isResponseCodeInterpreterCallCodeDeltaChunk(Nd)){const xd=Xu[Nd.output_index];xd!=null&&yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:escapeJSONDelta(Nd.delta)})}else if(isResponseCodeInterpreterCallCodeDoneChunk(Nd)){const xd=Xu[Nd.output_index];xd!=null&&(yd.enqueue({type:"tool-input-delta",id:xd.toolCallId,delta:'"}'}),yd.enqueue({type:"tool-input-end",id:xd.toolCallId}),yd.enqueue({type:"tool-call",toolCallId:xd.toolCallId,toolName:Du.toCustomToolName("code_interpreter"),input:JSON.stringify({code:Nd.code,containerId:xd.codeInterpreter.containerId}),providerExecuted:!0}))}else if(isResponseCreatedChunk(Nd))Yu=Nd.response.id,yd.enqueue({type:"response-metadata",id:Nd.response.id,timestamp:new Date(Nd.response.created_at*1e3),modelId:Nd.response.model});else if(isTextDeltaChunk(Nd))yd.enqueue({type:"text-delta",id:Nd.item_id,delta:Nd.delta}),(oh=(Wd=lo.providerOptions)==null?void 0:Wd[Lu])!=null&&oh.logprobs&&Nd.logprobs&&Ju.push(Nd.logprobs);else if(Nd.type==="response.reasoning_summary_part.added"){if(Nd.summary_index>0){const xd=od[Nd.item_id];xd.summaryParts[Nd.summary_index]="active";for(const Hd of Object.keys(xd.summaryParts))xd.summaryParts[Hd]==="can-conclude"&&(yd.enqueue({type:"reasoning-end",id:`${Nd.item_id}:${Hd}`,providerMetadata:{[Lu]:{itemId:Nd.item_id}}}),xd.summaryParts[Hd]="concluded");yd.enqueue({type:"reasoning-start",id:`${Nd.item_id}:${Nd.summary_index}`,providerMetadata:{[Lu]:{itemId:Nd.item_id,reasoningEncryptedContent:(Eh=(rh=od[Nd.item_id])==null?void 0:rh.encryptedContent)!=null?Eh:null}}})}}else if(Nd.type==="response.reasoning_summary_text.delta")yd.enqueue({type:"reasoning-delta",id:`${Nd.item_id}:${Nd.summary_index}`,delta:Nd.delta,providerMetadata:{[Lu]:{itemId:Nd.item_id}}});else if(Nd.type==="response.reasoning_summary_part.done")Mu?(yd.enqueue({type:"reasoning-end",id:`${Nd.item_id}:${Nd.summary_index}`,providerMetadata:{[Lu]:{itemId:Nd.item_id}}}),od[Nd.item_id].summaryParts[Nd.summary_index]="concluded"):od[Nd.item_id].summaryParts[Nd.summary_index]="can-conclude";else if(isResponseFinishedChunk(Nd))Wu={unified:mapOpenAIResponseFinishReason({finishReason:(ah=Nd.response.incomplete_details)==null?void 0:ah.reason,hasFunctionCall:nd}),raw:(vh=(yh=Nd.response.incomplete_details)==null?void 0:yh.reason)!=null?vh:void 0},Zu=Nd.response.usage,typeof Nd.response.service_tier=="string"&&(sd=Nd.response.service_tier),((Jd=Nd.response.reasoning)==null?void 0:Jd.context)!=null&&(ad=Nd.response.reasoning.context);else if(isResponseFailedChunk(Nd)){const xd=(Qd=Nd.response.incomplete_details)==null?void 0:Qd.reason;Wu={unified:xd?mapOpenAIResponseFinishReason({finishReason:xd,hasFunctionCall:nd}):"error",raw:xd??"error"},Zu=(sh=Nd.response.usage)!=null?sh:void 0,((Oh=Nd.response.reasoning)==null?void 0:Oh.context)!=null&&(ad=Nd.response.reasoning.context),!bd&&Nd.response.error!=null&&(bd=!0,yd.enqueue({type:"error",error:{type:"response.failed",sequence_number:Nd.sequence_number,response:{error:Nd.response.error,incomplete_details:Nd.response.incomplete_details,service_tier:Nd.response.service_tier}}}))}else isResponseAnnotationAddedChunk(Nd)?(ed.push(Nd.annotation),Nd.annotation.type==="url_citation"?yd.enqueue({type:"source",sourceType:"url",id:(Pd=(zd=(qd=Hu.config).generateId)==null?void 0:zd.call(qd))!=null?Pd:generateId(),url:Nd.annotation.url,title:Nd.annotation.title}):Nd.annotation.type==="file_citation"?yd.enqueue({type:"source",sourceType:"document",id:(Md=(Gd=(Od=Hu.config).generateId)==null?void 0:Gd.call(Od))!=null?Md:generateId(),mediaType:"text/plain",title:Nd.annotation.filename,filename:Nd.annotation.filename,providerMetadata:{[Lu]:{type:Nd.annotation.type,fileId:Nd.annotation.file_id,index:Nd.annotation.index}}}):Nd.annotation.type==="container_file_citation"?yd.enqueue({type:"source",sourceType:"document",id:(ph=(Xd=(Kd=Hu.config).generateId)==null?void 0:Xd.call(Kd))!=null?ph:generateId(),mediaType:"text/plain",title:Nd.annotation.filename,filename:Nd.annotation.filename,providerMetadata:{[Lu]:{type:Nd.annotation.type,fileId:Nd.annotation.file_id,containerId:Nd.annotation.container_id}}}):Nd.annotation.type==="file_path"&&yd.enqueue({type:"source",sourceType:"document",id:(Wh=(Sh=(_h=Hu.config).generateId)==null?void 0:Sh.call(_h))!=null?Wh:generateId(),mediaType:"application/octet-stream",title:Nd.annotation.file_id,filename:Nd.annotation.file_id,providerMetadata:{[Lu]:{type:Nd.annotation.type,fileId:Nd.annotation.file_id,index:Nd.annotation.index}}})):isErrorChunk(Nd)&&(bd=!0,Wu={unified:"error",raw:"error"},yd.enqueue({type:"error",error:Nd}))},flush(_d){const yd={[Lu]:{responseId:Yu,...Ju.length>0?{logprobs:Ju}:{},...sd!==void 0?{serviceTier:sd}:{},...ad!==void 0?{reasoningContext:ad}:{}}};_d.enqueue({type:"finish",finishReason:Wu,usage:convertOpenAIResponsesUsage(Zu),providerMetadata:yd})}})),request:{body:Iu},response:{headers:Fu}}}};function isTextDeltaChunk(Au){return Au.type==="response.output_text.delta"}function isOpenAIChatCompletionChunk(Au){const lo=asRecord2(Au);return lo!=null&&Array.isArray(lo.choices)&&typeof lo.type!="string"}function createOpenAIResponsesChatCompletionsMismatchError({value:Au,cause:lo,url:$u,requestBodyValues:Ru,responseHeaders:Iu}){return new APICallError({message:"Received a Chat Completions stream while using the OpenAI Responses API. The default OpenAI provider model uses the Responses API. If your custom baseURL targets a Chat Completions-compatible endpoint, use openai.chat('model-id') or createOpenAI(...).chat('model-id') instead. You can also use @ai-sdk/openai-compatible for OpenAI-compatible providers.",url:$u,requestBodyValues:Ru,responseHeaders:Iu,responseBody:JSON.stringify(Au),cause:lo,data:Au,isRetryable:!1})}function asRecord2(Au){return typeof Au=="object"&&Au!=null?Au:void 0}function isResponseOutputItemDoneChunk(Au){return Au.type==="response.output_item.done"}function isResponseFinishedChunk(Au){return Au.type==="response.completed"||Au.type==="response.incomplete"}function isResponseFailedChunk(Au){return Au.type==="response.failed"}function isResponseCreatedChunk(Au){return Au.type==="response.created"}function isResponseFunctionCallArgumentsDeltaChunk(Au){return Au.type==="response.function_call_arguments.delta"}function isResponseCustomToolCallInputDeltaChunk(Au){return Au.type==="response.custom_tool_call_input.delta"}function isResponseImageGenerationCallPartialImageChunk(Au){return Au.type==="response.image_generation_call.partial_image"}function isResponseCodeInterpreterCallCodeDeltaChunk(Au){return Au.type==="response.code_interpreter_call_code.delta"}function isResponseCodeInterpreterCallCodeDoneChunk(Au){return Au.type==="response.code_interpreter_call_code.done"}function isResponseApplyPatchCallOperationDiffDeltaChunk(Au){return Au.type==="response.apply_patch_call_operation_diff.delta"}function isResponseApplyPatchCallOperationDiffDoneChunk(Au){return Au.type==="response.apply_patch_call_operation_diff.done"}function isResponseOutputItemAddedChunk(Au){return Au.type==="response.output_item.added"}function isResponseAnnotationAddedChunk(Au){return Au.type==="response.output_text.annotation.added"}function isErrorChunk(Au){return Au.type==="error"}function isResponseOutputChunk(Au){return!(Au.type==="response.created"||Au.type==="response.failed"||Au.type==="error"||Au.type==="unknown_chunk")}function mapWebSearchOutput(Au){var lo;if(Au==null)return{};switch(Au.type){case"search":return{action:{type:"search",query:(lo=Au.query)!=null?lo:void 0,...Au.queries!=null&&{queries:Au.queries}},...Au.sources!=null&&{sources:Au.sources}};case"open_page":return{action:{type:"openPage",url:Au.url}};case"find_in_page":return{action:{type:"findInPage",url:Au.url,pattern:Au.pattern}}}}function escapeJSONDelta(Au){return JSON.stringify(Au).slice(1,-1)}var openaiSpeechModelOptionsSchema=lazySchema(()=>zodSchema(object({instructions:string$2().nullish(),speed:number$2().min(.25).max(4).default(1).nullish()}))),OpenAISpeechModel=class qw{constructor(lo,$u){this.modelId=lo,this.config=$u,this.specificationVersion="v4"}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new qw(lo.modelId,lo.config)}get provider(){return this.config.provider}async getArgs({text:lo,voice:$u="alloy",outputFormat:Ru="mp3",speed:Iu,instructions:Pu,language:Ou,providerOptions:Du}){const Mu=[],Lu=await parseProviderOptions({provider:"openai",providerOptions:Du,schema:openaiSpeechModelOptionsSchema}),Bu={model:this.modelId,input:lo,voice:$u,response_format:"mp3",speed:Iu,instructions:Pu};if(Ru&&(["mp3","opus","aac","flac","wav","pcm"].includes(Ru)?Bu.response_format=Ru:Mu.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${Ru}. Using mp3 instead.`})),Lu){const ju={};for(const Fu in ju){const zu=ju[Fu];zu!==void 0&&(Bu[Fu]=zu)}}return Ou&&Mu.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${Ou}" was ignored.`}),{requestBody:Bu,warnings:Mu}}async doGenerate(lo){var $u,Ru,Iu,Pu,Ou;const Du=(Iu=(Ru=($u=this.config._internal)==null?void 0:$u.currentDate)==null?void 0:Ru.call($u))!=null?Iu:new Date,{requestBody:Mu,warnings:Lu}=await this.getArgs(lo),{value:Bu,responseHeaders:ju,rawValue:Fu}=await postJsonToApi({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:combineHeaders((Ou=(Pu=this.config).headers)==null?void 0:Ou.call(Pu),lo.headers),body:Mu,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createBinaryResponseHandler(),abortSignal:lo.abortSignal,fetch:this.config.fetch});return{audio:Bu,warnings:Lu,request:{body:JSON.stringify(Mu)},response:{timestamp:Du,modelId:this.modelId,headers:ju,body:Fu}}}},openaiTranscriptionResponseSchema=lazySchema(()=>zodSchema(object({text:string$2(),language:string$2().nullish(),duration:number$2().nullish(),words:array(object({word:string$2(),start:number$2(),end:number$2()})).nullish(),segments:array(object({id:number$2(),seek:number$2(),start:number$2(),end:number$2(),text:string$2(),tokens:array(number$2()),temperature:number$2(),avg_logprob:number$2(),compression_ratio:number$2(),no_speech_prob:number$2()})).nullish()}))),openAITranscriptionModelOptions=lazySchema(()=>zodSchema(object({include:array(string$2()).optional(),language:string$2().optional(),prompt:string$2().optional(),temperature:number$2().min(0).max(1).default(0).optional(),timestampGranularities:array(_enum(["word","segment"])).default(["segment"]).optional(),streaming:object({delay:_enum(["minimal","low","medium","high","xhigh"]).optional(),include:array(string$2()).optional()}).optional()})));function isRealtimeTranscriptionModelId(Au){return Au==="gpt-realtime-whisper"||Au.startsWith("gpt-realtime-whisper-")}var languageMap={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},OpenAITranscriptionModel=class Vw{constructor(lo,$u){this.modelId=lo,this.config=$u,this.specificationVersion="v4"}static[WORKFLOW_SERIALIZE](lo){return serializeModelOptions({modelId:lo.modelId,config:lo.config})}static[WORKFLOW_DESERIALIZE](lo){return new Vw(lo.modelId,lo.config)}get provider(){return this.config.provider}async getArgs({audio:lo,mediaType:$u,providerOptions:Ru}){const Iu=[],Pu=await parseProviderOptions({provider:"openai",providerOptions:Ru,schema:openAITranscriptionModelOptions}),Ou=new FormData,Du=lo instanceof Uint8Array?new Blob([lo]):new Blob([convertBase64ToUint8Array(lo)]);Ou.append("model",this.modelId);const Mu=mediaTypeToExtension($u);if(Ou.append("file",new File([Du],"audio",{type:$u}),`audio.${Mu}`),this.modelId==="whisper-1"&&Ou.append("response_format","verbose_json"),Pu){const Lu=["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId),Bu={include:Pu.include,language:Pu.language,prompt:Pu.prompt,...this.modelId!=="whisper-1"&&{response_format:Lu?"json":"verbose_json"},temperature:Pu.temperature,timestamp_granularities:Pu.timestampGranularities};for(const[ju,Fu]of Object.entries(Bu))if(Fu!=null)if(Array.isArray(Fu))for(const zu of Fu)Ou.append(`${ju}[]`,String(zu));else Ou.append(ju,String(Fu))}return{formData:Ou,warnings:Iu}}async doGenerate(lo){var $u,Ru,Iu,Pu,Ou,Du,Mu,Lu,Bu,ju;if(isRealtimeTranscriptionModelId(this.modelId))throw new UnsupportedFunctionalityError({functionality:`non-streaming transcription with ${this.modelId}`});const Fu=(Iu=(Ru=($u=this.config._internal)==null?void 0:$u.currentDate)==null?void 0:Ru.call($u))!=null?Iu:new Date,{formData:zu,warnings:Uu}=await this.getArgs(lo),{value:Hu,responseHeaders:Vu,rawValue:Gu}=await postFormDataToApi({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:combineHeaders((Ou=(Pu=this.config).headers)==null?void 0:Ou.call(Pu),lo.headers),formData:zu,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiTranscriptionResponseSchema),abortSignal:lo.abortSignal,fetch:this.config.fetch}),Wu=Hu.language!=null&&Hu.language in languageMap?languageMap[Hu.language]:void 0;return{text:Hu.text,segments:(Bu=(Lu=(Du=Hu.segments)==null?void 0:Du.map(Zu=>({text:Zu.text,startSecond:Zu.start,endSecond:Zu.end})))!=null?Lu:(Mu=Hu.words)==null?void 0:Mu.map(Zu=>({text:Zu.word,startSecond:Zu.start,endSecond:Zu.end})))!=null?Bu:[],language:Wu,durationInSeconds:(ju=Hu.duration)!=null?ju:void 0,warnings:Uu,response:{timestamp:Fu,modelId:this.modelId,headers:Vu,body:Gu}}}async doStream(lo){var $u,Ru,Iu,Pu,Ou,Du,Mu;if(!isRealtimeTranscriptionModelId(this.modelId))throw new UnsupportedFunctionalityError({functionality:`streaming transcription with ${this.modelId}`});const Lu=(Iu=(Ru=($u=this.config._internal)==null?void 0:$u.currentDate)==null?void 0:Ru.call($u))!=null?Iu:new Date,Bu=await parseProviderOptions({provider:"openai",providerOptions:lo.providerOptions,schema:openAITranscriptionModelOptions}),ju=[],Fu=(Ou=(Pu=lo.providerOptions)==null?void 0:Pu.openai)!=null?Ou:{};for(const Hu of["include","prompt","temperature","timestampGranularities"])Fu[Hu]!=null&&ju.push({type:"unsupported",feature:`providerOptions.openai.${Hu}`,details:`OpenAI streaming transcription does not support ${Hu}.`});const zu=combineHeaders((Mu=(Du=this.config).headers)==null?void 0:Mu.call(Du),lo.headers),Uu=buildOpenAIRealtimeTranscriptionSession({modelId:this.modelId,inputAudioFormat:lo.inputAudioFormat,providerOptions:Bu});return{request:{body:Uu},response:{timestamp:Lu,modelId:this.modelId},stream:createOpenAIRealtimeTranscriptionStream({webSocket:this.config.webSocket,url:toWebSocketUrl(this.config.url({path:"/realtime?intent=transcription",modelId:this.modelId})),headers:zu,sessionUpdate:Uu,language:Bu?.language,warnings:ju,audio:lo.audio,abortSignal:lo.abortSignal,includeRawChunks:lo.includeRawChunks})}}};function createOpenAIRealtimeTranscriptionStream({webSocket:Au,url:lo,headers:$u,sessionUpdate:Ru,language:Iu,warnings:Pu,audio:Ou,abortSignal:Du,includeRawChunks:Mu}){let Lu=!1,Bu=()=>{};return new ReadableStream({start:ju=>{const Fu=getOpenAIRealtimeConnection($u);let zu,Uu;Bu=Wu=>{zu!=null?zu.cancel().catch(()=>{}):Ou.cancel().catch(()=>{}),Uu?.close(Wu)};const Hu=Wu=>{Lu||(Lu=!0,Bu(),ju.error(Wu))},Vu=(Wu,Zu)=>{Lu||(Lu=!0,Zu!=null&&ju.enqueue({type:"transcript-final",id:Zu,text:Wu}),ju.enqueue({type:"finish",text:Wu,segments:[],language:Iu}),ju.close(),Bu(1e3))},Gu=async Wu=>{zu=Ou.getReader();try{for(;;){const{done:Zu,value:Ju}=await zu.read();if(Zu||Lu)break;Wu.send(JSON.stringify({type:"input_audio_buffer.append",audio:convertToBase64(Ju)})),await waitForWebSocketBufferDrain(Wu)}}finally{zu.releaseLock(),zu=void 0}Lu||Wu.send(JSON.stringify({type:"input_audio_buffer.commit"}))};Uu=connectToWebSocket({url:lo,protocols:Fu.protocols,headers:Fu.headers,webSocket:Au,abortSignal:Du,onAbort:Hu,onProcessingError:Hu,onOpen:Wu=>{ju.enqueue({type:"stream-start",warnings:Pu}),Wu.send(JSON.stringify(Ru)),Gu(Wu).catch(Hu)},onMessageText:async Wu=>{var Zu,Ju,Yu,Xu;const ed=await safeParseJSON({text:Wu});if(!ed.success)return;const td=ed.value;switch(Mu&&ju.enqueue({type:"raw",rawValue:td}),td.type){case"conversation.item.input_audio_transcription.delta":{ju.enqueue({type:"transcript-delta",id:td.item_id,delta:(Zu=td.delta)!=null?Zu:""});break}case"conversation.item.input_audio_transcription.completed":{Vu((Ju=td.transcript)!=null?Ju:"",td.item_id);break}case"error":{Hu(new Error((Xu=(Yu=td.error)==null?void 0:Yu.message)!=null?Xu:"OpenAI realtime error"));break}}},onSocketError:()=>{Hu(new Error("OpenAI realtime transcription error"))},onClose:()=>{Lu||(Lu=!0,Bu(),ju.close())}})},cancel:()=>{Lu||(Lu=!0,Bu())}})}function buildOpenAIRealtimeTranscriptionSession({modelId:Au,inputAudioFormat:lo,providerOptions:$u}){var Ru,Iu;return{type:"session.update",session:{type:"transcription",audio:{input:{format:{type:lo.type,...lo.rate!=null?{rate:lo.rate}:{}},transcription:{model:Au,...$u?.language!=null?{language:$u.language}:{},...((Ru=$u?.streaming)==null?void 0:Ru.delay)!=null?{delay:$u.streaming.delay}:{}},turn_detection:null}},...((Iu=$u?.streaming)==null?void 0:Iu.include)!=null?{include:$u.streaming.include}:{}}}}function getOpenAIRealtimeConnection(Au){var lo;let $u;for(const[Iu,Pu]of Object.entries(Au))Iu.toLowerCase()==="authorization"&&Pu!=null&&($u=Pu);const Ru=(lo=$u?.match(/^bearer\s+(.+)$/i))==null?void 0:lo[1];return Ru==null?{protocols:["realtime"],headers:Au}:{protocols:["realtime",`openai-insecure-api-key.${Ru}`],headers:Object.fromEntries(Object.entries(Au).filter(([Iu])=>Iu.toLowerCase()!=="authorization"))}}var openaiSkillResponseSchema=lazySchema(()=>zodSchema(object({id:string$2(),name:string$2().nullish(),description:string$2().nullish(),default_version:string$2().nullish(),latest_version:string$2().nullish(),created_at:number$2(),updated_at:number$2().nullish()}))),OpenAISkills=class{constructor(Au){this.config=Au,this.specificationVersion="v4"}get provider(){return this.config.provider}async uploadSkill(Au){const lo=[];Au.displayTitle!=null&&lo.push({type:"unsupported",feature:"displayTitle"});const $u=new FormData;for(const Iu of Au.files){const Pu=convertInlineFileDataToUint8Array(Iu.data);$u.append("files[]",new Blob([Pu]),Iu.path)}const{value:Ru}=await postFormDataToApi({url:this.config.url({path:"/skills"}),headers:combineHeaders(this.config.headers()),formData:$u,failedResponseHandler:openaiFailedResponseHandler,successfulResponseHandler:createJsonResponseHandler(openaiSkillResponseSchema),fetch:this.config.fetch});return{providerReference:{openai:Ru.id},...Ru.name!=null?{name:Ru.name}:{},...Ru.description!=null?{description:Ru.description}:{},...Ru.latest_version!=null?{latestVersion:Ru.latest_version}:{},providerMetadata:{openai:{...Ru.default_version!=null?{defaultVersion:Ru.default_version}:{},...Ru.created_at!=null?{createdAt:Ru.created_at}:{},...Ru.updated_at!=null?{updatedAt:Ru.updated_at}:{}}},warnings:lo}}},VERSION$1="4.0.20";function createOpenAI(Au={}){var lo,$u;const Ru=(lo=withoutTrailingSlash(validateBaseURL(loadOptionalSetting({settingValue:Au.baseURL,environmentVariableName:"OPENAI_BASE_URL"}))))!=null?lo:"https://api.openai.com/v1",Iu=($u=Au.name)!=null?$u:"openai",Pu=()=>withUserAgentSuffix({Authorization:`Bearer ${loadApiKey({apiKey:Au.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":Au.organization,"OpenAI-Project":Au.project,...Au.headers},`ai-sdk/openai/${VERSION$1}`),Ou=Zu=>new OpenAIChatLanguageModel(Zu,{provider:`${Iu}.chat`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch}),Du=Zu=>new OpenAICompletionLanguageModel(Zu,{provider:`${Iu}.completion`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch}),Mu=Zu=>new OpenAIEmbeddingModel(Zu,{provider:`${Iu}.embedding`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch}),Lu=Zu=>new OpenAIImageModel(Zu,{provider:`${Iu}.image`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch}),Bu=Zu=>new OpenAITranscriptionModel(Zu,{provider:`${Iu}.transcription`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch,webSocket:Au.webSocket}),ju=Zu=>new OpenAISpeechModel(Zu,{provider:`${Iu}.speech`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch}),Fu=()=>new OpenAIFiles({provider:`${Iu}.files`,baseURL:Ru,headers:Pu,fetch:Au.fetch}),zu=()=>new OpenAISkills({provider:`${Iu}.skills`,url:({path:Zu})=>`${Ru}${Zu}`,headers:Pu,fetch:Au.fetch}),Uu=Zu=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return Hu(Zu)},Hu=Zu=>new OpenAIResponsesLanguageModel(Zu,{provider:`${Iu}.responses`,url:({path:Ju})=>`${Ru}${Ju}`,headers:Pu,fetch:Au.fetch,fileIdPrefixes:["file-"]}),Vu=Zu=>new OpenAIRealtimeModel(Zu,{provider:`${Iu}.realtime`,baseURL:Ru,headers:Pu,fetch:Au.fetch}),Gu=Object.assign(Zu=>Vu(Zu),{getToken:async Zu=>{const Yu=await Vu(Zu.model).doCreateClientSecret({sessionConfig:Zu.sessionConfig,expiresAfterSeconds:Zu.expiresAfterSeconds});return{token:Yu.token,url:Yu.url,expiresAt:Yu.expiresAt}}}),Wu=function(Zu){return Uu(Zu)};return Wu.specificationVersion="v4",Wu.languageModel=Uu,Wu.chat=Ou,Wu.completion=Du,Wu.responses=Hu,Wu.embedding=Mu,Wu.embeddingModel=Mu,Wu.textEmbedding=Mu,Wu.textEmbeddingModel=Mu,Wu.image=Lu,Wu.imageModel=Lu,Wu.transcription=Bu,Wu.transcriptionModel=Bu,Wu.speech=ju,Wu.speechModel=ju,Wu.files=Fu,Wu.skills=zu,Wu.experimental_realtime=Gu,Wu.tools=openaiTools,Wu}createOpenAI();const INFERENCE_API_PATH="/api/ai-inference/v1",DEFAULT_BROWSER_MODEL="bedrock:us.anthropic.claude-sonnet-4-6";function browserModelRequiresSignIn(Au){return!Au.token?.trim()}function inferenceApiUrl(Au){const lo=Au.replace(/\/+$/,"");return lo.endsWith(INFERENCE_API_PATH)?lo:`${lo}${INFERENCE_API_PATH}`}function describingFetch(Au,lo){return async($u,Ru)=>{try{return await Au($u,Ru)}catch(Iu){throw new Error(`Could not reach the inference service at ${lo}. Check that this is the right host — the service runs with the control plane, not the runtimes plane — and that it allows this origin. (${Iu instanceof Error?Iu.message:String(Iu)})`,{cause:Iu})}}}function createBrowserModel(Au){const lo=inferenceApiUrl(Au.inferenceUrl);return createOpenAI({name:"datalayer-ai-inference",baseURL:lo,apiKey:Au.token?.trim()||"anonymous",headers:Au.headers,fetch:describingFetch(Au.fetch??globalThis.fetch,lo)}).chat(Au.model||DEFAULT_BROWSER_MODEL)}const DEFAULT_BROWSER_MAX_STEPS=24,DEFAULT_TTL_MS=3e5,RETRY_MS=3e3;let pendingTimer;function readJwtClaims(Au){const lo=Au.split(".")[1];if(lo)try{const $u=lo.replace(/-/g,"+").replace(/_/g,"/"),Ru=$u.padEnd($u.length+(4-$u.length%4)%4,"="),Iu=JSON.parse(atob(Ru));return Iu&&typeof Iu=="object"?Iu:void 0}catch{return}}function tokenLifetimeMs(Au,lo){const $u=readJwtClaims(Au);return $u?.exp&&$u?.iat&&$u.exp>$u.iat?($u.exp-$u.iat)*1e3:lo&&lo>0?lo*1e3:DEFAULT_TTL_MS}async function fetchAnonymousToken(Au,lo){const $u=Au.replace(/\/+$/,""),Ru=await fetch(`${$u}/api/ai-inference/v1/anonymous/token`,{method:"POST",headers:{"Content-Type":"application/json"},signal:lo});if(!Ru.ok)throw new Error(`Anonymous inference token refused by ${$u} (HTTP ${Ru.status})`);const Iu=await Ru.json();if(!Iu.token)throw new Error(`No token in the reply from ${$u}`);const Pu=tokenLifetimeMs(Iu.token,Iu.expires_in);return{token:Iu.token,lifetimeMs:Pu,expiresAt:Date.now()+Pu}}const useAnonymousSessionStore=create$d((Au,lo)=>{const $u=Ru=>{Au({status:"minting",error:void 0}),fetchAnonymousToken(Ru).then(Iu=>{lo().status==="minting"&&(Au({status:"active",token:Iu.token,expiresAt:Iu.expiresAt,grantedMs:Iu.lifetimeMs,error:void 0}),clearTimeout(pendingTimer),pendingTimer=setTimeout(()=>lo().expire(),Math.max(0,Iu.expiresAt-Date.now())))}).catch(Iu=>{if(lo().status!=="minting")return;const Pu=Iu instanceof Error?Iu.message:String(Iu);console.warn("[anonymousToken] could not mint a token",Iu);const Ou=!lo().retried;Au({status:"failed",error:Pu,retried:!0}),Ou&&(clearTimeout(pendingTimer),pendingTimer=setTimeout(()=>{lo().status==="failed"&&$u(Ru)},RETRY_MS))})};return{status:"idle",start:Ru=>{const{status:Iu}=lo();Iu==="idle"&&Ru&&$u(Ru)},expire:()=>{const{status:Ru}=lo();Ru==="idle"||Ru==="expired"||(clearTimeout(pendingTimer),pendingTimer=void 0,Au({status:"expired",token:void 0}))},clear:()=>{lo().status!=="idle"&&(clearTimeout(pendingTimer),pendingTimer=void 0,Au({status:"idle",token:void 0,expiresAt:void 0,grantedMs:void 0,error:void 0,retried:!1}))}}});function useAnonymousSession(){return useAnonymousSessionStore()}function useAnonymousInferenceSession(Au,lo){const $u=useAnonymousSession();return reactExports.useEffect(()=>{const{start:Ru,clear:Iu}=useAnonymousSessionStore.getState();if(lo&&Au){Ru(Au);return}Iu()},[Au,lo]),$u}const SUBAGENT_STOPPED="Stopped.",isObject$3=Au=>!!Au&&typeof Au=="object";function parseAgentStreamMessage(Au){return isObject$3(Au)?typeof Au.type=="string"&&isObject$3(Au.payload)?{version:typeof Au.version=="string"?Au.version:"1.0",type:Au.type,agentId:typeof Au.agentId=="string"?Au.agentId:void 0,timestamp:typeof Au.timestamp=="string"?Au.timestamp:new Date().toISOString(),payload:Au.payload,event:typeof Au.event=="string"?Au.event:void 0,data:Au.data}:typeof Au.event=="string"&&isObject$3(Au.data)?{version:"1.0",type:Au.event,timestamp:new Date().toISOString(),payload:Au.data,event:Au.event,data:Au.data}:null:null}const DEFAULT_SUBAGENT_MAX_STEPS=12,TASK_SCHEMA={type:"object",properties:{task:{type:"string",description:"What to do, stated so that it can be carried out without the rest of this conversation."}},required:["task"]};function subagentTools(Au){const{subagents:lo,inference:$u,model:Ru,sharing:Iu="shared",maxSteps:Pu=DEFAULT_SUBAGENT_MAX_STEPS,tools:Ou,onEvent:Du,signal:Mu}=Au,Lu={};for(const Bu of lo)Lu[Bu.name]={description:Bu.description,inputSchema:jsonSchema$1(TASK_SCHEMA),execute:async(ju,Fu)=>{const{task:zu}=ju??{};if(!zu?.trim())return{error:"A delegated task needs to say what to do."};const Uu=Fu?.toolCallId??null;let Hu=!1;const Vu=Zu=>{if(Zu.phase==="end"||Zu.phase==="error"){if(Hu)return;Hu=!0}Du?.({subagentName:Bu.name,toolCallId:Uu,...Zu})},Gu=new ToolLoopAgent({id:Bu.name,model:createBrowserModel({...$u,model:Bu.model??Ru}),instructions:Bu.instructions,tools:Bu.tools??Ou??{},stopWhen:isStepCount(Pu)}),Wu=anySignal([Fu?.abortSignal,Mu?.()]);Vu({phase:"start",task:zu});try{const Zu=Iu==="shared"?Fu?.messages??[]:[],Ju=await Gu.stream({messages:[...Zu,{role:"user",content:zu}],abortSignal:Wu}),Yu=await relaySubagentRun(Ju.fullStream,Vu,Wu);if(Wu?.aborted)return Vu({phase:"error",error:STOPPED}),{agent:Bu.name,error:STOPPED};const Xu=Yu||await Ju.text;return Vu({phase:"end",output:Xu}),{agent:Bu.name,result:Xu}}catch(Zu){const Ju=Wu?.aborted?STOPPED:Zu instanceof Error?Zu.message:String(Zu);return Vu({phase:"error",error:Ju}),{agent:Bu.name,error:Ju}}},toModelOutput:({output:ju})=>{const Fu=ju;return{type:"text",value:Fu?.error?`${Bu.name} could not finish: ${Fu.error}`:Fu?.result??"Done."}}};return Lu}const STOPPED=SUBAGENT_STOPPED;function anySignal(Au){const lo=Au.filter(Ru=>!!Ru);if(lo.length<=1)return lo[0];if(typeof AbortSignal.any=="function")return AbortSignal.any(lo);const $u=new AbortController;for(const Ru of lo){if(Ru.aborted){$u.abort(Ru.reason);break}Ru.addEventListener("abort",()=>$u.abort(Ru.reason),{once:!0})}return $u.signal}function preview(Au){const lo=typeof Au=="string"?Au:JSON.stringify(Au);return lo.length>400?`${lo.slice(0,400)}…`:lo}async function relaySubagentRun(Au,lo,$u){let Ru="";for await(const Iu of Au){if($u?.aborted)break;switch(Iu.type){case"text-delta":Ru+=Iu.text??"",lo({phase:"text",text:Iu.text??""});break;case"reasoning-delta":lo({phase:"thinking",text:Iu.text??""});break;case"tool-call":lo({phase:"tool_call",toolName:Iu.toolName,toolArgs:Iu.input??{}});break;case"tool-result":lo({phase:"tool_result",toolName:Iu.toolName,result:preview(Iu.output)});break;case"tool-error":lo({phase:"tool_result",toolName:Iu.toolName,result:preview(Iu.error)});break;case"error":lo({phase:"error",error:Iu.error instanceof Error?Iu.error.message:String(Iu.error)});break}}return Ru}function messageText$2(Au){return typeof Au.content=="string"?Au.content:Au.content.map(lo=>typeof lo=="string"?lo:lo.text??"").join("")}function isModelRole(Au){return Au==="user"||Au==="assistant"||Au==="system"}class BrowserAgentAdapter extends BaseProtocolAdapter{protocol="browser-vercel-ai";protocolTransport="http";browserConfig;abortController=null;tools;constructor(lo){super(lo),this.browserConfig=lo;const $u=frontendToolsToVercelAI(lo.frontendTools??[],{onHitlRequired:lo.onHitlRequired,onStatusChange:lo.onStatusChange});this.tools={...$u,...lo.subagents?.length&&lo.inference?subagentTools({subagents:lo.subagents,inference:lo.inference,model:lo.model,sharing:lo.sharing,tools:$u,onEvent:lo.onSubagentEvent,signal:()=>this.abortController?.signal}):{}}}async connect(){this.setConnectionState("connected")}disconnect(){this.abortController?.abort(),this.abortController=null,this.setConnectionState("disconnected")}stopGeneration(){this.abortController?.abort()}supportsFeature(lo){return lo==="tools"}async sendToolResult(){}resolveModel(lo){const{languageModel:$u,inference:Ru,model:Iu}=this.browserConfig;if($u)return $u;if(!Ru)throw new Error("A browser agent needs either a `languageModel` or an `inference` endpoint to reach one.");return createBrowserModel({...Ru,model:lo||Iu})}runModes(lo){const $u=lo?.loop,Ru=$u?.modes??{},Iu=$u?.profile||void 0;if(Object.keys(Ru).length===0&&!Iu)return;const{modeEffect:Pu,languageModel:Ou}=this.browserConfig;if(!Pu)throw new Error("This agent has no modes or profiles: what was chosen in the composer cannot be applied to it.");const Du=Pu(Ru,Iu);if(Du.model&&Ou)throw new Error(`The mode or profile chosen runs on ${Du.model}, and this agent's model is its host's own: it cannot run on another.`);return Du}async sendMessage(lo,$u){this.abortController?.abort();const Ru=new AbortController;this.abortController=Ru;const Iu=($u?.messages??[]).filter(Bu=>isModelRole(Bu.role)).map(Bu=>({role:Bu.role,content:messageText$2(Bu)})).filter(Bu=>Bu.content.length>0),Pu=messageText$2(lo);Pu&&Iu[Iu.length-1]?.content!==Pu&&Iu.push({role:"user",content:Pu});let Ou=null,Du="";const Mu=()=>{Ou=generateMessageId(),Du=""},Lu=()=>{const Bu=createAssistantMessage(Du);Bu.id=Ou,this.emit({type:"message",message:Bu,timestamp:new Date})};try{const Bu=this.runModes($u?.forwardedProps),{instructions:ju}=this.browserConfig,Fu=Bu?.instructions?[ju?.trim(),Bu.instructions].filter(Boolean).join(`
1861
1860
 
1862
- `):ju,zu=streamText({model:this.resolveModel(Bu?.model||$u?.model),system:Fu,messages:Iu,tools:this.tools,stopWhen:isStepCount(this.browserConfig.maxSteps??DEFAULT_BROWSER_MAX_STEPS),abortSignal:Ru.signal});for await(const Uu of zu.fullStream){if(Ru.signal.aborted)break;switch(Uu.type){case"text-start":Mu();break;case"text-delta":Ou===null&&Mu(),Du+=Uu.text,Lu();break;case"tool-call":this.emit({type:"tool-call",toolCall:{toolCallId:Uu.toolCallId,toolName:Uu.toolName,args:Uu.input??{},argsComplete:!0},timestamp:new Date});break;case"tool-result":this.emit({type:"tool-result",toolResult:{toolCallId:Uu.toolCallId,success:!0,result:Uu.output},timestamp:new Date});break;case"tool-error":this.emit({type:"tool-result",toolResult:{toolCallId:Uu.toolCallId,success:!1,error:Uu.error instanceof Error?Uu.error.message:String(Uu.error)},timestamp:new Date});break;case"error":this.emit({type:"error",error:Uu.error instanceof Error?Uu.error:new Error(String(Uu.error)),timestamp:new Date});break;case"finish":{const Hu=Uu.totalUsage,Vu=Hu?.inputTokens??0,Gu=Hu?.outputTokens??0,Wu=Hu?.totalTokens??(Vu+Gu>0?Vu+Gu:void 0);this.emit({type:"done",usage:{promptTokens:Vu,completionTokens:Gu,totalTokens:Wu},timestamp:new Date});break}default:break}}}catch(Bu){if(Ru.signal.aborted)return;this.emit({type:"error",error:Bu instanceof Error?Bu:new Error(String(Bu)),timestamp:new Date}),this.emit({type:"done",timestamp:new Date})}finally{this.abortController===Ru&&(this.abortController=null)}}}const AGENT_METHODS={authenticate:"authenticate",initialize:"initialize",session_cancel:"session/cancel",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},CLIENT_METHODS={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},PROTOCOL_VERSION=1,zAuthMethod=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),id:string$2(),name:string$2()}),zAuthenticateRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),methodId:string$2()}),zAuthenticateResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zBlobResourceContents=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),blob:string$2(),mimeType:union([string$2(),_null()]).optional(),uri:string$2()}),zCreateTerminalResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),terminalId:string$2()}),zDiff=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),newText:string$2(),oldText:union([string$2(),_null()]).optional(),path:string$2()}),zEnvVariable=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),value:string$2()}),zErrorCode=union([literal(-32700),literal(-32600),literal(-32601),literal(-32602),literal(-32603),literal(-32e3),literal(-32002),number$2().int()]),zError=object({code:zErrorCode,data:unknown$1().optional(),message:string$2()}),zExtNotification=unknown$1(),zExtRequest=unknown$1(),zExtResponse=unknown$1(),zFileSystemCapability=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),readTextFile:boolean$1().optional().default(!1),writeTextFile:boolean$1().optional().default(!1)}),zClientCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),fs:zFileSystemCapability.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:boolean$1().optional().default(!1)}),zHttpHeader=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),value:string$2()}),zImplementation=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),title:union([string$2(),_null()]).optional(),version:string$2()}),zKillTerminalCommandResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zListSessionsRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cursor:union([string$2(),_null()]).optional(),cwd:union([string$2(),_null()]).optional()}),zMcpCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),http:boolean$1().optional().default(!1),sse:boolean$1().optional().default(!1)}),zMcpServerHttp=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),headers:array(zHttpHeader),name:string$2(),url:string$2()}),zMcpServerSse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),headers:array(zHttpHeader),name:string$2(),url:string$2()}),zMcpServerStdio=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),args:array(string$2()),command:string$2(),env:array(zEnvVariable),name:string$2()}),zMcpServer=union([zMcpServerHttp.and(object({type:literal("http")})),zMcpServerSse.and(object({type:literal("sse")})),zMcpServerStdio]),zModelId=string$2(),zModelInfo=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),modelId:zModelId,name:string$2()}),zNewSessionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),mcpServers:array(zMcpServer)}),zPermissionOptionId=string$2(),zPermissionOptionKind=union([literal("allow_once"),literal("allow_always"),literal("reject_once"),literal("reject_always")]),zPermissionOption=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),kind:zPermissionOptionKind,name:string$2(),optionId:zPermissionOptionId}),zPlanEntryPriority=union([literal("high"),literal("medium"),literal("low")]),zPlanEntryStatus=union([literal("pending"),literal("in_progress"),literal("completed")]),zPlanEntry=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2(),priority:zPlanEntryPriority,status:zPlanEntryStatus}),zPlan=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),entries:array(zPlanEntry)}),zPromptCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),audio:boolean$1().optional().default(!1),embeddedContext:boolean$1().optional().default(!1),image:boolean$1().optional().default(!1)}),zProtocolVersion=number$2().int().gte(0).lte(65535),zInitializeRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),clientCapabilities:zClientCapabilities.optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:union([zImplementation,_null()]).optional(),protocolVersion:zProtocolVersion}),zReadTextFileResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2()}),zReleaseTerminalResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zRequestId=union([_null(),bigint(),string$2()]),zRole=_enum(["assistant","user"]),zAnnotations=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),audience:union([array(zRole),_null()]).optional(),lastModified:union([string$2(),_null()]).optional(),priority:union([number$2(),_null()]).optional()}),zAudioContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),data:string$2(),mimeType:string$2()}),zImageContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),data:string$2(),mimeType:string$2(),uri:union([string$2(),_null()]).optional()}),zResourceLink=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),description:union([string$2(),_null()]).optional(),mimeType:union([string$2(),_null()]).optional(),name:string$2(),size:union([bigint(),_null()]).optional(),title:union([string$2(),_null()]).optional(),uri:string$2()}),zSelectedPermissionOutcome=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),optionId:zPermissionOptionId}),zRequestPermissionOutcome=union([object({outcome:literal("cancelled")}),zSelectedPermissionOutcome.and(object({outcome:literal("selected")}))]),zRequestPermissionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),outcome:zRequestPermissionOutcome}),zSessionForkCapabilities=object({_meta:unknown$1().optional()}),zSessionId=string$2(),zCancelNotification=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId});object({method:string$2(),params:union([union([zCancelNotification,zExtNotification]),_null()]).optional()});const zCreateTerminalRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),args:array(string$2()).optional(),command:string$2(),cwd:union([string$2(),_null()]).optional(),env:array(zEnvVariable).optional(),outputByteLimit:union([number$2().int().gte(0),_null()]).optional(),sessionId:zSessionId}),zForkSessionRequest=object({_meta:unknown$1().optional(),sessionId:zSessionId}),zKillTerminalCommandRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zLoadSessionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),mcpServers:array(zMcpServer),sessionId:zSessionId}),zReadTextFileRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),limit:union([number$2().int().gte(0),_null()]).optional(),line:union([number$2().int().gte(0),_null()]).optional(),path:string$2(),sessionId:zSessionId}),zReleaseTerminalRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zSessionInfo=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),sessionId:zSessionId,title:union([string$2(),_null()]).optional(),updatedAt:union([string$2(),_null()]).optional()}),zListSessionsResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),nextCursor:union([string$2(),_null()]).optional(),sessions:array(zSessionInfo)}),zSessionListCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zSessionCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),fork:union([zSessionForkCapabilities,_null()]).optional(),list:union([zSessionListCapabilities,_null()]).optional()}),zAgentCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),loadSession:boolean$1().optional().default(!1),mcpCapabilities:zMcpCapabilities.optional().default({http:!1,sse:!1}),promptCapabilities:zPromptCapabilities.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:zSessionCapabilities.optional().default({})}),zInitializeResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),agentCapabilities:zAgentCapabilities.optional().default({loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:union([zImplementation,_null()]).optional(),authMethods:array(zAuthMethod).optional().default([]),protocolVersion:zProtocolVersion}),zSessionModeId=string$2(),zCurrentModeUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),currentModeId:zSessionModeId}),zSessionMode=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),id:zSessionModeId,name:string$2()}),zSessionModeState=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableModes:array(zSessionMode),currentModeId:zSessionModeId}),zSessionModelState=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableModels:array(zModelInfo),currentModelId:zModelId}),zForkSessionResponse=object({_meta:unknown$1().optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional(),sessionId:zSessionId}),zLoadSessionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional()}),zNewSessionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional(),sessionId:zSessionId}),zSetSessionModeRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),modeId:zSessionModeId,sessionId:zSessionId}),zSetSessionModeResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zSetSessionModelRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),modelId:zModelId,sessionId:zSessionId}),zSetSessionModelResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zStopReason=union([literal("end_turn"),literal("max_tokens"),literal("max_turn_requests"),literal("refusal"),literal("cancelled")]),zPromptResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),stopReason:zStopReason});union([object({id:zRequestId,result:union([zInitializeResponse,zAuthenticateResponse,zNewSessionResponse,zLoadSessionResponse,zListSessionsResponse,zForkSessionResponse,zSetSessionModeResponse,zPromptResponse,zSetSessionModelResponse,zExtResponse])}),object({error:zError,id:zRequestId})]);const zTerminal=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),terminalId:string$2()}),zTerminalExitStatus=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitCode:union([number$2().int().gte(0),_null()]).optional(),signal:union([string$2(),_null()]).optional()}),zTerminalOutputRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zTerminalOutputResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitStatus:union([zTerminalExitStatus,_null()]).optional(),output:string$2(),truncated:boolean$1()}),zTextContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),text:string$2()}),zTextResourceContents=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),mimeType:union([string$2(),_null()]).optional(),text:string$2(),uri:string$2()}),zEmbeddedResourceResource=union([zTextResourceContents,zBlobResourceContents]),zEmbeddedResource=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),resource:zEmbeddedResourceResource}),zContentBlock=union([zTextContent.and(object({type:literal("text")})),zImageContent.and(object({type:literal("image")})),zAudioContent.and(object({type:literal("audio")})),zResourceLink.and(object({type:literal("resource_link")})),zEmbeddedResource.and(object({type:literal("resource")}))]),zContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:zContentBlock}),zContentChunk=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:zContentBlock}),zPromptRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),prompt:array(zContentBlock),sessionId:zSessionId});object({id:zRequestId,method:string$2(),params:union([union([zInitializeRequest,zAuthenticateRequest,zNewSessionRequest,zLoadSessionRequest,zListSessionsRequest,zForkSessionRequest,zSetSessionModeRequest,zPromptRequest,zSetSessionModelRequest,zExtRequest]),_null()]).optional()});const zToolCallContent=union([zContent.and(object({type:literal("content")})),zDiff.and(object({type:literal("diff")})),zTerminal.and(object({type:literal("terminal")}))]),zToolCallId=string$2(),zToolCallLocation=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),line:union([number$2().int().gte(0),_null()]).optional(),path:string$2()}),zToolCallStatus=union([literal("pending"),literal("in_progress"),literal("completed"),literal("failed")]),zToolKind=union([literal("read"),literal("edit"),literal("delete"),literal("move"),literal("search"),literal("execute"),literal("think"),literal("fetch"),literal("switch_mode"),literal("other")]),zToolCall=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:array(zToolCallContent).optional(),kind:zToolKind.optional(),locations:array(zToolCallLocation).optional(),rawInput:unknown$1().optional(),rawOutput:unknown$1().optional(),status:zToolCallStatus.optional(),title:string$2(),toolCallId:zToolCallId}),zToolCallUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:union([array(zToolCallContent),_null()]).optional(),kind:union([zToolKind,_null()]).optional(),locations:union([array(zToolCallLocation),_null()]).optional(),rawInput:unknown$1().optional(),rawOutput:unknown$1().optional(),status:union([zToolCallStatus,_null()]).optional(),title:union([string$2(),_null()]).optional(),toolCallId:zToolCallId}),zRequestPermissionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),options:array(zPermissionOption),sessionId:zSessionId,toolCall:zToolCallUpdate}),zUnstructuredCommandInput=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),hint:string$2()}),zAvailableCommandInput=zUnstructuredCommandInput,zAvailableCommand=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:string$2(),input:union([zAvailableCommandInput,_null()]).optional(),name:string$2()}),zAvailableCommandsUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableCommands:array(zAvailableCommand)}),zSessionUpdate=union([zContentChunk.and(object({sessionUpdate:literal("user_message_chunk")})),zContentChunk.and(object({sessionUpdate:literal("agent_message_chunk")})),zContentChunk.and(object({sessionUpdate:literal("agent_thought_chunk")})),zToolCall.and(object({sessionUpdate:literal("tool_call")})),zToolCallUpdate.and(object({sessionUpdate:literal("tool_call_update")})),zPlan.and(object({sessionUpdate:literal("plan")})),zAvailableCommandsUpdate.and(object({sessionUpdate:literal("available_commands_update")})),zCurrentModeUpdate.and(object({sessionUpdate:literal("current_mode_update")}))]),zSessionNotification=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,update:zSessionUpdate});object({method:string$2(),params:union([union([zSessionNotification,zExtNotification]),_null()]).optional()});const zWaitForTerminalExitRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zWaitForTerminalExitResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitCode:union([number$2().int().gte(0),_null()]).optional(),signal:union([string$2(),_null()]).optional()}),zWriteTextFileRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2(),path:string$2(),sessionId:zSessionId});object({id:zRequestId,method:string$2(),params:union([union([zWriteTextFileRequest,zReadTextFileRequest,zRequestPermissionRequest,zCreateTerminalRequest,zTerminalOutputRequest,zReleaseTerminalRequest,zWaitForTerminalExitRequest,zKillTerminalCommandRequest,zExtRequest]),_null()]).optional()});const zWriteTextFileResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()});union([object({id:zRequestId,result:union([zWriteTextFileResponse,zReadTextFileResponse,zRequestPermissionResponse,zCreateTerminalResponse,zTerminalOutputResponse,zReleaseTerminalResponse,zWaitForTerminalExitResponse,zKillTerminalCommandResponse,zExtResponse])}),object({error:zError,id:zRequestId})]);class ACPAdapter extends BaseProtocolAdapter{protocol="acp";protocolTransport="websocket";acpConfig;ws=null;session=null;agent=null;streamingContent="";streamingMessageId=null;pendingPermission=null;pendingRequests=new Map;constructor(lo){super(lo),this.acpConfig=lo}getSession(){return this.session}getAgent(){return this.agent}getPendingPermission(){return this.pendingPermission}async connect(){if(this.ws?.readyState!==WebSocket.OPEN)return this.setConnectionState("connecting"),new Promise((lo,$u)=>{try{const Ru=this.acpConfig.wsUrl||this.config.baseUrl,Iu=this.config.agentId,Pu=Iu?`${Ru}/${Iu}`:Ru;this.ws=new WebSocket(Pu),this.ws.onopen=async()=>{this.reconnectAttempts=0;try{const Ou=await this.sendRequest("initialize",{protocolVersion:PROTOCOL_VERSION,clientCapabilities:this.acpConfig.clientCapabilities||{fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}});Ou.agentCapabilities?.agent&&(this.agent=Ou.agentCapabilities.agent);const Du=await this.sendRequest(AGENT_METHODS.session_new,{});Du.sessionId?this.session={sessionId:Du.sessionId,agentId:this.config.agentId||"",createdAt:new Date().toISOString(),status:"active"}:Ou.session_id&&(this.session={sessionId:Ou.session_id,agentId:this.config.agentId||"",createdAt:new Date().toISOString(),status:"active"}),this.setConnectionState("connected"),lo()}catch(Ou){console.error("[ACPAdapter] Initialization error:",Ou),this.setConnectionState("connected"),lo()}},this.ws.onmessage=Ou=>{this.handleMessage(Ou)},this.ws.onerror=Ou=>{console.error("[ACPAdapter] WebSocket error:",Ou),this.emit({type:"error",error:new Error("WebSocket error"),timestamp:new Date})},this.ws.onclose=()=>{this.ws=null,this.setConnectionState("disconnected"),this.handleReconnect()}}catch(Ru){this.setConnectionState("error"),this.emit({type:"error",error:Ru instanceof Error?Ru:new Error(String(Ru)),timestamp:new Date}),$u(Ru)}})}disconnect(){this.session&&this.ws&&this.ws.readyState===WebSocket.OPEN&&this.terminateSession(this.session.sessionId).catch(lo=>{console.warn("[ACPAdapter] Failed to terminate session:",lo)});for(const[,{reject:lo}]of this.pendingRequests)lo(new Error("Connection closed"));this.pendingRequests.clear(),this.ws&&(this.ws.close(),this.ws=null),this.session=null,this.agent=null,this.pendingPermission=null,this.setConnectionState("disconnected")}async terminateSession(lo){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("[ACPAdapter] Cannot terminate: WebSocket not connected");return}try{const $u=lo||this.session?.sessionId;if(!$u){console.warn("[ACPAdapter] Cannot terminate: No session ID");return}const Ru={jsonrpc:"2.0",method:"session/cancel",params:{sessionId:$u}};this.ws.send(JSON.stringify(Ru)),console.debug("[ACPAdapter] Sent session/cancel for:",$u)}catch($u){console.debug("[ACPAdapter] Terminate request error:",$u)}}async sendMessage(lo,$u){if(!this.session)throw new Error("No active session");this.streamingContent="",this.streamingMessageId=generateMessageId();try{const Ru=typeof lo.content=="string"?lo.content:lo.content.filter(Pu=>Pu.type==="text").map(Pu=>Pu.text||"").join("");$u?.model&&console.log("[ACPAdapter] Sending with model:",$u.model),$u?.identities&&$u.identities.length>0&&console.log("[ACPAdapter] Sending with identities:",$u.identities.map(Pu=>Pu.provider));const Iu={};$u?.model&&(Iu.model=$u.model),$u?.identities&&$u.identities.length>0&&(Iu.identities=$u.identities),await this.sendRequest(AGENT_METHODS.session_prompt,{sessionId:this.session.sessionId,prompt:[{type:"text",text:Ru}],...Object.keys(Iu).length>0&&{metadata:Iu}})}catch(Ru){throw this.emit({type:"error",error:Ru instanceof Error?Ru:new Error(String(Ru)),timestamp:new Date}),Ru}}async sendToolResult(lo,$u){if(!this.session)throw new Error("No active session");this.emit({type:"tool-result",toolResult:$u,timestamp:new Date}),this.pendingPermission&&this.grantPermission()}grantPermission(lo){if(this.pendingPermission){const $u=lo||this.pendingPermission.options[0]?.optionId||"allow";this.sendResponse(this.pendingPermission.requestId,{outcome:{outcome:"selected",optionId:$u}}),this.pendingPermission=null}}denyPermission(){this.pendingPermission&&(this.sendResponse(this.pendingPermission.requestId,{outcome:{outcome:"cancelled"}}),this.pendingPermission=null)}supportsFeature(lo){return["streaming","tools","permissions","session-management","bidirectional"].includes(lo)}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}async sendRequest(lo,$u={}){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("Not connected to agent");const Ru=this.generateId(),Iu={jsonrpc:"2.0",id:Ru,method:lo,params:$u};return new Promise((Pu,Ou)=>{this.pendingRequests.set(Ru,{resolve:Pu,reject:Ou}),this.ws&&this.ws.send(JSON.stringify(Iu)),setTimeout(()=>{this.pendingRequests.has(Ru)&&(this.pendingRequests.delete(Ru),Ou(new Error("Request timeout")))},this.config.timeout||3e4)})}sendResponse(lo,$u){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("[ACPAdapter] Cannot send response: not connected");return}const Ru={jsonrpc:"2.0",id:lo,result:$u};this.ws.send(JSON.stringify(Ru))}handleMessage(lo){try{const $u=JSON.parse(lo.data);if($u.id&&this.pendingRequests.has($u.id)){const Ru=this.pendingRequests.get($u.id);if(!Ru)return;const{resolve:Iu,reject:Pu}=Ru;this.pendingRequests.delete($u.id),$u.error?Pu(new Error($u.error.message)):Iu($u.result),$u.result&&typeof $u.result=="object"&&"stopReason"in $u.result&&this.handleCompletion($u.result);return}if($u.method==="session/update"){this.handleSessionUpdate($u.params||{});return}if($u.method===CLIENT_METHODS.session_request_permission&&$u.id){this.handlePermissionRequest($u.id,$u.params);return}$u.result&&typeof $u.result=="object"&&"stopReason"in $u.result&&this.handleCompletion($u.result)}catch($u){console.error("[ACPAdapter] Failed to parse message:",$u)}}handleSessionUpdate(lo){const $u=lo.update;if(!$u)return;const Ru=$u.sessionUpdate,Iu=Pu=>Pu&&typeof Pu=="object"&&Pu.type==="text"?String(Pu.text??""):"";if(Ru==="agent_message_chunk"){const Pu=Iu($u.content);if(Pu){this.streamingContent+=Pu;const Ou=createAssistantMessage(this.streamingContent);this.streamingMessageId&&(Ou.id=this.streamingMessageId),this.emit({type:"message",message:Ou,timestamp:new Date})}}if(Ru==="tool_call"){const Pu=$u;this.emit({type:"tool-call",toolCall:{toolCallId:Pu.toolCallId||generateMessageId(),toolName:Pu.title||"",args:Pu.rawInput||{}},timestamp:new Date})}if(Ru==="tool_call_update"){const Pu=$u;(Pu.status==="completed"||Pu.status==="failed")&&this.emit({type:"tool-result",toolResult:{toolCallId:Pu.toolCallId??"",success:Pu.status==="completed",result:Pu.rawOutput},timestamp:new Date})}if(Ru==="agent_thought_chunk"){const Pu=Iu($u.content);Pu&&this.emit({type:"activity",activity:{type:"thought",data:Pu},timestamp:new Date})}}handlePermissionRequest(lo,$u){this.pendingPermission={requestId:lo,sessionId:$u.sessionId,toolCall:$u.toolCall,options:$u.options},this.emit({type:"tool-call",toolCall:{toolCallId:$u.toolCall.toolCallId,toolName:$u.toolCall.title||"",args:$u.toolCall.rawInput||{}},timestamp:new Date}),this.acpConfig.onPermissionRequest?.(this.pendingPermission)}handleCompletion(lo){if(this.streamingContent){const $u=createAssistantMessage(this.streamingContent);$u.id=this.streamingMessageId||generateMessageId(),this.emit({type:"message",message:$u,timestamp:new Date}),this.streamingContent="",this.streamingMessageId=null}this.emit({type:"activity",activity:{type:"completed",data:{stopReason:lo.stopReason}},timestamp:new Date})}}const internalQueryClient=new QueryClient({defaultOptions:{queries:{staleTime:300*1e3,refetchOnWindowFocus:!1}}});function isToolCallMessage(Au){return"type"in Au&&Au.type==="tool-call"}function getMessageText(Au){const lo=typeof Au.content=="string"?Au.content:Au.content.filter($u=>$u.type==="text").map($u=>$u.text).join("");return Au.role==="assistant"?sanitizeAssistantContent(lo):lo}function formatTokenCount(Au){return Au>=1e6?`${(Au/1e6).toFixed(1)}M`:Au>=1e3?`${(Au/1e3).toFixed(1)}K`:Au.toString()}function getApiBaseFromConfig(Au){return Au.replace(/\/(config|configure)\/?$/,"")}function createProtocolAdapter(Au){const lo={protocol:Au.type,baseUrl:Au.endpoint,authToken:Au.authToken,agentId:Au.agentId,...Au.options};switch(Au.type){case"ag-ui":if(Au.ownRoutesOnly&&!Au.appSessions)throw new Error("A chat whose runtime answers only the application’s own routes is an application’s: it needs its sessions (appSessions).");return new AGUIAdapter({...lo,...Au.appSessions?{appSessions:Au.appSessions}:{}});case"a2a":return new A2AAdapter(lo);case"vercel-ai":return new VercelAIAdapter(lo);case"acp":return new ACPAdapter(lo);case"browser-vercel-ai":return new BrowserAgentAdapter(lo);default:return console.warn(`[ChatBase] Unknown protocol type: ${Au.type}`),null}}const PAP_SIGN_IN_WORDS={title:Au=>`Sign in at ${Au}`,titleFor:(Au,lo,$u)=>`Sign in to ${Au} (${lo}) at ${$u}`,direct:"Open the company’s page through Datalayer, sign in there, and this conversation goes on once you are back.",device:"Open the company’s page and enter this code there.",mediatedTitle:Au=>`Sign in through ${Au}`,mediatedTitleFor:(Au,lo,$u)=>`Sign in to ${Au} (${lo}) through ${$u}`,mediated:"Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.",sentTo:Au=>`The company sent a code to ${Au}.`,needs:Au=>`It needs: ${Au.join(", ")}.`,open:Au=>`Open ${Au}`,code:"Your code",copy:"Copy the code",copied:"Copied",until:Au=>`Until ${new Date(Au).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}.`,checkAgain:"I have signed in: check again",tellMe:"Tell me when you are done.",checkMessage:Au=>`I have signed in at ${Au}. Please check again.`,refused:"This sign-in link cannot be opened safely, so it is not shown.",qr:Au=>`A code to scan to open ${Au} on your phone`,returned:{signed_in:Au=>`Signed in at ${Au}: checking again.`,denied:Au=>`You did not sign in at ${Au}: ask again when you want to.`,refused:Au=>`That sign-in at ${Au} was refused, and nothing was kept: start it again here.`}},PAP_SIGN_IN_CHANNEL="datalayer-pap-sign-in",SCOPE$1=/^[\x21\x23-\x5B\x5D-\x7E]{1,128}$/,DOMAIN=/^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function signInReturnOf(Au,lo){if(!Au||typeof Au!="object"||Array.isArray(Au))return null;const $u=Au,Ru=$u.outcome;return $u.company===lo&&(Ru==="signed_in"||Ru==="denied"||Ru==="refused")?Ru:null}const PAP_SIGN_IN_TOOL=/(^|[_.:\-/])pa(?:p|ct)_sign_in$/,isPapSignInTool=Au=>PAP_SIGN_IN_TOOL.test(Au);function unwrapped(Au){let lo=Au;if(typeof lo=="string")try{lo=JSON.parse(lo)}catch{return null}if(!lo||typeof lo!="object"||Array.isArray(lo))return null;const $u=lo;if($u.structuredContent&&typeof $u.structuredContent=="object")return unwrapped($u.structuredContent);if(Array.isArray($u.content)){const Ru=$u.content.find(Iu=>Iu?.type==="text"&&typeof Iu.text=="string");return Ru?unwrapped(Ru.text):null}return $u.result&&typeof $u.result=="object"&&!("status"in $u)?unwrapped($u.result):$u}function safeSignInUrl(Au){if(typeof Au!="string")return null;try{const lo=new URL(Au);return lo.protocol==="https:"&&lo.hostname?lo:null}catch{return null}}function readPapSignIn(Au){const lo=unwrapped(Au);if(!lo||lo.status!=="waiting_for_the_person"||lo.mode!=="direct"&&lo.mode!=="device"&&lo.mode!=="mediated")return null;const $u=safeSignInUrl(lo.open);if(!$u)return{refused:PAP_SIGN_IN_WORDS.refused};if(lo.mode==="device"&&(typeof lo.code!="string"||!lo.code))return null;const Ru=typeof lo.company=="string"&&DOMAIN.test(lo.company)?lo.company:"",Iu=typeof lo.organization_name=="string"?lo.organization_name.trim().slice(0,200):"",Pu=typeof lo.organization_domain=="string"&&DOMAIN.test(lo.organization_domain.toLowerCase())?lo.organization_domain.toLowerCase():"",Ou=Iu&&Pu?{name:Iu,domain:Pu}:void 0,Du=Array.isArray(lo.needs)?lo.needs.filter(Mu=>typeof Mu=="string"&&SCOPE$1.test(Mu)):[];return{mode:lo.mode,open:$u.toString(),host:$u.hostname,...Ru?{company:Ru}:{},...Ou?{organization:Ou}:{},...typeof lo.code=="string"&&lo.code?{code:lo.code}:{},...lo.mode==="mediated"&&typeof lo.sent_to=="string"&&lo.sent_to?{sentTo:lo.sent_to}:{},...typeof lo.expires_at=="string"&&lo.expires_at?{expiresAt:lo.expires_at}:{},...Du.length>0?{needs:Du}:{}}}const PAP_SIGN_IN_TYPE$1="application/vnd.datalayer.pap.sign-in+json",PAP_CONFIRM_TYPE="application/vnd.datalayer.pap.confirm+json",PAP_REPLIES_TYPE="application/vnd.datalayer.pap.replies+json",SHIELD_DIFF_TYPE="application/vnd.datalayer.shield.diff+json",SHIELD_TERMINAL_TYPE="application/vnd.datalayer.shield.terminal+json",DISPLAY_META_KEY="reactor.ui/display",record$1=Au=>Au&&typeof Au=="object"&&!Array.isArray(Au)?Au:null,text$h=Au=>typeof Au=="string"?Au:"",words=Au=>text$h(Au).trim(),ACTIONS=["read","write","send","buy","delete","publish"],STATUSES=["working","idle","queued","closed"],who=Au=>Au==="agent"||Au==="human"?Au:null;function protocolDisplayOf(Au){const lo=record$1(Au);if(!lo||!text$h(lo.type))return null;const $u=text$h(lo.id),Ru=record$1(lo.data)??{},Iu={kind:"unknown",id:$u,type:text$h(lo.type),version:typeof lo.version=="number"?lo.version:0,text:text$h(lo.text)};switch(lo.type){case PAP_SIGN_IN_TYPE$1:{const Pu=readPapSignIn({status:"waiting_for_the_person",...Ru});return Pu?"refused"in Pu?{kind:"sign-in-refused",id:$u,why:Pu.refused}:{kind:"sign-in",id:$u,...Pu}:Iu}case PAP_CONFIRM_TYPE:{const Pu=words(Ru.company),Ou=text$h(Ru.summary),Du=words(Ru.operation_ref),Mu=words(Ru.revision),Lu=record$1(Ru.terms),Bu=record$1(Ru.was),ju=Bu?words(Bu.revision):"",Fu=words(Ru.expires_at);if(!Pu||!Ou.trim()||!Du||!Mu||!Lu||!Fu||!Array.isArray(Ru.differences)||!$u.endsWith("-confirm")||Bu&&(!ju||ju===Mu))return Iu;const zu=Ru.does===null||Ru.does===void 0?null:ACTIONS.find(Hu=>Hu===Ru.does);if(zu===void 0)return Iu;const Uu=record$1(Ru.session);return{kind:"confirm",id:$u,approvalId:$u.slice(0,-8),company:Pu,summary:Ou,terms:Lu,operationRef:Du,revision:Mu,does:zu,signedIn:Uu&&typeof Uu.signed_in=="boolean"?Uu.signed_in:null,expiresAt:Fu,differences:Ru.differences.map(text$h),was:Bu?{revision:ju,terms:record$1(Bu.terms)??{}}:null}}case PAP_REPLIES_TYPE:{const Pu=words(Ru.company),Ou=text$h(Ru.conversation),Du=Array.isArray(Ru.replies)?Ru.replies.map(record$1).map(Mu=>({author:who(Mu?.author),name:words(Mu?.name)||null,text:text$h(Mu?.text)})):[];return!Pu||!/^[A-Za-z0-9_-]{1,256}$/.test(Ou)||!Du.length||Du.some(Mu=>!Mu.author||!Mu.text.trim())?Iu:{kind:"replies",id:$u,company:Pu,conversation:Ou,replies:Du,status:STATUSES.find(Mu=>Mu===Ru.status)??null,responder:who(Ru.responder)}}case SHIELD_DIFF_TYPE:{const Pu=words(Ru.path);return!Pu||typeof Ru.new_text!="string"||!(Ru.old_text===null||Ru.old_text===void 0||typeof Ru.old_text=="string")?Iu:{kind:"diff",id:$u,path:Pu,oldText:typeof Ru.old_text=="string"?Ru.old_text:null,newText:Ru.new_text,language:words(Ru.language)||languageOf$1(Pu)}}case SHIELD_TERMINAL_TYPE:{const Pu=words(Ru.terminal_id);if(!Pu)return Iu;const Ou=typeof Ru.exit_code=="number"&&Number.isInteger(Ru.exit_code)?Ru.exit_code:null;return Ru.exit_code!==null&&Ru.exit_code!==void 0&&Ou===null?Iu:{kind:"terminal",id:$u,terminalId:Pu,command:text$h(Ru.command),output:text$h(Ru.output),exitCode:Ou,released:Ru.released===!0}}default:return Iu}}const PAP_HANDOFF_TOOL=/(^|[_.:\-/])pap_handoff$/;function displayOfToolResult(Au,lo,$u=""){const Ru=record$1(lo),Iu=record$1(Ru?._meta)?.[DISPLAY_META_KEY];if(Iu!==void 0)return protocolDisplayOf(Iu);if(isPapSignInTool(Au)){const Pu=readPapSignIn(lo);return Pu?"refused"in Pu?{kind:"sign-in-refused",id:$u,why:Pu.refused}:{kind:"sign-in",id:$u,...Pu}:null}if(PAP_HANDOFF_TOOL.test(Au)&&Ru){const Pu=text$h(Ru.status);return Pu?{kind:"handoff",id:$u,handed:Pu!=="closed"&&Pu!=="direct_conversation_open",responder:who(Ru.responder),note:text$h(Ru.note)}:null}return null}function displayLine(Au){switch(Au.kind){case"sign-in":return Au.mode==="mediated"?`Sign in through ${Au.host}`:`Sign in at ${Au.company||Au.host}`;case"sign-in-refused":return Au.why;case"confirm":return`${Au.company} asks you to approve: ${Au.summary} (revision ${Au.revision})`;case"replies":return`${Au.company} answered${Au.responder==="human"?": one of its people is answering":""}`;case"handoff":return Au.handed?`Handed to ${Au.responder==="human"?"one of the company’s people":"the company"}`:Au.note||"Nothing was handed over.";case"diff":{const lo=countLines(Au.newText);return Au.oldText===null?`Wrote ${Au.path} (${lo} lines)`:`Changed ${Au.path} (+${lo} −${countLines(Au.oldText)} lines)`}case"terminal":{const lo=Au.command?`Ran \`${Au.command}\``:`Terminal ${Au.terminalId}`;return Au.exitCode===null?`${lo}: running`:`${lo}: exit ${Au.exitCode}`}case"unknown":return Au.text||`A display this app cannot draw (${Au.type})`}}const countLines=Au=>Au===""?0:Au.split(`
1861
+ `):ju,zu=streamText({model:this.resolveModel(Bu?.model||$u?.model),system:Fu,messages:Iu,tools:this.tools,stopWhen:isStepCount(this.browserConfig.maxSteps??DEFAULT_BROWSER_MAX_STEPS),abortSignal:Ru.signal});for await(const Uu of zu.fullStream){if(Ru.signal.aborted)break;switch(Uu.type){case"text-start":Mu();break;case"text-delta":Ou===null&&Mu(),Du+=Uu.text,Lu();break;case"tool-call":this.emit({type:"tool-call",toolCall:{toolCallId:Uu.toolCallId,toolName:Uu.toolName,args:Uu.input??{},argsComplete:!0},timestamp:new Date});break;case"tool-result":this.emit({type:"tool-result",toolResult:{toolCallId:Uu.toolCallId,success:!0,result:Uu.output},timestamp:new Date});break;case"tool-error":this.emit({type:"tool-result",toolResult:{toolCallId:Uu.toolCallId,success:!1,error:Uu.error instanceof Error?Uu.error.message:String(Uu.error)},timestamp:new Date});break;case"error":this.emit({type:"error",error:Uu.error instanceof Error?Uu.error:new Error(String(Uu.error)),timestamp:new Date});break;case"finish":{const Hu=Uu.totalUsage,Vu=Hu?.inputTokens??0,Gu=Hu?.outputTokens??0,Wu=Hu?.totalTokens??(Vu+Gu>0?Vu+Gu:void 0);this.emit({type:"done",usage:{promptTokens:Vu,completionTokens:Gu,totalTokens:Wu},timestamp:new Date});break}default:break}}}catch(Bu){if(Ru.signal.aborted)return;this.emit({type:"error",error:Bu instanceof Error?Bu:new Error(String(Bu)),timestamp:new Date}),this.emit({type:"done",timestamp:new Date})}finally{this.abortController===Ru&&(this.abortController=null)}}}const AGENT_METHODS={authenticate:"authenticate",initialize:"initialize",session_cancel:"session/cancel",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},CLIENT_METHODS={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},PROTOCOL_VERSION=1,zAuthMethod=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),id:string$2(),name:string$2()}),zAuthenticateRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),methodId:string$2()}),zAuthenticateResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zBlobResourceContents=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),blob:string$2(),mimeType:union([string$2(),_null()]).optional(),uri:string$2()}),zCreateTerminalResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),terminalId:string$2()}),zDiff=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),newText:string$2(),oldText:union([string$2(),_null()]).optional(),path:string$2()}),zEnvVariable=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),value:string$2()}),zErrorCode=union([literal(-32700),literal(-32600),literal(-32601),literal(-32602),literal(-32603),literal(-32e3),literal(-32002),number$2().int()]),zError=object({code:zErrorCode,data:unknown$1().optional(),message:string$2()}),zExtNotification=unknown$1(),zExtRequest=unknown$1(),zExtResponse=unknown$1(),zFileSystemCapability=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),readTextFile:boolean$1().optional().default(!1),writeTextFile:boolean$1().optional().default(!1)}),zClientCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),fs:zFileSystemCapability.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:boolean$1().optional().default(!1)}),zHttpHeader=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),value:string$2()}),zImplementation=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),name:string$2(),title:union([string$2(),_null()]).optional(),version:string$2()}),zKillTerminalCommandResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zListSessionsRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cursor:union([string$2(),_null()]).optional(),cwd:union([string$2(),_null()]).optional()}),zMcpCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),http:boolean$1().optional().default(!1),sse:boolean$1().optional().default(!1)}),zMcpServerHttp=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),headers:array(zHttpHeader),name:string$2(),url:string$2()}),zMcpServerSse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),headers:array(zHttpHeader),name:string$2(),url:string$2()}),zMcpServerStdio=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),args:array(string$2()),command:string$2(),env:array(zEnvVariable),name:string$2()}),zMcpServer=union([zMcpServerHttp.and(object({type:literal("http")})),zMcpServerSse.and(object({type:literal("sse")})),zMcpServerStdio]),zModelId=string$2(),zModelInfo=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),modelId:zModelId,name:string$2()}),zNewSessionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),mcpServers:array(zMcpServer)}),zPermissionOptionId=string$2(),zPermissionOptionKind=union([literal("allow_once"),literal("allow_always"),literal("reject_once"),literal("reject_always")]),zPermissionOption=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),kind:zPermissionOptionKind,name:string$2(),optionId:zPermissionOptionId}),zPlanEntryPriority=union([literal("high"),literal("medium"),literal("low")]),zPlanEntryStatus=union([literal("pending"),literal("in_progress"),literal("completed")]),zPlanEntry=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2(),priority:zPlanEntryPriority,status:zPlanEntryStatus}),zPlan=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),entries:array(zPlanEntry)}),zPromptCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),audio:boolean$1().optional().default(!1),embeddedContext:boolean$1().optional().default(!1),image:boolean$1().optional().default(!1)}),zProtocolVersion=number$2().int().gte(0).lte(65535),zInitializeRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),clientCapabilities:zClientCapabilities.optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:union([zImplementation,_null()]).optional(),protocolVersion:zProtocolVersion}),zReadTextFileResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2()}),zReleaseTerminalResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zRequestId=union([_null(),bigint(),string$2()]),zRole=_enum(["assistant","user"]),zAnnotations=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),audience:union([array(zRole),_null()]).optional(),lastModified:union([string$2(),_null()]).optional(),priority:union([number$2(),_null()]).optional()}),zAudioContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),data:string$2(),mimeType:string$2()}),zImageContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),data:string$2(),mimeType:string$2(),uri:union([string$2(),_null()]).optional()}),zResourceLink=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),description:union([string$2(),_null()]).optional(),mimeType:union([string$2(),_null()]).optional(),name:string$2(),size:union([bigint(),_null()]).optional(),title:union([string$2(),_null()]).optional(),uri:string$2()}),zSelectedPermissionOutcome=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),optionId:zPermissionOptionId}),zRequestPermissionOutcome=union([object({outcome:literal("cancelled")}),zSelectedPermissionOutcome.and(object({outcome:literal("selected")}))]),zRequestPermissionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),outcome:zRequestPermissionOutcome}),zSessionForkCapabilities=object({_meta:unknown$1().optional()}),zSessionId=string$2(),zCancelNotification=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId});object({method:string$2(),params:union([union([zCancelNotification,zExtNotification]),_null()]).optional()});const zCreateTerminalRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),args:array(string$2()).optional(),command:string$2(),cwd:union([string$2(),_null()]).optional(),env:array(zEnvVariable).optional(),outputByteLimit:union([number$2().int().gte(0),_null()]).optional(),sessionId:zSessionId}),zForkSessionRequest=object({_meta:unknown$1().optional(),sessionId:zSessionId}),zKillTerminalCommandRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zLoadSessionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),mcpServers:array(zMcpServer),sessionId:zSessionId}),zReadTextFileRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),limit:union([number$2().int().gte(0),_null()]).optional(),line:union([number$2().int().gte(0),_null()]).optional(),path:string$2(),sessionId:zSessionId}),zReleaseTerminalRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zSessionInfo=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),cwd:string$2(),sessionId:zSessionId,title:union([string$2(),_null()]).optional(),updatedAt:union([string$2(),_null()]).optional()}),zListSessionsResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),nextCursor:union([string$2(),_null()]).optional(),sessions:array(zSessionInfo)}),zSessionListCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zSessionCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),fork:union([zSessionForkCapabilities,_null()]).optional(),list:union([zSessionListCapabilities,_null()]).optional()}),zAgentCapabilities=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),loadSession:boolean$1().optional().default(!1),mcpCapabilities:zMcpCapabilities.optional().default({http:!1,sse:!1}),promptCapabilities:zPromptCapabilities.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:zSessionCapabilities.optional().default({})}),zInitializeResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),agentCapabilities:zAgentCapabilities.optional().default({loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:union([zImplementation,_null()]).optional(),authMethods:array(zAuthMethod).optional().default([]),protocolVersion:zProtocolVersion}),zSessionModeId=string$2(),zCurrentModeUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),currentModeId:zSessionModeId}),zSessionMode=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:union([string$2(),_null()]).optional(),id:zSessionModeId,name:string$2()}),zSessionModeState=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableModes:array(zSessionMode),currentModeId:zSessionModeId}),zSessionModelState=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableModels:array(zModelInfo),currentModelId:zModelId}),zForkSessionResponse=object({_meta:unknown$1().optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional(),sessionId:zSessionId}),zLoadSessionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional()}),zNewSessionResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),models:union([zSessionModelState,_null()]).optional(),modes:union([zSessionModeState,_null()]).optional(),sessionId:zSessionId}),zSetSessionModeRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),modeId:zSessionModeId,sessionId:zSessionId}),zSetSessionModeResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zSetSessionModelRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),modelId:zModelId,sessionId:zSessionId}),zSetSessionModelResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()}),zStopReason=union([literal("end_turn"),literal("max_tokens"),literal("max_turn_requests"),literal("refusal"),literal("cancelled")]),zPromptResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),stopReason:zStopReason});union([object({id:zRequestId,result:union([zInitializeResponse,zAuthenticateResponse,zNewSessionResponse,zLoadSessionResponse,zListSessionsResponse,zForkSessionResponse,zSetSessionModeResponse,zPromptResponse,zSetSessionModelResponse,zExtResponse])}),object({error:zError,id:zRequestId})]);const zTerminal=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),terminalId:string$2()}),zTerminalExitStatus=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitCode:union([number$2().int().gte(0),_null()]).optional(),signal:union([string$2(),_null()]).optional()}),zTerminalOutputRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zTerminalOutputResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitStatus:union([zTerminalExitStatus,_null()]).optional(),output:string$2(),truncated:boolean$1()}),zTextContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),text:string$2()}),zTextResourceContents=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),mimeType:union([string$2(),_null()]).optional(),text:string$2(),uri:string$2()}),zEmbeddedResourceResource=union([zTextResourceContents,zBlobResourceContents]),zEmbeddedResource=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),annotations:union([zAnnotations,_null()]).optional(),resource:zEmbeddedResourceResource}),zContentBlock=union([zTextContent.and(object({type:literal("text")})),zImageContent.and(object({type:literal("image")})),zAudioContent.and(object({type:literal("audio")})),zResourceLink.and(object({type:literal("resource_link")})),zEmbeddedResource.and(object({type:literal("resource")}))]),zContent=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:zContentBlock}),zContentChunk=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:zContentBlock}),zPromptRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),prompt:array(zContentBlock),sessionId:zSessionId});object({id:zRequestId,method:string$2(),params:union([union([zInitializeRequest,zAuthenticateRequest,zNewSessionRequest,zLoadSessionRequest,zListSessionsRequest,zForkSessionRequest,zSetSessionModeRequest,zPromptRequest,zSetSessionModelRequest,zExtRequest]),_null()]).optional()});const zToolCallContent=union([zContent.and(object({type:literal("content")})),zDiff.and(object({type:literal("diff")})),zTerminal.and(object({type:literal("terminal")}))]),zToolCallId=string$2(),zToolCallLocation=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),line:union([number$2().int().gte(0),_null()]).optional(),path:string$2()}),zToolCallStatus=union([literal("pending"),literal("in_progress"),literal("completed"),literal("failed")]),zToolKind=union([literal("read"),literal("edit"),literal("delete"),literal("move"),literal("search"),literal("execute"),literal("think"),literal("fetch"),literal("switch_mode"),literal("other")]),zToolCall=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:array(zToolCallContent).optional(),kind:zToolKind.optional(),locations:array(zToolCallLocation).optional(),rawInput:unknown$1().optional(),rawOutput:unknown$1().optional(),status:zToolCallStatus.optional(),title:string$2(),toolCallId:zToolCallId}),zToolCallUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:union([array(zToolCallContent),_null()]).optional(),kind:union([zToolKind,_null()]).optional(),locations:union([array(zToolCallLocation),_null()]).optional(),rawInput:unknown$1().optional(),rawOutput:unknown$1().optional(),status:union([zToolCallStatus,_null()]).optional(),title:union([string$2(),_null()]).optional(),toolCallId:zToolCallId}),zRequestPermissionRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),options:array(zPermissionOption),sessionId:zSessionId,toolCall:zToolCallUpdate}),zUnstructuredCommandInput=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),hint:string$2()}),zAvailableCommandInput=zUnstructuredCommandInput,zAvailableCommand=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),description:string$2(),input:union([zAvailableCommandInput,_null()]).optional(),name:string$2()}),zAvailableCommandsUpdate=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),availableCommands:array(zAvailableCommand)}),zSessionUpdate=union([zContentChunk.and(object({sessionUpdate:literal("user_message_chunk")})),zContentChunk.and(object({sessionUpdate:literal("agent_message_chunk")})),zContentChunk.and(object({sessionUpdate:literal("agent_thought_chunk")})),zToolCall.and(object({sessionUpdate:literal("tool_call")})),zToolCallUpdate.and(object({sessionUpdate:literal("tool_call_update")})),zPlan.and(object({sessionUpdate:literal("plan")})),zAvailableCommandsUpdate.and(object({sessionUpdate:literal("available_commands_update")})),zCurrentModeUpdate.and(object({sessionUpdate:literal("current_mode_update")}))]),zSessionNotification=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,update:zSessionUpdate});object({method:string$2(),params:union([union([zSessionNotification,zExtNotification]),_null()]).optional()});const zWaitForTerminalExitRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),sessionId:zSessionId,terminalId:string$2()}),zWaitForTerminalExitResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),exitCode:union([number$2().int().gte(0),_null()]).optional(),signal:union([string$2(),_null()]).optional()}),zWriteTextFileRequest=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional(),content:string$2(),path:string$2(),sessionId:zSessionId});object({id:zRequestId,method:string$2(),params:union([union([zWriteTextFileRequest,zReadTextFileRequest,zRequestPermissionRequest,zCreateTerminalRequest,zTerminalOutputRequest,zReleaseTerminalRequest,zWaitForTerminalExitRequest,zKillTerminalCommandRequest,zExtRequest]),_null()]).optional()});const zWriteTextFileResponse=object({_meta:union([record$2(string$2(),unknown$1()),_null()]).optional()});union([object({id:zRequestId,result:union([zWriteTextFileResponse,zReadTextFileResponse,zRequestPermissionResponse,zCreateTerminalResponse,zTerminalOutputResponse,zReleaseTerminalResponse,zWaitForTerminalExitResponse,zKillTerminalCommandResponse,zExtResponse])}),object({error:zError,id:zRequestId})]);class ACPAdapter extends BaseProtocolAdapter{protocol="acp";protocolTransport="websocket";acpConfig;ws=null;session=null;agent=null;streamingContent="";streamingMessageId=null;pendingPermission=null;pendingRequests=new Map;constructor(lo){super(lo),this.acpConfig=lo}getSession(){return this.session}getAgent(){return this.agent}getPendingPermission(){return this.pendingPermission}async connect(){if(this.ws?.readyState!==WebSocket.OPEN)return this.setConnectionState("connecting"),new Promise((lo,$u)=>{try{const Ru=this.acpConfig.wsUrl||this.config.baseUrl,Iu=this.config.agentId,Pu=Iu?`${Ru}/${Iu}`:Ru;this.ws=new WebSocket(Pu),this.ws.onopen=async()=>{this.reconnectAttempts=0;try{const Ou=await this.sendRequest("initialize",{protocolVersion:PROTOCOL_VERSION,clientCapabilities:this.acpConfig.clientCapabilities||{fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}});Ou.agentCapabilities?.agent&&(this.agent=Ou.agentCapabilities.agent);const Du=await this.sendRequest(AGENT_METHODS.session_new,{});Du.sessionId?this.session={sessionId:Du.sessionId,agentId:this.config.agentId||"",createdAt:new Date().toISOString(),status:"active"}:Ou.session_id&&(this.session={sessionId:Ou.session_id,agentId:this.config.agentId||"",createdAt:new Date().toISOString(),status:"active"}),this.setConnectionState("connected"),lo()}catch(Ou){console.error("[ACPAdapter] Initialization error:",Ou),this.setConnectionState("connected"),lo()}},this.ws.onmessage=Ou=>{this.handleMessage(Ou)},this.ws.onerror=Ou=>{console.error("[ACPAdapter] WebSocket error:",Ou),this.emit({type:"error",error:new Error("WebSocket error"),timestamp:new Date})},this.ws.onclose=()=>{this.ws=null,this.setConnectionState("disconnected"),this.handleReconnect()}}catch(Ru){this.setConnectionState("error"),this.emit({type:"error",error:Ru instanceof Error?Ru:new Error(String(Ru)),timestamp:new Date}),$u(Ru)}})}disconnect(){this.session&&this.ws&&this.ws.readyState===WebSocket.OPEN&&this.terminateSession(this.session.sessionId).catch(lo=>{console.warn("[ACPAdapter] Failed to terminate session:",lo)});for(const[,{reject:lo}]of this.pendingRequests)lo(new Error("Connection closed"));this.pendingRequests.clear(),this.ws&&(this.ws.close(),this.ws=null),this.session=null,this.agent=null,this.pendingPermission=null,this.setConnectionState("disconnected")}async terminateSession(lo){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("[ACPAdapter] Cannot terminate: WebSocket not connected");return}try{const $u=lo||this.session?.sessionId;if(!$u){console.warn("[ACPAdapter] Cannot terminate: No session ID");return}const Ru={jsonrpc:"2.0",method:"session/cancel",params:{sessionId:$u}};this.ws.send(JSON.stringify(Ru)),console.debug("[ACPAdapter] Sent session/cancel for:",$u)}catch($u){console.debug("[ACPAdapter] Terminate request error:",$u)}}async sendMessage(lo,$u){if(!this.session)throw new Error("No active session");this.streamingContent="",this.streamingMessageId=generateMessageId();try{const Ru=typeof lo.content=="string"?lo.content:lo.content.filter(Pu=>Pu.type==="text").map(Pu=>Pu.text||"").join("");$u?.model&&console.log("[ACPAdapter] Sending with model:",$u.model),$u?.identities&&$u.identities.length>0&&console.log("[ACPAdapter] Sending with identities:",$u.identities.map(Pu=>Pu.provider));const Iu={};$u?.model&&(Iu.model=$u.model),$u?.identities&&$u.identities.length>0&&(Iu.identities=$u.identities),await this.sendRequest(AGENT_METHODS.session_prompt,{sessionId:this.session.sessionId,prompt:[{type:"text",text:Ru}],...Object.keys(Iu).length>0&&{metadata:Iu}})}catch(Ru){throw this.emit({type:"error",error:Ru instanceof Error?Ru:new Error(String(Ru)),timestamp:new Date}),Ru}}async sendToolResult(lo,$u){if(!this.session)throw new Error("No active session");this.emit({type:"tool-result",toolResult:$u,timestamp:new Date}),this.pendingPermission&&this.grantPermission()}grantPermission(lo){if(this.pendingPermission){const $u=lo||this.pendingPermission.options[0]?.optionId||"allow";this.sendResponse(this.pendingPermission.requestId,{outcome:{outcome:"selected",optionId:$u}}),this.pendingPermission=null}}denyPermission(){this.pendingPermission&&(this.sendResponse(this.pendingPermission.requestId,{outcome:{outcome:"cancelled"}}),this.pendingPermission=null)}supportsFeature(lo){return["streaming","tools","permissions","session-management","bidirectional"].includes(lo)}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}async sendRequest(lo,$u={}){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("Not connected to agent");const Ru=this.generateId(),Iu={jsonrpc:"2.0",id:Ru,method:lo,params:$u};return new Promise((Pu,Ou)=>{this.pendingRequests.set(Ru,{resolve:Pu,reject:Ou}),this.ws&&this.ws.send(JSON.stringify(Iu)),setTimeout(()=>{this.pendingRequests.has(Ru)&&(this.pendingRequests.delete(Ru),Ou(new Error("Request timeout")))},this.config.timeout||3e4)})}sendResponse(lo,$u){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("[ACPAdapter] Cannot send response: not connected");return}const Ru={jsonrpc:"2.0",id:lo,result:$u};this.ws.send(JSON.stringify(Ru))}handleMessage(lo){try{const $u=JSON.parse(lo.data);if($u.id&&this.pendingRequests.has($u.id)){const Ru=this.pendingRequests.get($u.id);if(!Ru)return;const{resolve:Iu,reject:Pu}=Ru;this.pendingRequests.delete($u.id),$u.error?Pu(new Error($u.error.message)):Iu($u.result),$u.result&&typeof $u.result=="object"&&"stopReason"in $u.result&&this.handleCompletion($u.result);return}if($u.method==="session/update"){this.handleSessionUpdate($u.params||{});return}if($u.method===CLIENT_METHODS.session_request_permission&&$u.id){this.handlePermissionRequest($u.id,$u.params);return}$u.result&&typeof $u.result=="object"&&"stopReason"in $u.result&&this.handleCompletion($u.result)}catch($u){console.error("[ACPAdapter] Failed to parse message:",$u)}}handleSessionUpdate(lo){const $u=lo.update;if(!$u)return;const Ru=$u.sessionUpdate,Iu=Pu=>Pu&&typeof Pu=="object"&&Pu.type==="text"?String(Pu.text??""):"";if(Ru==="agent_message_chunk"){const Pu=Iu($u.content);if(Pu){this.streamingContent+=Pu;const Ou=createAssistantMessage(this.streamingContent);this.streamingMessageId&&(Ou.id=this.streamingMessageId),this.emit({type:"message",message:Ou,timestamp:new Date})}}if(Ru==="tool_call"){const Pu=$u;this.emit({type:"tool-call",toolCall:{toolCallId:Pu.toolCallId||generateMessageId(),toolName:Pu.title||"",args:Pu.rawInput||{}},timestamp:new Date})}if(Ru==="tool_call_update"){const Pu=$u;(Pu.status==="completed"||Pu.status==="failed")&&this.emit({type:"tool-result",toolResult:{toolCallId:Pu.toolCallId??"",success:Pu.status==="completed",result:Pu.rawOutput},timestamp:new Date})}if(Ru==="agent_thought_chunk"){const Pu=Iu($u.content);Pu&&this.emit({type:"activity",activity:{type:"thought",data:Pu},timestamp:new Date})}}handlePermissionRequest(lo,$u){this.pendingPermission={requestId:lo,sessionId:$u.sessionId,toolCall:$u.toolCall,options:$u.options},this.emit({type:"tool-call",toolCall:{toolCallId:$u.toolCall.toolCallId,toolName:$u.toolCall.title||"",args:$u.toolCall.rawInput||{}},timestamp:new Date}),this.acpConfig.onPermissionRequest?.(this.pendingPermission)}handleCompletion(lo){if(this.streamingContent){const $u=createAssistantMessage(this.streamingContent);$u.id=this.streamingMessageId||generateMessageId(),this.emit({type:"message",message:$u,timestamp:new Date}),this.streamingContent="",this.streamingMessageId=null}this.emit({type:"activity",activity:{type:"completed",data:{stopReason:lo.stopReason}},timestamp:new Date})}}const internalQueryClient=new QueryClient({defaultOptions:{queries:{staleTime:300*1e3,refetchOnWindowFocus:!1}}});function isToolCallMessage(Au){return"type"in Au&&Au.type==="tool-call"}function getMessageText(Au){const lo=typeof Au.content=="string"?Au.content:Au.content.filter($u=>$u.type==="text").map($u=>$u.text).join("");return Au.role==="assistant"?sanitizeAssistantContent(lo):lo}function formatTokenCount(Au){return Au>=1e6?`${(Au/1e6).toFixed(1)}M`:Au>=1e3?`${(Au/1e3).toFixed(1)}K`:Au.toString()}function getApiBaseFromConfig(Au){return Au.replace(/\/(config|configure)\/?$/,"")}function createProtocolAdapter(Au){const lo={protocol:Au.type,baseUrl:Au.endpoint,authToken:Au.authToken,agentId:Au.agentId,...Au.options};switch(Au.type){case"ag-ui":if(Au.ownRoutesOnly&&!Au.appSessions)throw new Error("A chat whose runtime answers only the application’s own routes is an application’s: it needs its sessions (appSessions).");return new AGUIAdapter({...lo,...Au.appSessions?{appSessions:Au.appSessions}:{}});case"a2a":return new A2AAdapter(lo);case"vercel-ai":return new VercelAIAdapter(lo);case"acp":return new ACPAdapter(lo);case"browser-vercel-ai":return new BrowserAgentAdapter(lo);default:return console.warn(`[ChatBase] Unknown protocol type: ${Au.type}`),null}}const PAP_SIGN_IN_WORDS={title:Au=>`Sign in at ${Au}`,titleFor:(Au,lo,$u)=>`Sign in to ${Au} (${lo}) at ${$u}`,direct:"Open the company’s page through Datalayer, sign in there, and this conversation goes on once you are back.",device:"Open the company’s page and enter this code there.",mediatedTitle:Au=>`Sign in through ${Au}`,mediatedTitleFor:(Au,lo,$u)=>`Sign in to ${Au} (${lo}) through ${$u}`,mediated:"Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.",sentTo:Au=>`The company sent a code to ${Au}.`,needs:Au=>`It needs: ${Au.join(", ")}.`,open:Au=>`Open ${Au}`,code:"Your code",copy:"Copy the code",copied:"Copied",until:Au=>`Until ${new Date(Au).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}.`,checkAgain:"I have signed in: check again",tellMe:"Tell me when you are done.",checkMessage:Au=>`I have signed in at ${Au}. Please check again.`,refused:"This sign-in link cannot be opened safely, so it is not shown.",qr:Au=>`A code to scan to open ${Au} on your phone`,returned:{signed_in:Au=>`Signed in at ${Au}: checking again.`,denied:Au=>`You did not sign in at ${Au}: ask again when you want to.`,refused:Au=>`That sign-in at ${Au} was refused, and nothing was kept: start it again here.`}},PAP_SIGN_IN_CHANNEL="datalayer-pap-sign-in",SCOPE$1=/^[\x21\x23-\x5B\x5D-\x7E]{1,128}$/,DOMAIN=/^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function signInReturnOf(Au,lo){if(!Au||typeof Au!="object"||Array.isArray(Au))return null;const $u=Au,Ru=$u.outcome;return $u.company===lo&&(Ru==="signed_in"||Ru==="denied"||Ru==="refused")?Ru:null}const PAP_SIGN_IN_TOOL=/(^|[_.:\-/])pa(?:p|ct)_sign_in$/,isPapSignInTool=Au=>PAP_SIGN_IN_TOOL.test(Au);function unwrapped(Au){let lo=Au;if(typeof lo=="string")try{lo=JSON.parse(lo)}catch{return null}if(!lo||typeof lo!="object"||Array.isArray(lo))return null;const $u=lo;if($u.structuredContent&&typeof $u.structuredContent=="object")return unwrapped($u.structuredContent);if(Array.isArray($u.content)){const Ru=$u.content.find(Iu=>Iu?.type==="text"&&typeof Iu.text=="string");return Ru?unwrapped(Ru.text):null}return $u.result&&typeof $u.result=="object"&&!("status"in $u)?unwrapped($u.result):$u}function safeSignInUrl(Au){if(typeof Au!="string")return null;try{const lo=new URL(Au);return lo.protocol==="https:"&&lo.hostname?lo:null}catch{return null}}function readPapSignIn(Au){const lo=unwrapped(Au);if(!lo||lo.status!=="waiting_for_the_person"||lo.mode!=="direct"&&lo.mode!=="device"&&lo.mode!=="mediated")return null;const $u=safeSignInUrl(lo.open);if(!$u)return{refused:PAP_SIGN_IN_WORDS.refused};if(lo.mode==="device"&&(typeof lo.code!="string"||!lo.code))return null;const Ru=typeof lo.company=="string"&&DOMAIN.test(lo.company)?lo.company:"",Iu=typeof lo.organization_name=="string"?lo.organization_name.trim().slice(0,200):"",Pu=typeof lo.organization_domain=="string"&&DOMAIN.test(lo.organization_domain.toLowerCase())?lo.organization_domain.toLowerCase():"",Ou=Iu&&Pu?{name:Iu,domain:Pu}:void 0,Du=Array.isArray(lo.needs)?lo.needs.filter(Mu=>typeof Mu=="string"&&SCOPE$1.test(Mu)):[];return{mode:lo.mode,open:$u.toString(),host:$u.hostname,...Ru?{company:Ru}:{},...Ou?{organization:Ou}:{},...typeof lo.code=="string"&&lo.code?{code:lo.code}:{},...lo.mode==="mediated"&&typeof lo.sent_to=="string"&&lo.sent_to?{sentTo:lo.sent_to}:{},...typeof lo.expires_at=="string"&&lo.expires_at?{expiresAt:lo.expires_at}:{},...Du.length>0?{needs:Du}:{}}}const PAP_SIGN_IN_TYPE$1="application/vnd.datalayer.pap.sign-in+json",PAP_CONFIRM_TYPE="application/vnd.datalayer.pap.confirm+json",PAP_REPLIES_TYPE="application/vnd.datalayer.pap.replies+json",SHIELD_DIFF_TYPE="application/vnd.datalayer.shield.diff+json",SHIELD_TERMINAL_TYPE="application/vnd.datalayer.shield.terminal+json",DISPLAY_META_KEY="reactor.ui/display",record$1=Au=>Au&&typeof Au=="object"&&!Array.isArray(Au)?Au:null,text$h=Au=>typeof Au=="string"?Au:"",words=Au=>text$h(Au).trim();function termsLeaves(Au,lo="",$u=[]){if(typeof Au=="object"&&Au!==null&&!Array.isArray(Au))for(const[Ru,Iu]of Object.entries(Au))termsLeaves(Iu,lo?`${lo}.${Ru}`:Ru,$u);else $u.push([lo,Au]);return $u}function shownValue(Au,lo=!1){return typeof Au=="string"?lo?`'${Au}'`:Au:typeof Au=="boolean"?Au?"True":"False":Au==null?"None":Array.isArray(Au)?`[${Au.map($u=>shownValue($u,!0)).join(", ")}]`:typeof Au=="object"?`{${Object.entries(Au).map(([$u,Ru])=>`'${$u}': ${shownValue(Ru,!0)}`).join(", ")}}`:String(Au)}function shownTerms(Au){return termsLeaves(Au).map(([lo,$u])=>`${lo}: ${shownValue($u)}`).join(`
1862
+ `)}const ACTIONS=["read","write","send","buy","delete","publish"],STATUSES=["working","idle","queued","closed"],who=Au=>Au==="agent"||Au==="human"?Au:null;function protocolDisplayOf(Au){const lo=record$1(Au);if(!lo||!text$h(lo.type))return null;const $u=text$h(lo.id),Ru=record$1(lo.data)??{},Iu={kind:"unknown",id:$u,type:text$h(lo.type),version:typeof lo.version=="number"?lo.version:0,text:text$h(lo.text)};switch(lo.type){case PAP_SIGN_IN_TYPE$1:{const Pu=readPapSignIn({status:"waiting_for_the_person",...Ru});return Pu?"refused"in Pu?{kind:"sign-in-refused",id:$u,why:Pu.refused}:{kind:"sign-in",id:$u,...Pu}:Iu}case PAP_CONFIRM_TYPE:{const Pu=words(Ru.company),Ou=text$h(Ru.summary),Du=words(Ru.operation_ref),Mu=words(Ru.revision),Lu=record$1(Ru.terms),Bu=record$1(Ru.was),ju=Bu?words(Bu.revision):"",Fu=words(Ru.expires_at);if(!Pu||Ru.summary!==void 0&&Ru.summary!==null&&!Ou.trim()||!Du||!Mu||!Lu||!Fu||!Array.isArray(Ru.differences)||!$u.endsWith("-confirm")||Bu&&(!ju||ju===Mu))return Iu;const zu=Ru.does===null||Ru.does===void 0?null:ACTIONS.find(Gu=>Gu===Ru.does);if(zu===void 0)return Iu;const Uu=!!Ou.trim(),Hu=Uu?Ou:shownTerms(Lu);if(!Hu.trim())return Iu;const Vu=record$1(Ru.session);return{kind:"confirm",id:$u,approvalId:$u.slice(0,-8),company:Pu,summary:Hu,summaryGiven:Uu,terms:Lu,operationRef:Du,revision:Mu,does:zu,signedIn:Vu&&typeof Vu.signed_in=="boolean"?Vu.signed_in:null,expiresAt:Fu,differences:Ru.differences.map(text$h),was:Bu?{revision:ju,terms:record$1(Bu.terms)??{}}:null}}case PAP_REPLIES_TYPE:{const Pu=words(Ru.company),Ou=text$h(Ru.conversation),Du=Array.isArray(Ru.replies)?Ru.replies.map(record$1).map(Mu=>({author:who(Mu?.author),name:words(Mu?.name)||null,text:text$h(Mu?.text)})):[];return!Pu||!/^[A-Za-z0-9_-]{1,256}$/.test(Ou)||!Du.length||Du.some(Mu=>!Mu.author||!Mu.text.trim())?Iu:{kind:"replies",id:$u,company:Pu,conversation:Ou,replies:Du,status:STATUSES.find(Mu=>Mu===Ru.status)??null,responder:who(Ru.responder)}}case SHIELD_DIFF_TYPE:{const Pu=words(Ru.path);return!Pu||typeof Ru.new_text!="string"||!(Ru.old_text===null||Ru.old_text===void 0||typeof Ru.old_text=="string")?Iu:{kind:"diff",id:$u,path:Pu,oldText:typeof Ru.old_text=="string"?Ru.old_text:null,newText:Ru.new_text,language:words(Ru.language)||languageOf$1(Pu)}}case SHIELD_TERMINAL_TYPE:{const Pu=words(Ru.terminal_id);if(!Pu)return Iu;const Ou=typeof Ru.exit_code=="number"&&Number.isInteger(Ru.exit_code)?Ru.exit_code:null;return Ru.exit_code!==null&&Ru.exit_code!==void 0&&Ou===null?Iu:{kind:"terminal",id:$u,terminalId:Pu,command:text$h(Ru.command),output:text$h(Ru.output),exitCode:Ou,released:Ru.released===!0}}default:return Iu}}const PAP_HANDOFF_TOOL=/(^|[_.:\-/])pap_handoff$/;function displayOfToolResult(Au,lo,$u=""){const Ru=record$1(lo),Iu=record$1(Ru?._meta)?.[DISPLAY_META_KEY];if(Iu!==void 0)return protocolDisplayOf(Iu);if(isPapSignInTool(Au)){const Pu=readPapSignIn(lo);return Pu?"refused"in Pu?{kind:"sign-in-refused",id:$u,why:Pu.refused}:{kind:"sign-in",id:$u,...Pu}:null}if(PAP_HANDOFF_TOOL.test(Au)&&Ru){const Pu=text$h(Ru.status);return Pu?{kind:"handoff",id:$u,handed:Pu!=="closed"&&Pu!=="direct_conversation_open",responder:who(Ru.responder),note:text$h(Ru.note)}:null}return null}function displayLine(Au){switch(Au.kind){case"sign-in":return Au.mode==="mediated"?`Sign in through ${Au.host}`:`Sign in at ${Au.company||Au.host}`;case"sign-in-refused":return Au.why;case"confirm":return`${Au.company} asks you to approve: ${Au.summary} (revision ${Au.revision})`;case"replies":return`${Au.company} answered${Au.responder==="human"?": one of its people is answering":""}`;case"handoff":return Au.handed?`Handed to ${Au.responder==="human"?"one of the company’s people":"the company"}`:Au.note||"Nothing was handed over.";case"diff":{const lo=countLines(Au.newText);return Au.oldText===null?`Wrote ${Au.path} (${lo} lines)`:`Changed ${Au.path} (+${lo} −${countLines(Au.oldText)} lines)`}case"terminal":{const lo=Au.command?`Ran \`${Au.command}\``:`Terminal ${Au.terminalId}`;return Au.exitCode===null?`${lo}: running`:`${lo}: exit ${Au.exitCode}`}case"unknown":return Au.text||`A display this app cannot draw (${Au.type})`}}const countLines=Au=>Au===""?0:Au.split(`
1863
1863
  `).length-(Au.endsWith(`
1864
1864
  `)?1:0),LANGUAGES={py:"python",pyi:"python",ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",json:"json",md:"markdown",mdx:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",css:"css",scss:"scss",html:"html",xml:"xml",sql:"sql",rs:"rust",go:"go",java:"java",c:"c",h:"c",cpp:"cpp",rb:"ruby",ipynb:"json",txt:"text"};function languageOf$1(Au){const lo=Au.split("/").pop()??"";if(lo==="Dockerfile"||lo==="Makefile")return lo.toLowerCase();const $u=lo.lastIndexOf(".");return $u>0?LANGUAGES[lo.slice($u+1).toLowerCase()]??"text":"text"}const DIFF_LINES_LIMIT=2e3,lines=Au=>Au===""?[]:Au.replace(/\n$/,"").split(`
1865
1865
  `);function unifiedDiffLines(Au,lo){const $u=Au===null?[]:lines(Au),Ru=lines(lo);if($u.length>DIFF_LINES_LIMIT||Ru.length>DIFF_LINES_LIMIT)return[...$u.map(Mu=>({kind:"remove",text:Mu})),...Ru.map(Mu=>({kind:"add",text:Mu}))];const Iu=[];for(let Mu=0;Mu<=$u.length;Mu++)Iu.push(new Uint32Array(Ru.length+1));for(let Mu=$u.length-1;Mu>=0;Mu--)for(let Lu=Ru.length-1;Lu>=0;Lu--)Iu[Mu][Lu]=$u[Mu]===Ru[Lu]?Iu[Mu+1][Lu+1]+1:Math.max(Iu[Mu+1][Lu],Iu[Mu][Lu+1]);const Pu=[];let Ou=0,Du=0;for(;Ou<$u.length&&Du<Ru.length;)$u[Ou]===Ru[Du]?(Pu.push({kind:"context",text:$u[Ou]}),Ou++,Du++):Iu[Ou+1][Du]>=Iu[Ou][Du+1]?(Pu.push({kind:"remove",text:$u[Ou]}),Ou++):(Pu.push({kind:"add",text:Ru[Du]}),Du++);for(;Ou<$u.length;)Pu.push({kind:"remove",text:$u[Ou++]});for(;Du<Ru.length;)Pu.push({kind:"add",text:Ru[Du++]});return Pu}const THREAD_WORDS={opening:"Opening your conversation…",notOpened:Au=>`Your conversation could not be opened, so this is a new one: ${Au}`};function messagesOfThread(Au){if(!Array.isArray(Au))return[];const lo=[];for(const $u of Au){if(!$u||typeof $u!="object")continue;const{id:Ru,role:Iu,content:Pu,activityType:Ou}=$u;if(Iu==="activity"&&Ou===REACTOR_UI_NAME)throw new Error(`Activity ${String(Ru)}: what a message showed comes on the ui socket (RU-W)`);(Iu==="user"||Iu==="assistant")&&typeof Ru=="string"&&typeof Pu=="string"&&Pu.trim()&&lo.push({id:Ru,role:Iu,content:Iu==="user"?askedOf(Pu):Pu,createdAt:new Date})}return lo}function snapshotOfStream(Au){let lo;for(const $u of eventsOfStream(Au))$u.type==="MESSAGES_SNAPSHOT"&&Array.isArray($u.messages)&&(lo=$u.messages);return lo}async function detailOf(Au){try{const lo=await Au.json();if(typeof lo.detail=="string"&&lo.detail)return lo.detail}catch{}return`${Au.status}`}async function openThread({agentBaseUrl:Au,agentId:lo,uid:$u,token:Ru,fetcher:Iu=fetch}){const Pu=`${Au.replace(/\/+$/,"")}/api/v1/apps/sessions/${encodeURIComponent($u)}`,Ou=Ru?{Authorization:`Bearer ${Ru}`}:{},Du=await Iu(`${Pu}/messages`,{headers:Ou});if(Du.ok){const Bu=await Du.json();return messagesOfThread(Bu.messages)}if(Du.status!==404)throw new Error(await detailOf(Du));const Mu=await Iu(`${Pu}/resume`,{method:"POST",headers:{"Content-Type":"application/json",...Ou},body:JSON.stringify({agent:lo})});if(!Mu.ok)throw new Error(await detailOf(Mu));const Lu=snapshotOfStream(await Mu.text());if(!Lu)throw new Error(`The runtime said nothing of session ${$u}.`);return messagesOfThread(Lu)}const ITEM_LIMIT=400,MESSAGE_TEXT_LIMIT=1e5,TOOL_TEXT_LIMIT=4e3,DIAGNOSTIC_LIMIT=50,DEVICE_LIMITS={items:ITEM_LIMIT,messageText:MESSAGE_TEXT_LIMIT,toolText:TOOL_TEXT_LIMIT,diagnostics:DIAGNOSTIC_LIMIT},BROWSER_LIMITS={items:5e3,messageText:1e6,toolText:1e6,diagnostics:DIAGNOSTIC_LIMIT},CUT_MARK="… (cut: too long to keep on this device)",emptyConversation=(Au=DEVICE_LIMITS)=>{for(const[lo,$u]of Object.entries(Au))if(!Number.isInteger($u)||$u<1)throw new Error(`A conversation's ${lo} bound is ${String($u)}: give a whole number of at least 1.`);return{items:[],running:!1,session:null,asking:null,dropped:0,diagnostics:[],turnRows:0,limits:Au}},text$g=Au=>typeof Au=="string"?Au:"",cut=(Au,lo)=>Au.length>lo?`${Au.slice(0,lo)}${CUT_MARK}`:Au,appended=(Au,lo,$u)=>Au.endsWith(CUT_MARK)?Au:cut(Au+lo,$u),isRecord$2=Au=>!!Au&&typeof Au=="object"&&!Array.isArray(Au);function withoutMeta(Au){if(isRecord$2(Au)&&"_meta"in Au){const{_meta:lo,...$u}=Au;return $u}return Au}function said$1(Au){return Au==null?"":typeof Au=="string"?Au:JSON.stringify(Au)}function questionOf$1(Au){if(!Au||typeof Au!="object")return null;const lo=Au,$u=lo.kind;if($u!=="text"&&$u!=="choice"&&$u!=="form"&&$u!=="file")throw new Error(`The application asks something no client knows: ${String($u)}.`);const Ru=Pu=>Array.isArray(Pu)?Pu.filter(Ou=>typeof Ou=="string"):[],Iu=lo.schema;return{kind:$u,prompt:text$g(lo.prompt),options:Ru(lo.options),schema:isRecord$2(Iu)?Iu:null,accept:Ru(lo.accept)}}function withItems(Au,lo,$u=0){const Ru=lo.length-Au.limits.items;return{...Au,items:Ru>0?lo.slice(Ru):lo,dropped:Au.dropped+Math.max(0,Ru),turnRows:Au.turnRows+$u}}function changed$1(Au,lo,$u){const Ru=Au.items.findIndex(Pu=>Pu.id===lo);if(Ru<0)return null;const Iu=Au.items.slice();return Iu[Ru]=$u(Iu[Ru]),{...Au,items:Iu}}function noted(Au,lo){const $u={type:lo.type,name:text$g(lo.name)||text$g(lo.activityType)};return{...Au,diagnostics:[...Au.diagnostics,$u].slice(-Au.limits.diagnostics)}}const HARNESS_TOOL_CALL="datalayer.harness.tool_call";function withRunningDisplay(Au,lo){if(!isRecord$2(lo)||!isRecord$2(lo._meta))return null;const $u=lo._meta[DISPLAY_META_KEY];if($u===void 0)return null;const Ru=protocolDisplayOf($u);if(!Ru)throw new Error(`${HARNESS_TOOL_CALL} of ${text$g(lo.id)} carries a display no client reads.`);return changed$1(Au,text$g(lo.id),Iu=>Iu.kind==="tool"&&Iu.status==="running"?{...Iu,value:{_meta:lo._meta},display:Ru}:Iu)}let rowCount=0;const rowId=Au=>`${Au}-${Date.now().toString(36)}-${rowCount+=1}`;function toolRow(Au,lo){return{kind:"tool",id:Au,name:lo,args:"",input:null,status:"running",awaiting:null,result:"",value:void 0,error:"",executionError:"",codeError:null,exitCode:null,display:null}}function withInput(Au,lo,$u){const Ru=JSON.stringify(lo),Iu=Ru.length<=$u;return{...Au,args:cut(Ru,$u),input:Iu?lo:null}}const asksThePerson=Au=>!!Au&&Array.isArray(Au.steps);function withResult(Au,lo,$u,Ru=!1){const Iu=lo.result,Pu=said$1(withoutMeta(Iu)),Ou=isRecord$2(Iu)?Iu:null,Du=typeof Ou?.execution_error=="string"?Ou.execution_error:"",Mu=isRecord$2(Ou?.code_error)?Ou.code_error:null,Lu=Mu?{name:text$g(Mu.name)||"Error",value:text$g(Mu.value)||"Unknown error",traceback:cut(text$g(Mu.traceback),$u)}:null,Bu=Ou&&typeof Ou.exit_code=="number"?Ou.exit_code:null,ju=!lo.success||Du!==""||Lu!==null||Bu!==null&&Bu!==0||Ou?.execution_ok===!1,Fu=ju||Ru?null:Ou?.pending_approval===!0?"approval":asksThePerson(Au.input)?"person":null;return{...Au,status:ju?"error":Fu?"running":"complete",awaiting:Fu,result:cut(Pu,$u),value:Pu.length<=$u?Iu:void 0,error:lo.error??"",executionError:cut(Du,$u),codeError:Lu,exitCode:Bu,display:displayOfToolResult(Au.name,Iu,Au.id)}}function rowsOfSnapshot(Au,lo,$u){if(!Array.isArray(Au))throw new Error("A messages snapshot carries no list of messages.");const Ru=[],Iu=new Map;for(const Pu of Au){for(const Ou of messagesOfThread([Pu]))Ru.push({kind:"message",id:Ou.id,role:Ou.role==="user"?"user":"assistant",text:cut(typeof Ou.content=="string"?Ou.content:"",lo.messageText),streaming:!1});if(isRecord$2(Pu)){if(Pu.role==="assistant"&&Pu.toolCalls!==void 0){if(!Array.isArray(Pu.toolCalls))throw new Error(`Message ${String(Pu.id)}'s tool calls are not a list.`);for(const Ou of Pu.toolCalls){const Du=isRecord$2(Ou)?Ou.function:void 0;if(!isRecord$2(Ou)||typeof Ou.id!="string"||!isRecord$2(Du))throw new Error(`Message ${String(Pu.id)} holds a tool call without its id and function.`);const Mu=text$g(Du.arguments);let Lu=null;if(Mu&&Mu.length<=lo.toolText){let Bu;try{Bu=JSON.parse(Mu)}catch{Bu=void 0}if(!isRecord$2(Bu))throw new Error(`Tool call ${Ou.id}'s arguments are not a JSON object.`);Lu=Bu}Iu.set(Ou.id,Ru.length),Ru.push({...toolRow(Ou.id,text$g(Du.name)),args:cut(Mu,lo.toolText),input:Mu?Lu:{},status:"complete"})}}if(Pu.role==="tool"){const Ou=text$g(Pu.toolCallId),Du=Iu.get(Ou);if(Du===void 0){$u.push(Ou||"no call");continue}Ru[Du]=withResult(Ru[Du],toolResultOf(Pu.content),lo.toolText,!0)}}}return Ru}function withPrompt(Au,lo,$u){return withItems({...Au,asking:null},[...Au.items,{kind:"message",id:lo,role:"user",text:$u,streaming:!1}])}function withoutItems(Au,lo){const $u=new Set(lo);return{...Au,items:Au.items.filter(Ru=>!$u.has(Ru.id))}}function withTurnEnded(Au,lo){const $u=Au.items.map(Iu=>Iu.kind==="message"&&Iu.streaming?{...Iu,streaming:!1}:Iu.kind==="tool"&&Iu.status==="running"?{...Iu,status:"error",awaiting:null,error:RUN_END_WORDS[lo]}:Iu.kind==="step"&&Iu.status==="running"?{...Iu,status:"complete"}:Iu),Ru={...Au,items:$u,running:!1};return withItems(Ru,[...$u,{kind:"end",id:rowId("end"),end:lo,words:RUN_END_WORDS[lo]}])}function withError(Au,lo){const $u=Au.items.map(Ru=>Ru.kind==="message"&&Ru.streaming?{...Ru,streaming:!1}:Ru.kind==="tool"&&Ru.status==="running"?{...Ru,status:"error",awaiting:null}:Ru.kind==="step"&&Ru.status==="running"?{...Ru,status:"complete"}:Ru);return withItems({...Au,running:!1},[...$u,{kind:"error",id:rowId("error"),text:lo}])}function required(Au,lo){const $u=Au[lo];if(typeof $u!="string"||!$u)throw new Error(`${Au.type} carries no ${lo}.`);return $u}function reduceConversation(Au,lo){const{limits:$u}=Au;switch(lo.type){case"RUN_STARTED":return{...Au,running:!0,asking:null,turnRows:0};case"TEXT_MESSAGE_START":{const Ru=text$g(lo.messageId)||rowId("message");if(Au.items.some(Pu=>Pu.id===Ru))return Au;const Iu=lo.role==="user"?"user":"assistant";return withItems(Au,[...Au.items,{kind:"message",id:Ru,role:Iu,text:"",streaming:!0}],1)}case"TEXT_MESSAGE_CONTENT":case"TEXT_MESSAGE_CHUNK":{const Ru=text$g(lo.delta),Iu=text$g(lo.messageId),Pu=changed$1(Au,Iu,Ou=>Ou.kind==="message"?{...Ou,text:appended(Ou.text,Ru,$u.messageText)}:Ou);return Pu||withItems(Au,[...Au.items,{kind:"message",id:Iu||rowId("message"),role:lo.role==="user"?"user":"assistant",text:cut(Ru,$u.messageText),streaming:lo.type==="TEXT_MESSAGE_CONTENT"}],1)}case"TEXT_MESSAGE_END":return changed$1(Au,text$g(lo.messageId),Ru=>Ru.kind==="message"?{...Ru,streaming:!1}:Ru)??Au;case"MESSAGE_SAID":{const Ru=required(lo,"messageId");if(typeof lo.text!="string")throw new Error(`MESSAGE_SAID of ${Ru} carries no text.`);if(lo.role!=="user"&&lo.role!=="assistant")throw new Error(`MESSAGE_SAID of ${Ru} is said by ${String(lo.role)}: only the person or the assistant speaks here.`);const Iu=lo.role,Pu=cut(lo.text,$u.messageText),Ou=Iu==="assistant"&&lo.streaming!==!1,Du=Au.items.findIndex(Mu=>Mu.id===Ru);if(Du>=0){const Mu=Au.items[Du];if(Mu.kind!=="message")throw new Error(`MESSAGE_SAID of ${Ru} names a ${Mu.kind} row.`);const Lu=Au.items.slice();return Lu[Du]={...Mu,text:Pu,streaming:Ou},{...Au,items:Lu}}return withItems(Au,[...Au.items,{kind:"message",id:Ru,role:Iu,text:Pu,streaming:Ou}],1)}case"TOOL_CALL_START":{const Ru=text$g(lo.toolCallId)||rowId("tool");return Au.items.some(Iu=>Iu.id===Ru)?Au:withItems(Au,[...Au.items,toolRow(Ru,text$g(lo.toolCallName)||text$g(lo.name))],1)}case"TOOL_CALL_ARGS":return changed$1(Au,text$g(lo.toolCallId),Ru=>Ru.kind==="tool"?{...Ru,args:appended(Ru.args,text$g(lo.delta),$u.toolText)}:Ru)??Au;case"TOOL_CALL_END":return changed$1(Au,text$g(lo.toolCallId),Ru=>{if(Ru.kind!=="tool"||Ru.args.endsWith(CUT_MARK))return Ru;if(!Ru.args)return{...Ru,input:{}};let Iu;try{Iu=JSON.parse(Ru.args)}catch{Iu=void 0}return isRecord$2(Iu)?{...Ru,input:Iu}:{...Ru,status:"error",awaiting:null,error:"Its arguments are not a JSON object."}})??Au;case"TOOL_CALL_SAID":{const Ru=required(lo,"toolCallId"),Iu=required(lo,"toolCallName");if(!isRecord$2(lo.args))throw new Error(`TOOL_CALL_SAID of ${Ru} carries arguments that are not an object.`);const Pu=lo.args,Ou=Au.items.findIndex(Lu=>Lu.id===Ru);if(Ou<0)return withItems(Au,[...Au.items,withInput(toolRow(Ru,Iu),Pu,$u.toolText)],1);const Du=Au.items[Ou];if(Du.kind!=="tool")throw new Error(`TOOL_CALL_SAID of ${Ru} names a ${Du.kind} row.`);const Mu=Au.items.slice();return Mu[Ou]=withInput(Du,{...Du.input??{},...Pu},$u.toolText),{...Au,items:Mu}}case"TOOL_CALL_RESULT":{const Ru=toolResultOf(lo.content);return changed$1(Au,text$g(lo.toolCallId),Iu=>Iu.kind==="tool"?withResult(Iu,Ru,$u.toolText):Iu)??noted(Au,lo)}case"TOOL_CALL_DONE":{const Ru=required(lo,"toolCallId");if(typeof lo.success!="boolean")throw new Error(`TOOL_CALL_DONE of ${Ru} does not say whether it succeeded.`);if(lo.error!==void 0&&typeof lo.error!="string")throw new Error(`TOOL_CALL_DONE of ${Ru} says its error in no words.`);const Iu={result:lo.result,success:lo.success,...lo.error!==void 0?{error:lo.error}:{}};return changed$1(Au,Ru,Pu=>Pu.kind==="tool"?withResult(Pu,Iu,$u.toolText,lo.answered===!0):Pu)??noted(Au,lo)}case"STEP_STARTED":{const Ru=text$g(lo.stepName)||text$g(lo.name);return withItems(Au,[...Au.items,{kind:"step",id:rowId("step"),name:Ru,status:"running"}],1)}case"STEP_FINISHED":{const Ru=text$g(lo.stepName)||text$g(lo.name),Iu=Au.items.map((Ou,Du)=>({item:Ou,index:Du})).reverse().find(({item:Ou})=>Ou.kind==="step"&&Ou.name===Ru&&Ou.status==="running");if(!Iu)return noted(Au,lo);const Pu=Au.items.slice();return Pu[Iu.index]={...Iu.item,status:"complete"},{...Au,items:Pu}}case"MESSAGES_SNAPSHOT":{const Ru=[],Iu=rowsOfSnapshot(lo.messages,$u,Ru),Pu=withItems({...Au,dropped:0},Iu,1);return Ru.reduce((Ou,Du)=>noted(Ou,{type:"TOOL_CALL_RESULT",name:`${Du} (no call)`}),Pu)}case"CUSTOM":{if(lo.name===REACTOR_UI_NAME)return withError(Au,UI_ON_RUN);if(lo.name==="loop.session"&&isRecord$2(lo.value)){const Ru=lo.value;return{...Au,session:Ru,asking:questionOf$1(Ru.asking)??Au.asking}}return lo.name===HARNESS_TOOL_CALL?withRunningDisplay(Au,lo.value)??noted(Au,lo):noted(Au,lo)}case"ACTIVITY_SNAPSHOT":case"ACTIVITY_DELTA":return lo.activityType===REACTOR_UI_NAME?withError(Au,UI_ON_RUN):noted(Au,lo);case"RUN_FINISHED":{const Ru=isRecord$2(lo.result)?lo.result:{},Iu=questionOf$1(Ru.asking),Pu=Au.items.map(Du=>Du.kind==="message"&&Du.streaming?{...Du,streaming:!1}:Du),Ou={...Au,items:Pu,running:!1,asking:Iu};return Iu||Au.turnRows>0?Ou:withItems(Ou,[...Pu,{kind:"end",id:rowId("end"),end:"answered",words:RUN_END_WORDS.answered}])}case"RUN_ERROR":return withError(Au,text$g(lo.message)||"Run failed");default:return noted(Au,lo)}}const emptyChatLayer=()=>({extras:new Map,displays:new Map,speakers:new Map,steps:[]}),toolCardId=Au=>`tool-${Au}`,rowIdOf=Au=>"toolCallId"in Au&&Au.id===toolCardId(Au.toolCallId)?Au.toolCallId:Au.id;function cardStatusOf(Au){return Au.status!=="running"?Au.status:Au.awaiting==="approval"?"inProgress":"executing"}function toolCallOf(Au){return{id:toolCardId(Au.id),type:"tool-call",toolCallId:Au.id,toolName:Au.name,args:Au.input??{},...Au.value!==void 0?{result:Au.value}:Au.result?{result:Au.result}:{},status:cardStatusOf(Au),...Au.error?{error:Au.error}:{},...Au.executionError?{executionError:Au.executionError}:{},...Au.codeError?{codeError:{name:Au.codeError.name,value:Au.codeError.value,...Au.codeError.traceback?{traceback:Au.codeError.traceback}:{}}}:{},...Au.exitCode!==null?{exitCode:Au.exitCode}:{}}}function withToolSummaries(Au,lo=[]){const $u=lo.filter(Pu=>Pu.summaryOf);if($u.length===0)return Au;let Ru=!1;const Iu=Au.map(Pu=>{if(!isToolCallMessage(Pu))return Pu;const Ou=Pu,Du=$u.find(Lu=>Lu.name===Ou.toolName);if(!Du?.summaryOf||Ou.result===void 0)return Pu;const Mu=Du.summaryOf(Ou.args,Ou.result)?.trim();return!Mu||Mu===Ou.summary?Pu:(Ru=!0,{...Ou,summary:Mu})});return Ru?Iu:Au}function conversationDrawer(Au){const lo=new Map,$u=(Iu,Pu)=>{const Ou=Pu.extras.get(Iu.id),Du=Pu.displays.get(Iu.id),Mu=Pu.speakers.get(Iu.id),Lu=lo.get(Iu.id);if(Lu&&Lu.row===Iu&&Lu.extras===Ou&&Lu.displays===Du&&Lu.speaker===Mu)return Lu.item;const Bu={...Ou,createdAt:Ou?.createdAt??new Date,id:Iu.id,role:Iu.kind==="message"?Iu.role:"assistant",content:Iu.kind==="message"?Iu.text:Au(Iu.text),...Du?{displays:Du}:{},...Mu?{speaker:Mu}:{}};return lo.set(Iu.id,{row:Iu,extras:Ou,displays:Du,speaker:Mu,item:Bu}),Bu},Ru=Iu=>{const Pu=lo.get(Iu.id);if(Pu&&Pu.row===Iu)return Pu.item;const Ou=toolCallOf(Iu);return lo.set(Iu.id,{row:Iu,item:Ou}),Ou};return(Iu,Pu)=>{const Ou=[],Du=new Map;for(const Lu of Pu.steps)Du.set(Lu.after,[...Du.get(Lu.after)??[],Lu.item]);Ou.push(...Du.get(null)??[]);const Mu=new Set;for(const Lu of Iu.items)Mu.add(Lu.id),Lu.kind==="message"||Lu.kind==="error"?Ou.push($u(Lu,Pu)):Lu.kind==="tool"&&Ou.push(Ru(Lu)),Ou.push(...Du.get(Lu.id)??[]);for(const[Lu,Bu]of Du)Lu!==null&&!Mu.has(Lu)&&Ou.push(...Bu);for(const Lu of lo.keys())Mu.has(Lu)||lo.delete(Lu);return Ou}}function isSubagentRunOver(Au){return Au.some(lo=>lo.phase==="end"||lo.phase==="error")}function getMonitoringCacheKey(Au,lo){return`${Au||"__unknown_service__"}::${lo||"__unknown_agent__"}`}function getTransportEndpoint(Au,lo,$u){switch(lo){case"vercel-ai":return`${Au}/api/v1/vercel-ai/${$u}`;case"a2a":return`${Au}/api/v1/a2a/agents/${$u}/`;case"acp":return`${Au}/api/v1/acp/ws/${$u}`;default:return`${Au}/api/v1/ag-ui/${$u}/`}}function toAgentRuntimeBaseUrl(Au){const lo=Au.replace(/\/$/,"");return lo.includes("/api/agent-runtimes")?lo:lo.includes("/api/jupyter-server")?lo.replace("/api/jupyter-server","/api/agent-runtimes"):lo.includes("/jupyter/server/")?lo.replace("/jupyter/server/","/agent-runtimes/"):lo.includes("/jupyter-server/")?lo.replace("/jupyter-server/","/agent-runtimes/"):lo.replace("/jupyter/","/agent-runtimes/")}async function createAgentOnRuntime(Au,lo,$u={}){const{iamStore:Ru}=await __vitePreload(async()=>{const{iamStore:Lu}=await import("./chunks/state-ChvKybRM.js");return{iamStore:Lu}},[],import.meta.url),Iu=Ru.getState().token||"";if(!$u.protocol&&!$u.agentSpecId)throw new Error("Agent protocol is required. Provide config.protocol from the selected spec/config.");const Pu=$u.protocol||"vercel-ai";if(!$u.model&&!$u.agentSpecId)throw new Error("Agent model is required. Provide config.model from the selected spec/config.");const Ou={name:$u.name||lo,description:$u.description||"AI assistant",agent_library:$u.agentLibrary||"pydantic-ai",transport:Pu,model:$u.model,system_prompt:$u.systemPrompt||"You are a helpful AI assistant."};$u.agentSpecId&&(Ou.agent_spec_id=$u.agentSpecId),typeof $u.enableSkills=="boolean"&&(Ou.enable_skills=$u.enableSkills),Array.isArray($u.backendTools)&&(Ou.backend_tools=$u.backendTools),$u.inferenceProvider&&(Ou.inferenceProvider=$u.inferenceProvider),typeof $u.enableCodemode=="boolean"&&(Ou.enable_codemode=$u.enableCodemode),$u.sandboxVariant&&(Ou.sandbox_variant=$u.sandboxVariant),$u.jupyterSandbox&&(Ou.jupyter_sandbox=$u.jupyterSandbox),$u.createPayload&&typeof $u.createPayload=="object"&&Object.assign(Ou,$u.createPayload);const Du=await fetch(`${Au}/api/v1/agents`,{method:"POST",headers:{"Content-Type":"application/json",...Iu?{Authorization:`Bearer ${Iu}`}:{}},body:JSON.stringify(Ou)});if(Du.ok||Du.status===400||Du.status===409){const Lu=getTransportEndpoint(Au,Pu,lo);return{agentId:lo,endpoint:Lu,isReady:!0}}const Mu=await Du.json().catch(()=>({}));throw new Error(Mu.detail||`Failed to create agent: ${Du.status}`)}const initialRuntimeState={runtime:null,status:"idle",error:null,isLaunching:!1,historyVersion:0,toolDecisionRequest:null},initialWsState={wsState:"closed",approvals:[],pendingApprovalCount:0,subagentActivity:{},compaction:null,contextSnapshot:null,costUsage:null,mcpStatus:null,codemodeStatus:null,fullContext:null,monitoringCache:{},loadedSkillsByAgentId:{}},initialNotebookState={ephemeralNotebookModels:{},ephemeralDocumentModels:{},editorModeByRuntime:{}},countPendingApprovals=Au=>Au.filter(lo=>lo.status==="pending").length;let _ws=null;const _wsByAgentId=new Map;function _resolveWs(Au){const lo=_wsByAgentId.size>0;if(Au){const $u=_wsByAgentId.get(Au);if($u&&$u.readyState===WebSocket.OPEN)return $u;if(lo)return null}return lo?null:_ws&&_ws.readyState===WebSocket.OPEN?_ws:null}const agentRuntimeStore=createStore$1()(subscribeWithSelector(persist((Au,lo)=>({agents:[],upsertAgent:$u=>{Au(Ru=>{const Iu=Ru.agents.findIndex(Du=>Du.id===$u.id),Pu=Date.now();if(Iu>=0){const Du=[...Ru.agents];return Du[Iu]={...Du[Iu],...$u,lastUpdated:Pu},{agents:Du}}const Ou={name:$u.name||$u.id,description:$u.description||"",status:$u.status||"initializing",lastUpdated:Pu,...$u};return{agents:[...Ru.agents,Ou]}})},getAgentById:$u=>lo().agents.find(Ru=>Ru.id===$u),getAgentByUrl:($u,Ru)=>lo().agents.find(Iu=>Iu.baseUrl===$u&&Iu.protocol===Ru),updateAgentStatus:($u,Ru,Iu=null)=>{Au(Pu=>{const Ou=Pu.agents.findIndex(Du=>Du.id===$u);if(Ou>=0){const Du=[...Pu.agents];return Du[Ou]={...Du[Ou],status:Ru,error:Iu,lastUpdated:Date.now()},{agents:Du}}return{}})},toggleAgentStatus:$u=>{Au(Ru=>{const Iu=Ru.agents.findIndex(Pu=>Pu.id===$u);if(Iu>=0){const Pu=[...Ru.agents],Ou=Pu[Iu].status;return Pu[Iu]={...Pu[Iu],status:Ou==="running"?"paused":"running",lastUpdated:Date.now()},{agents:Pu}}return{}})},deleteAgent:$u=>{Au(Ru=>{const{[$u]:Iu,...Pu}=Ru.loadedSkillsByAgentId;return{agents:Ru.agents.filter(Ou=>Ou.id!==$u),loadedSkillsByAgentId:Pu}})},clearAgents:()=>{Au({agents:[]})},setLoadedSkillsForAgent:($u,Ru)=>{Au(Iu=>({loadedSkillsByAgentId:{...Iu.loadedSkillsByAgentId,[$u]:Ru}}))},getLoadedSkillsForAgent:$u=>lo().loadedSkillsByAgentId[$u]??[],clearLoadedSkillsForAgent:$u=>{Au(Ru=>{if(!($u in Ru.loadedSkillsByAgentId))return{};const{[$u]:Iu,...Pu}=Ru.loadedSkillsByAgentId;return{loadedSkillsByAgentId:Pu}})},setEphemeralNotebookModel:($u,Ru)=>{Au(Iu=>({ephemeralNotebookModels:{...Iu.ephemeralNotebookModels,[$u]:Ru}}))},getEphemeralNotebookModel:$u=>lo().ephemeralNotebookModels[$u]??null,clearEphemeralNotebookModel:$u=>{Au(Ru=>{if(!($u in Ru.ephemeralNotebookModels))return{};const{[$u]:Iu,...Pu}=Ru.ephemeralNotebookModels;return{ephemeralNotebookModels:Pu}})},setEphemeralDocumentModel:($u,Ru)=>{Au(Iu=>({ephemeralDocumentModels:{...Iu.ephemeralDocumentModels,[$u]:Ru}}))},getEphemeralDocumentModel:$u=>lo().ephemeralDocumentModels[$u]??null,clearEphemeralDocumentModel:$u=>{Au(Ru=>{if(!($u in Ru.ephemeralDocumentModels))return{};const{[$u]:Iu,...Pu}=Ru.ephemeralDocumentModels;return{ephemeralDocumentModels:Pu}})},setEditorMode:($u,Ru)=>{$u&&Au(Iu=>({editorModeByRuntime:{...Iu.editorModeByRuntime,[$u]:Ru}}))},getEditorMode:$u=>lo().editorModeByRuntime[$u]??null,...initialRuntimeState,connectAgent:$u=>{const Ru=$u.jupyterBaseUrl||$u.serviceManager?.serverSettings.baseUrl;if(!Ru)throw new Error("connectAgent requires either jupyterBaseUrl or serviceManager");const Iu=toAgentRuntimeBaseUrl(Ru);Au({runtime:{runtimeName:$u.runtimeName,environmentName:$u.environmentName,jupyterBaseUrl:Ru,agentBaseUrl:Iu,serviceManager:$u.serviceManager,status:"ready",kernelId:$u.kernelId},status:"ready",error:null})},launchAgent:async $u=>{Au({status:"launching",error:null,isLaunching:!0});try{const{createRuntime:Ru}=await __vitePreload(async()=>{const{createRuntime:ju}=await Promise.resolve().then(()=>actions);return{createRuntime:ju}},void 0,import.meta.url),{runtimesStore:Iu}=await __vitePreload(async()=>{const{runtimesStore:ju}=await import("./chunks/substates-CqYxDlIh.js");return{runtimesStore:ju}},[],import.meta.url);$u.runtimesUrl&&Iu.setState({runtimesUrl:$u.runtimesUrl});const{runtimesUrl:Pu,...Ou}=$u,Du=await Ru({environmentName:Ou.environmentName,creditsLimit:Ou.creditsLimit,type:Ou.type||"notebook",givenName:Ou.givenName,capabilities:Ou.capabilities,snapshot:Ou.snapshot,appSpec:Ou.appSpec,appUid:Ou.appUid,deploymentUid:Ou.deploymentUid});Au({status:"connecting"});const Mu=Du.ingress,Lu=toAgentRuntimeBaseUrl(Mu),Bu={runtimeName:Du.runtime_name,environmentName:Du.environment.name,jupyterBaseUrl:Mu,agentBaseUrl:Lu,status:"ready"};return Au({runtime:Bu,status:"ready",isLaunching:!1}),Bu}catch(Ru){const Iu=Ru instanceof Error?Ru.message:"Failed to launch runtime";throw Au({status:"error",error:Iu,isLaunching:!1}),Ru}},createAgent:async($u={})=>{const{runtime:Ru}=lo();if(!Ru)throw new Error("No runtime connected. Launch or connect to a runtime first.");try{const Iu=$u.name||Ru.runtimeName,Pu=await createAgentOnRuntime(Ru.agentBaseUrl,Iu,$u);return Au({runtime:{...Ru,agentId:Pu.agentId,endpoint:Pu.endpoint,isReady:Pu.isReady}}),Pu}catch(Iu){const Pu=Iu instanceof Error?Iu.message:"Failed to create agent";throw Au({error:Pu}),Iu}},disconnect:()=>{Au({runtime:null,status:"disconnected",error:null})},clearError:()=>Au({error:null}),setError:$u=>Au({error:$u,status:"error"}),...initialWsState,...initialNotebookState,setWsState:$u=>Au({wsState:$u}),setWs:($u,Ru)=>{_ws=$u,Ru&&($u?_wsByAgentId.set(Ru,$u):_wsByAgentId.delete(Ru))},applySnapshot:$u=>Au(Ru=>({approvals:Ru.approvals,pendingApprovalCount:Ru.pendingApprovalCount,contextSnapshot:$u.contextSnapshot??null,costUsage:$u.costUsage??null,mcpStatus:$u.mcpStatus??null,codemodeStatus:$u.codemodeStatus??null,fullContext:$u.fullContext??null})),appendSubagentEvent:$u=>Au(Ru=>{const Iu=$u.toolCallId??$u.subagentName,Pu=Ru.subagentActivity[Iu]??[];return Pu.some(Ou=>Ou.phase==="error"&&Ou.error===SUBAGENT_STOPPED)?{}:{subagentActivity:{...Ru.subagentActivity,[Iu]:[...Pu,$u]}}}),clearSubagentActivity:()=>Au({subagentActivity:{}}),stopSubagentActivity:()=>Au($u=>{let Ru=!1;const Iu={};for(const[Pu,Ou]of Object.entries($u.subagentActivity)){if(Ou.length===0||isSubagentRunOver(Ou)){Iu[Pu]=Ou;continue}Ru=!0,Iu[Pu]=[...Ou,{subagentName:Ou[0].subagentName,toolCallId:Ou[0].toolCallId??Pu,phase:"error",error:SUBAGENT_STOPPED,transport:Ou[0].transport}]}return Ru?{subagentActivity:Iu}:{}}),requestHistoryReload:()=>Au($u=>({historyVersion:$u.historyVersion+1})),requestToolDecision:$u=>Au(Ru=>({toolDecisionRequest:{seq:(Ru.toolDecisionRequest?.seq??0)+1,...$u}})),setCompaction:$u=>Au({compaction:$u}),upsertApproval:$u=>Au(Ru=>{const Iu=Ru.approvals.filter(Ou=>Ou.id!==$u.id),Pu=[$u,...Iu];return{approvals:Pu,pendingApprovalCount:countPendingApprovals(Pu)}}),removeApproval:$u=>Au(Ru=>{const Iu=Ru.approvals.filter(Pu=>Pu.id!==$u);return{approvals:Iu,pendingApprovalCount:countPendingApprovals(Iu)}}),sendDecision:($u,Ru,Iu,Pu,Ou)=>{const Du=_resolveWs(Ou);return Du?(Du.send(JSON.stringify({type:"tool_approval_decision",approvalId:$u,approved:Ru,...Iu?{note:Iu}:{},...Pu?{toolCallId:Pu}:{}})),!0):!1},requestRefresh:$u=>{const Ru=_resolveWs($u);return Ru?(Ru.send(JSON.stringify({type:"request_snapshot"})),Ru.send(JSON.stringify({type:"request_otel_flush"})),!0):!1},sendRawMessage:($u,Ru)=>{const Iu=_resolveWs(Ru);return Iu?(Iu.send(JSON.stringify($u)),!0):!1},appendLocalTokenTurn:({serviceName:$u,agentId:Ru,timestampMs:Iu,promptTokens:Pu,completionTokens:Ou,totalTokens:Du})=>{Au(Mu=>{const Lu=getMonitoringCacheKey($u,Ru),Bu=Mu.monitoringCache[Lu]??{tokenTurns:[],costPoints:[]},ju=[...Bu.tokenTurns],Fu=ju[ju.length-1];if(Fu&&Fu.userMessageTokens===Pu&&Fu.aiMessageTokens===Ou&&Fu.systemPromptTokens===0&&Fu.toolsDescriptionTokens===0&&Fu.toolsUsageTokens===0&&Fu.totalTokens===Du)return ju[ju.length-1]={...Fu,timestampMs:Math.max(Fu.timestampMs,Iu)},{monitoringCache:{...Mu.monitoringCache,[Lu]:{...Bu,tokenTurns:ju}}};const zu=(Fu?.turnNumber??0)+1;return ju.push({turnNumber:zu,timestampMs:Iu,systemPromptTokens:0,toolsDescriptionTokens:0,userMessageTokens:Pu,aiMessageTokens:Ou,toolsUsageTokens:0,totalTokens:Du}),{monitoringCache:{...Mu.monitoringCache,[Lu]:{...Bu,tokenTurns:ju}}}})},mergeTokenTurns:({serviceName:$u,agentId:Ru,turns:Iu})=>{Iu.length!==0&&Au(Pu=>{const Ou=getMonitoringCacheKey($u,Ru),Du=Pu.monitoringCache[Ou]??{tokenTurns:[],costPoints:[]},Mu=new Map;for(const Bu of Du.tokenTurns)Mu.set(Bu.turnNumber,Bu);for(const Bu of Iu)Mu.set(Bu.turnNumber,Bu);const Lu=Array.from(Mu.values()).sort((Bu,ju)=>Bu.turnNumber-ju.turnNumber);return{monitoringCache:{...Pu.monitoringCache,[Ou]:{...Du,tokenTurns:Lu}}}})},appendLocalTokenTurnFull:({serviceName:$u,agentId:Ru,timestampMs:Iu,systemPromptTokens:Pu,toolsDescriptionTokens:Ou,userMessageTokens:Du,aiMessageTokens:Mu,toolsUsageTokens:Lu,totalTokens:Bu})=>{Au(ju=>{const Fu=getMonitoringCacheKey($u,Ru),zu=ju.monitoringCache[Fu]??{tokenTurns:[],costPoints:[]},Uu=[...zu.tokenTurns],Hu=Uu[Uu.length-1];if(Hu&&Hu.systemPromptTokens===Pu&&Hu.toolsDescriptionTokens===Ou&&Hu.userMessageTokens===Du&&Hu.aiMessageTokens===Mu&&Hu.toolsUsageTokens===Lu&&Hu.totalTokens===Bu)return Uu[Uu.length-1]={...Hu,timestampMs:Math.max(Hu.timestampMs,Iu)},{monitoringCache:{...ju.monitoringCache,[Fu]:{...zu,tokenTurns:Uu}}};const Vu=(Hu?.turnNumber??0)+1;return Uu.push({turnNumber:Vu,timestampMs:Iu,systemPromptTokens:Pu,toolsDescriptionTokens:Ou,userMessageTokens:Du,aiMessageTokens:Mu,toolsUsageTokens:Lu,totalTokens:Bu}),{monitoringCache:{...ju.monitoringCache,[Fu]:{...zu,tokenTurns:Uu}}}})},upsertLocalCostPoint:({serviceName:$u,agentId:Ru,timestampMs:Iu,cumulativeUsd:Pu})=>{Au(Ou=>{const Du=getMonitoringCacheKey($u,Ru),Mu=Ou.monitoringCache[Du]??{tokenTurns:[],costPoints:[]},Lu=[...Mu.costPoints],Bu=Lu.findIndex(ju=>Math.abs(ju.timestampMs-Iu)<1);return Bu>=0?Lu[Bu]={...Lu[Bu],cumulativeUsd:Math.max(Lu[Bu].cumulativeUsd,Pu)}:Lu.push({timestampMs:Iu,cumulativeUsd:Pu}),Lu.sort((ju,Fu)=>ju.timestampMs-Fu.timestampMs),{monitoringCache:{...Ou.monitoringCache,[Du]:{...Mu,costPoints:Lu}}}})},mergeCostPoints:({serviceName:$u,agentId:Ru,points:Iu})=>{Iu.length!==0&&Au(Pu=>{const Ou=getMonitoringCacheKey($u,Ru),Du=Pu.monitoringCache[Ou]??{tokenTurns:[],costPoints:[]},Mu=new Map;for(const Bu of Du.costPoints)Mu.set(Bu.timestampMs,Bu);for(const Bu of Iu){const ju=Mu.get(Bu.timestampMs);ju?Mu.set(Bu.timestampMs,{timestampMs:Bu.timestampMs,cumulativeUsd:Math.max(ju.cumulativeUsd,Bu.cumulativeUsd)}):Mu.set(Bu.timestampMs,Bu)}const Lu=Array.from(Mu.values()).sort((Bu,ju)=>Bu.timestampMs-ju.timestampMs);return{monitoringCache:{...Pu.monitoringCache,[Ou]:{...Du,costPoints:Lu}}}})},reset:()=>{if(_ws)try{_ws.close(1e3,"reset")}catch{}_ws=null,_wsByAgentId.clear(),Au($u=>({...initialRuntimeState,...initialWsState,ephemeralNotebookModels:$u.ephemeralNotebookModels,ephemeralDocumentModels:$u.ephemeralDocumentModels,editorModeByRuntime:$u.editorModeByRuntime}))},resetWs:()=>{if(_ws)try{_ws.close(1e3,"reset")}catch{}_ws=null,_wsByAgentId.clear(),Au($u=>({...initialWsState,ephemeralNotebookModels:$u.ephemeralNotebookModels,ephemeralDocumentModels:$u.ephemeralDocumentModels,editorModeByRuntime:$u.editorModeByRuntime,subagentActivity:$u.subagentActivity}))}}),{name:"agent-runtimes-storage",storage:createJSONStorage(()=>localStorage),partialize:Au=>({agents:Au.agents.map(lo=>({id:lo.id,name:lo.name,description:lo.description,baseUrl:lo.baseUrl,transport:lo.protocol,status:lo.status,lastUpdated:lo.lastUpdated,documentId:lo.documentId,runtimeId:lo.runtimeId})),monitoringCache:Au.monitoringCache,loadedSkillsByAgentId:Au.loadedSkillsByAgentId,ephemeralNotebookModels:Au.ephemeralNotebookModels,ephemeralDocumentModels:Au.ephemeralDocumentModels,editorModeByRuntime:Au.editorModeByRuntime})})));function useAgentRuntimeStore(Au){return useStore$1(agentRuntimeStore,Au||($u=>$u))}const useAgentRuntimeStoreWithStatics=useAgentRuntimeStore;useAgentRuntimeStoreWithStatics.getState=agentRuntimeStore.getState;useAgentRuntimeStoreWithStatics.subscribe=agentRuntimeStore.subscribe;const useAgentRuntimeConnection=()=>useAgentRuntimeStore(Au=>Au.runtime),useAgentRuntimeStatus=()=>useAgentRuntimeStore(Au=>Au.status),useAgentRuntimeError=()=>useAgentRuntimeStore(Au=>Au.error),useAgentRuntimeIsLaunching=()=>useAgentRuntimeStore(Au=>Au.isLaunching),useAgentRuntimeMcpStatus=()=>useAgentRuntimeStore(Au=>Au.mcpStatus),useAgentRuntimeFullContext=()=>useAgentRuntimeStore(Au=>Au.fullContext),useAgentRuntimeContextSnapshot=()=>useAgentRuntimeStore(Au=>Au.contextSnapshot),useAgentRuntimeCodemodeStatus=()=>useAgentRuntimeStore(Au=>Au.codemodeStatus),useAgentRuntimeWsState=()=>useAgentRuntimeStore(Au=>Au.wsState),EMPTY_SUBAGENT_EVENTS=[],useAgentRuntimeSubagentActivity=Au=>useAgentRuntimeStore(lo=>Au?lo.subagentActivity[Au]??EMPTY_SUBAGENT_EVENTS:EMPTY_SUBAGENT_EVENTS),useAgentRuntimeSubagentActivityByToolCall=(Au,lo)=>useAgentRuntimeStore($u=>{if(Au){const Ru=$u.subagentActivity[Au];if(Ru&&Ru.length>0)return Ru}if(lo){const Ru=$u.subagentActivity[lo];if(Ru&&Ru.length>0)return Ru;let Iu;for(const Pu of Object.values($u.subagentActivity))Pu.length>0&&Pu[0]?.subagentName===lo&&(Iu=Pu);if(Iu)return Iu}return EMPTY_SUBAGENT_EVENTS}),useAgentRuntimeActiveSubagentToolCallId=()=>useAgentRuntimeStore(Au=>{let lo=null;for(const[$u,Ru]of Object.entries(Au.subagentActivity))Ru.length!==0&&(isSubagentRunOver(Ru)||(lo=$u));return lo});agentRuntimeStore.subscribe;async function requestAPI(Au="",lo={}){const $u=libExports$3.ServerConnection.makeSettings(),Ru=libExports$5.URLExt.join($u.baseUrl,"agent_runtimes",Au);let Iu;try{Iu=await libExports$3.ServerConnection.makeRequest(Ru,lo,$u)}catch(Ou){throw new libExports$3.ServerConnection.NetworkError(Ou)}let Pu=await Iu.text();if(Pu.length>0)try{Pu=JSON.parse(Pu)}catch{}if(!Iu.ok)throw new libExports$3.ServerConnection.ResponseError(Iu,Pu.message||Pu);return Pu}function useConfig(Au,lo,$u,Ru){return reactExports.useContext(QueryClientContext)?useQuery({queryFn:async()=>{if(lo){const Pu={"Content-Type":"application/json"};$u&&(Pu.Authorization=`Bearer ${$u}`);let Ou=lo;if(Ru){const Mu=new URL(lo,window.location.origin);Mu.searchParams.set("agent_id",Ru),Ou=Mu.toString()}const Du=await fetch(Ou,{headers:Pu});if(!Du.ok)throw new Error(`Config fetch failed: ${Du.statusText}`);return Du.json()}return requestAPI("configure")},queryKey:["models",lo||"jupyter-server",Ru||"global"],enabled:Au,retry:1}):{data:void 0,isLoading:!1,isError:!1,error:null,refetch:()=>Promise.resolve({data:void 0})}}function parseSkillStatus(Au){return Au==="available"||Au==="enabled"||Au==="loaded"?Au:"available"}function useSkills(Au,lo,$u){const Ru=useAgentRuntimeCodemodeStatus(),Iu=reactExports.useMemo(()=>{if(!Ru)return;const Pu=(Ru.skills??[]).map(Ou=>({id:Ou.id??Ou.name,name:Ou.name,description:Ou.description,tags:Ou.tags,has_scripts:Ou.has_scripts,has_resources:Ou.has_resources,status:parseSkillStatus(Ou.status),approved:Ou.approved!==!1,skill_definition:Ou.skill_definition??null,source_variant:Ou.source_variant,module:Ou.module,package:Ou.package,method:Ou.method,path:Ou.path}));return{skills:Pu,total:Pu.length}},[Ru]);return{data:Iu,isLoading:!1,isError:!1,error:null,refetch:()=>Promise.resolve({data:Iu})}}function useSkillActions(Au){const lo=reactExports.useCallback(Pu=>{const Ou=agentRuntimeStore.getState().sendRawMessage({type:"skill_enable",skillId:Pu},Au);return Ou||console.warn("[useSkillActions] skill_enable dropped: websocket not ready"),Ou},[Au]),$u=reactExports.useCallback(Pu=>{const Ou=agentRuntimeStore.getState().sendRawMessage({type:"skill_disable",skillId:Pu},Au);return Ou||console.warn("[useSkillActions] skill_disable dropped: websocket not ready"),Ou},[Au]),Ru=reactExports.useCallback(Pu=>{const Ou=agentRuntimeStore.getState().sendRawMessage({type:"skill_approve",skillId:Pu},Au);return Ou||console.warn("[useSkillActions] skill_approve dropped: websocket not ready"),Ou},[Au]),Iu=reactExports.useCallback(Pu=>{const Ou=agentRuntimeStore.getState().sendRawMessage({type:"skill_unapprove",skillId:Pu},Au);return Ou||console.warn("[useSkillActions] skill_unapprove dropped: websocket not ready"),Ou},[Au]);return{enableSkill:lo,disableSkill:$u,approveSkill:Ru,unapproveSkill:Iu}}function useContextSnapshot(Au,lo,$u,Ru){return{data:useAgentRuntimeContextSnapshot()??void 0,isLoading:!1,isError:!1,error:null}}const RECONNECT_BASE_MS$1=1e3,RECONNECT_MAX_MS$1=3e4;function isRetryableCloseCode(Au){return!new Set([1002,1003,1007,1008,4401,4403]).has(Au)}function useSandbox(Au,lo,$u,Ru){const[Iu,Pu]=reactExports.useState(void 0),Ou=reactExports.useRef(null);reactExports.useEffect(()=>{if(!Au||!lo){Pu(void 0);return}const Mu=getApiBaseFromConfig(lo);if(!Mu)return;const Lu=Mu.replace(/^http/,"ws"),Bu=[];Ru&&Bu.push(`agent_id=${encodeURIComponent(Ru)}`),$u&&Bu.push(`token=${encodeURIComponent($u)}`);const ju=`${Lu}/configure/sandbox/ws${Bu.length?`?${Bu.join("&")}`:""}`;let Fu=!1,zu,Uu=0;const Hu=Gu=>{if(Fu||!isRetryableCloseCode(Gu))return;const Wu=Math.min(RECONNECT_BASE_MS$1*2**Uu,RECONNECT_MAX_MS$1);Uu+=1,zu=setTimeout(Vu,Wu)},Vu=()=>{if(Fu)return;const Gu=new WebSocket(ju);Ou.current=Gu,Gu.onopen=()=>{Uu=0},Gu.onmessage=Wu=>{try{const Zu=JSON.parse(Wu.data);if(Zu&&Zu.action==="interrupt")return;const Ju=typeof Zu?.variant=="string"?Zu.variant:"";Pu({available:Ju!=="unavailable"&&Ju!=="error",sandbox_running:!!Zu?.sandbox_running,is_executing:!!Zu?.is_executing,variant:Ju})}catch{}},Gu.onclose=Wu=>{Ou.current=null,Hu(Wu.code)},Gu.onerror=()=>{Gu.close()}};return Vu(),()=>{Fu=!0,zu&&clearTimeout(zu),Ou.current?.close(),Ou.current=null,Pu(void 0)}},[Au,lo,$u,Ru]);const Du=reactExports.useCallback(()=>{const Mu=Ou.current;Mu&&Mu.readyState===WebSocket.OPEN&&Mu.send(JSON.stringify({action:"interrupt"}))},[]);return{data:Iu,interrupt:Du}}function _typeof$8(Au){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(lo){return typeof lo}:function(lo){return lo&&typeof Symbol=="function"&&lo.constructor===Symbol&&lo!==Symbol.prototype?"symbol":typeof lo},_typeof$8(Au)}function _createClass$8(Au,lo,$u){return Object.defineProperty(Au,"prototype",{writable:!1}),Au}function _classCallCheck$8(Au,lo){if(!(Au instanceof lo))throw new TypeError("Cannot call a class as a function")}function _callSuper$1(Au,lo,$u){return lo=_getPrototypeOf$1(lo),_possibleConstructorReturn$1(Au,_isNativeReflectConstruct$1()?Reflect.construct(lo,$u||[],_getPrototypeOf$1(Au).constructor):lo.apply(Au,$u))}function _possibleConstructorReturn$1(Au,lo){if(lo&&(_typeof$8(lo)==="object"||typeof lo=="function"))return lo;if(lo!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(Au)}function _assertThisInitialized$1(Au){if(Au===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Au}function _inherits$1(Au,lo){if(typeof lo!="function"&&lo!==null)throw new TypeError("Super expression must either be null or a function");Au.prototype=Object.create(lo&&lo.prototype,{constructor:{value:Au,writable:!0,configurable:!0}}),Object.defineProperty(Au,"prototype",{writable:!1}),lo&&_setPrototypeOf$1(Au,lo)}function _wrapNativeSuper(Au){var lo=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(Ru){if(Ru===null||!_isNativeFunction(Ru))return Ru;if(typeof Ru!="function")throw new TypeError("Super expression must either be null or a function");if(typeof lo<"u"){if(lo.has(Ru))return lo.get(Ru);lo.set(Ru,Iu)}function Iu(){return _construct(Ru,arguments,_getPrototypeOf$1(this).constructor)}return Iu.prototype=Object.create(Ru.prototype,{constructor:{value:Iu,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(Iu,Ru)},_wrapNativeSuper(Au)}function _construct(Au,lo,$u){if(_isNativeReflectConstruct$1())return Reflect.construct.apply(null,arguments);var Ru=[null];Ru.push.apply(Ru,lo);var Iu=new(Au.bind.apply(Au,Ru));return $u&&_setPrototypeOf$1(Iu,$u.prototype),Iu}function _isNativeReflectConstruct$1(){try{var Au=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$1=function(){return!!Au})()}function _isNativeFunction(Au){try{return Function.toString.call(Au).indexOf("[native code]")!==-1}catch{return typeof Au=="function"}}function _setPrototypeOf$1(Au,lo){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ru,Iu){return Ru.__proto__=Iu,Ru},_setPrototypeOf$1(Au,lo)}function _getPrototypeOf$1(Au){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function($u){return $u.__proto__||Object.getPrototypeOf($u)},_getPrototypeOf$1(Au)}var DetailedError=(function(Au){function lo($u){var Ru,Iu=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Pu=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ou=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(_classCallCheck$8(this,lo),Ru=_callSuper$1(this,lo,[$u]),Ru.originalRequest=Pu,Ru.originalResponse=Ou,Ru.causingError=Iu,Iu!=null&&($u+=", caused by ".concat(Iu.toString())),Pu!=null){var Du=Pu.getHeader("X-Request-ID")||"n/a",Mu=Pu.getMethod(),Lu=Pu.getURL(),Bu=Ou?Ou.getStatus():"n/a",ju=Ou?Ou.getBody()||"":"n/a";$u+=", originated from request (method: ".concat(Mu,", url: ").concat(Lu,", response code: ").concat(Bu,", response text: ").concat(ju,", request id: ").concat(Du,")")}return Ru.message=$u,Ru}return _inherits$1(lo,Au),_createClass$8(lo)})(_wrapNativeSuper(Error));function log(Au){}function _typeof$7(Au){"@babel/helpers - typeof";return _typeof$7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(lo){return typeof lo}:function(lo){return lo&&typeof Symbol=="function"&&lo.constructor===Symbol&&lo!==Symbol.prototype?"symbol":typeof lo},_typeof$7(Au)}function _classCallCheck$7(Au,lo){if(!(Au instanceof lo))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(Au,lo){for(var $u=0;$u<lo.length;$u++){var Ru=lo[$u];Ru.enumerable=Ru.enumerable||!1,Ru.configurable=!0,"value"in Ru&&(Ru.writable=!0),Object.defineProperty(Au,_toPropertyKey$7(Ru.key),Ru)}}function _createClass$7(Au,lo,$u){return lo&&_defineProperties$7(Au.prototype,lo),Object.defineProperty(Au,"prototype",{writable:!1}),Au}function _toPropertyKey$7(Au){var lo=_toPrimitive$7(Au,"string");return _typeof$7(lo)=="symbol"?lo:lo+""}function _toPrimitive$7(Au,lo){if(_typeof$7(Au)!="object"||!Au)return Au;var $u=Au[Symbol.toPrimitive];if($u!==void 0){var Ru=$u.call(Au,lo);if(_typeof$7(Ru)!="object")return Ru;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Au)}var NoopUrlStorage=(function(){function Au(){_classCallCheck$7(this,Au)}return _createClass$7(Au,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function($u){return Promise.resolve([])}},{key:"removeUpload",value:function($u){return Promise.resolve()}},{key:"addUpload",value:function($u,Ru){return Promise.resolve(null)}}])})();const version$1="3.9.6",VERSION=version$1,_TD=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,_TE=typeof TextEncoder=="function"?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(Au=>{let lo={};return Au.forEach(($u,Ru)=>lo[$u]=Ru),lo})(b64chs),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):Au=>new Uint8Array(Array.prototype.slice.call(Au,0)),_mkUriSafe=Au=>Au.replace(/=/g,"").replace(/[+\/]/g,lo=>lo=="+"?"-":"_"),_tidyB64=Au=>Au.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=Au=>{let lo,$u,Ru,Iu,Pu="";const Ou=Au.length%3;for(let Du=0;Du<Au.length;){if(($u=Au.charCodeAt(Du++))>255||(Ru=Au.charCodeAt(Du++))>255||(Iu=Au.charCodeAt(Du++))>255)throw new TypeError("invalid character found");lo=$u<<16|Ru<<8|Iu,Pu+=b64chs[lo>>18&63]+b64chs[lo>>12&63]+b64chs[lo>>6&63]+b64chs[lo&63]}return Ou?Pu.slice(0,Ou-3)+"===".substring(Ou):Pu},_btoa=typeof btoa=="function"?Au=>btoa(Au):btoaPolyfill,_fromUint8Array=typeof Uint8Array.prototype.toBase64=="function"?Function.prototype.call.bind(Uint8Array.prototype.toBase64):Au=>{let $u=[];for(let Ru=0,Iu=Au.length;Ru<Iu;Ru+=4096)$u.push(_fromCC.apply(null,Au.subarray(Ru,Ru+4096)));return _btoa($u.join(""))},fromUint8Array=(Au,lo=!1)=>lo?_mkUriSafe(_fromUint8Array(Au)):_fromUint8Array(Au),cb_utob=Au=>{if(Au.length<2){var lo=Au.charCodeAt(0);return lo<128?Au:lo<2048?_fromCC(192|lo>>>6)+_fromCC(128|lo&63):_fromCC(224|lo>>>12&15)+_fromCC(128|lo>>>6&63)+_fromCC(128|lo&63)}else{var lo=65536+(Au.charCodeAt(0)-55296)*1024+(Au.charCodeAt(1)-56320);return _fromCC(240|lo>>>18&7)+_fromCC(128|lo>>>12&63)+_fromCC(128|lo>>>6&63)+_fromCC(128|lo&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,utob=Au=>Au.replace(re_utob,cb_utob),_encode=_TE?Au=>_fromUint8Array(_TE.encode(Au)):Au=>_btoa(utob(Au)),encode$3=(Au,lo=!1)=>lo?_mkUriSafe(_encode(Au)):_encode(Au),encodeURI$1=Au=>encode$3(Au,!0),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=Au=>{switch(Au.length){case 4:var lo=(7&Au.charCodeAt(0))<<18|(63&Au.charCodeAt(1))<<12|(63&Au.charCodeAt(2))<<6|63&Au.charCodeAt(3),$u=lo-65536;return _fromCC(($u>>>10)+55296)+_fromCC(($u&1023)+56320);case 3:return _fromCC((15&Au.charCodeAt(0))<<12|(63&Au.charCodeAt(1))<<6|63&Au.charCodeAt(2));default:return _fromCC((31&Au.charCodeAt(0))<<6|63&Au.charCodeAt(1))}},btou=Au=>Au.replace(re_btou,cb_btou),atobPolyfill=Au=>{if(Au=Au.replace(/\s+/g,""),!b64re.test(Au))throw new TypeError("malformed base64.");Au+="==".slice(2-(Au.length&3));let lo,$u,Ru,Iu=[];for(let Pu=0;Pu<Au.length;)lo=b64tab[Au.charAt(Pu++)]<<18|b64tab[Au.charAt(Pu++)]<<12|($u=b64tab[Au.charAt(Pu++)])<<6|(Ru=b64tab[Au.charAt(Pu++)]),$u===64?Iu.push(_fromCC(lo>>16&255)):Ru===64?Iu.push(_fromCC(lo>>16&255,lo>>8&255)):Iu.push(_fromCC(lo>>16&255,lo>>8&255,lo&255));return Iu.join("")},_atob=typeof atob=="function"?Au=>atob(_tidyB64(Au)):atobPolyfill,_toUint8Array=typeof Uint8Array.fromBase64=="function"?Au=>Uint8Array.fromBase64(Au):Au=>_U8Afrom(_atob(Au).split("").map(lo=>lo.charCodeAt(0))),toUint8Array=Au=>_toUint8Array(_unURI(Au)),_decode=_TD?Au=>_TD.decode(_toUint8Array(Au)):Au=>btou(_atob(Au)),_unURI=Au=>_tidyB64(Au.replace(/[-_]/g,lo=>lo=="-"?"+":"/")),decode$3=Au=>_decode(_unURI(Au)),isValid$1=Au=>{if(typeof Au!="string")return!1;const lo=Au.replace(/\s+/g,"").replace(/={0,2}$/,"");return lo.length%4===1?!1:!/[^\s0-9a-zA-Z\+/]/.test(lo)||!/[^\s0-9a-zA-Z\-_]/.test(lo)},_noEnum=Au=>({value:Au,enumerable:!1,writable:!0,configurable:!0}),extendString=function(){const Au=(lo,$u)=>Object.defineProperty(String.prototype,lo,_noEnum($u));Au("fromBase64",function(){return decode$3(this)}),Au("toBase64",function(lo){return encode$3(this,lo)}),Au("toBase64URI",function(){return encode$3(this,!0)}),Au("toBase64URL",function(){return encode$3(this,!0)}),Au("toUint8Array",function(){return toUint8Array(this)})},extendUint8Array=function(){const Au=(lo,$u)=>Object.defineProperty(Uint8Array.prototype,lo,_noEnum($u));Au("toBase64",function(lo){return fromUint8Array(this,lo)}),Au("toBase64URI",function(){return fromUint8Array(this,!0)}),Au("toBase64URL",function(){return fromUint8Array(this,!0)})},extendBuiltins=()=>{extendString(),extendUint8Array()},gBase64={version:version$1,VERSION,atob:_atob,atobPolyfill,btoa:_btoa,btoaPolyfill,fromBase64:decode$3,toBase64:encode$3,encode:encode$3,encodeURI:encodeURI$1,encodeURL:encodeURI$1,utob,btou,decode:decode$3,isValid:isValid$1,fromUint8Array,toUint8Array,extendString,extendUint8Array,extendBuiltins};var urlParseExports=requireUrlParse();const URL$1=getDefaultExportFromCjs(urlParseExports);function uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(Au){var lo=Math.random()*16|0,$u=Au==="x"?lo:lo&3|8;return $u.toString(16)})}function _regeneratorRuntime$1(){_regeneratorRuntime$1=function(){return lo};var Au,lo={},$u=Object.prototype,Ru=$u.hasOwnProperty,Iu=Object.defineProperty||function(_d,yd,Sd){_d[yd]=Sd.value},Pu=typeof Symbol=="function"?Symbol:{},Ou=Pu.iterator||"@@iterator",Du=Pu.asyncIterator||"@@asyncIterator",Mu=Pu.toStringTag||"@@toStringTag";function Lu(_d,yd,Sd){return Object.defineProperty(_d,yd,{value:Sd,enumerable:!0,configurable:!0,writable:!0}),_d[yd]}try{Lu({},"")}catch{Lu=function(Sd,kd,md){return Sd[kd]=md}}function Bu(_d,yd,Sd,kd){var md=yd&&yd.prototype instanceof Gu?yd:Gu,dd=Object.create(md.prototype),vd=new bd(kd||[]);return Iu(dd,"_invoke",{value:od(_d,Sd,vd)}),dd}function ju(_d,yd,Sd){try{return{type:"normal",arg:_d.call(yd,Sd)}}catch(kd){return{type:"throw",arg:kd}}}lo.wrap=Bu;var Fu="suspendedStart",zu="suspendedYield",Uu="executing",Hu="completed",Vu={};function Gu(){}function Wu(){}function Zu(){}var Ju={};Lu(Ju,Ou,function(){return this});var Yu=Object.getPrototypeOf,Xu=Yu&&Yu(Yu(wd([])));Xu&&Xu!==$u&&Ru.call(Xu,Ou)&&(Ju=Xu);var ed=Zu.prototype=Gu.prototype=Object.create(Ju);function td(_d){["next","throw","return"].forEach(function(yd){Lu(_d,yd,function(Sd){return this._invoke(yd,Sd)})})}function nd(_d,yd){function Sd(md,dd,vd,ld){var ud=ju(_d[md],_d,dd);if(ud.type!=="throw"){var hd=ud.arg,gd=hd.value;return gd&&_typeof$6(gd)=="object"&&Ru.call(gd,"__await")?yd.resolve(gd.__await).then(function(Ed){Sd("next",Ed,vd,ld)},function(Ed){Sd("throw",Ed,vd,ld)}):yd.resolve(gd).then(function(Ed){hd.value=Ed,vd(hd)},function(Ed){return Sd("throw",Ed,vd,ld)})}ld(ud.arg)}var kd;Iu(this,"_invoke",{value:function(dd,vd){function ld(){return new yd(function(ud,hd){Sd(dd,vd,ud,hd)})}return kd=kd?kd.then(ld,ld):ld()}})}function od(_d,yd,Sd){var kd=Fu;return function(md,dd){if(kd===Uu)throw Error("Generator is already running");if(kd===Hu){if(md==="throw")throw dd;return{value:Au,done:!0}}for(Sd.method=md,Sd.arg=dd;;){var vd=Sd.delegate;if(vd){var ld=sd(vd,Sd);if(ld){if(ld===Vu)continue;return ld}}if(Sd.method==="next")Sd.sent=Sd._sent=Sd.arg;else if(Sd.method==="throw"){if(kd===Fu)throw kd=Hu,Sd.arg;Sd.dispatchException(Sd.arg)}else Sd.method==="return"&&Sd.abrupt("return",Sd.arg);kd=Uu;var ud=ju(_d,yd,Sd);if(ud.type==="normal"){if(kd=Sd.done?Hu:zu,ud.arg===Vu)continue;return{value:ud.arg,done:Sd.done}}ud.type==="throw"&&(kd=Hu,Sd.method="throw",Sd.arg=ud.arg)}}}function sd(_d,yd){var Sd=yd.method,kd=_d.iterator[Sd];if(kd===Au)return yd.delegate=null,Sd==="throw"&&_d.iterator.return&&(yd.method="return",yd.arg=Au,sd(_d,yd),yd.method==="throw")||Sd!=="return"&&(yd.method="throw",yd.arg=new TypeError("The iterator does not provide a '"+Sd+"' method")),Vu;var md=ju(kd,_d.iterator,yd.arg);if(md.type==="throw")return yd.method="throw",yd.arg=md.arg,yd.delegate=null,Vu;var dd=md.arg;return dd?dd.done?(yd[_d.resultName]=dd.value,yd.next=_d.nextLoc,yd.method!=="return"&&(yd.method="next",yd.arg=Au),yd.delegate=null,Vu):dd:(yd.method="throw",yd.arg=new TypeError("iterator result is not an object"),yd.delegate=null,Vu)}function ad(_d){var yd={tryLoc:_d[0]};1 in _d&&(yd.catchLoc=_d[1]),2 in _d&&(yd.finallyLoc=_d[2],yd.afterLoc=_d[3]),this.tryEntries.push(yd)}function pd(_d){var yd=_d.completion||{};yd.type="normal",delete yd.arg,_d.completion=yd}function bd(_d){this.tryEntries=[{tryLoc:"root"}],_d.forEach(ad,this),this.reset(!0)}function wd(_d){if(_d||_d===""){var yd=_d[Ou];if(yd)return yd.call(_d);if(typeof _d.next=="function")return _d;if(!isNaN(_d.length)){var Sd=-1,kd=function md(){for(;++Sd<_d.length;)if(Ru.call(_d,Sd))return md.value=_d[Sd],md.done=!1,md;return md.value=Au,md.done=!0,md};return kd.next=kd}}throw new TypeError(_typeof$6(_d)+" is not iterable")}return Wu.prototype=Zu,Iu(ed,"constructor",{value:Zu,configurable:!0}),Iu(Zu,"constructor",{value:Wu,configurable:!0}),Wu.displayName=Lu(Zu,Mu,"GeneratorFunction"),lo.isGeneratorFunction=function(_d){var yd=typeof _d=="function"&&_d.constructor;return!!yd&&(yd===Wu||(yd.displayName||yd.name)==="GeneratorFunction")},lo.mark=function(_d){return Object.setPrototypeOf?Object.setPrototypeOf(_d,Zu):(_d.__proto__=Zu,Lu(_d,Mu,"GeneratorFunction")),_d.prototype=Object.create(ed),_d},lo.awrap=function(_d){return{__await:_d}},td(nd.prototype),Lu(nd.prototype,Du,function(){return this}),lo.AsyncIterator=nd,lo.async=function(_d,yd,Sd,kd,md){md===void 0&&(md=Promise);var dd=new nd(Bu(_d,yd,Sd,kd),md);return lo.isGeneratorFunction(yd)?dd:dd.next().then(function(vd){return vd.done?vd.value:dd.next()})},td(ed),Lu(ed,Mu,"Generator"),Lu(ed,Ou,function(){return this}),Lu(ed,"toString",function(){return"[object Generator]"}),lo.keys=function(_d){var yd=Object(_d),Sd=[];for(var kd in yd)Sd.push(kd);return Sd.reverse(),function md(){for(;Sd.length;){var dd=Sd.pop();if(dd in yd)return md.value=dd,md.done=!1,md}return md.done=!0,md}},lo.values=wd,bd.prototype={constructor:bd,reset:function(yd){if(this.prev=0,this.next=0,this.sent=this._sent=Au,this.done=!1,this.delegate=null,this.method="next",this.arg=Au,this.tryEntries.forEach(pd),!yd)for(var Sd in this)Sd.charAt(0)==="t"&&Ru.call(this,Sd)&&!isNaN(+Sd.slice(1))&&(this[Sd]=Au)},stop:function(){this.done=!0;var yd=this.tryEntries[0].completion;if(yd.type==="throw")throw yd.arg;return this.rval},dispatchException:function(yd){if(this.done)throw yd;var Sd=this;function kd(hd,gd){return vd.type="throw",vd.arg=yd,Sd.next=hd,gd&&(Sd.method="next",Sd.arg=Au),!!gd}for(var md=this.tryEntries.length-1;md>=0;--md){var dd=this.tryEntries[md],vd=dd.completion;if(dd.tryLoc==="root")return kd("end");if(dd.tryLoc<=this.prev){var ld=Ru.call(dd,"catchLoc"),ud=Ru.call(dd,"finallyLoc");if(ld&&ud){if(this.prev<dd.catchLoc)return kd(dd.catchLoc,!0);if(this.prev<dd.finallyLoc)return kd(dd.finallyLoc)}else if(ld){if(this.prev<dd.catchLoc)return kd(dd.catchLoc,!0)}else{if(!ud)throw Error("try statement without catch or finally");if(this.prev<dd.finallyLoc)return kd(dd.finallyLoc)}}}},abrupt:function(yd,Sd){for(var kd=this.tryEntries.length-1;kd>=0;--kd){var md=this.tryEntries[kd];if(md.tryLoc<=this.prev&&Ru.call(md,"finallyLoc")&&this.prev<md.finallyLoc){var dd=md;break}}dd&&(yd==="break"||yd==="continue")&&dd.tryLoc<=Sd&&Sd<=dd.finallyLoc&&(dd=null);var vd=dd?dd.completion:{};return vd.type=yd,vd.arg=Sd,dd?(this.method="next",this.next=dd.finallyLoc,Vu):this.complete(vd)},complete:function(yd,Sd){if(yd.type==="throw")throw yd.arg;return yd.type==="break"||yd.type==="continue"?this.next=yd.arg:yd.type==="return"?(this.rval=this.arg=yd.arg,this.method="return",this.next="end"):yd.type==="normal"&&Sd&&(this.next=Sd),Vu},finish:function(yd){for(var Sd=this.tryEntries.length-1;Sd>=0;--Sd){var kd=this.tryEntries[Sd];if(kd.finallyLoc===yd)return this.complete(kd.completion,kd.afterLoc),pd(kd),Vu}},catch:function(yd){for(var Sd=this.tryEntries.length-1;Sd>=0;--Sd){var kd=this.tryEntries[Sd];if(kd.tryLoc===yd){var md=kd.completion;if(md.type==="throw"){var dd=md.arg;pd(kd)}return dd}}throw Error("illegal catch attempt")},delegateYield:function(yd,Sd,kd){return this.delegate={iterator:wd(yd),resultName:Sd,nextLoc:kd},this.method==="next"&&(this.arg=Au),Vu}},lo}function asyncGeneratorStep$1(Au,lo,$u,Ru,Iu,Pu,Ou){try{var Du=Au[Pu](Ou),Mu=Du.value}catch(Lu){$u(Lu);return}Du.done?lo(Mu):Promise.resolve(Mu).then(Ru,Iu)}function _asyncToGenerator$1(Au){return function(){var lo=this,$u=arguments;return new Promise(function(Ru,Iu){var Pu=Au.apply(lo,$u);function Ou(Mu){asyncGeneratorStep$1(Pu,Ru,Iu,Ou,Du,"next",Mu)}function Du(Mu){asyncGeneratorStep$1(Pu,Ru,Iu,Ou,Du,"throw",Mu)}Ou(void 0)})}}function _slicedToArray$1(Au,lo){return _arrayWithHoles$1(Au)||_iterableToArrayLimit$1(Au,lo)||_unsupportedIterableToArray$1(Au,lo)||_nonIterableRest$1()}function _nonIterableRest$1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -3399,7 +3399,7 @@ ${Pu}\`\`\``}),lo}const ChatCodeBlock=defineContributionPoint("chat.codeBlock"),
3399
3399
  `):""}function latestSaying(Au){for(let lo=Au.length-1;lo>=0;lo-=1){const $u=Au[lo];if($u.role!=="assistant"||typeof $u.toolName=="string")continue;const Ru=plainWordsOf($u.content);if(!Ru)continue;const Iu=markdownOf($u.content);if(Ru.length<=SAYING_LIMIT)return{id:String($u.id??lo),text:Ru,more:!1,markdown:Iu};const Pu=Ru.slice(0,SAYING_LIMIT),Ou=Pu.slice(0,Math.max(Pu.lastIndexOf(" "),SAYING_LIMIT*.6));return{id:String($u.id??lo),text:`${Ou.trimEnd()}…`,more:!0,markdown:Iu}}}function mouthOpening(Au){return Au<.08?0:Au<.3?1:Au<.6?2:3}const ASSISTANT_AWAY_KEY="datalayer-assistant-away";function keptAway(){try{if(window.localStorage.getItem(ASSISTANT_AWAY_KEY)==="always")return"always";if(window.sessionStorage.getItem(ASSISTANT_AWAY_KEY)==="session")return"session"}catch{}return"none"}function keepAway(Au){try{window.localStorage.removeItem(ASSISTANT_AWAY_KEY),window.sessionStorage.removeItem(ASSISTANT_AWAY_KEY),Au==="always"?window.localStorage.setItem(ASSISTANT_AWAY_KEY,"always"):Au==="session"&&window.sessionStorage.setItem(ASSISTANT_AWAY_KEY,"session")}catch{}}const ASSISTANT_OBSTACLES=['[role="dialog"]','[role="alertdialog"]',"dialog[open]",'[class*="prc-Overlay-Overlay"]',"[data-chat-composer]"].join(", "),POINTER_ROOM=24,POINTER_CALM_MS=1500;function boxesMeet(Au,lo,$u=0){return Au.left-$u<lo.right&&lo.left<Au.right+$u&&Au.top-$u<lo.bottom&&lo.top<Au.bottom+$u}function pointerNear(Au,lo,$u=POINTER_ROOM){return boxesMeet(Au,{left:lo.x,top:lo.y,right:lo.x,bottom:lo.y},$u)}const MOUTH_STEP_MS=110,WIDE=["wide1","wide2","wide3","wide4"],BY_OPENING={0:["closed","narrow"],1:["narrow","medium","closed"],2:["medium","narrow",...WIDE],3:[...WIDE,"medium"]};function mouthFor(Au,lo,$u=Math.random()){const Ru=Object.keys(Au?.mouths??{});if(Ru.length===0)return;if(lo===void 0)return Ru[Math.min(Ru.length-1,Math.floor($u*Ru.length))];const Iu=BY_OPENING[mouthOpening(lo)],Pu=WIDE.filter(Ou=>Ru.includes(Ou));return mouthOpening(lo)===3&&Pu.length>0?Pu[Math.min(Pu.length-1,Math.floor($u*Pu.length))]:Iu.find(Ou=>Ru.includes(Ou))??Ru[0]}function playCharacterSound(Au){const lo=new Audio(Au);Promise.resolve(lo.play()).catch($u=>{console.warn(`A sound of the character was not played: ${String($u)}`)})}function nextFrameIndex(Au,lo,$u=Math.random()){const Ru=Au.frames[lo];let Iu=$u*100;for(const Pu of Ru?.branching??[]){if(Iu<Pu.weight)return Pu.frameIndex;Iu-=Pu.weight}return lo+1<Au.frames.length?lo+1:void 0}function animationFor(Au,lo,$u=Math.random()){const Ru=stateAnimations(Au)[lo];return Ru[Math.min(Ru.length-1,Math.floor($u*Ru.length))]}const reducedMotion=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function SpriteCharacter({character:Au,state:lo,size:$u,sounds:Ru=!1,mouthLevel:Iu,playSound:Pu=playCharacterSound}){const[Ou,Du]=reactExports.useState(()=>({name:animationFor(Au,lo),index:0}));reactExports.useEffect(()=>{Du({name:animationFor(Au,lo),index:0})},[Au,lo]);const Mu=Au.animations[Ou.name],Lu=Mu?.frames[Ou.index],Bu=reactExports.useMemo(reducedMotion,[]);reactExports.useEffect(()=>{if(!Mu||!Lu||Bu)return;const Ju=setTimeout(()=>{const Yu=nextFrameIndex(Mu,Ou.index);Du(Yu===void 0?{name:animationFor(Au,lo),index:0}:{name:Ou.name,index:Yu})},Math.max(Lu.duration,16));return()=>clearTimeout(Ju)},[Mu,Lu,Ou,Au,lo,Bu]);const ju=Ru&&Lu?.sound!==void 0?Au.sounds?.[Lu.sound]:void 0;reactExports.useEffect(()=>{ju&&Pu(ju)},[ju,Ou,Pu]);const Fu=lo==="speaking"&&!Bu&&!!Lu?.mouths,[zu,Uu]=reactExports.useState();reactExports.useEffect(()=>{if(!Fu){Uu(void 0);return}const Ju=()=>Uu(mouthFor(Lu,Iu?.()));Ju();const Yu=setInterval(Ju,MOUTH_STEP_MS);return()=>clearInterval(Yu)},[Fu,Lu,Iu]);const Hu=Fu&&zu?Lu?.mouths?.[zu]:void 0,Vu=Hu?[Hu]:Lu?.images??[],{width:Gu,height:Wu}=Au.frameSize,Zu=$u/Math.max(Gu,Wu);return jsxRuntimeExports.jsx("span",{className:"assistant-sprite",role:"img","aria-label":Au.name,"data-sprite-animation":Ou.name,...Hu?{"data-sprite-mouth":zu}:{},style:{position:"relative",display:"block",width:$u,height:$u},children:Vu.map((Ju,Yu)=>jsxRuntimeExports.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:($u-Gu*Zu)/2,top:($u-Wu*Zu)/2,width:Gu,height:Wu,transform:`scale(${Zu})`,transformOrigin:"top left",backgroundImage:`url(${Au.sprite})`,backgroundPosition:`-${Ju.x}px -${Ju.y}px`,backgroundRepeat:"no-repeat",imageRendering:"pixelated"}},Yu))})}const CLIPPY_JS_VERSION="0.1.0",CLIPPY_JS_SOURCE=`jsDelivr (clippyjs ${CLIPPY_JS_VERSION})`,BASE=`https://cdn.jsdelivr.net/npm/clippyjs@${CLIPPY_JS_VERSION}/dist/agents`,CLIPPY_JS_CHARACTERS=["Clippy","Merlin","Links","Rover","Genie","Genius","F1","Peedy","Rocky","Bonzi"],clippyJsCharacterId=Au=>`clippy-js-${Au.toLowerCase()}`;async function fetchText(Au){const lo=await fetch(Au);if(!lo.ok)throw new Error(`${Au} answered ${lo.status}.`);return lo.text()}function defaultExportText(Au,lo){const $u=/^var [A-Za-z_$][\w$]* = ([\s\S]*?);\s*export\s*\{/m.exec(Au);if(!$u)throw new Error(`${lo} does not export its value as clippy.js 0.1 does.`);return $u[1]}async function readClippyJsCharacter(Au){const lo=`${BASE}/${Au.toLowerCase()}`,[$u,Ru]=await Promise.all([fetchText(`${lo}/agent.mjs`),fetchText(`${lo}/map.mjs`)]),Iu=defaultExportText($u,`${Au}'s agent.mjs`),Pu=defaultExportText(Ru,`${Au}'s map.mjs`);if(!/^"data:image\/(png|gif|webp|jpeg);base64,[A-Za-z0-9+/=]+"$/.test(Pu))throw new Error(`${Au}'s map.mjs does not hold an image.`);const Ou=await(await fetch(Pu.slice(1,-1))).blob();return readClippyCharacter({agentJs:`clippy.ready(${JSON.stringify(Au)}, ${Iu});`,mapPng:Ou})}const FETCHED=new Map;function fetchClippyJsCharacter(Au){let lo=FETCHED.get(Au);return lo||(lo=readClippyJsCharacter(Au),FETCHED.set(Au,lo),lo.catch(()=>FETCHED.delete(Au))),lo}function clippyJsProblem(Au,lo){const $u=lo instanceof Error?lo.message:String(lo);return`${Au} could not be fetched from ${CLIPPY_JS_SOURCE}: ${$u} The paper clip stands in for it.`}function useClippyJsCharacter(Au){const[lo,$u]=reactExports.useState({});return reactExports.useEffect(()=>{let Ru=!1;return $u({}),fetchClippyJsCharacter(Au).then(Iu=>!Ru&&$u({character:Iu}),Iu=>!Ru&&$u({problem:clippyJsProblem(Au,Iu)})),()=>{Ru=!0}},[Au]),lo}const PaperClip=ASSISTANT_CHARACTERS[0].Drawing;function clippyJsDrawing(Au){return function({size:$u,mode:Ru,state:Iu="idle",mouthLevel:Pu}){const{character:Ou,problem:Du}=useClippyJsCharacter(Au);return Du?jsxRuntimeExports.jsxs("span",{title:Du,"data-assistant-fetch-problem":clippyJsCharacterId(Au),style:{display:"block",width:$u,height:$u},children:[jsxRuntimeExports.jsx(PaperClip,{size:$u,mode:Ru}),jsxRuntimeExports.jsx("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:Du})]}):Ou?jsxRuntimeExports.jsx(SpriteCharacter,{character:Ou,state:Iu,size:$u,mouthLevel:Pu}):jsxRuntimeExports.jsx("span",{"aria-busy":"true","data-assistant-fetching":clippyJsCharacterId(Au),style:{display:"block",width:$u,height:$u}})}}const CLIPPY_JS_ASSISTANT_CHARACTERS=CLIPPY_JS_CHARACTERS.map(Au=>({id:clippyJsCharacterId(Au),name:Au,family:"clippy-js",fetchedFrom:CLIPPY_JS_SOURCE,Drawing:clippyJsDrawing(Au)}));function orbStateOf(Au){return Au??"idle"}const SvgAvatarOrb=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/SvgAvatarOrb-BScIrM3b.js"),[],import.meta.url).then(Au=>({default:Au.SvgAvatarOrb})));function OrbDrawing({size:Au,state:lo}){return jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("span",{"aria-busy":"true",style:{display:"block",width:Au,height:Au}}),children:jsxRuntimeExports.jsx("span",{"data-assistant-orb":"theme",style:{display:"block"},children:jsxRuntimeExports.jsx(SvgAvatarOrb,{size:Au,state:orbStateOf(lo),tone:"theme"})})})}const ASSISTANT_ORB_CHARACTERS=[{id:"orb",name:"Orb",family:"orb",Drawing:OrbDrawing}],SHIPPED_ASSISTANT_CHARACTERS=[...ASSISTANT_ORB_CHARACTERS,...CLIPPY_JS_ASSISTANT_CHARACTERS,...ASSISTANT_CHARACTERS];function shippedAssistantCharacter(Au){const lo=SHIPPED_ASSISTANT_CHARACTERS.find($u=>$u.id===Au);if(!lo)throw new Error(`There is no assistant avatar "${Au}"; the avatars are ${SHIPPED_ASSISTANT_CHARACTERS.map($u=>$u.id).join(", ")}.`);return lo}function decidedByWords(Au){return`${Au.name} (${Au.model})`}function readAgentDecisions(Au){if(!Au||typeof Au!="object")return null;const lo=Au;return{spec:String(lo.spec),name:String(lo.name),model:String(lo.model),modelName:String(lo.model_name??lo.model),questions:Array.isArray(lo.questions)?lo.questions:[],maxQuestions:Number(lo.max_questions),maxTextLength:Number(lo.max_text_length)}}async function agentDecisionsAt(Au){const lo=Au.serverUrl.replace(/\/+$/,""),$u=Au.token?{Authorization:`Bearer ${Au.token}`}:void 0;try{const Ru=await fetch(Au.agentId?`${lo}/api/v1/agents/${encodeURIComponent(Au.agentId)}`:`${lo}/api/v1/agents`,{headers:$u});if(!Ru.ok)return;const Iu=await Ru.json(),Pu=Iu.agents,Ou=Au.agentId?Iu:Pu?.length===1?Pu[0]:void 0;return!Ou||!("decisions"in Ou)?void 0:readAgentDecisions(Ou.decisions)}catch{return}}const DEFAULT_DECISION_NAME="Answer",DEFAULT_SCORE_RANGE={from:1,to:5},MAX_SCORE_STEPS=11;function scoreSteps(Au){const lo=[];for(let $u=Au.from;$u<=Au.to;$u+=1)lo.push(String($u));return lo}function decisionAskProblem(Au){if(!Au.situation.trim())return"Say the situation the question is about.";if(!Au.question.trim())return"Ask a question.";if(Au.type==="choice"){const lo=(Au.options??[]).filter($u=>$u.trim());if(lo.length<2)return"A choice needs at least two options.";if(new Set(lo.map($u=>$u.trim())).size!==lo.length)return"Two options are the same."}if(Au.type==="score"){const lo=Au.range??DEFAULT_SCORE_RANGE;if(!Number.isInteger(lo.from)||!Number.isInteger(lo.to))return"A score goes from a whole number to another.";if(lo.to<=lo.from)return"A score goes from a lower number to a higher one.";if(lo.to-lo.from+1>MAX_SCORE_STEPS)return`A score has at most ${MAX_SCORE_STEPS} steps.`}}function decisionRequest(Au){const lo=Au.type==="choice"?(Au.options??[]).map($u=>$u.trim()).filter(Boolean):Au.type==="score"?scoreSteps(Au.range??DEFAULT_SCORE_RANGE):[];return{state:Au.situation.trim(),questions:[{name:Au.name?.trim()||DEFAULT_DECISION_NAME,type:Au.type,instructions:Au.question.trim(),options:lo}]}}function confidenceWords(Au){return String(Number(Au.toFixed(2)))}function decisionAnswerWords(Au,lo,$u=[]){if(typeof lo.probability=="number"&&lo.choice===void 0){const Iu=lo.probability>=.5;return`${Au}: ${Iu?"yes":"no"} (${confidenceWords(Iu?lo.probability:1-lo.probability)})`}const Ru=typeof lo.confidence=="number"?` (${confidenceWords(lo.confidence)})`:"";if(typeof lo.score=="number"){const Iu=$u.length?$u:Object.keys(lo.legend??{}).sort((Mu,Lu)=>Number(Mu)-Number(Lu)).map(Mu=>lo.legend?.[Mu]??Mu),Pu=lo.legend?.[String(lo.score)]??Iu[lo.score],Ou=Iu[Iu.length-1],Du=Iu.length>0&&Iu.every(Mu=>/^-?\d+$/.test(Mu.trim()));return`${Au}: ${Pu??lo.score+1}${Du&&Ou!==void 0?` of ${Ou}`:""}${Ru}`}return typeof lo.choice=="string"?`${Au}: ${lo.choice}${Ru}`:`${Au}: no answer`}function decisionResponseWords(Au,lo){if(lo.refusal)return lo.refusal;const[$u]=Au.questions,Ru=lo.answers?.[$u.name];return Ru?decisionAnswerWords($u.name,Ru,$u.options):"Nothing was decided: the answer did not come back."}function decisionsAskerAt(Au,lo,$u,Ru){const Iu=Au.replace(/\/+$/,""),Pu=async Ou=>{const Du=$u?{...Ou,agent_id:$u}:Ou;let Mu;try{Mu=await fetch(`${Iu}/api/v1/configure/inference/decisions`,{method:"POST",headers:{"Content-Type":"application/json",...lo?{Authorization:`Bearer ${lo}`}:{}},body:JSON.stringify(Du)})}catch{return{refusal:"Nothing was decided: the runtime could not be reached."}}if(!Mu.ok){let Lu="";try{const Bu=await Mu.json();Lu=typeof Bu.detail=="string"?Bu.detail:""}catch{}return{refusal:`Nothing was decided: the runtime refused it (${Mu.status})${Lu?`: ${Lu}`:"."}`}}return await Mu.json()};return Pu.decisions=Ru,Pu}const DECISION_WORDS={ask:"Ask a decision",asking:"Asking…",submit:"Ask",cancel:"Cancel",again:"Ask another",decidedBy:Au=>`Decided by ${Au}`,types:{noul:"Yes or no",choice:"A choice",score:"A score"}};function useDecisionAsker(Au){const lo=Au?.serverUrl,$u=Au?.token,Ru=Au?.agentId,[Iu,Pu]=reactExports.useState();return reactExports.useEffect(()=>{if(Pu(void 0),!lo)return;let Ou=!0;return agentDecisionsAt({serverUrl:lo,token:$u,agentId:Ru}).then(Du=>{Ou&&Pu(Du??void 0)}),()=>{Ou=!1}},[lo,$u,Ru]),reactExports.useMemo(()=>lo&&Iu?decisionsAskerAt(lo,$u,Ru,Iu):void 0,[lo,$u,Ru,Iu])}const LINK_SX={mt:1,p:0,border:0,bg:"transparent",color:"accent.fg",textDecoration:"underline",cursor:"pointer",fontSize:1};function DecisionAsk({ask:Au,onActiveChange:lo}){const[$u,Ru]=reactExports.useState(!1),[Iu,Pu]=reactExports.useState(""),[Ou,Du]=reactExports.useState(""),[Mu,Lu]=reactExports.useState(""),Bu=Object.keys(DECISION_WORDS.types).filter(pd=>!Au.decisions||Au.decisions.questions.includes(pd)),[ju,Fu]=reactExports.useState(Bu[0]??"noul"),[zu,Uu]=reactExports.useState(""),[Hu,Vu]=reactExports.useState(String(DEFAULT_SCORE_RANGE.from)),[Gu,Wu]=reactExports.useState(String(DEFAULT_SCORE_RANGE.to)),[Zu,Ju]=reactExports.useState(),[Yu,Xu]=reactExports.useState(!1),[ed,td]=reactExports.useState(),nd=reactExports.useRef(lo);nd.current=lo,reactExports.useEffect(()=>()=>nd.current?.(!1),[]);const od=pd=>{Ru(pd),lo?.(pd)},sd=()=>{td(void 0),Ju(void 0),od(!1)};if(!$u)return jsxRuntimeExports.jsx(Box,{as:"button",type:"button","data-balloon-ask-decision":"",onClick:()=>od(!0),...LINK_SX,display:"block",children:DECISION_WORDS.ask});if(ed!==void 0)return jsxRuntimeExports.jsxs(Box,{"data-balloon-decision":"answered",mt:2,children:[jsxRuntimeExports.jsx(Text$3,{as:"p","data-decision-answer":"",sx:{m:0,fontWeight:"semibold"},children:ed}),jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,mt:2,children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",onClick:()=>td(void 0),children:DECISION_WORDS.again}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"invisible",onClick:sd,children:DECISION_WORDS.cancel})]})]});const ad=async()=>{const pd={situation:Iu,question:Ou,type:ju,name:Mu,options:zu.split(`
3400
3400
  `),range:{from:Number(Hu),to:Number(Gu)}},bd=decisionAskProblem(pd);if(Ju(bd),bd)return;const wd=decisionRequest(pd);Xu(!0);try{td(decisionResponseWords(wd,await Au(wd)))}catch(_d){td(`Nothing was decided: ${_d instanceof Error?_d.message:String(_d)}`)}finally{Xu(!1)}};return jsxRuntimeExports.jsxs(Box,{as:"form","data-balloon-decision":"asking","aria-label":DECISION_WORDS.ask,onSubmit:pd=>{pd.preventDefault(),ad()},onKeyDown:pd=>{pd.key==="Escape"&&sd()},mt:2,display:"flex",flexDirection:"column",gap:2,children:[Au.decisions?jsxRuntimeExports.jsx(Text$3,{as:"p","data-decision-model":Au.decisions.model,sx:{m:0,fontSize:0,color:"fg.muted"},children:DECISION_WORDS.decidedBy(decidedByWords(Au.decisions))}):null,jsxRuntimeExports.jsxs(FormControl$1,{children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"Situation"}),jsxRuntimeExports.jsx(Textarea,{block:!0,rows:3,resize:"vertical",name:"situation",placeholder:"Help! My payouts have been failing for 3 days.",value:Iu,onChange:pd=>Pu(pd.target.value)})]}),jsxRuntimeExports.jsxs(FormControl$1,{children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"Question"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",name:"question",placeholder:"Is it urgent?",value:Ou,onChange:pd=>Du(pd.target.value)})]}),jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"Type"}),jsxRuntimeExports.jsx(Select$1,{block:!0,size:"small",name:"type",value:ju,onChange:pd=>Fu(pd.target.value),children:Bu.map(pd=>jsxRuntimeExports.jsx(Select$1.Option,{value:pd,children:DECISION_WORDS.types[pd]},pd))})]}),jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"Name"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",name:"name",placeholder:"Answer",value:Mu,onChange:pd=>Lu(pd.target.value)})]})]}),ju==="choice"&&jsxRuntimeExports.jsxs(FormControl$1,{children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"Options, one per line"}),jsxRuntimeExports.jsx(Textarea,{block:!0,rows:3,resize:"vertical",name:"options",placeholder:`Billing
3401
3401
  Tech
3402
- Sales`,value:zu,onChange:pd=>Uu(pd.target.value)})]}),ju==="score"&&jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"From"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",type:"number",name:"from",value:Hu,onChange:pd=>Vu(pd.target.value)})]}),jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"To"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",type:"number",name:"to",value:Gu,onChange:pd=>Wu(pd.target.value)})]})]}),Zu?jsxRuntimeExports.jsx(Text$3,{as:"p",role:"alert",sx:{m:0,color:"danger.fg",fontSize:0},children:Zu}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",type:"submit",disabled:Yu,children:Yu?DECISION_WORDS.asking:DECISION_WORDS.submit}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",type:"button",onClick:sd,disabled:Yu,children:DECISION_WORDS.cancel})]})]})}const DEFAULT_BALLOON_DISPLAY="history";let displayNames=null;function toolDisplayName(Au){if(!displayNames){displayNames=new Map;for(const Ru of Object.values(BACKEND_TOOL_CATALOG)){const Iu=Ru.runtime?.method;Iu&&Ru.name&&!displayNames.has(Iu)&&displayNames.set(Iu,Ru.name)}}const lo=displayNames.get(Au);if(lo)return lo;const $u=Au.indexOf("__");return $u>0?Au.slice($u+2):Au}function toolLineParts(Au,lo=ENGLISH_CHAT_WORDS){if(Au.phase==="running"&&Au.words)return{before:"",name:"",after:Au.words};switch(Au.phase){case"running":return{...lo.toolRunning,name:Au.name};case"done":return{...lo.toolDone,name:Au.name};case"failed":return{...lo.toolFailedLine,name:Au.name}}}function toolLineText(Au,lo=ENGLISH_CHAT_WORDS){const{before:$u,name:Ru,after:Iu}=toolLineParts(Au,lo);return`${$u}${Ru}${Iu}`}function newestToolLine(Au){const lo=Au[Au.length-1];if(!lo||typeof lo.toolName!="string"||!lo.toolName)return;const $u=lo.status==="error"||typeof lo.error=="string"&&lo.error?"failed":lo.status==="complete"?"done":"running";return{id:String(lo.toolCallId??lo.id??lo.toolName),tool:lo.toolName,name:toolDisplayName(lo.toolName),phase:$u}}function toolAnnouncement(Au,lo,$u=ENGLISH_CHAT_WORDS){if(Au&&!(lo&&lo.id===Au.id&&lo.phase===Au.phase))return toolLineText(Au,$u)}function conversationCount(Au){return Au.filter(lo=>{const $u=lo;return($u.role==="user"||$u.role==="assistant")&&typeof $u.toolName!="string"}).length}function displayItemOfLine(Au){return!Au.tool&&!Au.name?{id:`balloon-activity:${Au.id}`,role:"assistant",content:Au.words??"",createdAt:new Date(0)}:toolCallOfLine(Au)}function toolCallOfLine(Au){return{id:`balloon-tool:${Au.id}`,type:"tool-call",toolCallId:Au.id,toolName:Au.tool||Au.name,args:{},status:Au.phase==="failed"?"error":Au.phase==="done"?"complete":"executing",...Au.words?{summary:Au.words}:{}}}function withToolCall(Au,lo){return!lo||Au.some($u=>$u.toolCallId===lo.id||$u.id===lo.id)?Au:[...Au,displayItemOfLine(lo)]}const VISUALLY_HIDDEN={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},BALLOON_AVATARS={userAvatar:null,assistantAvatar:null,showAvatars:!1,avatarSize:0,userAvatarBg:"neutral.muted",assistantAvatarBg:"accent.emphasis"};async function respondInBalloon(Au,lo){if(lo&&typeof lo=="object"){const $u=lo;$u.type==="tool-approval-decision"&&typeof $u.approved=="boolean"&&typeof $u.approvalId=="string"&&agentRuntimeStore.getState().sendDecision($u.approvalId,$u.approved)}}function BalloonChatItems({items:Au,density:lo="compact",waiting:$u=!1}){const Ru=reactExports.useRef(null);return jsxRuntimeExports.jsx(Box,{"data-balloon-chat-items":"",minWidth:0,children:jsxRuntimeExports.jsx(ChatMessageList,{displayItems:Au,isLoading:$u,isStreaming:!1,showLoadingIndicator:$u,hideMessagesAfterToolUI:!1,avatarConfig:BALLOON_AVATARS,padding:0,onRespond:respondInBalloon,messagesEndRef:Ru,emptyContent:$u?jsxRuntimeExports.jsx(TypingDots,{size:6}):null,density:lo})})}function BalloonToolCall({line:Au,waiting:lo=!1}){return jsxRuntimeExports.jsx(Box,{"aria-hidden":"true","data-balloon-tool":Au.phase,"data-balloon-tool-name":Au.tool||void 0,minWidth:0,width:"100%",children:jsxRuntimeExports.jsx(BalloonChatItems,{items:[displayItemOfLine(Au)],waiting:lo})})}function ToolLineAnnouncer({line:Au}){const lo=useChatWords(),$u=reactExports.useRef(void 0),[Ru,Iu]=reactExports.useState("");return reactExports.useEffect(()=>{const Pu=toolAnnouncement(Au,$u.current,lo);Au&&Pu&&($u.current={id:Au.id,phase:Au.phase},Iu(Pu))},[Au?.id,Au?.phase]),jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite","data-balloon-announce":"",...VISUALLY_HIDDEN,children:Ru})}function WordsAnnouncer({text:Au,speaking:lo=!1}){const $u=reactExports.useRef(void 0),[Ru,Iu]=reactExports.useState("");return reactExports.useEffect(()=>{lo||!Au||Au===$u.current||($u.current=Au,Iu(plainWords(Au)))},[Au,lo]),jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite","data-balloon-words-announce":"",...VISUALLY_HIDDEN,children:Ru})}function BalloonNow({busy:Au=!1}){const lo=useChatWords();return jsxRuntimeExports.jsxs(Box,{as:"span","data-balloon-now":Au?"busy":"",display:"inline-flex",alignItems:"center",gap:"6px",fontSize:0,fontWeight:"semibold",color:"accent.fg",textTransform:"uppercase",letterSpacing:"0.04em",sx:{"@keyframes balloonNowBreathe":{"0%, 100%":{opacity:1,transform:"scale(1)"},"50%":{opacity:.35,transform:"scale(0.7)"}},"& [data-balloon-now-dot]":{width:6,height:6,borderRadius:"50%",bg:"accent.emphasis",animation:Au?"balloonNowBreathe 1.2s ease-in-out infinite":"none"},"@media (prefers-reduced-motion: reduce)":{"& [data-balloon-now-dot]":{animation:"none"}}},children:[jsxRuntimeExports.jsx(Box,{as:"span","data-balloon-now-dot":"","aria-hidden":"true"}),lo.now]})}function conversationHeaderText(Au,lo=ENGLISH_CHAT_WORDS){return Au>0?`${lo.conversation} · ${Au}`:lo.conversation}function ConversationBalloonHeader({count:Au}){const lo=useChatWords();return jsxRuntimeExports.jsx(Box,{"data-balloon-header":"",flexShrink:0,display:"flex",alignItems:"center",gap:2,pl:3,pr:6,py:2,borderBottom:"1px solid",borderColor:"border.muted",bg:"canvas.default",borderTopLeftRadius:"var(--theme-radius-bubble, 16px)",borderTopRightRadius:"var(--theme-radius-bubble, 16px)",children:jsxRuntimeExports.jsx(Text$3,{sx:{fontSize:0,fontWeight:"semibold",color:"fg.muted"},children:conversationHeaderText(Au,lo)})})}function CurrentBalloonBody({text:Au,tool:lo,busy:$u=!1,speaking:Ru=!1,attachment:Iu,waiting:Pu=!1,whole:Ou=!1,fullText:Du,onOverflow:Mu}){const Lu=reactExports.useRef(null),Bu=!Ou&&!!Au&&!!Du&&Du!==Au;return reactExports.useLayoutEffect(()=>{const ju=Lu.current;!ju||Ou||!Mu||Mu(ju.scrollHeight>ju.clientHeight+1)},[Au,Ou,Mu]),jsxRuntimeExports.jsxs(Box,{"data-balloon-current":"",display:"flex",flexDirection:"column",gap:1,minWidth:0,children:[jsxRuntimeExports.jsx(BalloonNow,{busy:$u}),lo?jsxRuntimeExports.jsx(BalloonToolCall,{line:lo,waiting:Pu}):Au?jsxRuntimeExports.jsxs(Box,{"aria-busy":Ru,ref:Lu,"data-balloon-current-text":Ou?"whole":"",maxHeight:Ou?240:"5.6em",overflowY:Ou?"auto":void 0,overflowWrap:"anywhere",pr:Ou?1:void 0,overflow:Ou?void 0:"hidden",children:[Bu?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{"aria-hidden":"true",children:jsxRuntimeExports.jsx(ChatMarkdown,{density:"compact",text:Au})}),jsxRuntimeExports.jsx(Box,{as:"span","data-balloon-words-whole":"",...VISUALLY_HIDDEN,children:plainWords(Du??"")})]}):jsxRuntimeExports.jsx(ChatMarkdown,{density:"compact",text:Ou?Du??Au:Au}),Pu&&jsxRuntimeExports.jsx(Box,{as:"span",ml:2,display:"inline-flex",children:jsxRuntimeExports.jsx(TypingDots,{size:5})})]}):Pu?jsxRuntimeExports.jsx(TypingDots,{size:6}):null,Iu,jsxRuntimeExports.jsx(WordsAnnouncer,{text:lo?void 0:Du??Au,speaking:Ru}),jsxRuntimeExports.jsx(ToolLineAnnouncer,{line:lo})]})}const BalloonExpandContext=reactExports.createContext(null);function BalloonExpandButton({title:Au,onExpand:lo}){const $u=useChatWords();return jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"invisible",leadingVisual:ScreenFullIcon,"aria-label":$u.expandWhat(Au),"data-balloon-expand":"",onClick:lo,sx:{alignSelf:"flex-start",px:1},children:$u.expand})}const EXPANDED_DIALOG_SIZE={width:"80vw",height:"80vh"};function ExpandedVisual({visual:Au,target:lo,onClose:$u}){const Ru=lo?.current;return lo?Ru?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Box,{"data-balloon-expanded":"target","data-balloon-visual":Au.id,position:"relative",minWidth:0,children:[jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,right:0,zIndex:1,children:jsxRuntimeExports.jsx(IconButton,{icon:Au.shrink?ScreenNormalIcon:XIcon,size:"small",variant:"invisible","aria-label":`${Au.shrink?"Shrink":"Close"} ${Au.title}`,"data-balloon-expanded-close":"",...Au.shrink?{"data-balloon-shrink":""}:{},onClick:$u})}),Au.render("target")]}),Ru):null:jsxRuntimeExports.jsx(Dialog$1,{title:Au.title,onClose:$u,sx:{width:EXPANDED_DIALOG_SIZE.width,maxWidth:EXPANDED_DIALOG_SIZE.width,height:EXPANDED_DIALOG_SIZE.height,maxHeight:EXPANDED_DIALOG_SIZE.height},children:jsxRuntimeExports.jsx(Box,{"data-balloon-expanded":"overlay","data-balloon-visual":Au.id,minWidth:0,children:Au.render("overlay")})})}function focusExpanded(Au){const lo=Au?.current;if(!lo)return;const $u=typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;lo.scrollIntoView?.({behavior:$u?"auto":"smooth",block:"start"}),(lo.querySelector('[tabindex="-1"]')??lo).focus?.({preventScroll:!0})}function BalloonSuggestions({suggestions:Au,onSuggestion:lo}){const $u=useChatWords();return jsxRuntimeExports.jsx(Box,{role:"group","aria-label":$u.suggestions,"data-balloon-suggestions":"",display:"flex",flexWrap:"wrap",gap:1,mt:2,children:Au.map(Ru=>jsxRuntimeExports.jsx(ButtonComponent,{size:"small","data-balloon-suggestion":Ru.label,"aria-label":`Ask: ${Ru.prompt}`,title:Ru.prompt,onClick:()=>lo(Ru),sx:{borderRadius:999},children:Ru.label},Ru.label))})}const BALLOON_HISTORY_MAX_HEIGHT=220,COPIED_MS=1500,BALLOON_HISTORY_WITH_ATTACHMENT_MAX_HEIGHT=120;function BalloonHistoryLarge({history:Au,tool:lo,attachment:$u}){const Ru=useChatWords();return jsxRuntimeExports.jsxs(Box,{role:"log","aria-label":Ru.conversation,"data-balloon-history-large":"",display:"flex",flexDirection:"column",gap:2,children:[jsxRuntimeExports.jsx(BalloonChatItems,{items:withToolCall(Au,lo),density:"comfortable"}),$u?jsxRuntimeExports.jsx(Box,{children:$u}):null]})}function BalloonHistory({history:Au,onOpen:lo,maxHeight:$u=BALLOON_HISTORY_MAX_HEIGHT,onExpand:Ru,tool:Iu,waiting:Pu=!1}){const Ou=useChatWords(),Du=reactExports.useRef(null),Mu=Au[Au.length-1]?.id;return reactExports.useEffect(()=>{const Lu=Du.current;Lu&&(Lu.scrollTop=Lu.scrollHeight)},[Au.length,Mu,Pu,Iu?.id,Iu?.phase]),reactExports.useEffect(()=>{const Lu=Du.current,Bu=Lu?.firstElementChild;if(!Lu||!Bu||typeof ResizeObserver>"u")return;const ju=new ResizeObserver(()=>{Lu.scrollTop=Lu.scrollHeight});return ju.observe(Bu),()=>ju.disconnect()},[]),jsxRuntimeExports.jsxs(Box,{"data-balloon-history":"",flex:1,minWidth:0,display:"flex",flexDirection:"column",children:[jsxRuntimeExports.jsx(Box,{as:"button",type:"button","data-balloon-peek":"","data-balloon-header":"",onClick:lo,m:0,p:0,pb:1,border:0,bg:"transparent",font:"inherit",textAlign:"left",cursor:"pointer",fontSize:0,fontWeight:"semibold",color:"fg.muted",hover:{textDecoration:"underline"},children:conversationHeaderText(conversationCount(Au),Ou)}),Ru?jsxRuntimeExports.jsx(IconButton,{icon:ScreenFullIcon,size:"small",variant:"invisible","aria-label":Ou.expandConversation,"data-balloon-history-expand":"",onClick:Ru,sx:{position:"absolute",top:"4px",right:"28px"}}):null,jsxRuntimeExports.jsx(Box,{ref:Du,role:"log","aria-label":Ou.conversation,"data-balloon-history-list":"",maxHeight:$u,overflowY:"auto",display:"flex",flexDirection:"column",pr:1,children:jsxRuntimeExports.jsx(BalloonChatItems,{items:withToolCall(Au,Iu),waiting:Pu})})]})}function SpeechBalloon({text:Au,more:lo=!1,onOpen:$u,above:Ru,side:Iu="above",align:Pu,tailAt:Ou,approval:Du,decide:Mu,onDecisionActive:Lu,wide:Bu=!1,onDismissPeek:ju,display:Fu="history",tool:zu,speaking:Uu=!1,busy:Hu=!1,attachment:Vu,history:Gu,onExpand:Wu,expandTitle:Zu,suggestions:Ju,onSuggestion:Yu,waiting:Xu=!1,fullText:ed,onExpandHistory:td}){const nd=useChatWords(),[od,sd]=reactExports.useState(!1),[ad,pd]=reactExports.useState(!1),[bd,wd]=reactExports.useState(!1),_d=async()=>{try{await globalThis.navigator?.clipboard?.writeText(Sd),wd(!0),setTimeout(()=>wd(!1),COPIED_MS)}catch{}},yd=!!ed&&ed!==Au||!!lo&&Au.endsWith("…"),Sd=ed??Au;reactExports.useEffect(()=>{sd(!1)},[Sd.slice(0,40)]);const kd=Ju&&Ju.length>0&&Yu&&!Du?Ju:null,md=Fu==="current",dd=!md&&Gu&&Gu.length>0?Gu:null;return jsxRuntimeExports.jsxs(Box,{"data-speech-balloon":"","data-balloon-display":Fu,maxWidth:Bu||dd||kd||od||md&&Vu?300:md?260:280,px:3,py:2,color:"fg.default",border:"1px solid",borderRadius:"bubble",boxShadow:"shadow.medium",fontSize:1,textAlign:"left",bottom:Iu==="above"?`${Ru}px`:void 0,top:Iu==="above"?void 0:`${Ru}px`,sx:{position:"absolute",[Pu]:0,width:Bu||dd||kd||od||md&&Vu?300:"max-content",bg:"canvas.overlay",borderColor:md?"accent.muted":"border.default","&::after":{content:'""',position:"absolute",...Iu==="above"?{bottom:"-7px"}:{top:"-7px"},[Pu]:`${Ou-6}px`,width:12,height:12,bg:"canvas.overlay",borderRight:"1px solid",borderBottom:"1px solid",borderColor:md?"accent.muted":"border.default",transform:Iu==="above"?"rotate(45deg)":"rotate(225deg)"}},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"flex-start",gap:1,children:[md&&!Du?jsxRuntimeExports.jsx(Box,{role:"button",tabIndex:0,"data-balloon-peek":"",onClick:vd=>{const ld=vd.target.closest("button");ld&&vd.currentTarget.contains(ld)||$u()},onKeyDown:vd=>{vd.target===vd.currentTarget&&(vd.key==="Enter"||vd.key===" ")&&(vd.preventDefault(),$u())},flex:1,minWidth:0,m:0,p:0,border:0,bg:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",children:jsxRuntimeExports.jsx(CurrentBalloonBody,{text:Au,tool:zu,busy:Hu,speaking:Uu,waiting:Xu,whole:od,fullText:Sd,onOverflow:pd})}):dd?jsxRuntimeExports.jsx(BalloonHistory,{history:dd,onOpen:$u,onExpand:td,tool:zu,waiting:Xu,maxHeight:Vu?BALLOON_HISTORY_WITH_ATTACHMENT_MAX_HEIGHT:BALLOON_HISTORY_MAX_HEIGHT}):zu?jsxRuntimeExports.jsx(Box,{flex:1,minWidth:0,children:jsxRuntimeExports.jsx(BalloonToolCall,{line:zu})}):jsxRuntimeExports.jsx(Box,{as:"button",type:"button","data-balloon-peek":"","data-balloon-more":lo?"":void 0,onClick:$u,flex:1,minWidth:0,m:0,p:0,border:0,bg:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",hover:{textDecoration:"underline"},children:jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite",children:Au})}),ju&&!Du?jsxRuntimeExports.jsx(IconButton,{icon:XIcon,size:"small",variant:"invisible","aria-label":nd.dismiss,"data-balloon-dismiss":"",onClick:ju,sx:{mt:"-4px",mr:"-8px",flexShrink:0}}):null]}),!Du&&!zu&&!dd&&Sd.trim()?jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mt:1,"data-balloon-under":"",children:[md&&(yd||ad||od)?jsxRuntimeExports.jsx(Box,{as:"button",type:"button","aria-expanded":od,"data-balloon-whole":od?"less":"more",onClick:()=>sd(!od),m:0,p:0,border:0,bg:"transparent",color:"accent.fg",font:"inherit",fontSize:0,cursor:"pointer",hover:{textDecoration:"underline"},children:od?nd.showLess:nd.showMore}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx(IconButton,{icon:bd?CheckIcon:CopyIcon,size:"small",variant:"invisible","aria-label":nd.copyWords,"data-balloon-copy":bd?"copied":"",onClick:vd=>{vd.stopPropagation(),_d()},sx:{color:"fg.muted",mr:"-6px",mb:"-4px"}})]}):null,!md&&!dd&&Xu?jsxRuntimeExports.jsx(Box,{"data-balloon-waiting":"",mt:1,children:jsxRuntimeExports.jsx(BalloonChatItems,{items:[],waiting:!0})}):null,Du&&jsxRuntimeExports.jsxs(Box,{"data-balloon-approval":Du.id,mt:1,children:[jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,fontWeight:"semibold"},children:Du.asks}),Du.why?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:Du.why}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,mt:2,children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",disabled:Du.deciding,onClick:Du.onApprove,children:nd.approve}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",disabled:Du.deciding,onClick:Du.onDeny,children:nd.deny})]}),Du.others>0?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,mt:1,color:"fg.muted",fontSize:0},children:nd.moreWaiting(Du.others)}):null]}),kd&&Yu?jsxRuntimeExports.jsx(BalloonSuggestions,{suggestions:kd,onSuggestion:Yu}):null,Vu?jsxRuntimeExports.jsxs(Box,{"data-balloon-attachment":"",mt:2,display:"flex",flexDirection:"column",gap:1,children:[Vu,Wu?jsxRuntimeExports.jsx(BalloonExpandButton,{title:Zu??nd.theVisual,onExpand:Wu}):null]}):null,md?null:jsxRuntimeExports.jsx(ToolLineAnnouncer,{line:zu}),Mu&&jsxRuntimeExports.jsx(DecisionAsk,{ask:Mu,onActiveChange:Lu})]})}const MENU_DESCRIPTION_MAX=60;function shortDescription(Au){const lo=Au.replace(/\s+/g," ").trim();if(lo.length<=MENU_DESCRIPTION_MAX)return lo;const $u=lo.slice(0,MENU_DESCRIPTION_MAX),Ru=$u.lastIndexOf(" ");return`${(Ru>MENU_DESCRIPTION_MAX/2?$u.slice(0,Ru):$u).replace(/[\s,.;:!?—-]+$/,"")}…`}function menuGroups(Au){const lo=[];for(const $u of Au){const Ru=lo.find(Iu=>Iu.group===$u.group);Ru?Ru.items.push($u):lo.push({group:$u.group,items:[$u]})}return[...lo.filter($u=>$u.group===void 0),...lo.filter($u=>$u.group!==void 0)]}function opensContextMenu(Au){return Au.key==="ContextMenu"||Au.key==="F10"&&Au.shiftKey}const LONG_PRESS_MS=550;function AssistantContextMenu({at:Au,items:lo,onClose:$u,returnFocusRef:Ru,label:Iu}){const Pu=reactExports.useRef(null),Ou=Au!==null;if(reactExports.useEffect(()=>{if(!Ou)return;const Mu=()=>$u();return window.addEventListener("scroll",Mu,!0),()=>window.removeEventListener("scroll",Mu,!0)},[Ou,$u]),!Au||typeof document>"u")return null;const Du=menuGroups(lo);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactDomExports.createPortal(jsxRuntimeExports.jsx("div",{ref:Pu,"aria-hidden":"true","data-assistant-menu-anchor":"",style:{position:"fixed",left:Au.x,top:Au.y,width:1,height:1,pointerEvents:"none"}}),document.body),jsxRuntimeExports.jsx(ActionMenu,{open:!0,anchorRef:Pu,onOpenChange:Mu=>{Mu||($u(),requestAnimationFrame(()=>Ru?.current?.focus()))},children:jsxRuntimeExports.jsx(ActionMenu.Overlay,{width:"auto","data-assistant-menu":"",children:jsxRuntimeExports.jsx(ActionList,{"aria-label":Iu,children:Du.map(({group:Mu,items:Lu},Bu)=>{const ju=Lu.some(zu=>zu.checked!==void 0),Fu=Lu.map(zu=>jsxRuntimeExports.jsxs(ActionList.Item,{"data-assistant-menu-item":zu.id,disabled:zu.disabled,variant:zu.danger?"danger":"default",...ju?{selected:!!zu.checked}:{},onSelect:()=>{zu.onSelect(),$u(),requestAnimationFrame(()=>Ru?.current?.focus())},children:[zu.icon&&jsxRuntimeExports.jsx(ActionList.LeadingVisual,{children:jsxRuntimeExports.jsx(zu.icon,{})}),zu.label,zu.description&&jsxRuntimeExports.jsx(ActionList.Description,{variant:"block",children:jsxRuntimeExports.jsx("span",{title:zu.description,children:shortDescription(zu.description)})})]},zu.id));return jsxRuntimeExports.jsxs(ActionList.Group,{...ju?{selectionVariant:"single"}:{},children:[Mu&&jsxRuntimeExports.jsx(ActionList.GroupHeading,{children:Mu}),Fu]},Mu??`ungrouped-${Bu}`)})})})})]})}const BALLOON_GRACE_MS=700,BALLOON_HOVER_START={shown:!1,over:!1,focused:!1};function balloonHover(Au,lo){switch(lo){case"enter":return{...Au,over:!0,shown:!0};case"leave":return{...Au,over:!1};case"focus":return{...Au,focused:!0,shown:!0};case"blur":return{...Au,focused:!1};case"grace":return Au.over||Au.focused?Au:{...Au,shown:!1};case"escape":return{...Au,shown:!1};case"outside":return{...Au,shown:!1,over:!1,focused:!1}}}function graceRuns(Au){return Au.shown&&!Au.over&&!Au.focused}const DEFAULT_AVATAR_MODEL_URL="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r170/examples/models/gltf/RobotExpressive/RobotExpressive.glb",AVATAR_3D_ID="model3d";function assistantModel3D(Au){const lo=Au?.url||DEFAULT_AVATAR_MODEL_URL;return{kind:"model3d",id:AVATAR_3D_ID,name:lo===DEFAULT_AVATAR_MODEL_URL?"Robot (3D)":"3D avatar",url:lo}}function isAssistantModel3D(Au){return typeof Au=="object"&&Au!==null&&Au.kind==="model3d"}const NO_WEBGL_SENTENCE="This avatar is a 3D model, and this browser cannot draw 3D: WebGL is turned off or missing.",modelNotLoadedSentence=(Au,lo)=>`The 3D avatar could not be loaded from ${Au}: ${lo}`;function webglAvailable(Au=typeof document>"u"?void 0:document){if(!Au)return!1;try{const lo=Au.createElement("canvas");return!!(lo.getContext?.("webgl2")??lo.getContext?.("webgl"))}catch{return!1}}const prefersReducedMotion=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function idleClipName(Au){return Au.find(lo=>lo.toLowerCase()==="idle")??Au.find(lo=>/idle/i.test(lo))??Au[0]}const STATE_CLIPS={idle:{names:[/^idle$/i,/idle/i]},greeting:{names:[/^wave$/i,/wave|greet|hello/i],once:!0},thinking:{names:[/think|ponder/i]},working:{names:[/work|typing/i,/^walk(ing)?$/i]},waiting:{names:[/wait/i]},speaking:{names:[/talk|speak/i]},paused:{names:[/^sit(ting)?$/i,/sit/i],once:!0,holds:!0},goodbye:{names:[/bye/i,/^wave$/i,/wave/i],once:!0}};function stateMotion(Au,lo){const $u=STATE_CLIPS[Au];for(const Ru of $u.names){const Iu=lo.find(Pu=>Ru.test(Pu));if(Iu)return{clip:Iu,own:!0,once:!!$u.once,holds:!!$u.holds,procedural:!1}}return{clip:idleClipName(lo),own:!1,once:!1,holds:!1,procedural:!0}}const REST_POSE={headPitch:0,headYaw:0,headRoll:0,bodyYaw:0,bodyLean:0,bodyLift:0,bodyShift:0},REST=REST_POSE;function proceduralPose(Au,lo){const $u=Math.max(0,lo),Ru=Math.sin;switch(Au){case"idle":return{...REST,headYaw:.08*Ru($u*.45),bodyLift:.006*Ru($u*2)};case"greeting":{const Iu=Math.max(.15,1-$u/2);return{...REST,bodyYaw:.3*Ru($u*7+Math.PI/2)*Iu,headRoll:.15*Ru($u*7+Math.PI/2)*Iu,bodyLift:.035*Math.abs(Ru($u*7+Math.PI/2))*Iu}}case"thinking":return{...REST,headPitch:-.16+.03*Ru($u*.7),headRoll:.24+.04*Ru($u*.8),headYaw:.22*Ru($u*.6+.4),bodyYaw:.07*Ru($u*.5)};case"working":return{...REST,headPitch:.22,headYaw:.12*Ru($u*3),bodyLift:.02*Math.abs(Ru($u*10+.3))};case"waiting":return{...REST,bodyLean:.12,headPitch:-.06,headRoll:-.14+.05*Ru($u*1.6),bodyLift:.014*Ru($u*2.4)};case"speaking":return{...REST,headPitch:.07*Ru($u*4.6),headYaw:.12*Ru($u*1.7+.6),headRoll:.05*Ru($u*2.3),bodyYaw:.04*Ru($u*1.1)};case"paused":return{...REST,headPitch:.35,bodyLean:.1,bodyLift:-.03};case"goodbye":return{...REST,bodyYaw:.3*Ru($u*7+Math.PI/2),bodyLift:-.12*Math.min(1,$u/.7)}}}function accentPose(Au,lo){return Au==="working"?{...REST,headPitch:.16+.03*Math.sin(Math.max(0,lo)*3)}:REST}const OUT_OF_FRAME=1.25;function leavingPose(Au){const lo=Number.isFinite(Au)?Math.max(0,Au):60;return{...REST,bodyYaw:Math.PI/2,bodyShift:Math.min(OUT_OF_FRAME,.9*lo),bodyLift:lo<3?.012*Math.abs(Math.sin(lo*8)):0}}const GOODBYE_WAVE_SECONDS=1.2,CROSSFADE_SECONDS=.4,POSE_FOLLOW_RATE=7;function dampedPose(Au,lo,$u,Ru=POSE_FOLLOW_RATE){const Iu=1-Math.exp(-Math.max(0,$u)*Ru),Pu={...Au};for(const Ou of Object.keys(lo))Pu[Ou]=Au[Ou]+(lo[Ou]-Au[Ou])*Iu;return Pu}function walkClipName(Au){return Au.find(lo=>/^walk(ing)?$/i.test(lo))}const TALKING_MORPH=/mouth|jaw|open|^v?_?aa$|viseme_aa|surprised/i;function talkingMorphIndices(Au){return Object.entries(Au??{}).filter(([lo])=>TALKING_MORPH.test(lo)).map(([,lo])=>lo)}function talkAmount({speaking:Au,level:lo,reducedMotion:$u,seconds:Ru}){return!Au||$u?0:lo!==void 0?Math.max(0,Math.min(1,lo)):.25+.25*Math.abs(Math.sin(Ru*9))}function smoothed(Au,lo,$u){const Ru=1-Math.exp(-Math.max(0,$u)*18);return Au+(lo-Au)*Ru}function cameraDistance(Au,lo){const $u=lo*Math.PI/360;return Math.max(Au,.001)/2/Math.tan($u)*1.15}const Avatar3D=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/Avatar3D-g7pP5vZ4.js"),[],import.meta.url)),MOTIONS={"@keyframes assistantFloat":{"0%, 100%":{transform:"translateY(0)"},"50%":{transform:"translateY(-3px)"}},"@keyframes assistantBlink":{"0%, 94%, 100%":{transform:"scaleY(0)"},"97%":{transform:"scaleY(1)"}},"@keyframes assistantTilt":{"0%, 100%":{transform:"rotate(-5deg)"},"50%":{transform:"rotate(-8deg) translateY(-2px)"}},"@keyframes assistantWork":{"0%, 100%":{transform:"rotate(-3deg) translateY(0)"},"50%":{transform:"rotate(3deg) translateY(-4px)"}},"@keyframes assistantAttention":{"0%, 100%":{transform:"scale(1) rotate(0)"},"20%":{transform:"scale(1.08) rotate(-6deg)"},"40%":{transform:"scale(1.08) rotate(6deg)"},"60%":{transform:"scale(1)"}},"@keyframes assistantHop":{"0%, 100%":{transform:"translateY(0)"},"30%":{transform:"translateY(-14px)"},"55%":{transform:"translateY(0)"},"75%":{transform:"translateY(-6px)"}},"@keyframes assistantTalk":{"0%, 100%":{transform:"scaleY(1)"},"50%":{transform:"scaleY(2.2)"}},"@keyframes assistantDoze":{"0%, 100%":{transform:"translateY(2px) scale(1, 0.97)"},"50%":{transform:"translateY(3px) scale(1.02, 0.95)"}},"@keyframes assistantLeave":{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.2) translateY(20px)",opacity:0}}},BODY="& .assistant-body",AWAY_CHOICES=[{away:"page",label:"Hide for now"},{away:"session",label:"Hide for this session"},{away:"always",label:"Don’t show again"}],AgentInspectorDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/AgentInspectorDialog-DTQHUrHA.js"),[],import.meta.url)),AgentDetailsDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/AgentDetailsDialog-CXN0RO_L.js"),[],import.meta.url)),SandboxDetailsDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/SandboxDetailsDialog-qJBg2naH.js"),[],import.meta.url));function assistantMenuItems(Au){const lo=[];if(Au.inspect&&lo.push({id:"inspect",label:"Inspect the agent…",icon:PulseIcon,onSelect:Au.inspect}),Au.agentDetails&&lo.push({id:"agent-details",label:"Agent Details…",icon:DependabotIcon,onSelect:Au.agentDetails}),Au.sandboxDetails&&lo.push({id:"sandbox-details",label:"Code Sandbox Details…",icon:CodeIcon,onSelect:Au.sandboxDetails}),Au.conversationLabel!==!1&&lo.push({id:"conversation",label:Au.conversationLabel??(Au.open?"Close the conversation":"Open the conversation"),icon:CommentDiscussionIcon,onSelect:Au.onToggle}),Au.busy&&Au.onStop&&lo.push({id:"stop",label:"Stop the turn",icon:SquareFillIcon,onSelect:Au.onStop}),Au.onNewChat&&lo.push({id:"new-chat",label:"New conversation",icon:PlusIcon,onSelect:Au.onNewChat}),Au.onClear&&lo.push({id:"clear",label:"Clear the conversation",icon:TrashIcon,onSelect:Au.onClear}),Au.suggestions?.length&&Au.onSuggestion){const $u=Au.onSuggestion;for(const Ru of Au.suggestions)lo.push({id:`suggestion:${Ru.label}`,label:Ru.label,description:Ru.prompt,group:"Suggestions",disabled:Au.busy,onSelect:()=>$u(Ru)})}if(Au.onBalloonDisplayChange){const $u=Au.onBalloonDisplayChange;lo.push({id:"balloon-history",label:"History",group:"Balloon",checked:Au.balloonDisplay!=="current",onSelect:()=>$u("history")},{id:"balloon-current",label:"Current",group:"Balloon",checked:Au.balloonDisplay==="current",onSelect:()=>$u("current")})}Au.onChangeCharacter&&lo.push({id:"character",label:"Change avatar…",icon:PencilIcon,onSelect:Au.onChangeCharacter}),Au.speech&&lo.push({id:"speech",label:Au.speech.muted?"Unmute speech":"Mute speech",icon:Au.speech.muted?UnmuteIcon:MuteIcon,onSelect:Au.speech.onToggle}),Au.characterSounds&&lo.push({id:"character-sounds",label:Au.characterSounds.on?"Mute its sounds":"Play its sounds",icon:Au.characterSounds.on?MuteIcon:UnmuteIcon,onSelect:Au.characterSounds.onToggle}),Au.onResetPosition&&lo.push({id:"reset-position",label:"Reset position",icon:ScreenNormalIcon,onSelect:Au.onResetPosition}),Au.about&&lo.push({id:"about",label:`About ${Au.name}`,icon:InfoIcon,onSelect:Au.about}),lo.push(...Au.extra??[]);for(const $u of AWAY_CHOICES)lo.push({id:`away:${$u.away}`,label:$u.label,group:"Send away",icon:XIcon,onSelect:()=>Au.onDismiss($u.away)});return lo}const BALLOON_ROOM=200;function pixels(Au){if(typeof Au=="number")return Au;const lo=typeof Au=="string"?/^(-?\d+(?:\.\d+)?)px$/.exec(Au):null;return lo?Number(lo[1]):void 0}function balloonSide(Au,lo={width:typeof window>"u"?1280:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}){const $u=pixels(Au.left),Ru=pixels(Au.top),Iu=$u!==void 0?$u<lo.width/2?"left":"right":Au.left!==void 0&&Au.right===void 0?"left":"right";return{side:Ru!==void 0?Ru<BALLOON_ROOM?"below":"above":Au.top!==void 0&&Au.bottom===void 0?"below":"above",align:Iu}}const CLEAR_CHECK_MS=400;function useKeepClear(Au,lo,$u){const[Ru,Iu]=reactExports.useState(!1),[Pu,Ou]=reactExports.useState(!1);return reactExports.useEffect(()=>{if($u){Iu(!1);return}const Du=()=>{const Lu=Au.current;if(!Lu)return;const Bu=Lu.getBoundingClientRect(),ju=lo?.current,Fu=Array.from(document.querySelectorAll(ASSISTANT_OBSTACLES)).some(zu=>{if(Lu.contains(zu)||zu.contains(Lu)||ju?.contains(zu))return!1;const Uu=zu.getBoundingClientRect();return Uu.width>0&&Uu.height>0&&boxesMeet(Bu,Uu)});Iu(Fu)};Du();const Mu=window.setInterval(Du,CLEAR_CHECK_MS);return()=>window.clearInterval(Mu)},[Au,lo,$u]),reactExports.useEffect(()=>{if($u){Ou(!1);return}let Du,Mu=!1;const Lu=Bu=>{const ju=Au.current,Fu=Bu.target;!ju||Fu&&(ju.contains(Fu)||lo?.current?.contains(Fu))||Bu.type==="pointermove"&&Bu.buttons===0&&!Mu||pointerNear(ju.getBoundingClientRect(),{x:Bu.clientX,y:Bu.clientY})&&(Mu=!0,Ou(!0),clearTimeout(Du),Du=setTimeout(()=>{Mu=!1,Ou(!1)},POINTER_CALM_MS))};return document.addEventListener("pointerdown",Lu,!0),document.addEventListener("pointermove",Lu,!0),()=>{clearTimeout(Du),document.removeEventListener("pointerdown",Lu,!0),document.removeEventListener("pointermove",Lu,!0)}},[Au,lo,$u]),Ru?"obstacle":Pu?"pointer":void 0}function useMouth(Au,lo,$u){reactExports.useEffect(()=>{const Ru=Au.current,Iu=typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(!Ru||!lo||!$u||Iu){Ru?.removeAttribute("data-assistant-mouth");return}let Pu=0;const Ou=()=>{Ru.setAttribute("data-assistant-mouth",String(mouthOpening(lo()))),Pu=requestAnimationFrame(Ou)};return Pu=requestAnimationFrame(Ou),()=>{cancelAnimationFrame(Pu),Ru.removeAttribute("data-assistant-mouth")}},[Au,lo,$u])}function AssistantStage({character:Au,state:lo,size:$u=88,replay:Ru,place:Iu,stageRef:Pu,onDragStart:Ou,open:Du,onToggle:Mu,onCharacterClick:Lu,onCharacterKeyDown:Bu,balloon:ju,insist:Fu=!1,onDismiss:zu,ownRef:Uu,decide:Hu,mouthLevel:Vu,stayPut:Gu=!1,balloonDisplay:Wu="history",expandTarget:Zu,expandOnArrival:Ju=!1,suggestions:Yu,onSuggestion:Xu,inspector:ed,inspectAgent:td,conversationLabel:nd,onBalloonDisplayChange:od,onStop:sd,onNewChat:ad,onClear:pd,onChangeCharacter:bd,speech:wd,onResetPosition:_d,about:yd,sandbox:Sd,contextMenu:kd,agentName:md,label:dd}){const vd=useChatWords(),ld=isAssistantModel3D(Au)?Au:void 0,ud=typeof Au=="string"?shippedAssistantCharacter(Au):!ld&&"Drawing"in Au?Au:void 0,hd=ud?ud.name:ld?ld.name:Au.name,gd=md??hd,Ed=reactExports.useId(),Td=!!(md||dd),{colorScheme:Rd}=useTheme(),jd=Rd?.startsWith("dark")?"dark":"light",[Cd,$d]=reactExports.useReducer(balloonHover,BALLOON_HOVER_START),Id=Cd.shown,Vd=graceRuns(Cd);reactExports.useEffect(()=>{if(!Vd)return;const xh=setTimeout(()=>$d("grace"),BALLOON_GRACE_MS);return()=>clearTimeout(xh)},[Vd]),reactExports.useEffect(()=>{if(!Id)return;const xh=Ph=>{const Kh=Ph.target;Kh&&Pu.current?.contains(Kh)||$d("outside")};return document.addEventListener("pointerdown",xh,!0),()=>document.removeEventListener("pointerdown",xh,!0)},[Id,Pu]);const[Dd,Wd]=reactExports.useState(!1),[oh,rh]=reactExports.useState(null),[Eh,ah]=reactExports.useState(!1),[yh,vh]=reactExports.useState(!1),[Jd,Qd]=reactExports.useState(null),sh=reactExports.useRef(null),Oh=reactExports.useRef(void 0),qd=reactExports.useCallback(()=>rh(null),[]),[zd,Pd]=reactExports.useState(!1),Od=!ud&&!ld&&Object.keys(Au.sounds??{}).length>0;reactExports.useEffect(()=>()=>clearTimeout(Oh.current),[]);const Gd=reactExports.useRef(null),Md=useKeepClear(Pu,Uu,Dd||oh!==null||Eh||yh||Jd!==null||Gu),Kd=Iu.left===void 0&&Iu.top===void 0?pixels(Iu.right):void 0,Xd=pixels(Iu.bottom);reactExports.useEffect(()=>{if(Md||Kd===void 0||Xd===void 0)return;const xh=document.documentElement;return xh.style.setProperty(ASSISTANT_CLEARANCE_VAR,`${Kd+$u}px`),()=>{xh.style.removeProperty(ASSISTANT_CLEARANCE_VAR)}},[Md,Kd,Xd,$u]),useMouth(Pu,Vu,lo==="speaking");const[ph,_h]=reactExports.useState(!1),Sh=!Md&&!Du&&!!ju&&(Id||Fu||ph),Wh=(lo==="idle"||lo==="greeting")&&!ju?.tool&&!ju?.approval&&!ju?.busy,xd=assistantMenuItems({name:gd,open:Du,onToggle:Mu,onDismiss:zu,conversationLabel:nd,inspect:ed?()=>ah(!0):void 0,agentDetails:yd?()=>Qd("agent"):void 0,sandboxDetails:Sd?()=>Qd("sandbox"):void 0,balloonDisplay:Wu,onBalloonDisplayChange:od,suggestions:Yu,onSuggestion:Xu,busy:lo==="thinking"||lo==="working"||lo==="speaking",onStop:sd,onNewChat:ad,onClear:pd,onChangeCharacter:bd,speech:wd,characterSounds:Od?{on:zd,onToggle:()=>Pd(xh=>!xh)}:void 0,onResetPosition:_d,about:yd?()=>vh(!0):void 0,extra:kd}),Hd=ju?.visual,[Zd,gh]=reactExports.useState(null),Ch=Hd?()=>{gh(Hd),Zu&&requestAnimationFrame(()=>focusExpanded(Zu))}:null,wh=ju?.history,Th=Wu!=="current"&&wh&&wh.length>0?{id:"balloon-history",title:conversationHeaderText(conversationCount(wh),vd),shrink:!0,render:()=>jsxRuntimeExports.jsx(BalloonHistoryLarge,{history:wh,tool:ju?.tool,attachment:ju?.attachment})}:null,$h=Zd?.id==="balloon-history"?Th:Zd;return reactExports.useEffect(()=>{Hd&&Ju&&Zu&&gh(Hd)},[Hd?.id,Ju,!!Zu]),jsxRuntimeExports.jsxs(Box,{ref:Pu,"data-assistant-state":lo,"data-assistant-aside":Md,"data-assistant-balloon":Wu,sx:{position:"fixed",zIndex:1002,...Iu,width:$u,height:$u,opacity:Md?0:1,visibility:Md?"hidden":"visible",pointerEvents:Md?"none":void 0,transition:Md?ld?"opacity 150ms ease 1.4s, visibility 0s linear 1.55s":"opacity 150ms ease, visibility 0s linear 150ms":"opacity 150ms ease",...MOTIONS,"& .assistant-lids ellipse":{transformBox:"fill-box",transformOrigin:"top",transform:"scaleY(0)",animation:"assistantBlink 5.2s ease-in-out infinite"},[BODY]:{transformBox:"fill-box",transformOrigin:"50% 100%"},"& .assistant-pupils":{transition:"transform var(--theme-motion-status, 120ms) var(--theme-motion-easing, ease)"},"& .assistant-mouth":{transformBox:"fill-box",transformOrigin:"center"},'&[data-assistant-state="idle"] .assistant-body':{animation:"assistantFloat 3.2s ease-in-out infinite"},'&[data-assistant-state="thinking"] .assistant-body':{animation:"assistantTilt 2.4s ease-in-out infinite"},'&[data-assistant-state="thinking"] .assistant-pupils':{transform:"translate(-1px, -3px)"},'&[data-assistant-state="working"] .assistant-body':{animation:"assistantWork 0.7s ease-in-out infinite"},'&[data-assistant-state="working"] .assistant-pupils':{transform:"translate(2px, 2px)"},'&[data-assistant-state="waiting"] .assistant-body':{animation:"assistantAttention 1.4s ease-in-out infinite"},'&[data-assistant-state="greeting"] .assistant-body':{animation:"assistantHop 0.9s ease-out 2"},'&[data-assistant-state="speaking"] .assistant-mouth':{animation:"assistantTalk 0.24s ease-in-out infinite"},'&[data-assistant-state="speaking"] .assistant-body':{animation:"assistantFloat 1.6s ease-in-out infinite"},"&[data-assistant-mouth] .assistant-mouth":{animation:"none",transition:"transform 60ms linear"},'&[data-assistant-mouth="0"] .assistant-mouth':{transform:"scaleY(1)"},'&[data-assistant-mouth="1"] .assistant-mouth':{transform:"scaleY(1.5)"},'&[data-assistant-mouth="2"] .assistant-mouth':{transform:"scaleY(2.1)"},'&[data-assistant-mouth="3"] .assistant-mouth':{transform:"scaleY(2.8)"},'&[data-assistant-state="paused"] .assistant-body':{animation:"assistantDoze 4.8s ease-in-out infinite",filter:"grayscale(0.5)",opacity:.8},'&[data-assistant-state="paused"] .assistant-lids ellipse':{animation:"none",transform:"scaleY(1)"},'&[data-assistant-state="goodbye"] .assistant-body':{animation:"assistantLeave 0.6s ease-in forwards"},'&[data-assistant-state="goodbye"] .assistant-sprite':{animation:"assistantLeave 0.6s ease-in forwards"},"@media (prefers-reduced-motion: reduce)":{"& *":{animation:"none !important"},transition:"none"}},onMouseEnter:()=>$d("enter"),onMouseLeave:()=>$d("leave"),onFocus:xh=>{let Ph=!0;try{Ph=xh.target.matches(":focus-visible")}catch{}Ph&&$d("focus")},onBlur:xh=>{const Ph=xh.relatedTarget;(!Ph||!xh.currentTarget.contains(Ph))&&$d("blur")},onKeyDown:xh=>{xh.key==="Escape"&&Id&&$d("escape")},children:[$h&&jsxRuntimeExports.jsx(ExpandedVisual,{visual:$h,target:Zu,onClose:()=>gh(null)}),Sh&&ju&&jsxRuntimeExports.jsx(BalloonExpandContext.Provider,{value:Ch,children:jsxRuntimeExports.jsx(SpeechBalloon,{text:ju.text,more:ju.more,approval:ju.approval,onDismissPeek:ju.onDismiss,display:Wu,tool:ju.tool,speaking:ju.speaking,busy:ju.busy,attachment:ju.attachment,history:ju.history,onExpand:Ch??void 0,expandTitle:Hd?.title,onExpandHistory:Th?()=>{gh(Th),Zu&&requestAnimationFrame(()=>focusExpanded(Zu))}:void 0,suggestions:Wh?Yu:void 0,fullText:ju.fullText,waiting:(lo==="thinking"||lo==="working"||lo==="waiting")&&!ju.speaking,onSuggestion:Xu,decide:Hu,onDecisionActive:_h,wide:ph,onOpen:Mu,above:$u+8,side:balloonSide(Iu).side,align:balloonSide(Iu).align,tailAt:$u/2})}),jsxRuntimeExports.jsxs(Box,{as:"button",type:"button","aria-label":dd??(Du?`Close the conversation with ${gd}`:`Talk to ${gd}`),"aria-describedby":Td?Ed:void 0,"aria-expanded":Du,"aria-haspopup":"menu",ref:sh,"data-assistant-figure":"",onContextMenu:xh=>{xh.preventDefault(),clearTimeout(Oh.current),rh({x:xh.clientX,y:xh.clientY})},onKeyDown:xh=>{if(opensContextMenu(xh)){xh.preventDefault();const Ph=xh.currentTarget.getBoundingClientRect();rh({x:Ph.left+Ph.width/2,y:Ph.bottom});return}Bu?.(xh)},onPointerUp:()=>clearTimeout(Oh.current),onPointerCancel:()=>clearTimeout(Oh.current),onPointerMove:xh=>{const Ph=Gd.current;Ph&&Math.hypot(xh.clientX-Ph.x,xh.clientY-Ph.y)>8&&clearTimeout(Oh.current)},onPointerDown:xh=>{if(Gd.current={x:xh.clientX,y:xh.clientY},xh.pointerType==="touch"){const Ph={x:xh.clientX,y:xh.clientY};clearTimeout(Oh.current),Oh.current=setTimeout(()=>{Gd.current={x:-1e6,y:-1e6},rh(Ph)},LONG_PRESS_MS)}Ou(xh)},onClick:xh=>{const Ph=Gd.current;Gd.current=null,!(Ph&&Math.hypot(xh.clientX-Ph.x,xh.clientY-Ph.y)>4)&&(Lu??Mu)()},display:"block",width:$u,height:$u,p:0,border:0,bg:"transparent",cursor:"grab",filter:"drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18))",active:{cursor:"grabbing"},focusVisible:{outline:"2px solid",outlineColor:"var(--focus-outlineColor, var(--fgColor-accent))",outlineOffset:2,borderRadius:"50%"},touchAction:"none",children:[Td&&jsxRuntimeExports.jsx(Box,{as:"span",id:Ed,position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",children:`Its avatar: ${hd}`}),ud?jsxRuntimeExports.jsx(ud.Drawing,{size:$u,mode:jd,state:lo,mouthLevel:Vu}):ld?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("span",{"aria-busy":"true",style:{display:"block",width:$u,height:$u}}),children:jsxRuntimeExports.jsx(Avatar3D,{avatar:ld,state:lo,size:$u,mouthLevel:Vu,aside:Md!==void 0,replay:Ru})}):jsxRuntimeExports.jsx(SpriteCharacter,{character:Au,state:lo,size:$u,sounds:zd,mouthLevel:Vu})]}),(Id||Dd)&&!Md&&lo!=="goodbye"&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:"-6px",right:"-6px",children:jsxRuntimeExports.jsxs(ActionMenu,{open:Dd,onOpenChange:Wd,children:[jsxRuntimeExports.jsx(ActionMenu.Anchor,{children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,"aria-label":`Send ${gd} away`,size:"small",variant:"invisible","data-assistant-dismiss":"",sx:{bg:"canvas.default",borderRadius:"50%",boxShadow:"shadow.small"}})}),jsxRuntimeExports.jsx(ActionMenu.Overlay,{width:"auto",children:jsxRuntimeExports.jsx(ActionList,{children:AWAY_CHOICES.map(xh=>jsxRuntimeExports.jsx(ActionList.Item,{"data-assistant-away":xh.away,onSelect:()=>zu(xh.away),children:xh.label},xh.away))})})]})}),jsxRuntimeExports.jsx(AssistantContextMenu,{at:oh,items:xd,onClose:qd,returnFocusRef:sh,label:`${gd}’s menu`}),Eh&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(AgentInspectorDialog,{tracer:ed??null,agent:td,title:`${yd?.name??gd} · Agent Inspector`,onClose:()=>{ah(!1),sh.current?.focus()}})}),Jd==="agent"&&yd&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(AgentDetailsDialog,{about:yd,name:gd,onClose:()=>{Qd(null),sh.current?.focus()}})}),Jd==="sandbox"&&Sd&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(SandboxDetailsDialog,{sandbox:Sd,name:yd?.name??gd,onClose:()=>{Qd(null),sh.current?.focus()}})}),yh&&yd&&jsxRuntimeExports.jsx(Dialog$1,{title:`About ${yd.name??gd}`,onClose:()=>{vh(!1),sh.current?.focus()},"data-assistant-about":"",children:[["Agent",yd.name],["Spec",yd.spec],["Model",yd.model],["Runs",yd.where],["Avatar",hd]].filter(([,xh])=>xh).map(([xh,Ph])=>jsxRuntimeExports.jsxs(Text$3,{as:"p",sx:{m:0,mb:1},children:[jsxRuntimeExports.jsxs(Text$3,{sx:{color:"fg.muted"},children:[xh,": "]}),Ph]},xh))})]})}const CONVERSATION_BALLOON_WIDTH=380,CONVERSATION_BALLOON_MAX_HEIGHT=560,CONVERSATION_BALLOON_VIEWPORT_SHARE=.6,CURRENT_BALLOON_HEIGHT=230;function conversationBalloonHeight(Au){return Math.max(240,Math.min(CONVERSATION_BALLOON_MAX_HEIGHT,Math.round(Au*CONVERSATION_BALLOON_VIEWPORT_SHARE)))}const TAIL=7;function balloonTailAt(Au,lo,$u=CONVERSATION_BALLOON_WIDTH){return Math.min($u-24-TAIL,Math.max(24,Au-lo-TAIL))}function conversationBalloonSx(Au,lo="canvas.default"){return{borderRadius:"var(--theme-radius-bubble, 16px)",overflow:"visible",...Au.edge==="none"?{}:{"&::after":{content:'""',position:"absolute",...Au.edge==="bottom"?{bottom:`-${TAIL}px`}:{top:`-${TAIL}px`},left:`${Au.at}px`,width:`${TAIL*2}px`,height:`${TAIL*2}px`,bg:lo,borderRight:"1px solid",borderBottom:"1px solid",borderColor:"border.default",transform:Au.edge==="bottom"?"rotate(45deg)":"rotate(225deg)",pointerEvents:"none"}}}}function ConversationBalloonClose({name:Au,onClose:lo}){return jsxRuntimeExports.jsx(Box,{"data-conversation-balloon-close":"",position:"absolute",top:"6px",right:"6px",zIndex:30,children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,size:"small",variant:"invisible","aria-label":Au?`Close the conversation with ${Au}`:"Close the conversation",onClick:lo,sx:{bg:"canvas.default",borderRadius:"50%"}})})}function BalloonApprovalMessage({approval:Au}){const lo=useChatWords(),$u=reactExports.useRef(null);return reactExports.useEffect(()=>{$u.current?.scrollIntoView?.({block:"nearest"})},[Au.id]),jsxRuntimeExports.jsx(Box,{ref:$u,"data-balloon-approval":Au.id,px:3,py:2,display:"flex",children:jsxRuntimeExports.jsxs(Box,{maxWidth:"90%",px:3,py:2,bg:"attention.subtle",border:"1px solid",borderColor:"attention.muted",borderRadius:"var(--theme-radius-bubble, 16px)",fontSize:1,children:[jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:lo.waitingForYou}),jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,fontWeight:"semibold"},children:Au.asks}),Au.why?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:Au.why}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,mt:2,alignItems:"center",children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",disabled:Au.deciding,onClick:Au.onApprove,children:lo.approve}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",disabled:Au.deciding,onClick:Au.onDeny,children:lo.deny}),Au.others>0?jsxRuntimeExports.jsx(Text$3,{sx:{color:"fg.muted",fontSize:0},children:lo.moreWaiting(Au.others)}):null]})]})})}const PEEK_LIMIT=60;function peekLine(Au,lo=PEEK_LIMIT){const $u=Au.replace(/\s+/g," ").trim();if($u.length<=lo)return{text:$u,more:!1};const Ru=$u.slice(0,lo);return{text:`${Ru.slice(0,Math.max(Ru.lastIndexOf(" "),lo*.6)).trimEnd()}…`,more:!0}}const PRESENCE_LINES={idle:"Ready",thinking:"Thinking…",working:"Working…",waiting:"Waiting for you",paused:"Paused"};function presenceState(Au,lo,$u=!1){return $u?"paused":lo?.open&&lo.pendingApproval?"waiting":Au?lo?.open?"working":"thinking":"idle"}function presenceToolOf(Au){for(let lo=Au.length-1;lo>=0;lo-=1){const $u=Au[lo];if(typeof $u.toolName=="string"&&$u.toolCallId){const Ru=$u.status!=="complete"&&$u.status!=="error",Iu=Ru&&$u.result?.pending_approval===!0;return{open:Ru,pendingApproval:Iu}}}return{open:!1,pendingApproval:!1}}const LIVE=new Set(["running","idle","busy","starting"]);function sandboxIsLive(Au){return Au.status===void 0||LIVE.has(Au.status)}const NO_SANDBOX_YET="No sandbox is running yet: run a cell or ask the agent to execute code.",SANDBOX_KIND_LABELS={browser:"Python in your browser (Pyodide)",local:"Local Jupyter server",jupyter:"Jupyter server",cloud:"Datalayer cloud runtime",runtime:"In the agent runtime"};function isLocalUrl(Au){if(!Au)return!1;try{const lo=new URL(Au).hostname;return lo==="localhost"||lo==="127.0.0.1"||lo==="::1"||lo==="[::1]"||lo.endsWith(".localhost")}catch{return!1}}const SECRET_PARAMS=/^(token|access_token|api_key|apikey|key|auth|password|secret|signature|sig|jwt)$/i;function displayUrl(Au){if(Au)try{const lo=new URL(Au);lo.username="",lo.password="";for(const $u of[...lo.searchParams.keys()])SECRET_PARAMS.test($u)&&lo.searchParams.delete($u);return lo.toString()}catch{return Au.split("?")[0]}}const text$3=Au=>typeof Au=="string"&&Au?Au:void 0;function assistantSandboxOf(Au,lo={}){if(!Au)return;const $u=text$3(Au.variant),Ru=text$3(Au.jupyter_url)??text$3(Au.agent_base_url),Iu=Au.sandbox_running===!0||Au.jupyter_connected===!0;return!$u&&!Iu?void 0:{kind:$u==="datalayer"?"cloud":$u==="jupyter-server"||$u==="jupyter"?isLocalUrl(text$3(Au.jupyter_url))?"local":"jupyter":"runtime",status:lo.state??(Iu?"running":"stopped"),variant:$u,url:Ru,token:text$3(Au.jupyter_token),kernelId:text$3(Au.kernel_id),agentId:lo.agentId,environment:text$3(Au.environment_name),serverUrl:lo.serverUrl}}function sandboxExecuteOverHttp(Au,lo){const $u=Au.replace(/\/+$/,"").replace(/\/api\/v1$/,"");return async Ru=>{const Iu=await fetch(`${$u}/api/v1/sandbox/execute`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:Ru,agent_id:lo})});if(!Iu.ok)return{stdout:"",error:`The sandbox did not run the code (HTTP ${Iu.status}).`};const Pu=await Iu.json();return{stdout:Pu.stdout??"",error:Pu.error??void 0}}}function timeLeft(Au,lo=Date.now()){if(Au===null)return"never";if(Au===void 0||Au==="")return;const $u=typeof Au=="number"?Au<1e12?Au*1e3:Au:Date.parse(Au);if(!Number.isFinite($u))return;const Ru=Math.round(($u-lo)/6e4);if(Ru<=0)return"ended";const Iu=Math.floor(Ru/60);return Iu?`${Iu} h ${Ru%60} min`:`${Ru} min`}function endpointAgentId(Au){return Au?.match(/\/api\/v1\/(?:ag-ui|vercel-ai|a2a\/agents|acp\/ws)\/([^/]+)/)?.[1]}function useIsMobile(Au=640){const[lo,$u]=reactExports.useState(!1);return reactExports.useEffect(()=>{const Ru=()=>{$u(window.innerWidth<Au)};return Ru(),window.addEventListener("resize",Ru),()=>window.removeEventListener("resize",Ru)},[Au]),lo}const px=Au=>`${Math.round(Au)}px`,clamp=(Au,lo)=>Math.max(8,Math.min(Au,Math.max(8,lo)));function ChatFloating({endpoint:Au,protocol:lo,useStore:$u=!0,title:Ru="Chat",description:Iu="Start a conversation with the AI agent.",position:Pu="bottom-right",defaultOpen:Ou=!1,width:Du=400,height:Mu=550,showHeader:Lu=!0,showButton:Bu=!0,showNewChatButton:ju=!0,showClearButton:Fu=!0,showSettingsButton:zu=!1,enableKeyboardShortcuts:Uu=!0,toggleShortcut:Hu="/",showPoweredBy:Vu=!0,promptVariant:Gu,mentionableAgents:Wu,poweredByProps:Zu,clickOutsideToClose:Ju=!1,escapeToClose:Yu=!0,className:Xu,onSettingsClick:ed,onNewChat:td,onOpen:nd,onClose:od,onStateUpdate:sd,children:ad,brandIcon:pd,buttonIcon:bd,buttonTooltip:wd="Chat with AI",brandColor:_d,buttonGlow:yd=!0,offset:Sd=20,animationDuration:kd=200,frontendTools:md,initialState:dd,suggestions:vd,submitOnSuggestionClick:ld=!0,hideMessagesAfterToolUI:ud=!1,defaultViewMode:hd="floating",onViewModeChange:gd,sidebarMountPoint:Ed=null,showPanelBackdrop:Td=!1,availableModels:Rd,showModelSelector:jd=!1,showToolsMenu:Cd=!1,showSkillsMenu:$d=!1,showTokenUsage:Id=!0,showContextRing:Vd=!1,themeVariant:Dd,themeOverrides:Wd,colorMode:oh,runtimeId:rh,historyEndpoint:Eh,authToken:ah,historyAuthToken:yh,pendingPrompt:vh,showInformation:Jd=!1,onInformationClick:Qd,onToolCallStart:sh,onToolCallComplete:Oh,showToolApprovalBanner:qd,pendingApprovals:zd,onApproveApproval:Pd,onRejectApproval:Od,panelProps:Gd,launching:Md=!1,launchingMessage:Kd,assistantCharacter:Xd=DEFAULT_ASSISTANT_CHARACTER,balloonDisplay:ph=DEFAULT_BALLOON_DISPLAY,expandTarget:_h,conversation:Sh,decisions:Wh,voice:Nd,inspector:xd,onBalloonDisplayChange:Hd,onChangeCharacter:Zd,about:gh,sandbox:Ch,contextMenu:wh}){const Th=useChatWords(),$h=reactExports.useRef(null),[xh,Ph]=reactExports.useState(),[Kh,Dh]=reactExports.useState(!1),[ep,np]=reactExports.useState();reactExports.useEffect(()=>np(void 0),[ph]);const hp=ep??ph,gp=reactExports.useCallback(Mh=>{np(Mh),Hd?.(Mh)},[Hd]),Jh=useChatOpen(),_p=useChatMessages(),sp=useChatStore(Mh=>Mh.setOpen),cp=useChatStore(Mh=>Mh.clearMessages),[qh,zh]=reactExports.useState(Ou),Yh=$u?Jh:qh,Df=$u?sp:zh,Cp=_p,Rh=reactExports.useRef(null),jh=useIsMobile(),[df,Bp]=reactExports.useState(!1),[af,ef]=reactExports.useState(!1),[tp,Yp]=reactExports.useState(hd),[Mf,im]=reactExports.useState(0),[Rf,zf]=reactExports.useState(!1),[Gf,mp]=reactExports.useState(null),zp=tp==="panel"?"sidebar":tp,[xp,Vp]=reactExports.useState(null);reactExports.useLayoutEffect(()=>{Vp(resolveMountPoint(Ed))},[Ed,Yh,tp]);const Gp=disabledChatViewModes({sidebarMountPoint:xp,viewMode:zp}),Up=Gp.includes("sidebar"),tf=tp==="panel"&&!jh&&!!xp,vp=useViewportDrag(Rh),Wf=vp.reset;reactExports.useEffect(()=>{tp!=="floating-draggable"&&Wf()},[tp,Wf]);const mf=88,Pm=tp==="assistant"&&!jh,[Kf,jm]=reactExports.useState(!1),[Hp,vm]=reactExports.useState({open:!1,pendingApproval:!1}),[cm,wf]=reactExports.useState(!1),[Nh,Ud]=reactExports.useState(),[lh,Lh]=reactExports.useState(0),[Bh,pp]=reactExports.useState([]),[ip,Op]=reactExports.useState([]),[Sp]=useVoiceSettings(),hf=reactExports.useMemo(()=>Nd?settledVoice(Nd,Sp):void 0,[Nd,Sp]),{speaker:Dp,state:Uh,stop:ap,read:sm,level:Uf}=useVoiceSpeaker(hf);useSpokenAnswers(ip,Kf,!!Dp&&hf?.output==="always"&&!Kh,Dp);const[pf,Hf]=reactExports.useState(!1),[Zm,Ym]=reactExports.useState(!1),[bm,Sf]=reactExports.useState(keptAway),am=Pm&&bm==="none",Nf=reactExports.useCallback(()=>{keepAway("none"),Sf("none")},[]),[Ef,um]=reactExports.useState(),bp=Sh?Sh.saying:Ef,Zf=Sh?Sh.answering:cm,Yf=Sh?Sh.tool:Nh,Vh=hp==="current",[Ap,Wp]=reactExports.useState(),[gf,bf]=reactExports.useState(!1);reactExports.useEffect(()=>{if(!bp||Yh)return;bf(!0);const Mh=setTimeout(()=>bf(!1),12e3);return()=>clearTimeout(Mh)},[bp?.id,bp?.text,Yh]),reactExports.useEffect(()=>{Yh&&bp&&Wp(bp.id)},[Yh,bp?.id]);const ym=reactExports.useRef(null),Jf=useViewportDrag(ym,{whole:!0});reactExports.useEffect(()=>{if(!am)return;Hf(!0);const Mh=setTimeout(()=>Hf(!1),1800);return()=>clearTimeout(Mh)},[am]);const Tp=assistantStateOf(Sh?Sh.presence:presenceState(Kf,Hp),{arriving:pf,leaving:Zm,speaking:Zf,voicing:Uh.speaking}),qf=!!bp&&bp.id!==Ap,[Fm,lf]=reactExports.useState(!1),Zh=zd?.[0],Mp=Zh&&Pd&&Od?{id:Zh.id,asks:Zh.toolDescription||Zh.toolName,others:(zd?.length??1)-1,deciding:Fm,onApprove:()=>{lf(!0),Promise.resolve(Pd(Zh.id)).finally(()=>lf(!1))},onDeny:()=>{lf(!0),Promise.resolve(Od(Zh.id)).finally(()=>lf(!1))}}:void 0,dm=useDecisionAsker(Wh?.serverUrl?{serverUrl:Wh.serverUrl,token:Wh.token,agentId:Wh.agentId??endpointAgentId(Au)}:void 0),rf=Tp==="thinking"||Tp==="working"||Tp==="speaking",Cf=Yf&&(Yf.phase==="running"||rf)?Yf:void 0,s0=rf&&!Zf?Th.thinking:(bp?.more?bp.text:bp?.markdown)||void 0,a0=rf&&!Zf?void 0:bp?.more?bp.markdown:void 0,_m=!Vh&&!Sh&&Bh.length>0?Bh:void 0,Om=Mh=>_m?{...Mh,history:_m}:Mh,hg=Tp==="paused"?{text:Th.paused}:Uh.sentence?{text:Uh.sentence}:Uh.refused?{text:Uh.refused}:Mp?Om({text:Th.waitingForYou,approval:Mp}):Tp==="waiting"?{text:Th.waitingOpen}:Cf?Om({text:toolLineText(Cf,Th),tool:Cf,busy:rf}):Vh&&(qf||rf)?{text:s0??Iu,fullText:a0,more:bp?.more,speaking:Zf&&rf,busy:rf,onDismiss:bp?()=>{Wp(bp.id),bf(!1)}:void 0}:Om(qf&&bp?{...peekLine(bp.text),onDismiss:()=>{Wp(bp.id),bf(!1)}}:{text:Iu}),D0=!!Uh.sentence||Tp==="greeting"||Tp==="waiting"||!!Mp||!!Cf||Vh&&rf||qf&&(Tp==="speaking"||gf),qg=reactExports.useMemo(()=>Sh||!vd?.length?void 0:vd.map(Mh=>({label:Mh.title,prompt:Mh.message})),[Sh,vd]),Vg=reactExports.useCallback(Mh=>{$h.current?$h.current.send(Mh.prompt):Ph(Mh.prompt)},[]),l0=Gd?.onSendReady,jv=reactExports.useCallback(Mh=>{$h.current=Mh,l0?.(Mh)},[l0]),Ag=Gd?.onLoadingChange,I1=Gd?.onDisplayItemsChange,pv=reactExports.useCallback(Mh=>{jm(Mh),Ag?.(Mh)},[Ag]),Fv=reactExports.useCallback(Mh=>{const Np=presenceToolOf(Mh);vm(wp=>wp.open===Np.open&&wp.pendingApproval===Np.pendingApproval?wp:Np),wf(newestIsAnswer(Mh));const Qf=newestToolLine(Mh);Ud(wp=>wp?.id===Qf?.id&&wp?.phase===Qf?.phase?wp:Qf),Lh(conversationCount(Mh)),pp(Mh),Op(Mh);const wm=latestSaying(Mh);um(wp=>wp?.id===wm?.id&&wp?.text===wm?.text?wp:wm),I1?.(Mh)},[I1]),Gg=reactExports.useCallback(Mh=>{if(!(Mh==="sidebar"&&Up))if(Mh==="sidebar"){if(gd){gd(Mh);return}Yp("panel"),im(Np=>Np+1)}else Mh==="assistant"&&Nf(),Yp(Mh),im(Np=>Np+1),gd?.(Mh)},[gd,Up,Nf]);reactExports.useLayoutEffect(()=>{if(tp!=="panel"||jh){zf(!1);return}if(xp){zf(!0);return}const Mh=Rh.current?.parentElement;if(!Mh){zf(!1);return}const Np=window.getComputedStyle(Mh),Qf=Np.display.includes("flex")&&(Np.flexDirection==="row"||Np.flexDirection==="row-reverse"),wm=Np.display.includes("grid");zf(Qf||wm)},[tp,jh,Yh,xp]);const Tg=typeof Du=="number"?Du:typeof Du=="string"&&Number.parseInt(Du,10)||420;reactExports.useLayoutEffect(()=>{if(jh||tp!=="panel"||Rf||!Yh){mp(null);return}const Mh=Rh.current?.parentElement;if(!Mh){mp(null);return}const Np=Mh.style.paddingRight,Qf=Mh.style.boxSizing,wm=window.getComputedStyle(Mh).paddingRight;Mh.style.boxSizing="border-box",Mh.style.paddingRight=`calc(${wm} + ${Tg}px)`;const wp=()=>{const mg=Mh.getBoundingClientRect();mp(Sm=>{const ig=mg.height<1?{top:0,height:window.innerHeight,right:0}:{top:mg.top,height:mg.height,right:Math.max(0,window.innerWidth-mg.right)};return Sm&&Math.abs(Sm.top-ig.top)<1&&Math.abs(Sm.height-ig.height)<1&&Math.abs(Sm.right-ig.right)<1?Sm:ig})};wp(),window.addEventListener("resize",wp),window.addEventListener("scroll",wp,!0);const Um=new ResizeObserver(wp);return Um.observe(Mh),()=>{window.removeEventListener("resize",wp),window.removeEventListener("scroll",wp,!0),Um.disconnect(),Mh.style.paddingRight=Np,Mh.style.boxSizing=Qf}},[jh,tp,Rf,Yh,Tg]);const zm=reactExports.useMemo(()=>{if(lo&&typeof lo=="object")return lo;if(!Au)return;const Mh=typeof lo=="string"?lo:void 0,Np=Au.match(/^(.*?)\/api\/v1\//)?.[1]||Au.match(/^(https?:\/\/[^/]+)/)?.[1]||"",Qf=Au.match(/\/api\/v1\/(ag-ui|vercel-ai|a2a|acp)\//),wm=Mh??Qf?.[1]??"vercel-ai",wp=endpointAgentId(Au);return{type:wm,endpoint:Au,agentId:wp,authToken:ah,enableConfigQuery:jd||Cd||$d||Id,configEndpoint:jd||Cd||$d||Id?`${Np}/api/v1/configure`:void 0}},[lo,Au,ah,jd,Cd,$d,Id]),pg=Au?.match(/^(.*?)\/api\/v1\//)?.[1],Xh=reactExports.useMemo(()=>gh||zm?.agentId?{name:Ru,protocol:zm?.type,url:zm?.endpoint,agentId:zm?.agentId,apiBase:pg,...gh}:void 0,[gh,zm,Ru,pg]),zv=useAgentRuntimeCodemodeStatus(),Uv=reactExports.useMemo(()=>Ch??assistantSandboxOf(zv?.sandbox,{agentId:zm?.agentId,serverUrl:pg})??(zm?.agentId&&pg?{kind:"runtime",status:"not running",agentId:zm.agentId,serverUrl:pg}:void 0),[Ch,zv,zm?.agentId,pg]);reactExports.useEffect(()=>{cp()},[Au,lo]),reactExports.useEffect(()=>{Df(Ou)},[]);const Vf=reactExports.useCallback(()=>{const Mh=!Yh;Bp(!0),Mh?(Df(Mh),nd?.()):setTimeout(()=>{Df(Mh),od?.(),Bp(!1)},kd),setTimeout(()=>Bp(!1),kd)},[Yh,Df,nd,od,kd]),P1=reactExports.useCallback(Mh=>{Yh&&Vf(),keepAway(Mh),Ym(!0),setTimeout(()=>{Ym(!1),Sf(Mh)},600)},[Yh,Vf]),kg=typeof window>"u"?1280:window.innerWidth,c0=typeof window>"u"?800:window.innerHeight,Xf=conversationBalloonHeight(c0),fv=Vh&&!Sh,Wg=fv?CURRENT_BALLOON_HEIGHT:Xf,mv=()=>{const Mh=CONVERSATION_BALLOON_WIDTH,Np=Wg;if(Jf.position){const{left:Sm,top:ig}=Jf.position,qv=Sm+mf/2<kg/2,N0=ig-Np-16,em=ig+mf+16,gg=N0<8&&em+Np>c0-8,vg=gg?qv?Sm+mf+16:Sm-Mh-16:qv?Sm:Sm+mf-Mh,vv=gg?ig+mf-Np:N0>=8?N0:em,Em=clamp(vg,kg-Mh-8);return{place:{left:px(Em),top:px(clamp(vv,c0-Np-8)),right:"auto",bottom:"auto"},tail:gg?{edge:"none"}:{edge:N0>=8?"bottom":"top",at:balloonTailAt(Sm+mf/2,Em)}}}const Qf=Pu.endsWith("right"),wm=Qf?kg-Sd-mf/2:Sd+mf/2,wp=Qf?kg-Sd-Mh:Sd,Um={edge:Pu.startsWith("bottom")?"bottom":"top",at:balloonTailAt(wm,wp)},mg=hm();return{place:Pu.startsWith("bottom")?{...mg,bottom:px(Sd+mf+16)}:{...mg,top:px(Sd+mf+16)},tail:Um}},Af=reactExports.useCallback(()=>{$u&&cp(),td?.()},[$u,cp,td]),Kg=reactExports.useCallback(()=>{window.confirm("Clear all messages?")&&$u&&cp()},[$u,cp]);useChatKeyboardShortcuts({onToggle:Uu?Vf:void 0,onNewChat:Uu?Af:void 0,onClear:Uu&&Cp.length>0?Kg:void 0,enabled:Uu}),reactExports.useEffect(()=>{if(!Yu||!Yh)return;const Mh=Np=>{Np.key==="Escape"&&Vf()};return document.addEventListener("keydown",Mh),()=>document.removeEventListener("keydown",Mh)},[Yu,Yh,Vf]);const gv=!!Sh;reactExports.useEffect(()=>{if(!gv||!Yh)return;const Mh=setTimeout(()=>{Rh.current?.querySelector('[data-chat-composer] textarea, [data-chat-composer] [contenteditable="true"], textarea')?.focus()},kd);return()=>clearTimeout(Mh)},[gv,Yh,kd,Mf]),reactExports.useEffect(()=>{if(!am||!Yh)return;const Mh=setTimeout(()=>{const Np=Rh.current?.querySelector("[data-chat-history]");Np?.scrollTo?.({top:Np.scrollHeight})},kd);return()=>clearTimeout(Mh)},[am,Yh,kd]),reactExports.useEffect(()=>{if(!Ju||!Yh)return;const Mh=Qf=>{Rh.current&&!Rh.current.contains(Qf.target)&&Vf()},Np=setTimeout(()=>{document.addEventListener("mousedown",Mh)},100);return()=>{clearTimeout(Np),document.removeEventListener("mousedown",Mh)}},[Ju,Yh,Vf]),reactExports.useEffect(()=>{if(jh&&Yh)return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.touchAction="none",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width="",document.body.style.touchAction=""}},[jh,Yh]);const hm=()=>{const Mh={position:"fixed",zIndex:1e3};switch(Pu){case"bottom-right":Mh.bottom=Sd,Mh.right=Sd;break;case"bottom-left":Mh.bottom=Sd,Mh.left=Sd;break;case"top-right":Mh.top=Sd,Mh.right=Sd;break;case"top-left":Mh.top=Sd,Mh.left=Sd;break}return Mh},Dm=Mh=>{if(Mh)return"scale(1) translateY(0)";switch(Pu){case"bottom-right":case"bottom-left":return"scale(0.95) translateY(20px)";case"top-right":case"top-left":return"scale(0.95) translateY(-20px)";default:return"scale(0.95)"}},fg=Uu?getShortcutDisplay({key:Hu}):void 0,yf=am?mv():void 0,vf=jh?"100%":yf?CONVERSATION_BALLOON_WIDTH:Du,xm=jh?"100%":yf?Wg:Mu,Zg=jh?{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",borderRadius:0}:{},$g=jsxRuntimeExports.jsx(Tooltip,{text:`Close${Yu?" (Esc)":""}`,direction:"s",children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,"aria-label":"Close",onClick:Vf,variant:"invisible",size:"small"})}),Hv=yf?{showHeader:!1,showPoweredBy:!1,promptVariant:"lexical",showModelSelector:!1,showToolsMenu:!1,showSkillsMenu:!1,showTokenUsage:!1,showContextRing:!1,showInformation:!1,showToolApprovalBanner:!1,showAgentsMenu:!1,showTurnFooter:!1,compact:!0,welcome:Iu,backgroundColor:"canvas.default",borderRadius:"var(--theme-radius-bubble, 16px)",trailingContent:Mp?jsxRuntimeExports.jsx(BalloonApprovalMessage,{approval:Mp}):void 0,footerContent:dm?jsxRuntimeExports.jsx(Box,{"data-balloon-decisions":"",px:3,pb:1,display:"flex",flexDirection:"column",alignItems:"flex-end",fontSize:0,sx:{"& form":{alignSelf:"stretch"},'& [data-balloon-decision="answered"]':{alignSelf:"stretch"}},children:jsxRuntimeExports.jsx(DecisionAsk,{ask:dm})}):void 0}:void 0,Jp=jsxRuntimeExports.jsxs(Box,{ref:Rh,className:Xu,sx:{...am?{[ASSISTANT_CLEARANCE_VAR]:"initial"}:{},position:tp==="panel"&&!jh&&(Rf||tf)?"relative":"fixed",...tp==="floating"&&!jh?{top:0,right:0,bottom:0,left:"auto"}:{},...tp==="floating-small"&&!jh?hm():{},...tp==="floating-draggable"&&!jh?vp.position?{left:px(vp.position.left),top:px(vp.position.top),right:"auto",bottom:"auto"}:hm():{},...yf?yf.place:Pm&&!jh?hm():{},...tp==="panel"&&!jh?{...Rf||tf?{top:"auto",right:"auto",bottom:"auto",left:"auto",marginLeft:"auto",alignSelf:"stretch"}:{top:Gf?`${Gf.top}px`:0,right:Gf?`${Gf.right}px`:0,bottom:Gf?"auto":0,left:"auto"}}:{},width:tp==="panel"&&!jh?Yh||df?`${Tg}px`:"0px":tp==="floating"&&!jh?typeof vf=="number"?`${vf}px`:vf:(tp==="floating-small"||tp==="floating-draggable"||tp==="assistant")&&!jh?typeof vf=="number"?`${vf}px`:vf:jh?"100%":typeof vf=="number"?`${vf}px`:vf,height:tp==="panel"&&!jh?Rf||tf?"100%":Gf?`${Gf.height}px`:"100%":tp==="floating"&&!jh?"100%":(tp==="floating-small"||tp==="floating-draggable"||tp==="assistant")&&!jh?typeof xm=="number"?`${xm}px`:xm:jh?"100%":typeof xm=="number"?`${xm}px`:xm,display:"flex",flexDirection:"column",bg:"canvas.default",border:"1px solid",borderColor:"border.default",borderRadius:tp==="panel"||jh?0:Pm?"var(--theme-radius-bubble, 16px)":"12px",boxShadow:tp==="panel"?"shadow.none":"shadow.extra-large",overflow:"hidden",transform:tp==="panel"?Yh?"translateX(0)":"translateX(100%)":Dm(Yh),opacity:tp==="panel"||Yh?1:0,transition:`transform ${kd}ms ease, opacity ${kd}ms ease, width ${kd}ms ease`,zIndex:tp==="panel"&&!jh&&(Rf||tf)?"auto":1001,visibility:Yh||df?"visible":"hidden",pointerEvents:Yh?"auto":"none",...Zg,...yf?conversationBalloonSx(yf.tail,yf.tail.edge==="bottom"?"canvas.subtle":"canvas.default"):{}},"data-conversation-balloon":yf?"":void 0,"data-balloon-display":yf?hp:void 0,children:[yf?jsxRuntimeExports.jsx(ConversationBalloonClose,{onClose:Vf}):null,yf&&!fv?jsxRuntimeExports.jsx(ConversationBalloonHeader,{count:lh}):null,tp==="floating-draggable"&&!jh&&jsxRuntimeExports.jsx(Box,{onPointerDown:vp.onHandlePointerDown,"aria-label":"Move the chat",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:18,cursor:"grab",color:"fg.subtle",bg:"canvas.subtle",borderBottom:"1px solid",borderColor:"border.muted",active:{cursor:"grabbing"},touchAction:"none",children:jsxRuntimeExports.jsx(GrabberIcon,{size:16})}),Sh?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Lu&&!yf?jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,flexShrink:0,px:3,py:2,borderBottom:"1px solid",borderColor:"border.default",children:[pd||jsxRuntimeExports.jsx(ForwardRef$2,{colored:!0,size:20}),jsxRuntimeExports.jsx(Text$3,{sx:{flex:1,minWidth:0,fontWeight:"semibold",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ru}),$g]}):null,jsxRuntimeExports.jsx(Box,{"data-floating-conversation":!0,flex:"1 1 auto",minHeight:0,display:"flex",borderRadius:yf?"bubble":void 0,overflow:yf?"hidden":void 0,children:Sh.body})]}):jsxRuntimeExports.jsx(ChatBase,{title:Ru,showHeader:Lu,useStore:$u,protocol:zm,themeVariant:Dd,themeOverrides:Wd,colorMode:oh,autoFocus:Yh,focusTrigger:Mf,launching:Md,launchingMessage:Kd,brandIcon:pd||jsxRuntimeExports.jsx(ForwardRef$2,{colored:!0,size:20}),headerButtons:{showNewChat:ju,showClear:Fu&&Cp.length>0,showSettings:zu&&!!ed,onNewChat:Af,onClear:Kg,onSettings:ed},headerActions:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$g}),chatViewMode:zp,onChatViewModeChange:Gg,disabledViewModes:Gp,showPoweredBy:Vu,promptVariant:Gu,mentionableAgents:Wu,poweredByProps:{brandName:"Datalayer",brandUrl:"https://datalayer.ai",...Zu},description:Iu,onStateUpdate:sd,onNewChat:td,suggestions:vd,submitOnSuggestionClick:ld,hideMessagesAfterToolUI:ud,avatarConfig:{showAvatars:!0},placeholder:"Type a message...",backgroundColor:"canvas.subtle",frontendTools:md,showModelSelector:jd,availableModels:Rd,showToolsMenu:Cd,showSkillsMenu:$d,showTokenUsage:Id,showContextRing:Vd,runtimeId:rh,historyEndpoint:Eh,historyAuthToken:yh,pendingPrompt:vh??xh,inspector:xd,showInformation:Jd,onInformationClick:Qd,onToolCallStart:sh,onToolCallComplete:Oh,showToolApprovalBanner:qd,pendingApprovals:zd,onApproveApproval:Pd,onRejectApproval:Od,voice:Nd,voiceSpeaking:Uh.speaking,voiceSentence:Uh.sentence,onStopSpeaking:Dp?ap:void 0,voiceLevel:Uf,onReadAloud:Dp?sm:void 0,...Gd,...Hv,onLoadingChange:pv,onDisplayItemsChange:Fv,onSendReady:jv,children:yf&&fv?jsxRuntimeExports.jsx(Box,{px:3,pt:3,pb:2,overflow:"hidden",children:jsxRuntimeExports.jsx(CurrentBalloonBody,{text:Cf?void 0:s0??Iu,fullText:Cf?void 0:a0,tool:Cf,busy:rf,speaking:Zf&&rf,waiting:rf&&!Zf})}):ad})]}),M0=jsxRuntimeExports.jsx(IconButton,{icon:bd||CommentDiscussionIcon,"aria-label":wd,unsafeDisableTooltip:!!bp,onClick:Pm&&bm==="page"?Nf:Vf,size:"large",sx:{width:56,height:56,borderRadius:"50%",bg:_d||"accent.emphasis",color:"fg.onEmphasis",boxShadow:"shadow.large",transition:"transform 0.2s ease, box-shadow 0.2s ease",transform:af?"scale(1.1)":"scale(1)",...qf?{animation:"chatFloatingBlink 1.1s ease-in-out infinite","@keyframes chatFloatingBlink":{"0%, 100%":{filter:"brightness(1)",boxShadow:"0 0 0 0 rgba(0,0,0,0)"},"50%":{filter:"brightness(1.25)",boxShadow:"0 0 0 6px var(--bgColor-accent-muted, rgba(84,174,255,0.4))"}},"@media (prefers-reduced-motion: reduce)":{animation:"none"}}:{},"&:hover":{bg:_d||"accent.emphasis",boxShadow:"shadow.extra-large"}}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[am&&jsxRuntimeExports.jsx(AssistantStage,{character:Xd,state:Tp,size:mf,place:Jf.position?{left:px(Jf.position.left),top:px(Jf.position.top)}:hm(),stageRef:ym,onDragStart:Jf.onHandlePointerDown,open:Yh,onToggle:Vf,balloon:hg,balloonDisplay:hp,expandTarget:_h,insist:D0,onDismiss:P1,ownRef:Rh,mouthLevel:Uf,suggestions:qg,onSuggestion:Vg,inspector:xd,onBalloonDisplayChange:gp,onStop:Kf&&$h.current?()=>$h.current?.stop():void 0,onNewChat:!Sh&&ju?Af:void 0,onClear:!Sh&&$u?Kg:void 0,onChangeCharacter:Zd,speech:Dp&&hf?.output==="always"?{muted:Kh,onToggle:()=>{Kh||Dp.stop(),Dh(!Kh)}}:void 0,onResetPosition:Jf.position?Jf.reset:void 0,about:Xh,sandbox:Uv,contextMenu:wh}),Bu&&!Yh&&!am&&jsxRuntimeExports.jsx(Box,{sx:{...hm()},children:jsxRuntimeExports.jsxs(Box,{position:"relative",display:"inline-flex",isolation:"isolate",onMouseEnter:()=>ef(!0),onMouseLeave:()=>ef(!1),children:[yd&&jsxRuntimeExports.jsx(ButtonGlow,{color:_d}),af&&bp?jsxRuntimeExports.jsx(SpeechBalloon,{text:bp.text,more:bp.more,onOpen:Vf,above:64,side:Pu.startsWith("bottom")?"above":"below",align:Pu.includes("right")?"right":"left",tailAt:28}):null,bp?M0:jsxRuntimeExports.jsx(Tooltip,{text:`${wd}${fg?` (${fg})`:""}`,direction:Pu.includes("right")?"w":"e",children:M0}),Cp.length>0&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,right:0,minWidth:18,height:18,px:1,display:"flex",alignItems:"center",justifyContent:"center",bg:"danger.emphasis",color:"fg.onEmphasis",borderRadius:"50%",fontSize:0,fontWeight:"bold",pointerEvents:"none",children:jsxRuntimeExports.jsx(Text$3,{sx:{fontSize:0},children:Cp.length>99?"99+":Cp.length})}),qf&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"50%",border:"2px solid",borderColor:_d||"accent.emphasis",animation:"pulse 2s infinite",pointerEvents:"none",reducedMotion:{animation:"none",transform:"scale(1.15)",opacity:.6},sx:{"@keyframes pulse":{"0%":{transform:"scale(1)",opacity:1},"100%":{transform:"scale(1.5)",opacity:0}}}})]})}),jh&&Yh&&jsxRuntimeExports.jsx(Box,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"neutral.muted",opacity:.5,zIndex:999,onClick:Vf}),Td&&tp==="panel"&&Yh&&!jh&&jsxRuntimeExports.jsx(Box,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"neutral.muted",opacity:.3,zIndex:1e3,onClick:Vf}),tf&&xp?reactDomExports.createPortal(Jp,xp):Jp]})}const LoopCanvasBlock=defineContributionPoint("loop.canvas.block"),LoopA2uiComponent=defineContributionPoint("loop.a2ui.component"),LoopAppFiles=defineContributionPoint("loop.app.files"),listeners$2=new Set;function requestSurface(Au){if(listeners$2.size===0)return!1;for(const lo of[...listeners$2])lo(Au);return!0}function onSurfaceRequest(Au){return listeners$2.add(Au),()=>{listeners$2.delete(Au)}}const listeners$1=new Set;function focusPrompt(){if(listeners$1.size===0)return!1;for(const Au of[...listeners$1])Au();return!0}function onPromptFocusRequest(Au){return listeners$1.add(Au),()=>{listeners$1.delete(Au)}}function agentServerOf(Au,lo){return Au.target==="datalayer"?Au.agentBaseUrl||void 0:Au.agentBaseUrl||lo}function noRuntimeSaid(Au,lo){return Au.state==="error"?lo.noRuntime(Au.errorReason??""):lo.runtimeStarting}const IDLE_SANDBOX_SNAPSHOT=Object.freeze({state:"idle"}),IDLE_SANDBOX_SNAPSHOT_SIGNAL={value:IDLE_SANDBOX_SNAPSHOT,peek:()=>IDLE_SANDBOX_SNAPSHOT},IDLE_SANDBOX_TARGET_SIGNAL={value:void 0,peek:()=>{}};function loopSurfaceId(Au){return`loop-${Au||"default"}`}function createPromptChannel(){const Au=new Set,lo=[];return{submit($u){if(Au.size===0)return lo.push($u),!0;for(const Ru of[...Au])Ru($u);return!0},subscribe($u){if(Au.add($u),lo.length>0){const Ru=lo.splice(0,lo.length);queueMicrotask(()=>{for(const Iu of Ru)$u(Iu)})}return()=>{Au.delete($u)}}}}const LoopViewType=defineContributionPoint("loop.viewType"),LoopEditorView=defineContributionPoint("loop.chat.surface"),LoopChatSurface=LoopEditorView,LoopFrontendTool=defineContributionPoint("loop.frontendTool"),LoopChatComposer=defineContributionPoint("loop.chat.composer"),LoopChatHeader=defineContributionPoint("loop.chat.header"),LoopSessionAction=defineContributionPoint("loop.session.action");function sessionActionsFor(Au,lo,$u="thread"){return lo?Au.map(Ru=>Ru.value).filter(Ru=>{const Iu=Ru.placement??"thread";return Iu==="both"||Iu===$u}).filter(Ru=>{try{return Ru.when(lo)}catch{return!1}}).sort((Ru,Iu)=>(Ru.order??100)-(Iu.order??100)):[]}const LoopAgentBlueprint=defineContributionPoint("loop.agent.blueprint"),LoopChatSuggestion=defineContributionPoint("loop.chat.suggestion"),LoopAssistantCharacter=defineContributionPoint("loop.assistant.character");defineContributionPoint("loop.assistant.menu");async function sendInstead(Au,lo){if(!Au.sendInstead)return null;try{return await Au.sendInstead.send(lo),{sent:!0}}catch($u){return{sent:!1,refused:$u instanceof Error?$u.message:String($u)}}}const LoopChatExtras=defineContributionPoint("loop.chat.extras"),LoopOpeningNotebook=defineContributionPoint("loop.notebook.opening"),LoopOpeningDocument=defineContributionPoint("loop.document.opening"),LoopAgentGate=defineGate("loop.agent.available"),LoopNotebookToolbar=defineContributionPoint("loop.notebook.toolbar"),LoopNotebookToolbarItem=defineContributionPoint("loop.notebook.toolbar.item"),LoopDocumentToolbar=defineContributionPoint("loop.document.toolbar"),LoopDocumentToolbarItem=defineContributionPoint("loop.document.toolbar.item"),LoopCommand=defineContributionPoint("loop.command"),LoopRunProps=defineContributionPoint("loop.runProps");function runForwardedProps(Au,lo){let $u;for(const Ru of[...Au.map(Iu=>Iu.props()),lo]){if(!Ru)continue;const Iu={...$u?.loop??{},...Ru.loop??{}};$u={...$u,...Ru},Object.keys(Iu).length>0&&($u.loop=Iu)}return $u}defineContributionPoint("loop.mention");const LoopSlots={header:"loop.header",chatHeader:"loop.chatHeader",promptAction:"loop.promptAction",inpromptMenu:"loop.inpromptMenu",footer:"loop.footer",status:"loop.status",root:"root",sidebar:"loop.sidebar"};function sandboxIndicatorState(Au,lo,$u){return Au==="error"?"connected-dead":Au==="starting"?"connected-starting":Au==="stopping"?"disconnecting":Au!=="running"?"disconnected":lo==="busy"||$u?"connected-busy":"connected-idle"}function canOpenView(Au,lo){return Au.canOpen?Au.canOpen(lo):!0}function parseCommand(Au){const lo=Au.trimStart();if(!lo.startsWith("/"))return;const[$u,...Ru]=lo.slice(1).split(/\s+/);if($u)return{name:$u.toLowerCase(),argv:Ru.join(" ").trim()}}const LoopChatLayout=defineContributionPoint("loop.chat.layout"),LoopPromptPanel=defineContributionPoint("loop.prompt.panel"),LoopChatTurn=defineContributionPoint("loop.chat.turn");function defineAgentCapacityPlugin(Au){const{key:lo,displayName:$u,description:Ru,specId:Iu,octicon:Pu,emoji:Ou,codemode:Du,createPayload:Mu,suggestions:Lu,instructions:Bu,model:ju,modeEffect:Fu,name:zu,requiredBackendPlugins:Uu}=Au;return{name:zu??`@datalayer/loop-plugin-agent-${lo}`,...Uu?{requiredBackendPlugins:Uu}:{},displayName:$u,description:Ru,octicon:Pu??"dependabot",emoji:Ou,contributes:[contribution(LoopAgentBlueprint,{id:lo,specId:Iu,createPayload:{description:Ru,agent_library:"pydantic-ai",enable_codemode:Du??!1,...Mu},...Bu?{instructions:Bu}:{},...ju?{model:ju}:{},...Fu?{modeEffect:Fu}:{}},{id:lo}),...Lu&&Lu.length>0?[contribution(LoopChatSuggestion,{id:lo,suggestions:Lu},{id:lo})]:[]]}}var util;(function(Au){Au.assertEqual=Iu=>{};function lo(Iu){}Au.assertIs=lo;function $u(Iu){throw new Error}Au.assertNever=$u,Au.arrayToEnum=Iu=>{const Pu={};for(const Ou of Iu)Pu[Ou]=Ou;return Pu},Au.getValidEnumValues=Iu=>{const Pu=Au.objectKeys(Iu).filter(Du=>typeof Iu[Iu[Du]]!="number"),Ou={};for(const Du of Pu)Ou[Du]=Iu[Du];return Au.objectValues(Ou)},Au.objectValues=Iu=>Au.objectKeys(Iu).map(function(Pu){return Iu[Pu]}),Au.objectKeys=typeof Object.keys=="function"?Iu=>Object.keys(Iu):Iu=>{const Pu=[];for(const Ou in Iu)Object.prototype.hasOwnProperty.call(Iu,Ou)&&Pu.push(Ou);return Pu},Au.find=(Iu,Pu)=>{for(const Ou of Iu)if(Pu(Ou))return Ou},Au.isInteger=typeof Number.isInteger=="function"?Iu=>Number.isInteger(Iu):Iu=>typeof Iu=="number"&&Number.isFinite(Iu)&&Math.floor(Iu)===Iu;function Ru(Iu,Pu=" | "){return Iu.map(Ou=>typeof Ou=="string"?`'${Ou}'`:Ou).join(Pu)}Au.joinValues=Ru,Au.jsonStringifyReplacer=(Iu,Pu)=>typeof Pu=="bigint"?Pu.toString():Pu})(util||(util={}));var objectUtil;(function(Au){Au.mergeShapes=(lo,$u)=>({...lo,...$u})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=Au=>{switch(typeof Au){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(Au)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(Au)?ZodParsedType.array:Au===null?ZodParsedType.null:Au.then&&typeof Au.then=="function"&&Au.catch&&typeof Au.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&Au instanceof Map?ZodParsedType.map:typeof Set<"u"&&Au instanceof Set?ZodParsedType.set:typeof Date<"u"&&Au instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(lo){super(),this.issues=[],this.addIssue=Ru=>{this.issues=[...this.issues,Ru]},this.addIssues=(Ru=[])=>{this.issues=[...this.issues,...Ru]};const $u=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$u):this.__proto__=$u,this.name="ZodError",this.issues=lo}format(lo){const $u=lo||function(Pu){return Pu.message},Ru={_errors:[]},Iu=Pu=>{for(const Ou of Pu.issues)if(Ou.code==="invalid_union")Ou.unionErrors.map(Iu);else if(Ou.code==="invalid_return_type")Iu(Ou.returnTypeError);else if(Ou.code==="invalid_arguments")Iu(Ou.argumentsError);else if(Ou.path.length===0)Ru._errors.push($u(Ou));else{let Du=Ru,Mu=0;for(;Mu<Ou.path.length;){const Lu=Ou.path[Mu];Mu===Ou.path.length-1?(Du[Lu]=Du[Lu]||{_errors:[]},Du[Lu]._errors.push($u(Ou))):Du[Lu]=Du[Lu]||{_errors:[]},Du=Du[Lu],Mu++}}};return Iu(this),Ru}static assert(lo){if(!(lo instanceof ZodError))throw new Error(`Not a ZodError: ${lo}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(lo=$u=>$u.message){const $u={},Ru=[];for(const Iu of this.issues)if(Iu.path.length>0){const Pu=Iu.path[0];$u[Pu]=$u[Pu]||[],$u[Pu].push(lo(Iu))}else Ru.push(lo(Iu));return{formErrors:Ru,fieldErrors:$u}}get formErrors(){return this.flatten()}}ZodError.create=Au=>new ZodError(Au);const errorMap=(Au,lo)=>{let $u;switch(Au.code){case ZodIssueCode.invalid_type:Au.received===ZodParsedType.undefined?$u="Required":$u=`Expected ${Au.expected}, received ${Au.received}`;break;case ZodIssueCode.invalid_literal:$u=`Invalid literal value, expected ${JSON.stringify(Au.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$u=`Unrecognized key(s) in object: ${util.joinValues(Au.keys,", ")}`;break;case ZodIssueCode.invalid_union:$u="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$u=`Invalid discriminator value. Expected ${util.joinValues(Au.options)}`;break;case ZodIssueCode.invalid_enum_value:$u=`Invalid enum value. Expected ${util.joinValues(Au.options)}, received '${Au.received}'`;break;case ZodIssueCode.invalid_arguments:$u="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$u="Invalid function return type";break;case ZodIssueCode.invalid_date:$u="Invalid date";break;case ZodIssueCode.invalid_string:typeof Au.validation=="object"?"includes"in Au.validation?($u=`Invalid input: must include "${Au.validation.includes}"`,typeof Au.validation.position=="number"&&($u=`${$u} at one or more positions greater than or equal to ${Au.validation.position}`)):"startsWith"in Au.validation?$u=`Invalid input: must start with "${Au.validation.startsWith}"`:"endsWith"in Au.validation?$u=`Invalid input: must end with "${Au.validation.endsWith}"`:util.assertNever(Au.validation):Au.validation!=="regex"?$u=`Invalid ${Au.validation}`:$u="Invalid";break;case ZodIssueCode.too_small:Au.type==="array"?$u=`Array must contain ${Au.exact?"exactly":Au.inclusive?"at least":"more than"} ${Au.minimum} element(s)`:Au.type==="string"?$u=`String must contain ${Au.exact?"exactly":Au.inclusive?"at least":"over"} ${Au.minimum} character(s)`:Au.type==="number"?$u=`Number must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${Au.minimum}`:Au.type==="bigint"?$u=`Number must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${Au.minimum}`:Au.type==="date"?$u=`Date must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(Au.minimum))}`:$u="Invalid input";break;case ZodIssueCode.too_big:Au.type==="array"?$u=`Array must contain ${Au.exact?"exactly":Au.inclusive?"at most":"less than"} ${Au.maximum} element(s)`:Au.type==="string"?$u=`String must contain ${Au.exact?"exactly":Au.inclusive?"at most":"under"} ${Au.maximum} character(s)`:Au.type==="number"?$u=`Number must be ${Au.exact?"exactly":Au.inclusive?"less than or equal to":"less than"} ${Au.maximum}`:Au.type==="bigint"?$u=`BigInt must be ${Au.exact?"exactly":Au.inclusive?"less than or equal to":"less than"} ${Au.maximum}`:Au.type==="date"?$u=`Date must be ${Au.exact?"exactly":Au.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(Au.maximum))}`:$u="Invalid input";break;case ZodIssueCode.custom:$u="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$u="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$u=`Number must be a multiple of ${Au.multipleOf}`;break;case ZodIssueCode.not_finite:$u="Number must be finite";break;default:$u=lo.defaultError,util.assertNever(Au)}return{message:$u}};let overrideErrorMap=errorMap;function getErrorMap(){return overrideErrorMap}const makeIssue=Au=>{const{data:lo,path:$u,errorMaps:Ru,issueData:Iu}=Au,Pu=[...$u,...Iu.path||[]],Ou={...Iu,path:Pu};if(Iu.message!==void 0)return{...Iu,path:Pu,message:Iu.message};let Du="";const Mu=Ru.filter(Lu=>!!Lu).slice().reverse();for(const Lu of Mu)Du=Lu(Ou,{data:lo,defaultError:Du}).message;return{...Iu,path:Pu,message:Du}};function addIssueToContext(Au,lo){const $u=getErrorMap(),Ru=makeIssue({issueData:lo,data:Au.data,path:Au.path,errorMaps:[Au.common.contextualErrorMap,Au.schemaErrorMap,$u,$u===errorMap?void 0:errorMap].filter(Iu=>!!Iu)});Au.common.issues.push(Ru)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(lo,$u){const Ru=[];for(const Iu of $u){if(Iu.status==="aborted")return INVALID;Iu.status==="dirty"&&lo.dirty(),Ru.push(Iu.value)}return{status:lo.value,value:Ru}}static async mergeObjectAsync(lo,$u){const Ru=[];for(const Iu of $u){const Pu=await Iu.key,Ou=await Iu.value;Ru.push({key:Pu,value:Ou})}return ParseStatus.mergeObjectSync(lo,Ru)}static mergeObjectSync(lo,$u){const Ru={};for(const Iu of $u){const{key:Pu,value:Ou}=Iu;if(Pu.status==="aborted"||Ou.status==="aborted")return INVALID;Pu.status==="dirty"&&lo.dirty(),Ou.status==="dirty"&&lo.dirty(),Pu.value!=="__proto__"&&(typeof Ou.value<"u"||Iu.alwaysSet)&&(Ru[Pu.value]=Ou.value)}return{status:lo.value,value:Ru}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=Au=>({status:"dirty",value:Au}),OK=Au=>({status:"valid",value:Au}),isAborted=Au=>Au.status==="aborted",isDirty=Au=>Au.status==="dirty",isValid=Au=>Au.status==="valid",isAsync=Au=>typeof Promise<"u"&&Au instanceof Promise;var errorUtil;(function(Au){Au.errToObj=lo=>typeof lo=="string"?{message:lo}:lo||{},Au.toString=lo=>typeof lo=="string"?lo:lo?.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(lo,$u,Ru,Iu){this._cachedPath=[],this.parent=lo,this.data=$u,this._path=Ru,this._key=Iu}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(Au,lo)=>{if(isValid(lo))return{success:!0,data:lo.value};if(!Au.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $u=new ZodError(Au.common.issues);return this._error=$u,this._error}}};function processCreateParams(Au){if(!Au)return{};const{errorMap:lo,invalid_type_error:$u,required_error:Ru,description:Iu}=Au;if(lo&&($u||Ru))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return lo?{errorMap:lo,description:Iu}:{errorMap:(Ou,Du)=>{const{message:Mu}=Au;return Ou.code==="invalid_enum_value"?{message:Mu??Du.defaultError}:typeof Du.data>"u"?{message:Mu??Ru??Du.defaultError}:Ou.code!=="invalid_type"?{message:Du.defaultError}:{message:Mu??$u??Du.defaultError}},description:Iu}}class ZodType{get description(){return this._def.description}_getType(lo){return getParsedType(lo.data)}_getOrReturnCtx(lo,$u){return $u||{common:lo.parent.common,data:lo.data,parsedType:getParsedType(lo.data),schemaErrorMap:this._def.errorMap,path:lo.path,parent:lo.parent}}_processInputParams(lo){return{status:new ParseStatus,ctx:{common:lo.parent.common,data:lo.data,parsedType:getParsedType(lo.data),schemaErrorMap:this._def.errorMap,path:lo.path,parent:lo.parent}}}_parseSync(lo){const $u=this._parse(lo);if(isAsync($u))throw new Error("Synchronous parse encountered promise.");return $u}_parseAsync(lo){const $u=this._parse(lo);return Promise.resolve($u)}parse(lo,$u){const Ru=this.safeParse(lo,$u);if(Ru.success)return Ru.data;throw Ru.error}safeParse(lo,$u){const Ru={common:{issues:[],async:$u?.async??!1,contextualErrorMap:$u?.errorMap},path:$u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)},Iu=this._parseSync({data:lo,path:Ru.path,parent:Ru});return handleResult(Ru,Iu)}"~validate"(lo){const $u={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)};if(!this["~standard"].async)try{const Ru=this._parseSync({data:lo,path:[],parent:$u});return isValid(Ru)?{value:Ru.value}:{issues:$u.common.issues}}catch(Ru){Ru?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),$u.common={issues:[],async:!0}}return this._parseAsync({data:lo,path:[],parent:$u}).then(Ru=>isValid(Ru)?{value:Ru.value}:{issues:$u.common.issues})}async parseAsync(lo,$u){const Ru=await this.safeParseAsync(lo,$u);if(Ru.success)return Ru.data;throw Ru.error}async safeParseAsync(lo,$u){const Ru={common:{issues:[],contextualErrorMap:$u?.errorMap,async:!0},path:$u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)},Iu=this._parse({data:lo,path:Ru.path,parent:Ru}),Pu=await(isAsync(Iu)?Iu:Promise.resolve(Iu));return handleResult(Ru,Pu)}refine(lo,$u){const Ru=Iu=>typeof $u=="string"||typeof $u>"u"?{message:$u}:typeof $u=="function"?$u(Iu):$u;return this._refinement((Iu,Pu)=>{const Ou=lo(Iu),Du=()=>Pu.addIssue({code:ZodIssueCode.custom,...Ru(Iu)});return typeof Promise<"u"&&Ou instanceof Promise?Ou.then(Mu=>Mu?!0:(Du(),!1)):Ou?!0:(Du(),!1)})}refinement(lo,$u){return this._refinement((Ru,Iu)=>lo(Ru)?!0:(Iu.addIssue(typeof $u=="function"?$u(Ru,Iu):$u),!1))}_refinement(lo){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:lo}})}superRefine(lo){return this._refinement(lo)}constructor(lo){this.spa=this.safeParseAsync,this._def=lo,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:$u=>this["~validate"]($u)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(lo){return ZodUnion.create([this,lo],this._def)}and(lo){return ZodIntersection.create(this,lo,this._def)}transform(lo){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:lo}})}default(lo){const $u=typeof lo=="function"?lo:()=>lo;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$u,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(lo){const $u=typeof lo=="function"?lo:()=>lo;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$u,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(lo){const $u=this.constructor;return new $u({...this._def,description:lo})}pipe(lo){return ZodPipeline.create(this,lo)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(Au){let lo="[0-5]\\d";Au.precision?lo=`${lo}\\.\\d{${Au.precision}}`:Au.precision==null&&(lo=`${lo}(\\.\\d+)?`);const $u=Au.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${lo})${$u}`}function timeRegex(Au){return new RegExp(`^${timeRegexSource(Au)}$`)}function datetimeRegex(Au){let lo=`${dateRegexSource}T${timeRegexSource(Au)}`;const $u=[];return $u.push(Au.local?"Z?":"Z"),Au.offset&&$u.push("([+-]\\d{2}:?\\d{2})"),lo=`${lo}(${$u.join("|")})`,new RegExp(`^${lo}$`)}function isValidIP(Au,lo){return!!((lo==="v4"||!lo)&&ipv4Regex.test(Au)||(lo==="v6"||!lo)&&ipv6Regex.test(Au))}function isValidJWT(Au,lo){if(!jwtRegex.test(Au))return!1;try{const[$u]=Au.split(".");if(!$u)return!1;const Ru=$u.replace(/-/g,"+").replace(/_/g,"/").padEnd($u.length+(4-$u.length%4)%4,"="),Iu=JSON.parse(atob(Ru));return!(typeof Iu!="object"||Iu===null||"typ"in Iu&&Iu?.typ!=="JWT"||!Iu.alg||lo&&Iu.alg!==lo)}catch{return!1}}function isValidCidr(Au,lo){return!!((lo==="v4"||!lo)&&ipv4CidrRegex.test(Au)||(lo==="v6"||!lo)&&ipv6CidrRegex.test(Au))}class ZodString extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=String(lo.data)),this._getType(lo)!==ZodParsedType.string){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:Pu.parsedType}),INVALID}const Ru=new ParseStatus;let Iu;for(const Pu of this._def.checks)if(Pu.kind==="min")lo.data.length<Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"string",inclusive:!0,exact:!1,message:Pu.message}),Ru.dirty());else if(Pu.kind==="max")lo.data.length>Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"string",inclusive:!0,exact:!1,message:Pu.message}),Ru.dirty());else if(Pu.kind==="length"){const Ou=lo.data.length>Pu.value,Du=lo.data.length<Pu.value;(Ou||Du)&&(Iu=this._getOrReturnCtx(lo,Iu),Ou?addIssueToContext(Iu,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"string",inclusive:!0,exact:!0,message:Pu.message}):Du&&addIssueToContext(Iu,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"string",inclusive:!0,exact:!0,message:Pu.message}),Ru.dirty())}else if(Pu.kind==="email")emailRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"email",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"emoji",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="uuid")uuidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"uuid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="nanoid")nanoidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="cuid")cuidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cuid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="cuid2")cuid2Regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="ulid")ulidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"ulid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="url")try{new URL(lo.data)}catch{Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"url",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()}else Pu.kind==="regex"?(Pu.regex.lastIndex=0,Pu.regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"regex",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty())):Pu.kind==="trim"?lo.data=lo.data.trim():Pu.kind==="includes"?lo.data.includes(Pu.value,Pu.position)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{includes:Pu.value,position:Pu.position},message:Pu.message}),Ru.dirty()):Pu.kind==="toLowerCase"?lo.data=lo.data.toLowerCase():Pu.kind==="toUpperCase"?lo.data=lo.data.toUpperCase():Pu.kind==="startsWith"?lo.data.startsWith(Pu.value)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{startsWith:Pu.value},message:Pu.message}),Ru.dirty()):Pu.kind==="endsWith"?lo.data.endsWith(Pu.value)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{endsWith:Pu.value},message:Pu.message}),Ru.dirty()):Pu.kind==="datetime"?datetimeRegex(Pu).test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"datetime",message:Pu.message}),Ru.dirty()):Pu.kind==="date"?dateRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"date",message:Pu.message}),Ru.dirty()):Pu.kind==="time"?timeRegex(Pu).test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"time",message:Pu.message}),Ru.dirty()):Pu.kind==="duration"?durationRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"duration",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="ip"?isValidIP(lo.data,Pu.version)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"ip",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="jwt"?isValidJWT(lo.data,Pu.alg)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"jwt",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="cidr"?isValidCidr(lo.data,Pu.version)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cidr",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="base64"?base64Regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"base64",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="base64url"?base64urlRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"base64url",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):util.assertNever(Pu);return{status:Ru.value,value:lo.data}}_regex(lo,$u,Ru){return this.refinement(Iu=>lo.test(Iu),{validation:$u,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(Ru)})}_addCheck(lo){return new ZodString({...this._def,checks:[...this._def.checks,lo]})}email(lo){return this._addCheck({kind:"email",...errorUtil.errToObj(lo)})}url(lo){return this._addCheck({kind:"url",...errorUtil.errToObj(lo)})}emoji(lo){return this._addCheck({kind:"emoji",...errorUtil.errToObj(lo)})}uuid(lo){return this._addCheck({kind:"uuid",...errorUtil.errToObj(lo)})}nanoid(lo){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(lo)})}cuid(lo){return this._addCheck({kind:"cuid",...errorUtil.errToObj(lo)})}cuid2(lo){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(lo)})}ulid(lo){return this._addCheck({kind:"ulid",...errorUtil.errToObj(lo)})}base64(lo){return this._addCheck({kind:"base64",...errorUtil.errToObj(lo)})}base64url(lo){return this._addCheck({kind:"base64url",...errorUtil.errToObj(lo)})}jwt(lo){return this._addCheck({kind:"jwt",...errorUtil.errToObj(lo)})}ip(lo){return this._addCheck({kind:"ip",...errorUtil.errToObj(lo)})}cidr(lo){return this._addCheck({kind:"cidr",...errorUtil.errToObj(lo)})}datetime(lo){return typeof lo=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:lo}):this._addCheck({kind:"datetime",precision:typeof lo?.precision>"u"?null:lo?.precision,offset:lo?.offset??!1,local:lo?.local??!1,...errorUtil.errToObj(lo?.message)})}date(lo){return this._addCheck({kind:"date",message:lo})}time(lo){return typeof lo=="string"?this._addCheck({kind:"time",precision:null,message:lo}):this._addCheck({kind:"time",precision:typeof lo?.precision>"u"?null:lo?.precision,...errorUtil.errToObj(lo?.message)})}duration(lo){return this._addCheck({kind:"duration",...errorUtil.errToObj(lo)})}regex(lo,$u){return this._addCheck({kind:"regex",regex:lo,...errorUtil.errToObj($u)})}includes(lo,$u){return this._addCheck({kind:"includes",value:lo,position:$u?.position,...errorUtil.errToObj($u?.message)})}startsWith(lo,$u){return this._addCheck({kind:"startsWith",value:lo,...errorUtil.errToObj($u)})}endsWith(lo,$u){return this._addCheck({kind:"endsWith",value:lo,...errorUtil.errToObj($u)})}min(lo,$u){return this._addCheck({kind:"min",value:lo,...errorUtil.errToObj($u)})}max(lo,$u){return this._addCheck({kind:"max",value:lo,...errorUtil.errToObj($u)})}length(lo,$u){return this._addCheck({kind:"length",value:lo,...errorUtil.errToObj($u)})}nonempty(lo){return this.min(1,errorUtil.errToObj(lo))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(lo=>lo.kind==="datetime")}get isDate(){return!!this._def.checks.find(lo=>lo.kind==="date")}get isTime(){return!!this._def.checks.find(lo=>lo.kind==="time")}get isDuration(){return!!this._def.checks.find(lo=>lo.kind==="duration")}get isEmail(){return!!this._def.checks.find(lo=>lo.kind==="email")}get isURL(){return!!this._def.checks.find(lo=>lo.kind==="url")}get isEmoji(){return!!this._def.checks.find(lo=>lo.kind==="emoji")}get isUUID(){return!!this._def.checks.find(lo=>lo.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(lo=>lo.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(lo=>lo.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(lo=>lo.kind==="cuid2")}get isULID(){return!!this._def.checks.find(lo=>lo.kind==="ulid")}get isIP(){return!!this._def.checks.find(lo=>lo.kind==="ip")}get isCIDR(){return!!this._def.checks.find(lo=>lo.kind==="cidr")}get isBase64(){return!!this._def.checks.find(lo=>lo.kind==="base64")}get isBase64url(){return!!this._def.checks.find(lo=>lo.kind==="base64url")}get minLength(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxLength(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}}ZodString.create=Au=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:Au?.coerce??!1,...processCreateParams(Au)});function floatSafeRemainder(Au,lo){const $u=(Au.toString().split(".")[1]||"").length,Ru=(lo.toString().split(".")[1]||"").length,Iu=$u>Ru?$u:Ru,Pu=Number.parseInt(Au.toFixed(Iu).replace(".","")),Ou=Number.parseInt(lo.toFixed(Iu).replace(".",""));return Pu%Ou/10**Iu}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(lo){if(this._def.coerce&&(lo.data=Number(lo.data)),this._getType(lo)!==ZodParsedType.number){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:Pu.parsedType}),INVALID}let Ru;const Iu=new ParseStatus;for(const Pu of this._def.checks)Pu.kind==="int"?util.isInteger(lo.data)||(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Pu.message}),Iu.dirty()):Pu.kind==="min"?(Pu.inclusive?lo.data<Pu.value:lo.data<=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"number",inclusive:Pu.inclusive,exact:!1,message:Pu.message}),Iu.dirty()):Pu.kind==="max"?(Pu.inclusive?lo.data>Pu.value:lo.data>=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"number",inclusive:Pu.inclusive,exact:!1,message:Pu.message}),Iu.dirty()):Pu.kind==="multipleOf"?floatSafeRemainder(lo.data,Pu.value)!==0&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_multiple_of,multipleOf:Pu.value,message:Pu.message}),Iu.dirty()):Pu.kind==="finite"?Number.isFinite(lo.data)||(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_finite,message:Pu.message}),Iu.dirty()):util.assertNever(Pu);return{status:Iu.value,value:lo.data}}gte(lo,$u){return this.setLimit("min",lo,!0,errorUtil.toString($u))}gt(lo,$u){return this.setLimit("min",lo,!1,errorUtil.toString($u))}lte(lo,$u){return this.setLimit("max",lo,!0,errorUtil.toString($u))}lt(lo,$u){return this.setLimit("max",lo,!1,errorUtil.toString($u))}setLimit(lo,$u,Ru,Iu){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:lo,value:$u,inclusive:Ru,message:errorUtil.toString(Iu)}]})}_addCheck(lo){return new ZodNumber({...this._def,checks:[...this._def.checks,lo]})}int(lo){return this._addCheck({kind:"int",message:errorUtil.toString(lo)})}positive(lo){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(lo)})}negative(lo){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(lo)})}nonpositive(lo){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(lo)})}nonnegative(lo){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(lo)})}multipleOf(lo,$u){return this._addCheck({kind:"multipleOf",value:lo,message:errorUtil.toString($u)})}finite(lo){return this._addCheck({kind:"finite",message:errorUtil.toString(lo)})}safe(lo){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(lo)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(lo)})}get minValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}get isInt(){return!!this._def.checks.find(lo=>lo.kind==="int"||lo.kind==="multipleOf"&&util.isInteger(lo.value))}get isFinite(){let lo=null,$u=null;for(const Ru of this._def.checks){if(Ru.kind==="finite"||Ru.kind==="int"||Ru.kind==="multipleOf")return!0;Ru.kind==="min"?($u===null||Ru.value>$u)&&($u=Ru.value):Ru.kind==="max"&&(lo===null||Ru.value<lo)&&(lo=Ru.value)}return Number.isFinite($u)&&Number.isFinite(lo)}}ZodNumber.create=Au=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:Au?.coerce||!1,...processCreateParams(Au)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(lo){if(this._def.coerce)try{lo.data=BigInt(lo.data)}catch{return this._getInvalidInput(lo)}if(this._getType(lo)!==ZodParsedType.bigint)return this._getInvalidInput(lo);let Ru;const Iu=new ParseStatus;for(const Pu of this._def.checks)Pu.kind==="min"?(Pu.inclusive?lo.data<Pu.value:lo.data<=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_small,type:"bigint",minimum:Pu.value,inclusive:Pu.inclusive,message:Pu.message}),Iu.dirty()):Pu.kind==="max"?(Pu.inclusive?lo.data>Pu.value:lo.data>=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_big,type:"bigint",maximum:Pu.value,inclusive:Pu.inclusive,message:Pu.message}),Iu.dirty()):Pu.kind==="multipleOf"?lo.data%Pu.value!==BigInt(0)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_multiple_of,multipleOf:Pu.value,message:Pu.message}),Iu.dirty()):util.assertNever(Pu);return{status:Iu.value,value:lo.data}}_getInvalidInput(lo){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:$u.parsedType}),INVALID}gte(lo,$u){return this.setLimit("min",lo,!0,errorUtil.toString($u))}gt(lo,$u){return this.setLimit("min",lo,!1,errorUtil.toString($u))}lte(lo,$u){return this.setLimit("max",lo,!0,errorUtil.toString($u))}lt(lo,$u){return this.setLimit("max",lo,!1,errorUtil.toString($u))}setLimit(lo,$u,Ru,Iu){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:lo,value:$u,inclusive:Ru,message:errorUtil.toString(Iu)}]})}_addCheck(lo){return new ZodBigInt({...this._def,checks:[...this._def.checks,lo]})}positive(lo){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(lo)})}negative(lo){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(lo)})}nonpositive(lo){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(lo)})}nonnegative(lo){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(lo)})}multipleOf(lo,$u){return this._addCheck({kind:"multipleOf",value:lo,message:errorUtil.toString($u)})}get minValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}}ZodBigInt.create=Au=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:Au?.coerce??!1,...processCreateParams(Au)});class ZodBoolean extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=!!lo.data),this._getType(lo)!==ZodParsedType.boolean){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodBoolean.create=Au=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:Au?.coerce||!1,...processCreateParams(Au)});class ZodDate extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=new Date(lo.data)),this._getType(lo)!==ZodParsedType.date){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:Pu.parsedType}),INVALID}if(Number.isNaN(lo.data.getTime())){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_date}),INVALID}const Ru=new ParseStatus;let Iu;for(const Pu of this._def.checks)Pu.kind==="min"?lo.data.getTime()<Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_small,message:Pu.message,inclusive:!0,exact:!1,minimum:Pu.value,type:"date"}),Ru.dirty()):Pu.kind==="max"?lo.data.getTime()>Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_big,message:Pu.message,inclusive:!0,exact:!1,maximum:Pu.value,type:"date"}),Ru.dirty()):util.assertNever(Pu);return{status:Ru.value,value:new Date(lo.data.getTime())}}_addCheck(lo){return new ZodDate({...this._def,checks:[...this._def.checks,lo]})}min(lo,$u){return this._addCheck({kind:"min",value:lo.getTime(),message:errorUtil.toString($u)})}max(lo,$u){return this._addCheck({kind:"max",value:lo.getTime(),message:errorUtil.toString($u)})}get minDate(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo!=null?new Date(lo):null}get maxDate(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo!=null?new Date(lo):null}}ZodDate.create=Au=>new ZodDate({checks:[],coerce:Au?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(Au)});class ZodSymbol extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.symbol){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodSymbol.create=Au=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(Au)});class ZodUndefined extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.undefined){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodUndefined.create=Au=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(Au)});class ZodNull extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.null){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodNull.create=Au=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(Au)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(lo){return OK(lo.data)}}ZodAny.create=Au=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(Au)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(lo){return OK(lo.data)}}ZodUnknown.create=Au=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(Au)});class ZodNever extends ZodType{_parse(lo){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$u.parsedType}),INVALID}}ZodNever.create=Au=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(Au)});class ZodVoid extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.undefined){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodVoid.create=Au=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(Au)});class ZodArray extends ZodType{_parse(lo){const{ctx:$u,status:Ru}=this._processInputParams(lo),Iu=this._def;if($u.parsedType!==ZodParsedType.array)return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$u.parsedType}),INVALID;if(Iu.exactLength!==null){const Ou=$u.data.length>Iu.exactLength.value,Du=$u.data.length<Iu.exactLength.value;(Ou||Du)&&(addIssueToContext($u,{code:Ou?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:Du?Iu.exactLength.value:void 0,maximum:Ou?Iu.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Iu.exactLength.message}),Ru.dirty())}if(Iu.minLength!==null&&$u.data.length<Iu.minLength.value&&(addIssueToContext($u,{code:ZodIssueCode.too_small,minimum:Iu.minLength.value,type:"array",inclusive:!0,exact:!1,message:Iu.minLength.message}),Ru.dirty()),Iu.maxLength!==null&&$u.data.length>Iu.maxLength.value&&(addIssueToContext($u,{code:ZodIssueCode.too_big,maximum:Iu.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Iu.maxLength.message}),Ru.dirty()),$u.common.async)return Promise.all([...$u.data].map((Ou,Du)=>Iu.type._parseAsync(new ParseInputLazyPath($u,Ou,$u.path,Du)))).then(Ou=>ParseStatus.mergeArray(Ru,Ou));const Pu=[...$u.data].map((Ou,Du)=>Iu.type._parseSync(new ParseInputLazyPath($u,Ou,$u.path,Du)));return ParseStatus.mergeArray(Ru,Pu)}get element(){return this._def.type}min(lo,$u){return new ZodArray({...this._def,minLength:{value:lo,message:errorUtil.toString($u)}})}max(lo,$u){return new ZodArray({...this._def,maxLength:{value:lo,message:errorUtil.toString($u)}})}length(lo,$u){return new ZodArray({...this._def,exactLength:{value:lo,message:errorUtil.toString($u)}})}nonempty(lo){return this.min(1,lo)}}ZodArray.create=(Au,lo)=>new ZodArray({type:Au,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(lo)});function deepPartialify(Au){if(Au instanceof ZodObject){const lo={};for(const $u in Au.shape){const Ru=Au.shape[$u];lo[$u]=ZodOptional.create(deepPartialify(Ru))}return new ZodObject({...Au._def,shape:()=>lo})}else return Au instanceof ZodArray?new ZodArray({...Au._def,type:deepPartialify(Au.element)}):Au instanceof ZodOptional?ZodOptional.create(deepPartialify(Au.unwrap())):Au instanceof ZodNullable?ZodNullable.create(deepPartialify(Au.unwrap())):Au instanceof ZodTuple?ZodTuple.create(Au.items.map(lo=>deepPartialify(lo))):Au}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const lo=this._def.shape(),$u=util.objectKeys(lo);return this._cached={shape:lo,keys:$u},this._cached}_parse(lo){if(this._getType(lo)!==ZodParsedType.object){const Lu=this._getOrReturnCtx(lo);return addIssueToContext(Lu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Lu.parsedType}),INVALID}const{status:Ru,ctx:Iu}=this._processInputParams(lo),{shape:Pu,keys:Ou}=this._getCached(),Du=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const Lu in Iu.data)Ou.includes(Lu)||Du.push(Lu);const Mu=[];for(const Lu of Ou){const Bu=Pu[Lu],ju=Iu.data[Lu];Mu.push({key:{status:"valid",value:Lu},value:Bu._parse(new ParseInputLazyPath(Iu,ju,Iu.path,Lu)),alwaysSet:Lu in Iu.data})}if(this._def.catchall instanceof ZodNever){const Lu=this._def.unknownKeys;if(Lu==="passthrough")for(const Bu of Du)Mu.push({key:{status:"valid",value:Bu},value:{status:"valid",value:Iu.data[Bu]}});else if(Lu==="strict")Du.length>0&&(addIssueToContext(Iu,{code:ZodIssueCode.unrecognized_keys,keys:Du}),Ru.dirty());else if(Lu!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Lu=this._def.catchall;for(const Bu of Du){const ju=Iu.data[Bu];Mu.push({key:{status:"valid",value:Bu},value:Lu._parse(new ParseInputLazyPath(Iu,ju,Iu.path,Bu)),alwaysSet:Bu in Iu.data})}}return Iu.common.async?Promise.resolve().then(async()=>{const Lu=[];for(const Bu of Mu){const ju=await Bu.key,Fu=await Bu.value;Lu.push({key:ju,value:Fu,alwaysSet:Bu.alwaysSet})}return Lu}).then(Lu=>ParseStatus.mergeObjectSync(Ru,Lu)):ParseStatus.mergeObjectSync(Ru,Mu)}get shape(){return this._def.shape()}strict(lo){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...lo!==void 0?{errorMap:($u,Ru)=>{const Iu=this._def.errorMap?.($u,Ru).message??Ru.defaultError;return $u.code==="unrecognized_keys"?{message:errorUtil.errToObj(lo).message??Iu}:{message:Iu}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(lo){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...lo})})}merge(lo){return new ZodObject({unknownKeys:lo._def.unknownKeys,catchall:lo._def.catchall,shape:()=>({...this._def.shape(),...lo._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(lo,$u){return this.augment({[lo]:$u})}catchall(lo){return new ZodObject({...this._def,catchall:lo})}pick(lo){const $u={};for(const Ru of util.objectKeys(lo))lo[Ru]&&this.shape[Ru]&&($u[Ru]=this.shape[Ru]);return new ZodObject({...this._def,shape:()=>$u})}omit(lo){const $u={};for(const Ru of util.objectKeys(this.shape))lo[Ru]||($u[Ru]=this.shape[Ru]);return new ZodObject({...this._def,shape:()=>$u})}deepPartial(){return deepPartialify(this)}partial(lo){const $u={};for(const Ru of util.objectKeys(this.shape)){const Iu=this.shape[Ru];lo&&!lo[Ru]?$u[Ru]=Iu:$u[Ru]=Iu.optional()}return new ZodObject({...this._def,shape:()=>$u})}required(lo){const $u={};for(const Ru of util.objectKeys(this.shape))if(lo&&!lo[Ru])$u[Ru]=this.shape[Ru];else{let Pu=this.shape[Ru];for(;Pu instanceof ZodOptional;)Pu=Pu._def.innerType;$u[Ru]=Pu}return new ZodObject({...this._def,shape:()=>$u})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(Au,lo)=>new ZodObject({shape:()=>Au,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});ZodObject.strictCreate=(Au,lo)=>new ZodObject({shape:()=>Au,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});ZodObject.lazycreate=(Au,lo)=>new ZodObject({shape:Au,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});class ZodUnion extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru=this._def.options;function Iu(Pu){for(const Du of Pu)if(Du.result.status==="valid")return Du.result;for(const Du of Pu)if(Du.result.status==="dirty")return $u.common.issues.push(...Du.ctx.common.issues),Du.result;const Ou=Pu.map(Du=>new ZodError(Du.ctx.common.issues));return addIssueToContext($u,{code:ZodIssueCode.invalid_union,unionErrors:Ou}),INVALID}if($u.common.async)return Promise.all(Ru.map(async Pu=>{const Ou={...$u,common:{...$u.common,issues:[]},parent:null};return{result:await Pu._parseAsync({data:$u.data,path:$u.path,parent:Ou}),ctx:Ou}})).then(Iu);{let Pu;const Ou=[];for(const Mu of Ru){const Lu={...$u,common:{...$u.common,issues:[]},parent:null},Bu=Mu._parseSync({data:$u.data,path:$u.path,parent:Lu});if(Bu.status==="valid")return Bu;Bu.status==="dirty"&&!Pu&&(Pu={result:Bu,ctx:Lu}),Lu.common.issues.length&&Ou.push(Lu.common.issues)}if(Pu)return $u.common.issues.push(...Pu.ctx.common.issues),Pu.result;const Du=Ou.map(Mu=>new ZodError(Mu));return addIssueToContext($u,{code:ZodIssueCode.invalid_union,unionErrors:Du}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(Au,lo)=>new ZodUnion({options:Au,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(lo)});function mergeValues(Au,lo){const $u=getParsedType(Au),Ru=getParsedType(lo);if(Au===lo)return{valid:!0,data:Au};if($u===ZodParsedType.object&&Ru===ZodParsedType.object){const Iu=util.objectKeys(lo),Pu=util.objectKeys(Au).filter(Du=>Iu.indexOf(Du)!==-1),Ou={...Au,...lo};for(const Du of Pu){const Mu=mergeValues(Au[Du],lo[Du]);if(!Mu.valid)return{valid:!1};Ou[Du]=Mu.data}return{valid:!0,data:Ou}}else if($u===ZodParsedType.array&&Ru===ZodParsedType.array){if(Au.length!==lo.length)return{valid:!1};const Iu=[];for(let Pu=0;Pu<Au.length;Pu++){const Ou=Au[Pu],Du=lo[Pu],Mu=mergeValues(Ou,Du);if(!Mu.valid)return{valid:!1};Iu.push(Mu.data)}return{valid:!0,data:Iu}}else return $u===ZodParsedType.date&&Ru===ZodParsedType.date&&+Au==+lo?{valid:!0,data:Au}:{valid:!1}}class ZodIntersection extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo),Iu=(Pu,Ou)=>{if(isAborted(Pu)||isAborted(Ou))return INVALID;const Du=mergeValues(Pu.value,Ou.value);return Du.valid?((isDirty(Pu)||isDirty(Ou))&&$u.dirty(),{status:$u.value,value:Du.data}):(addIssueToContext(Ru,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return Ru.common.async?Promise.all([this._def.left._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}),this._def.right._parseAsync({data:Ru.data,path:Ru.path,parent:Ru})]).then(([Pu,Ou])=>Iu(Pu,Ou)):Iu(this._def.left._parseSync({data:Ru.data,path:Ru.path,parent:Ru}),this._def.right._parseSync({data:Ru.data,path:Ru.path,parent:Ru}))}}ZodIntersection.create=(Au,lo,$u)=>new ZodIntersection({left:Au,right:lo,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($u)});class ZodTuple extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.array)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:Ru.parsedType}),INVALID;if(Ru.data.length<this._def.items.length)return addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&Ru.data.length>this._def.items.length&&(addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$u.dirty());const Pu=[...Ru.data].map((Ou,Du)=>{const Mu=this._def.items[Du]||this._def.rest;return Mu?Mu._parse(new ParseInputLazyPath(Ru,Ou,Ru.path,Du)):null}).filter(Ou=>!!Ou);return Ru.common.async?Promise.all(Pu).then(Ou=>ParseStatus.mergeArray($u,Ou)):ParseStatus.mergeArray($u,Pu)}get items(){return this._def.items}rest(lo){return new ZodTuple({...this._def,rest:lo})}}ZodTuple.create=(Au,lo)=>{if(!Array.isArray(Au))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:Au,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(lo)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.object)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ru.parsedType}),INVALID;const Iu=[],Pu=this._def.keyType,Ou=this._def.valueType;for(const Du in Ru.data)Iu.push({key:Pu._parse(new ParseInputLazyPath(Ru,Du,Ru.path,Du)),value:Ou._parse(new ParseInputLazyPath(Ru,Ru.data[Du],Ru.path,Du)),alwaysSet:Du in Ru.data});return Ru.common.async?ParseStatus.mergeObjectAsync($u,Iu):ParseStatus.mergeObjectSync($u,Iu)}get element(){return this._def.valueType}static create(lo,$u,Ru){return $u instanceof ZodType?new ZodRecord({keyType:lo,valueType:$u,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(Ru)}):new ZodRecord({keyType:ZodString.create(),valueType:lo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($u)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.map)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:Ru.parsedType}),INVALID;const Iu=this._def.keyType,Pu=this._def.valueType,Ou=[...Ru.data.entries()].map(([Du,Mu],Lu)=>({key:Iu._parse(new ParseInputLazyPath(Ru,Du,Ru.path,[Lu,"key"])),value:Pu._parse(new ParseInputLazyPath(Ru,Mu,Ru.path,[Lu,"value"]))}));if(Ru.common.async){const Du=new Map;return Promise.resolve().then(async()=>{for(const Mu of Ou){const Lu=await Mu.key,Bu=await Mu.value;if(Lu.status==="aborted"||Bu.status==="aborted")return INVALID;(Lu.status==="dirty"||Bu.status==="dirty")&&$u.dirty(),Du.set(Lu.value,Bu.value)}return{status:$u.value,value:Du}})}else{const Du=new Map;for(const Mu of Ou){const Lu=Mu.key,Bu=Mu.value;if(Lu.status==="aborted"||Bu.status==="aborted")return INVALID;(Lu.status==="dirty"||Bu.status==="dirty")&&$u.dirty(),Du.set(Lu.value,Bu.value)}return{status:$u.value,value:Du}}}}ZodMap.create=(Au,lo,$u)=>new ZodMap({valueType:lo,keyType:Au,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($u)});class ZodSet extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.set)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:Ru.parsedType}),INVALID;const Iu=this._def;Iu.minSize!==null&&Ru.data.size<Iu.minSize.value&&(addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:Iu.minSize.value,type:"set",inclusive:!0,exact:!1,message:Iu.minSize.message}),$u.dirty()),Iu.maxSize!==null&&Ru.data.size>Iu.maxSize.value&&(addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:Iu.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Iu.maxSize.message}),$u.dirty());const Pu=this._def.valueType;function Ou(Mu){const Lu=new Set;for(const Bu of Mu){if(Bu.status==="aborted")return INVALID;Bu.status==="dirty"&&$u.dirty(),Lu.add(Bu.value)}return{status:$u.value,value:Lu}}const Du=[...Ru.data.values()].map((Mu,Lu)=>Pu._parse(new ParseInputLazyPath(Ru,Mu,Ru.path,Lu)));return Ru.common.async?Promise.all(Du).then(Mu=>Ou(Mu)):Ou(Du)}min(lo,$u){return new ZodSet({...this._def,minSize:{value:lo,message:errorUtil.toString($u)}})}max(lo,$u){return new ZodSet({...this._def,maxSize:{value:lo,message:errorUtil.toString($u)}})}size(lo,$u){return this.min(lo,$u).max(lo,$u)}nonempty(lo){return this.min(1,lo)}}ZodSet.create=(Au,lo)=>new ZodSet({valueType:Au,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(lo)});class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(lo){const{ctx:$u}=this._processInputParams(lo);return this._def.getter()._parse({data:$u.data,path:$u.path,parent:$u})}}ZodLazy.create=(Au,lo)=>new ZodLazy({getter:Au,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(lo)});class ZodLiteral extends ZodType{_parse(lo){if(lo.data!==this._def.value){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{received:$u.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:lo.data}}get value(){return this._def.value}}ZodLiteral.create=(Au,lo)=>new ZodLiteral({value:Au,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(lo)});function createZodEnum(Au,lo){return new ZodEnum({values:Au,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(lo)})}class ZodEnum extends ZodType{_parse(lo){if(typeof lo.data!="string"){const $u=this._getOrReturnCtx(lo),Ru=this._def.values;return addIssueToContext($u,{expected:util.joinValues(Ru),received:$u.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(lo.data)){const $u=this._getOrReturnCtx(lo),Ru=this._def.values;return addIssueToContext($u,{received:$u.data,code:ZodIssueCode.invalid_enum_value,options:Ru}),INVALID}return OK(lo.data)}get options(){return this._def.values}get enum(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}get Values(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}get Enum(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}extract(lo,$u=this._def){return ZodEnum.create(lo,{...this._def,...$u})}exclude(lo,$u=this._def){return ZodEnum.create(this.options.filter(Ru=>!lo.includes(Ru)),{...this._def,...$u})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(lo){const $u=util.getValidEnumValues(this._def.values),Ru=this._getOrReturnCtx(lo);if(Ru.parsedType!==ZodParsedType.string&&Ru.parsedType!==ZodParsedType.number){const Iu=util.objectValues($u);return addIssueToContext(Ru,{expected:util.joinValues(Iu),received:Ru.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util.getValidEnumValues(this._def.values))),!this._cache.has(lo.data)){const Iu=util.objectValues($u);return addIssueToContext(Ru,{received:Ru.data,code:ZodIssueCode.invalid_enum_value,options:Iu}),INVALID}return OK(lo.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(Au,lo)=>new ZodNativeEnum({values:Au,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(lo)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(lo){const{ctx:$u}=this._processInputParams(lo);if($u.parsedType!==ZodParsedType.promise&&$u.common.async===!1)return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$u.parsedType}),INVALID;const Ru=$u.parsedType===ZodParsedType.promise?$u.data:Promise.resolve($u.data);return OK(Ru.then(Iu=>this._def.type.parseAsync(Iu,{path:$u.path,errorMap:$u.common.contextualErrorMap})))}}ZodPromise.create=(Au,lo)=>new ZodPromise({type:Au,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(lo)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo),Iu=this._def.effect||null,Pu={addIssue:Ou=>{addIssueToContext(Ru,Ou),Ou.fatal?$u.abort():$u.dirty()},get path(){return Ru.path}};if(Pu.addIssue=Pu.addIssue.bind(Pu),Iu.type==="preprocess"){const Ou=Iu.transform(Ru.data,Pu);if(Ru.common.async)return Promise.resolve(Ou).then(async Du=>{if($u.value==="aborted")return INVALID;const Mu=await this._def.schema._parseAsync({data:Du,path:Ru.path,parent:Ru});return Mu.status==="aborted"?INVALID:Mu.status==="dirty"||$u.value==="dirty"?DIRTY(Mu.value):Mu});{if($u.value==="aborted")return INVALID;const Du=this._def.schema._parseSync({data:Ou,path:Ru.path,parent:Ru});return Du.status==="aborted"?INVALID:Du.status==="dirty"||$u.value==="dirty"?DIRTY(Du.value):Du}}if(Iu.type==="refinement"){const Ou=Du=>{const Mu=Iu.refinement(Du,Pu);if(Ru.common.async)return Promise.resolve(Mu);if(Mu instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Du};if(Ru.common.async===!1){const Du=this._def.schema._parseSync({data:Ru.data,path:Ru.path,parent:Ru});return Du.status==="aborted"?INVALID:(Du.status==="dirty"&&$u.dirty(),Ou(Du.value),{status:$u.value,value:Du.value})}else return this._def.schema._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}).then(Du=>Du.status==="aborted"?INVALID:(Du.status==="dirty"&&$u.dirty(),Ou(Du.value).then(()=>({status:$u.value,value:Du.value}))))}if(Iu.type==="transform")if(Ru.common.async===!1){const Ou=this._def.schema._parseSync({data:Ru.data,path:Ru.path,parent:Ru});if(!isValid(Ou))return INVALID;const Du=Iu.transform(Ou.value,Pu);if(Du instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$u.value,value:Du}}else return this._def.schema._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}).then(Ou=>isValid(Ou)?Promise.resolve(Iu.transform(Ou.value,Pu)).then(Du=>({status:$u.value,value:Du})):INVALID);util.assertNever(Iu)}}ZodEffects.create=(Au,lo,$u)=>new ZodEffects({schema:Au,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:lo,...processCreateParams($u)});ZodEffects.createWithPreprocess=(Au,lo,$u)=>new ZodEffects({schema:lo,effect:{type:"preprocess",transform:Au},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($u)});class ZodOptional extends ZodType{_parse(lo){return this._getType(lo)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(lo)}unwrap(){return this._def.innerType}}ZodOptional.create=(Au,lo)=>new ZodOptional({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(lo)});class ZodNullable extends ZodType{_parse(lo){return this._getType(lo)===ZodParsedType.null?OK(null):this._def.innerType._parse(lo)}unwrap(){return this._def.innerType}}ZodNullable.create=(Au,lo)=>new ZodNullable({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(lo)});class ZodDefault extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo);let Ru=$u.data;return $u.parsedType===ZodParsedType.undefined&&(Ru=this._def.defaultValue()),this._def.innerType._parse({data:Ru,path:$u.path,parent:$u})}removeDefault(){return this._def.innerType}}ZodDefault.create=(Au,lo)=>new ZodDefault({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof lo.default=="function"?lo.default:()=>lo.default,...processCreateParams(lo)});class ZodCatch extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru={...$u,common:{...$u.common,issues:[]}},Iu=this._def.innerType._parse({data:Ru.data,path:Ru.path,parent:{...Ru}});return isAsync(Iu)?Iu.then(Pu=>({status:"valid",value:Pu.status==="valid"?Pu.value:this._def.catchValue({get error(){return new ZodError(Ru.common.issues)},input:Ru.data})})):{status:"valid",value:Iu.status==="valid"?Iu.value:this._def.catchValue({get error(){return new ZodError(Ru.common.issues)},input:Ru.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(Au,lo)=>new ZodCatch({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof lo.catch=="function"?lo.catch:()=>lo.catch,...processCreateParams(lo)});class ZodNaN extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.nan){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:Ru.parsedType}),INVALID}return{status:"valid",value:lo.data}}}ZodNaN.create=Au=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(Au)});class ZodBranded extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru=$u.data;return this._def.type._parse({data:Ru,path:$u.path,parent:$u})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.common.async)return(async()=>{const Pu=await this._def.in._parseAsync({data:Ru.data,path:Ru.path,parent:Ru});return Pu.status==="aborted"?INVALID:Pu.status==="dirty"?($u.dirty(),DIRTY(Pu.value)):this._def.out._parseAsync({data:Pu.value,path:Ru.path,parent:Ru})})();{const Iu=this._def.in._parseSync({data:Ru.data,path:Ru.path,parent:Ru});return Iu.status==="aborted"?INVALID:Iu.status==="dirty"?($u.dirty(),{status:"dirty",value:Iu.value}):this._def.out._parseSync({data:Iu.value,path:Ru.path,parent:Ru})}}static create(lo,$u){return new ZodPipeline({in:lo,out:$u,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(lo){const $u=this._def.innerType._parse(lo),Ru=Iu=>(isValid(Iu)&&(Iu.value=Object.freeze(Iu.value)),Iu);return isAsync($u)?$u.then(Iu=>Ru(Iu)):Ru($u)}unwrap(){return this._def.innerType}}ZodReadonly.create=(Au,lo)=>new ZodReadonly({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(lo)});var ZodFirstPartyTypeKind;(function(Au){Au.ZodString="ZodString",Au.ZodNumber="ZodNumber",Au.ZodNaN="ZodNaN",Au.ZodBigInt="ZodBigInt",Au.ZodBoolean="ZodBoolean",Au.ZodDate="ZodDate",Au.ZodSymbol="ZodSymbol",Au.ZodUndefined="ZodUndefined",Au.ZodNull="ZodNull",Au.ZodAny="ZodAny",Au.ZodUnknown="ZodUnknown",Au.ZodNever="ZodNever",Au.ZodVoid="ZodVoid",Au.ZodArray="ZodArray",Au.ZodObject="ZodObject",Au.ZodUnion="ZodUnion",Au.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Au.ZodIntersection="ZodIntersection",Au.ZodTuple="ZodTuple",Au.ZodRecord="ZodRecord",Au.ZodMap="ZodMap",Au.ZodSet="ZodSet",Au.ZodFunction="ZodFunction",Au.ZodLazy="ZodLazy",Au.ZodLiteral="ZodLiteral",Au.ZodEnum="ZodEnum",Au.ZodEffects="ZodEffects",Au.ZodNativeEnum="ZodNativeEnum",Au.ZodOptional="ZodOptional",Au.ZodNullable="ZodNullable",Au.ZodDefault="ZodDefault",Au.ZodCatch="ZodCatch",Au.ZodPromise="ZodPromise",Au.ZodBranded="ZodBranded",Au.ZodPipeline="ZodPipeline",Au.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const stringType=ZodString.create,numberType=ZodNumber.create;ZodBigInt.create;const booleanType=ZodBoolean.create;ZodDate.create;const anyType=ZodAny.create,unknownType=ZodUnknown.create;ZodNever.create;const arrayType=ZodArray.create,objectType=ZodObject.create,unionType=ZodUnion.create,intersectionType=ZodIntersection.create;ZodTuple.create;const recordType=ZodRecord.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create;ZodPromise.create;ZodOptional.create;ZodNullable.create;const coerce={string:(Au=>ZodString.create({...Au,coerce:!0})),number:(Au=>ZodNumber.create({...Au,coerce:!0})),boolean:(Au=>ZodBoolean.create({...Au,coerce:!0})),bigint:(Au=>ZodBigInt.create({...Au,coerce:!0})),date:(Au=>ZodDate.create({...Au,coerce:!0}))};class A2uiError extends Error{constructor(lo,$u="UNKNOWN_ERROR"){super(lo),this.name=this.constructor.name,this.code=$u,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class A2uiValidationError extends A2uiError{constructor(lo,$u,Ru="VALIDATION_ERROR"){super(lo,Ru),this.details=$u}}class A2uiDataError extends A2uiError{constructor(lo,$u){super(lo,"DATA_ERROR"),this.path=$u}}class A2uiExpressionError extends A2uiError{constructor(lo,$u,Ru){super(lo,"EXPRESSION_ERROR"),this.expression=$u,this.details=Ru}}class A2uiStateError extends A2uiError{constructor(lo){super(lo,"STATE_ERROR")}}class A2uiCatalogError extends A2uiError{constructor(lo,$u="CATALOG_ERROR"){super(lo,$u)}}class A2uiIntegrityError extends A2uiValidationError{constructor(lo,$u,Ru="INTEGRITY_ERROR"){super(lo,$u,Ru),this.name="A2uiIntegrityError"}}class A2uiRecursionError extends A2uiValidationError{constructor(lo,$u,Ru="RECURSION_ERROR"){super(lo,$u,Ru),this.name="A2uiRecursionError"}}var RpcErrorCode;(function(Au){Au.INVALID_FUNCTION_CALL="INVALID_FUNCTION_CALL",Au.EXECUTION_ERROR="EXECUTION_ERROR",Au.UNKNOWN_FUNCTION="UNKNOWN_FUNCTION",Au.UNKNOWN_ERROR="UNKNOWN_ERROR",Au.TIMEOUT="TIMEOUT",Au.CANCELLED="CANCELLED",Au.DISPOSED="DISPOSED",Au.DUPLICATE="DUPLICATE",Au.NO_LISTENER="NO_LISTENER"})(RpcErrorCode||(RpcErrorCode={}));class A2uiRpcError extends A2uiError{constructor(lo,$u=RpcErrorCode.UNKNOWN_ERROR,Ru,Iu){const Pu=$u||RpcErrorCode.UNKNOWN_ERROR;super(`[${Pu}] ${lo}`,Pu),this.functionCallId=Ru,this.details=Iu,this.name="A2uiRpcError"}}function markChildRef(Au,lo){return Au._def.a2uiChildRef=lo,Au}function childRefKindOf(Au){return Au?._def?.a2uiChildRef}const MAX_FUNCTION_CALL_ARGS=1e3;objectType({component:stringType().describe("The type name of the component."),id:lazyType(()=>ComponentIdSchema$2).optional(),weight:numberType().optional()}).passthrough().describe("A generic A2UI component definition.");const ComponentIdSchema$2=markChildRef(stringType().describe("REF:common_types.json#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),DataBindingSchema$2=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).describe("REF:common_types.json#/$defs/DataBinding"),FunctionCallSchema$2=objectType({call:stringType().describe("The name of the function to call."),args:recordType(stringType(),unknownType()).describe("Arguments passed to the function.").optional(),returnType:enumType(["string","number","boolean","array","object","any","void"]).describe("The expected return type of the function call.").optional(),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:common_types.json#/$defs/FunctionCall|Invokes a named function, combining common function properties with the catalog function definition."),DynamicStringSchema$2=unionType([stringType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicString|Represents a string"),DynamicBooleanSchema$2=unionType([booleanType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),AccessibilityAttributesSchema$2=objectType({label:DynamicStringSchema$2.optional(),description:DynamicStringSchema$2.optional(),live:enumType(["off","polite","assertive"]).default("off").describe("Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts.").optional(),hidden:DynamicBooleanSchema$2.optional()}).describe("REF:common_types.json#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding."),ExtensionsSchema$1=recordType(stringType(),unknownType()).superRefine((Au,lo)=>{for(const $u in Au)$u.match(/^[\p{XID_Start}_][\p{XID_Continue}]*$/u)||lo.addIssue({path:[$u],code:ZodIssueCode.custom,message:`Invalid extension key "${$u}": Keys MUST be Unicode identifiers (UAX #31).`})}).describe("REF:#/$defs/Extensions|Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.");objectType({id:ComponentIdSchema$2,accessibility:AccessibilityAttributesSchema$2.optional(),catalogId:stringType().describe("The catalog ID for this component, overriding any surface-level default catalogId.").optional(),metadata:objectType({extensions:ExtensionsSchema$1.optional()}).strict().describe("Optional component-level metadata for vendor extensions.").optional()}).describe("REF:common_types.json#/$defs/ComponentCommon");const ChildListSchema$1=markChildRef(unionType([arrayType(ComponentIdSchema$2).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema$2,path:stringType().describe("The path to the list of component property objects in the data model.")}).describe("A template for generating a dynamic list of children.")]).describe("REF:common_types.json#/$defs/ChildList"),"child-list"),DynamicValueSchema$2=unionType([stringType(),numberType(),booleanType(),arrayType(unknownType()),DataBindingSchema$2,FunctionCallSchema$2,recordType(stringType(),unknownType()).refine(Au=>!Au||!("path"in Au)&&!("call"in Au))]).describe("REF:common_types.json#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),DynamicNumberSchema$2=unionType([numberType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number."),DynamicStringListSchema$1=unionType([arrayType(stringType()),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array."),CheckRuleSchema$2=objectType({condition:unionType([DynamicBooleanSchema$2,DataBindingSchema$2,FunctionCallSchema$2]).describe("Path or function call evaluating to a structured validation result object."),message:stringType().describe("Optional fallback error message.").optional()}).describe("REF:common_types.json#/$defs/CheckRule|A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object."),CheckableSchema=objectType({checks:arrayType(CheckRuleSchema$2).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:common_types.json#/$defs/Checkable|Properties for components that support renderer-side checks."),ActionSchema$2=unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the server."),context:recordType(stringType(),unknownType()).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the server.")}).strict().describe("Triggers a server-side event."),objectType({functionCall:FunctionCallSchema$2}).strict().describe("Executes a local client-side function."),objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the agent."),userMessage:DynamicStringSchema$2.optional(),context:recordType(stringType(),unknownType()).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the agent.")}).strict().describe("Triggers an agent-side event."),objectType({functionCall:FunctionCallSchema$2}).strict().describe("Executes a renderer or agent-side function.")]).describe("REF:common_types.json#/$defs/Action|Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function."),CallIdSchema$1=stringType().describe("REF:common_types.json#/$defs/CallId|The unique identifier for a function call.");objectType({call:stringType().describe("The name of the function to call."),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:common_types.json#/$defs/FunctionCommon|Baseline envelope properties common to all function calls. Function-specific argument schemas (\\'args\\') are defined individually by each function in the active catalog.");objectType({call:literalType("@index"),args:objectType({offset:DynamicNumberSchema$2.optional()}).strict().optional()}).strict().describe("REF:common_types.json#/$defs/IndexSystemFunction|Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.");objectType({component:literalType("Surface").optional(),child:literalType("root").optional()}).strict().describe("REF:common_types.json#/$defs/Surface|The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has \\'child\\': \\'root\\'.");objectType({functionCallId:CallIdSchema$1,value:unknownType().describe("The return value of the function.").optional(),error:objectType({code:stringType(),message:stringType()}).strict().describe("An error object indicating failure of the function execution.").optional()}).strict().describe("REF:common_types.json#/$defs/FunctionResponse|The return response matching a callAgentFunction or callRendererFunction invocation.");const SEMVER_REGEX=/^[vV]?(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function normalizeVersionString(Au){if(!Au||typeof Au!="string")return"";const lo=Au.trim().replace(/^[vV]/,""),$u=lo.indexOf("-"),Ru=lo.indexOf("+");let Iu=lo.length;return $u!==-1&&Ru!==-1?Iu=Math.min($u,Ru):$u!==-1?Iu=$u:Ru!==-1&&(Iu=Ru),`${lo.slice(0,Iu).replace(/_/g,".")}${lo.slice(Iu)}`}function parseSemVer(Au){if(!Au||typeof Au!="string")return null;const lo=Au.trim().match(SEMVER_REGEX);return lo?{major:parseInt(lo[1],10),minor:parseInt(lo[2],10),patch:lo[3]!==void 0?parseInt(lo[3],10):0,prerelease:lo[4]?lo[4].split("."):[],build:lo[5]?lo[5].split("."):[]}:null}function toSemVer(Au){if(!Au)return null;if(typeof Au=="object"){const lo=Au;return typeof lo.major!="number"||!Number.isInteger(lo.major)||lo.major<0||typeof lo.minor=="number"&&(!Number.isInteger(lo.minor)||lo.minor<0)||typeof lo.patch=="number"&&(!Number.isInteger(lo.patch)||lo.patch<0)?null:{major:lo.major,minor:typeof lo.minor=="number"?lo.minor:0,patch:typeof lo.patch=="number"?lo.patch:0,prerelease:Array.isArray(lo.prerelease)?lo.prerelease:[],build:Array.isArray(lo.build)?lo.build:[]}}return parseSemVer(normalizeVersionString(Au))}function toCanonicalVersion(Au){if(!Au)return null;const lo=toSemVer(Au);if(!lo)return null;if(lo.patch===0&&lo.prerelease.length===0&&lo.build.length===0)return`${lo.major}.${lo.minor}`;const $u=lo.prerelease.length>0?`-${lo.prerelease.join(".")}`:"",Ru=lo.build.length>0?`+${lo.build.join(".")}`:"";return`${lo.major}.${lo.minor}.${lo.patch}${$u}${Ru}`}function comparePrereleaseId(Au,lo){const $u=/^\d+$/.test(Au),Ru=/^\d+$/.test(lo);return $u&&Ru?Au.length!==lo.length?Au.length-lo.length:Au<lo?-1:Au>lo?1:0:$u?-1:Ru?1:Au<lo?-1:Au>lo?1:0}function comparePrereleaseLists(Au,lo){if(Au.length===0&&lo.length===0)return 0;if(Au.length===0)return 1;if(lo.length===0)return-1;const $u=Math.min(Au.length,lo.length);for(let Ru=0;Ru<$u;Ru++){const Iu=comparePrereleaseId(Au[Ru],lo[Ru]);if(Iu!==0)return Iu}return Au.length-lo.length}function compareSemVer(Au,lo){const $u=toSemVer(Au),Ru=toSemVer(lo);return!$u&&!Ru?0:$u?Ru?$u.major!==Ru.major?$u.major-Ru.major:$u.minor!==Ru.minor?$u.minor-Ru.minor:$u.patch!==Ru.patch?$u.patch-Ru.patch:comparePrereleaseLists($u.prerelease,Ru.prerelease):1:-1}function isAtLeastVersion(Au,lo){if(!Au)return!1;const $u=toSemVer(Au),Ru=toSemVer(lo);return!$u||!Ru?!1:compareSemVer($u,Ru)>=0}const UAX31_IDENTIFIER=/^[\p{XID_Start}_][\p{XID_Continue}]*$/u;function isValidUax31Identifier(Au){if(!Au)return!1;const lo=Au.startsWith("@")?Au.slice(1):Au;return UAX31_IDENTIFIER.test(lo)}function assertUax31Identifier(Au,lo){if(!isValidUax31Identifier(Au))throw new A2uiCatalogError(`Invalid UAX #31 ${lo}`)}const DEFAULT_PROTOCOL_VERSION="0.9",COMMON_TYPE_SCHEMAS={DynamicString:DynamicStringSchema$2,DynamicNumber:DynamicNumberSchema$2,DynamicBoolean:DynamicBooleanSchema$2,DynamicStringList:DynamicStringListSchema$1,DynamicValue:DynamicValueSchema$2,ComponentId:ComponentIdSchema$2,ChildList:ChildListSchema$1,Action:ActionSchema$2,CheckRule:CheckRuleSchema$2,Checkable:CheckableSchema,AccessibilityAttributes:AccessibilityAttributesSchema$2,DataBinding:DataBindingSchema$2,FunctionCall:FunctionCallSchema$2};function resolveJsonPointer(Au,lo){if(!lo.startsWith("#/"))return;const $u=lo.slice(2).split("/").map(Iu=>Iu.replace(/~1/g,"/").replace(/~0/g,"~"));let Ru=Au;for(const Iu of $u)if(Ru&&typeof Ru=="object"&&Iu in Ru)Ru=Ru[Iu];else return;return typeof Ru=="object"&&Ru!==null?Ru:void 0}function resolveProtocolRef(Au){const lo=Au.split(/#\/(?:\$defs|definitions)\//)[1];return lo?COMMON_TYPE_SCHEMAS[lo]:void 0}function convertEnumToZod(Au){return Au.length===0?unknownType():Au.every(lo=>typeof lo=="string")?enumType(Au):Au.length===1?literalType(Au[0]):unionType(Au.map(lo=>literalType(lo)))}function canonicalJsonStringify(Au){return Au===null||typeof Au!="object"?JSON.stringify(Au):Array.isArray(Au)?`[${Au.map(canonicalJsonStringify).join(",")}]`:`{${Object.keys(Au).sort().map(Ru=>`${JSON.stringify(Ru)}:${canonicalJsonStringify(Au[Ru])}`).join(",")}}`}function finalizePropertyZod(Au,lo,$u,Ru,Iu){let Pu=Au;if(lo.not&&typeof lo.not=="object"){const Ou=convertPropertyToZod(lo.not,$u,new Set(Ru),Iu);Pu=Pu.refine(Du=>!Ou.safeParse(Du).success,{message:'Value matched prohibited "not" schema'})}return lo.default!==void 0&&(Pu=Pu.default(lo.default)),typeof lo.description=="string"&&(Pu=Pu.describe(lo.description)),Pu}function convertRefToZod(Au,lo,$u,Ru,Iu){const Pu=resolveProtocolRef(Au);if(Pu){const Ou=Au.split(/#\/(?:\$defs|definitions)\//)[1],Du=typeof lo.description=="string"?`REF:common_types.json#/$defs/${Ou}|${lo.description}`:Pu.description;return Du?Pu.describe(Du):Pu}if($u&&Au.startsWith("#/")){const Ou=resolveJsonPointer($u,Au);if(!Ou)return unknownType().superRefine((Mu,Lu)=>{Lu.addIssue({code:ZodIssueCode.custom,message:`Unresolvable schema reference: '${Au}'`})});if(Ru.has(Au)){let Mu=Iu.get(Au);return lazyType(()=>(Mu||(Mu=Iu.get(Au)??convertPropertyToZod(Ou,$u,new Set([Au]),Iu),Iu.set(Au,Mu)),Mu))}let Du=Iu.get(Au);if(!Du){const Mu=new Set(Ru);Mu.add(Au),Du=convertPropertyToZod(Ou,$u,Mu,Iu),Iu.set(Au,Du)}return typeof lo.description=="string"&&(Du=Du.describe(lo.description)),Du}}function convertUnionToZod(Au,lo,$u,Ru){const Iu=Array.isArray(Au.oneOf),Ou=(Au.oneOf||Au.anyOf).filter(Fu=>typeof Fu=="object"&&Fu!==null);if(Ou.length===0)return;const Du=Ou.find(Fu=>Array.isArray(Fu.enum)),Mu=Ou.some(Fu=>typeof Fu.$ref=="string"&&Fu.$ref.includes("DataBinding")),Lu=Ou.map(Fu=>convertPropertyToZod(Fu,lo,new Set($u),Ru));let Bu;if(Lu.length===1)Bu=Lu[0];else{const Fu=unionType([Lu[0],Lu[1],...Lu.slice(2)]);Bu=Iu?anyType().superRefine((zu,Uu)=>{let Hu=0;for(const Vu of Lu)if(Vu.safeParse(zu).success&&++Hu>1){Uu.addIssue({code:ZodIssueCode.custom,message:"Value matched more than one schema in oneOf"});return}}).pipe(Fu):Fu}Au.default!==void 0&&(Bu=Bu.default(Au.default));const ju=(typeof Au.description=="string"?Au.description:void 0)||(Du&&Mu?"REF:common_types.json#/$defs/DynamicString":void 0);return ju?Bu.describe(ju):Bu}function convertPropertyToZod(Au,lo,$u=new Set,Ru=new Map){if(!Au||typeof Au!="object")return unknownType();if(Au.$ref&&typeof Au.$ref=="string"){const Iu=convertRefToZod(Au.$ref,Au,lo,$u,Ru);if(Iu)return Iu}if(Array.isArray(Au.oneOf)||Array.isArray(Au.anyOf)){const Iu=convertUnionToZod(Au,lo,$u,Ru);if(Iu)return Iu}if(Au.const!==void 0){const Iu=literalType(Au.const);return finalizePropertyZod(Iu,Au,lo,$u,Ru)}if(Array.isArray(Au.enum)&&Au.enum.length>0){const Iu=convertEnumToZod(Au.enum);return finalizePropertyZod(Iu,Au,lo,$u,Ru)}if(Au.type==="array"){const Iu=Au.items&&typeof Au.items=="object"?convertPropertyToZod(Au.items,lo,new Set($u),Ru):unknownType();let Pu=arrayType(Iu);return typeof Au.minItems=="number"&&(Pu=Pu.min(Au.minItems)),typeof Au.maxItems=="number"&&(Pu=Pu.max(Au.maxItems)),Au.uniqueItems===!0&&(Pu=Pu.refine(Ou=>new Set(Ou.map(canonicalJsonStringify)).size===Ou.length,{message:"Array items must be unique"})),finalizePropertyZod(Pu,Au,lo,$u,Ru)}switch(Au.type){case"string":{let Iu=stringType();if(typeof Au.minLength=="number"&&(Iu=Iu.min(Au.minLength)),typeof Au.maxLength=="number"&&(Iu=Iu.max(Au.maxLength)),typeof Au.pattern=="string")try{Iu=Iu.regex(new RegExp(Au.pattern,"u"))}catch{}return finalizePropertyZod(Iu,Au,lo,$u,Ru)}case"integer":case"number":{let Iu=Au.type==="integer"?numberType().int():numberType();return typeof Au.minimum=="number"&&(Iu=Iu.min(Au.minimum)),typeof Au.maximum=="number"&&(Iu=Iu.max(Au.maximum)),typeof Au.exclusiveMinimum=="number"&&(Iu=Iu.gt(Au.exclusiveMinimum)),typeof Au.exclusiveMaximum=="number"&&(Iu=Iu.lt(Au.exclusiveMaximum)),typeof Au.multipleOf=="number"&&(Iu=Iu.multipleOf(Au.multipleOf)),finalizePropertyZod(Iu,Au,lo,$u,Ru)}case"boolean":return finalizePropertyZod(booleanType(),Au,lo,$u,Ru);case"object":{const Iu=Au.properties;let Pu;if(typeof Iu=="object"&&Iu!==null){const Ou=Array.isArray(Au.required)?new Set(Au.required.filter(Lu=>typeof Lu=="string")):new Set,Du=objectType(convertPropertiesToShape(Iu,Ou,!1,lo,$u,Ru));Pu=Au.additionalProperties===!1||Au.unevaluatedProperties===!1?Du.strict():Du.passthrough()}else Pu=recordType(unknownType());return finalizePropertyZod(Pu,Au,lo,$u,Ru)}default:return finalizePropertyZod(unknownType(),Au,lo,$u,Ru)}}function convertPropertiesToShape(Au,lo,$u=!1,Ru,Iu,Pu=new Map){const Ou={};for(const[Du,Mu]of Object.entries(Au)){if($u&&(Du==="component"||Du==="id"))continue;const Lu=convertPropertyToZod(typeof Mu=="object"&&Mu!==null?Mu:{},Ru,Iu?new Set(Iu):new Set,Pu);Ou[Du]=lo.has(Du)?Lu:Lu.optional()}return Ou}function collectComponentSubSchemas(Au,lo,$u=new Set){const Ru=[];if(!Au||typeof Au!="object")return Ru;if(Array.isArray(Au.allOf)){for(const Iu of Au.allOf)if(!(!Iu||typeof Iu!="object"))if(typeof Iu.$ref=="string"){const Pu=Iu.$ref;if(Pu.includes("common_types.json")&&Pu.includes("ComponentCommon"))Ru.push({properties:{accessibility:AccessibilityAttributesSchema$2.optional()}});else if(Pu.startsWith("#/")&&!$u.has(Pu)){$u.add(Pu);const Ou=resolveJsonPointer(lo,Pu);Ou&&Ru.push(...collectComponentSubSchemas(Ou,lo,$u))}}else Ru.push(...collectComponentSubSchemas(Iu,lo,$u))}return Au.properties&&Ru.push(Au),Ru}function convertComponentJsonSchemaToZod(Au,lo,$u=!0,Ru=new Map){const Iu={},Pu=collectComponentSubSchemas(Au,lo),Ou=new Set;for(const Lu of Pu)Array.isArray(Lu.required)&&Lu.required.forEach(Bu=>{typeof Bu=="string"&&Ou.add(Bu)});for(const Lu of Pu){const Bu=convertPropertiesToShape(Lu.properties||{},Ou,$u,lo,void 0,Ru);Object.assign(Iu,Bu)}const Du=objectType(Iu);return Au.unevaluatedProperties===!0||typeof Au.unevaluatedProperties=="object"&&Au.unevaluatedProperties!==null||Au.additionalProperties===!0||typeof Au.additionalProperties=="object"&&Au.additionalProperties!==null?Du.passthrough():Du.strict()}function convertFunctionArgsJsonSchemaToZod(Au,lo,$u=new Map){const Ru=new Set(Array.isArray(Au.required)?Au.required.filter(Du=>typeof Du=="string"):[]),Iu=convertPropertiesToShape(Au.properties||{},Ru,!1,lo,void 0,$u),Pu=objectType(Iu);return Au.unevaluatedProperties===!0||typeof Au.unevaluatedProperties=="object"&&Au.unevaluatedProperties!==null||Au.additionalProperties===!0||typeof Au.additionalProperties=="object"&&Au.additionalProperties!==null?Pu.passthrough():Pu.strict()}function parseFunctionDefinitions(Au,lo,$u,Ru=!1){const Iu=[];if(!Au)return Iu;const Pu=new Map,Ou=(Du,Mu)=>{if(Ru&&(assertUax31Identifier(Du,`function identifier: '${Du}'`),Mu&&typeof Mu=="object"))for(const Lu of Object.keys(Mu))assertUax31Identifier(Lu,`argument identifier: '${Lu}' in function '${Du}'`)};if(Array.isArray(Au)){for(const Du of Au)if(Du&&typeof Du=="object"&&typeof Du.name=="string"){if(Ou(Du.name,Du.parameters),$u&&!$u.has(Du.name))continue;const Mu=Du.parameters&&typeof Du.parameters=="object"?convertFunctionArgsJsonSchemaToZod(Du.parameters,lo,Pu):recordType(unknownType());Iu.push({name:Du.name,description:typeof Du.description=="string"?Du.description:void 0,returnType:typeof Du.returnType=="string"?Du.returnType:"any",allowedCallers:Du.allowedCallers,requiresUserActivation:Du.requiresUserActivation,schema:Mu})}return Iu}if(typeof Au=="object"&&Au!==null)for(const[Du,Mu]of Object.entries(Au)){const Lu=Mu&&typeof Mu=="object"?Mu:{};if(Ou(Du,Lu.properties&&typeof Lu.properties=="object"?Lu.properties:Lu.parameters),$u&&!$u.has(Du)||!Mu||typeof Mu!="object")continue;const Bu=Mu,ju=Bu.properties;let Fu=ju?.args??Bu.args??Bu.parameters;!Fu&&ju&&!("call"in ju)&&!("function"in ju)?Fu=Bu:Fu&&typeof Fu=="object"&&!("properties"in Fu)&&!("type"in Fu)&&(Fu={type:"object",properties:Fu,required:Bu.required,additionalProperties:Bu.additionalProperties});const zu=Fu&&typeof Fu=="object"?convertFunctionArgsJsonSchemaToZod(Fu,lo,Pu):recordType(unknownType()),Uu=(typeof Bu.returnType=="string"?Bu.returnType:void 0)??(typeof ju?.returnType?.const=="string"?(ju?.returnType).const:"any"),Hu=Bu.allowedCallers??ju?.allowedCallers?.const,Vu=Bu.requiresUserActivation??ju?.requiresUserActivation?.const;Iu.push({name:Du,description:typeof Bu.description=="string"?Bu.description:void 0,returnType:Uu,allowedCallers:Hu,requiresUserActivation:Vu,schema:zu})}return Iu}function extractPermittedNames(Au,lo){if(!Array.isArray(Au))return;const $u=new Set;for(const Ru of Au)if(typeof Ru?.$ref=="string"&&Ru.$ref.startsWith(lo)){const Pu=Ru.$ref.slice(lo.length).replace(/~([01])/g,(Ou,Du)=>Du==="1"?"/":"~");$u.add(Pu)}return $u}function parseCatalogComponents(Au,lo,$u,Ru){const Iu=[],Pu=new Map;for(const[Ou,Du]of Object.entries(Au)){const Mu=Du||{};if($u){assertUax31Identifier(Ou,`component identifier: '${Ou}'`);const Bu=Mu.properties;if(Bu&&typeof Bu=="object")for(const ju of Object.keys(Bu))assertUax31Identifier(ju,`property identifier: '${ju}' in component '${Ou}'`)}if(Ru&&!Ru.has(Ou))continue;const Lu=convertComponentJsonSchemaToZod(Mu,lo,!0,Pu);Iu.push({name:Ou,schema:Lu,allowedParents:Array.isArray(Mu.allowedParents)?Mu.allowedParents.filter(Bu=>typeof Bu=="string"):void 0,allowedChildren:Array.isArray(Mu.allowedChildren)?Mu.allowedChildren.filter(Bu=>typeof Bu=="string"):void 0})}return Iu}function parseThemeSchema(Au,lo){const $u=Au.theme??Au.themeSchema??Au.styles??lo?.theme;if($u&&typeof $u=="object")return convertComponentJsonSchemaToZod($u,Au,!1)}function loadCatalogFromSchema(Au,lo){const $u=Au.catalogId??Au.$id??Au.id;if(!$u||typeof $u!="string")throw new Error("Catalog ID must be specified via catalog metadata ('catalogId' or '$id').");const Ru=Au.$defs,Iu=Ru?.anyComponent,Pu=extractPermittedNames(Iu?.oneOf,"#/components/"),Ou=lo??Au.protocolVersion??DEFAULT_PROTOCOL_VERSION,Du=isAtLeastVersion(Ou,"1.0"),Mu=Au.components??{},Lu=parseCatalogComponents(Mu,Au,Du,Pu),Bu=Ru?.anyFunction,ju=extractPermittedNames(Bu?.oneOf,"#/functions/"),Fu=parseFunctionDefinitions(Au.functions,Au,ju,Du),zu=parseThemeSchema(Au,Ru),Uu=typeof Au.instructions=="string"?Au.instructions:void 0;return new Catalog($u,Ou,Lu,Fu,zu,Uu)}const V08_STANDARD_DEFS={ComponentId:{description:"The unique identifier for a component, used for both definitions and references within the same surface.",type:"string"},TextItem:{additionalProperties:!1,description:"The value of the text field. This can be a literal string or a reference to a value in the data model ('path', e.g. '/user/name').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},UrlItem:{additionalProperties:!1,description:"The URL of the audio to be played. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/song/url').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},AltTextItem:{additionalProperties:!1,description:"The alt text for the image. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/thumbnail/altText').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},NameItem:{additionalProperties:!1,description:"The name of the icon to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/form/submit').",properties:{literalString:{enum:["accountCircle","add","arrowBack","arrowForward","attachFile","calendarToday","call","camera","check","close","delete","download","edit","event","error","favorite","favoriteOff","folder","help","home","info","locationOn","lock","lockOpen","mail","menu","moreVert","moreHoriz","notificationsOff","notifications","payment","person","phone","photo","print","refresh","search","send","settings","share","shoppingCart","star","starHalf","starOff","upload","visibility","visibilityOff","warning"],type:"string"},path:{type:"string"}},type:"object"},DescriptionItem:{additionalProperties:!1,description:"A description of the audio, such as a title or summary. This can be a literal string or a reference to a value in the data model ('path', e.g. '/song/title').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},ChildrenItem:{additionalProperties:!1,description:"Defines the children. Use 'explicitList' for a fixed set of children, or 'template' to generate children from a data list.",properties:{explicitList:{items:{type:"string"},type:"array"},template:{$ref:"#/$defs/TemplateItem",description:"A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children."}},type:"object"},TemplateItem:{additionalProperties:!1,description:"A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.",properties:{componentId:{type:"string"},dataBinding:{type:"string"}},required:["componentId","dataBinding"],type:"object"},TabItemItem:{additionalProperties:!1,properties:{child:{type:"string"},title:{$ref:"#/$defs/TitleItem"}},required:["title","child"],type:"object"},TitleItem:{additionalProperties:!1,description:"The tab title. Defines the value as either a literal value or a path to data model value (e.g. '/options/title').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},ActionItem:{additionalProperties:!1,description:"The client-side action to be dispatched when the button is clicked. It includes the action's name and an optional context payload.",properties:{context:{items:{$ref:"#/$defs/ContextItem"},type:"array"},name:{type:"string"}},required:["name"],type:"object"},ContextItem:{additionalProperties:!1,properties:{key:{type:"string"},value:{$ref:"#/$defs/ValueItem",description:"Defines the value to be included in the context as either a literal value or a path to a data model value (e.g. '/user/name')."}},required:["key","value"],type:"object"},ValueItem:{additionalProperties:!1,description:"The current value of the slider. This can be a literal number ('literalNumber') or a reference to a value in the data model ('path', e.g. '/restaurant/cost').",properties:{literalNumber:{type:"number"},path:{type:"string"}},type:"object"},LabelItem:{additionalProperties:!1,description:"The label for the slider. This can be a literal string or a reference to a value in the data model ('path').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},OptionItem:{additionalProperties:!1,properties:{label:{$ref:"#/$defs/LabelItem",description:"The text to display for this option. This can be a literal string or a reference to a value in the data model (e.g. '/option/label')."},value:{description:"The value to be associated with this option when selected.",type:"string"}},required:["label","value"],type:"object"},SelectionItem:{additionalProperties:!1,description:"The currently selected values for the component. This can be a literal array of strings or a path to an array in the data model('path', e.g. '/hotel/options').",properties:{literalArray:{items:{type:"string"},type:"array"},path:{type:"string"}},type:"object"}},V09_CHILD_REF_OPTIONS={childRefNames:new Set(["ComponentId","Child","ChildComponentId"]),childListRefNames:new Set(["ChildList","TemplateChildList","ChildrenItem","TemplateItem"])},V09_STANDARD_DEFS={ComponentId:{type:"string",description:"The unique identifier for a component, used for both definitions and references within the same surface."},AccessibilityAttributes:{type:"object",description:"Attributes to enhance accessibility when using assistive technologies like screen readers.",properties:{label:{$ref:"#/$defs/DynamicString",description:"A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."},description:{$ref:"#/$defs/DynamicString",description:"Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."}}},ComponentCommon:{type:"object",properties:{id:{$ref:"#/$defs/ComponentId"},accessibility:{$ref:"#/$defs/AccessibilityAttributes"}},required:["id"]},ChildList:{oneOf:[{type:"array",items:{$ref:"#/$defs/ComponentId"},description:"A static list of child component IDs."},{type:"object",description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:"#/$defs/ComponentId"},path:{type:"string",description:"The path to the list of component property objects in the data model."}},required:["componentId","path"],additionalProperties:!1}]},DataBinding:{type:"object",properties:{path:{type:"string",description:"A JSON Pointer path to a value in the data model."}},required:["path"],additionalProperties:!1},DynamicValue:{description:"A value that can be a literal, a path, or a function call returning any type.",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicString:{description:"Represents a string",oneOf:[{type:"string"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"string"}}}]}]},DynamicNumber:{description:"Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",oneOf:[{type:"number"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"number"}}}]}]},DynamicBoolean:{description:"A boolean value that can be a literal, a path, or a function call returning a boolean.",oneOf:[{type:"boolean"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"boolean"}}}]}]},DynamicStringList:{description:"Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",oneOf:[{type:"array",items:{type:"string"}},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"array"}}}]}]},FunctionCall:{type:"object",description:"Invokes a named function on the client.",properties:{call:{type:"string",description:"The name of the function to call."},args:{type:"object",description:"Arguments passed to the function.",additionalProperties:{anyOf:[{$ref:"#/$defs/DynamicValue"},{type:"object",description:"A literal object argument (e.g. configuration)."}]}},returnType:{type:"string",description:"The expected return type of the function call.",enum:["string","number","boolean","array","object","any","void"],default:"boolean"}},required:["call"],oneOf:[{$ref:"catalog.json#/$defs/anyFunction"}]},CheckRule:{type:"object",description:"A single validation rule applied to an input component.",properties:{condition:{$ref:"#/$defs/DynamicBoolean"},message:{type:"string",description:"The error message to display if the check fails."}},required:["condition","message"],additionalProperties:!1},Checkable:{description:"Properties for components that support client-side checks.",type:"object",properties:{checks:{type:"array",description:"A list of checks to perform. These are function calls that must return a boolean indicating validity.",items:{$ref:"#/$defs/CheckRule"}}}},Action:{description:"Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.",oneOf:[{type:"object",description:"Triggers a server-side event.",properties:{event:{type:"object",description:"The event to dispatch to the server.",properties:{name:{type:"string",description:"The name of the action to be dispatched to the server."},context:{type:"object",description:"A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",additionalProperties:{$ref:"#/$defs/DynamicValue"}}},required:["name"],additionalProperties:!1}},required:["event"],additionalProperties:!1},{type:"object",description:"Executes a local client-side function.",properties:{functionCall:{$ref:"#/$defs/FunctionCall"}},required:["functionCall"],additionalProperties:!1}]}},V10_STANDARD_DEFS={ComponentId:{type:"string",description:"The unique identifier for a component, used for both definitions and references within the same surface."},CallId:{type:"string",description:"The unique identifier for a function call."},AccessibilityAttributes:{type:"object",description:"Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding.",properties:{label:{$ref:"#/$defs/DynamicString",description:"A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."},description:{$ref:"#/$defs/DynamicString",description:"Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."},live:{type:"string",enum:["off","polite","assertive"],default:"off",description:"Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts."},hidden:{$ref:"#/$defs/DynamicBoolean",description:"Hides the element and its children from assistive technologies when true. Default is false."}},additionalProperties:!1},Extensions:{type:"object",description:"Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.",patternProperties:{"^[\\p{XID_Start}_][\\p{XID_Continue}]*$":{}},additionalProperties:!1},ComponentCommon:{type:"object",properties:{id:{$ref:"#/$defs/ComponentId"},catalogId:{type:"string",description:"The catalog ID for this component, overriding any surface-level default catalogId."},accessibility:{$ref:"#/$defs/AccessibilityAttributes"},metadata:{type:"object",description:"Optional component-level metadata for vendor extensions.",properties:{extensions:{$ref:"#/$defs/Extensions"}},additionalProperties:!1}},required:["id"]},Child:{$ref:"#/$defs/ComponentId",description:"A reference to a single child component ID."},ChildList:{oneOf:[{type:"array",items:{$ref:"#/$defs/ComponentId"},description:"A static list of child component IDs."},{type:"object",description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:"#/$defs/ComponentId"},path:{type:"string",description:"The path to the list of component property objects in the data model."}},required:["componentId","path"],additionalProperties:!1}]},DataBinding:{type:"object",properties:{path:{type:"string",description:"A JSON Pointer path to a value in the data model."}},required:["path"],additionalProperties:!1},DynamicValue:{description:"A value that can be a literal, a path, or a function call returning any type.",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object",not:{anyOf:[{required:["path"]},{required:["call"]}]}},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicString:{description:"Represents a string",oneOf:[{type:"string"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicNumber:{description:"Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",oneOf:[{type:"number"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicBoolean:{description:"A boolean value that can be a literal, a path, or a function call returning a boolean.",oneOf:[{type:"boolean"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicStringList:{description:"Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",oneOf:[{type:"array",items:{type:"string"}},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},FunctionCommon:{type:"object",description:"Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog.",properties:{call:{type:"string",description:"The name of the function to call."},catalogId:{type:"string",description:"The catalog ID for this function, overriding any surface-level default catalogId."}},required:["call"]},IndexSystemFunction:{type:"object",description:"Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.",returnType:"number",properties:{call:{const:"@index"},args:{type:"object",properties:{offset:{$ref:"#/$defs/DynamicNumber",description:"Optional. An offset to add to the 0-based index (e.g., 1 for 1-based indexing). Defaults to 0.",default:0}},unevaluatedProperties:!1}},required:["call"],unevaluatedProperties:!1},FunctionCall:{type:"object",description:"Invokes a named function, combining common function properties with the catalog function definition.",allOf:[{$ref:"#/$defs/FunctionCommon"},{oneOf:[{$ref:"catalog.json#/$defs/anyFunction"},{$ref:"#/$defs/IndexSystemFunction"}]}],unevaluatedProperties:!1},CheckRule:{type:"object",description:"A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object.",properties:{condition:{oneOf:[{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}],description:"Path or function call evaluating to a structured validation result object."},message:{type:"string",description:"Optional fallback error message."}},required:["condition"],additionalProperties:!1},Checkable:{description:"Properties for components that support renderer-side checks.",type:"object",properties:{checks:{type:"array",description:"A list of checks to perform. These are function calls that must return a boolean indicating validity.",items:{$ref:"#/$defs/CheckRule"}}}},Action:{description:"Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.",oneOf:[{type:"object",description:"Triggers an agent-side event.",properties:{event:{type:"object",description:"The event to dispatch to the agent.",properties:{name:{type:"string",description:"The name of the action to be dispatched to the agent."},userMessage:{$ref:"#/$defs/DynamicString",description:"An optional human-readable message describing the action performed by the user, to present in conversation history or user feedback."},context:{type:"object",description:"A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",additionalProperties:{$ref:"#/$defs/DynamicValue"}}},required:["name"],additionalProperties:!1}},required:["event"],additionalProperties:!1},{type:"object",description:"Executes a renderer or agent-side function.",properties:{functionCall:{$ref:"#/$defs/FunctionCall"}},required:["functionCall"],additionalProperties:!1}]},Surface:{title:"Surface Container Component",description:"The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.",type:"object",allowedParents:[],properties:{component:{const:"Surface"},child:{const:"root"}},additionalProperties:!1},FunctionResponse:{type:"object",description:"The return response matching a callAgentFunction or callRendererFunction invocation.",properties:{functionCallId:{$ref:"#/$defs/CallId",description:"The unique ID matching the initiating function call."},value:{description:"The return value of the function."},error:{type:"object",description:"An error object indicating failure of the function execution.",properties:{code:{type:"string"},message:{type:"string"}},required:["code","message"],additionalProperties:!1}},required:["functionCallId"],oneOf:[{required:["value"]},{required:["error"]}],additionalProperties:!1}};const STANDARD_DEFS_BY_VERSION={"0.8":V08_STANDARD_DEFS,"0.9":V09_STANDARD_DEFS,"0.9.1":V09_STANDARD_DEFS,"1.0":V10_STANDARD_DEFS};function getStandardDefsForCatalog(Au,lo){if(lo?.standardDefs)return lo.standardDefs;if(lo?.protocolVersion){const $u=toCanonicalVersion(lo.protocolVersion)??normalizeVersionString(lo.protocolVersion);if($u in STANDARD_DEFS_BY_VERSION)return STANDARD_DEFS_BY_VERSION[$u]}return V09_STANDARD_DEFS}function transformRefDescriptionNode(Au){if(typeof Au.description!="string"||!Au.description.startsWith("REF:"))return!1;const lo=Au.description.substring(4),$u=lo.indexOf("|"),Ru=$u===-1?lo:lo.substring(0,$u),Iu=$u===-1?"":lo.substring($u+1),Pu=Au.default;for(const Ou of Object.keys(Au))delete Au[Ou];return Au.$ref=Ru.startsWith("#")?Ru:`#/$defs/${Ru.split("/").pop()}`,Pu!==void 0&&(Au.default=Pu),Iu&&(Au.description=Iu),!0}function cleanSchemaProperties(Au){Array.isArray(Au.anyOf)&&(Au.oneOf=Au.anyOf,delete Au.anyOf),Au.additionalProperties&&typeof Au.additionalProperties=="object"&&Object.keys(Au.additionalProperties).length===0&&(Au.additionalProperties=!0),Au.unevaluatedProperties&&typeof Au.unevaluatedProperties=="object"&&Object.keys(Au.unevaluatedProperties).length===0&&(Au.unevaluatedProperties=!0),"$schema"in Au&&delete Au.$schema}function cleanSchemaNode(Au,lo=new Set){if(typeof Au!="object"||Au===null||lo.has(Au))return;if(lo.add(Au),Array.isArray(Au)){for(const Ru of Au)cleanSchemaNode(Ru,lo);return}const $u=Au;if(!transformRefDescriptionNode($u)){cleanSchemaProperties($u);for(const Ru of Object.keys($u))cleanSchemaNode($u[Ru],lo)}}function processTheme(Au,lo){if(!Au.themeSchema)return;const $u=zodToJsonSchema(Au.themeSchema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode($u),$u.definitions&&typeof $u.definitions=="object"?(Object.assign(lo,$u.definitions),delete $u.definitions):$u.$defs&&typeof $u.$defs=="object"&&(Object.assign(lo,$u.$defs),delete $u.$defs);const Ru=Au.id.includes("v0_8")||Au.id.includes("v0.8"),Iu={type:"object",properties:$u.properties||{},...Array.isArray($u.required)&&$u.required.length>0?{required:$u.required}:{},...Ru?{}:{additionalProperties:$u.additionalProperties!==void 0?$u.additionalProperties:!0}};lo.theme=Iu}function extractZodComponentSchema(Au,lo){if(!Au.schema||typeof Au.schema!="object"||!("safeParse"in Au.schema))return{props:{},reqList:[],additionalProps:void 0};const $u=zodToJsonSchema(Au.schema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode($u),$u.definitions&&typeof $u.definitions=="object"?Object.assign(lo,$u.definitions):$u.$defs&&typeof $u.$defs=="object"&&Object.assign(lo,$u.$defs);const Ru=$u.properties||{},Iu=Array.isArray($u.required)?$u.required.filter(Du=>Du!=="component"&&Du!=="id"):[],Pu=$u.unevaluatedProperties??$u.additionalProperties;return{props:Ru,reqList:Iu,additionalProps:typeof Pu=="boolean"||typeof Pu=="object"&&Pu!==null?Pu:void 0}}function processSingleComponent(Au,lo,$u,Ru,Iu){const{props:Pu,reqList:Ou,additionalProps:Du}=extractZodComponentSchema(lo,$u),{component:Mu,id:Lu,...Bu}=Pu,ju={id:{$ref:"#/$defs/ComponentId"},...Bu,component:{const:Au}},Fu=["id",...Ou,"component"];let zu;return Iu?.componentEnvelopeRef?zu={allOf:[{$ref:Iu.componentEnvelopeRef},{type:"object",properties:ju,required:Fu}],unevaluatedProperties:Du!==void 0?Du:!1}:zu={type:"object",properties:ju,required:Fu,unevaluatedProperties:Du!==void 0?Du:!1},lo.allowedParents&&lo.allowedParents.length>0&&(zu.allowedParents=lo.allowedParents),lo.allowedChildren&&lo.allowedChildren.length>0&&(zu.allowedChildren=lo.allowedChildren),zu}function processComponents(Au,lo,$u,Ru){if(Au.components.size===0){lo.components={};return}const Iu={};for(const[Pu,Ou]of Au.components.entries())Iu[Pu]=processSingleComponent(Pu,Ou,$u,Au,Ru);lo.components=Iu,$u.anyComponent={oneOf:Array.from(Au.components.keys()).map(Pu=>({$ref:`#/components/${Pu}`})),discriminator:{propertyName:"component"}}}function processSingleFunction(Au,lo,$u){let Ru;if(lo.schema&&typeof lo.schema=="object"&&"safeParse"in lo.schema){const Iu=zodToJsonSchema(lo.schema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode(Iu),Iu.definitions&&typeof Iu.definitions=="object"?(Object.assign($u,Iu.definitions),delete Iu.definitions):Iu.$defs&&typeof Iu.$defs=="object"&&(Object.assign($u,Iu.$defs),delete Iu.$defs),Ru=Iu}else Ru={type:"object",properties:{}};if(lo.description&&Ru.description===void 0&&(Ru.description=lo.description),Ru.type==="object"){const Iu=Ru.unevaluatedProperties??Ru.additionalProperties,Pu=typeof Iu=="boolean"||typeof Iu=="object"&&Iu!==null?Iu:void 0;Ru.additionalProperties!==void 0&&delete Ru.additionalProperties,Ru.unevaluatedProperties=Pu!==void 0?Pu:!1}return Ru}function processFunctions(Au,lo,$u){if(Au.functions.size===0)return;const Ru={};for(const[Iu,Pu]of Au.functions.entries())Ru[Iu]=processSingleFunction(Iu,Pu,$u);lo.functions=Ru,$u.anyFunction={oneOf:Array.from(Au.functions.keys()).map(Iu=>({$ref:`#/functions/${Iu}`}))}}function collectReferencedDefs(Au,lo,$u=new Set){if(!(typeof Au!="object"||Au===null)&&!$u.has(Au)){if($u.add(Au),typeof Au.$ref=="string"){const Ru=Au.$ref;Ru.startsWith("#/$defs/")&&lo.add(Ru.substring(8))}if(Array.isArray(Au))for(const Ru of Au)collectReferencedDefs(Ru,lo,$u);else for(const Ru of Object.values(Au))collectReferencedDefs(Ru,lo,$u)}}function generateCatalogSchema(Au,lo){const $u={$schema:"https://json-schema.org/draft/2020-12/schema",catalogId:Au.id};Au.instructions&&($u.instructions=Au.instructions);const Ru={};processTheme(Au,Ru),processComponents(Au,$u,Ru,lo),processFunctions(Au,$u,Ru);const Iu=getStandardDefsForCatalog(Au,lo);let Pu;do{Pu=Object.keys(Ru).length;const Ou=new Set;collectReferencedDefs($u,Ou),collectReferencedDefs(Ru,Ou),(Ou.has("DynamicString")||Ou.has("DynamicNumber")||Ou.has("DynamicBoolean")||Ou.has("DynamicValue"))&&(Ou.add("DataBinding"),Ou.add("FunctionCall"));for(const Du of Ou)Du in Iu&&!(Du in Ru)&&(Ru[Du]=Iu[Du])}while(Object.keys(Ru).length>Pu);return Object.keys(Ru).length>0&&($u.$defs=Ru),$u}function extractRefDefName(Au){if(!Au)return"";const lo=Au.lastIndexOf("#");return(lo!==-1?Au.slice(lo+1):Au).split("/").filter(Boolean).pop()??""}function unwrapNextZodLayer(Au,lo){if(!Au?._def)return null;if(lo){if(lo.has(Au))return null;lo.add(Au)}switch(Au._def.typeName){case"ZodOptional":case"ZodNullable":case"ZodDefault":case"ZodReadonly":return Au._def.innerType;case"ZodBranded":return Au._def.type;case"ZodEffects":return Au._def.schema;case"ZodLazy":return Au._def.getter();default:return null}}function getDescriptions(Au){const lo=[],$u=new Set;let Ru=Au;for(;Ru;){Ru.description&&lo.push(Ru.description),Ru._def?.description&&lo.push(Ru._def.description);const Iu=unwrapNextZodLayer(Ru,$u);if(!Iu)break;Ru=Iu}return lo}function unwrapZodType(Au){const lo=new Set;let $u=Au;for(;$u;){const Ru=unwrapNextZodLayer($u,lo);if(!Ru)break;$u=Ru}return $u}function checkDirectJsonRef(Au,lo){if(!Au)return null;const $u=extractRefDefName(Au),Ru=lo.childListRefNames,Iu=lo.childRefNames;return Ru.has($u)?{isChild:!1,isChildList:!0}:Iu.has($u)?{isChild:!0,isChildList:!1}:null}function checkCombinerList(Au,lo){let $u=!1;for(const Ru of Au){if(typeof Ru!="object"||Ru===null)continue;const Iu=checkJsonSchemaRef(Ru,lo);if(Iu.isChildList)return{isChild:!1,isChildList:!0};Iu.isChild&&($u=!0)}return $u?{isChild:!0,isChildList:!1}:null}function checkCombinerRefs(Au,lo){let $u=!1;for(const Ru of["oneOf","anyOf","allOf"]){const Iu=Au[Ru];if(!Array.isArray(Iu))continue;const Pu=checkCombinerList(Iu,lo);if(Pu?.isChildList)return Pu;Pu?.isChild&&($u=!0)}return $u?{isChild:!0,isChildList:!1}:null}function checkJsonSchemaRef(Au,lo){const $u=typeof Au.$ref=="string"?Au.$ref:"",Ru=checkDirectJsonRef($u,lo);if(Ru)return Ru;if(Au.type==="array"&&Au.items){const Pu=checkJsonSchemaRef(Au.items,lo);if(Pu.isChild||Pu.isChildList)return{isChild:!1,isChildList:!0}}const Iu=checkCombinerRefs(Au,lo);return Iu||(Au.type==="object"&&Au.properties&&("componentId"in Au.properties&&("path"in Au.properties||"dataBinding"in Au.properties)||"explicitList"in Au.properties||"template"in Au.properties)?{isChild:!1,isChildList:!0}:{isChild:!1,isChildList:!1})}function isTemplateShape(Au){if(Au?._def?.typeName==="ZodObject"&&typeof Au._def.shape=="function"){const lo=Au._def.shape();return!!(lo.componentId&&(lo.path||lo.dataBinding)||lo.explicitList||lo.template)}return!1}function isArrayOfChild(Au,lo){if(Au?._def?.typeName==="ZodArray"){const $u=unwrapZodType(Au._def.type);return analyzeChildRefSchema($u,lo).isChild}return!1}function analyzeUnionOptions(Au,lo){let $u=!1,Ru=!1,Iu=!1;for(const Pu of Au){const Ou=unwrapZodType(Pu);isTemplateShape(Ou)&&($u=!0),isArrayOfChild(Ou,lo)&&(Ru=!0);const Du=analyzeChildRefSchema(Ou,lo);if(Du.isChildList)return{isChild:!1,isChildList:!0};Du.isChild&&(Iu=!0)}return $u||Ru?{isChild:!1,isChildList:!0}:Iu?{isChild:!0,isChildList:!1}:{isChild:!1,isChildList:!1}}function isChildListDescription(Au,lo){if(!Au)return!1;if(Au.startsWith("REF:")){const Iu=extractRefDefName(Au.substring(4).split("|")[0]);if(lo.has(Iu))return!0}const $u=extractRefDefName(Au.split("|")[0]);if($u&&lo.has($u))return!0;const Ru=Au.trim();return!!lo.has(Ru)}function isChildDescription(Au,lo){if(!Au)return!1;if(Au.startsWith("REF:")){const Iu=extractRefDefName(Au.substring(4).split("|")[0]);if(lo.has(Iu))return!0}const $u=extractRefDefName(Au.split("|")[0]);if($u&&lo.has($u))return!0;const Ru=Au.trim();return!!lo.has(Ru)}function checkDescriptionChildRef(Au,lo){const $u=lo.childListRefNames,Ru=lo.childRefNames;for(const Iu of Au){if(isChildListDescription(Iu,$u))return{isChild:!1,isChildList:!0};if(isChildDescription(Iu,Ru))return{isChild:!0,isChildList:!1}}return null}function analyzeZodArray(Au,lo){const $u=analyzeChildRefSchema(Au,lo);return $u.isChild||$u.isChildList?{isChild:!1,isChildList:!0}:{isChild:!1,isChildList:!1}}function analyzeChildRefSchema(Au,lo){if(!Au||typeof Au!="object")return{isChild:!1,isChildList:!1};const $u=childRefKindOf(Au);if($u==="component-id")return{isChild:!0,isChildList:!1};if($u==="child-list")return{isChild:!1,isChildList:!0};const Ru=checkDescriptionChildRef(getDescriptions(Au),lo);if(Ru)return Ru;const Iu=unwrapZodType(Au);if(!Iu?._def)return checkJsonSchemaRef(Au,lo);const Pu=childRefKindOf(Iu);if(Pu==="component-id")return{isChild:!0,isChildList:!1};if(Pu==="child-list")return{isChild:!1,isChildList:!0};const Ou=Iu._def.typeName;if(Ou==="ZodArray"){const Du=unwrapZodType(Iu._def.type);return analyzeZodArray(Du,lo)}if(Ou==="ZodUnion"){const Du=Iu._def.options??[];return analyzeUnionOptions(Du,lo)}if(Ou==="ZodObject"&&typeof Iu._def.shape=="function"){const Du=Iu._def.shape();if(Du.componentId&&(Du.path||Du.dataBinding)||Du.explicitList||Du.template)return{isChild:!1,isChildList:!0}}return{isChild:!1,isChildList:!1}}function addNestedRef(Au,lo,$u){const Ru=Au.nestedRefs[lo];if(Ru){Ru.add($u);return}Au.nestedRefs[lo]=new Set([$u])}function inspectShapeField(Au,lo,$u,Ru){const Iu=analyzeChildRefSchema(lo,Ru);if(Iu.isChildList){$u.listRefs.add(Au);return}if(Iu.isChild){$u.singleRefs.add(Au);return}const Pu=unwrapZodType(lo);if(Pu?._def?.typeName!=="ZodArray")return;const Ou=unwrapZodType(Pu._def.type);if(Ou?._def?.typeName!=="ZodObject"||typeof Ou._def.shape!="function")return;const Du=Ou._def.shape();for(const[Mu,Lu]of Object.entries(Du)){const Bu=analyzeChildRefSchema(Lu,Ru);(Bu.isChild||Bu.isChildList)&&($u.listRefs.add(Au),addNestedRef($u,Au,Mu))}}function rawArrayItemProperties(Au){if(typeof Au!="object"||Au===null)return null;const lo=Au;if(lo.type!=="array"&&!("items"in lo))return null;const $u=lo.items;if(typeof $u!="object"||$u===null)return null;const Ru=$u.properties;return typeof Ru!="object"||Ru===null?null:Ru}function inspectRawProperties(Au,lo,$u){for(const[Ru,Iu]of Object.entries(Au)){const Pu=analyzeChildRefSchema(Iu,$u);if(Pu.isChildList){lo.listRefs.add(Ru);continue}if(Pu.isChild){lo.singleRefs.add(Ru);continue}const Ou=rawArrayItemProperties(Iu);if(Ou)for(const[Du,Mu]of Object.entries(Ou)){const Lu=analyzeChildRefSchema(Mu,$u);(Lu.isChild||Lu.isChildList)&&(lo.listRefs.add(Ru),addNestedRef(lo,Ru,Du))}}}function inspectComponentSchema(Au,lo,$u){if(!Au)return;const Ru=unwrapZodType(Au);if(Ru?._def?.typeName==="ZodObject"&&typeof Ru._def.shape=="function"){const Iu=Ru._def.shape();for(const[Pu,Ou]of Object.entries(Iu))inspectShapeField(Pu,Ou,lo,$u);return}if(typeof Au=="object"&&Au!==null&&"properties"in Au){const Iu=Au.properties;typeof Iu=="object"&&Iu!==null&&inspectRawProperties(Iu,lo,$u)}}function buildComponentRefMap(Au,lo){const $u={},Ru=typeof Au?.components?.values=="function"?Array.from(Au.components.values()):Array.isArray(Au)?Au:Array.from(Au.values());for(const Iu of Ru){const Pu={singleRefs:new Set,listRefs:new Set,nestedRefs:{}};inspectComponentSchema(Iu.schema,Pu,lo),$u[Iu.name]={singleRefs:Pu.singleRefs,listRefs:Pu.listRefs,nestedRefs:Pu.nestedRefs}}return $u}function createFunctionImplementation(Au,lo){return{name:Au.name,returnType:Au.returnType,schema:Au.schema,allowedCallers:Au.allowedCallers,requiresUserActivation:Au.requiresUserActivation,description:Au.description,execute:lo}}class Catalog{get catalogSchema(){return this.cachedCatalogSchema||(this.cachedCatalogSchema=generateCatalogSchema(this)),this.cachedCatalogSchema}get componentRefMap(){return this._componentRefMap||(this._componentRefMap=buildComponentRefMap(this,V09_CHILD_REF_OPTIONS)),this._componentRefMap}constructor(lo,$u,Ru=[],Iu=[],Pu,Ou){if(!$u)throw new A2uiCatalogError("protocolVersion must be provided.");this.id=lo,this.protocolVersion=$u;const Du=new Map;for(const Lu of Ru)Du.set(Lu.name,Lu);this.components=Du;const Mu=new Map;for(const Lu of Iu)Mu.set(Lu.name,Lu);this.functions=Mu,this.themeSchema=Pu,this.instructions=Ou,this.invoker=(Lu,Bu,ju,Fu)=>{const zu=this.functions.get(Lu);if(!zu)throw new A2uiExpressionError(`Function not found in catalog '${this.id}': ${Lu}`,Lu);const Uu=zu.execute;if(typeof Uu!="function")throw new A2uiExpressionError(`Function '${Lu}' in catalog '${this.id}' is schema-only and has no implementation.`,Lu);try{const Hu=zu.schema.parse(Bu);return Uu.call(zu,Hu,ju,Fu)}catch(Hu){throw Hu?.name==="ZodError"||Hu instanceof ZodError?new A2uiExpressionError(`Validation failed for function '${Lu}': ${Hu.message}`,Lu,Hu.errors??Hu.issues):Hu}}}static fromSchema(lo,$u){return loadCatalogFromSchema(lo,$u)}}class EventEmitter{constructor(){this.listeners=new Set}subscribe(lo){return this.listeners.add(lo),{unsubscribe:()=>this.listeners.delete(lo)}}async emit(lo){for(const $u of this.listeners)try{await $u(lo)}catch(Ru){console.error("EventEmitter error:",Ru)}}dispose(){this.listeners.clear()}}var i=Symbol.for("preact-signals");function t(){if(v>1)v--;else{var Au,lo=!1;for((function(){var Iu=c;for(c=void 0;Iu!==void 0;){var Pu=Iu.S;if(Pu.v===Iu.v)for(var Ou=Pu.t;Ou!==void 0;Ou=Ou.x)Ou.i===Iu.i&&(Ou.i=Pu.i);Iu=Iu.o}})();h!==void 0;){var $u=h;for(h=void 0,s++;$u!==void 0;){var Ru=$u.u;if($u.u=void 0,$u.f&=-3,!(8&$u.f)&&w($u))try{$u.c()}catch(Iu){lo||(Au=Iu,lo=!0)}$u=Ru}}if(s=0,v--,lo)throw Au}}function r(Au){if(v>0)return Au();u=++e,v++;try{return Au()}finally{t()}}var n,o=void 0;function f(Au){var lo=o,$u=n;o=void 0,n=void 0;try{return Au()}finally{o=lo,n=$u}}var h=void 0,v=0,s=0,e=0,u=0,c=void 0,a=0;function d(Au){if(o!==void 0){var lo=Au.n;if(lo===void 0||lo.t!==o)return lo={i:0,S:Au,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:lo},o.s!==void 0&&(o.s.n=lo),o.s=lo,Au.n=lo,32&o.f&&Au.S(lo),lo;if(lo.i===-1)return lo.i=0,lo.n!==void 0&&(lo.n.p=lo.p,lo.p!==void 0&&(lo.p.n=lo.n),lo.p=o.s,lo.n=void 0,o.s.n=lo,o.s=lo),lo}}function l(Au,lo){this.v=Au,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=lo?.watched,this.Z=lo?.unwatched,this.name=lo?.name}l.prototype.brand=i;l.prototype.h=function(){return!0};l.prototype.S=function(Au){var lo=this,$u=this.t;$u!==Au&&Au.e===void 0&&(Au.x=$u,this.t=Au,$u!==void 0?$u.e=Au:f(function(){var Ru;(Ru=lo.W)==null||Ru.call(lo)}))};l.prototype.U=function(Au){var lo=this;if(this.t!==void 0){var $u=Au.e,Ru=Au.x;$u!==void 0&&($u.x=Ru,Au.e=void 0),Ru!==void 0&&(Ru.e=$u,Au.x=void 0),Au===this.t&&(this.t=Ru,Ru===void 0&&f(function(){var Iu;(Iu=lo.Z)==null||Iu.call(lo)}))}};l.prototype.subscribe=function(Au){var lo=this;return x(function(){var $u=lo.value;f(function(){return Au($u)})},{name:"sub"})};l.prototype.valueOf=function(){return this.value};l.prototype.toString=function(){return this.value+""};l.prototype.toJSON=function(){return this.value};l.prototype.peek=function(){var Au=this;return f(function(){return Au.value})};Object.defineProperty(l.prototype,"value",{get:function(){var Au=d(this);return Au!==void 0&&(Au.i=this.i),this.v},set:function(Au){if(Au!==this.v){if(s>100)throw new Error("Cycle detected");(function($u){v!==0&&s===0&&$u.l!==u&&($u.l=u,c={S:$u,v:$u.v,i:$u.i,o:c})})(this),this.v=Au,this.i++,a++,v++;try{for(var lo=this.t;lo!==void 0;lo=lo.x)lo.t.N()}finally{t()}}}});function y(Au,lo){return new l(Au,lo)}function w(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n)if(lo.S.i!==lo.i||!lo.S.h()||lo.S.i!==lo.i)return!0;return!1}function b(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n){var $u=lo.S.n;if($u!==void 0&&(lo.r=$u),lo.S.n=lo,lo.i=-1,lo.n===void 0){Au.s=lo;break}}}function _(Au){for(var lo=Au.s,$u=void 0;lo!==void 0;){var Ru=lo.p;lo.i===-1?(lo.S.U(lo),Ru!==void 0&&(Ru.n=lo.n),lo.n!==void 0&&(lo.n.p=Ru)):$u=lo,lo.S.n=lo.r,lo.r!==void 0&&(lo.r=void 0),lo=Ru}Au.s=$u}function j(Au,lo){l.call(this,void 0,lo),this.x=Au,this.s=void 0,this.g=a-1,this.f=4}j.prototype=new l;j.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===a))return!0;if(this.g=a,this.f|=1,this.i>0&&!w(this))return this.f&=-2,!0;var Au=o;try{b(this),o=this;var lo=this.x();(16&this.f||this.v!==lo||this.i===0)&&(this.v=lo,this.f&=-17,this.i++)}catch($u){this.v=$u,this.f|=16,this.i++}return o=Au,_(this),this.f&=-2,!0};j.prototype.S=function(Au){if(this.t===void 0){this.f|=36;for(var lo=this.s;lo!==void 0;lo=lo.n)lo.S.S(lo)}l.prototype.S.call(this,Au)};j.prototype.U=function(Au){if(this.t!==void 0&&(l.prototype.U.call(this,Au),this.t===void 0)){this.f&=-33;for(var lo=this.s;lo!==void 0;lo=lo.n)lo.S.U(lo)}};j.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var Au=this.t;Au!==void 0;Au=Au.x)Au.t.N()}};Object.defineProperty(j.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var Au=d(this);if(this.h(),Au!==void 0&&(Au.i=this.i),16&this.f)throw this.v;return this.v}});function O(Au,lo){return new j(Au,lo)}function p(Au){var lo=Au.j;if(Au.j=void 0,typeof lo=="function"){v++;var $u=o;o=void 0;try{lo()}catch(Ru){throw Au.f&=-2,Au.f|=8,g(Au),Ru}finally{o=$u,t()}}}function g(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n)lo.S.U(lo);Au.x=void 0,Au.s=void 0,p(Au)}function S(Au){if(o!==this)throw new Error("Out-of-order effect");_(this),o=Au,this.f&=-2;try{8&this.f&&g(this)}finally{t()}}function m(Au,lo){this.x=Au,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=lo?.name,n&&n.push(this)}m.prototype.c=function(){var Au=this.S();try{if(8&this.f||this.x===void 0)return;var lo=this.x();typeof lo=="function"&&(this.j=lo)}finally{Au()}};m.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,p(this),b(this),v++;var Au=o;return o=this,S.bind(this,Au)};m.prototype.N=function(){2&this.f||(this.f|=2,this.u=h,h=this)};m.prototype.d=function(){this.f|=8,1&this.f||g(this)};m.prototype.dispose=function(){this.d()};function x(Au,lo){var $u=new m(Au,lo);try{$u.c()}catch(Iu){throw $u.d(),Iu}var Ru=$u.d.bind($u);return Ru[Symbol.dispose]=Ru,Ru}let signalImpl,computedImpl,effectImpl,batchWriteImpl,isSignalImpl,getValueImpl,setValueImpl,peekValueImpl;const _PRIVATE_DEFAULT_SIGNAL_IMPLEMENTATION={signal:y,computed:O,effect:x,batchWrite:r,isSignal:Au=>!!Au&&typeof Au=="object"&&"value"in Au&&"peek"in Au,getValue:Au=>Au.value,setValue:(Au,lo)=>{Au instanceof j||(Au.value=lo)},peekValue:Au=>Au.peek()};setSignalImplementation(_PRIVATE_DEFAULT_SIGNAL_IMPLEMENTATION);function setSignalImplementation(Au){signalImpl=Au.signal,computedImpl=Au.computed,effectImpl=Au.effect,batchWriteImpl=Au.batchWrite,isSignalImpl=Au.isSignal,getValueImpl=Au.getValue,setValueImpl=Au.setValue,peekValueImpl=Au.peekValue}function signal(Au){return signalImpl(Au)}function computed(Au){return computedImpl(Au)}function effect(Au){return effectImpl(Au)}function batchWrite(Au){return batchWriteImpl(Au)}function isSignal(Au){return isSignalImpl(Au)}function getValue(Au){return getValueImpl(Au)}function setValue(Au,lo){setValueImpl(Au,lo)}function peekValue(Au){return peekValueImpl(Au)}function isNumeric(Au){return/^(0|[1-9]\d*)$/.test(Au)}const MAX_ARRAY_INDEX=1e4,FORBIDDEN_KEYS=new Set(["__proto__","constructor","prototype"]);class DataModel{constructor(lo={}){this.data={},this.signals=new Map,this.subscriptions=new Set,this.data=lo}getSignal(lo){const $u=this.normalizePath(lo);return this.signals.has($u)||this.signals.set($u,signal(this.get($u))),this.signals.get($u)}set(lo,$u){if(lo==null)throw new A2uiDataError("Path cannot be null or undefined.");if(lo==="/"||lo==="")return this.data=$u??{},this.notifyAllSignals(),this;const Ru=this.parsePath(lo),Iu=Ru.pop();if($u==null&&this.get(lo)===void 0)return this;if(this.data===void 0||this.data===null)this.data={};else if(typeof this.data!="object")throw new A2uiDataError(`Cannot set path '${lo}': the data model root is a primitive value.`,lo);let Pu=this.data;for(let Ou=0;Ou<Ru.length;Ou++){const Du=Ru[Ou];if(Array.isArray(Pu)){if(!isNumeric(Du))throw new A2uiDataError(`Cannot use non-numeric segment '${Du}' on an array in path '${lo}'.`,lo);const Mu=parseInt(Du,10);if(Mu>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Du}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);const Lu=Pu[Mu];if(Lu!=null&&typeof Lu!="object")throw new A2uiDataError(`Cannot set path '${lo}': segment '${Du}' is a primitive value.`,lo);if(Lu==null){const Bu=Ou<Ru.length-1?Ru[Ou+1]:Iu;if(isNumeric(Bu)){if(parseInt(Bu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Bu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);Pu[Mu]=[]}else Pu[Mu]={}}}else{const Mu=Object.prototype.hasOwnProperty.call(Pu,Du);if(Mu){const Lu=Pu[Du];if(Lu!=null&&typeof Lu!="object")throw new A2uiDataError(`Cannot set path '${lo}': segment '${Du}' is a primitive value.`,lo)}if(!Mu||Pu[Du]===void 0||Pu[Du]===null){const Lu=Ou<Ru.length-1?Ru[Ou+1]:Iu;if(isNumeric(Lu)){if(parseInt(Lu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Lu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);Pu[Du]=[]}else Pu[Du]={}}}Pu=Pu[Du]}if(Array.isArray(Pu)){if(!isNumeric(Iu))throw new A2uiDataError(`Cannot use non-numeric segment '${Iu}' on an array in path '${lo}'.`,lo);if(parseInt(Iu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Iu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo)}if($u==null)if(Array.isArray(Pu)){const Ou=parseInt(Iu,10);Ou<Pu.length&&(Pu[Ou]=void 0)}else delete Pu[Iu];else Pu[Iu]=$u;return this.notifySignals(lo),this}delete(lo){return this.set(lo,void 0)}static resolvePath(lo,$u){return lo.startsWith("/")?lo:$u?`${$u.endsWith("/")?$u:`${$u}/`}${lo}`:`/${lo}`}get(lo){if(lo==null)throw new A2uiDataError("Path cannot be null or undefined.");if(lo==="/"||lo==="")return this.data;const $u=this.parsePath(lo);let Ru=this.data;for(const Iu of $u){if(Ru==null||typeof Ru!="object")return;if(Array.isArray(Ru)){if(!isNumeric(Iu))return;const Pu=parseInt(Iu,10);if(Pu<0||Pu>=Ru.length)return;Ru=Ru[Pu]}else{if(!Object.prototype.hasOwnProperty.call(Ru,Iu))return;Ru=Ru[Iu]}}return Ru}hasPath(lo){return lo==null?!1:this.get(lo)!==void 0}subscribe(lo,$u){const Ru=this.getSignal(lo);let Iu=!0,Pu=peekValue(Ru);const Ou=effect(()=>{const Du=getValue(Ru);Pu=Du,Iu||$u(Du)});return Iu=!1,this.subscriptions.add(Ou),{get value(){return Pu},unsubscribe:()=>{Ou(),this.subscriptions.delete(Ou)}}}dispose(){for(const lo of this.subscriptions)lo();this.subscriptions.clear(),this.signals.clear()}normalizePath(lo){return lo.length>1&&lo.endsWith("/")?lo.slice(0,-1):lo||"/"}parsePath(lo){return lo.split("/").filter($u=>$u.length>0).map($u=>{const Ru=$u.replace(/~([01])/g,(Iu,Pu)=>Pu==="1"?"/":"~");if(FORBIDDEN_KEYS.has(Ru))throw new A2uiDataError(`Forbidden path segment '${Ru}' in path '${lo}'.`,lo);return Ru})}notifySignals(lo){const $u=this.normalizePath(lo);batchWrite(()=>{this.updateSignal($u);let Ru=$u;for(;Ru!=="/"&&Ru!=="";)Ru=Ru.substring(0,Ru.lastIndexOf("/"))||"/",this.updateSignal(Ru);for(const Iu of this.signals.keys())this.isDescendant(Iu,$u)&&this.updateSignal(Iu)})}updateSignal(lo){const $u=this.signals.get(lo);if($u){const Ru=this.get(lo);Array.isArray(Ru)?setValue($u,Ru.slice()):typeof Ru=="object"&&Ru!==null?setValue($u,{...Ru}):setValue($u,Ru)}}notifyAllSignals(){batchWrite(()=>{for(const lo of this.signals.keys())this.updateSignal(lo)})}isDescendant(lo,$u){return $u==="/"||$u===""?lo!=="/":lo.startsWith($u+"/")}}const MAX_GLOBAL_DEPTH=50,MAX_FUNC_CALL_DEPTH=5,RELAXED_PATH_PATTERN=/^(?:(?:\/(?:[^~/]|~[01])*)*|(?:[^~/]|~[01])+(?:\/(?:[^~/]|~[01])*)*)$/;function*extractPointers(Au,lo,$u){if(typeof Au=="string")yield[Au,lo];else if(Array.isArray(Au))for(let Ru=0;Ru<Au.length;Ru++){const Iu=Au[Ru],Pu=`${lo}[${Ru}]`;yield*extractPointers(Iu,Pu,$u)}else if(typeof Au=="object"&&Au!==null){const Ru=Au;if("componentId"in Ru&&typeof Ru.componentId=="string"&&("path"in Ru||"dataBinding"in Ru))yield[Ru.componentId,`${lo}.componentId`];else if($u?.size)for(const Iu of $u)Iu in Ru&&(yield*extractPointers(Ru[Iu],`${lo}.${Iu}`));else for(const[Iu,Pu]of Object.entries(Ru))yield*extractPointers(Pu,`${lo}.${Iu}`)}}function getOrCreateRefMap(Au){return Au.componentRefMap}function*getComponentReferences(Au,lo){if(!Au||typeof Au!="object")return;const $u=lo instanceof Catalog?getOrCreateRefMap(lo):lo,Ru=Au.component;let Iu="",Pu=Au;if(typeof Ru=="string")Iu=Ru;else if(typeof Ru=="object"&&Ru!==null){const Bu=Ru;Iu=Object.keys(Bu)[0]??"",Pu=Bu[Iu]??{}}if(!Iu||typeof Pu!="object"||Pu===null)return;const Ou=$u[Iu],Du=Ou?Ou.singleRefs:new Set,Mu=Ou?Ou.listRefs:new Set,Lu=Ou?.nestedRefs;for(const[Bu,ju]of Object.entries(Pu))(Du.has(Bu)||Mu.has(Bu))&&(yield*extractPointers(ju,Bu,Lu?.[Bu]))}function traverseRecursionAndPaths(Au,lo,$u){if(lo>MAX_GLOBAL_DEPTH)throw new A2uiRecursionError(`Global recursion limit exceeded: Depth > ${MAX_GLOBAL_DEPTH}`);if(Array.isArray(Au)){for(const Ru of Au)traverseRecursionAndPaths(Ru,lo+1,$u);return}if(typeof Au=="object"&&Au!==null){const Ru=Au;if("path"in Ru&&typeof Ru.path=="string"){const Ou=Ru.path;if(!RELAXED_PATH_PATTERN.test(Ou))throw new A2uiValidationError(`Invalid path syntax: '${Ou}'`)}const Iu="functionCall"in Ru&&typeof Ru.functionCall=="object"&&Ru.functionCall!==null,Pu="call"in Ru&&"args"in Ru;if(Iu){if($u>=MAX_FUNC_CALL_DEPTH)throw new A2uiRecursionError(`Recursion limit exceeded: functionCall depth > ${MAX_FUNC_CALL_DEPTH}`);for(const[Ou,Du]of Object.entries(Ru))Ou==="functionCall"?traverseRecursionAndPaths(Du,lo+1,$u+1):traverseRecursionAndPaths(Du,lo+1,$u)}else if(Pu){if($u>=MAX_FUNC_CALL_DEPTH)throw new A2uiRecursionError(`Recursion limit exceeded: functionCall depth > ${MAX_FUNC_CALL_DEPTH}`);for(const[Ou,Du]of Object.entries(Ru))Ou==="args"?traverseRecursionAndPaths(Du,lo+1,$u+1):traverseRecursionAndPaths(Du,lo+1,$u)}else for(const Ou of Object.values(Ru))traverseRecursionAndPaths(Ou,lo+1,$u)}}function validateRecursionAndPaths(Au){traverseRecursionAndPaths(Au,0,0)}class SurfaceComponentsModel{constructor(lo){this.components=new Map,this._onCreated=new EventEmitter,this._onDeleted=new EventEmitter,this.onCreated=this._onCreated,this.onDeleted=this._onDeleted,lo&&this.setCatalog(lo)}setCatalog(lo){this.refMap=lo instanceof Catalog?lo.componentRefMap:lo}get(lo){return this.components.get(lo)}getAll(){return new Map(this.components)}has(lo){return this.components.has(lo)}get entries(){return this.components.entries()}get keys(){return this.components.keys()}get values(){return this.components.values()}get size(){return this.components.size}get componentsMap(){return this.components}addComponent(lo){if(this.components.has(lo.id))throw new A2uiStateError(`Component with id '${lo.id}' already exists.`);this.components.set(lo.id,lo),this._onCreated.emit(lo)}removeComponent(lo){const $u=this.components.get(lo);$u&&(this.components.delete(lo),$u.dispose(),this._onDeleted.emit(lo))}getChildReferences(lo){const $u=this.components.get(lo);if(!$u)return[];const Ru=$u.catalog?.components.size?$u.catalog.componentRefMap:this.refMap??$u.catalog?.componentRefMap??{};return Array.from(getComponentReferences({id:$u.id,component:$u.type,...$u.properties},Ru))}getChildIds(lo){return this.getChildReferences(lo).map(([$u])=>$u)}detectCycles(lo={}){const $u=lo.rootId??"root",Ru=lo.maxDepth??MAX_GLOBAL_DEPTH,Iu=lo.allowMissingRoot??!1;for(const Mu of this.components.values())for(const[Lu,Bu]of this.getChildReferences(Mu.id))if(Lu===Mu.id)throw new A2uiRecursionError(`Circular reference detected: Component '${Mu.id}' references itself in field '${Bu}' (Self-reference detected)`);const Pu=new Set,Ou=new Set,Du=(Mu,Lu)=>{if(Lu>Ru)throw new A2uiRecursionError(`Global recursion limit exceeded: logical depth > ${Ru}`);Pu.add(Mu),Ou.add(Mu);const Bu=this.getChildIds(Mu);for(const ju of Bu)if(this.components.has(ju)){if(!Pu.has(ju))Du(ju,Lu+1);else if(Ou.has(ju))throw new A2uiRecursionError(`Circular reference detected involving component '${ju}'`)}Ou.delete(Mu)};if(Iu){const Mu=Array.from(this.components.keys()).sort();for(const Lu of Mu)Pu.has(Lu)||Du(Lu,0)}else this.components.has($u)&&Du($u,0);return Pu}validateTopology(lo={}){if(this.components.size===0)return;const $u=lo.rootId??"root",Ru=lo.allowMissingRoot??!1,Iu=lo.allowDanglingReferences??!1,Pu=lo.allowOrphanComponents??!1;if(!Ru&&!this.components.has($u))throw new A2uiIntegrityError(`Missing root component: No component has id='${$u}'`);if(!Iu){for(const Du of this.components.values())for(const[Mu,Lu]of this.getChildReferences(Du.id))if(!this.components.has(Mu))throw new A2uiIntegrityError(`Component '${Du.id}' references non-existent component '${Mu}' in field '${Lu}' (Dangling reference '${Mu}' in component '${Du.id}')`)}const Ou=this.detectCycles({rootId:$u,allowMissingRoot:Ru,maxDepth:lo.maxDepth});if(!Pu&&!Ru&&Ou.size<this.components.size){const Du=Array.from(this.components.keys()).filter(Mu=>!Ou.has(Mu)).sort();if(Du.length>0)throw new A2uiIntegrityError(`Component '${Du[0]}' is not reachable from '${$u}' (Orphaned component '${Du[0]}' is not reachable from root)`)}}validateReferences(lo={}){const $u=[];try{this.validateTopology(lo)}catch(Ru){Ru instanceof A2uiValidationError?$u.push(Ru):Ru instanceof Error&&$u.push(new A2uiValidationError(Ru.message))}return $u}dispose(){for(const lo of this.components.values())lo.dispose();this.components.clear(),this._onCreated.dispose(),this._onDeleted.dispose()}}class SurfaceModel{constructor(lo,$u,Ru=new Map,Iu={},Pu=!1,Ou,Du="root"){if(this.id=lo,this.defaultCatalog=$u,this.theme=Iu,this.sendDataModel=Pu,this.rootId=Du,this._onAction=new EventEmitter,this._onError=new EventEmitter,this._onWarning=new EventEmitter,this.onAction=this._onAction,this.onError=this._onError,this.onWarning=this._onWarning,Ru!=null&&!(Ru instanceof Map))throw new TypeError("availableCatalogs must be a Map, or undefined/null. Note that availableCatalogs is now the 3rd argument to SurfaceModel and theme is the 4th argument.");const Mu=new Map(Ru??[]);$u?.id&&!Mu.has($u.id)&&Mu.set($u.id,$u),this.availableCatalogs=Mu,this.dataModel=Ou??new DataModel({}),this.componentsModel=new SurfaceComponentsModel($u)}get catalog(){return this.defaultCatalog}async dispatchAction(lo,$u){if(!lo||typeof lo!="object")return;const Ru=extractActionTarget(lo);if(!Ru)return;const Iu=Ru.name;if(!Iu||typeof Iu!="string")return;const Pu=Ru.context,Ou=Pu&&typeof Pu=="object"&&!Array.isArray(Pu)?Pu:{},Du={name:Iu,surfaceId:this.id,sourceComponentId:$u,timestamp:new Date().toISOString(),context:Ou},Mu=Ru.catalogId??lo.catalogId;typeof Mu=="string"&&Mu&&(Du.catalogId=Mu),typeof Ru.userMessage=="string"&&Ru.userMessage.length>0&&(Du.userMessage=Ru.userMessage),await this._onAction.emit(Du)}async dispatchError(lo){await this._onError.emit({...lo,surfaceId:this.id})}async dispatchWarning(lo){await this._onWarning.emit({...lo,surfaceId:this.id})}dispose(){this.dataModel.dispose(),this.componentsModel.dispose(),this._onAction.dispose(),this._onError.dispose(),this._onWarning.dispose()}}function extractActionTarget(Au){return"event"in Au&&Au.event&&typeof Au.event=="object"?Au.event:"name"in Au&&typeof Au.name=="string"?Au:null}class SurfaceGroupModel{constructor(){this.surfaces=new Map,this.surfaceUnsubscribers=new Map,this._onSurfaceCreated=new EventEmitter,this._onSurfaceDeleted=new EventEmitter,this._onAction=new EventEmitter,this.onSurfaceCreated=this._onSurfaceCreated,this.onSurfaceDeleted=this._onSurfaceDeleted,this.onAction=this._onAction}addSurface(lo){if(this.surfaces.has(lo.id)){console.warn(`Surface ${lo.id} already exists. Ignoring.`);return}this.surfaces.set(lo.id,lo);const $u=lo.onAction.subscribe(Ru=>this._onAction.emit(Ru));this.surfaceUnsubscribers.set(lo.id,$u),this._onSurfaceCreated.emit(lo)}deleteSurface(lo){const $u=this.surfaces.get(lo);if($u){const Ru=this.surfaceUnsubscribers.get(lo);Ru&&(Ru.unsubscribe(),this.surfaceUnsubscribers.delete(lo)),this.surfaces.delete(lo),$u.dispose(),this._onSurfaceDeleted.emit(lo)}}getSurface(lo){return this.surfaces.get(lo)}get surfacesMap(){return this.surfaces}dispose(){for(const lo of Array.from(this.surfaces.keys()))this.deleteSurface(lo);this._onSurfaceCreated.dispose(),this._onSurfaceDeleted.dispose(),this._onAction.dispose()}}class ComponentModel{constructor(lo,$u,Ru,Iu){this.id=lo,this.type=$u,this.catalog=Iu,this._onUpdated=new EventEmitter,this.onUpdated=this._onUpdated,this._properties=Ru}get properties(){return this._properties}set properties(lo){this._properties=lo,this._onUpdated.emit(this)}dispose(){this._onUpdated.dispose()}get componentTree(){return{id:this.id,type:this.type,...this._properties}}}function formatZodIssue(Au){const lo=Au.path.join(".")||"root";switch(Au.code){case ZodIssueCode.invalid_union:{const $u=Au.unionErrors?.flatMap(Ru=>Ru.issues);return $u&&$u.length>0?$u.map(formatZodIssue).join("; "):`${lo}: Invalid union`}case ZodIssueCode.unrecognized_keys:{const $u=Au.keys.map(Ru=>`'${Ru}'`).join(", ");return`${lo}: Unrecognized key(s) in object: ${$u}`}case ZodIssueCode.invalid_enum_value:{const $u=Au,Ru=$u.options.map(Iu=>String(Iu)).join(" | ");return`${lo}: Invalid enum value. Expected ${Ru}, received '${String($u.received)}'`}case ZodIssueCode.invalid_type:{const $u=Au;return`${lo}: Expected ${$u.expected}, received ${$u.received}`}case ZodIssueCode.custom:return`${lo}: ${Au.message}`;default:return Au.message?`${lo}: ${Au.message}`:`${lo}: Validation error (${Au.code})`}}const DEFAULT_CATALOG_COMPATIBILITY={"0.8":new Set(["0.8"]),"0.9":new Set(["0.9","0.9.1"]),"0.9.1":new Set(["0.9.1","0.9"]),"1.0":new Set(["1.0"])};function isCatalogVersionCompatible(Au,lo,$u=DEFAULT_CATALOG_COMPATIBILITY){if(!Au||!lo)return!1;const Ru=toCanonicalVersion(Au),Iu=toCanonicalVersion(lo);if(Ru&&Iu){if(Ru===Iu)return!0;const Du=$u[Iu];if(Du&&Du.has(Ru))return!0;const Mu=toSemVer(Au),Lu=toSemVer(lo);return!!(Mu&&Lu&&Mu.major>=1&&Mu.major===Lu.major)}if(typeof Au!="string"||typeof lo!="string")return!1;const Pu=normalizeVersionString(Au),Ou=normalizeVersionString(lo);return Pu.length>0&&Pu===Ou}let globalKnownActionsProvider;function registerKnownActionsProvider(Au){globalKnownActionsProvider=Au}function validateActionSurfaceIds(Au,lo){for(const $u of lo){const Ru=Au[$u];if(Ru&&typeof Ru=="object"){const Iu=Ru;if("surfaceId"in Iu&&Iu.surfaceId!==void 0&&typeof Iu.surfaceId!="string")throw new A2uiValidationError("surfaceId must be a string")}}}class BaseVersionAdapter{get compatibleCatalogVersions(){const lo=toCanonicalVersion(this.version);return lo?new Set([lo]):new Set}get validActions(){return new Set(this.getNativeActionKeys())}isCatalogCompatible(lo){return lo?isCatalogVersionCompatible(lo,this.version):!1}extractOperations(lo){if(!lo||typeof lo!="object")return[];if(Array.isArray(lo))return lo.flatMap(Du=>this.extractOperations(Du));const $u=lo;if(Array.isArray($u.messages))return this.extractOperations($u.messages);const Ru=this.getNativeActionKeys();validateActionSurfaceIds($u,Ru);const Iu=Ru.filter(Du=>Du in $u).sort();if(Iu.length>1)throw new A2uiValidationError(`Message contains multiple conflicting update actions: ${Iu.join(", ")}.`);if(Iu.length===0){const Du=globalKnownActionsProvider?globalKnownActionsProvider():new Set(Ru),Mu=Object.keys($u).find(Bu=>Du.has(Bu)&&!Ru.includes(Bu)),Lu=Ru.slice().sort().join(", ");throw Mu?new A2uiValidationError(`Invalid ${this.version} message: action '${Mu}' is not supported in protocol version ${this.version}. Allowed actions: ${Lu}.`):new A2uiValidationError(`Invalid ${this.version} message: message must contain exactly one update action: ${Lu}.`)}const Pu=this.preparePayloadForValidation($u),Ou=this.schema.safeParse(Pu);if(!Ou.success){const Du=Ou.error.errors.map(formatZodIssue).join("; ");throw new A2uiValidationError(`Invalid ${this.version} message: ${Du}`,Ou.error)}return this.extractOperationsFromObject($u)}preparePayloadForValidation(lo){return"version"in lo?lo:{version:this.version,...lo}}}const exactlyOneKey=(Au,lo)=>{const $u=Object.keys(Au).filter(Ru=>Au[Ru]!==void 0);$u.length!==1&&lo.addIssue({code:ZodIssueCode.custom,message:`Must define exactly one property, found ${$u.length} (${$u.join(", ")}).`})},StringValueSchema=objectType({path:stringType().optional(),literalString:stringType().optional(),literal:stringType().optional()}).strict().superRefine(exactlyOneKey),DataValueMapItemSchema=lazyType(()=>objectType({key:stringType(),valueString:stringType().optional(),valueNumber:numberType().optional(),valueBoolean:booleanType().optional(),valueMap:arrayType(DataValueMapItemSchema).optional()}).strict().superRefine((Au,lo)=>{let $u=0;Au.valueString!==void 0&&$u++,Au.valueNumber!==void 0&&$u++,Au.valueBoolean!==void 0&&$u++,Au.valueMap!==void 0&&$u++,$u!==1&&lo.addIssue({code:ZodIssueCode.custom,message:`Value map item must have exactly one value property (valueString, valueNumber, valueBoolean, valueMap), found ${$u}.`})}));function createDataValueSchema(Au={}){const lo=Au.maxDepth??5;return DataValueMapItemSchema.superRefine(($u,Ru)=>{const Iu=(Pu,Ou)=>{if(Ou>lo){Ru.addIssue({code:ZodIssueCode.custom,message:`valueMap recursion exceeded maximum depth of ${lo}.`});return}if(Pu.valueMap&&Array.isArray(Pu.valueMap))for(const Du of Pu.valueMap)Iu(Du,Ou+1)};Iu($u,1)})}const DataValueSchema=createDataValueSchema();objectType({path:stringType().optional(),literalNumber:numberType().optional(),literal:numberType().optional()}).strict().superRefine(exactlyOneKey);objectType({path:stringType().optional(),literalBoolean:booleanType().optional(),literal:booleanType().optional()}).strict().superRefine(exactlyOneKey);const ActionSchema$1=objectType({name:stringType().describe("A unique name identifying the action (e.g., 'submitForm')."),context:arrayType(objectType({key:stringType(),value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional(),literalNumber:numberType().optional(),literalBoolean:booleanType().optional()}).describe("The dynamic value. Define EXACTLY ONE of the nested properties.").strict().superRefine(exactlyOneKey)})).describe("A key-value map of data bindings to be resolved when the action is triggered.").optional()});objectType({text:StringValueSchema,usageHint:enumType(["h1","h2","h3","h4","h5","caption","body"]).optional()});objectType({url:StringValueSchema,usageHint:enumType(["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]).optional(),fit:enumType(["contain","cover","fill","none","scale-down"]).optional(),altText:StringValueSchema.optional()});objectType({name:StringValueSchema});objectType({url:StringValueSchema});objectType({url:StringValueSchema,description:StringValueSchema.optional().describe("A label, title, or placeholder text.")});objectType({tabItems:arrayType(objectType({title:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional()}),child:stringType().describe("A reference to a component instance by its unique ID.")}).strict().superRefine((Au,lo)=>{Au.title||lo.addIssue({code:ZodIssueCode.custom,message:"Tab item is missing 'title'."}),Au.child||lo.addIssue({code:ZodIssueCode.custom,message:"Tab item is missing 'child'."}),Au.title&&exactlyOneKey(Au.title,lo)})).describe("A list of tabs, each with a title and a child component ID.")});objectType({axis:enumType(["horizontal","vertical"]).optional().describe("The orientation."),color:stringType().optional().describe("The color of the divider (e.g., hex code or semantic name)."),thickness:numberType().optional().describe("The thickness of the divider.")});objectType({entryPointChild:stringType().describe("The ID of the component (e.g., a button) that triggers the modal."),contentChild:stringType().describe("The ID of the component to display as the modal's content.")});objectType({child:stringType().describe("The ID of the component to display as the button's content."),action:ActionSchema$1.describe("Represents a user-initiated action."),primary:booleanType().optional().describe("Indicates if this button should be styled as the primary action.")});objectType({label:StringValueSchema,value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalBoolean:booleanType().optional()}).strict().superRefine(exactlyOneKey)});objectType({text:StringValueSchema.optional(),label:StringValueSchema.describe("A label, title, or placeholder text."),textFieldType:enumType(["shortText","number","date","longText","obscured"]).optional(),validationRegexp:stringType().optional().describe("A regex string to validate the input.")});objectType({value:StringValueSchema,enableDate:booleanType().optional(),enableTime:booleanType().optional(),outputFormat:stringType().optional().describe("The string format for the output (e.g., 'YYYY-MM-DD').")});objectType({selections:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalArray:arrayType(stringType()).optional()}).strict().superRefine(exactlyOneKey),options:arrayType(objectType({label:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional()}).strict().superRefine(exactlyOneKey),value:stringType()})).optional(),maxAllowedSelections:numberType().optional(),type:enumType(["checkbox","chips"]).optional(),filterable:booleanType().optional()});objectType({value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalNumber:numberType().optional()}).strict().superRefine(exactlyOneKey),minValue:numberType().optional(),maxValue:numberType().optional(),label:StringValueSchema.optional()});const ComponentArrayTemplateSchema=objectType({componentId:stringType(),dataBinding:stringType()}),ComponentArrayReferenceSchema=objectType({explicitList:arrayType(stringType()).optional(),template:ComponentArrayTemplateSchema.describe("A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.").optional()}).strict().superRefine(exactlyOneKey);objectType({children:ComponentArrayReferenceSchema,distribution:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({children:ComponentArrayReferenceSchema,distribution:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({children:ComponentArrayReferenceSchema,direction:enumType(["vertical","horizontal"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({child:stringType().describe("The ID of the component to be rendered inside the card.")});const ValueMapSchema=DataValueSchema.describe("A single data entry. Exactly one 'value*' property should be provided alongside the key."),ComponentPropertiesSchema=recordType(anyType()).refine(Au=>Object.keys(Au).length===1,"A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading')."),ComponentInstanceSchema=objectType({id:stringType().describe("The unique identifier for this component."),weight:numberType().optional().describe("The relative weight of this component within a Row or Column. This corresponds to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column."),component:ComponentPropertiesSchema.describe("A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading'). The value is an object containing the properties for that specific component.")}).strict().describe("Represents a *single* component in a UI widget tree. This component could be one of many supported types."),BeginRenderingMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered."),catalogId:stringType().optional().describe("The identifier of the component catalog to use for this surface. If omitted, the client MUST default to the standard catalog for this A2UI version (https://a2ui.org/specification/v0_8/standard_catalog_definition.json)."),root:stringType().describe("The ID of the root component to render."),styles:objectType({font:stringType().optional().describe("The primary font for the UI."),primaryColor:stringType().regex(/^#[0-9a-fA-F]{6}$/).optional().describe("The primary UI color as a hexadecimal code (e.g., '#00BFFF').")}).strict().optional().describe("Styling information for the UI.")}).strict().describe("Signals the client to begin rendering a surface with a root component and specific styles."),SurfaceUpdateMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated. If you are adding a new surface this *must* be a new, unique identified that has never been used for any existing surfaces shown."),components:arrayType(ComponentInstanceSchema).min(1).describe("A list containing all UI components for the surface.")}).strict().superRefine((Au,lo)=>{const $u=new Set;for(const Iu of Au.components)Iu.id&&($u.has(Iu.id)&&lo.addIssue({code:ZodIssueCode.custom,message:`Duplicate component ID found: ${Iu.id}`,path:["components"]}),$u.add(Iu.id));const Ru=(Iu,Pu)=>{for(const Ou of Iu)Ou&&!$u.has(Ou)&&lo.addIssue({code:ZodIssueCode.custom,message:`Component '${Pu}' references non-existent component ID '${Ou}'.`,path:["components"]})};for(const Iu of Au.components){if(!Iu.id||!Iu.component)continue;const Pu=Object.keys(Iu.component);if(Pu.length!==1)continue;const Ou=Pu[0],Du=Iu.component[Ou];switch(Ou){case"Row":case"Column":case"List":if(Du.children&&!Array.isArray(Du.children)){const Mu=!!Du.children.explicitList,Lu=!!Du.children.template;(Mu&&Lu||!Mu&&!Lu)&&lo.addIssue({code:ZodIssueCode.custom,message:`Component '${Iu.id}' must have either 'explicitList' or 'template' in children, but not both or neither.`}),Mu&&Ru(Du.children.explicitList,Iu.id),Lu&&Ru([Du.children.template?.componentId],Iu.id)}break;case"Card":Du.child&&Ru([Du.child],Iu.id);break;case"Tabs":Du.tabItems&&Array.isArray(Du.tabItems)&&Du.tabItems.forEach(Mu=>{Mu.child&&Ru([Mu.child],Iu.id)});break;case"Modal":Ru([Du.entryPointChild,Du.contentChild],Iu.id);break;case"Button":Du.child&&Ru([Du.child],Iu.id);break}}}).describe("Updates a surface with a new set of components."),DataModelUpdateMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to."),path:stringType().optional().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', the entire data model will be replaced."),contents:arrayType(ValueMapSchema).describe("An array of data entries. Each entry must contain a 'key' and exactly one corresponding typed 'value*' property.")}).strict().describe("Updates the data model for a surface."),DeleteSurfaceMessageSchema$2=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted.")}).strict().describe("Signals the client to delete the surface identified by 'surfaceId'."),A2uiMessageSchema$1=objectType({beginRendering:BeginRenderingMessageSchema.optional(),surfaceUpdate:SurfaceUpdateMessageSchema.optional(),dataModelUpdate:DataModelUpdateMessageSchema.optional(),deleteSurface:DeleteSurfaceMessageSchema$2.optional()}).strict().superRefine((Au,lo)=>{Object.keys(Au).filter(Ru=>["beginRendering","surfaceUpdate","dataModelUpdate","deleteSurface"].includes(Ru)).length!==1&&lo.addIssue({code:ZodIssueCode.custom,message:"A2UI Protocol message must have exactly one of: surfaceUpdate, dataModelUpdate, beginRendering, deleteSurface."})}).describe("Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.");function normalizeV08Component(Au){if(!Au||typeof Au!="object")return{id:"",component:""};const lo=Au;let $u=typeof lo.component=="string"?lo.component:"";const Ru={};for(const[Iu,Pu]of Object.entries(lo))Iu!=="component"&&Iu!=="id"&&(Ru[Iu]=Pu);if(lo.component&&typeof lo.component=="object"){const Iu=lo.component,Pu=Object.keys(Iu);if(Pu.length>0){$u=Pu[0];const Ou=Iu[Pu[0]];Ou&&typeof Ou=="object"&&Ou!==null&&!Array.isArray(Ou)&&Object.assign(Ru,Ou)}}return{...Ru,id:String(lo.id??""),component:$u}}class V0Point8Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v0.8",this.schema=A2uiMessageSchema$1}getNativeActionKeys(){return["beginRendering","surfaceUpdate","dataModelUpdate","deleteSurface"]}preparePayloadForValidation(lo){const $u={...lo};return delete $u.version,$u}extractOperationsFromObject(lo){const $u=[];if("beginRendering"in lo){const Ru=lo.beginRendering;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId??""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,theme:Ru?.theme??Ru?.styles,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components.map(normalizeV08Component):void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version,rootId:typeof Ru?.root=="string"&&Ru.root?Ru.root:void 0})}if("surfaceUpdate"in lo){const Ru=lo.surfaceUpdate;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId??""),components:Array.isArray(Ru?.components)?Ru.components.map(normalizeV08Component):[]})}if("dataModelUpdate"in lo){const Ru=lo.dataModelUpdate,Iu=String(Ru?.surfaceId??"");if(Array.isArray(Ru?.contents)){for(const Pu of Ru.contents)if(Pu&&typeof Pu=="object"&&typeof Pu.key=="string"){const Ou="valueNumber"in Pu?Pu.valueNumber:"valueString"in Pu?Pu.valueString:"valueBoolean"in Pu?Pu.valueBoolean:"valueObject"in Pu?Pu.valueObject:"valueArray"in Pu?Pu.valueArray:Pu.value;$u.push({type:"updateDataModel",surfaceId:Iu,path:Pu.key,value:Ou})}}else $u.push({type:"updateDataModel",surfaceId:Iu,path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId??"")})}return $u}}const CreateSurfaceMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),createSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered."),catalogId:stringType().describe("A string that uniquely identifies this catalog. It is recommended to prefix this with an internet domain that you own, to avoid conflicts e.g. mycompany.com:somecatalog'."),theme:anyType().optional(),sendDataModel:booleanType().describe("If true, the client will send the full data model of this surface in the metadata of every A2A message sent to the server that created the surface. Defaults to false.").optional()}).strict().describe("Signals the client to create a new surface and begin rendering it. It is an error to send 'createSurface' for a surfaceId that already exists without first deleting it. When this message is sent, the client will expect 'updateComponents' and/or 'updateDataModel' messages for the same surfaceId that define the component tree.")}).strict(),UpdateComponentsMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),updateComponents:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated."),components:arrayType(recordType(stringType(),anyType())).min(1).describe("A list containing all UI components for the surface.")}).strict().describe("Updates a surface with a new set of components. This message can be sent multiple times to update the component tree of an existing surface. One of the components in one of the components lists MUST have an 'id' of 'root' to serve as the root of the component tree. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),UpdateDataModelMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),updateDataModel:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to."),path:stringType().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', refers to the entire data model.").optional(),value:anyType().describe("The data to be updated in the data model. If present, the value at 'path' is replaced (or created). If omitted, the key at 'path' is removed.").optional()}).strict().describe("Updates the data model for an existing surface. This message can be sent multiple times to update the data model. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),DeleteSurfaceMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),deleteSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted.")}).strict().describe("Signals the client to delete the surface identified by 'surfaceId'. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),A2uiMessageSchema=unionType([CreateSurfaceMessageSchema$1,UpdateComponentsMessageSchema$1,UpdateDataModelMessageSchema$1,DeleteSurfaceMessageSchema$1]),A2uiMessageListSchema=arrayType(A2uiMessageSchema).describe("A list of messages.");objectType({messages:A2uiMessageListSchema}).strict().describe("An object wrapping a list of messages.");class V0Point9Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v0.9",this.schema=A2uiMessageSchema}get compatibleCatalogVersions(){return new Set(["0.9","0.9.1"])}getNativeActionKeys(){return["createSurface","updateComponents","updateDataModel","deleteSurface"]}extractOperationsFromObject(lo){const $u=[];if("createSurface"in lo){const Ru=lo.createSurface;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId||""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,theme:Ru?.theme,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components:void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version})}if("updateComponents"in lo){const Ru=lo.updateComponents;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId||""),components:Array.isArray(Ru?.components)?Ru.components:[]})}if("updateDataModel"in lo){const Ru=lo.updateDataModel;$u.push({type:"updateDataModel",surfaceId:String(Ru?.surfaceId||""),path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId||"")})}return $u}}const INTERNAL_OPERATION_TYPES=["createSurface","updateComponents","updateDataModel","deleteSurface","callRendererFunction","agentFunctionResponse"];function isInternalOperation(Au){return typeof Au=="object"&&Au!==null&&"type"in Au&&typeof Au.type=="string"&&INTERNAL_OPERATION_TYPES.includes(Au.type)}objectType({componentId:lazyType(()=>ComponentIdSchema$1),path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("REF:#/$defs/TemplateChildList|A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.");const AnyComponentSchema=lazyType(()=>ComponentCommonSchema.extend({component:stringType()}).passthrough().refine(Au=>Au.component!=="Surface",{message:'Component type cannot be "Surface". "Surface" is a top-level protocol container defined in createSurface, not a child component.'})),ComponentsListSchema=arrayType(AnyComponentSchema).min(1);recordType(stringType(),anyType());const ComponentIdSchema$1=markChildRef(stringType().describe("REF:#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),CallIdSchema=stringType().describe("REF:#/$defs/CallId|The unique identifier for a function call."),DataBindingSchema$1=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).strict().describe("REF:#/$defs/DataBinding"),FunctionCommonSchema=objectType({call:stringType().describe("The name of the function to call."),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:#/$defs/FunctionCommon|Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog."),FunctionCallSchema$1=recordType(stringType(),anyType()).and(intersectionType(FunctionCommonSchema,anyType())).describe("REF:#/$defs/FunctionCall|Invokes a named function, combining common function properties with the catalog function definition."),DynamicStringSchema$1=unionType([stringType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicString|Represents a string"),DynamicBooleanSchema$1=unionType([booleanType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),AccessibilityAttributesSchema$1=objectType({label:DynamicStringSchema$1.optional(),description:DynamicStringSchema$1.optional(),live:enumType(["off","polite","assertive"]).describe("Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts.").default("off"),hidden:DynamicBooleanSchema$1.optional()}).strict().describe("REF:#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding."),ExtensionsSchema=recordType(stringType(),unknownType()).superRefine((Au,lo)=>{for(const $u in Au)$u.match(/^[\p{XID_Start}_][\p{XID_Continue}:-]*$/u)||lo.addIssue({path:[$u],code:ZodIssueCode.custom,message:`Invalid extension key "${$u}": Keys MUST be Unicode identifiers (UAX #31).`})}).describe("REF:#/$defs/Extensions|Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions."),ComponentCommonSchema=objectType({id:ComponentIdSchema$1,catalogId:stringType().describe("The catalog ID for this component, overriding any surface-level default catalogId.").optional(),accessibility:AccessibilityAttributesSchema$1.optional(),metadata:objectType({extensions:ExtensionsSchema.optional()}).strict().describe("Optional component-level metadata for vendor extensions.").optional()}).describe("REF:#/$defs/ComponentCommon");markChildRef(unionType([arrayType(ComponentIdSchema$1).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema$1,path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.")]).describe("REF:#/$defs/ChildList"),"child-list");const DynamicValueSchema$1=unionType([stringType(),numberType(),booleanType(),arrayType(anyType()),recordType(stringType(),unknownType()).refine(Au=>!Au||!("path"in Au)&&!("call"in Au)),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),DynamicNumberSchema$1=unionType([numberType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.");unionType([arrayType(stringType()),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.");objectType({call:literalType("@index"),args:objectType({offset:DynamicNumberSchema$1.optional()}).optional()}).describe("REF:#/$defs/IndexSystemFunction|Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.");const CheckRuleSchema$1=objectType({condition:unionType([DataBindingSchema$1,FunctionCallSchema$1]).describe("Path or function call evaluating to a structured validation result object."),message:stringType().describe("Optional fallback error message.").optional()}).strict().describe("REF:#/$defs/CheckRule|A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object.");objectType({checks:arrayType(CheckRuleSchema$1).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:#/$defs/Checkable|Properties for components that support renderer-side checks.");unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the agent."),userMessage:DynamicStringSchema$1.optional(),context:recordType(stringType(),DynamicValueSchema$1).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the agent.")}).strict().describe("Triggers an agent-side event."),objectType({functionCall:FunctionCallSchema$1}).strict().describe("Executes a renderer or agent-side function.")]).describe("REF:#/$defs/Action|Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.");objectType({component:literalType("Surface").optional(),child:literalType("root").optional()}).strict().describe("REF:#/$defs/Surface|The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.");const FunctionResponseSchema=objectType({functionCallId:CallIdSchema,value:anyType().describe("The return value of the function.").optional(),error:objectType({code:stringType(),message:stringType()}).strict().describe("An error object indicating failure of the function execution.").optional()}).strict().superRefine((Au,lo)=>{const $u="value"in Au,Ru="error"in Au;($u&&Ru||!$u&&!Ru)&&lo.addIssue({code:ZodIssueCode.custom,message:'FunctionResponse must have either "value" or "error", but not both or neither.'})}).describe("REF:#/$defs/FunctionResponse|The return response matching a callAgentFunction or callRendererFunction invocation."),CreateSurfaceMessageSchema=objectType({version:literalType("v1.0"),createSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered. It must be globally unique for the renderer's lifetime."),catalogId:stringType().describe("A string that uniquely identifies the default catalog for this surface. It is recommended to prefix this with an internet domain that you own, to avoid conflicts e.g. 'mycompany.com:somecatalog'. Components and function calls that do not explicitly specify a catalogId will use this surface-level default catalogId.").optional(),sendDataModel:booleanType().describe("If true, the renderer will send the full data model of this surface in the metadata of every A2A message sent to the agent that created the surface. Defaults to false.").optional(),components:ComponentsListSchema.optional(),dataModel:recordType(stringType(),anyType()).describe("The initial root data model object for the surface.").optional(),metadata:objectType({extensions:ExtensionsSchema.optional()}).strict().describe("Optional surface-level metadata.").optional()}).strict().describe("Signals the renderer to create a new surface and begin rendering it. Creating a surface implicitly instantiates the canonical 'Surface' container component ('common_types.json#/$defs/Surface') with 'child': 'root'. It is an error to try to create a surface with an existing ID without first deleting it; surfaceId MUST be globally unique for the renderer's lifetime. When this message is sent, the renderer expects 'updateComponents' and/or 'updateDataModel' messages for the same surfaceId to define the component tree.")}).strict(),UpdateComponentsMessageSchema=objectType({version:literalType("v1.0"),updateComponents:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated. It must be globally unique for the renderer's lifetime."),components:ComponentsListSchema}).strict().describe("Updates a surface with a new set of components. This message can be sent multiple times to update the component tree of an existing surface. One of the components in one of the components lists MUST have an 'id' of 'root' to serve as the root of the component tree. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),UpdateDataModelMessageSchema=objectType({version:literalType("v1.0"),updateDataModel:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to. It must be globally unique for the renderer's lifetime."),path:stringType().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', refers to the entire data model.").optional(),value:anyType().describe("The data to be updated in the data model. To delete the key/value at 'path', set 'value' explicitly to null.")}).strict().describe("Updates the data model for an existing surface. This message can be sent multiple times to update the data model. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),DeleteSurfaceMessageSchema=objectType({version:literalType("v1.0"),deleteSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted. It must be globally unique for the renderer's lifetime.")}).strict().describe("Signals the renderer to delete the surface identified by 'surfaceId'. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),CallRendererFunctionMessageSchema=objectType({version:literalType("v1.0"),callRendererFunction:objectType({functionCallId:CallIdSchema,callFunction:intersectionType(FunctionCallSchema$1,anyType())}).strict().describe("Signals the renderer to execute a function locally on behalf of the agent.")}).strict(),AgentFunctionResponseMessageSchema=objectType({version:literalType("v1.0"),agentFunctionResponse:FunctionResponseSchema}).strict(),AgentToRendererMessageSchema=unionType([CreateSurfaceMessageSchema,UpdateComponentsMessageSchema,UpdateDataModelMessageSchema,DeleteSurfaceMessageSchema,CallRendererFunctionMessageSchema,AgentFunctionResponseMessageSchema]);class V1Point0Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v1.0",this.schema=AgentToRendererMessageSchema}getNativeActionKeys(){return[...INTERNAL_OPERATION_TYPES]}extractOperationsFromObject(lo){const $u=[];if("createSurface"in lo){const Ru=lo.createSurface;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId||""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components:void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version})}if("updateComponents"in lo){const Ru=lo.updateComponents;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId||""),components:Array.isArray(Ru?.components)?Ru.components:[]})}if("updateDataModel"in lo){const Ru=lo.updateDataModel;$u.push({type:"updateDataModel",surfaceId:String(Ru?.surfaceId||""),path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId||"")})}if("callRendererFunction"in lo){const Ru=lo.callRendererFunction,Iu=Ru?.callFunction||{};$u.push({type:"callRendererFunction",functionCallId:String(Ru?.functionCallId||""),call:String(Iu?.call||""),version:this.version,catalogId:typeof Iu?.catalogId=="string"?Iu.catalogId:void 0,args:Iu?.args&&typeof Iu.args=="object"&&!Array.isArray(Iu.args)?Iu.args:{}})}if("agentFunctionResponse"in lo){const Ru=lo.agentFunctionResponse;$u.push({type:"agentFunctionResponse",functionCallId:String(Ru?.functionCallId||""),version:this.version,value:Ru?.value,error:Ru?.error&&typeof Ru.error=="object"?Ru.error:void 0})}return $u}}class VersionAdapterFactory{constructor(){this.adapters=new Map([["0.8",new V0Point8Adapter],["0.9",new V0Point9Adapter],["0.9.1",new V0Point9Adapter],["1.0",new V1Point0Adapter]])}getAllKnownActions(){const lo=new Set;for(const $u of this.adapters.values())if($u.validActions)for(const Ru of $u.validActions)lo.add(Ru);return lo}registerAdapter(lo){const $u=toCanonicalVersion(lo.version)??normalizeVersionString(lo.version);this.adapters.set($u,lo)}getAdapter(lo){const $u=toCanonicalVersion(lo)??normalizeVersionString(lo),Ru=this.adapters.get($u);if(!Ru){const Iu=Array.from(new Set(Array.from(this.adapters.keys()).map(Pu=>Pu.startsWith("v")?Pu:`v${Pu}`))).sort().join(", ");throw new A2uiValidationError(`[VersionAdapterFactory] Unsupported protocol version '${lo}'. Supported versions: ${Iu}.`)}return Ru}resolveFromPayload(lo){const $u=Array.isArray(lo)?lo[0]:lo;if(typeof $u=="object"&&$u!==null){if("messages"in $u&&Array.isArray($u.messages))return this.resolveFromPayload($u.messages);if("version"in $u){const Ru=$u.version;if(typeof Ru!="string")throw new A2uiValidationError(`[VersionAdapterFactory] Message payload is missing a valid 'version' string: 'version' property must be a string, got ${typeof Ru}.`);return this.getAdapter(Ru)}if("beginRendering"in $u||"surfaceUpdate"in $u||"dataModelUpdate"in $u||"deleteSurface"in $u)return this.getAdapter("v0.8")}throw new A2uiValidationError("[VersionAdapterFactory] Message payload is missing a valid 'version' string.")}static registerAdapter(lo){defaultVersionAdapterFactory.registerAdapter(lo)}static getAdapter(lo){return defaultVersionAdapterFactory.getAdapter(lo)}static resolveFromPayload(lo){return defaultVersionAdapterFactory.resolveFromPayload(lo)}static getAllKnownActions(){return defaultVersionAdapterFactory.getAllKnownActions()}}const defaultVersionAdapterFactory=new VersionAdapterFactory;registerKnownActionsProvider(()=>defaultVersionAdapterFactory.getAllKnownActions());const schemaKeysCache=new WeakMap;function getKnownSchemaKeys(Au){if(schemaKeysCache.has(Au))return schemaKeysCache.get(Au);const lo=(()=>{let $u=Au;for(;$u;){if($u instanceof ZodObject||$u._def?.typeName==="ZodObject"){if($u._def?.unknownKeys==="passthrough")return null;const Ru=typeof $u.shape=="function"?$u.shape():$u.shape;return Ru&&typeof Ru=="object"?new Set(Object.keys(Ru)):null}if($u instanceof ZodEffects||$u._def?.typeName==="ZodEffects"){$u=$u._def.schema;continue}if($u instanceof ZodOptional||$u instanceof ZodNullable||$u._def?.typeName==="ZodOptional"||$u._def?.typeName==="ZodNullable"){$u=$u._def.innerType;continue}if($u instanceof ZodDefault||$u._def?.typeName==="ZodDefault"){$u=$u._def.innerType;continue}if($u instanceof ZodCatch||$u._def?.typeName==="ZodCatch"){$u=$u._def.innerType;continue}if($u instanceof ZodIntersection||$u._def?.typeName==="ZodIntersection"){const Ru=getKnownSchemaKeys($u._def.left),Iu=getKnownSchemaKeys($u._def.right);return!Ru||!Iu?null:new Set([...Ru,...Iu])}if($u instanceof ZodUnion||$u._def?.typeName==="ZodUnion"){const Ru=$u._def.options,Iu=new Set;for(const Pu of Ru){const Ou=getKnownSchemaKeys(Pu);if(!Ou)return null;for(const Du of Ou)Iu.add(Du)}return Iu}return null}return null})();return schemaKeysCache.set(Au,lo),lo}function validateFunctionArgs(Au,lo,$u){if(!lo||typeof lo!="object"||Array.isArray(lo))return;const Ru=Object.keys(lo);if(Ru.length>MAX_FUNCTION_CALL_ARGS)throw new A2uiExpressionError(`Function call '${Au}' exceeds maximum allowed arguments count (${MAX_FUNCTION_CALL_ARGS})`,Au);const Iu=$u?.functions?.get?.(Au);if(!Iu?.schema)return;const Pu=getKnownSchemaKeys(Iu.schema);if(Pu){for(const Ou of Ru)if(!Pu.has(Ou))throw new A2uiExpressionError(`Unknown argument '${Ou}' passed to function '${Au}'`,Au);if(Ru.length>Pu.size)throw new A2uiExpressionError(`Too many arguments for function '${Au}': expected at most ${Pu.size}, received ${Ru.length}`,Au)}}function resolveContextIndex(Au){let lo=Au;for(;lo;){if(lo.explicitIndex!==void 0&&Number.isFinite(lo.explicitIndex))return lo.explicitIndex;if(!(lo instanceof DataContext)&&typeof lo.getIndex=="function"){const $u=lo.getIndex();if($u!==void 0&&Number.isFinite($u))return $u}if(!(lo instanceof DataContext)&&typeof lo.index=="number"&&Number.isFinite(lo.index))return lo.index;if(typeof lo.path=="string"){const $u=lo.path.split("/").filter(Boolean);if($u.length>0&&/^\d+$/.test($u[$u.length-1]))return parseInt($u[$u.length-1],10)}lo=lo.parent}}const MAX_DYNAMIC_VALUE_DEPTH=1e3;class DataContext{constructor(lo,$u,Ru,Iu){this.surface=lo,this.path=$u,this.dataModel=lo.dataModel,this.functionInvoker=lo.defaultCatalog.invoker,this.explicitIndex=Ru,this.parent=Iu,this.warnedPaths=Iu?Iu.warnedPaths:new Set}getIndex(){return resolveContextIndex(this)}get index(){return this.getIndex()}set(lo,$u){const Ru=this.resolvePath(lo);this.dataModel.set(Ru,$u)}static isDataBindingObject(lo){return"path"in lo&&typeof lo.path=="string"&&!("componentId"in lo)}static isFunctionCallObject(lo){return"call"in lo&&typeof lo.call=="string"}static containsDynamicValue(lo){if(lo===null||typeof lo!="object")return!1;if(Array.isArray(lo))return lo.some(Ru=>DataContext.containsDynamicValue(Ru));const $u=lo;return DataContext.isDataBindingObject($u)||DataContext.isFunctionCallObject($u)?!0:Object.values($u).some(Ru=>DataContext.containsDynamicValue(Ru))}emitMissingDataBindingWarning(lo){typeof this.dataModel?.hasPath=="function"&&!this.dataModel.hasPath(lo)&&!this.warnedPaths.has(lo)&&(this.warnedPaths.add(lo),this.surface?.dispatchWarning?.({code:"MISSING_DATA_BINDING",path:lo,message:`Preflight DataBinding Warning: The bound JSON Pointer '${lo}' does not physically exist in the active DataModel. Evaluating to None.`}))}resolveDynamicValue(lo,$u=0){if($u>MAX_DYNAMIC_VALUE_DEPTH){const Iu=new A2uiExpressionError(`Maximum dynamic value nesting depth exceeded (${MAX_DYNAMIC_VALUE_DEPTH})`);this.dispatchExpressionError(Iu,"DynamicValue");return}if(lo===null||typeof lo!="object")return lo;if(Array.isArray(lo))return DataContext.containsDynamicValue(lo)?lo.map(Iu=>this.resolveDynamicValue(Iu,$u+1)):lo;const Ru=lo;if(DataContext.isDataBindingObject(Ru)){const Iu=this.resolvePath(lo.path),Pu=this.dataModel.get(Iu);return Pu===void 0&&this.emitMissingDataBindingWarning(Iu),Pu}return DataContext.isFunctionCallObject(Ru)?this.resolveFunctionCallValue(lo,$u):this.resolvePlainObjectValue(Ru,$u)}resolveFunctionCallValue(lo,$u=0){let Ru;try{Ru=this.resolveFunctionCatalog(lo.catalogId),validateFunctionArgs(lo.call,lo.args,Ru)}catch(Du){this.dispatchExpressionError(Du,lo.call);return}const Iu={};for(const[Du,Mu]of Object.entries(lo.args??{}))Iu[Du]=this.resolveDynamicValue(Mu,$u+1);const Pu=new AbortController,Ou=this.evaluateFunctionReactive(lo.call,Iu,Pu.signal,lo.catalogId,Ru.invoker);if(Ou!==void 0)return isSignal(Ou)?peekValue(Ou):Ou}resolvePlainObjectValue(lo,$u=0){if(!DataContext.containsDynamicValue(lo))return lo;const Ru={};for(const[Iu,Pu]of Object.entries(lo))Ru[Iu]=this.resolveDynamicValue(Pu,$u+1);return Ru}subscribeDynamicValue(lo,$u){const Ru=this.resolveSignal(lo);let Iu=!0,Pu=peekValue(Ru);const Ou=effect(()=>{const Du=getValue(Ru);Pu=Du,Iu||$u(Du)});return Iu=!1,{get value(){return Pu},unsubscribe:()=>{Ou(),Ru.unsubscribe?.()}}}resolveSignal(lo,$u=0){if($u>MAX_DYNAMIC_VALUE_DEPTH){const Du=new A2uiExpressionError(`Maximum dynamic value nesting depth exceeded (${MAX_DYNAMIC_VALUE_DEPTH})`);return this.dispatchExpressionError(Du,typeof lo=="object"&&lo&&"call"in lo?lo.call:"DynamicValue"),signal(void 0)}if(typeof lo!="object"||lo===null)return signal(lo);if(Array.isArray(lo)){if(!DataContext.containsDynamicValue(lo))return signal(lo);const Du=lo.map(Lu=>this.resolveSignal(Lu,$u+1)),Mu=computed(()=>Du.map(Lu=>getValue(Lu)));return Mu.unsubscribe=()=>{for(const Lu of Du)Lu.unsubscribe?.()},Mu}const Ru=lo;if(DataContext.isDataBindingObject(Ru)){const Du=this.resolvePath(lo.path);return this.emitMissingDataBindingWarning(Du),this.dataModel.getSignal(Du)}if(DataContext.isFunctionCallObject(Ru)){const Du=lo;let Mu;try{Mu=this.resolveFunctionCatalog(Du.catalogId),validateFunctionArgs(Du.call,Du.args,Mu)}catch(Vu){return this.dispatchExpressionError(Vu,Du.call),signal(void 0)}const Lu={};for(const[Vu,Gu]of Object.entries(Du.args??{}))Lu[Vu]=this.resolveSignal(Gu,$u+1);if(Object.keys(Lu).length===0){const Vu=new AbortController,Gu=this.evaluateFunctionReactive(Du.call,{},Vu.signal,Du.catalogId,Mu.invoker),Wu=isSignal(Gu)?Gu:signal(Gu);return Wu.unsubscribe=()=>Vu.abort(),Wu}const Bu=Object.keys(Lu),ju=signal(void 0);let Fu,zu;const Uu=computed(()=>{const Vu={};for(let Gu=0;Gu<Bu.length;Gu++)Vu[Bu[Gu]]=getValue(Lu[Bu[Gu]]);return Vu}),Hu=effect(()=>{try{const Vu=getValue(Uu);Fu&&Fu.abort(),zu&&(zu(),zu=void 0),Fu=new AbortController;const Gu=this.evaluateFunctionReactive(Du.call,Vu,Fu.signal,Du.catalogId,Mu.invoker);isSignal(Gu)?zu=effect(()=>{setValue(ju,getValue(Gu))}):setValue(ju,Gu)}catch(Vu){this.dispatchExpressionError(Vu,Du.call),setValue(ju,void 0)}});return ju.unsubscribe=()=>{Hu(),zu&&zu(),Fu&&Fu.abort();for(let Vu=0;Vu<Bu.length;Vu++)Lu[Bu[Vu]].unsubscribe?.()},ju}if(!DataContext.containsDynamicValue(Ru))return signal(lo);const Iu=Object.entries(Ru).map(([Du,Mu])=>[Du,this.resolveSignal(Mu)]),Pu=computed(()=>{const Du={};for(const[Mu,Lu]of Iu)Du[Mu]=getValue(Lu);return Du}),Ou=Pu.unsubscribe?.bind(Pu);return Pu.unsubscribe=()=>{Ou?.();for(const[,Du]of Iu)Du.unsubscribe?.()},Pu}resolveAction(lo){if("event"in lo){const $u={};if(lo.event.context)for(const[Ru,Iu]of Object.entries(lo.event.context))$u[Ru]=this.resolveDynamicValue(Iu);return{event:{...lo.event,context:$u}}}return"functionCall"in lo?this.resolveDynamicValue(lo.functionCall):lo}resolveFunctionCatalog(lo){if(lo===void 0)return this.surface.defaultCatalog;const $u=this.surface.availableCatalogs?.get(lo);if(!$u)throw new A2uiCatalogError(`Catalog not found: ${lo}`);return $u}evaluateFunctionReactive(lo,$u,Ru,Iu,Pu){const Ou=Pu??(Iu===void 0?this.functionInvoker:this.resolveFunctionCatalog(Iu).invoker);try{return Ou(lo,$u,this,Ru)}catch(Du){this.dispatchExpressionError(Du,lo);return}}dispatchExpressionError(lo,$u){if(lo instanceof ZodError||typeof lo=="object"&&lo!==null&&lo.name==="ZodError"){const Ru=lo,Iu=new A2uiExpressionError(`Validation failed for function '${$u}': ${Ru.message}`,$u,Ru.errors??Ru.issues);this.surface.dispatchError({code:"EXPRESSION_ERROR",message:Iu.message,expression:$u,details:Iu.details})}else if(lo instanceof A2uiExpressionError)this.surface.dispatchError({code:"EXPRESSION_ERROR",message:lo.message,expression:lo.expression,details:lo.details});else{const Ru=typeof lo=="object"&&lo!==null?lo:{};this.surface.dispatchError({code:"EXPRESSION_ERROR",message:Ru.message??`An unexpected error occurred in function ${$u}.`,expression:$u})}}nested(lo,$u){const Ru=this.resolvePath(lo);return new DataContext(this.surface,Ru,$u,this)}resolvePath(lo){if(lo.startsWith("/"))return lo;if(lo===""||lo===".")return this.path;let $u=this.path;return $u.endsWith("/")&&$u.length>1&&($u=$u.slice(0,-1)),$u==="/"&&($u=""),`${$u}/${lo}`}}const IndexApi={name:"@index",returnType:"number",allowedCallers:"rendererOnly",schema:objectType({offset:coerce.number().optional()})};createFunctionImplementation(IndexApi,(Au,lo)=>{const $u=typeof Au.offset=="number"&&Number.isFinite(Au.offset)?Au.offset:0,Ru=resolveContextIndex(lo);if(Ru===void 0||!Number.isFinite(Ru))throw new A2uiValidationError("@index function can only be evaluated inside a collection template iteration scope.");return Ru+$u});const COMPONENT_ENVELOPE_KEYS=["id","component","catalogId","catalogID"];class PayloadValidator{constructor(lo,$u){this.catalog=lo,this.config=$u,this.enforceIdentifiers=isAtLeastVersion(lo.protocolVersion,"1.0")}get allowUnknown(){return this.config?this.config.allowUnknownElements??!1:!0}validateComponent(lo,$u){const Ru=lo.id;if(typeof Ru!="string"||!Ru)throw new A2uiValidationError(`Component '${lo.component}' is missing an 'id'; entries require a valid string 'id'.`);this.assertIdentifier(Ru,`Component id '${Ru}' must be a valid UAX #31 identifier`);const Iu=lo.component,Pu=typeof Iu=="string"?Iu:$u;if(!Pu)throw new A2uiValidationError(`Cannot create component ${Ru} without a type.`);const Ou=this.catalog.components.get(Pu);if(!Ou){if(!this.allowUnknown)throw new A2uiValidationError(`Unknown component type '${Pu}' not found in catalog '${this.catalog.id}'.`);return}const Du=stripEnvelopeKeys(lo),Mu=Ou.schema.safeParse(Du);if(!Mu.success){const Lu=Mu.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for component '${Pu}' (${Ru}): ${Lu}`,Mu.error.issues)}this.validateNestedFunctions(Du)}assertFunctionIdentifiers(lo,$u){if(this.assertIdentifier(lo,`Function name '${lo}' must be a valid UAX #31 identifier`),$u&&typeof $u=="object"&&!Array.isArray($u)){const Ru=Object.keys($u);if(Ru.length>MAX_FUNCTION_CALL_ARGS)throw new A2uiValidationError(`Function call '${lo}' exceeds maximum allowed arguments count (${MAX_FUNCTION_CALL_ARGS})`);for(const Iu of Ru)this.assertIdentifier(Iu,`Function argument '${Iu}' in function '${lo}' must be a valid UAX #31 identifier`)}}validateNestedFunctions(lo){if(Array.isArray(lo)){for(const Iu of lo)this.validateNestedFunctions(Iu);return}if(typeof lo!="object"||lo===null)return;const $u=lo,Ru=$u.call??$u.function;if(typeof Ru=="string"&&Ru.length>0){const Iu=$u.args,Pu=Iu!==void 0?Iu:{},Ou=typeof $u.catalogId=="string"&&$u.catalogId.length>0?$u.catalogId:void 0;Ou&&Ou!==this.catalog.id?this.assertFunctionIdentifiers(Ru,Pu):this.validateFunction(Ru,Pu)}for(const[Iu,Pu]of Object.entries($u))Iu!=="id"&&Iu!=="component"&&this.validateNestedFunctions(Pu)}validateFunction(lo,$u){this.assertFunctionIdentifiers(lo,$u);const Ru=this.catalog.functions.get(lo)??(this.enforceIdentifiers&&lo==="@index"?IndexApi:void 0);if(!Ru){if(!this.allowUnknown)throw new A2uiValidationError(`Unrecognized function '${lo}'`);return $u??{}}if(!Ru.schema){if($u!==void 0&&(typeof $u!="object"||$u===null||Array.isArray($u)))throw new A2uiValidationError(`Validation failed for function '${lo}': Expected object, received ${Array.isArray($u)?"array":typeof $u}`);return $u??{}}const Iu=Ru.schema.safeParse($u??{});if(!Iu.success){const Pu=Iu.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for function '${lo}': ${Pu}`,Iu.error.issues)}return Iu.data}validateTheme(lo){const $u=this.catalog.themeSchema;if(!$u)return lo;const Ru=$u.safeParse(lo);if(!Ru.success){const Iu=Ru.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for theme: ${Iu}`,Ru.error.issues)}return Ru.data}assertIdentifier(lo,$u){if(this.enforceIdentifiers&&!isValidUax31Identifier(lo))throw new A2uiValidationError($u)}}function stripEnvelopeKeys(Au){const lo={};for(const[$u,Ru]of Object.entries(Au))COMPONENT_ENVELOPE_KEYS.includes($u)||(lo[$u]=Ru);return lo}class RpcHandler{constructor(lo,$u){if(this.pendingAgentCalls=new Map,this.isDisposed=!1,Array.isArray(lo))this.catalogs=lo,this.outboundListener=$u,this.defaultTimeoutMs=3e4;else{const Ru=lo??{};this.catalogs=Ru.catalogs??[],this.outboundListener=Ru.outboundListener,this.defaultTimeoutMs=Ru.defaultTimeoutMs??3e4}}get disposed(){return this.isDisposed}async handleCallRendererFunction(lo,$u,Ru=!1){const Iu=this.validateInboundMessage(lo);if(Iu)return await this.emitOutboundResponse(Iu),Iu;const{version:Pu,callRendererFunction:Ou}=lo,{functionCallId:Du,callFunction:Mu}=Ou,{call:Lu,catalogId:Bu,args:ju}=Mu,Fu=this.resolveFunctionImplementation(Bu,Lu,$u,Pu);if("error"in Fu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,Fu.error,Pu);return await this.emitOutboundResponse(Vu),Vu}const zu=this.checkExecutionPermissions(Fu.funcImpl,Lu,Ru);if(zu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,zu,Pu);return await this.emitOutboundResponse(Vu),Vu}const Uu=this.parseArguments(Fu.catalog,Fu.funcImpl,ju,Lu);if("error"in Uu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,Uu.error,Pu);return await this.emitOutboundResponse(Vu),Vu}const Hu=await this.executeFunctionSafely(Fu.funcImpl,Uu.args,$u,Du,Pu);return await this.emitOutboundResponse(Hu),Hu}handleAgentFunctionResponse(lo){if(!lo||!lo.agentFunctionResponse)return;const{functionCallId:$u,value:Ru,error:Iu}=lo.agentFunctionResponse,Pu=this.pendingAgentCalls.get($u);if(Pu)if(this.pendingAgentCalls.delete($u),Iu){const Ou=Iu.code??RpcErrorCode.UNKNOWN_ERROR,Du=Iu.message??"Agent function execution failed";Pu.reject(new A2uiRpcError(Du,Ou,$u,Iu))}else Pu.resolve(Ru)}callAgentFunction(lo,$u,Ru){if(this.isDisposed)return Promise.reject(new A2uiRpcError("RpcHandler has been disposed.",RpcErrorCode.DISPOSED));if(!this.outboundListener)return Promise.reject(new A2uiRpcError("Cannot call agent function without outboundListener configured.",RpcErrorCode.NO_LISTENER));if(!$u||!$u.call)return Promise.reject(new A2uiRpcError("Missing or invalid function call name.",RpcErrorCode.INVALID_FUNCTION_CALL));const Iu=Ru??{},Pu=Iu.functionCallId??this.generateFunctionCallId(),Ou=Iu.timeoutMs??this.defaultTimeoutMs;if(this.pendingAgentCalls.has(Pu))return Promise.reject(new A2uiRpcError(`A call with functionCallId '${Pu}' is already pending.`,RpcErrorCode.DUPLICATE,Pu));const Du={functionCallId:Pu,call:$u,effectiveTimeoutMs:Ou,version:Iu.version};return this.dispatchAgentCall(lo,Du)}dispose(){if(!this.isDisposed){this.isDisposed=!0;for(const[lo,$u]of this.pendingAgentCalls.entries())$u.reject(new A2uiRpcError(`RpcHandler disposed while call '${lo}' was pending.`,RpcErrorCode.CANCELLED,lo));this.pendingAgentCalls.clear()}}async emitOutboundResponse(lo){if(this.outboundListener)try{const $u=this.outboundListener(lo);$u&&typeof $u.catch=="function"&&await $u}catch{}}validateInboundMessage(lo){if(!lo)return this.createResponseError("unknown",RpcErrorCode.INVALID_FUNCTION_CALL,"Inbound message is null or undefined.","unknown");const $u=lo.version;return this.isDisposed?this.createResponseError(lo.callRendererFunction?.functionCallId??"unknown",RpcErrorCode.DISPOSED,"RpcHandler has been disposed.",$u):lo.callRendererFunction?.callFunction?null:this.createResponseError(lo.callRendererFunction?.functionCallId??"unknown",RpcErrorCode.INVALID_FUNCTION_CALL,"Malformed message: missing callRendererFunction or callFunction.",$u)}resolveFunctionImplementation(lo,$u,Ru,Iu){let Pu;if(lo){if(Pu=this.catalogs.find(Du=>Du.id===lo),!Pu)return{error:`Catalog not found: ${lo}`}}else Ru?.surface?.defaultCatalog&&(Pu=Ru.surface.defaultCatalog);if(!Pu)return{error:"No catalog available for function resolution."};if(Pu.protocolVersion&&Iu&&!isCatalogVersionCompatible(Pu.protocolVersion,Iu))return{error:`Catalog '${Pu.id}' specification version (${Pu.protocolVersion}) does not match message protocol version (${Iu}).`};const Ou=Pu.functions?.get($u);return Ou?{funcImpl:Ou,catalog:Pu}:{error:`Function not found: ${$u}`}}checkExecutionPermissions(lo,$u,Ru){const Iu=lo.allowedCallers??"rendererOnly";return Iu==="rendererOrAgent"||Iu==="agentOnly"?lo.requiresUserActivation&&!Ru?`Function '${$u}' requires user activation context to execute.`:null:`Function '${$u}' cannot be called by agent (allowedCallers is ${Iu}).`}parseArguments(lo,$u,Ru,Iu){try{return{args:new PayloadValidator(lo,{allowUnknownElements:!1}).validateFunction(Iu,Ru)}}catch(Pu){const Ou=this.extractErrorMessage(Pu);return{error:`Invalid function arguments for '${Iu}': ${Ou}`}}}async executeFunctionSafely(lo,$u,Ru,Iu,Pu){const Ou=Pu||"v1.0";try{const Du=await Promise.resolve(lo.execute($u,Ru)),Mu=isSignal(Du)?getValue(Du):Du;return{version:Ou,rendererFunctionResponse:{functionCallId:Iu,value:Mu!==void 0?Mu:null}}}catch(Du){const Mu=this.extractErrorMessage(Du);return{version:Ou,rendererFunctionResponse:{functionCallId:Iu,error:{code:RpcErrorCode.EXECUTION_ERROR,message:Mu||"An error occurred during function execution."}}}}}generateFunctionCallId(){if(typeof globalThis.crypto?.randomUUID=="function")return globalThis.crypto.randomUUID();const lo=Math.random().toString(36).substring(2,15).padEnd(13,"0");return`call-${Date.now()}-${lo}`}dispatchAgentCall(lo,$u){const{functionCallId:Ru,call:Iu,effectiveTimeoutMs:Pu,version:Ou}=$u;return new Promise((Du,Mu)=>{let Lu;const Bu=()=>{Lu&&(clearTimeout(Lu),Lu=void 0),this.pendingAgentCalls.delete(Ru)};Lu=this.createTimeoutTimer(Ru,Iu.call,Pu,Bu,Mu),this.pendingAgentCalls.set(Ru,{resolve:ju=>{Bu(),Du(ju)},reject:ju=>{Bu(),Mu(ju)}}),this.sendOutboundMessage(lo,Ru,Iu,Ou,Bu,Mu)})}createTimeoutTimer(lo,$u,Ru,Iu,Pu){if(!(Ru<=0))return setTimeout(()=>{this.pendingAgentCalls.delete(lo)&&(Iu(),Pu(new A2uiRpcError(`Agent function call '${$u}' timed out after ${Ru}ms.`,RpcErrorCode.TIMEOUT,lo)))},Ru)}sendOutboundMessage(lo,$u,Ru,Iu,Pu,Ou){const Du={version:Iu||"v1.0",callAgentFunction:{surfaceId:lo,functionCallId:$u,callFunction:Ru}};try{const Mu=this.outboundListener(Du);Mu&&typeof Mu.catch=="function"&&Mu.catch(Lu=>{Pu(),Ou(Lu)})}catch(Mu){Pu(),Ou(Mu)}}extractErrorMessage(lo){return lo instanceof Error?lo.message:String(lo)}createResponseError(lo,$u,Ru,Iu){return{version:Iu||"v1.0",rendererFunctionResponse:{functionCallId:lo,error:{code:$u,message:Ru}}}}}class MessageProcessor{constructor(lo,$u,Ru){this.catalogs=lo,this.actionHandler=$u,this.model=new SurfaceGroupModel,this.adapterRegistry=Ru?.adapterRegistry??defaultVersionAdapterFactory,this.rpc=new RpcHandler({catalogs:this.catalogs,outboundListener:Ru?.outboundListener,defaultTimeoutMs:Ru?.defaultTimeoutMs}),Ru?.validationConfig?this.validationConfig={allowOrphanComponents:!1,allowDanglingReferences:!1,allowMissingRoot:!1,allowUnknownElements:!1,...Ru.validationConfig}:this.validationConfig=void 0,this.actionHandler&&this.model.onAction.subscribe(this.actionHandler)}callAgentFunction(lo,$u,Ru){return this.rpc.callAgentFunction(lo,$u,Ru)}dispose(){this.rpc.dispose()}getRendererCapabilities(lo){if(!lo?.versions||lo.versions.length===0)throw new A2uiValidationError("At least one protocol version must be provided in CapabilitiesOptions to generate renderer capabilities.");const $u=lo.versions,Ru={};for(const Iu of $u){const Pu={supportedCatalogIds:this.catalogs.map(Du=>Du.id)},Ou=lo?.includeInlineCatalogs?this.catalogs.map(Du=>compareSemVer(Iu,"1.0")>=0?generateCatalogSchema(Du,{componentEnvelopeRef:lo?.componentEnvelopeRef,protocolVersion:Iu}):this.generateLegacyInlineCatalog(Du,lo?.componentEnvelopeRef??"common_types.json#/$defs/ComponentCommon")):void 0;Ou&&(Pu.inlineCatalogs=Ou),Ru[Iu]=Pu}return Ru}getClientCapabilities(lo){return this.getRendererCapabilities(lo)}generateLegacyInlineCatalog(lo,$u="common_types.json#/$defs/ComponentCommon"){const Ru=generateCatalogSchema(lo,{componentEnvelopeRef:$u}),Iu=Ru.components||{},Pu=Ru.functions,Ou=[];for(const Lu of lo.functions.values()){const Bu=Pu?.[Lu.name];Ou.push({name:Lu.name,description:Lu.description,returnType:Lu.returnType,parameters:Bu?.properties?.args??{type:"object",properties:{}}})}const Mu=Ru.$defs?.theme?.properties;return{catalogId:lo.id,components:Iu,...Ou.length>0?{functions:Ou}:{},...Mu?{theme:Mu}:{}}}getRendererDataModel(lo){const $u=Array.from(this.model.surfacesMap.values()).filter(Ou=>Ou.sendDataModel);if($u.length===0)return;if(lo!==void 0){const Ou={};for(const Du of $u){const Mu=Du.defaultCatalog?.protocolVersion;(!Mu||isCatalogVersionCompatible(Mu,lo))&&(Ou[Du.id]=Du.dataModel.get("/"))}return Object.keys(Ou).length===0?void 0:{version:lo,surfaces:Ou}}const Ru=new Set;for(const Ou of $u)if(Ou.defaultCatalog?.protocolVersion){const Du=toCanonicalVersion(Ou.defaultCatalog.protocolVersion),Mu=Du?`v${Du}`:Ou.defaultCatalog.protocolVersion;Ru.add(Mu)}if(Ru.size>1)throw new A2uiValidationError(`Multiple protocol versions detected among active surfaces: ${Array.from(Ru).sort().join(", ")}. Specify a target protocol version in getRendererDataModel(version).`);const Iu=Ru.size===1?Ru.values().next().value:"v1.0",Pu={};for(const Ou of $u)Pu[Ou.id]=Ou.dataModel.get("/");return{version:Iu,surfaces:Pu}}getClientDataModel(lo){return this.getRendererDataModel(lo)}resolvePath(lo,$u){return DataModel.resolvePath(lo,$u)}getSurfaces(){return this.model.surfacesMap}getSurface(lo){return this.model.getSurface(lo)}onSurfaceCreated(lo){return this.model.onSurfaceCreated.subscribe(lo)}onSurfaceDeleted(lo){return this.model.onSurfaceDeleted.subscribe(lo)}processMessages(lo,$u){const Ru=this.prepareOperations(lo);for(const Iu of Ru)this.processOperation(Iu,$u)}async processMessagesAsync(lo,$u){const Ru=this.prepareOperations(lo),Iu=[];for(const Pu of Ru){const Ou=await this.processOperationAsync(Pu,$u);Ou&&Iu.push(Ou)}return Iu}prepareOperations(lo){return!lo||Array.isArray(lo)&&lo.length===0?[]:(this.validationConfig&&validateRecursionAndPaths(lo),this.validationConfig?.targetVersion&&this.validateTargetVersion(lo),isInternalOperation(lo)?[lo]:this.adapterRegistry.resolveFromPayload(lo).extractOperations(lo))}validateTargetVersion(lo){const $u=this.validationConfig?.targetVersion;if(!$u)return;const Ru=Iu=>{if(typeof Iu=="object"&&Iu!==null&&"version"in Iu){const Pu=Iu.version;if(Pu){const Ou=toCanonicalVersion(Pu)??Pu,Du=toCanonicalVersion($u)??$u;if(Ou!==Du)throw new A2uiValidationError(`Message version '${Pu}' does not match expected target version '${$u}'`)}}};if(Array.isArray(lo))for(const Iu of lo)Ru(Iu);else Ru(lo)}applyStateOperation(lo){if(this.validationConfig?.allowedMessages&&!this.validationConfig.allowedMessages.includes(lo.type))throw new A2uiValidationError(`Operation '${lo.type}' is not permitted by ValidationConfig.allowedMessages`);switch(lo.type){case"createSurface":this.processCreateSurfaceOp(lo);break;case"deleteSurface":this.processDeleteSurfaceOp(lo);break;case"updateComponents":this.processUpdateComponentsOp(lo);break;case"updateDataModel":this.processUpdateDataModelOp(lo);break;case"agentFunctionResponse":this.rpc.handleAgentFunctionResponse({version:lo.version??"v1.0",agentFunctionResponse:{functionCallId:lo.functionCallId,value:lo.value,error:lo.error}});break}}resolveRpcDataContext(lo){const $u=(lo.catalogId?this.catalogs.find(Ou=>Ou.id===lo.catalogId):void 0)??this.catalogs[0],Ru=(lo.catalogId?Array.from(this.model.surfacesMap.values()).find(Ou=>Ou.defaultCatalog?.id===lo.catalogId||Ou.availableCatalogs?.has(lo.catalogId)):void 0)??this.model.surfacesMap.values().next().value;if(Ru)return new DataContext(Ru,"/");const Iu=`_rpc_fallback_${lo.functionCallId||"default"}`,Pu=new Map;for(const Ou of this.catalogs)$u?.protocolVersion&&Ou.protocolVersion&&isCatalogVersionCompatible($u.protocolVersion,Ou.protocolVersion)&&Pu.set(Ou.id,Ou);return $u&&Pu.set($u.id,$u),new DataContext(new SurfaceModel(Iu,$u,Pu),"/")}processOperation(lo,$u){if(lo.type==="callRendererFunction"){const Ru=this.resolveRpcDataContext(lo),Iu=$u?.isUserActivated??lo.isUserActivated??!1,Pu={version:lo.version??"v1.0",callRendererFunction:{functionCallId:lo.functionCallId,callFunction:{call:lo.call,catalogId:lo.catalogId,args:lo.args}}};this.rpc.handleCallRendererFunction(Pu,Ru,Iu).catch(Ou=>{console.error(`Unhandled error in callRendererFunction (${lo.call}):`,Ou)});return}this.applyStateOperation(lo)}async processOperationAsync(lo,$u){if(lo.type==="callRendererFunction"){const Ru=this.resolveRpcDataContext(lo),Iu=$u?.isUserActivated??lo.isUserActivated??!1,Pu={version:lo.version??"v1.0",callRendererFunction:{functionCallId:lo.functionCallId,callFunction:{call:lo.call,catalogId:lo.catalogId,args:lo.args}}};return await this.rpc.handleCallRendererFunction(Pu,Ru,Iu)}return this.applyStateOperation(lo),null}processCreateSurfaceOp(lo){const{surfaceId:$u,catalogId:Ru,theme:Iu,sendDataModel:Pu,components:Ou,dataModel:Du}=lo,Mu=Ru!==void 0?this.catalogs.find(zu=>zu.id===Ru):this.catalogs[0];if(!Mu)throw new A2uiStateError(`Catalog not found: ${Ru}`);const Lu=lo.version;if(Mu.protocolVersion&&Lu&&!isCatalogVersionCompatible(Mu.protocolVersion,Lu))throw new A2uiValidationError(`Surface '${$u}' catalog '${Ru??Mu.id}' specification version (${Mu.protocolVersion}) does not match message protocol version (${Lu}).`);if(this.model.getSurface($u))throw new A2uiStateError(`Surface ${$u} already exists.`);let Bu=Iu;if(Iu&&Mu.themeSchema)try{Bu=new PayloadValidator(Mu,this.validationConfig).validateTheme(Iu)}catch(zu){throw zu instanceof A2uiValidationError?new A2uiValidationError(zu.message.replace(/^Validation failed for theme:/,`Validation failed for theme on surface '${$u}':`),zu.details):zu}const ju=new Map(this.catalogs.filter(zu=>isCatalogVersionCompatible(zu.protocolVersion,Mu.protocolVersion)).map(zu=>[zu.id,zu])),Fu=new SurfaceModel($u,Mu,ju,Bu,Pu??!1,void 0,lo.rootId??"root");this.model.addSurface(Fu),Du&&Fu.dataModel.set("/",Du),Ou&&Ou.length>0&&this.processUpdateComponentsOp({type:"updateComponents",surfaceId:$u,components:Ou})}processDeleteSurfaceOp(lo){lo.surfaceId&&this.model.deleteSurface(lo.surfaceId)}validateComponentProperties(lo,$u){const{id:Ru,component:Iu}=lo,Pu=lo.catalogId??lo.catalogID;if(typeof Ru!="string"||!Ru)throw new A2uiValidationError(`Component '${Iu}' is missing an 'id'; entries require a valid string 'id'.`);let Ou=$u.defaultCatalog;if(typeof Pu=="string"&&Pu){const Mu=$u.availableCatalogs.get(Pu);if(!Mu){const Lu=this.catalogs.find(Bu=>Bu.id===Pu);throw Lu?new A2uiValidationError(`Component '${Ru}' catalog '${Pu}' specification version (${Lu.protocolVersion}) does not match surface default catalog version (${$u.defaultCatalog.protocolVersion}).`):new A2uiValidationError(`Unknown catalog ID '${Pu}' for component '${Ru}'. Available catalogs: ${this.catalogs.map(Bu=>Bu.id).join(", ")}`)}Ou=Mu}const Du=$u.componentsModel.get(Ru);new PayloadValidator(Ou,this.validationConfig).validateComponent(lo,Du?.type)}applyComponentUpdate(lo,$u){const{id:Ru,component:Iu,...Pu}=lo;if(typeof Ru!="string")return;const Ou=lo.catalogId??lo.catalogID,Du=$u.componentsModel.get(Ru);let Mu=$u.defaultCatalog;if(typeof Ou=="string"&&Ou){const Lu=$u.availableCatalogs.get(Ou);Lu&&(Mu=Lu)}if(Du){const Lu=typeof Iu=="string"?Iu:Du.type;if(Lu!==Du.type||Ou&&Du.catalog?.id!==Mu.id){$u.componentsModel.removeComponent(Ru);const Bu=new ComponentModel(Ru,Lu,Pu,Mu);$u.componentsModel.addComponent(Bu)}else Du.properties=Pu}else{if(typeof Iu!="string"||!Iu)throw new A2uiValidationError(`Cannot create component ${Ru} without a type.`);const Lu=new ComponentModel(Ru,Iu,Pu,Mu);$u.componentsModel.addComponent(Lu)}}processUpdateComponentsOp(lo){if(!lo.surfaceId)return;const $u=this.model.getSurface(lo.surfaceId);if(!$u)throw new A2uiStateError(`Surface not found for message: ${lo.surfaceId}`);for(const Ru of lo.components)this.validateComponentProperties(Ru,$u);this.validateCompositionConstraints($u,lo.components),this.validateCandidateTopology($u,lo.components);for(const Ru of lo.components)this.applyComponentUpdate(Ru,$u)}processUpdateDataModelOp(lo){if(!lo.surfaceId)return;const $u=this.model.getSurface(lo.surfaceId);if(!$u)throw new A2uiStateError(`Surface not found for message: ${lo.surfaceId}`);const Ru=lo.path||"/",Iu=lo.value;$u.dataModel.set(Ru,Iu)}validateParentConstraints(lo,$u,Ru,Iu){if(!Iu||Iu.length===0){if((lo==="root"||this.validationConfig&&this.validationConfig.allowOrphanComponents===!1)&&!Ru.includes("Surface"))throw new A2uiValidationError(`Component '${lo}' (${$u}) cannot be placed under parent 'Surface' (Surface). Allowed parents: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_PARENT");return}for(const Pu of Iu)if(!Ru.includes(Pu.parentType))throw new A2uiValidationError(`Component '${lo}' (${$u}) cannot be placed under parent '${Pu.parentId}' (${Pu.parentType||"unknown"}). Allowed parents: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_PARENT")}validateChildConstraints(lo,$u,Ru,Iu,Pu){for(const Ou of Iu){const Du=Pu.get(Ou);if(Du&&!Ru.includes(Du))throw new A2uiValidationError(`Container '${lo}' (${$u}) cannot contain child '${Ou}' (${Du}). Allowed children: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_CHILD")}}buildCompositionTopology(lo,$u){const Ru=new Map,Iu=new Map,Pu=new Map;for(const[Du,Mu]of lo.componentsModel.entries){Ru.set(Du,Mu.type),Mu.catalog&&Iu.set(Du,Mu.catalog);const Lu=lo.componentsModel.getChildIds(Du);Lu.length>0&&Pu.set(Du,Lu)}for(const Du of $u){const{id:Mu,component:Lu,...Bu}=Du;if(typeof Mu!="string")continue;let ju=lo.defaultCatalog;const Fu=Du.catalogId??Du.catalogID;if(typeof Fu=="string"&&Fu){const Gu=lo.availableCatalogs.get(Fu);Gu&&(ju=Gu,Iu.set(Mu,Gu))}const zu=lo.componentsModel.get(Mu),Uu=(typeof Lu=="string"?Lu:zu?.type)??"";Uu&&Ru.set(Mu,Uu);const Hu={id:Mu,component:Uu,...Bu},Vu=Array.from(getComponentReferences(Hu,ju)).map(([Gu])=>Gu);Vu.length>0?Pu.set(Mu,Vu):Pu.delete(Mu)}const Ou=new Map;for(const[Du,Mu]of Pu.entries()){const Lu=Ru.get(Du)||"Unknown";for(const Bu of Mu){const ju=Ou.get(Bu)??[];ju.push({parentId:Du,parentType:Lu}),Ou.set(Bu,ju)}}return{typeMap:Ru,compCatalogMap:Iu,childMap:Pu,parentMap:Ou}}validateCompositionConstraints(lo,$u){const{typeMap:Ru,compCatalogMap:Iu,childMap:Pu,parentMap:Ou}=this.buildCompositionTopology(lo,$u);for(const[Du,Mu]of Ru.entries()){const Bu=(Iu.get(Du)??lo.defaultCatalog).components.get(Mu);Bu&&(Bu.allowedParents&&Bu.allowedParents.length>0&&this.validateParentConstraints(Du,Mu,Bu.allowedParents,Ou.get(Du)),Bu.allowedChildren&&Bu.allowedChildren.length>0&&this.validateChildConstraints(Du,Mu,Bu.allowedChildren,Pu.get(Du)||[],Ru))}}validateCandidateTopology(lo,$u){if(!this.validationConfig)return;const Ru=new SurfaceComponentsModel(lo.defaultCatalog);for(const[Iu,Pu]of lo.componentsModel.entries)Ru.addComponent(new ComponentModel(Iu,Pu.type,Pu.properties,Pu.catalog));for(const Iu of $u){const{id:Pu,component:Ou,...Du}=Iu;if(typeof Pu!="string"||!Pu)continue;const Mu=Iu.catalogId??Iu.catalogID;let Lu=lo.defaultCatalog;if(typeof Mu=="string"&&Mu){const Fu=lo.availableCatalogs.get(Mu);Fu&&(Lu=Fu)}const Bu=Ru.get(Pu),ju=(typeof Ou=="string"?Ou:Bu?.type)||"";ju&&(Bu?ju!==Bu.type||Mu&&Bu.catalog?.id!==Lu.id?(Ru.removeComponent(Pu),Ru.addComponent(new ComponentModel(Pu,ju,Du,Lu))):Bu.properties=Du:Ru.addComponent(new ComponentModel(Pu,ju,Du,Lu)))}Ru.validateTopology({...this.validationConfig,rootId:this.validationConfig.rootId??lo.rootId})}}class ComponentContext{constructor(lo,$u,Ru="/",Iu,Pu){const Ou=lo.componentsModel.get($u);if(!Ou)throw new A2uiStateError(`Component not found: ${$u}`);this.componentModel=Ou,this.surfaceComponents=lo.componentsModel,this.theme=lo.theme,this.dataContext=new DataContext(lo,Ru,Pu,Iu),this._actionDispatcher=Du=>lo.dispatchAction(Du,this.componentModel.id)}dispatchAction(lo){return this._actionDispatcher(lo)}}function scrapeSchemaBehavior(Au){return getFieldBehavior(Au)}function unwrapZodSchema(Au){let lo=Au;for(;lo;){const $u=lo._def?.typeName;if($u==="ZodOptional"||$u==="ZodNullable"||$u==="ZodDefault"||$u==="ZodReadonly")lo=lo._def.innerType;else if($u==="ZodEffects")lo=lo._def.schema;else if($u==="ZodBranded")lo=lo._def.type;else if($u==="ZodLazy")lo=lo._def.getter();else break}return lo}function getRefDefName(Au){let lo=Au,$u="";for(;lo&&($u=lo.description??lo._def?.description??"",!$u);){const Iu=lo._def?.typeName;if(Iu==="ZodOptional"||Iu==="ZodNullable"||Iu==="ZodDefault"||Iu==="ZodReadonly")lo=lo._def.innerType;else if(Iu==="ZodEffects")lo=lo._def.schema;else if(Iu==="ZodBranded")lo=lo._def.type;else if(Iu==="ZodLazy")lo=lo._def.getter();else break}if(!$u||!$u.startsWith("REF:"))return"";const Ru=$u.slice(4);return extractRefDefName(Ru.split("|")[0])}function isCheckableField(Au){const lo=getRefDefName(Au);if(lo==="Checkable"||lo==="CheckRule")return!0;const $u=unwrapZodSchema(Au);if($u?._def?.typeName==="ZodArray"){const Ru=$u._def.type;if(getRefDefName(Ru)==="CheckRule")return!0}return!1}function isActionOption(Au){if(getRefDefName(Au)==="Action")return!0;const $u=unwrapZodSchema(Au)._def;return $u?.typeName==="ZodObject"&&!!$u.shape?.().event}function isDynamicOption(Au){const lo=getRefDefName(Au);if(lo==="DataBinding"||lo.startsWith("Dynamic"))return!0;const Ru=unwrapZodSchema(Au)._def;if(Ru?.typeName!=="ZodObject")return!1;const Iu=Ru.shape?.()||{},Pu=Object.values(Iu).some(Ou=>getRefDefName(Ou)==="ComponentId");return!!Iu.path&&!Pu}function isChildListOption(Au){if(childRefKindOf(Au)==="child-list"||getRefDefName(Au)==="ChildList")return!0;const $u=unwrapZodSchema(Au)._def;if($u?.typeName!=="ZodObject")return!1;const Ru=$u.shape?.()||{};return Object.values(Ru).some(Iu=>getRefDefName(Iu)==="ComponentId")}function isDynamicDef(Au,lo){return(Au==="DataBinding"||Au.startsWith("Dynamic"))&&lo!=="ZodObject"&&lo!=="ZodArray"}function matchUnionBehavior(Au){if(Au.some(isActionOption))return{type:"ACTION"};if(Au.some(isDynamicOption))return{type:"DYNAMIC"};if(Au.some(isChildListOption))return{type:"STRUCTURAL"}}function scrapeObjectShape(Au){const lo={};for(const[$u,Ru]of Object.entries(Au))lo[$u]=getFieldBehavior(Ru);return lo}function getFieldBehavior(Au){const lo=getRefDefName(Au);if(isCheckableField(Au))return{type:"CHECKABLE"};if(lo==="Action")return{type:"ACTION"};const $u=unwrapZodSchema(Au);if(childRefKindOf($u)==="child-list"||lo==="ChildList")return{type:"STRUCTURAL"};if(isDynamicDef(lo,$u._def?.typeName))return{type:"DYNAMIC"};if($u._def.typeName==="ZodUnion"){const Ru=matchUnionBehavior($u._def.options);if(Ru)return Ru}return $u._def.typeName==="ZodArray"?{type:"ARRAY",element:getFieldBehavior($u._def.type)}:$u._def.typeName==="ZodObject"?{type:"OBJECT",shape:scrapeObjectShape($u._def.shape())}:{type:"STATIC"}}const MAX_DYNAMIC_CHILD_LIST_SIZE=1e4;function getSafeChildList(Au){return Array.isArray(Au)?Au.length>MAX_DYNAMIC_CHILD_LIST_SIZE?Au.slice(0,MAX_DYNAMIC_CHILD_LIST_SIZE):Au:[]}class GenericBinder{constructor(lo,$u){this.dataListeners=[],this.propsListeners=[],this.currentProps={},this.isConnected=!1,this.actionClosures=new Map,this.context=lo,this.behaviorTree=scrapeSchemaBehavior($u),this.behaviorTree.type!=="OBJECT"&&(this.behaviorTree={type:"OBJECT",shape:{}}),this.resolveInitialProps()}resolveInitialProps(){const lo=this.context.componentModel.properties,$u=this.resolveAndBind(lo,this.behaviorTree,[],!0);this.currentProps={...this.currentProps,...$u||{}}}connect(){if(this.isConnected)return;this.isConnected=!0;const lo=this.context.componentModel.onUpdated.subscribe(()=>{this.rebuildAllBindings()});this.compUnsub=()=>lo.unsubscribe(),this.rebuildAllBindings()}rebuildAllBindings(){this.dataListeners.forEach(Ru=>Ru()),this.dataListeners=[];const lo=this.context.componentModel.properties,$u=this.resolveAndBind(lo,this.behaviorTree,[],!1);this.currentProps={...this.currentProps,...$u||{}},this.notify()}bindDynamicValue(lo,$u,Ru){const Iu=this.context.dataContext.subscribeDynamicValue(lo,Pu=>{this.updateDeepValue($u,Pu),this.notify()});return Ru?Iu.unsubscribe():this.dataListeners.push(()=>Iu.unsubscribe()),Iu.value}resolveDeepSync(lo,$u=0){if(typeof lo!="object"||lo===null)return lo;if($u>MAX_DYNAMIC_VALUE_DEPTH)return;if("path"in lo||"call"in lo)return this.context.dataContext.resolveDynamicValue(lo,$u);if(Array.isArray(lo))return lo.map(Iu=>this.resolveDeepSync(Iu,$u+1));const Ru={};for(const[Iu,Pu]of Object.entries(lo))Ru[Iu]=this.resolveDeepSync(Pu,$u+1);return Ru}resolveEventAction(lo){if(typeof lo!="object"||lo===null)return lo;const $u=lo;if("event"in $u&&typeof $u.event=="object"&&$u.event!==null){const Ru=$u.event,Iu={...Ru,context:Ru.context?this.resolveDeepSync(Ru.context,1):void 0};return Ru.userMessage!==void 0&&(Iu.userMessage=this.resolveDeepSync(Ru.userMessage,1)),{...$u,event:Iu}}if("name"in $u){const Ru={...$u,context:$u.context?this.resolveDeepSync($u.context,1):void 0};return $u.userMessage!==void 0&&(Ru.userMessage=this.resolveDeepSync($u.userMessage,1)),Ru}return this.resolveDeepSync(lo,0)}bindAction(lo,$u){const Ru=$u.join("/"),Iu=this.actionClosures.get(Ru);if(Iu&&jsonEquals(Iu.raw,lo))return Iu.closure;const Pu=()=>{if(lo&&typeof lo=="object"){const Ou=lo,Du=Ou.functionCall&&typeof Ou.functionCall=="object"?Ou.functionCall:Ou;if(typeof Du.call=="string"){this.context.dataContext.resolveDynamicValue(Du);return}}this.context.dispatchAction(this.resolveEventAction(lo))};return this.actionClosures.set(Ru,{raw:lo,closure:Pu}),Pu}mapTemplateChildren(lo,$u,Ru){const Iu=getSafeChildList(lo),Pu=this.context.dataContext.nested(Ru);return Iu.map((Ou,Du)=>({id:$u,basePath:Pu.nested(String(Du)).path}))}bindStructuralTemplate(lo,$u,Ru){if(!lo||typeof lo!="object"||Array.isArray(lo))return lo;const Iu=lo,Pu=typeof Iu.path=="string"?Iu.path:void 0,Ou=typeof Iu.componentId=="string"?Iu.componentId:void 0;if(!Pu||!Ou)return lo;const Du=this.context.dataContext.subscribeDynamicValue({path:Pu},Mu=>{const Lu=this.mapTemplateChildren(Mu,Ou,Pu);this.updateDeepValue($u,Lu),this.notify()});return Ru?Du.unsubscribe():this.dataListeners.push(()=>Du.unsubscribe()),this.mapTemplateChildren(Du.value,Ou,Pu)}extractValidationResult(lo,$u){if(typeof lo=="object"&&lo!==null&&"valid"in lo){const Ru=lo.message;return{valid:!!lo.valid,message:Ru!=null?String(Ru):$u}}return{valid:!!lo,message:$u}}bindCheckable(lo,$u,Ru){const Iu=Array.isArray(lo)?lo:[],Pu=Iu.map(()=>({valid:!0,message:""})),Ou=$u.slice(0,-1),Du=()=>{const Lu=Pu.filter(Bu=>!Bu.valid).map(Bu=>Bu.message);this.updateDeepValue([...Ou,"isValid"],Lu.length===0),this.updateDeepValue([...Ou,"validationErrors"],Lu),this.notify()};Iu.forEach((Lu,Bu)=>{const ju=typeof Lu=="object"&&Lu!==null?Lu:void 0,Fu=ju&&ju.condition!==void 0?ju.condition:Lu,zu=typeof ju?.message=="string"?ju.message:"Validation failed";Pu[Bu].message=zu;const Uu=this.context.dataContext.subscribeDynamicValue(Fu,Hu=>{Pu[Bu]=this.extractValidationResult(Hu,zu),Du()});Ru?Uu.unsubscribe():this.dataListeners.push(()=>Uu.unsubscribe()),Pu[Bu]=this.extractValidationResult(Uu.value,zu)});const Mu=Pu.filter(Lu=>!Lu.valid).map(Lu=>Lu.message);return this.updateDeepValue([...Ou,"isValid"],Mu.length===0),this.updateDeepValue([...Ou,"validationErrors"],Mu),lo}bindObject(lo,$u,Ru,Iu){const Pu={};for(const[Ou,Du]of Object.entries(lo)){const Mu=$u[Ou]||{type:"STATIC"};Pu[Ou]=this.resolveAndBind(Du,Mu,[...Ru,Ou],Iu)}for(const[Ou,Du]of Object.entries($u))if(Du.type==="DYNAMIC"){const Mu=`set${Ou.charAt(0).toUpperCase()+Ou.slice(1)}`,Lu=lo[Ou];Pu[Mu]=Bu=>{if(Lu&&typeof Lu=="object"&&"path"in Lu){const ju=Lu.path;typeof ju=="string"&&this.context.dataContext.set(ju,Bu)}}}return Pu}resolveAndBind(lo,$u,Ru,Iu){if(lo==null)return lo;switch($u.type){case"DYNAMIC":return this.bindDynamicValue(lo,Ru,Iu);case"ACTION":return this.bindAction(lo,Ru);case"STRUCTURAL":return this.bindStructuralTemplate(lo,Ru,Iu);case"CHECKABLE":return this.bindCheckable(lo,Ru,Iu);case"STATIC":return lo;case"ARRAY":return Array.isArray(lo)?lo.map((Pu,Ou)=>this.resolveAndBind(Pu,$u.element,[...Ru,Ou.toString()],Iu)):lo;case"OBJECT":return typeof lo!="object"?lo:this.bindObject(lo,$u.shape,Ru,Iu)}}updateDeepValue(lo,$u){this.currentProps=this.cloneAndUpdate(this.currentProps,lo,$u)}cloneAndUpdate(lo,$u,Ru){if($u.length===0)return Ru;const[Iu,...Pu]=$u;if(Array.isArray(lo)){const Ou=[...lo];return Ou[Number(Iu)]=this.cloneAndUpdate(Ou[Number(Iu)],Pu,Ru),Ou}else{const Ou=typeof lo=="object"&&lo!==null?lo:{};return{...Ou,[Iu]:this.cloneAndUpdate(Ou[Iu],Pu,Ru)}}}dispose(){this.isConnected&&(this.isConnected=!1,this.dataListeners.forEach(lo=>lo()),this.dataListeners=[],this.compUnsub&&(this.compUnsub(),this.compUnsub=void 0))}notify(){this.propsListeners.forEach(lo=>lo(this.currentProps))}subscribe(lo){return this.propsListeners.length===0&&this.connect(),this.propsListeners.push(lo),{unsubscribe:()=>{this.propsListeners=this.propsListeners.filter($u=>$u!==lo),this.propsListeners.length===0&&this.dispose()}}}get snapshot(){return this.currentProps}}function jsonEquals(Au,lo){if(Object.is(Au,lo))return!0;if(typeof Au!="object"||typeof lo!="object"||Au===null||lo===null)return!1;if(Array.isArray(Au)||Array.isArray(lo))return!Array.isArray(Au)||!Array.isArray(lo)||Au.length!==lo.length?!1:Au.every((Iu,Pu)=>jsonEquals(Iu,lo[Pu]));const $u=Object.keys(Au),Ru=Object.keys(lo);return $u.length!==Ru.length?!1:$u.every(Iu=>Object.prototype.hasOwnProperty.call(lo,Iu)&&jsonEquals(Au[Iu],lo[Iu]))}class ResolvedBinding{constructor(lo){this.value=lo}}class WritableBinding extends ResolvedBinding{constructor(lo,$u,Ru){super(lo),this.set=$u,this.path=Ru}}function isWritable(Au){return Au instanceof WritableBinding}function sameBinding(Au,lo){return isWritable(Au)!==isWritable(lo)||isWritable(Au)&&isWritable(lo)&&Au.path!==lo.path?!1:valueEquals(Au.value,lo.value)}function valueEquals(Au,lo){if(Object.is(Au,lo))return!0;if(Array.isArray(Au)&&Array.isArray(lo))return Au.length===lo.length&&Au.every(($u,Ru)=>valueEquals($u,lo[Ru]));if(isPlainObject$2(Au)&&isPlainObject$2(lo)){const $u=Object.keys(Au),Ru=Object.keys(lo);return $u.length===Ru.length&&$u.every(Iu=>Iu in lo&&valueEquals(Au[Iu],lo[Iu]))}return!1}function isPlainObject$2(Au){if(typeof Au!="object"||Au===null)return!1;const lo=Object.getPrototypeOf(Au);return lo===Object.prototype||lo===null}const PLACEHOLDER_TYPE="Placeholder";function isComponentNode(Au){return Au instanceof MutableComponentNode}class MutableComponentNode{constructor(lo,$u,Ru,Iu,Pu,Ou,Du="resolved"){this._onDestroyed=new EventEmitter,this.onDestroyed=this._onDestroyed,this.cleanups=[],this._disposed=!1,this.instanceId=lo,this.componentId=$u,this.type=Ru,this.dataPath=Iu,this.props=signal(Pu),this.impl=Ou,this.state=Du}get disposed(){return this._disposed}get isPlaceholder(){return this.state!=="resolved"}addCleanup(lo){this.cleanups.push(lo)}toJSON(){if(this.isPlaceholder)return{id:this.componentId,type:this.type,state:this.state};const lo={id:this.componentId,type:this.type},$u=peekValue(this.props);for(const[Ru,Iu]of Object.entries($u))lo[Ru]=serializeValue(Iu);return lo}setProps(lo){if(this._disposed)return;const $u=peekValue(this.props);shallowEqual($u,lo)||setValue(this.props,lo)}dispose(){if(!this._disposed){this._disposed=!0;for(const lo of this.cleanups)try{lo()}catch($u){console.error(`ComponentNode cleanup error (${this.instanceId}):`,$u)}this.cleanups=[],this._onDestroyed.emit(),this._onDestroyed.dispose()}}}function serializeValue(Au){if(isComponentNode(Au))return Au.toJSON();if(Au instanceof ResolvedBinding)return serializeValue(Au.value);if(typeof Au=="function")return"<Action>";if(Array.isArray(Au))return Au.map(serializeValue);if(Au&&typeof Au=="object"){const lo={};for(const[$u,Ru]of Object.entries(Au))lo[$u]=serializeValue(Ru);return lo}return Au}function shallowEqual(Au,lo){if(Object.is(Au,lo))return!0;const $u=Object.keys(Au),Ru=Object.keys(lo);if($u.length!==Ru.length)return!1;for(const Iu of $u)if(!Object.is(Au[Iu],lo[Iu]))return!1;return!0}const COMPONENT_ID_REF="REF:common_types.json#/$defs/ComponentId",CHILD_LIST_REF="REF:common_types.json#/$defs/ChildList",EMPTY_REF_FIELDS$1=new Map,refFieldsCache=new WeakMap;function extractRefFields(Au){const lo=refFieldsCache.get(Au);if(lo)return lo;const $u=unwrap(Au);if($u.schema._def.typeName!=="ZodObject")return refFieldsCache.set(Au,EMPTY_REF_FIELDS$1),EMPTY_REF_FIELDS$1;const Ru=new Map,Iu=$u.schema.shape;for(const[Ou,Du]of Object.entries(Iu)){const Mu=unwrap(Du);if(marksChildList(Mu)||isChildListUnion(Mu.schema)){Ru.set(Ou,{kind:"list"});continue}if(marksComponentId(Mu)){Ru.set(Ou,{kind:"single"});continue}if(Mu.schema._def.typeName==="ZodArray"){const Lu=unwrap(Mu.schema._def.type);if(marksComponentId(Lu)){Ru.set(Ou,{kind:"list"});continue}if(Lu.schema._def.typeName==="ZodObject"){const Bu=new Set,ju=Lu.schema.shape;for(const[Fu,zu]of Object.entries(ju))marksComponentId(unwrap(zu))&&Bu.add(Fu);Bu.size>0&&Ru.set(Ou,{kind:"nested",keys:Bu})}}}const Pu=Ru;return refFieldsCache.set(Au,Pu),Pu}function unwrap(Au){const lo=[],$u=new Set;let Ru=Au;for(;;){Ru.description&&lo.push(Ru.description);const Iu=childRefKindOf(Ru);Iu&&$u.add(Iu);const Pu=Ru._def.typeName;if(Pu==="ZodOptional"||Pu==="ZodNullable"||Pu==="ZodDefault")Ru=Ru._def.innerType;else if(Pu==="ZodEffects")Ru=Ru._def.schema;else return{schema:Ru,descriptions:lo,refs:$u}}}function marksComponentId(Au){return Au.refs.has("component-id")||hasPointer(Au.descriptions,COMPONENT_ID_REF)}function marksChildList(Au){return Au.refs.has("child-list")||hasPointer(Au.descriptions,CHILD_LIST_REF)}function hasPointer(Au,lo){return Au.some($u=>$u.startsWith(lo))}function isChildListUnion(Au){return Au._def.typeName!=="ZodUnion"?!1:Au._def.options.some($u=>{if($u._def.typeName!=="ZodObject")return!1;const Ru=$u.shape;return Ru.componentId&&Ru.path})}const ROOT_COMPONENT_ID="root",ROOT_DATA_PATH="/",EMPTY_REF_FIELDS=new Map;class NodeResolver{constructor(lo,$u){if(this.records=new Map,this.nodesByEdge=new Map,this.nodesByComponentId=new Map,this.pendingParents=new Map,this.dispatchedErrors=new Map,this.modelSubs=[],this._disposed=!1,$u!==lo.defaultCatalog)throw new A2uiStateError("NodeResolver requires the same catalog instance its surface was constructed with.");this.surface=lo,this.catalog=$u,this.rootId=lo.rootId??ROOT_COMPONENT_ID,this.rootNode=signal(void 0),this.modelSubs.push(lo.componentsModel.onCreated.subscribe(Ru=>this.onComponentCreated(Ru))),this.modelSubs.push(lo.componentsModel.onDeleted.subscribe(Ru=>this.onComponentDeleted(Ru))),lo.componentsModel.get(this.rootId)&&this.buildRoot()}dispatchOnce(lo,$u,Ru,Iu){let Pu=this.dispatchedErrors.get($u);Pu||(Pu=new Map,this.dispatchedErrors.set($u,Pu));let Ou=Pu.get(Ru);Ou||(Ou=new Set,Pu.set(Ru,Ou)),!Ou.has(lo)&&(Ou.add(lo),this.surface.dispatchError({code:lo,message:Iu}))}clearDispatched(lo,$u){const Ru=this.dispatchedErrors.get(lo);Ru?.delete($u)&&Ru.size===0&&this.dispatchedErrors.delete(lo)}get activeNodeCount(){return this.records.size}get disposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;for(const lo of this.modelSubs)lo.unsubscribe();this.modelSubs.length=0;for(const lo of[...this.records.keys()])this.disposeNode(lo);this.pendingParents.clear(),this.dispatchedErrors.clear(),this.rootRecord=void 0,setValue(this.rootNode,void 0)}}buildRoot(){if(this.rootRecord)return;const lo=`>${escapeIdPart(this.rootId)}>${escapeIdPart(this.rootId)}@/`,$u=this.createNode(this.rootId,ROOT_DATA_PATH,lo,void 0);this.rootRecord=this.records.get($u),setValue(this.rootNode,$u)}onComponentCreated(lo){if(this._disposed)return;if(lo.id===this.rootId){const Ru=this.surface.componentsModel.get(this.rootId);this.rootRecord&&this.rootRecord.componentModel!==Ru&&(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,Ru||setValue(this.rootNode,void 0)),Ru&&this.buildRoot()}const $u=this.pendingParents.get(lo.id);if($u){this.pendingParents.delete(lo.id);for(const Ru of $u){const Iu=this.records.get(Ru);Iu&&!Ru.disposed&&this.materialize(Iu)}}}onComponentDeleted(lo){if(this._disposed)return;this.dispatchedErrors.delete(lo);const $u=this.surface.componentsModel.get(lo),Ru=this.nodesByComponentId.get(lo);if(!Ru)return;const Iu=new Set;let Pu=!1;for(const Ou of[...Ru]){const Du=this.records.get(Ou);Du&&(Du.parent?Iu.add(Du.parent):Pu=!0)}Pu&&this.rootRecord&&($u?this.rootRecord.componentModel!==$u&&(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,this.buildRoot()):(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,setValue(this.rootNode,void 0)));for(const Ou of Iu){const Du=this.records.get(Ou);Du&&!Ou.disposed&&this.materialize(Du)}}createNode(lo,$u,Ru,Iu,Pu=1){const Ou=this.surface.componentsModel.get(lo);if(!Ou){const zu=this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,PLACEHOLDER_TYPE,$u,{},void 0,"pending"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS});return Iu&&this.registerPendingParent(lo,Iu),zu.node}const Du=(Ou.catalog?.components.size?Ou.catalog:void 0)??this.catalog,Mu=Du.components.get(Ou.type);if(!Mu)return this.dispatchOnce("UNKNOWN_COMPONENT_TYPE",lo,$u,`Component '${lo}' has type '${Ou.type}', which is not in catalog '${Du.id}'.`),this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,Ou.type,$u,{},void 0,"unknown-type"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS,componentModel:Ou}).node;this.clearDispatched(lo,$u);const Lu=Iu?this.records.get(Iu)?.context?.dataContext:void 0,Bu=new ComponentContext(this.surface,lo,$u,Lu),ju=new GenericBinder(Bu,Mu.schema),Fu=this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,Ou.type,$u,{},Mu),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:extractRefFields(Mu.schema),behavior:scrapeSchemaBehavior(Mu.schema),context:Bu,componentModel:Ou,binder:ju});return Fu.binderSub=ju.subscribe(zu=>{Fu.lastBinderProps=zu,this.materialize(Fu)}),Fu.lastBinderProps=ju.snapshot,this.materialize(Fu),Fu.node}registerNode(lo,$u){const Ru={node:lo,edgeKey:$u.edgeKey,parent:$u.parent,occurrence:$u.occurrence,refFields:$u.refFields,behavior:$u.behavior,context:$u.context,componentModel:$u.componentModel,binder:$u.binder,childEdges:new Map};this.records.set(lo,Ru),this.nodesByEdge.set($u.edgeKey,lo);let Iu=this.nodesByComponentId.get(lo.componentId);return Iu||(Iu=new Set,this.nodesByComponentId.set(lo.componentId,Iu)),Iu.add(lo),Ru}childNode(lo,$u,Ru,Iu,Pu=1){const Ou=this.nodesByEdge.get(Ru);if(this.isCyclic(lo,$u,Iu))return Ou&&!Ou.disposed&&Ou.isPlaceholder&&this.records.get(Ou)?.occurrence===Pu?Ou:(Ou&&!Ou.disposed&&this.disposeNode(Ou),this.dispatchOnce("CYCLIC_REFERENCE",lo,$u,`Component '${lo}' at '${$u}' is referenced by one of its own descendants; rendering a placeholder instead.`),this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,PLACEHOLDER_TYPE,$u,{},void 0,"cyclic"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS}).node);if(Ou&&!Ou.disposed){const Du=this.surface.componentsModel.get(lo),Mu=(Du?.catalog?.components.size?Du.catalog:void 0)??this.catalog,Lu=Du?Mu.components.get(Du.type):void 0,Bu=this.records.get(Ou);if(Ou.componentId===lo&&Ou.dataPath===$u&&Bu?.occurrence===Pu&&(Ou.isPlaceholder?Du===void 0&&Ou.state==="pending"||Du!==void 0&&Lu===void 0&&Ou.state==="unknown-type"&&Bu?.componentModel===Du:Du!==void 0&&Ou.type===Du.type&&Bu?.componentModel===Du))return Ou.state==="pending"&&this.registerPendingParent(lo,Iu),Ou;this.disposeNode(Ou)}return this.createNode(lo,$u,Ru,Iu,Pu)}registerPendingParent(lo,$u){let Ru=this.pendingParents.get(lo);Ru||(Ru=new Set,this.pendingParents.set(lo,Ru)),Ru.add($u)}isCyclic(lo,$u,Ru){for(let Iu=Ru;Iu;Iu=this.records.get(Iu)?.parent)if(Iu.componentId===lo&&Iu.dataPath===$u)return!0;return!1}materialize(lo){if(lo.node.disposed)return;const Ru={...lo.lastBinderProps??lo.binder?.snapshot??{}},Iu=new Map,Pu=lo.componentModel?.properties;if(Pu)for(const Bu of lo.refFields.keys())Bu in Ru&&!(Bu in Pu)&&delete Ru[Bu];const Ou=new Map,Du=(Bu,ju,Fu)=>{const zu=`${escapeIdPart(ju)}@${escapeIdPart(Fu)}`,Uu=(Ou.get(zu)??0)+1;Ou.set(zu,Uu);const Hu=`${lo.edgeKey}>${Bu}>${zu}`,Vu=this.childNode(ju,Fu,Hu,lo.node,Uu);return Iu.set(Hu,Vu),Vu};for(const[Bu,ju]of lo.refFields)switch(ju.kind){case"single":{const Fu=Ru[Bu];typeof Fu=="string"&&Fu&&(Ru[Bu]=Du(escapeIdPart(Bu),Fu,lo.node.dataPath));break}case"list":{const Fu=Ru[Bu];if(!Array.isArray(Fu))break;const zu=getSafeChildList(Fu);Ru[Bu]=zu.map((Uu,Hu)=>{if(typeof Uu=="string"&&Uu)return Du(`${escapeIdPart(Bu)}[${Hu}]`,Uu,lo.node.dataPath);if(Uu&&typeof Uu=="object"&&!Array.isArray(Uu)){const Vu=Uu;if(typeof Vu.id=="string"&&typeof Vu.basePath=="string")return Du(`${escapeIdPart(Bu)}[${Hu}]`,Vu.id,Vu.basePath);if(typeof Vu.componentId=="string"&&Vu.componentId)return Du(`${escapeIdPart(Bu)}[${Hu}]`,Vu.componentId,lo.node.dataPath)}return Uu});break}case"nested":{const Fu=Ru[Bu];if(!Array.isArray(Fu))break;Ru[Bu]=Fu.map((zu,Uu)=>{if(!zu||typeof zu!="object"||Array.isArray(zu))return zu;const Hu={...zu};let Vu=!1;for(const Gu of ju.keys){const Wu=Hu[Gu];typeof Wu=="string"&&Wu&&(Hu[Gu]=Du(`${escapeIdPart(Bu)}[${Uu}].${escapeIdPart(Gu)}`,Wu,lo.node.dataPath),Vu=!0)}return Vu?Hu:zu});break}}for(const[Bu,ju]of lo.childEdges)if(!Iu.has(Bu)&&(this.disposeNode(ju),ju.isPlaceholder&&![...Iu.values()].some(zu=>zu.isPlaceholder&&zu.componentId===ju.componentId))){const zu=this.pendingParents.get(ju.componentId);zu&&(zu.delete(lo.node),zu.size===0&&this.pendingParents.delete(ju.componentId))}lo.childEdges=Iu;const Mu=lo.behavior&&lo.context?wrapDynamicValues(Ru,lo.behavior,Pu??{},lo.context.dataContext):Ru,Lu=peekValue(lo.node.props);for(const Bu of Object.keys(Mu))Mu[Bu]=stabilize(Lu[Bu],Mu[Bu]);lo.node.setProps(Mu)}disposeNode(lo){if(lo.disposed)return;const $u=this.records.get(lo);if($u){for(const Iu of $u.childEdges.values())this.disposeNode(Iu);$u.childEdges.clear(),$u.binderSub?.unsubscribe(),$u.binderSub=void 0,this.nodesByEdge.get($u.edgeKey)===lo&&this.nodesByEdge.delete($u.edgeKey),this.records.delete(lo)}const Ru=this.nodesByComponentId.get(lo.componentId);Ru&&(Ru.delete(lo),Ru.size===0&&this.nodesByComponentId.delete(lo.componentId));for(const[Iu,Pu]of this.pendingParents)Pu.delete(lo),Pu.size===0&&this.pendingParents.delete(Iu);lo.state==="cyclic"&&this.clearDispatched(lo.componentId,lo.dataPath),lo.dispose()}}const ID_PART_ESCAPES={"~":"~0","#":"~1","[":"~2","]":"~3",">":"~4","@":"~5"};function escapeIdPart(Au){return Au.replace(/[~#[\]>@]/g,lo=>ID_PART_ESCAPES[lo])}function instanceIdFor(Au,lo,$u){const Ru=lo.replace(/\/+$/,"")||ROOT_DATA_PATH,Iu=lo===ROOT_DATA_PATH?escapeIdPart(Au):`${escapeIdPart(Au)}-[${escapeIdPart(Ru)}]`;return $u>1?`${Iu}#${$u}`:Iu}function wrapDynamicValues(Au,lo,$u,Ru){switch(lo.type){case"DYNAMIC":{const Iu=$u&&typeof $u=="object"&&!Array.isArray($u)&&typeof $u.path=="string"?$u.path:void 0;return Iu===void 0?new ResolvedBinding(Au):new WritableBinding(Au,Pu=>Ru.set(Iu,Pu),Iu)}case"ARRAY":{if(!Array.isArray(Au))return Au;const Iu=Array.isArray($u)?$u:[];return Au.map((Pu,Ou)=>wrapDynamicValues(Pu,lo.element,Iu[Ou],Ru))}case"OBJECT":{if(!Au||typeof Au!="object"||Array.isArray(Au))return Au;const Iu=new Set;for(const[Du,Mu]of Object.entries(lo.shape))Mu.type==="DYNAMIC"&&Iu.add(`set${Du.charAt(0).toUpperCase()}${Du.slice(1)}`);const Pu=$u&&typeof $u=="object"&&!Array.isArray($u)?$u:{},Ou={};for(const[Du,Mu]of Object.entries(Au))Iu.has(Du)||(Ou[Du]=wrapDynamicValues(Mu,lo.shape[Du]??{type:"STATIC"},Pu[Du],Ru));for(const[Du,Mu]of Object.entries(lo.shape))Mu.type==="DYNAMIC"&&!(Du in Ou)&&(Ou[Du]=new ResolvedBinding(void 0));return Ou}default:return Au}}function stabilize(Au,lo){if(Object.is(Au,lo))return lo;if(Au instanceof ResolvedBinding&&lo instanceof ResolvedBinding)return sameBinding(Au,lo)?Au:lo;if(isComponentNode(Au)||isComponentNode(lo))return lo;if(Array.isArray(Au)&&Array.isArray(lo)&&Au.length===lo.length){let $u=!0;const Ru=lo.map((Iu,Pu)=>{const Ou=stabilize(Au[Pu],Iu);return Object.is(Ou,Au[Pu])||($u=!1),Ou});return $u?Au:Ru}if(isPlainObject$1(Au)&&isPlainObject$1(lo)){const $u=Object.keys(Au),Ru=Object.keys(lo);if($u.length===Ru.length){let Iu=!0;const Pu={};for(const Ou of Ru){const Du=stabilize(Au[Ou],lo[Ou]);Pu[Ou]=Du,(!(Ou in Au)||!Object.is(Du,Au[Ou]))&&(Iu=!1)}return Iu?Au:Pu}}return lo}function isPlainObject$1(Au){if(!Au||typeof Au!="object"||Array.isArray(Au)||isComponentNode(Au))return!1;const lo=Object.getPrototypeOf(Au);return lo===Object.prototype||lo===null}const ComponentIdSchema=markChildRef(stringType().describe("REF:#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),DataBindingSchema=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).strict().describe("REF:#/$defs/DataBinding"),DynamicValueSchema=unionType([stringType(),numberType(),booleanType(),arrayType(anyType()),DataBindingSchema,lazyType(()=>FunctionCallSchema)]).describe("REF:#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),FunctionCallSchema=objectType({call:stringType().describe("The name of the function to call."),args:recordType(stringType(),unionType([DynamicValueSchema,recordType(stringType(),anyType()).describe("A literal object argument (e.g. configuration).")])).describe("Arguments passed to the function.").optional(),returnType:enumType(["string","number","boolean","array","object","any","void"]).describe("The expected return type of the function call.").default("boolean")}).describe("REF:#/$defs/FunctionCall|Invokes a named function on the client."),DynamicStringSchema=unionType([stringType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicString|Represents a string"),AccessibilityAttributesSchema=objectType({label:DynamicStringSchema.optional(),description:DynamicStringSchema.optional()}).describe("REF:#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers.");objectType({id:ComponentIdSchema,accessibility:AccessibilityAttributesSchema.optional()}).describe("REF:#/$defs/ComponentCommon");const ChildListSchema=markChildRef(unionType([arrayType(ComponentIdSchema).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema,path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.")]).describe("REF:#/$defs/ChildList"),"child-list"),DynamicNumberSchema=unionType([numberType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number."),DynamicBooleanSchema=unionType([booleanType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),DynamicStringListSchema=unionType([arrayType(stringType()),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array."),CheckRuleSchema=objectType({condition:DynamicBooleanSchema,message:stringType().describe("The error message to display if the check fails.")}).strict().describe("REF:#/$defs/CheckRule|A single validation rule applied to an input component.");objectType({checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:#/$defs/Checkable|Properties for components that support client-side checks.");const ActionSchema=unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the server."),context:recordType(stringType(),DynamicValueSchema).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the server.")}).strict().describe("Triggers a server-side event."),objectType({functionCall:FunctionCallSchema}).strict().describe("Executes a local client-side function.")]).describe("REF:#/$defs/Action|Defines an interaction handler that can either trigger a server-side event or execute a local client-side function."),TextApi={name:"Text",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),text:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text content to display. While simple Markdown formatting is supported (i.e. without HTML, images, or links), utilizing dedicated UI components is generally preferred for a richer and more structured presentation."),variant:enumType(["h1","h2","h3","h4","h5","caption","body"]).default("body").describe("A hint for the base text style.").optional()}).strict()},ImageApi={name:"Image",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the image to display."),description:DynamicStringSchema.describe("REF:#/$defs/DynamicString|Accessibility text for the image.").optional(),fit:enumType(["contain","cover","fill","none","scaleDown"]).default("fill").describe("Specifies how the image should be resized to fit its container. This corresponds to the CSS 'object-fit' property.").optional(),variant:enumType(["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]).default("mediumFeature").describe("A hint for the image size and style.").optional()}).strict()},IconApi={name:"Icon",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),name:unionType([enumType(["accountCircle","add","arrowBack","arrowForward","attachFile","calendarToday","call","camera","check","close","delete","download","edit","event","error","fastForward","favorite","favoriteOff","folder","help","home","info","locationOn","lock","lockOpen","mail","menu","moreVert","moreHoriz","notificationsOff","notifications","pause","payment","person","phone","photo","play","print","refresh","rewind","search","send","settings","share","shoppingCart","skipNext","skipPrevious","star","starHalf","starOff","stop","upload","visibility","visibilityOff","volumeDown","volumeMute","volumeOff","volumeUp","warning"]),objectType({svgPath:stringType()}),DataBindingSchema.describe("REF:#/$defs/DataBinding")]).describe("The name of the icon to display.")}).strict()},VideoApi={name:"Video",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the video to display.")}).strict()},AudioPlayerApi={name:"AudioPlayer",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the audio to be played."),description:DynamicStringSchema.describe("REF:#/$defs/DynamicString|A description of the audio, such as a title or summary.").optional()}).strict()},RowApi={name:"Row",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID."),justify:enumType(["center","end","spaceAround","spaceBetween","spaceEvenly","start","stretch"]).default("start").describe("Defines the arrangement of children along the main axis (horizontally). Use 'spaceBetween' to push items to the edges, or 'start'/'end'/'center' to pack them together.").optional(),align:enumType(["start","center","end","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis (vertically). This is similar to the CSS 'align-items' property, but uses camelCase values (e.g., 'start').").optional()}).strict()},ColumnApi={name:"Column",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID."),justify:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly","stretch"]).default("start").describe("Defines the arrangement of children along the main axis (vertically). Use 'spaceBetween' to push items to the edges (e.g. header at top, footer at bottom), or 'start'/'end'/'center' to pack them together.").optional(),align:enumType(["center","end","start","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis (horizontally). This is similar to the CSS 'align-items' property.").optional()}).strict()},ListApi={name:"List",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list."),direction:enumType(["vertical","horizontal"]).default("vertical").describe("The direction in which the list items are laid out.").optional(),align:enumType(["start","center","end","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis.").optional()}).strict()},CardApi={name:"Card",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the single child component to be rendered inside the card. To display multiple elements, you MUST wrap them in a layout component (like Column or Row) and pass that container's ID here. Do NOT pass multiple IDs or a non-existent ID.")}).strict()},TabsApi={name:"Tabs",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),tabs:arrayType(objectType({title:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The tab title."),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the child component.")})).min(1).describe("An array of objects, where each object defines a tab with a title and a child component.")}).strict()},ModalApi={name:"Modal",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),trigger:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the component that opens the modal when interacted with (e.g., a button)."),content:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the component to be displayed inside the modal.")}).strict()},DividerApi={name:"Divider",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),axis:enumType(["horizontal","vertical"]).default("horizontal").describe("The orientation of the divider.").optional()}).strict()},ButtonApi={name:"Button",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the child component. Use a 'Text' component for a labeled button. Only use an 'Icon' if the requirements explicitly ask for an icon-only button."),variant:enumType(["default","primary","borderless"]).default("default").describe("A hint for the button style. If omitted, a default button style is used. 'primary' indicates this is the main call-to-action button. 'borderless' means the button has no visual border or background, making its child content appear like a clickable link.").optional(),action:ActionSchema.describe("REF:#/$defs/Action")}).strict()},TextFieldApi={name:"TextField",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text label for the input field."),value:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The value of the text field.").optional(),variant:enumType(["longText","number","shortText","obscured"]).default("shortText").describe("The type of input field to display.").optional(),validationRegexp:stringType().describe("A regular expression used for client-side validation of the input.").optional()}).strict()},CheckBoxApi={name:"CheckBox",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text to display next to the checkbox."),value:DynamicBooleanSchema.describe("REF:#/$defs/DynamicBoolean|The current state of the checkbox (true for checked, false for unchecked).")}).strict()},ChoicePickerApi={name:"ChoicePicker",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The label for the group of options.").optional(),variant:enumType(["multipleSelection","mutuallyExclusive"]).default("mutuallyExclusive").describe("A hint for how the choice picker should be displayed and behave.").optional(),options:arrayType(objectType({label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text to display for this option."),value:stringType().describe("The stable value associated with this option.")})).describe("The list of available options to choose from."),value:DynamicStringListSchema.describe("REF:#/$defs/DynamicStringList|The list of currently selected values. This should be bound to a string array in the data model."),displayStyle:enumType(["checkbox","chips"]).default("checkbox").describe("The display style of the component.").optional(),filterable:booleanType().default(!1).describe("If true, displays a search input to filter the options.").optional()}).strict()},SliderApi={name:"Slider",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The label for the slider.").optional(),min:numberType().default(0).describe("The minimum value of the slider.").optional(),max:numberType().describe("The maximum value of the slider."),value:DynamicNumberSchema.describe("REF:#/$defs/DynamicNumber|The current value of the slider.")}).strict()},DateTimeInputApi={name:"DateTimeInput",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),value:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The selected date and/or time value in ISO 8601 format. If not yet set, initialize with an empty string."),enableDate:booleanType().default(!1).describe("If true, allows the user to select a date.").optional(),enableTime:booleanType().default(!1).describe("If true, allows the user to select a time.").optional(),min:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The minimum allowed date/time in ISO 8601 format.").optional(),max:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The maximum allowed date/time in ISO 8601 format.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text label for the input field.").optional()}).strict()},DEFAULT_CSS=`
3402
+ Sales`,value:zu,onChange:pd=>Uu(pd.target.value)})]}),ju==="score"&&jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"From"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",type:"number",name:"from",value:Hu,onChange:pd=>Vu(pd.target.value)})]}),jsxRuntimeExports.jsxs(FormControl$1,{sx:{flex:1},children:[jsxRuntimeExports.jsx(FormControl$1.Label,{children:"To"}),jsxRuntimeExports.jsx(TextInput$1,{block:!0,size:"small",type:"number",name:"to",value:Gu,onChange:pd=>Wu(pd.target.value)})]})]}),Zu?jsxRuntimeExports.jsx(Text$3,{as:"p",role:"alert",sx:{m:0,color:"danger.fg",fontSize:0},children:Zu}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",type:"submit",disabled:Yu,children:Yu?DECISION_WORDS.asking:DECISION_WORDS.submit}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",type:"button",onClick:sd,disabled:Yu,children:DECISION_WORDS.cancel})]})]})}const DEFAULT_BALLOON_DISPLAY="history";let displayNames=null;function toolDisplayName(Au){if(!displayNames){displayNames=new Map;for(const Ru of Object.values(BACKEND_TOOL_CATALOG)){const Iu=Ru.runtime?.method;Iu&&Ru.name&&!displayNames.has(Iu)&&displayNames.set(Iu,Ru.name)}}const lo=displayNames.get(Au);if(lo)return lo;const $u=Au.indexOf("__");return $u>0?Au.slice($u+2):Au}function toolLineParts(Au,lo=ENGLISH_CHAT_WORDS){if(Au.phase==="running"&&Au.words)return{before:"",name:"",after:Au.words};switch(Au.phase){case"running":return{...lo.toolRunning,name:Au.name};case"done":return{...lo.toolDone,name:Au.name};case"failed":return{...lo.toolFailedLine,name:Au.name}}}function toolLineText(Au,lo=ENGLISH_CHAT_WORDS){const{before:$u,name:Ru,after:Iu}=toolLineParts(Au,lo);return`${$u}${Ru}${Iu}`}function newestToolLine(Au){const lo=Au[Au.length-1];if(!lo||typeof lo.toolName!="string"||!lo.toolName)return;const $u=lo.status==="error"||typeof lo.error=="string"&&lo.error?"failed":lo.status==="complete"?"done":"running";return{id:String(lo.toolCallId??lo.id??lo.toolName),tool:lo.toolName,name:toolDisplayName(lo.toolName),phase:$u}}function toolAnnouncement(Au,lo,$u=ENGLISH_CHAT_WORDS){if(Au&&!(lo&&lo.id===Au.id&&lo.phase===Au.phase))return toolLineText(Au,$u)}function conversationCount(Au){return Au.filter(lo=>{const $u=lo;return($u.role==="user"||$u.role==="assistant")&&typeof $u.toolName!="string"}).length}function displayItemOfLine(Au){return!Au.tool&&!Au.name?{id:`balloon-activity:${Au.id}`,role:"assistant",content:Au.words??"",createdAt:new Date(0)}:toolCallOfLine(Au)}function toolCallOfLine(Au){return{id:`balloon-tool:${Au.id}`,type:"tool-call",toolCallId:Au.id,toolName:Au.tool||Au.name,args:{},status:Au.phase==="failed"?"error":Au.phase==="done"?"complete":"executing",...Au.words?{summary:Au.words}:{}}}function withToolCall(Au,lo){return!lo||Au.some($u=>$u.toolCallId===lo.id||$u.id===lo.id)?Au:[...Au,displayItemOfLine(lo)]}const VISUALLY_HIDDEN={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},BALLOON_AVATARS={userAvatar:null,assistantAvatar:null,showAvatars:!1,avatarSize:0,userAvatarBg:"neutral.muted",assistantAvatarBg:"accent.emphasis"};async function respondInBalloon(Au,lo){if(lo&&typeof lo=="object"){const $u=lo;$u.type==="tool-approval-decision"&&typeof $u.approved=="boolean"&&typeof $u.approvalId=="string"&&agentRuntimeStore.getState().sendDecision($u.approvalId,$u.approved)}}function BalloonChatItems({items:Au,density:lo="compact",waiting:$u=!1}){const Ru=reactExports.useRef(null);return jsxRuntimeExports.jsx(Box,{"data-balloon-chat-items":"",minWidth:0,children:jsxRuntimeExports.jsx(ChatMessageList,{displayItems:Au,isLoading:$u,isStreaming:!1,showLoadingIndicator:$u,hideMessagesAfterToolUI:!1,avatarConfig:BALLOON_AVATARS,padding:0,onRespond:respondInBalloon,messagesEndRef:Ru,emptyContent:$u?jsxRuntimeExports.jsx(TypingDots,{size:6}):null,density:lo})})}function BalloonToolCall({line:Au,waiting:lo=!1}){return jsxRuntimeExports.jsx(Box,{"aria-hidden":"true","data-balloon-tool":Au.phase,"data-balloon-tool-name":Au.tool||void 0,minWidth:0,width:"100%",children:jsxRuntimeExports.jsx(BalloonChatItems,{items:[displayItemOfLine(Au)],waiting:lo})})}function ToolLineAnnouncer({line:Au}){const lo=useChatWords(),$u=reactExports.useRef(void 0),[Ru,Iu]=reactExports.useState("");return reactExports.useEffect(()=>{const Pu=toolAnnouncement(Au,$u.current,lo);Au&&Pu&&($u.current={id:Au.id,phase:Au.phase},Iu(Pu))},[Au?.id,Au?.phase]),jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite","data-balloon-announce":"",...VISUALLY_HIDDEN,children:Ru})}function WordsAnnouncer({text:Au,speaking:lo=!1}){const $u=reactExports.useRef(void 0),[Ru,Iu]=reactExports.useState("");return reactExports.useEffect(()=>{lo||!Au||Au===$u.current||($u.current=Au,Iu(plainWords(Au)))},[Au,lo]),jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite","data-balloon-words-announce":"",...VISUALLY_HIDDEN,children:Ru})}function BalloonNow({busy:Au=!1}){const lo=useChatWords();return jsxRuntimeExports.jsxs(Box,{as:"span","data-balloon-now":Au?"busy":"",display:"inline-flex",alignItems:"center",gap:"6px",fontSize:0,fontWeight:"semibold",color:"accent.fg",textTransform:"uppercase",letterSpacing:"0.04em",sx:{"@keyframes balloonNowBreathe":{"0%, 100%":{opacity:1,transform:"scale(1)"},"50%":{opacity:.35,transform:"scale(0.7)"}},"& [data-balloon-now-dot]":{width:6,height:6,borderRadius:"50%",bg:"accent.emphasis",animation:Au?"balloonNowBreathe 1.2s ease-in-out infinite":"none"},"@media (prefers-reduced-motion: reduce)":{"& [data-balloon-now-dot]":{animation:"none"}}},children:[jsxRuntimeExports.jsx(Box,{as:"span","data-balloon-now-dot":"","aria-hidden":"true"}),lo.now]})}function conversationHeaderText(Au,lo=ENGLISH_CHAT_WORDS){return Au>0?`${lo.conversation} · ${Au}`:lo.conversation}function ConversationBalloonHeader({count:Au}){const lo=useChatWords();return jsxRuntimeExports.jsx(Box,{"data-balloon-header":"",flexShrink:0,display:"flex",alignItems:"center",gap:2,pl:3,pr:6,py:2,borderBottom:"1px solid",borderColor:"border.muted",bg:"canvas.default",borderTopLeftRadius:"var(--theme-radius-bubble, 16px)",borderTopRightRadius:"var(--theme-radius-bubble, 16px)",children:jsxRuntimeExports.jsx(Text$3,{sx:{fontSize:0,fontWeight:"semibold",color:"fg.muted"},children:conversationHeaderText(Au,lo)})})}function CurrentBalloonBody({text:Au,tool:lo,busy:$u=!1,speaking:Ru=!1,attachment:Iu,waiting:Pu=!1,whole:Ou=!1,fullText:Du,onOverflow:Mu}){const Lu=reactExports.useRef(null),Bu=!Ou&&!!Au&&!!Du&&Du!==Au;return reactExports.useLayoutEffect(()=>{const ju=Lu.current;!ju||Ou||!Mu||Mu(ju.scrollHeight>ju.clientHeight+1)},[Au,Ou,Mu]),jsxRuntimeExports.jsxs(Box,{"data-balloon-current":"",display:"flex",flexDirection:"column",gap:1,minWidth:0,children:[jsxRuntimeExports.jsx(BalloonNow,{busy:$u}),lo?jsxRuntimeExports.jsx(BalloonToolCall,{line:lo,waiting:Pu}):Au?jsxRuntimeExports.jsxs(Box,{"aria-busy":Ru,ref:Lu,"data-balloon-current-text":Ou?"whole":"",maxHeight:Ou?240:"5.6em",overflowY:Ou?"auto":void 0,overflowWrap:"anywhere",pr:Ou?1:void 0,overflow:Ou?void 0:"hidden",children:[Bu?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{"aria-hidden":"true",children:jsxRuntimeExports.jsx(ChatMarkdown,{density:"compact",text:Au})}),jsxRuntimeExports.jsx(Box,{as:"span","data-balloon-words-whole":"",...VISUALLY_HIDDEN,children:plainWords(Du??"")})]}):jsxRuntimeExports.jsx(ChatMarkdown,{density:"compact",text:Ou?Du??Au:Au}),Pu&&jsxRuntimeExports.jsx(Box,{as:"span",ml:2,display:"inline-flex",children:jsxRuntimeExports.jsx(TypingDots,{size:5})})]}):Pu?jsxRuntimeExports.jsx(TypingDots,{size:6}):null,Iu,jsxRuntimeExports.jsx(WordsAnnouncer,{text:lo?void 0:Du??Au,speaking:Ru}),jsxRuntimeExports.jsx(ToolLineAnnouncer,{line:lo})]})}const BalloonExpandContext=reactExports.createContext(null);function BalloonExpandButton({title:Au,onExpand:lo}){const $u=useChatWords();return jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"invisible",leadingVisual:ScreenFullIcon,"aria-label":$u.expandWhat(Au),"data-balloon-expand":"",onClick:lo,sx:{alignSelf:"flex-start",px:1},children:$u.expand})}const EXPANDED_DIALOG_SIZE={width:"80vw",height:"80vh"};function ExpandedVisual({visual:Au,target:lo,onClose:$u}){const Ru=lo?.current;return lo?Ru?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Box,{"data-balloon-expanded":"target","data-balloon-visual":Au.id,position:"relative",minWidth:0,children:[jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,right:0,zIndex:1,children:jsxRuntimeExports.jsx(IconButton,{icon:Au.shrink?ScreenNormalIcon:XIcon,size:"small",variant:"invisible","aria-label":`${Au.shrink?"Shrink":"Close"} ${Au.title}`,"data-balloon-expanded-close":"",...Au.shrink?{"data-balloon-shrink":""}:{},onClick:$u})}),Au.render("target")]}),Ru):null:jsxRuntimeExports.jsx(Dialog$1,{title:Au.title,onClose:$u,sx:{width:EXPANDED_DIALOG_SIZE.width,maxWidth:EXPANDED_DIALOG_SIZE.width,height:EXPANDED_DIALOG_SIZE.height,maxHeight:EXPANDED_DIALOG_SIZE.height},children:jsxRuntimeExports.jsx(Box,{"data-balloon-expanded":"overlay","data-balloon-visual":Au.id,minWidth:0,children:Au.render("overlay")})})}function focusExpanded(Au){const lo=Au?.current;if(!lo)return;const $u=typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;lo.scrollIntoView?.({behavior:$u?"auto":"smooth",block:"start"}),(lo.querySelector('[tabindex="-1"]')??lo).focus?.({preventScroll:!0})}function BalloonSuggestions({suggestions:Au,onSuggestion:lo}){const $u=useChatWords();return jsxRuntimeExports.jsx(Box,{role:"group","aria-label":$u.suggestions,"data-balloon-suggestions":"",display:"flex",flexWrap:"wrap",gap:1,mt:2,children:Au.map(Ru=>jsxRuntimeExports.jsx(ButtonComponent,{size:"small","data-balloon-suggestion":Ru.label,"aria-label":`Ask: ${Ru.prompt}`,title:Ru.prompt,onClick:()=>lo(Ru),sx:{borderRadius:999},children:Ru.label},Ru.label))})}const BALLOON_HISTORY_MAX_HEIGHT=220,COPIED_MS=1500,BALLOON_HISTORY_WITH_ATTACHMENT_MAX_HEIGHT=120;function BalloonHistoryLarge({history:Au,tool:lo,attachment:$u}){const Ru=useChatWords();return jsxRuntimeExports.jsxs(Box,{role:"log","aria-label":Ru.conversation,"data-balloon-history-large":"",display:"flex",flexDirection:"column",gap:2,children:[jsxRuntimeExports.jsx(BalloonChatItems,{items:withToolCall(Au,lo),density:"comfortable"}),$u?jsxRuntimeExports.jsx(Box,{children:$u}):null]})}function BalloonHistory({history:Au,onOpen:lo,maxHeight:$u=BALLOON_HISTORY_MAX_HEIGHT,onExpand:Ru,tool:Iu,waiting:Pu=!1}){const Ou=useChatWords(),Du=reactExports.useRef(null),Mu=Au[Au.length-1]?.id;return reactExports.useEffect(()=>{const Lu=Du.current;Lu&&(Lu.scrollTop=Lu.scrollHeight)},[Au.length,Mu,Pu,Iu?.id,Iu?.phase]),reactExports.useEffect(()=>{const Lu=Du.current,Bu=Lu?.firstElementChild;if(!Lu||!Bu||typeof ResizeObserver>"u")return;const ju=new ResizeObserver(()=>{Lu.scrollTop=Lu.scrollHeight});return ju.observe(Bu),()=>ju.disconnect()},[]),jsxRuntimeExports.jsxs(Box,{"data-balloon-history":"",flex:1,minWidth:0,display:"flex",flexDirection:"column",children:[jsxRuntimeExports.jsx(Box,{as:"button",type:"button","data-balloon-peek":"","data-balloon-header":"",onClick:lo,m:0,p:0,pb:1,border:0,bg:"transparent",font:"inherit",textAlign:"left",cursor:"pointer",fontSize:0,fontWeight:"semibold",color:"fg.muted",hover:{textDecoration:"underline"},children:conversationHeaderText(conversationCount(Au),Ou)}),Ru?jsxRuntimeExports.jsx(IconButton,{icon:ScreenFullIcon,size:"small",variant:"invisible","aria-label":Ou.expandConversation,"data-balloon-history-expand":"",onClick:Ru,sx:{position:"absolute",top:"4px",right:"28px"}}):null,jsxRuntimeExports.jsx(Box,{ref:Du,role:"log","aria-label":Ou.conversation,"data-balloon-history-list":"",maxHeight:$u,overflowY:"auto",display:"flex",flexDirection:"column",pr:1,children:jsxRuntimeExports.jsx(BalloonChatItems,{items:withToolCall(Au,Iu),waiting:Pu})})]})}function SpeechBalloon({text:Au,more:lo=!1,onOpen:$u,above:Ru,side:Iu="above",align:Pu,tailAt:Ou,approval:Du,decide:Mu,onDecisionActive:Lu,wide:Bu=!1,onDismissPeek:ju,display:Fu="history",tool:zu,speaking:Uu=!1,busy:Hu=!1,attachment:Vu,history:Gu,onExpand:Wu,expandTitle:Zu,suggestions:Ju,onSuggestion:Yu,waiting:Xu=!1,fullText:ed,onExpandHistory:td}){const nd=useChatWords(),[od,sd]=reactExports.useState(!1),[ad,pd]=reactExports.useState(!1),[bd,wd]=reactExports.useState(!1),_d=async()=>{try{await globalThis.navigator?.clipboard?.writeText(Sd),wd(!0),setTimeout(()=>wd(!1),COPIED_MS)}catch{}},yd=!!ed&&ed!==Au||!!lo&&Au.endsWith("…"),Sd=ed??Au;reactExports.useEffect(()=>{sd(!1)},[Sd.slice(0,40)]);const kd=Ju&&Ju.length>0&&Yu&&!Du?Ju:null,md=Fu==="current",dd=!md&&Gu&&Gu.length>0?Gu:null;return jsxRuntimeExports.jsxs(Box,{"data-speech-balloon":"","data-balloon-display":Fu,maxWidth:Bu||dd||kd||od||md&&Vu?300:md?260:280,px:3,py:2,color:"fg.default",border:"1px solid",borderRadius:"bubble",boxShadow:"shadow.medium",fontSize:1,textAlign:"left",bottom:Iu==="above"?`${Ru}px`:void 0,top:Iu==="above"?void 0:`${Ru}px`,sx:{position:"absolute",[Pu]:0,width:Bu||dd||kd||od||md&&Vu?300:"max-content",bg:"canvas.overlay",borderColor:md?"accent.muted":"border.default","&::after":{content:'""',position:"absolute",...Iu==="above"?{bottom:"-7px"}:{top:"-7px"},[Pu]:`${Ou-6}px`,width:12,height:12,bg:"canvas.overlay",borderRight:"1px solid",borderBottom:"1px solid",borderColor:md?"accent.muted":"border.default",transform:Iu==="above"?"rotate(45deg)":"rotate(225deg)"}},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"flex-start",gap:1,children:[md&&!Du?jsxRuntimeExports.jsx(Box,{role:"button",tabIndex:0,"data-balloon-peek":"",onClick:vd=>{const ld=vd.target.closest("button");ld&&vd.currentTarget.contains(ld)||$u()},onKeyDown:vd=>{vd.target===vd.currentTarget&&(vd.key==="Enter"||vd.key===" ")&&(vd.preventDefault(),$u())},flex:1,minWidth:0,m:0,p:0,border:0,bg:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",children:jsxRuntimeExports.jsx(CurrentBalloonBody,{text:Au,tool:zu,busy:Hu,speaking:Uu,waiting:Xu,whole:od,fullText:Sd,onOverflow:pd})}):dd?jsxRuntimeExports.jsx(BalloonHistory,{history:dd,onOpen:$u,onExpand:td,tool:zu,waiting:Xu,maxHeight:Vu?BALLOON_HISTORY_WITH_ATTACHMENT_MAX_HEIGHT:BALLOON_HISTORY_MAX_HEIGHT}):zu?jsxRuntimeExports.jsx(Box,{flex:1,minWidth:0,children:jsxRuntimeExports.jsx(BalloonToolCall,{line:zu})}):jsxRuntimeExports.jsx(Box,{as:"button",type:"button","data-balloon-peek":"","data-balloon-more":lo?"":void 0,onClick:$u,flex:1,minWidth:0,m:0,p:0,border:0,bg:"transparent",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",hover:{textDecoration:"underline"},children:jsxRuntimeExports.jsx(Box,{as:"span",role:"status","aria-live":"polite",children:Au})}),ju&&!Du?jsxRuntimeExports.jsx(IconButton,{icon:XIcon,size:"small",variant:"invisible","aria-label":nd.dismiss,"data-balloon-dismiss":"",onClick:ju,sx:{mt:"-4px",mr:"-8px",flexShrink:0}}):null]}),!Du&&!zu&&!dd&&Sd.trim()?jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mt:1,"data-balloon-under":"",children:[md&&(yd||ad||od)?jsxRuntimeExports.jsx(Box,{as:"button",type:"button","aria-expanded":od,"data-balloon-whole":od?"less":"more",onClick:()=>sd(!od),m:0,p:0,border:0,bg:"transparent",color:"accent.fg",font:"inherit",fontSize:0,cursor:"pointer",hover:{textDecoration:"underline"},children:od?nd.showLess:nd.showMore}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx(IconButton,{icon:bd?CheckIcon:CopyIcon,size:"small",variant:"invisible","aria-label":nd.copyWords,"data-balloon-copy":bd?"copied":"",onClick:vd=>{vd.stopPropagation(),_d()},sx:{color:"fg.muted",mr:"-6px",mb:"-4px"}})]}):null,!md&&!dd&&Xu?jsxRuntimeExports.jsx(Box,{"data-balloon-waiting":"",mt:1,children:jsxRuntimeExports.jsx(BalloonChatItems,{items:[],waiting:!0})}):null,Du&&jsxRuntimeExports.jsxs(Box,{"data-balloon-approval":Du.id,mt:1,children:[jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,fontWeight:"semibold"},children:Du.asks}),Du.why?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:Du.why}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,mt:2,children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",disabled:Du.deciding,onClick:Du.onApprove,children:nd.approve}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",disabled:Du.deciding,onClick:Du.onDeny,children:nd.deny})]}),Du.others>0?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,mt:1,color:"fg.muted",fontSize:0},children:nd.moreWaiting(Du.others)}):null]}),kd&&Yu?jsxRuntimeExports.jsx(BalloonSuggestions,{suggestions:kd,onSuggestion:Yu}):null,Vu?jsxRuntimeExports.jsxs(Box,{"data-balloon-attachment":"",mt:2,display:"flex",flexDirection:"column",gap:1,children:[Vu,Wu?jsxRuntimeExports.jsx(BalloonExpandButton,{title:Zu??nd.theVisual,onExpand:Wu}):null]}):null,md?null:jsxRuntimeExports.jsx(ToolLineAnnouncer,{line:zu}),Mu&&jsxRuntimeExports.jsx(DecisionAsk,{ask:Mu,onActiveChange:Lu})]})}const MENU_DESCRIPTION_MAX=60;function shortDescription(Au){const lo=Au.replace(/\s+/g," ").trim();if(lo.length<=MENU_DESCRIPTION_MAX)return lo;const $u=lo.slice(0,MENU_DESCRIPTION_MAX),Ru=$u.lastIndexOf(" ");return`${(Ru>MENU_DESCRIPTION_MAX/2?$u.slice(0,Ru):$u).replace(/[\s,.;:!?—-]+$/,"")}…`}function menuGroups(Au){const lo=[];for(const $u of Au){const Ru=lo.find(Iu=>Iu.group===$u.group);Ru?Ru.items.push($u):lo.push({group:$u.group,items:[$u]})}return[...lo.filter($u=>$u.group===void 0),...lo.filter($u=>$u.group!==void 0)]}function opensContextMenu(Au){return Au.key==="ContextMenu"||Au.key==="F10"&&Au.shiftKey}const LONG_PRESS_MS=550;function AssistantContextMenu({at:Au,items:lo,onClose:$u,returnFocusRef:Ru,label:Iu}){const Pu=reactExports.useRef(null),Ou=Au!==null;if(reactExports.useEffect(()=>{if(!Ou)return;const Mu=()=>$u();return window.addEventListener("scroll",Mu,!0),()=>window.removeEventListener("scroll",Mu,!0)},[Ou,$u]),!Au||typeof document>"u")return null;const Du=menuGroups(lo);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactDomExports.createPortal(jsxRuntimeExports.jsx("div",{ref:Pu,"aria-hidden":"true","data-assistant-menu-anchor":"",style:{position:"fixed",left:Au.x,top:Au.y,width:1,height:1,pointerEvents:"none"}}),document.body),jsxRuntimeExports.jsx(ActionMenu,{open:!0,anchorRef:Pu,onOpenChange:Mu=>{Mu||($u(),requestAnimationFrame(()=>Ru?.current?.focus()))},children:jsxRuntimeExports.jsx(ActionMenu.Overlay,{width:"auto","data-assistant-menu":"",children:jsxRuntimeExports.jsx(ActionList,{"aria-label":Iu,children:Du.map(({group:Mu,items:Lu},Bu)=>{const ju=Lu.some(zu=>zu.checked!==void 0),Fu=Lu.map(zu=>jsxRuntimeExports.jsxs(ActionList.Item,{"data-assistant-menu-item":zu.id,disabled:zu.disabled,variant:zu.danger?"danger":"default",...ju?{selected:!!zu.checked}:{},onSelect:()=>{zu.onSelect(),$u(),requestAnimationFrame(()=>Ru?.current?.focus())},children:[zu.icon&&jsxRuntimeExports.jsx(ActionList.LeadingVisual,{children:jsxRuntimeExports.jsx(zu.icon,{})}),zu.label,zu.description&&jsxRuntimeExports.jsx(ActionList.Description,{variant:"block",children:jsxRuntimeExports.jsx("span",{title:zu.description,children:shortDescription(zu.description)})})]},zu.id));return jsxRuntimeExports.jsxs(ActionList.Group,{...ju?{selectionVariant:"single"}:{},children:[Mu&&jsxRuntimeExports.jsx(ActionList.GroupHeading,{children:Mu}),Fu]},Mu??`ungrouped-${Bu}`)})})})})]})}const BALLOON_GRACE_MS=700,BALLOON_HOVER_START={shown:!1,over:!1,focused:!1};function balloonHover(Au,lo){switch(lo){case"enter":return{...Au,over:!0,shown:!0};case"leave":return{...Au,over:!1};case"focus":return{...Au,focused:!0,shown:!0};case"blur":return{...Au,focused:!1};case"grace":return Au.over||Au.focused?Au:{...Au,shown:!1};case"escape":return{...Au,shown:!1};case"outside":return{...Au,shown:!1,over:!1,focused:!1}}}function graceRuns(Au){return Au.shown&&!Au.over&&!Au.focused}const DEFAULT_AVATAR_MODEL_URL="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r170/examples/models/gltf/RobotExpressive/RobotExpressive.glb",AVATAR_3D_ID="model3d";function assistantModel3D(Au){const lo=Au?.url||DEFAULT_AVATAR_MODEL_URL;return{kind:"model3d",id:AVATAR_3D_ID,name:lo===DEFAULT_AVATAR_MODEL_URL?"Robot (3D)":"3D avatar",url:lo}}function isAssistantModel3D(Au){return typeof Au=="object"&&Au!==null&&Au.kind==="model3d"}const NO_WEBGL_SENTENCE="This avatar is a 3D model, and this browser cannot draw 3D: WebGL is turned off or missing.",modelNotLoadedSentence=(Au,lo)=>`The 3D avatar could not be loaded from ${Au}: ${lo}`;function webglAvailable(Au=typeof document>"u"?void 0:document){if(!Au)return!1;try{const lo=Au.createElement("canvas");return!!(lo.getContext?.("webgl2")??lo.getContext?.("webgl"))}catch{return!1}}const prefersReducedMotion=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function idleClipName(Au){return Au.find(lo=>lo.toLowerCase()==="idle")??Au.find(lo=>/idle/i.test(lo))??Au[0]}const STATE_CLIPS={idle:{names:[/^idle$/i,/idle/i]},greeting:{names:[/^wave$/i,/wave|greet|hello/i],once:!0},thinking:{names:[/think|ponder/i]},working:{names:[/work|typing/i,/^walk(ing)?$/i]},waiting:{names:[/wait/i]},speaking:{names:[/talk|speak/i]},paused:{names:[/^sit(ting)?$/i,/sit/i],once:!0,holds:!0},goodbye:{names:[/bye/i,/^wave$/i,/wave/i],once:!0}};function stateMotion(Au,lo){const $u=STATE_CLIPS[Au];for(const Ru of $u.names){const Iu=lo.find(Pu=>Ru.test(Pu));if(Iu)return{clip:Iu,own:!0,once:!!$u.once,holds:!!$u.holds,procedural:!1}}return{clip:idleClipName(lo),own:!1,once:!1,holds:!1,procedural:!0}}const REST_POSE={headPitch:0,headYaw:0,headRoll:0,bodyYaw:0,bodyLean:0,bodyLift:0,bodyShift:0},REST=REST_POSE;function proceduralPose(Au,lo){const $u=Math.max(0,lo),Ru=Math.sin;switch(Au){case"idle":return{...REST,headYaw:.08*Ru($u*.45),bodyLift:.006*Ru($u*2)};case"greeting":{const Iu=Math.max(.15,1-$u/2);return{...REST,bodyYaw:.3*Ru($u*7+Math.PI/2)*Iu,headRoll:.15*Ru($u*7+Math.PI/2)*Iu,bodyLift:.035*Math.abs(Ru($u*7+Math.PI/2))*Iu}}case"thinking":return{...REST,headPitch:-.16+.03*Ru($u*.7),headRoll:.24+.04*Ru($u*.8),headYaw:.22*Ru($u*.6+.4),bodyYaw:.07*Ru($u*.5)};case"working":return{...REST,headPitch:.22,headYaw:.12*Ru($u*3),bodyLift:.02*Math.abs(Ru($u*10+.3))};case"waiting":return{...REST,bodyLean:.12,headPitch:-.06,headRoll:-.14+.05*Ru($u*1.6),bodyLift:.014*Ru($u*2.4)};case"speaking":return{...REST,headPitch:.07*Ru($u*4.6),headYaw:.12*Ru($u*1.7+.6),headRoll:.05*Ru($u*2.3),bodyYaw:.04*Ru($u*1.1)};case"paused":return{...REST,headPitch:.35,bodyLean:.1,bodyLift:-.03};case"goodbye":return{...REST,bodyYaw:.3*Ru($u*7+Math.PI/2),bodyLift:-.12*Math.min(1,$u/.7)}}}function accentPose(Au,lo){return Au==="working"?{...REST,headPitch:.16+.03*Math.sin(Math.max(0,lo)*3)}:REST}const OUT_OF_FRAME=1.25;function leavingPose(Au){const lo=Number.isFinite(Au)?Math.max(0,Au):60;return{...REST,bodyYaw:Math.PI/2,bodyShift:Math.min(OUT_OF_FRAME,.9*lo),bodyLift:lo<3?.012*Math.abs(Math.sin(lo*8)):0}}const GOODBYE_WAVE_SECONDS=1.2,CROSSFADE_SECONDS=.4,POSE_FOLLOW_RATE=7;function dampedPose(Au,lo,$u,Ru=POSE_FOLLOW_RATE){const Iu=1-Math.exp(-Math.max(0,$u)*Ru),Pu={...Au};for(const Ou of Object.keys(lo))Pu[Ou]=Au[Ou]+(lo[Ou]-Au[Ou])*Iu;return Pu}function walkClipName(Au){return Au.find(lo=>/^walk(ing)?$/i.test(lo))}const TALKING_MORPH=/mouth|jaw|open|^v?_?aa$|viseme_aa|surprised/i;function talkingMorphIndices(Au){return Object.entries(Au??{}).filter(([lo])=>TALKING_MORPH.test(lo)).map(([,lo])=>lo)}function talkAmount({speaking:Au,level:lo,reducedMotion:$u,seconds:Ru}){return!Au||$u?0:lo!==void 0?Math.max(0,Math.min(1,lo)):.25+.25*Math.abs(Math.sin(Ru*9))}function smoothed(Au,lo,$u){const Ru=1-Math.exp(-Math.max(0,$u)*18);return Au+(lo-Au)*Ru}function cameraDistance(Au,lo){const $u=lo*Math.PI/360;return Math.max(Au,.001)/2/Math.tan($u)*1.15}const Avatar3D=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/Avatar3D-g7pP5vZ4.js"),[],import.meta.url)),MOTIONS={"@keyframes assistantFloat":{"0%, 100%":{transform:"translateY(0)"},"50%":{transform:"translateY(-3px)"}},"@keyframes assistantBlink":{"0%, 94%, 100%":{transform:"scaleY(0)"},"97%":{transform:"scaleY(1)"}},"@keyframes assistantTilt":{"0%, 100%":{transform:"rotate(-5deg)"},"50%":{transform:"rotate(-8deg) translateY(-2px)"}},"@keyframes assistantWork":{"0%, 100%":{transform:"rotate(-3deg) translateY(0)"},"50%":{transform:"rotate(3deg) translateY(-4px)"}},"@keyframes assistantAttention":{"0%, 100%":{transform:"scale(1) rotate(0)"},"20%":{transform:"scale(1.08) rotate(-6deg)"},"40%":{transform:"scale(1.08) rotate(6deg)"},"60%":{transform:"scale(1)"}},"@keyframes assistantHop":{"0%, 100%":{transform:"translateY(0)"},"30%":{transform:"translateY(-14px)"},"55%":{transform:"translateY(0)"},"75%":{transform:"translateY(-6px)"}},"@keyframes assistantTalk":{"0%, 100%":{transform:"scaleY(1)"},"50%":{transform:"scaleY(2.2)"}},"@keyframes assistantDoze":{"0%, 100%":{transform:"translateY(2px) scale(1, 0.97)"},"50%":{transform:"translateY(3px) scale(1.02, 0.95)"}},"@keyframes assistantLeave":{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.2) translateY(20px)",opacity:0}}},BODY="& .assistant-body",AWAY_CHOICES=[{away:"page",label:"Hide for now"},{away:"session",label:"Hide for this session"},{away:"always",label:"Don’t show again"}],AgentInspectorDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/AgentInspectorDialog-DeK96QG1.js"),[],import.meta.url)),AgentDetailsDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/AgentDetailsDialog-CXN0RO_L.js"),[],import.meta.url)),SandboxDetailsDialog=reactExports.lazy(()=>__vitePreload(()=>import("./chunks/SandboxDetailsDialog-qJBg2naH.js"),[],import.meta.url));function assistantMenuItems(Au){const lo=[];if(Au.inspect&&lo.push({id:"inspect",label:"Inspect the agent…",icon:PulseIcon,onSelect:Au.inspect}),Au.agentDetails&&lo.push({id:"agent-details",label:"Agent Details…",icon:DependabotIcon,onSelect:Au.agentDetails}),Au.sandboxDetails&&lo.push({id:"sandbox-details",label:"Code Sandbox Details…",icon:CodeIcon,onSelect:Au.sandboxDetails}),Au.conversationLabel!==!1&&lo.push({id:"conversation",label:Au.conversationLabel??(Au.open?"Close the conversation":"Open the conversation"),icon:CommentDiscussionIcon,onSelect:Au.onToggle}),Au.busy&&Au.onStop&&lo.push({id:"stop",label:"Stop the turn",icon:SquareFillIcon,onSelect:Au.onStop}),Au.onNewChat&&lo.push({id:"new-chat",label:"New conversation",icon:PlusIcon,onSelect:Au.onNewChat}),Au.onClear&&lo.push({id:"clear",label:"Clear the conversation",icon:TrashIcon,onSelect:Au.onClear}),Au.suggestions?.length&&Au.onSuggestion){const $u=Au.onSuggestion;for(const Ru of Au.suggestions)lo.push({id:`suggestion:${Ru.label}`,label:Ru.label,description:Ru.prompt,group:"Suggestions",disabled:Au.busy,onSelect:()=>$u(Ru)})}if(Au.onBalloonDisplayChange){const $u=Au.onBalloonDisplayChange;lo.push({id:"balloon-history",label:"History",group:"Balloon",checked:Au.balloonDisplay!=="current",onSelect:()=>$u("history")},{id:"balloon-current",label:"Current",group:"Balloon",checked:Au.balloonDisplay==="current",onSelect:()=>$u("current")})}Au.onChangeCharacter&&lo.push({id:"character",label:"Change avatar…",icon:PencilIcon,onSelect:Au.onChangeCharacter}),Au.speech&&lo.push({id:"speech",label:Au.speech.muted?"Unmute speech":"Mute speech",icon:Au.speech.muted?UnmuteIcon:MuteIcon,onSelect:Au.speech.onToggle}),Au.characterSounds&&lo.push({id:"character-sounds",label:Au.characterSounds.on?"Mute its sounds":"Play its sounds",icon:Au.characterSounds.on?MuteIcon:UnmuteIcon,onSelect:Au.characterSounds.onToggle}),Au.onResetPosition&&lo.push({id:"reset-position",label:"Reset position",icon:ScreenNormalIcon,onSelect:Au.onResetPosition}),Au.about&&lo.push({id:"about",label:`About ${Au.name}`,icon:InfoIcon,onSelect:Au.about}),lo.push(...Au.extra??[]);for(const $u of AWAY_CHOICES)lo.push({id:`away:${$u.away}`,label:$u.label,group:"Send away",icon:XIcon,onSelect:()=>Au.onDismiss($u.away)});return lo}const BALLOON_ROOM=200;function pixels(Au){if(typeof Au=="number")return Au;const lo=typeof Au=="string"?/^(-?\d+(?:\.\d+)?)px$/.exec(Au):null;return lo?Number(lo[1]):void 0}function balloonSide(Au,lo={width:typeof window>"u"?1280:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}){const $u=pixels(Au.left),Ru=pixels(Au.top),Iu=$u!==void 0?$u<lo.width/2?"left":"right":Au.left!==void 0&&Au.right===void 0?"left":"right";return{side:Ru!==void 0?Ru<BALLOON_ROOM?"below":"above":Au.top!==void 0&&Au.bottom===void 0?"below":"above",align:Iu}}const CLEAR_CHECK_MS=400;function useKeepClear(Au,lo,$u){const[Ru,Iu]=reactExports.useState(!1),[Pu,Ou]=reactExports.useState(!1);return reactExports.useEffect(()=>{if($u){Iu(!1);return}const Du=()=>{const Lu=Au.current;if(!Lu)return;const Bu=Lu.getBoundingClientRect(),ju=lo?.current,Fu=Array.from(document.querySelectorAll(ASSISTANT_OBSTACLES)).some(zu=>{if(Lu.contains(zu)||zu.contains(Lu)||ju?.contains(zu))return!1;const Uu=zu.getBoundingClientRect();return Uu.width>0&&Uu.height>0&&boxesMeet(Bu,Uu)});Iu(Fu)};Du();const Mu=window.setInterval(Du,CLEAR_CHECK_MS);return()=>window.clearInterval(Mu)},[Au,lo,$u]),reactExports.useEffect(()=>{if($u){Ou(!1);return}let Du,Mu=!1;const Lu=Bu=>{const ju=Au.current,Fu=Bu.target;!ju||Fu&&(ju.contains(Fu)||lo?.current?.contains(Fu))||Bu.type==="pointermove"&&Bu.buttons===0&&!Mu||pointerNear(ju.getBoundingClientRect(),{x:Bu.clientX,y:Bu.clientY})&&(Mu=!0,Ou(!0),clearTimeout(Du),Du=setTimeout(()=>{Mu=!1,Ou(!1)},POINTER_CALM_MS))};return document.addEventListener("pointerdown",Lu,!0),document.addEventListener("pointermove",Lu,!0),()=>{clearTimeout(Du),document.removeEventListener("pointerdown",Lu,!0),document.removeEventListener("pointermove",Lu,!0)}},[Au,lo,$u]),Ru?"obstacle":Pu?"pointer":void 0}function useMouth(Au,lo,$u){reactExports.useEffect(()=>{const Ru=Au.current,Iu=typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(!Ru||!lo||!$u||Iu){Ru?.removeAttribute("data-assistant-mouth");return}let Pu=0;const Ou=()=>{Ru.setAttribute("data-assistant-mouth",String(mouthOpening(lo()))),Pu=requestAnimationFrame(Ou)};return Pu=requestAnimationFrame(Ou),()=>{cancelAnimationFrame(Pu),Ru.removeAttribute("data-assistant-mouth")}},[Au,lo,$u])}function AssistantStage({character:Au,state:lo,size:$u=88,replay:Ru,place:Iu,stageRef:Pu,onDragStart:Ou,open:Du,onToggle:Mu,onCharacterClick:Lu,onCharacterKeyDown:Bu,balloon:ju,insist:Fu=!1,onDismiss:zu,ownRef:Uu,decide:Hu,mouthLevel:Vu,stayPut:Gu=!1,balloonDisplay:Wu="history",expandTarget:Zu,expandOnArrival:Ju=!1,suggestions:Yu,onSuggestion:Xu,inspector:ed,inspectAgent:td,conversationLabel:nd,onBalloonDisplayChange:od,onStop:sd,onNewChat:ad,onClear:pd,onChangeCharacter:bd,speech:wd,onResetPosition:_d,about:yd,sandbox:Sd,contextMenu:kd,agentName:md,label:dd}){const vd=useChatWords(),ld=isAssistantModel3D(Au)?Au:void 0,ud=typeof Au=="string"?shippedAssistantCharacter(Au):!ld&&"Drawing"in Au?Au:void 0,hd=ud?ud.name:ld?ld.name:Au.name,gd=md??hd,Ed=reactExports.useId(),Td=!!(md||dd),{colorScheme:Rd}=useTheme(),jd=Rd?.startsWith("dark")?"dark":"light",[Cd,$d]=reactExports.useReducer(balloonHover,BALLOON_HOVER_START),Id=Cd.shown,Vd=graceRuns(Cd);reactExports.useEffect(()=>{if(!Vd)return;const xh=setTimeout(()=>$d("grace"),BALLOON_GRACE_MS);return()=>clearTimeout(xh)},[Vd]),reactExports.useEffect(()=>{if(!Id)return;const xh=Ph=>{const Kh=Ph.target;Kh&&Pu.current?.contains(Kh)||$d("outside")};return document.addEventListener("pointerdown",xh,!0),()=>document.removeEventListener("pointerdown",xh,!0)},[Id,Pu]);const[Dd,Wd]=reactExports.useState(!1),[oh,rh]=reactExports.useState(null),[Eh,ah]=reactExports.useState(!1),[yh,vh]=reactExports.useState(!1),[Jd,Qd]=reactExports.useState(null),sh=reactExports.useRef(null),Oh=reactExports.useRef(void 0),qd=reactExports.useCallback(()=>rh(null),[]),[zd,Pd]=reactExports.useState(!1),Od=!ud&&!ld&&Object.keys(Au.sounds??{}).length>0;reactExports.useEffect(()=>()=>clearTimeout(Oh.current),[]);const Gd=reactExports.useRef(null),Md=useKeepClear(Pu,Uu,Dd||oh!==null||Eh||yh||Jd!==null||Gu),Kd=Iu.left===void 0&&Iu.top===void 0?pixels(Iu.right):void 0,Xd=pixels(Iu.bottom);reactExports.useEffect(()=>{if(Md||Kd===void 0||Xd===void 0)return;const xh=document.documentElement;return xh.style.setProperty(ASSISTANT_CLEARANCE_VAR,`${Kd+$u}px`),()=>{xh.style.removeProperty(ASSISTANT_CLEARANCE_VAR)}},[Md,Kd,Xd,$u]),useMouth(Pu,Vu,lo==="speaking");const[ph,_h]=reactExports.useState(!1),Sh=!Md&&!Du&&!!ju&&(Id||Fu||ph),Wh=(lo==="idle"||lo==="greeting")&&!ju?.tool&&!ju?.approval&&!ju?.busy,xd=assistantMenuItems({name:gd,open:Du,onToggle:Mu,onDismiss:zu,conversationLabel:nd,inspect:ed?()=>ah(!0):void 0,agentDetails:yd?()=>Qd("agent"):void 0,sandboxDetails:Sd?()=>Qd("sandbox"):void 0,balloonDisplay:Wu,onBalloonDisplayChange:od,suggestions:Yu,onSuggestion:Xu,busy:lo==="thinking"||lo==="working"||lo==="speaking",onStop:sd,onNewChat:ad,onClear:pd,onChangeCharacter:bd,speech:wd,characterSounds:Od?{on:zd,onToggle:()=>Pd(xh=>!xh)}:void 0,onResetPosition:_d,about:yd?()=>vh(!0):void 0,extra:kd}),Hd=ju?.visual,[Zd,gh]=reactExports.useState(null),Ch=Hd?()=>{gh(Hd),Zu&&requestAnimationFrame(()=>focusExpanded(Zu))}:null,wh=ju?.history,Th=Wu!=="current"&&wh&&wh.length>0?{id:"balloon-history",title:conversationHeaderText(conversationCount(wh),vd),shrink:!0,render:()=>jsxRuntimeExports.jsx(BalloonHistoryLarge,{history:wh,tool:ju?.tool,attachment:ju?.attachment})}:null,$h=Zd?.id==="balloon-history"?Th:Zd;return reactExports.useEffect(()=>{Hd&&Ju&&Zu&&gh(Hd)},[Hd?.id,Ju,!!Zu]),jsxRuntimeExports.jsxs(Box,{ref:Pu,"data-assistant-state":lo,"data-assistant-aside":Md,"data-assistant-balloon":Wu,sx:{position:"fixed",zIndex:1002,...Iu,width:$u,height:$u,opacity:Md?0:1,visibility:Md?"hidden":"visible",pointerEvents:Md?"none":void 0,transition:Md?ld?"opacity 150ms ease 1.4s, visibility 0s linear 1.55s":"opacity 150ms ease, visibility 0s linear 150ms":"opacity 150ms ease",...MOTIONS,"& .assistant-lids ellipse":{transformBox:"fill-box",transformOrigin:"top",transform:"scaleY(0)",animation:"assistantBlink 5.2s ease-in-out infinite"},[BODY]:{transformBox:"fill-box",transformOrigin:"50% 100%"},"& .assistant-pupils":{transition:"transform var(--theme-motion-status, 120ms) var(--theme-motion-easing, ease)"},"& .assistant-mouth":{transformBox:"fill-box",transformOrigin:"center"},'&[data-assistant-state="idle"] .assistant-body':{animation:"assistantFloat 3.2s ease-in-out infinite"},'&[data-assistant-state="thinking"] .assistant-body':{animation:"assistantTilt 2.4s ease-in-out infinite"},'&[data-assistant-state="thinking"] .assistant-pupils':{transform:"translate(-1px, -3px)"},'&[data-assistant-state="working"] .assistant-body':{animation:"assistantWork 0.7s ease-in-out infinite"},'&[data-assistant-state="working"] .assistant-pupils':{transform:"translate(2px, 2px)"},'&[data-assistant-state="waiting"] .assistant-body':{animation:"assistantAttention 1.4s ease-in-out infinite"},'&[data-assistant-state="greeting"] .assistant-body':{animation:"assistantHop 0.9s ease-out 2"},'&[data-assistant-state="speaking"] .assistant-mouth':{animation:"assistantTalk 0.24s ease-in-out infinite"},'&[data-assistant-state="speaking"] .assistant-body':{animation:"assistantFloat 1.6s ease-in-out infinite"},"&[data-assistant-mouth] .assistant-mouth":{animation:"none",transition:"transform 60ms linear"},'&[data-assistant-mouth="0"] .assistant-mouth':{transform:"scaleY(1)"},'&[data-assistant-mouth="1"] .assistant-mouth':{transform:"scaleY(1.5)"},'&[data-assistant-mouth="2"] .assistant-mouth':{transform:"scaleY(2.1)"},'&[data-assistant-mouth="3"] .assistant-mouth':{transform:"scaleY(2.8)"},'&[data-assistant-state="paused"] .assistant-body':{animation:"assistantDoze 4.8s ease-in-out infinite",filter:"grayscale(0.5)",opacity:.8},'&[data-assistant-state="paused"] .assistant-lids ellipse':{animation:"none",transform:"scaleY(1)"},'&[data-assistant-state="goodbye"] .assistant-body':{animation:"assistantLeave 0.6s ease-in forwards"},'&[data-assistant-state="goodbye"] .assistant-sprite':{animation:"assistantLeave 0.6s ease-in forwards"},"@media (prefers-reduced-motion: reduce)":{"& *":{animation:"none !important"},transition:"none"}},onMouseEnter:()=>$d("enter"),onMouseLeave:()=>$d("leave"),onFocus:xh=>{let Ph=!0;try{Ph=xh.target.matches(":focus-visible")}catch{}Ph&&$d("focus")},onBlur:xh=>{const Ph=xh.relatedTarget;(!Ph||!xh.currentTarget.contains(Ph))&&$d("blur")},onKeyDown:xh=>{xh.key==="Escape"&&Id&&$d("escape")},children:[$h&&jsxRuntimeExports.jsx(ExpandedVisual,{visual:$h,target:Zu,onClose:()=>gh(null)}),Sh&&ju&&jsxRuntimeExports.jsx(BalloonExpandContext.Provider,{value:Ch,children:jsxRuntimeExports.jsx(SpeechBalloon,{text:ju.text,more:ju.more,approval:ju.approval,onDismissPeek:ju.onDismiss,display:Wu,tool:ju.tool,speaking:ju.speaking,busy:ju.busy,attachment:ju.attachment,history:ju.history,onExpand:Ch??void 0,expandTitle:Hd?.title,onExpandHistory:Th?()=>{gh(Th),Zu&&requestAnimationFrame(()=>focusExpanded(Zu))}:void 0,suggestions:Wh?Yu:void 0,fullText:ju.fullText,waiting:(lo==="thinking"||lo==="working"||lo==="waiting")&&!ju.speaking,onSuggestion:Xu,decide:Hu,onDecisionActive:_h,wide:ph,onOpen:Mu,above:$u+8,side:balloonSide(Iu).side,align:balloonSide(Iu).align,tailAt:$u/2})}),jsxRuntimeExports.jsxs(Box,{as:"button",type:"button","aria-label":dd??(Du?`Close the conversation with ${gd}`:`Talk to ${gd}`),"aria-describedby":Td?Ed:void 0,"aria-expanded":Du,"aria-haspopup":"menu",ref:sh,"data-assistant-figure":"",onContextMenu:xh=>{xh.preventDefault(),clearTimeout(Oh.current),rh({x:xh.clientX,y:xh.clientY})},onKeyDown:xh=>{if(opensContextMenu(xh)){xh.preventDefault();const Ph=xh.currentTarget.getBoundingClientRect();rh({x:Ph.left+Ph.width/2,y:Ph.bottom});return}Bu?.(xh)},onPointerUp:()=>clearTimeout(Oh.current),onPointerCancel:()=>clearTimeout(Oh.current),onPointerMove:xh=>{const Ph=Gd.current;Ph&&Math.hypot(xh.clientX-Ph.x,xh.clientY-Ph.y)>8&&clearTimeout(Oh.current)},onPointerDown:xh=>{if(Gd.current={x:xh.clientX,y:xh.clientY},xh.pointerType==="touch"){const Ph={x:xh.clientX,y:xh.clientY};clearTimeout(Oh.current),Oh.current=setTimeout(()=>{Gd.current={x:-1e6,y:-1e6},rh(Ph)},LONG_PRESS_MS)}Ou(xh)},onClick:xh=>{const Ph=Gd.current;Gd.current=null,!(Ph&&Math.hypot(xh.clientX-Ph.x,xh.clientY-Ph.y)>4)&&(Lu??Mu)()},display:"block",width:$u,height:$u,p:0,border:0,bg:"transparent",cursor:"grab",filter:"drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18))",active:{cursor:"grabbing"},focusVisible:{outline:"2px solid",outlineColor:"var(--focus-outlineColor, var(--fgColor-accent))",outlineOffset:2,borderRadius:"50%"},touchAction:"none",children:[Td&&jsxRuntimeExports.jsx(Box,{as:"span",id:Ed,position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",children:`Its avatar: ${hd}`}),ud?jsxRuntimeExports.jsx(ud.Drawing,{size:$u,mode:jd,state:lo,mouthLevel:Vu}):ld?jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("span",{"aria-busy":"true",style:{display:"block",width:$u,height:$u}}),children:jsxRuntimeExports.jsx(Avatar3D,{avatar:ld,state:lo,size:$u,mouthLevel:Vu,aside:Md!==void 0,replay:Ru})}):jsxRuntimeExports.jsx(SpriteCharacter,{character:Au,state:lo,size:$u,sounds:zd,mouthLevel:Vu})]}),(Id||Dd)&&!Md&&lo!=="goodbye"&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:"-6px",right:"-6px",children:jsxRuntimeExports.jsxs(ActionMenu,{open:Dd,onOpenChange:Wd,children:[jsxRuntimeExports.jsx(ActionMenu.Anchor,{children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,"aria-label":`Send ${gd} away`,size:"small",variant:"invisible","data-assistant-dismiss":"",sx:{bg:"canvas.default",borderRadius:"50%",boxShadow:"shadow.small"}})}),jsxRuntimeExports.jsx(ActionMenu.Overlay,{width:"auto",children:jsxRuntimeExports.jsx(ActionList,{children:AWAY_CHOICES.map(xh=>jsxRuntimeExports.jsx(ActionList.Item,{"data-assistant-away":xh.away,onSelect:()=>zu(xh.away),children:xh.label},xh.away))})})]})}),jsxRuntimeExports.jsx(AssistantContextMenu,{at:oh,items:xd,onClose:qd,returnFocusRef:sh,label:`${gd}’s menu`}),Eh&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(AgentInspectorDialog,{tracer:ed??null,agent:td,title:`${yd?.name??gd} · Agent Inspector`,onClose:()=>{ah(!1),sh.current?.focus()}})}),Jd==="agent"&&yd&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(AgentDetailsDialog,{about:yd,name:gd,onClose:()=>{Qd(null),sh.current?.focus()}})}),Jd==="sandbox"&&Sd&&jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(SandboxDetailsDialog,{sandbox:Sd,name:yd?.name??gd,onClose:()=>{Qd(null),sh.current?.focus()}})}),yh&&yd&&jsxRuntimeExports.jsx(Dialog$1,{title:`About ${yd.name??gd}`,onClose:()=>{vh(!1),sh.current?.focus()},"data-assistant-about":"",children:[["Agent",yd.name],["Spec",yd.spec],["Model",yd.model],["Runs",yd.where],["Avatar",hd]].filter(([,xh])=>xh).map(([xh,Ph])=>jsxRuntimeExports.jsxs(Text$3,{as:"p",sx:{m:0,mb:1},children:[jsxRuntimeExports.jsxs(Text$3,{sx:{color:"fg.muted"},children:[xh,": "]}),Ph]},xh))})]})}const CONVERSATION_BALLOON_WIDTH=380,CONVERSATION_BALLOON_MAX_HEIGHT=560,CONVERSATION_BALLOON_VIEWPORT_SHARE=.6,CURRENT_BALLOON_HEIGHT=230;function conversationBalloonHeight(Au){return Math.max(240,Math.min(CONVERSATION_BALLOON_MAX_HEIGHT,Math.round(Au*CONVERSATION_BALLOON_VIEWPORT_SHARE)))}const TAIL=7;function balloonTailAt(Au,lo,$u=CONVERSATION_BALLOON_WIDTH){return Math.min($u-24-TAIL,Math.max(24,Au-lo-TAIL))}function conversationBalloonSx(Au,lo="canvas.default"){return{borderRadius:"var(--theme-radius-bubble, 16px)",overflow:"visible",...Au.edge==="none"?{}:{"&::after":{content:'""',position:"absolute",...Au.edge==="bottom"?{bottom:`-${TAIL}px`}:{top:`-${TAIL}px`},left:`${Au.at}px`,width:`${TAIL*2}px`,height:`${TAIL*2}px`,bg:lo,borderRight:"1px solid",borderBottom:"1px solid",borderColor:"border.default",transform:Au.edge==="bottom"?"rotate(45deg)":"rotate(225deg)",pointerEvents:"none"}}}}function ConversationBalloonClose({name:Au,onClose:lo}){return jsxRuntimeExports.jsx(Box,{"data-conversation-balloon-close":"",position:"absolute",top:"6px",right:"6px",zIndex:30,children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,size:"small",variant:"invisible","aria-label":Au?`Close the conversation with ${Au}`:"Close the conversation",onClick:lo,sx:{bg:"canvas.default",borderRadius:"50%"}})})}function BalloonApprovalMessage({approval:Au}){const lo=useChatWords(),$u=reactExports.useRef(null);return reactExports.useEffect(()=>{$u.current?.scrollIntoView?.({block:"nearest"})},[Au.id]),jsxRuntimeExports.jsx(Box,{ref:$u,"data-balloon-approval":Au.id,px:3,py:2,display:"flex",children:jsxRuntimeExports.jsxs(Box,{maxWidth:"90%",px:3,py:2,bg:"attention.subtle",border:"1px solid",borderColor:"attention.muted",borderRadius:"var(--theme-radius-bubble, 16px)",fontSize:1,children:[jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:lo.waitingForYou}),jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,fontWeight:"semibold"},children:Au.asks}),Au.why?jsxRuntimeExports.jsx(Text$3,{as:"p",sx:{m:0,color:"fg.muted",fontSize:0},children:Au.why}):null,jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,mt:2,alignItems:"center",children:[jsxRuntimeExports.jsx(ButtonComponent,{size:"small",variant:"primary",disabled:Au.deciding,onClick:Au.onApprove,children:lo.approve}),jsxRuntimeExports.jsx(ButtonComponent,{size:"small",disabled:Au.deciding,onClick:Au.onDeny,children:lo.deny}),Au.others>0?jsxRuntimeExports.jsx(Text$3,{sx:{color:"fg.muted",fontSize:0},children:lo.moreWaiting(Au.others)}):null]})]})})}const PEEK_LIMIT=60;function peekLine(Au,lo=PEEK_LIMIT){const $u=Au.replace(/\s+/g," ").trim();if($u.length<=lo)return{text:$u,more:!1};const Ru=$u.slice(0,lo);return{text:`${Ru.slice(0,Math.max(Ru.lastIndexOf(" "),lo*.6)).trimEnd()}…`,more:!0}}const PRESENCE_LINES={idle:"Ready",thinking:"Thinking…",working:"Working…",waiting:"Waiting for you",paused:"Paused"};function presenceState(Au,lo,$u=!1){return $u?"paused":lo?.open&&lo.pendingApproval?"waiting":Au?lo?.open?"working":"thinking":"idle"}function presenceToolOf(Au){for(let lo=Au.length-1;lo>=0;lo-=1){const $u=Au[lo];if(typeof $u.toolName=="string"&&$u.toolCallId){const Ru=$u.status!=="complete"&&$u.status!=="error",Iu=Ru&&$u.result?.pending_approval===!0;return{open:Ru,pendingApproval:Iu}}}return{open:!1,pendingApproval:!1}}const LIVE=new Set(["running","idle","busy","starting"]);function sandboxIsLive(Au){return Au.status===void 0||LIVE.has(Au.status)}const NO_SANDBOX_YET="No sandbox is running yet: run a cell or ask the agent to execute code.",SANDBOX_KIND_LABELS={browser:"Python in your browser (Pyodide)",local:"Local Jupyter server",jupyter:"Jupyter server",cloud:"Datalayer cloud runtime",runtime:"In the agent runtime"};function isLocalUrl(Au){if(!Au)return!1;try{const lo=new URL(Au).hostname;return lo==="localhost"||lo==="127.0.0.1"||lo==="::1"||lo==="[::1]"||lo.endsWith(".localhost")}catch{return!1}}const SECRET_PARAMS=/^(token|access_token|api_key|apikey|key|auth|password|secret|signature|sig|jwt)$/i;function displayUrl(Au){if(Au)try{const lo=new URL(Au);lo.username="",lo.password="";for(const $u of[...lo.searchParams.keys()])SECRET_PARAMS.test($u)&&lo.searchParams.delete($u);return lo.toString()}catch{return Au.split("?")[0]}}const text$3=Au=>typeof Au=="string"&&Au?Au:void 0;function assistantSandboxOf(Au,lo={}){if(!Au)return;const $u=text$3(Au.variant),Ru=text$3(Au.jupyter_url)??text$3(Au.agent_base_url),Iu=Au.sandbox_running===!0||Au.jupyter_connected===!0;return!$u&&!Iu?void 0:{kind:$u==="datalayer"?"cloud":$u==="jupyter-server"||$u==="jupyter"?isLocalUrl(text$3(Au.jupyter_url))?"local":"jupyter":"runtime",status:lo.state??(Iu?"running":"stopped"),variant:$u,url:Ru,token:text$3(Au.jupyter_token),kernelId:text$3(Au.kernel_id),agentId:lo.agentId,environment:text$3(Au.environment_name),serverUrl:lo.serverUrl}}function sandboxExecuteOverHttp(Au,lo){const $u=Au.replace(/\/+$/,"").replace(/\/api\/v1$/,"");return async Ru=>{const Iu=await fetch(`${$u}/api/v1/sandbox/execute`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:Ru,agent_id:lo})});if(!Iu.ok)return{stdout:"",error:`The sandbox did not run the code (HTTP ${Iu.status}).`};const Pu=await Iu.json();return{stdout:Pu.stdout??"",error:Pu.error??void 0}}}function timeLeft(Au,lo=Date.now()){if(Au===null)return"never";if(Au===void 0||Au==="")return;const $u=typeof Au=="number"?Au<1e12?Au*1e3:Au:Date.parse(Au);if(!Number.isFinite($u))return;const Ru=Math.round(($u-lo)/6e4);if(Ru<=0)return"ended";const Iu=Math.floor(Ru/60);return Iu?`${Iu} h ${Ru%60} min`:`${Ru} min`}function endpointAgentId(Au){return Au?.match(/\/api\/v1\/(?:ag-ui|vercel-ai|a2a\/agents|acp\/ws)\/([^/]+)/)?.[1]}function useIsMobile(Au=640){const[lo,$u]=reactExports.useState(!1);return reactExports.useEffect(()=>{const Ru=()=>{$u(window.innerWidth<Au)};return Ru(),window.addEventListener("resize",Ru),()=>window.removeEventListener("resize",Ru)},[Au]),lo}const px=Au=>`${Math.round(Au)}px`,clamp=(Au,lo)=>Math.max(8,Math.min(Au,Math.max(8,lo)));function ChatFloating({endpoint:Au,protocol:lo,useStore:$u=!0,title:Ru="Chat",description:Iu="Start a conversation with the AI agent.",position:Pu="bottom-right",defaultOpen:Ou=!1,width:Du=400,height:Mu=550,showHeader:Lu=!0,showButton:Bu=!0,showNewChatButton:ju=!0,showClearButton:Fu=!0,showSettingsButton:zu=!1,enableKeyboardShortcuts:Uu=!0,toggleShortcut:Hu="/",showPoweredBy:Vu=!0,promptVariant:Gu,mentionableAgents:Wu,poweredByProps:Zu,clickOutsideToClose:Ju=!1,escapeToClose:Yu=!0,className:Xu,onSettingsClick:ed,onNewChat:td,onOpen:nd,onClose:od,onStateUpdate:sd,children:ad,brandIcon:pd,buttonIcon:bd,buttonTooltip:wd="Chat with AI",brandColor:_d,buttonGlow:yd=!0,offset:Sd=20,animationDuration:kd=200,frontendTools:md,initialState:dd,suggestions:vd,submitOnSuggestionClick:ld=!0,hideMessagesAfterToolUI:ud=!1,defaultViewMode:hd="floating",onViewModeChange:gd,sidebarMountPoint:Ed=null,showPanelBackdrop:Td=!1,availableModels:Rd,showModelSelector:jd=!1,showToolsMenu:Cd=!1,showSkillsMenu:$d=!1,showTokenUsage:Id=!0,showContextRing:Vd=!1,themeVariant:Dd,themeOverrides:Wd,colorMode:oh,runtimeId:rh,historyEndpoint:Eh,authToken:ah,historyAuthToken:yh,pendingPrompt:vh,showInformation:Jd=!1,onInformationClick:Qd,onToolCallStart:sh,onToolCallComplete:Oh,showToolApprovalBanner:qd,pendingApprovals:zd,onApproveApproval:Pd,onRejectApproval:Od,panelProps:Gd,launching:Md=!1,launchingMessage:Kd,assistantCharacter:Xd=DEFAULT_ASSISTANT_CHARACTER,balloonDisplay:ph=DEFAULT_BALLOON_DISPLAY,expandTarget:_h,conversation:Sh,decisions:Wh,voice:Nd,inspector:xd,onBalloonDisplayChange:Hd,onChangeCharacter:Zd,about:gh,sandbox:Ch,contextMenu:wh}){const Th=useChatWords(),$h=reactExports.useRef(null),[xh,Ph]=reactExports.useState(),[Kh,Dh]=reactExports.useState(!1),[ep,np]=reactExports.useState();reactExports.useEffect(()=>np(void 0),[ph]);const hp=ep??ph,gp=reactExports.useCallback(Mh=>{np(Mh),Hd?.(Mh)},[Hd]),Jh=useChatOpen(),_p=useChatMessages(),sp=useChatStore(Mh=>Mh.setOpen),cp=useChatStore(Mh=>Mh.clearMessages),[qh,zh]=reactExports.useState(Ou),Yh=$u?Jh:qh,Df=$u?sp:zh,Cp=_p,Rh=reactExports.useRef(null),jh=useIsMobile(),[df,Bp]=reactExports.useState(!1),[af,ef]=reactExports.useState(!1),[tp,Yp]=reactExports.useState(hd),[Mf,im]=reactExports.useState(0),[Rf,zf]=reactExports.useState(!1),[Gf,mp]=reactExports.useState(null),zp=tp==="panel"?"sidebar":tp,[xp,Vp]=reactExports.useState(null);reactExports.useLayoutEffect(()=>{Vp(resolveMountPoint(Ed))},[Ed,Yh,tp]);const Gp=disabledChatViewModes({sidebarMountPoint:xp,viewMode:zp}),Up=Gp.includes("sidebar"),tf=tp==="panel"&&!jh&&!!xp,vp=useViewportDrag(Rh),Wf=vp.reset;reactExports.useEffect(()=>{tp!=="floating-draggable"&&Wf()},[tp,Wf]);const mf=88,Pm=tp==="assistant"&&!jh,[Kf,jm]=reactExports.useState(!1),[Hp,vm]=reactExports.useState({open:!1,pendingApproval:!1}),[cm,wf]=reactExports.useState(!1),[Nh,Ud]=reactExports.useState(),[lh,Lh]=reactExports.useState(0),[Bh,pp]=reactExports.useState([]),[ip,Op]=reactExports.useState([]),[Sp]=useVoiceSettings(),hf=reactExports.useMemo(()=>Nd?settledVoice(Nd,Sp):void 0,[Nd,Sp]),{speaker:Dp,state:Uh,stop:ap,read:sm,level:Uf}=useVoiceSpeaker(hf);useSpokenAnswers(ip,Kf,!!Dp&&hf?.output==="always"&&!Kh,Dp);const[pf,Hf]=reactExports.useState(!1),[Zm,Ym]=reactExports.useState(!1),[bm,Sf]=reactExports.useState(keptAway),am=Pm&&bm==="none",Nf=reactExports.useCallback(()=>{keepAway("none"),Sf("none")},[]),[Ef,um]=reactExports.useState(),bp=Sh?Sh.saying:Ef,Zf=Sh?Sh.answering:cm,Yf=Sh?Sh.tool:Nh,Vh=hp==="current",[Ap,Wp]=reactExports.useState(),[gf,bf]=reactExports.useState(!1);reactExports.useEffect(()=>{if(!bp||Yh)return;bf(!0);const Mh=setTimeout(()=>bf(!1),12e3);return()=>clearTimeout(Mh)},[bp?.id,bp?.text,Yh]),reactExports.useEffect(()=>{Yh&&bp&&Wp(bp.id)},[Yh,bp?.id]);const ym=reactExports.useRef(null),Jf=useViewportDrag(ym,{whole:!0});reactExports.useEffect(()=>{if(!am)return;Hf(!0);const Mh=setTimeout(()=>Hf(!1),1800);return()=>clearTimeout(Mh)},[am]);const Tp=assistantStateOf(Sh?Sh.presence:presenceState(Kf,Hp),{arriving:pf,leaving:Zm,speaking:Zf,voicing:Uh.speaking}),qf=!!bp&&bp.id!==Ap,[Fm,lf]=reactExports.useState(!1),Zh=zd?.[0],Mp=Zh&&Pd&&Od?{id:Zh.id,asks:Zh.toolDescription||Zh.toolName,others:(zd?.length??1)-1,deciding:Fm,onApprove:()=>{lf(!0),Promise.resolve(Pd(Zh.id)).finally(()=>lf(!1))},onDeny:()=>{lf(!0),Promise.resolve(Od(Zh.id)).finally(()=>lf(!1))}}:void 0,dm=useDecisionAsker(Wh?.serverUrl?{serverUrl:Wh.serverUrl,token:Wh.token,agentId:Wh.agentId??endpointAgentId(Au)}:void 0),rf=Tp==="thinking"||Tp==="working"||Tp==="speaking",Cf=Yf&&(Yf.phase==="running"||rf)?Yf:void 0,s0=rf&&!Zf?Th.thinking:(bp?.more?bp.text:bp?.markdown)||void 0,a0=rf&&!Zf?void 0:bp?.more?bp.markdown:void 0,_m=!Vh&&!Sh&&Bh.length>0?Bh:void 0,Om=Mh=>_m?{...Mh,history:_m}:Mh,hg=Tp==="paused"?{text:Th.paused}:Uh.sentence?{text:Uh.sentence}:Uh.refused?{text:Uh.refused}:Mp?Om({text:Th.waitingForYou,approval:Mp}):Tp==="waiting"?{text:Th.waitingOpen}:Cf?Om({text:toolLineText(Cf,Th),tool:Cf,busy:rf}):Vh&&(qf||rf)?{text:s0??Iu,fullText:a0,more:bp?.more,speaking:Zf&&rf,busy:rf,onDismiss:bp?()=>{Wp(bp.id),bf(!1)}:void 0}:Om(qf&&bp?{...peekLine(bp.text),onDismiss:()=>{Wp(bp.id),bf(!1)}}:{text:Iu}),D0=!!Uh.sentence||Tp==="greeting"||Tp==="waiting"||!!Mp||!!Cf||Vh&&rf||qf&&(Tp==="speaking"||gf),qg=reactExports.useMemo(()=>Sh||!vd?.length?void 0:vd.map(Mh=>({label:Mh.title,prompt:Mh.message})),[Sh,vd]),Vg=reactExports.useCallback(Mh=>{$h.current?$h.current.send(Mh.prompt):Ph(Mh.prompt)},[]),l0=Gd?.onSendReady,jv=reactExports.useCallback(Mh=>{$h.current=Mh,l0?.(Mh)},[l0]),Ag=Gd?.onLoadingChange,I1=Gd?.onDisplayItemsChange,pv=reactExports.useCallback(Mh=>{jm(Mh),Ag?.(Mh)},[Ag]),Fv=reactExports.useCallback(Mh=>{const Np=presenceToolOf(Mh);vm(wp=>wp.open===Np.open&&wp.pendingApproval===Np.pendingApproval?wp:Np),wf(newestIsAnswer(Mh));const Qf=newestToolLine(Mh);Ud(wp=>wp?.id===Qf?.id&&wp?.phase===Qf?.phase?wp:Qf),Lh(conversationCount(Mh)),pp(Mh),Op(Mh);const wm=latestSaying(Mh);um(wp=>wp?.id===wm?.id&&wp?.text===wm?.text?wp:wm),I1?.(Mh)},[I1]),Gg=reactExports.useCallback(Mh=>{if(!(Mh==="sidebar"&&Up))if(Mh==="sidebar"){if(gd){gd(Mh);return}Yp("panel"),im(Np=>Np+1)}else Mh==="assistant"&&Nf(),Yp(Mh),im(Np=>Np+1),gd?.(Mh)},[gd,Up,Nf]);reactExports.useLayoutEffect(()=>{if(tp!=="panel"||jh){zf(!1);return}if(xp){zf(!0);return}const Mh=Rh.current?.parentElement;if(!Mh){zf(!1);return}const Np=window.getComputedStyle(Mh),Qf=Np.display.includes("flex")&&(Np.flexDirection==="row"||Np.flexDirection==="row-reverse"),wm=Np.display.includes("grid");zf(Qf||wm)},[tp,jh,Yh,xp]);const Tg=typeof Du=="number"?Du:typeof Du=="string"&&Number.parseInt(Du,10)||420;reactExports.useLayoutEffect(()=>{if(jh||tp!=="panel"||Rf||!Yh){mp(null);return}const Mh=Rh.current?.parentElement;if(!Mh){mp(null);return}const Np=Mh.style.paddingRight,Qf=Mh.style.boxSizing,wm=window.getComputedStyle(Mh).paddingRight;Mh.style.boxSizing="border-box",Mh.style.paddingRight=`calc(${wm} + ${Tg}px)`;const wp=()=>{const mg=Mh.getBoundingClientRect();mp(Sm=>{const ig=mg.height<1?{top:0,height:window.innerHeight,right:0}:{top:mg.top,height:mg.height,right:Math.max(0,window.innerWidth-mg.right)};return Sm&&Math.abs(Sm.top-ig.top)<1&&Math.abs(Sm.height-ig.height)<1&&Math.abs(Sm.right-ig.right)<1?Sm:ig})};wp(),window.addEventListener("resize",wp),window.addEventListener("scroll",wp,!0);const Um=new ResizeObserver(wp);return Um.observe(Mh),()=>{window.removeEventListener("resize",wp),window.removeEventListener("scroll",wp,!0),Um.disconnect(),Mh.style.paddingRight=Np,Mh.style.boxSizing=Qf}},[jh,tp,Rf,Yh,Tg]);const zm=reactExports.useMemo(()=>{if(lo&&typeof lo=="object")return lo;if(!Au)return;const Mh=typeof lo=="string"?lo:void 0,Np=Au.match(/^(.*?)\/api\/v1\//)?.[1]||Au.match(/^(https?:\/\/[^/]+)/)?.[1]||"",Qf=Au.match(/\/api\/v1\/(ag-ui|vercel-ai|a2a|acp)\//),wm=Mh??Qf?.[1]??"vercel-ai",wp=endpointAgentId(Au);return{type:wm,endpoint:Au,agentId:wp,authToken:ah,enableConfigQuery:jd||Cd||$d||Id,configEndpoint:jd||Cd||$d||Id?`${Np}/api/v1/configure`:void 0}},[lo,Au,ah,jd,Cd,$d,Id]),pg=Au?.match(/^(.*?)\/api\/v1\//)?.[1],Xh=reactExports.useMemo(()=>gh||zm?.agentId?{name:Ru,protocol:zm?.type,url:zm?.endpoint,agentId:zm?.agentId,apiBase:pg,...gh}:void 0,[gh,zm,Ru,pg]),zv=useAgentRuntimeCodemodeStatus(),Uv=reactExports.useMemo(()=>Ch??assistantSandboxOf(zv?.sandbox,{agentId:zm?.agentId,serverUrl:pg})??(zm?.agentId&&pg?{kind:"runtime",status:"not running",agentId:zm.agentId,serverUrl:pg}:void 0),[Ch,zv,zm?.agentId,pg]);reactExports.useEffect(()=>{cp()},[Au,lo]),reactExports.useEffect(()=>{Df(Ou)},[]);const Vf=reactExports.useCallback(()=>{const Mh=!Yh;Bp(!0),Mh?(Df(Mh),nd?.()):setTimeout(()=>{Df(Mh),od?.(),Bp(!1)},kd),setTimeout(()=>Bp(!1),kd)},[Yh,Df,nd,od,kd]),P1=reactExports.useCallback(Mh=>{Yh&&Vf(),keepAway(Mh),Ym(!0),setTimeout(()=>{Ym(!1),Sf(Mh)},600)},[Yh,Vf]),kg=typeof window>"u"?1280:window.innerWidth,c0=typeof window>"u"?800:window.innerHeight,Xf=conversationBalloonHeight(c0),fv=Vh&&!Sh,Wg=fv?CURRENT_BALLOON_HEIGHT:Xf,mv=()=>{const Mh=CONVERSATION_BALLOON_WIDTH,Np=Wg;if(Jf.position){const{left:Sm,top:ig}=Jf.position,qv=Sm+mf/2<kg/2,N0=ig-Np-16,em=ig+mf+16,gg=N0<8&&em+Np>c0-8,vg=gg?qv?Sm+mf+16:Sm-Mh-16:qv?Sm:Sm+mf-Mh,vv=gg?ig+mf-Np:N0>=8?N0:em,Em=clamp(vg,kg-Mh-8);return{place:{left:px(Em),top:px(clamp(vv,c0-Np-8)),right:"auto",bottom:"auto"},tail:gg?{edge:"none"}:{edge:N0>=8?"bottom":"top",at:balloonTailAt(Sm+mf/2,Em)}}}const Qf=Pu.endsWith("right"),wm=Qf?kg-Sd-mf/2:Sd+mf/2,wp=Qf?kg-Sd-Mh:Sd,Um={edge:Pu.startsWith("bottom")?"bottom":"top",at:balloonTailAt(wm,wp)},mg=hm();return{place:Pu.startsWith("bottom")?{...mg,bottom:px(Sd+mf+16)}:{...mg,top:px(Sd+mf+16)},tail:Um}},Af=reactExports.useCallback(()=>{$u&&cp(),td?.()},[$u,cp,td]),Kg=reactExports.useCallback(()=>{window.confirm("Clear all messages?")&&$u&&cp()},[$u,cp]);useChatKeyboardShortcuts({onToggle:Uu?Vf:void 0,onNewChat:Uu?Af:void 0,onClear:Uu&&Cp.length>0?Kg:void 0,enabled:Uu}),reactExports.useEffect(()=>{if(!Yu||!Yh)return;const Mh=Np=>{Np.key==="Escape"&&Vf()};return document.addEventListener("keydown",Mh),()=>document.removeEventListener("keydown",Mh)},[Yu,Yh,Vf]);const gv=!!Sh;reactExports.useEffect(()=>{if(!gv||!Yh)return;const Mh=setTimeout(()=>{Rh.current?.querySelector('[data-chat-composer] textarea, [data-chat-composer] [contenteditable="true"], textarea')?.focus()},kd);return()=>clearTimeout(Mh)},[gv,Yh,kd,Mf]),reactExports.useEffect(()=>{if(!am||!Yh)return;const Mh=setTimeout(()=>{const Np=Rh.current?.querySelector("[data-chat-history]");Np?.scrollTo?.({top:Np.scrollHeight})},kd);return()=>clearTimeout(Mh)},[am,Yh,kd]),reactExports.useEffect(()=>{if(!Ju||!Yh)return;const Mh=Qf=>{Rh.current&&!Rh.current.contains(Qf.target)&&Vf()},Np=setTimeout(()=>{document.addEventListener("mousedown",Mh)},100);return()=>{clearTimeout(Np),document.removeEventListener("mousedown",Mh)}},[Ju,Yh,Vf]),reactExports.useEffect(()=>{if(jh&&Yh)return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.touchAction="none",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width="",document.body.style.touchAction=""}},[jh,Yh]);const hm=()=>{const Mh={position:"fixed",zIndex:1e3};switch(Pu){case"bottom-right":Mh.bottom=Sd,Mh.right=Sd;break;case"bottom-left":Mh.bottom=Sd,Mh.left=Sd;break;case"top-right":Mh.top=Sd,Mh.right=Sd;break;case"top-left":Mh.top=Sd,Mh.left=Sd;break}return Mh},Dm=Mh=>{if(Mh)return"scale(1) translateY(0)";switch(Pu){case"bottom-right":case"bottom-left":return"scale(0.95) translateY(20px)";case"top-right":case"top-left":return"scale(0.95) translateY(-20px)";default:return"scale(0.95)"}},fg=Uu?getShortcutDisplay({key:Hu}):void 0,yf=am?mv():void 0,vf=jh?"100%":yf?CONVERSATION_BALLOON_WIDTH:Du,xm=jh?"100%":yf?Wg:Mu,Zg=jh?{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",borderRadius:0}:{},$g=jsxRuntimeExports.jsx(Tooltip,{text:`Close${Yu?" (Esc)":""}`,direction:"s",children:jsxRuntimeExports.jsx(IconButton,{icon:XIcon,"aria-label":"Close",onClick:Vf,variant:"invisible",size:"small"})}),Hv=yf?{showHeader:!1,showPoweredBy:!1,promptVariant:"lexical",showModelSelector:!1,showToolsMenu:!1,showSkillsMenu:!1,showTokenUsage:!1,showContextRing:!1,showInformation:!1,showToolApprovalBanner:!1,showAgentsMenu:!1,showTurnFooter:!1,compact:!0,welcome:Iu,backgroundColor:"canvas.default",borderRadius:"var(--theme-radius-bubble, 16px)",trailingContent:Mp?jsxRuntimeExports.jsx(BalloonApprovalMessage,{approval:Mp}):void 0,footerContent:dm?jsxRuntimeExports.jsx(Box,{"data-balloon-decisions":"",px:3,pb:1,display:"flex",flexDirection:"column",alignItems:"flex-end",fontSize:0,sx:{"& form":{alignSelf:"stretch"},'& [data-balloon-decision="answered"]':{alignSelf:"stretch"}},children:jsxRuntimeExports.jsx(DecisionAsk,{ask:dm})}):void 0}:void 0,Jp=jsxRuntimeExports.jsxs(Box,{ref:Rh,className:Xu,sx:{...am?{[ASSISTANT_CLEARANCE_VAR]:"initial"}:{},position:tp==="panel"&&!jh&&(Rf||tf)?"relative":"fixed",...tp==="floating"&&!jh?{top:0,right:0,bottom:0,left:"auto"}:{},...tp==="floating-small"&&!jh?hm():{},...tp==="floating-draggable"&&!jh?vp.position?{left:px(vp.position.left),top:px(vp.position.top),right:"auto",bottom:"auto"}:hm():{},...yf?yf.place:Pm&&!jh?hm():{},...tp==="panel"&&!jh?{...Rf||tf?{top:"auto",right:"auto",bottom:"auto",left:"auto",marginLeft:"auto",alignSelf:"stretch"}:{top:Gf?`${Gf.top}px`:0,right:Gf?`${Gf.right}px`:0,bottom:Gf?"auto":0,left:"auto"}}:{},width:tp==="panel"&&!jh?Yh||df?`${Tg}px`:"0px":tp==="floating"&&!jh?typeof vf=="number"?`${vf}px`:vf:(tp==="floating-small"||tp==="floating-draggable"||tp==="assistant")&&!jh?typeof vf=="number"?`${vf}px`:vf:jh?"100%":typeof vf=="number"?`${vf}px`:vf,height:tp==="panel"&&!jh?Rf||tf?"100%":Gf?`${Gf.height}px`:"100%":tp==="floating"&&!jh?"100%":(tp==="floating-small"||tp==="floating-draggable"||tp==="assistant")&&!jh?typeof xm=="number"?`${xm}px`:xm:jh?"100%":typeof xm=="number"?`${xm}px`:xm,display:"flex",flexDirection:"column",bg:"canvas.default",border:"1px solid",borderColor:"border.default",borderRadius:tp==="panel"||jh?0:Pm?"var(--theme-radius-bubble, 16px)":"12px",boxShadow:tp==="panel"?"shadow.none":"shadow.extra-large",overflow:"hidden",transform:tp==="panel"?Yh?"translateX(0)":"translateX(100%)":Dm(Yh),opacity:tp==="panel"||Yh?1:0,transition:`transform ${kd}ms ease, opacity ${kd}ms ease, width ${kd}ms ease`,zIndex:tp==="panel"&&!jh&&(Rf||tf)?"auto":1001,visibility:Yh||df?"visible":"hidden",pointerEvents:Yh?"auto":"none",...Zg,...yf?conversationBalloonSx(yf.tail,yf.tail.edge==="bottom"?"canvas.subtle":"canvas.default"):{}},"data-conversation-balloon":yf?"":void 0,"data-balloon-display":yf?hp:void 0,children:[yf?jsxRuntimeExports.jsx(ConversationBalloonClose,{onClose:Vf}):null,yf&&!fv?jsxRuntimeExports.jsx(ConversationBalloonHeader,{count:lh}):null,tp==="floating-draggable"&&!jh&&jsxRuntimeExports.jsx(Box,{onPointerDown:vp.onHandlePointerDown,"aria-label":"Move the chat",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:18,cursor:"grab",color:"fg.subtle",bg:"canvas.subtle",borderBottom:"1px solid",borderColor:"border.muted",active:{cursor:"grabbing"},touchAction:"none",children:jsxRuntimeExports.jsx(GrabberIcon,{size:16})}),Sh?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Lu&&!yf?jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,flexShrink:0,px:3,py:2,borderBottom:"1px solid",borderColor:"border.default",children:[pd||jsxRuntimeExports.jsx(ForwardRef$2,{colored:!0,size:20}),jsxRuntimeExports.jsx(Text$3,{sx:{flex:1,minWidth:0,fontWeight:"semibold",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ru}),$g]}):null,jsxRuntimeExports.jsx(Box,{"data-floating-conversation":!0,flex:"1 1 auto",minHeight:0,display:"flex",borderRadius:yf?"bubble":void 0,overflow:yf?"hidden":void 0,children:Sh.body})]}):jsxRuntimeExports.jsx(ChatBase,{title:Ru,showHeader:Lu,useStore:$u,protocol:zm,themeVariant:Dd,themeOverrides:Wd,colorMode:oh,autoFocus:Yh,focusTrigger:Mf,launching:Md,launchingMessage:Kd,brandIcon:pd||jsxRuntimeExports.jsx(ForwardRef$2,{colored:!0,size:20}),headerButtons:{showNewChat:ju,showClear:Fu&&Cp.length>0,showSettings:zu&&!!ed,onNewChat:Af,onClear:Kg,onSettings:ed},headerActions:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$g}),chatViewMode:zp,onChatViewModeChange:Gg,disabledViewModes:Gp,showPoweredBy:Vu,promptVariant:Gu,mentionableAgents:Wu,poweredByProps:{brandName:"Datalayer",brandUrl:"https://datalayer.ai",...Zu},description:Iu,onStateUpdate:sd,onNewChat:td,suggestions:vd,submitOnSuggestionClick:ld,hideMessagesAfterToolUI:ud,avatarConfig:{showAvatars:!0},placeholder:"Type a message...",backgroundColor:"canvas.subtle",frontendTools:md,showModelSelector:jd,availableModels:Rd,showToolsMenu:Cd,showSkillsMenu:$d,showTokenUsage:Id,showContextRing:Vd,runtimeId:rh,historyEndpoint:Eh,historyAuthToken:yh,pendingPrompt:vh??xh,inspector:xd,showInformation:Jd,onInformationClick:Qd,onToolCallStart:sh,onToolCallComplete:Oh,showToolApprovalBanner:qd,pendingApprovals:zd,onApproveApproval:Pd,onRejectApproval:Od,voice:Nd,voiceSpeaking:Uh.speaking,voiceSentence:Uh.sentence,onStopSpeaking:Dp?ap:void 0,voiceLevel:Uf,onReadAloud:Dp?sm:void 0,...Gd,...Hv,onLoadingChange:pv,onDisplayItemsChange:Fv,onSendReady:jv,children:yf&&fv?jsxRuntimeExports.jsx(Box,{px:3,pt:3,pb:2,overflow:"hidden",children:jsxRuntimeExports.jsx(CurrentBalloonBody,{text:Cf?void 0:s0??Iu,fullText:Cf?void 0:a0,tool:Cf,busy:rf,speaking:Zf&&rf,waiting:rf&&!Zf})}):ad})]}),M0=jsxRuntimeExports.jsx(IconButton,{icon:bd||CommentDiscussionIcon,"aria-label":wd,unsafeDisableTooltip:!!bp,onClick:Pm&&bm==="page"?Nf:Vf,size:"large",sx:{width:56,height:56,borderRadius:"50%",bg:_d||"accent.emphasis",color:"fg.onEmphasis",boxShadow:"shadow.large",transition:"transform 0.2s ease, box-shadow 0.2s ease",transform:af?"scale(1.1)":"scale(1)",...qf?{animation:"chatFloatingBlink 1.1s ease-in-out infinite","@keyframes chatFloatingBlink":{"0%, 100%":{filter:"brightness(1)",boxShadow:"0 0 0 0 rgba(0,0,0,0)"},"50%":{filter:"brightness(1.25)",boxShadow:"0 0 0 6px var(--bgColor-accent-muted, rgba(84,174,255,0.4))"}},"@media (prefers-reduced-motion: reduce)":{animation:"none"}}:{},"&:hover":{bg:_d||"accent.emphasis",boxShadow:"shadow.extra-large"}}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[am&&jsxRuntimeExports.jsx(AssistantStage,{character:Xd,state:Tp,size:mf,place:Jf.position?{left:px(Jf.position.left),top:px(Jf.position.top)}:hm(),stageRef:ym,onDragStart:Jf.onHandlePointerDown,open:Yh,onToggle:Vf,balloon:hg,balloonDisplay:hp,expandTarget:_h,insist:D0,onDismiss:P1,ownRef:Rh,mouthLevel:Uf,suggestions:qg,onSuggestion:Vg,inspector:xd,onBalloonDisplayChange:gp,onStop:Kf&&$h.current?()=>$h.current?.stop():void 0,onNewChat:!Sh&&ju?Af:void 0,onClear:!Sh&&$u?Kg:void 0,onChangeCharacter:Zd,speech:Dp&&hf?.output==="always"?{muted:Kh,onToggle:()=>{Kh||Dp.stop(),Dh(!Kh)}}:void 0,onResetPosition:Jf.position?Jf.reset:void 0,about:Xh,sandbox:Uv,contextMenu:wh}),Bu&&!Yh&&!am&&jsxRuntimeExports.jsx(Box,{sx:{...hm()},children:jsxRuntimeExports.jsxs(Box,{position:"relative",display:"inline-flex",isolation:"isolate",onMouseEnter:()=>ef(!0),onMouseLeave:()=>ef(!1),children:[yd&&jsxRuntimeExports.jsx(ButtonGlow,{color:_d}),af&&bp?jsxRuntimeExports.jsx(SpeechBalloon,{text:bp.text,more:bp.more,onOpen:Vf,above:64,side:Pu.startsWith("bottom")?"above":"below",align:Pu.includes("right")?"right":"left",tailAt:28}):null,bp?M0:jsxRuntimeExports.jsx(Tooltip,{text:`${wd}${fg?` (${fg})`:""}`,direction:Pu.includes("right")?"w":"e",children:M0}),Cp.length>0&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,right:0,minWidth:18,height:18,px:1,display:"flex",alignItems:"center",justifyContent:"center",bg:"danger.emphasis",color:"fg.onEmphasis",borderRadius:"50%",fontSize:0,fontWeight:"bold",pointerEvents:"none",children:jsxRuntimeExports.jsx(Text$3,{sx:{fontSize:0},children:Cp.length>99?"99+":Cp.length})}),qf&&jsxRuntimeExports.jsx(Box,{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"50%",border:"2px solid",borderColor:_d||"accent.emphasis",animation:"pulse 2s infinite",pointerEvents:"none",reducedMotion:{animation:"none",transform:"scale(1.15)",opacity:.6},sx:{"@keyframes pulse":{"0%":{transform:"scale(1)",opacity:1},"100%":{transform:"scale(1.5)",opacity:0}}}})]})}),jh&&Yh&&jsxRuntimeExports.jsx(Box,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"neutral.muted",opacity:.5,zIndex:999,onClick:Vf}),Td&&tp==="panel"&&Yh&&!jh&&jsxRuntimeExports.jsx(Box,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"neutral.muted",opacity:.3,zIndex:1e3,onClick:Vf}),tf&&xp?reactDomExports.createPortal(Jp,xp):Jp]})}const LoopCanvasBlock=defineContributionPoint("loop.canvas.block"),LoopA2uiComponent=defineContributionPoint("loop.a2ui.component"),LoopAppFiles=defineContributionPoint("loop.app.files"),listeners$2=new Set;function requestSurface(Au){if(listeners$2.size===0)return!1;for(const lo of[...listeners$2])lo(Au);return!0}function onSurfaceRequest(Au){return listeners$2.add(Au),()=>{listeners$2.delete(Au)}}const listeners$1=new Set;function focusPrompt(){if(listeners$1.size===0)return!1;for(const Au of[...listeners$1])Au();return!0}function onPromptFocusRequest(Au){return listeners$1.add(Au),()=>{listeners$1.delete(Au)}}function agentServerOf(Au,lo){return Au.target==="datalayer"?Au.agentBaseUrl||void 0:Au.agentBaseUrl||lo}function noRuntimeSaid(Au,lo){return Au.state==="error"?lo.noRuntime(Au.errorReason??""):lo.runtimeStarting}const IDLE_SANDBOX_SNAPSHOT=Object.freeze({state:"idle"}),IDLE_SANDBOX_SNAPSHOT_SIGNAL={value:IDLE_SANDBOX_SNAPSHOT,peek:()=>IDLE_SANDBOX_SNAPSHOT},IDLE_SANDBOX_TARGET_SIGNAL={value:void 0,peek:()=>{}};function loopSurfaceId(Au){return`loop-${Au||"default"}`}function createPromptChannel(){const Au=new Set,lo=[];return{submit($u){if(Au.size===0)return lo.push($u),!0;for(const Ru of[...Au])Ru($u);return!0},subscribe($u){if(Au.add($u),lo.length>0){const Ru=lo.splice(0,lo.length);queueMicrotask(()=>{for(const Iu of Ru)$u(Iu)})}return()=>{Au.delete($u)}}}}const LoopViewType=defineContributionPoint("loop.viewType"),LoopEditorView=defineContributionPoint("loop.chat.surface"),LoopChatSurface=LoopEditorView,LoopFrontendTool=defineContributionPoint("loop.frontendTool"),LoopChatComposer=defineContributionPoint("loop.chat.composer"),LoopChatHeader=defineContributionPoint("loop.chat.header"),LoopSessionAction=defineContributionPoint("loop.session.action");function sessionActionsFor(Au,lo,$u="thread"){return lo?Au.map(Ru=>Ru.value).filter(Ru=>{const Iu=Ru.placement??"thread";return Iu==="both"||Iu===$u}).filter(Ru=>{try{return Ru.when(lo)}catch{return!1}}).sort((Ru,Iu)=>(Ru.order??100)-(Iu.order??100)):[]}const LoopAgentBlueprint=defineContributionPoint("loop.agent.blueprint"),LoopChatSuggestion=defineContributionPoint("loop.chat.suggestion"),LoopAssistantCharacter=defineContributionPoint("loop.assistant.character");defineContributionPoint("loop.assistant.menu");async function sendInstead(Au,lo){if(!Au.sendInstead)return null;try{return await Au.sendInstead.send(lo),{sent:!0}}catch($u){return{sent:!1,refused:$u instanceof Error?$u.message:String($u)}}}const LoopChatExtras=defineContributionPoint("loop.chat.extras"),LoopOpeningNotebook=defineContributionPoint("loop.notebook.opening"),LoopOpeningDocument=defineContributionPoint("loop.document.opening"),LoopAgentGate=defineGate("loop.agent.available"),LoopNotebookToolbar=defineContributionPoint("loop.notebook.toolbar"),LoopNotebookToolbarItem=defineContributionPoint("loop.notebook.toolbar.item"),LoopDocumentToolbar=defineContributionPoint("loop.document.toolbar"),LoopDocumentToolbarItem=defineContributionPoint("loop.document.toolbar.item"),LoopCommand=defineContributionPoint("loop.command"),LoopRunProps=defineContributionPoint("loop.runProps");function runForwardedProps(Au,lo){let $u;for(const Ru of[...Au.map(Iu=>Iu.props()),lo]){if(!Ru)continue;const Iu={...$u?.loop??{},...Ru.loop??{}};$u={...$u,...Ru},Object.keys(Iu).length>0&&($u.loop=Iu)}return $u}defineContributionPoint("loop.mention");const LoopSlots={header:"loop.header",chatHeader:"loop.chatHeader",promptAction:"loop.promptAction",inpromptMenu:"loop.inpromptMenu",footer:"loop.footer",status:"loop.status",root:"root",sidebar:"loop.sidebar"};function sandboxIndicatorState(Au,lo,$u){return Au==="error"?"connected-dead":Au==="starting"?"connected-starting":Au==="stopping"?"disconnecting":Au!=="running"?"disconnected":lo==="busy"||$u?"connected-busy":"connected-idle"}function canOpenView(Au,lo){return Au.canOpen?Au.canOpen(lo):!0}function parseCommand(Au){const lo=Au.trimStart();if(!lo.startsWith("/"))return;const[$u,...Ru]=lo.slice(1).split(/\s+/);if($u)return{name:$u.toLowerCase(),argv:Ru.join(" ").trim()}}const LoopChatLayout=defineContributionPoint("loop.chat.layout"),LoopPromptPanel=defineContributionPoint("loop.prompt.panel"),LoopChatTurn=defineContributionPoint("loop.chat.turn");function defineAgentCapacityPlugin(Au){const{key:lo,displayName:$u,description:Ru,specId:Iu,octicon:Pu,emoji:Ou,codemode:Du,createPayload:Mu,suggestions:Lu,instructions:Bu,model:ju,modeEffect:Fu,name:zu,requiredBackendPlugins:Uu}=Au;return{name:zu??`@datalayer/loop-plugin-agent-${lo}`,...Uu?{requiredBackendPlugins:Uu}:{},displayName:$u,description:Ru,octicon:Pu??"dependabot",emoji:Ou,contributes:[contribution(LoopAgentBlueprint,{id:lo,specId:Iu,createPayload:{description:Ru,agent_library:"pydantic-ai",enable_codemode:Du??!1,...Mu},...Bu?{instructions:Bu}:{},...ju?{model:ju}:{},...Fu?{modeEffect:Fu}:{}},{id:lo}),...Lu&&Lu.length>0?[contribution(LoopChatSuggestion,{id:lo,suggestions:Lu},{id:lo})]:[]]}}var util;(function(Au){Au.assertEqual=Iu=>{};function lo(Iu){}Au.assertIs=lo;function $u(Iu){throw new Error}Au.assertNever=$u,Au.arrayToEnum=Iu=>{const Pu={};for(const Ou of Iu)Pu[Ou]=Ou;return Pu},Au.getValidEnumValues=Iu=>{const Pu=Au.objectKeys(Iu).filter(Du=>typeof Iu[Iu[Du]]!="number"),Ou={};for(const Du of Pu)Ou[Du]=Iu[Du];return Au.objectValues(Ou)},Au.objectValues=Iu=>Au.objectKeys(Iu).map(function(Pu){return Iu[Pu]}),Au.objectKeys=typeof Object.keys=="function"?Iu=>Object.keys(Iu):Iu=>{const Pu=[];for(const Ou in Iu)Object.prototype.hasOwnProperty.call(Iu,Ou)&&Pu.push(Ou);return Pu},Au.find=(Iu,Pu)=>{for(const Ou of Iu)if(Pu(Ou))return Ou},Au.isInteger=typeof Number.isInteger=="function"?Iu=>Number.isInteger(Iu):Iu=>typeof Iu=="number"&&Number.isFinite(Iu)&&Math.floor(Iu)===Iu;function Ru(Iu,Pu=" | "){return Iu.map(Ou=>typeof Ou=="string"?`'${Ou}'`:Ou).join(Pu)}Au.joinValues=Ru,Au.jsonStringifyReplacer=(Iu,Pu)=>typeof Pu=="bigint"?Pu.toString():Pu})(util||(util={}));var objectUtil;(function(Au){Au.mergeShapes=(lo,$u)=>({...lo,...$u})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=Au=>{switch(typeof Au){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(Au)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(Au)?ZodParsedType.array:Au===null?ZodParsedType.null:Au.then&&typeof Au.then=="function"&&Au.catch&&typeof Au.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&Au instanceof Map?ZodParsedType.map:typeof Set<"u"&&Au instanceof Set?ZodParsedType.set:typeof Date<"u"&&Au instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(lo){super(),this.issues=[],this.addIssue=Ru=>{this.issues=[...this.issues,Ru]},this.addIssues=(Ru=[])=>{this.issues=[...this.issues,...Ru]};const $u=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$u):this.__proto__=$u,this.name="ZodError",this.issues=lo}format(lo){const $u=lo||function(Pu){return Pu.message},Ru={_errors:[]},Iu=Pu=>{for(const Ou of Pu.issues)if(Ou.code==="invalid_union")Ou.unionErrors.map(Iu);else if(Ou.code==="invalid_return_type")Iu(Ou.returnTypeError);else if(Ou.code==="invalid_arguments")Iu(Ou.argumentsError);else if(Ou.path.length===0)Ru._errors.push($u(Ou));else{let Du=Ru,Mu=0;for(;Mu<Ou.path.length;){const Lu=Ou.path[Mu];Mu===Ou.path.length-1?(Du[Lu]=Du[Lu]||{_errors:[]},Du[Lu]._errors.push($u(Ou))):Du[Lu]=Du[Lu]||{_errors:[]},Du=Du[Lu],Mu++}}};return Iu(this),Ru}static assert(lo){if(!(lo instanceof ZodError))throw new Error(`Not a ZodError: ${lo}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(lo=$u=>$u.message){const $u={},Ru=[];for(const Iu of this.issues)if(Iu.path.length>0){const Pu=Iu.path[0];$u[Pu]=$u[Pu]||[],$u[Pu].push(lo(Iu))}else Ru.push(lo(Iu));return{formErrors:Ru,fieldErrors:$u}}get formErrors(){return this.flatten()}}ZodError.create=Au=>new ZodError(Au);const errorMap=(Au,lo)=>{let $u;switch(Au.code){case ZodIssueCode.invalid_type:Au.received===ZodParsedType.undefined?$u="Required":$u=`Expected ${Au.expected}, received ${Au.received}`;break;case ZodIssueCode.invalid_literal:$u=`Invalid literal value, expected ${JSON.stringify(Au.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$u=`Unrecognized key(s) in object: ${util.joinValues(Au.keys,", ")}`;break;case ZodIssueCode.invalid_union:$u="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$u=`Invalid discriminator value. Expected ${util.joinValues(Au.options)}`;break;case ZodIssueCode.invalid_enum_value:$u=`Invalid enum value. Expected ${util.joinValues(Au.options)}, received '${Au.received}'`;break;case ZodIssueCode.invalid_arguments:$u="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$u="Invalid function return type";break;case ZodIssueCode.invalid_date:$u="Invalid date";break;case ZodIssueCode.invalid_string:typeof Au.validation=="object"?"includes"in Au.validation?($u=`Invalid input: must include "${Au.validation.includes}"`,typeof Au.validation.position=="number"&&($u=`${$u} at one or more positions greater than or equal to ${Au.validation.position}`)):"startsWith"in Au.validation?$u=`Invalid input: must start with "${Au.validation.startsWith}"`:"endsWith"in Au.validation?$u=`Invalid input: must end with "${Au.validation.endsWith}"`:util.assertNever(Au.validation):Au.validation!=="regex"?$u=`Invalid ${Au.validation}`:$u="Invalid";break;case ZodIssueCode.too_small:Au.type==="array"?$u=`Array must contain ${Au.exact?"exactly":Au.inclusive?"at least":"more than"} ${Au.minimum} element(s)`:Au.type==="string"?$u=`String must contain ${Au.exact?"exactly":Au.inclusive?"at least":"over"} ${Au.minimum} character(s)`:Au.type==="number"?$u=`Number must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${Au.minimum}`:Au.type==="bigint"?$u=`Number must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${Au.minimum}`:Au.type==="date"?$u=`Date must be ${Au.exact?"exactly equal to ":Au.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(Au.minimum))}`:$u="Invalid input";break;case ZodIssueCode.too_big:Au.type==="array"?$u=`Array must contain ${Au.exact?"exactly":Au.inclusive?"at most":"less than"} ${Au.maximum} element(s)`:Au.type==="string"?$u=`String must contain ${Au.exact?"exactly":Au.inclusive?"at most":"under"} ${Au.maximum} character(s)`:Au.type==="number"?$u=`Number must be ${Au.exact?"exactly":Au.inclusive?"less than or equal to":"less than"} ${Au.maximum}`:Au.type==="bigint"?$u=`BigInt must be ${Au.exact?"exactly":Au.inclusive?"less than or equal to":"less than"} ${Au.maximum}`:Au.type==="date"?$u=`Date must be ${Au.exact?"exactly":Au.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(Au.maximum))}`:$u="Invalid input";break;case ZodIssueCode.custom:$u="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$u="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$u=`Number must be a multiple of ${Au.multipleOf}`;break;case ZodIssueCode.not_finite:$u="Number must be finite";break;default:$u=lo.defaultError,util.assertNever(Au)}return{message:$u}};let overrideErrorMap=errorMap;function getErrorMap(){return overrideErrorMap}const makeIssue=Au=>{const{data:lo,path:$u,errorMaps:Ru,issueData:Iu}=Au,Pu=[...$u,...Iu.path||[]],Ou={...Iu,path:Pu};if(Iu.message!==void 0)return{...Iu,path:Pu,message:Iu.message};let Du="";const Mu=Ru.filter(Lu=>!!Lu).slice().reverse();for(const Lu of Mu)Du=Lu(Ou,{data:lo,defaultError:Du}).message;return{...Iu,path:Pu,message:Du}};function addIssueToContext(Au,lo){const $u=getErrorMap(),Ru=makeIssue({issueData:lo,data:Au.data,path:Au.path,errorMaps:[Au.common.contextualErrorMap,Au.schemaErrorMap,$u,$u===errorMap?void 0:errorMap].filter(Iu=>!!Iu)});Au.common.issues.push(Ru)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(lo,$u){const Ru=[];for(const Iu of $u){if(Iu.status==="aborted")return INVALID;Iu.status==="dirty"&&lo.dirty(),Ru.push(Iu.value)}return{status:lo.value,value:Ru}}static async mergeObjectAsync(lo,$u){const Ru=[];for(const Iu of $u){const Pu=await Iu.key,Ou=await Iu.value;Ru.push({key:Pu,value:Ou})}return ParseStatus.mergeObjectSync(lo,Ru)}static mergeObjectSync(lo,$u){const Ru={};for(const Iu of $u){const{key:Pu,value:Ou}=Iu;if(Pu.status==="aborted"||Ou.status==="aborted")return INVALID;Pu.status==="dirty"&&lo.dirty(),Ou.status==="dirty"&&lo.dirty(),Pu.value!=="__proto__"&&(typeof Ou.value<"u"||Iu.alwaysSet)&&(Ru[Pu.value]=Ou.value)}return{status:lo.value,value:Ru}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=Au=>({status:"dirty",value:Au}),OK=Au=>({status:"valid",value:Au}),isAborted=Au=>Au.status==="aborted",isDirty=Au=>Au.status==="dirty",isValid=Au=>Au.status==="valid",isAsync=Au=>typeof Promise<"u"&&Au instanceof Promise;var errorUtil;(function(Au){Au.errToObj=lo=>typeof lo=="string"?{message:lo}:lo||{},Au.toString=lo=>typeof lo=="string"?lo:lo?.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(lo,$u,Ru,Iu){this._cachedPath=[],this.parent=lo,this.data=$u,this._path=Ru,this._key=Iu}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(Au,lo)=>{if(isValid(lo))return{success:!0,data:lo.value};if(!Au.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $u=new ZodError(Au.common.issues);return this._error=$u,this._error}}};function processCreateParams(Au){if(!Au)return{};const{errorMap:lo,invalid_type_error:$u,required_error:Ru,description:Iu}=Au;if(lo&&($u||Ru))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return lo?{errorMap:lo,description:Iu}:{errorMap:(Ou,Du)=>{const{message:Mu}=Au;return Ou.code==="invalid_enum_value"?{message:Mu??Du.defaultError}:typeof Du.data>"u"?{message:Mu??Ru??Du.defaultError}:Ou.code!=="invalid_type"?{message:Du.defaultError}:{message:Mu??$u??Du.defaultError}},description:Iu}}class ZodType{get description(){return this._def.description}_getType(lo){return getParsedType(lo.data)}_getOrReturnCtx(lo,$u){return $u||{common:lo.parent.common,data:lo.data,parsedType:getParsedType(lo.data),schemaErrorMap:this._def.errorMap,path:lo.path,parent:lo.parent}}_processInputParams(lo){return{status:new ParseStatus,ctx:{common:lo.parent.common,data:lo.data,parsedType:getParsedType(lo.data),schemaErrorMap:this._def.errorMap,path:lo.path,parent:lo.parent}}}_parseSync(lo){const $u=this._parse(lo);if(isAsync($u))throw new Error("Synchronous parse encountered promise.");return $u}_parseAsync(lo){const $u=this._parse(lo);return Promise.resolve($u)}parse(lo,$u){const Ru=this.safeParse(lo,$u);if(Ru.success)return Ru.data;throw Ru.error}safeParse(lo,$u){const Ru={common:{issues:[],async:$u?.async??!1,contextualErrorMap:$u?.errorMap},path:$u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)},Iu=this._parseSync({data:lo,path:Ru.path,parent:Ru});return handleResult(Ru,Iu)}"~validate"(lo){const $u={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)};if(!this["~standard"].async)try{const Ru=this._parseSync({data:lo,path:[],parent:$u});return isValid(Ru)?{value:Ru.value}:{issues:$u.common.issues}}catch(Ru){Ru?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),$u.common={issues:[],async:!0}}return this._parseAsync({data:lo,path:[],parent:$u}).then(Ru=>isValid(Ru)?{value:Ru.value}:{issues:$u.common.issues})}async parseAsync(lo,$u){const Ru=await this.safeParseAsync(lo,$u);if(Ru.success)return Ru.data;throw Ru.error}async safeParseAsync(lo,$u){const Ru={common:{issues:[],contextualErrorMap:$u?.errorMap,async:!0},path:$u?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:lo,parsedType:getParsedType(lo)},Iu=this._parse({data:lo,path:Ru.path,parent:Ru}),Pu=await(isAsync(Iu)?Iu:Promise.resolve(Iu));return handleResult(Ru,Pu)}refine(lo,$u){const Ru=Iu=>typeof $u=="string"||typeof $u>"u"?{message:$u}:typeof $u=="function"?$u(Iu):$u;return this._refinement((Iu,Pu)=>{const Ou=lo(Iu),Du=()=>Pu.addIssue({code:ZodIssueCode.custom,...Ru(Iu)});return typeof Promise<"u"&&Ou instanceof Promise?Ou.then(Mu=>Mu?!0:(Du(),!1)):Ou?!0:(Du(),!1)})}refinement(lo,$u){return this._refinement((Ru,Iu)=>lo(Ru)?!0:(Iu.addIssue(typeof $u=="function"?$u(Ru,Iu):$u),!1))}_refinement(lo){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:lo}})}superRefine(lo){return this._refinement(lo)}constructor(lo){this.spa=this.safeParseAsync,this._def=lo,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:$u=>this["~validate"]($u)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(lo){return ZodUnion.create([this,lo],this._def)}and(lo){return ZodIntersection.create(this,lo,this._def)}transform(lo){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:lo}})}default(lo){const $u=typeof lo=="function"?lo:()=>lo;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$u,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(lo){const $u=typeof lo=="function"?lo:()=>lo;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$u,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(lo){const $u=this.constructor;return new $u({...this._def,description:lo})}pipe(lo){return ZodPipeline.create(this,lo)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(Au){let lo="[0-5]\\d";Au.precision?lo=`${lo}\\.\\d{${Au.precision}}`:Au.precision==null&&(lo=`${lo}(\\.\\d+)?`);const $u=Au.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${lo})${$u}`}function timeRegex(Au){return new RegExp(`^${timeRegexSource(Au)}$`)}function datetimeRegex(Au){let lo=`${dateRegexSource}T${timeRegexSource(Au)}`;const $u=[];return $u.push(Au.local?"Z?":"Z"),Au.offset&&$u.push("([+-]\\d{2}:?\\d{2})"),lo=`${lo}(${$u.join("|")})`,new RegExp(`^${lo}$`)}function isValidIP(Au,lo){return!!((lo==="v4"||!lo)&&ipv4Regex.test(Au)||(lo==="v6"||!lo)&&ipv6Regex.test(Au))}function isValidJWT(Au,lo){if(!jwtRegex.test(Au))return!1;try{const[$u]=Au.split(".");if(!$u)return!1;const Ru=$u.replace(/-/g,"+").replace(/_/g,"/").padEnd($u.length+(4-$u.length%4)%4,"="),Iu=JSON.parse(atob(Ru));return!(typeof Iu!="object"||Iu===null||"typ"in Iu&&Iu?.typ!=="JWT"||!Iu.alg||lo&&Iu.alg!==lo)}catch{return!1}}function isValidCidr(Au,lo){return!!((lo==="v4"||!lo)&&ipv4CidrRegex.test(Au)||(lo==="v6"||!lo)&&ipv6CidrRegex.test(Au))}class ZodString extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=String(lo.data)),this._getType(lo)!==ZodParsedType.string){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:Pu.parsedType}),INVALID}const Ru=new ParseStatus;let Iu;for(const Pu of this._def.checks)if(Pu.kind==="min")lo.data.length<Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"string",inclusive:!0,exact:!1,message:Pu.message}),Ru.dirty());else if(Pu.kind==="max")lo.data.length>Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"string",inclusive:!0,exact:!1,message:Pu.message}),Ru.dirty());else if(Pu.kind==="length"){const Ou=lo.data.length>Pu.value,Du=lo.data.length<Pu.value;(Ou||Du)&&(Iu=this._getOrReturnCtx(lo,Iu),Ou?addIssueToContext(Iu,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"string",inclusive:!0,exact:!0,message:Pu.message}):Du&&addIssueToContext(Iu,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"string",inclusive:!0,exact:!0,message:Pu.message}),Ru.dirty())}else if(Pu.kind==="email")emailRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"email",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"emoji",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="uuid")uuidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"uuid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="nanoid")nanoidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="cuid")cuidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cuid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="cuid2")cuid2Regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="ulid")ulidRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"ulid",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty());else if(Pu.kind==="url")try{new URL(lo.data)}catch{Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"url",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()}else Pu.kind==="regex"?(Pu.regex.lastIndex=0,Pu.regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"regex",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty())):Pu.kind==="trim"?lo.data=lo.data.trim():Pu.kind==="includes"?lo.data.includes(Pu.value,Pu.position)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{includes:Pu.value,position:Pu.position},message:Pu.message}),Ru.dirty()):Pu.kind==="toLowerCase"?lo.data=lo.data.toLowerCase():Pu.kind==="toUpperCase"?lo.data=lo.data.toUpperCase():Pu.kind==="startsWith"?lo.data.startsWith(Pu.value)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{startsWith:Pu.value},message:Pu.message}),Ru.dirty()):Pu.kind==="endsWith"?lo.data.endsWith(Pu.value)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:{endsWith:Pu.value},message:Pu.message}),Ru.dirty()):Pu.kind==="datetime"?datetimeRegex(Pu).test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"datetime",message:Pu.message}),Ru.dirty()):Pu.kind==="date"?dateRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"date",message:Pu.message}),Ru.dirty()):Pu.kind==="time"?timeRegex(Pu).test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.invalid_string,validation:"time",message:Pu.message}),Ru.dirty()):Pu.kind==="duration"?durationRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"duration",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="ip"?isValidIP(lo.data,Pu.version)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"ip",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="jwt"?isValidJWT(lo.data,Pu.alg)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"jwt",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="cidr"?isValidCidr(lo.data,Pu.version)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"cidr",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="base64"?base64Regex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"base64",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):Pu.kind==="base64url"?base64urlRegex.test(lo.data)||(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{validation:"base64url",code:ZodIssueCode.invalid_string,message:Pu.message}),Ru.dirty()):util.assertNever(Pu);return{status:Ru.value,value:lo.data}}_regex(lo,$u,Ru){return this.refinement(Iu=>lo.test(Iu),{validation:$u,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(Ru)})}_addCheck(lo){return new ZodString({...this._def,checks:[...this._def.checks,lo]})}email(lo){return this._addCheck({kind:"email",...errorUtil.errToObj(lo)})}url(lo){return this._addCheck({kind:"url",...errorUtil.errToObj(lo)})}emoji(lo){return this._addCheck({kind:"emoji",...errorUtil.errToObj(lo)})}uuid(lo){return this._addCheck({kind:"uuid",...errorUtil.errToObj(lo)})}nanoid(lo){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(lo)})}cuid(lo){return this._addCheck({kind:"cuid",...errorUtil.errToObj(lo)})}cuid2(lo){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(lo)})}ulid(lo){return this._addCheck({kind:"ulid",...errorUtil.errToObj(lo)})}base64(lo){return this._addCheck({kind:"base64",...errorUtil.errToObj(lo)})}base64url(lo){return this._addCheck({kind:"base64url",...errorUtil.errToObj(lo)})}jwt(lo){return this._addCheck({kind:"jwt",...errorUtil.errToObj(lo)})}ip(lo){return this._addCheck({kind:"ip",...errorUtil.errToObj(lo)})}cidr(lo){return this._addCheck({kind:"cidr",...errorUtil.errToObj(lo)})}datetime(lo){return typeof lo=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:lo}):this._addCheck({kind:"datetime",precision:typeof lo?.precision>"u"?null:lo?.precision,offset:lo?.offset??!1,local:lo?.local??!1,...errorUtil.errToObj(lo?.message)})}date(lo){return this._addCheck({kind:"date",message:lo})}time(lo){return typeof lo=="string"?this._addCheck({kind:"time",precision:null,message:lo}):this._addCheck({kind:"time",precision:typeof lo?.precision>"u"?null:lo?.precision,...errorUtil.errToObj(lo?.message)})}duration(lo){return this._addCheck({kind:"duration",...errorUtil.errToObj(lo)})}regex(lo,$u){return this._addCheck({kind:"regex",regex:lo,...errorUtil.errToObj($u)})}includes(lo,$u){return this._addCheck({kind:"includes",value:lo,position:$u?.position,...errorUtil.errToObj($u?.message)})}startsWith(lo,$u){return this._addCheck({kind:"startsWith",value:lo,...errorUtil.errToObj($u)})}endsWith(lo,$u){return this._addCheck({kind:"endsWith",value:lo,...errorUtil.errToObj($u)})}min(lo,$u){return this._addCheck({kind:"min",value:lo,...errorUtil.errToObj($u)})}max(lo,$u){return this._addCheck({kind:"max",value:lo,...errorUtil.errToObj($u)})}length(lo,$u){return this._addCheck({kind:"length",value:lo,...errorUtil.errToObj($u)})}nonempty(lo){return this.min(1,errorUtil.errToObj(lo))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(lo=>lo.kind==="datetime")}get isDate(){return!!this._def.checks.find(lo=>lo.kind==="date")}get isTime(){return!!this._def.checks.find(lo=>lo.kind==="time")}get isDuration(){return!!this._def.checks.find(lo=>lo.kind==="duration")}get isEmail(){return!!this._def.checks.find(lo=>lo.kind==="email")}get isURL(){return!!this._def.checks.find(lo=>lo.kind==="url")}get isEmoji(){return!!this._def.checks.find(lo=>lo.kind==="emoji")}get isUUID(){return!!this._def.checks.find(lo=>lo.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(lo=>lo.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(lo=>lo.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(lo=>lo.kind==="cuid2")}get isULID(){return!!this._def.checks.find(lo=>lo.kind==="ulid")}get isIP(){return!!this._def.checks.find(lo=>lo.kind==="ip")}get isCIDR(){return!!this._def.checks.find(lo=>lo.kind==="cidr")}get isBase64(){return!!this._def.checks.find(lo=>lo.kind==="base64")}get isBase64url(){return!!this._def.checks.find(lo=>lo.kind==="base64url")}get minLength(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxLength(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}}ZodString.create=Au=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:Au?.coerce??!1,...processCreateParams(Au)});function floatSafeRemainder(Au,lo){const $u=(Au.toString().split(".")[1]||"").length,Ru=(lo.toString().split(".")[1]||"").length,Iu=$u>Ru?$u:Ru,Pu=Number.parseInt(Au.toFixed(Iu).replace(".","")),Ou=Number.parseInt(lo.toFixed(Iu).replace(".",""));return Pu%Ou/10**Iu}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(lo){if(this._def.coerce&&(lo.data=Number(lo.data)),this._getType(lo)!==ZodParsedType.number){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:Pu.parsedType}),INVALID}let Ru;const Iu=new ParseStatus;for(const Pu of this._def.checks)Pu.kind==="int"?util.isInteger(lo.data)||(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Pu.message}),Iu.dirty()):Pu.kind==="min"?(Pu.inclusive?lo.data<Pu.value:lo.data<=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:Pu.value,type:"number",inclusive:Pu.inclusive,exact:!1,message:Pu.message}),Iu.dirty()):Pu.kind==="max"?(Pu.inclusive?lo.data>Pu.value:lo.data>=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:Pu.value,type:"number",inclusive:Pu.inclusive,exact:!1,message:Pu.message}),Iu.dirty()):Pu.kind==="multipleOf"?floatSafeRemainder(lo.data,Pu.value)!==0&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_multiple_of,multipleOf:Pu.value,message:Pu.message}),Iu.dirty()):Pu.kind==="finite"?Number.isFinite(lo.data)||(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_finite,message:Pu.message}),Iu.dirty()):util.assertNever(Pu);return{status:Iu.value,value:lo.data}}gte(lo,$u){return this.setLimit("min",lo,!0,errorUtil.toString($u))}gt(lo,$u){return this.setLimit("min",lo,!1,errorUtil.toString($u))}lte(lo,$u){return this.setLimit("max",lo,!0,errorUtil.toString($u))}lt(lo,$u){return this.setLimit("max",lo,!1,errorUtil.toString($u))}setLimit(lo,$u,Ru,Iu){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:lo,value:$u,inclusive:Ru,message:errorUtil.toString(Iu)}]})}_addCheck(lo){return new ZodNumber({...this._def,checks:[...this._def.checks,lo]})}int(lo){return this._addCheck({kind:"int",message:errorUtil.toString(lo)})}positive(lo){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(lo)})}negative(lo){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(lo)})}nonpositive(lo){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(lo)})}nonnegative(lo){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(lo)})}multipleOf(lo,$u){return this._addCheck({kind:"multipleOf",value:lo,message:errorUtil.toString($u)})}finite(lo){return this._addCheck({kind:"finite",message:errorUtil.toString(lo)})}safe(lo){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(lo)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(lo)})}get minValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}get isInt(){return!!this._def.checks.find(lo=>lo.kind==="int"||lo.kind==="multipleOf"&&util.isInteger(lo.value))}get isFinite(){let lo=null,$u=null;for(const Ru of this._def.checks){if(Ru.kind==="finite"||Ru.kind==="int"||Ru.kind==="multipleOf")return!0;Ru.kind==="min"?($u===null||Ru.value>$u)&&($u=Ru.value):Ru.kind==="max"&&(lo===null||Ru.value<lo)&&(lo=Ru.value)}return Number.isFinite($u)&&Number.isFinite(lo)}}ZodNumber.create=Au=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:Au?.coerce||!1,...processCreateParams(Au)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(lo){if(this._def.coerce)try{lo.data=BigInt(lo.data)}catch{return this._getInvalidInput(lo)}if(this._getType(lo)!==ZodParsedType.bigint)return this._getInvalidInput(lo);let Ru;const Iu=new ParseStatus;for(const Pu of this._def.checks)Pu.kind==="min"?(Pu.inclusive?lo.data<Pu.value:lo.data<=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_small,type:"bigint",minimum:Pu.value,inclusive:Pu.inclusive,message:Pu.message}),Iu.dirty()):Pu.kind==="max"?(Pu.inclusive?lo.data>Pu.value:lo.data>=Pu.value)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.too_big,type:"bigint",maximum:Pu.value,inclusive:Pu.inclusive,message:Pu.message}),Iu.dirty()):Pu.kind==="multipleOf"?lo.data%Pu.value!==BigInt(0)&&(Ru=this._getOrReturnCtx(lo,Ru),addIssueToContext(Ru,{code:ZodIssueCode.not_multiple_of,multipleOf:Pu.value,message:Pu.message}),Iu.dirty()):util.assertNever(Pu);return{status:Iu.value,value:lo.data}}_getInvalidInput(lo){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:$u.parsedType}),INVALID}gte(lo,$u){return this.setLimit("min",lo,!0,errorUtil.toString($u))}gt(lo,$u){return this.setLimit("min",lo,!1,errorUtil.toString($u))}lte(lo,$u){return this.setLimit("max",lo,!0,errorUtil.toString($u))}lt(lo,$u){return this.setLimit("max",lo,!1,errorUtil.toString($u))}setLimit(lo,$u,Ru,Iu){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:lo,value:$u,inclusive:Ru,message:errorUtil.toString(Iu)}]})}_addCheck(lo){return new ZodBigInt({...this._def,checks:[...this._def.checks,lo]})}positive(lo){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(lo)})}negative(lo){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(lo)})}nonpositive(lo){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(lo)})}nonnegative(lo){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(lo)})}multipleOf(lo,$u){return this._addCheck({kind:"multipleOf",value:lo,message:errorUtil.toString($u)})}get minValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo}get maxValue(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo}}ZodBigInt.create=Au=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:Au?.coerce??!1,...processCreateParams(Au)});class ZodBoolean extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=!!lo.data),this._getType(lo)!==ZodParsedType.boolean){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodBoolean.create=Au=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:Au?.coerce||!1,...processCreateParams(Au)});class ZodDate extends ZodType{_parse(lo){if(this._def.coerce&&(lo.data=new Date(lo.data)),this._getType(lo)!==ZodParsedType.date){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:Pu.parsedType}),INVALID}if(Number.isNaN(lo.data.getTime())){const Pu=this._getOrReturnCtx(lo);return addIssueToContext(Pu,{code:ZodIssueCode.invalid_date}),INVALID}const Ru=new ParseStatus;let Iu;for(const Pu of this._def.checks)Pu.kind==="min"?lo.data.getTime()<Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_small,message:Pu.message,inclusive:!0,exact:!1,minimum:Pu.value,type:"date"}),Ru.dirty()):Pu.kind==="max"?lo.data.getTime()>Pu.value&&(Iu=this._getOrReturnCtx(lo,Iu),addIssueToContext(Iu,{code:ZodIssueCode.too_big,message:Pu.message,inclusive:!0,exact:!1,maximum:Pu.value,type:"date"}),Ru.dirty()):util.assertNever(Pu);return{status:Ru.value,value:new Date(lo.data.getTime())}}_addCheck(lo){return new ZodDate({...this._def,checks:[...this._def.checks,lo]})}min(lo,$u){return this._addCheck({kind:"min",value:lo.getTime(),message:errorUtil.toString($u)})}max(lo,$u){return this._addCheck({kind:"max",value:lo.getTime(),message:errorUtil.toString($u)})}get minDate(){let lo=null;for(const $u of this._def.checks)$u.kind==="min"&&(lo===null||$u.value>lo)&&(lo=$u.value);return lo!=null?new Date(lo):null}get maxDate(){let lo=null;for(const $u of this._def.checks)$u.kind==="max"&&(lo===null||$u.value<lo)&&(lo=$u.value);return lo!=null?new Date(lo):null}}ZodDate.create=Au=>new ZodDate({checks:[],coerce:Au?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(Au)});class ZodSymbol extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.symbol){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodSymbol.create=Au=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(Au)});class ZodUndefined extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.undefined){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodUndefined.create=Au=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(Au)});class ZodNull extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.null){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodNull.create=Au=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(Au)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(lo){return OK(lo.data)}}ZodAny.create=Au=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(Au)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(lo){return OK(lo.data)}}ZodUnknown.create=Au=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(Au)});class ZodNever extends ZodType{_parse(lo){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$u.parsedType}),INVALID}}ZodNever.create=Au=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(Au)});class ZodVoid extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.undefined){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:Ru.parsedType}),INVALID}return OK(lo.data)}}ZodVoid.create=Au=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(Au)});class ZodArray extends ZodType{_parse(lo){const{ctx:$u,status:Ru}=this._processInputParams(lo),Iu=this._def;if($u.parsedType!==ZodParsedType.array)return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$u.parsedType}),INVALID;if(Iu.exactLength!==null){const Ou=$u.data.length>Iu.exactLength.value,Du=$u.data.length<Iu.exactLength.value;(Ou||Du)&&(addIssueToContext($u,{code:Ou?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:Du?Iu.exactLength.value:void 0,maximum:Ou?Iu.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Iu.exactLength.message}),Ru.dirty())}if(Iu.minLength!==null&&$u.data.length<Iu.minLength.value&&(addIssueToContext($u,{code:ZodIssueCode.too_small,minimum:Iu.minLength.value,type:"array",inclusive:!0,exact:!1,message:Iu.minLength.message}),Ru.dirty()),Iu.maxLength!==null&&$u.data.length>Iu.maxLength.value&&(addIssueToContext($u,{code:ZodIssueCode.too_big,maximum:Iu.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Iu.maxLength.message}),Ru.dirty()),$u.common.async)return Promise.all([...$u.data].map((Ou,Du)=>Iu.type._parseAsync(new ParseInputLazyPath($u,Ou,$u.path,Du)))).then(Ou=>ParseStatus.mergeArray(Ru,Ou));const Pu=[...$u.data].map((Ou,Du)=>Iu.type._parseSync(new ParseInputLazyPath($u,Ou,$u.path,Du)));return ParseStatus.mergeArray(Ru,Pu)}get element(){return this._def.type}min(lo,$u){return new ZodArray({...this._def,minLength:{value:lo,message:errorUtil.toString($u)}})}max(lo,$u){return new ZodArray({...this._def,maxLength:{value:lo,message:errorUtil.toString($u)}})}length(lo,$u){return new ZodArray({...this._def,exactLength:{value:lo,message:errorUtil.toString($u)}})}nonempty(lo){return this.min(1,lo)}}ZodArray.create=(Au,lo)=>new ZodArray({type:Au,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(lo)});function deepPartialify(Au){if(Au instanceof ZodObject){const lo={};for(const $u in Au.shape){const Ru=Au.shape[$u];lo[$u]=ZodOptional.create(deepPartialify(Ru))}return new ZodObject({...Au._def,shape:()=>lo})}else return Au instanceof ZodArray?new ZodArray({...Au._def,type:deepPartialify(Au.element)}):Au instanceof ZodOptional?ZodOptional.create(deepPartialify(Au.unwrap())):Au instanceof ZodNullable?ZodNullable.create(deepPartialify(Au.unwrap())):Au instanceof ZodTuple?ZodTuple.create(Au.items.map(lo=>deepPartialify(lo))):Au}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const lo=this._def.shape(),$u=util.objectKeys(lo);return this._cached={shape:lo,keys:$u},this._cached}_parse(lo){if(this._getType(lo)!==ZodParsedType.object){const Lu=this._getOrReturnCtx(lo);return addIssueToContext(Lu,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Lu.parsedType}),INVALID}const{status:Ru,ctx:Iu}=this._processInputParams(lo),{shape:Pu,keys:Ou}=this._getCached(),Du=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const Lu in Iu.data)Ou.includes(Lu)||Du.push(Lu);const Mu=[];for(const Lu of Ou){const Bu=Pu[Lu],ju=Iu.data[Lu];Mu.push({key:{status:"valid",value:Lu},value:Bu._parse(new ParseInputLazyPath(Iu,ju,Iu.path,Lu)),alwaysSet:Lu in Iu.data})}if(this._def.catchall instanceof ZodNever){const Lu=this._def.unknownKeys;if(Lu==="passthrough")for(const Bu of Du)Mu.push({key:{status:"valid",value:Bu},value:{status:"valid",value:Iu.data[Bu]}});else if(Lu==="strict")Du.length>0&&(addIssueToContext(Iu,{code:ZodIssueCode.unrecognized_keys,keys:Du}),Ru.dirty());else if(Lu!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Lu=this._def.catchall;for(const Bu of Du){const ju=Iu.data[Bu];Mu.push({key:{status:"valid",value:Bu},value:Lu._parse(new ParseInputLazyPath(Iu,ju,Iu.path,Bu)),alwaysSet:Bu in Iu.data})}}return Iu.common.async?Promise.resolve().then(async()=>{const Lu=[];for(const Bu of Mu){const ju=await Bu.key,Fu=await Bu.value;Lu.push({key:ju,value:Fu,alwaysSet:Bu.alwaysSet})}return Lu}).then(Lu=>ParseStatus.mergeObjectSync(Ru,Lu)):ParseStatus.mergeObjectSync(Ru,Mu)}get shape(){return this._def.shape()}strict(lo){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...lo!==void 0?{errorMap:($u,Ru)=>{const Iu=this._def.errorMap?.($u,Ru).message??Ru.defaultError;return $u.code==="unrecognized_keys"?{message:errorUtil.errToObj(lo).message??Iu}:{message:Iu}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(lo){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...lo})})}merge(lo){return new ZodObject({unknownKeys:lo._def.unknownKeys,catchall:lo._def.catchall,shape:()=>({...this._def.shape(),...lo._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(lo,$u){return this.augment({[lo]:$u})}catchall(lo){return new ZodObject({...this._def,catchall:lo})}pick(lo){const $u={};for(const Ru of util.objectKeys(lo))lo[Ru]&&this.shape[Ru]&&($u[Ru]=this.shape[Ru]);return new ZodObject({...this._def,shape:()=>$u})}omit(lo){const $u={};for(const Ru of util.objectKeys(this.shape))lo[Ru]||($u[Ru]=this.shape[Ru]);return new ZodObject({...this._def,shape:()=>$u})}deepPartial(){return deepPartialify(this)}partial(lo){const $u={};for(const Ru of util.objectKeys(this.shape)){const Iu=this.shape[Ru];lo&&!lo[Ru]?$u[Ru]=Iu:$u[Ru]=Iu.optional()}return new ZodObject({...this._def,shape:()=>$u})}required(lo){const $u={};for(const Ru of util.objectKeys(this.shape))if(lo&&!lo[Ru])$u[Ru]=this.shape[Ru];else{let Pu=this.shape[Ru];for(;Pu instanceof ZodOptional;)Pu=Pu._def.innerType;$u[Ru]=Pu}return new ZodObject({...this._def,shape:()=>$u})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(Au,lo)=>new ZodObject({shape:()=>Au,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});ZodObject.strictCreate=(Au,lo)=>new ZodObject({shape:()=>Au,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});ZodObject.lazycreate=(Au,lo)=>new ZodObject({shape:Au,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(lo)});class ZodUnion extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru=this._def.options;function Iu(Pu){for(const Du of Pu)if(Du.result.status==="valid")return Du.result;for(const Du of Pu)if(Du.result.status==="dirty")return $u.common.issues.push(...Du.ctx.common.issues),Du.result;const Ou=Pu.map(Du=>new ZodError(Du.ctx.common.issues));return addIssueToContext($u,{code:ZodIssueCode.invalid_union,unionErrors:Ou}),INVALID}if($u.common.async)return Promise.all(Ru.map(async Pu=>{const Ou={...$u,common:{...$u.common,issues:[]},parent:null};return{result:await Pu._parseAsync({data:$u.data,path:$u.path,parent:Ou}),ctx:Ou}})).then(Iu);{let Pu;const Ou=[];for(const Mu of Ru){const Lu={...$u,common:{...$u.common,issues:[]},parent:null},Bu=Mu._parseSync({data:$u.data,path:$u.path,parent:Lu});if(Bu.status==="valid")return Bu;Bu.status==="dirty"&&!Pu&&(Pu={result:Bu,ctx:Lu}),Lu.common.issues.length&&Ou.push(Lu.common.issues)}if(Pu)return $u.common.issues.push(...Pu.ctx.common.issues),Pu.result;const Du=Ou.map(Mu=>new ZodError(Mu));return addIssueToContext($u,{code:ZodIssueCode.invalid_union,unionErrors:Du}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(Au,lo)=>new ZodUnion({options:Au,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(lo)});function mergeValues(Au,lo){const $u=getParsedType(Au),Ru=getParsedType(lo);if(Au===lo)return{valid:!0,data:Au};if($u===ZodParsedType.object&&Ru===ZodParsedType.object){const Iu=util.objectKeys(lo),Pu=util.objectKeys(Au).filter(Du=>Iu.indexOf(Du)!==-1),Ou={...Au,...lo};for(const Du of Pu){const Mu=mergeValues(Au[Du],lo[Du]);if(!Mu.valid)return{valid:!1};Ou[Du]=Mu.data}return{valid:!0,data:Ou}}else if($u===ZodParsedType.array&&Ru===ZodParsedType.array){if(Au.length!==lo.length)return{valid:!1};const Iu=[];for(let Pu=0;Pu<Au.length;Pu++){const Ou=Au[Pu],Du=lo[Pu],Mu=mergeValues(Ou,Du);if(!Mu.valid)return{valid:!1};Iu.push(Mu.data)}return{valid:!0,data:Iu}}else return $u===ZodParsedType.date&&Ru===ZodParsedType.date&&+Au==+lo?{valid:!0,data:Au}:{valid:!1}}class ZodIntersection extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo),Iu=(Pu,Ou)=>{if(isAborted(Pu)||isAborted(Ou))return INVALID;const Du=mergeValues(Pu.value,Ou.value);return Du.valid?((isDirty(Pu)||isDirty(Ou))&&$u.dirty(),{status:$u.value,value:Du.data}):(addIssueToContext(Ru,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return Ru.common.async?Promise.all([this._def.left._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}),this._def.right._parseAsync({data:Ru.data,path:Ru.path,parent:Ru})]).then(([Pu,Ou])=>Iu(Pu,Ou)):Iu(this._def.left._parseSync({data:Ru.data,path:Ru.path,parent:Ru}),this._def.right._parseSync({data:Ru.data,path:Ru.path,parent:Ru}))}}ZodIntersection.create=(Au,lo,$u)=>new ZodIntersection({left:Au,right:lo,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($u)});class ZodTuple extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.array)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:Ru.parsedType}),INVALID;if(Ru.data.length<this._def.items.length)return addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&Ru.data.length>this._def.items.length&&(addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$u.dirty());const Pu=[...Ru.data].map((Ou,Du)=>{const Mu=this._def.items[Du]||this._def.rest;return Mu?Mu._parse(new ParseInputLazyPath(Ru,Ou,Ru.path,Du)):null}).filter(Ou=>!!Ou);return Ru.common.async?Promise.all(Pu).then(Ou=>ParseStatus.mergeArray($u,Ou)):ParseStatus.mergeArray($u,Pu)}get items(){return this._def.items}rest(lo){return new ZodTuple({...this._def,rest:lo})}}ZodTuple.create=(Au,lo)=>{if(!Array.isArray(Au))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:Au,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(lo)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.object)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ru.parsedType}),INVALID;const Iu=[],Pu=this._def.keyType,Ou=this._def.valueType;for(const Du in Ru.data)Iu.push({key:Pu._parse(new ParseInputLazyPath(Ru,Du,Ru.path,Du)),value:Ou._parse(new ParseInputLazyPath(Ru,Ru.data[Du],Ru.path,Du)),alwaysSet:Du in Ru.data});return Ru.common.async?ParseStatus.mergeObjectAsync($u,Iu):ParseStatus.mergeObjectSync($u,Iu)}get element(){return this._def.valueType}static create(lo,$u,Ru){return $u instanceof ZodType?new ZodRecord({keyType:lo,valueType:$u,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(Ru)}):new ZodRecord({keyType:ZodString.create(),valueType:lo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($u)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.map)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:Ru.parsedType}),INVALID;const Iu=this._def.keyType,Pu=this._def.valueType,Ou=[...Ru.data.entries()].map(([Du,Mu],Lu)=>({key:Iu._parse(new ParseInputLazyPath(Ru,Du,Ru.path,[Lu,"key"])),value:Pu._parse(new ParseInputLazyPath(Ru,Mu,Ru.path,[Lu,"value"]))}));if(Ru.common.async){const Du=new Map;return Promise.resolve().then(async()=>{for(const Mu of Ou){const Lu=await Mu.key,Bu=await Mu.value;if(Lu.status==="aborted"||Bu.status==="aborted")return INVALID;(Lu.status==="dirty"||Bu.status==="dirty")&&$u.dirty(),Du.set(Lu.value,Bu.value)}return{status:$u.value,value:Du}})}else{const Du=new Map;for(const Mu of Ou){const Lu=Mu.key,Bu=Mu.value;if(Lu.status==="aborted"||Bu.status==="aborted")return INVALID;(Lu.status==="dirty"||Bu.status==="dirty")&&$u.dirty(),Du.set(Lu.value,Bu.value)}return{status:$u.value,value:Du}}}}ZodMap.create=(Au,lo,$u)=>new ZodMap({valueType:lo,keyType:Au,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($u)});class ZodSet extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.parsedType!==ZodParsedType.set)return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:Ru.parsedType}),INVALID;const Iu=this._def;Iu.minSize!==null&&Ru.data.size<Iu.minSize.value&&(addIssueToContext(Ru,{code:ZodIssueCode.too_small,minimum:Iu.minSize.value,type:"set",inclusive:!0,exact:!1,message:Iu.minSize.message}),$u.dirty()),Iu.maxSize!==null&&Ru.data.size>Iu.maxSize.value&&(addIssueToContext(Ru,{code:ZodIssueCode.too_big,maximum:Iu.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Iu.maxSize.message}),$u.dirty());const Pu=this._def.valueType;function Ou(Mu){const Lu=new Set;for(const Bu of Mu){if(Bu.status==="aborted")return INVALID;Bu.status==="dirty"&&$u.dirty(),Lu.add(Bu.value)}return{status:$u.value,value:Lu}}const Du=[...Ru.data.values()].map((Mu,Lu)=>Pu._parse(new ParseInputLazyPath(Ru,Mu,Ru.path,Lu)));return Ru.common.async?Promise.all(Du).then(Mu=>Ou(Mu)):Ou(Du)}min(lo,$u){return new ZodSet({...this._def,minSize:{value:lo,message:errorUtil.toString($u)}})}max(lo,$u){return new ZodSet({...this._def,maxSize:{value:lo,message:errorUtil.toString($u)}})}size(lo,$u){return this.min(lo,$u).max(lo,$u)}nonempty(lo){return this.min(1,lo)}}ZodSet.create=(Au,lo)=>new ZodSet({valueType:Au,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(lo)});class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(lo){const{ctx:$u}=this._processInputParams(lo);return this._def.getter()._parse({data:$u.data,path:$u.path,parent:$u})}}ZodLazy.create=(Au,lo)=>new ZodLazy({getter:Au,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(lo)});class ZodLiteral extends ZodType{_parse(lo){if(lo.data!==this._def.value){const $u=this._getOrReturnCtx(lo);return addIssueToContext($u,{received:$u.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:lo.data}}get value(){return this._def.value}}ZodLiteral.create=(Au,lo)=>new ZodLiteral({value:Au,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(lo)});function createZodEnum(Au,lo){return new ZodEnum({values:Au,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(lo)})}class ZodEnum extends ZodType{_parse(lo){if(typeof lo.data!="string"){const $u=this._getOrReturnCtx(lo),Ru=this._def.values;return addIssueToContext($u,{expected:util.joinValues(Ru),received:$u.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(lo.data)){const $u=this._getOrReturnCtx(lo),Ru=this._def.values;return addIssueToContext($u,{received:$u.data,code:ZodIssueCode.invalid_enum_value,options:Ru}),INVALID}return OK(lo.data)}get options(){return this._def.values}get enum(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}get Values(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}get Enum(){const lo={};for(const $u of this._def.values)lo[$u]=$u;return lo}extract(lo,$u=this._def){return ZodEnum.create(lo,{...this._def,...$u})}exclude(lo,$u=this._def){return ZodEnum.create(this.options.filter(Ru=>!lo.includes(Ru)),{...this._def,...$u})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(lo){const $u=util.getValidEnumValues(this._def.values),Ru=this._getOrReturnCtx(lo);if(Ru.parsedType!==ZodParsedType.string&&Ru.parsedType!==ZodParsedType.number){const Iu=util.objectValues($u);return addIssueToContext(Ru,{expected:util.joinValues(Iu),received:Ru.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util.getValidEnumValues(this._def.values))),!this._cache.has(lo.data)){const Iu=util.objectValues($u);return addIssueToContext(Ru,{received:Ru.data,code:ZodIssueCode.invalid_enum_value,options:Iu}),INVALID}return OK(lo.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(Au,lo)=>new ZodNativeEnum({values:Au,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(lo)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(lo){const{ctx:$u}=this._processInputParams(lo);if($u.parsedType!==ZodParsedType.promise&&$u.common.async===!1)return addIssueToContext($u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$u.parsedType}),INVALID;const Ru=$u.parsedType===ZodParsedType.promise?$u.data:Promise.resolve($u.data);return OK(Ru.then(Iu=>this._def.type.parseAsync(Iu,{path:$u.path,errorMap:$u.common.contextualErrorMap})))}}ZodPromise.create=(Au,lo)=>new ZodPromise({type:Au,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(lo)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo),Iu=this._def.effect||null,Pu={addIssue:Ou=>{addIssueToContext(Ru,Ou),Ou.fatal?$u.abort():$u.dirty()},get path(){return Ru.path}};if(Pu.addIssue=Pu.addIssue.bind(Pu),Iu.type==="preprocess"){const Ou=Iu.transform(Ru.data,Pu);if(Ru.common.async)return Promise.resolve(Ou).then(async Du=>{if($u.value==="aborted")return INVALID;const Mu=await this._def.schema._parseAsync({data:Du,path:Ru.path,parent:Ru});return Mu.status==="aborted"?INVALID:Mu.status==="dirty"||$u.value==="dirty"?DIRTY(Mu.value):Mu});{if($u.value==="aborted")return INVALID;const Du=this._def.schema._parseSync({data:Ou,path:Ru.path,parent:Ru});return Du.status==="aborted"?INVALID:Du.status==="dirty"||$u.value==="dirty"?DIRTY(Du.value):Du}}if(Iu.type==="refinement"){const Ou=Du=>{const Mu=Iu.refinement(Du,Pu);if(Ru.common.async)return Promise.resolve(Mu);if(Mu instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Du};if(Ru.common.async===!1){const Du=this._def.schema._parseSync({data:Ru.data,path:Ru.path,parent:Ru});return Du.status==="aborted"?INVALID:(Du.status==="dirty"&&$u.dirty(),Ou(Du.value),{status:$u.value,value:Du.value})}else return this._def.schema._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}).then(Du=>Du.status==="aborted"?INVALID:(Du.status==="dirty"&&$u.dirty(),Ou(Du.value).then(()=>({status:$u.value,value:Du.value}))))}if(Iu.type==="transform")if(Ru.common.async===!1){const Ou=this._def.schema._parseSync({data:Ru.data,path:Ru.path,parent:Ru});if(!isValid(Ou))return INVALID;const Du=Iu.transform(Ou.value,Pu);if(Du instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$u.value,value:Du}}else return this._def.schema._parseAsync({data:Ru.data,path:Ru.path,parent:Ru}).then(Ou=>isValid(Ou)?Promise.resolve(Iu.transform(Ou.value,Pu)).then(Du=>({status:$u.value,value:Du})):INVALID);util.assertNever(Iu)}}ZodEffects.create=(Au,lo,$u)=>new ZodEffects({schema:Au,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:lo,...processCreateParams($u)});ZodEffects.createWithPreprocess=(Au,lo,$u)=>new ZodEffects({schema:lo,effect:{type:"preprocess",transform:Au},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($u)});class ZodOptional extends ZodType{_parse(lo){return this._getType(lo)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(lo)}unwrap(){return this._def.innerType}}ZodOptional.create=(Au,lo)=>new ZodOptional({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(lo)});class ZodNullable extends ZodType{_parse(lo){return this._getType(lo)===ZodParsedType.null?OK(null):this._def.innerType._parse(lo)}unwrap(){return this._def.innerType}}ZodNullable.create=(Au,lo)=>new ZodNullable({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(lo)});class ZodDefault extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo);let Ru=$u.data;return $u.parsedType===ZodParsedType.undefined&&(Ru=this._def.defaultValue()),this._def.innerType._parse({data:Ru,path:$u.path,parent:$u})}removeDefault(){return this._def.innerType}}ZodDefault.create=(Au,lo)=>new ZodDefault({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof lo.default=="function"?lo.default:()=>lo.default,...processCreateParams(lo)});class ZodCatch extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru={...$u,common:{...$u.common,issues:[]}},Iu=this._def.innerType._parse({data:Ru.data,path:Ru.path,parent:{...Ru}});return isAsync(Iu)?Iu.then(Pu=>({status:"valid",value:Pu.status==="valid"?Pu.value:this._def.catchValue({get error(){return new ZodError(Ru.common.issues)},input:Ru.data})})):{status:"valid",value:Iu.status==="valid"?Iu.value:this._def.catchValue({get error(){return new ZodError(Ru.common.issues)},input:Ru.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(Au,lo)=>new ZodCatch({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof lo.catch=="function"?lo.catch:()=>lo.catch,...processCreateParams(lo)});class ZodNaN extends ZodType{_parse(lo){if(this._getType(lo)!==ZodParsedType.nan){const Ru=this._getOrReturnCtx(lo);return addIssueToContext(Ru,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:Ru.parsedType}),INVALID}return{status:"valid",value:lo.data}}}ZodNaN.create=Au=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(Au)});class ZodBranded extends ZodType{_parse(lo){const{ctx:$u}=this._processInputParams(lo),Ru=$u.data;return this._def.type._parse({data:Ru,path:$u.path,parent:$u})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(lo){const{status:$u,ctx:Ru}=this._processInputParams(lo);if(Ru.common.async)return(async()=>{const Pu=await this._def.in._parseAsync({data:Ru.data,path:Ru.path,parent:Ru});return Pu.status==="aborted"?INVALID:Pu.status==="dirty"?($u.dirty(),DIRTY(Pu.value)):this._def.out._parseAsync({data:Pu.value,path:Ru.path,parent:Ru})})();{const Iu=this._def.in._parseSync({data:Ru.data,path:Ru.path,parent:Ru});return Iu.status==="aborted"?INVALID:Iu.status==="dirty"?($u.dirty(),{status:"dirty",value:Iu.value}):this._def.out._parseSync({data:Iu.value,path:Ru.path,parent:Ru})}}static create(lo,$u){return new ZodPipeline({in:lo,out:$u,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(lo){const $u=this._def.innerType._parse(lo),Ru=Iu=>(isValid(Iu)&&(Iu.value=Object.freeze(Iu.value)),Iu);return isAsync($u)?$u.then(Iu=>Ru(Iu)):Ru($u)}unwrap(){return this._def.innerType}}ZodReadonly.create=(Au,lo)=>new ZodReadonly({innerType:Au,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(lo)});var ZodFirstPartyTypeKind;(function(Au){Au.ZodString="ZodString",Au.ZodNumber="ZodNumber",Au.ZodNaN="ZodNaN",Au.ZodBigInt="ZodBigInt",Au.ZodBoolean="ZodBoolean",Au.ZodDate="ZodDate",Au.ZodSymbol="ZodSymbol",Au.ZodUndefined="ZodUndefined",Au.ZodNull="ZodNull",Au.ZodAny="ZodAny",Au.ZodUnknown="ZodUnknown",Au.ZodNever="ZodNever",Au.ZodVoid="ZodVoid",Au.ZodArray="ZodArray",Au.ZodObject="ZodObject",Au.ZodUnion="ZodUnion",Au.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Au.ZodIntersection="ZodIntersection",Au.ZodTuple="ZodTuple",Au.ZodRecord="ZodRecord",Au.ZodMap="ZodMap",Au.ZodSet="ZodSet",Au.ZodFunction="ZodFunction",Au.ZodLazy="ZodLazy",Au.ZodLiteral="ZodLiteral",Au.ZodEnum="ZodEnum",Au.ZodEffects="ZodEffects",Au.ZodNativeEnum="ZodNativeEnum",Au.ZodOptional="ZodOptional",Au.ZodNullable="ZodNullable",Au.ZodDefault="ZodDefault",Au.ZodCatch="ZodCatch",Au.ZodPromise="ZodPromise",Au.ZodBranded="ZodBranded",Au.ZodPipeline="ZodPipeline",Au.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const stringType=ZodString.create,numberType=ZodNumber.create;ZodBigInt.create;const booleanType=ZodBoolean.create;ZodDate.create;const anyType=ZodAny.create,unknownType=ZodUnknown.create;ZodNever.create;const arrayType=ZodArray.create,objectType=ZodObject.create,unionType=ZodUnion.create,intersectionType=ZodIntersection.create;ZodTuple.create;const recordType=ZodRecord.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create;ZodPromise.create;ZodOptional.create;ZodNullable.create;const coerce={string:(Au=>ZodString.create({...Au,coerce:!0})),number:(Au=>ZodNumber.create({...Au,coerce:!0})),boolean:(Au=>ZodBoolean.create({...Au,coerce:!0})),bigint:(Au=>ZodBigInt.create({...Au,coerce:!0})),date:(Au=>ZodDate.create({...Au,coerce:!0}))};class A2uiError extends Error{constructor(lo,$u="UNKNOWN_ERROR"){super(lo),this.name=this.constructor.name,this.code=$u,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class A2uiValidationError extends A2uiError{constructor(lo,$u,Ru="VALIDATION_ERROR"){super(lo,Ru),this.details=$u}}class A2uiDataError extends A2uiError{constructor(lo,$u){super(lo,"DATA_ERROR"),this.path=$u}}class A2uiExpressionError extends A2uiError{constructor(lo,$u,Ru){super(lo,"EXPRESSION_ERROR"),this.expression=$u,this.details=Ru}}class A2uiStateError extends A2uiError{constructor(lo){super(lo,"STATE_ERROR")}}class A2uiCatalogError extends A2uiError{constructor(lo,$u="CATALOG_ERROR"){super(lo,$u)}}class A2uiIntegrityError extends A2uiValidationError{constructor(lo,$u,Ru="INTEGRITY_ERROR"){super(lo,$u,Ru),this.name="A2uiIntegrityError"}}class A2uiRecursionError extends A2uiValidationError{constructor(lo,$u,Ru="RECURSION_ERROR"){super(lo,$u,Ru),this.name="A2uiRecursionError"}}var RpcErrorCode;(function(Au){Au.INVALID_FUNCTION_CALL="INVALID_FUNCTION_CALL",Au.EXECUTION_ERROR="EXECUTION_ERROR",Au.UNKNOWN_FUNCTION="UNKNOWN_FUNCTION",Au.UNKNOWN_ERROR="UNKNOWN_ERROR",Au.TIMEOUT="TIMEOUT",Au.CANCELLED="CANCELLED",Au.DISPOSED="DISPOSED",Au.DUPLICATE="DUPLICATE",Au.NO_LISTENER="NO_LISTENER"})(RpcErrorCode||(RpcErrorCode={}));class A2uiRpcError extends A2uiError{constructor(lo,$u=RpcErrorCode.UNKNOWN_ERROR,Ru,Iu){const Pu=$u||RpcErrorCode.UNKNOWN_ERROR;super(`[${Pu}] ${lo}`,Pu),this.functionCallId=Ru,this.details=Iu,this.name="A2uiRpcError"}}function markChildRef(Au,lo){return Au._def.a2uiChildRef=lo,Au}function childRefKindOf(Au){return Au?._def?.a2uiChildRef}const MAX_FUNCTION_CALL_ARGS=1e3;objectType({component:stringType().describe("The type name of the component."),id:lazyType(()=>ComponentIdSchema$2).optional(),weight:numberType().optional()}).passthrough().describe("A generic A2UI component definition.");const ComponentIdSchema$2=markChildRef(stringType().describe("REF:common_types.json#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),DataBindingSchema$2=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).describe("REF:common_types.json#/$defs/DataBinding"),FunctionCallSchema$2=objectType({call:stringType().describe("The name of the function to call."),args:recordType(stringType(),unknownType()).describe("Arguments passed to the function.").optional(),returnType:enumType(["string","number","boolean","array","object","any","void"]).describe("The expected return type of the function call.").optional(),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:common_types.json#/$defs/FunctionCall|Invokes a named function, combining common function properties with the catalog function definition."),DynamicStringSchema$2=unionType([stringType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicString|Represents a string"),DynamicBooleanSchema$2=unionType([booleanType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),AccessibilityAttributesSchema$2=objectType({label:DynamicStringSchema$2.optional(),description:DynamicStringSchema$2.optional(),live:enumType(["off","polite","assertive"]).default("off").describe("Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts.").optional(),hidden:DynamicBooleanSchema$2.optional()}).describe("REF:common_types.json#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding."),ExtensionsSchema$1=recordType(stringType(),unknownType()).superRefine((Au,lo)=>{for(const $u in Au)$u.match(/^[\p{XID_Start}_][\p{XID_Continue}]*$/u)||lo.addIssue({path:[$u],code:ZodIssueCode.custom,message:`Invalid extension key "${$u}": Keys MUST be Unicode identifiers (UAX #31).`})}).describe("REF:#/$defs/Extensions|Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.");objectType({id:ComponentIdSchema$2,accessibility:AccessibilityAttributesSchema$2.optional(),catalogId:stringType().describe("The catalog ID for this component, overriding any surface-level default catalogId.").optional(),metadata:objectType({extensions:ExtensionsSchema$1.optional()}).strict().describe("Optional component-level metadata for vendor extensions.").optional()}).describe("REF:common_types.json#/$defs/ComponentCommon");const ChildListSchema$1=markChildRef(unionType([arrayType(ComponentIdSchema$2).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema$2,path:stringType().describe("The path to the list of component property objects in the data model.")}).describe("A template for generating a dynamic list of children.")]).describe("REF:common_types.json#/$defs/ChildList"),"child-list"),DynamicValueSchema$2=unionType([stringType(),numberType(),booleanType(),arrayType(unknownType()),DataBindingSchema$2,FunctionCallSchema$2,recordType(stringType(),unknownType()).refine(Au=>!Au||!("path"in Au)&&!("call"in Au))]).describe("REF:common_types.json#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),DynamicNumberSchema$2=unionType([numberType(),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number."),DynamicStringListSchema$1=unionType([arrayType(stringType()),DataBindingSchema$2,FunctionCallSchema$2]).describe("REF:common_types.json#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array."),CheckRuleSchema$2=objectType({condition:unionType([DynamicBooleanSchema$2,DataBindingSchema$2,FunctionCallSchema$2]).describe("Path or function call evaluating to a structured validation result object."),message:stringType().describe("Optional fallback error message.").optional()}).describe("REF:common_types.json#/$defs/CheckRule|A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object."),CheckableSchema=objectType({checks:arrayType(CheckRuleSchema$2).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:common_types.json#/$defs/Checkable|Properties for components that support renderer-side checks."),ActionSchema$2=unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the server."),context:recordType(stringType(),unknownType()).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the server.")}).strict().describe("Triggers a server-side event."),objectType({functionCall:FunctionCallSchema$2}).strict().describe("Executes a local client-side function."),objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the agent."),userMessage:DynamicStringSchema$2.optional(),context:recordType(stringType(),unknownType()).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the agent.")}).strict().describe("Triggers an agent-side event."),objectType({functionCall:FunctionCallSchema$2}).strict().describe("Executes a renderer or agent-side function.")]).describe("REF:common_types.json#/$defs/Action|Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function."),CallIdSchema$1=stringType().describe("REF:common_types.json#/$defs/CallId|The unique identifier for a function call.");objectType({call:stringType().describe("The name of the function to call."),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:common_types.json#/$defs/FunctionCommon|Baseline envelope properties common to all function calls. Function-specific argument schemas (\\'args\\') are defined individually by each function in the active catalog.");objectType({call:literalType("@index"),args:objectType({offset:DynamicNumberSchema$2.optional()}).strict().optional()}).strict().describe("REF:common_types.json#/$defs/IndexSystemFunction|Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.");objectType({component:literalType("Surface").optional(),child:literalType("root").optional()}).strict().describe("REF:common_types.json#/$defs/Surface|The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has \\'child\\': \\'root\\'.");objectType({functionCallId:CallIdSchema$1,value:unknownType().describe("The return value of the function.").optional(),error:objectType({code:stringType(),message:stringType()}).strict().describe("An error object indicating failure of the function execution.").optional()}).strict().describe("REF:common_types.json#/$defs/FunctionResponse|The return response matching a callAgentFunction or callRendererFunction invocation.");const SEMVER_REGEX=/^[vV]?(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function normalizeVersionString(Au){if(!Au||typeof Au!="string")return"";const lo=Au.trim().replace(/^[vV]/,""),$u=lo.indexOf("-"),Ru=lo.indexOf("+");let Iu=lo.length;return $u!==-1&&Ru!==-1?Iu=Math.min($u,Ru):$u!==-1?Iu=$u:Ru!==-1&&(Iu=Ru),`${lo.slice(0,Iu).replace(/_/g,".")}${lo.slice(Iu)}`}function parseSemVer(Au){if(!Au||typeof Au!="string")return null;const lo=Au.trim().match(SEMVER_REGEX);return lo?{major:parseInt(lo[1],10),minor:parseInt(lo[2],10),patch:lo[3]!==void 0?parseInt(lo[3],10):0,prerelease:lo[4]?lo[4].split("."):[],build:lo[5]?lo[5].split("."):[]}:null}function toSemVer(Au){if(!Au)return null;if(typeof Au=="object"){const lo=Au;return typeof lo.major!="number"||!Number.isInteger(lo.major)||lo.major<0||typeof lo.minor=="number"&&(!Number.isInteger(lo.minor)||lo.minor<0)||typeof lo.patch=="number"&&(!Number.isInteger(lo.patch)||lo.patch<0)?null:{major:lo.major,minor:typeof lo.minor=="number"?lo.minor:0,patch:typeof lo.patch=="number"?lo.patch:0,prerelease:Array.isArray(lo.prerelease)?lo.prerelease:[],build:Array.isArray(lo.build)?lo.build:[]}}return parseSemVer(normalizeVersionString(Au))}function toCanonicalVersion(Au){if(!Au)return null;const lo=toSemVer(Au);if(!lo)return null;if(lo.patch===0&&lo.prerelease.length===0&&lo.build.length===0)return`${lo.major}.${lo.minor}`;const $u=lo.prerelease.length>0?`-${lo.prerelease.join(".")}`:"",Ru=lo.build.length>0?`+${lo.build.join(".")}`:"";return`${lo.major}.${lo.minor}.${lo.patch}${$u}${Ru}`}function comparePrereleaseId(Au,lo){const $u=/^\d+$/.test(Au),Ru=/^\d+$/.test(lo);return $u&&Ru?Au.length!==lo.length?Au.length-lo.length:Au<lo?-1:Au>lo?1:0:$u?-1:Ru?1:Au<lo?-1:Au>lo?1:0}function comparePrereleaseLists(Au,lo){if(Au.length===0&&lo.length===0)return 0;if(Au.length===0)return 1;if(lo.length===0)return-1;const $u=Math.min(Au.length,lo.length);for(let Ru=0;Ru<$u;Ru++){const Iu=comparePrereleaseId(Au[Ru],lo[Ru]);if(Iu!==0)return Iu}return Au.length-lo.length}function compareSemVer(Au,lo){const $u=toSemVer(Au),Ru=toSemVer(lo);return!$u&&!Ru?0:$u?Ru?$u.major!==Ru.major?$u.major-Ru.major:$u.minor!==Ru.minor?$u.minor-Ru.minor:$u.patch!==Ru.patch?$u.patch-Ru.patch:comparePrereleaseLists($u.prerelease,Ru.prerelease):1:-1}function isAtLeastVersion(Au,lo){if(!Au)return!1;const $u=toSemVer(Au),Ru=toSemVer(lo);return!$u||!Ru?!1:compareSemVer($u,Ru)>=0}const UAX31_IDENTIFIER=/^[\p{XID_Start}_][\p{XID_Continue}]*$/u;function isValidUax31Identifier(Au){if(!Au)return!1;const lo=Au.startsWith("@")?Au.slice(1):Au;return UAX31_IDENTIFIER.test(lo)}function assertUax31Identifier(Au,lo){if(!isValidUax31Identifier(Au))throw new A2uiCatalogError(`Invalid UAX #31 ${lo}`)}const DEFAULT_PROTOCOL_VERSION="0.9",COMMON_TYPE_SCHEMAS={DynamicString:DynamicStringSchema$2,DynamicNumber:DynamicNumberSchema$2,DynamicBoolean:DynamicBooleanSchema$2,DynamicStringList:DynamicStringListSchema$1,DynamicValue:DynamicValueSchema$2,ComponentId:ComponentIdSchema$2,ChildList:ChildListSchema$1,Action:ActionSchema$2,CheckRule:CheckRuleSchema$2,Checkable:CheckableSchema,AccessibilityAttributes:AccessibilityAttributesSchema$2,DataBinding:DataBindingSchema$2,FunctionCall:FunctionCallSchema$2};function resolveJsonPointer(Au,lo){if(!lo.startsWith("#/"))return;const $u=lo.slice(2).split("/").map(Iu=>Iu.replace(/~1/g,"/").replace(/~0/g,"~"));let Ru=Au;for(const Iu of $u)if(Ru&&typeof Ru=="object"&&Iu in Ru)Ru=Ru[Iu];else return;return typeof Ru=="object"&&Ru!==null?Ru:void 0}function resolveProtocolRef(Au){const lo=Au.split(/#\/(?:\$defs|definitions)\//)[1];return lo?COMMON_TYPE_SCHEMAS[lo]:void 0}function convertEnumToZod(Au){return Au.length===0?unknownType():Au.every(lo=>typeof lo=="string")?enumType(Au):Au.length===1?literalType(Au[0]):unionType(Au.map(lo=>literalType(lo)))}function canonicalJsonStringify(Au){return Au===null||typeof Au!="object"?JSON.stringify(Au):Array.isArray(Au)?`[${Au.map(canonicalJsonStringify).join(",")}]`:`{${Object.keys(Au).sort().map(Ru=>`${JSON.stringify(Ru)}:${canonicalJsonStringify(Au[Ru])}`).join(",")}}`}function finalizePropertyZod(Au,lo,$u,Ru,Iu){let Pu=Au;if(lo.not&&typeof lo.not=="object"){const Ou=convertPropertyToZod(lo.not,$u,new Set(Ru),Iu);Pu=Pu.refine(Du=>!Ou.safeParse(Du).success,{message:'Value matched prohibited "not" schema'})}return lo.default!==void 0&&(Pu=Pu.default(lo.default)),typeof lo.description=="string"&&(Pu=Pu.describe(lo.description)),Pu}function convertRefToZod(Au,lo,$u,Ru,Iu){const Pu=resolveProtocolRef(Au);if(Pu){const Ou=Au.split(/#\/(?:\$defs|definitions)\//)[1],Du=typeof lo.description=="string"?`REF:common_types.json#/$defs/${Ou}|${lo.description}`:Pu.description;return Du?Pu.describe(Du):Pu}if($u&&Au.startsWith("#/")){const Ou=resolveJsonPointer($u,Au);if(!Ou)return unknownType().superRefine((Mu,Lu)=>{Lu.addIssue({code:ZodIssueCode.custom,message:`Unresolvable schema reference: '${Au}'`})});if(Ru.has(Au)){let Mu=Iu.get(Au);return lazyType(()=>(Mu||(Mu=Iu.get(Au)??convertPropertyToZod(Ou,$u,new Set([Au]),Iu),Iu.set(Au,Mu)),Mu))}let Du=Iu.get(Au);if(!Du){const Mu=new Set(Ru);Mu.add(Au),Du=convertPropertyToZod(Ou,$u,Mu,Iu),Iu.set(Au,Du)}return typeof lo.description=="string"&&(Du=Du.describe(lo.description)),Du}}function convertUnionToZod(Au,lo,$u,Ru){const Iu=Array.isArray(Au.oneOf),Ou=(Au.oneOf||Au.anyOf).filter(Fu=>typeof Fu=="object"&&Fu!==null);if(Ou.length===0)return;const Du=Ou.find(Fu=>Array.isArray(Fu.enum)),Mu=Ou.some(Fu=>typeof Fu.$ref=="string"&&Fu.$ref.includes("DataBinding")),Lu=Ou.map(Fu=>convertPropertyToZod(Fu,lo,new Set($u),Ru));let Bu;if(Lu.length===1)Bu=Lu[0];else{const Fu=unionType([Lu[0],Lu[1],...Lu.slice(2)]);Bu=Iu?anyType().superRefine((zu,Uu)=>{let Hu=0;for(const Vu of Lu)if(Vu.safeParse(zu).success&&++Hu>1){Uu.addIssue({code:ZodIssueCode.custom,message:"Value matched more than one schema in oneOf"});return}}).pipe(Fu):Fu}Au.default!==void 0&&(Bu=Bu.default(Au.default));const ju=(typeof Au.description=="string"?Au.description:void 0)||(Du&&Mu?"REF:common_types.json#/$defs/DynamicString":void 0);return ju?Bu.describe(ju):Bu}function convertPropertyToZod(Au,lo,$u=new Set,Ru=new Map){if(!Au||typeof Au!="object")return unknownType();if(Au.$ref&&typeof Au.$ref=="string"){const Iu=convertRefToZod(Au.$ref,Au,lo,$u,Ru);if(Iu)return Iu}if(Array.isArray(Au.oneOf)||Array.isArray(Au.anyOf)){const Iu=convertUnionToZod(Au,lo,$u,Ru);if(Iu)return Iu}if(Au.const!==void 0){const Iu=literalType(Au.const);return finalizePropertyZod(Iu,Au,lo,$u,Ru)}if(Array.isArray(Au.enum)&&Au.enum.length>0){const Iu=convertEnumToZod(Au.enum);return finalizePropertyZod(Iu,Au,lo,$u,Ru)}if(Au.type==="array"){const Iu=Au.items&&typeof Au.items=="object"?convertPropertyToZod(Au.items,lo,new Set($u),Ru):unknownType();let Pu=arrayType(Iu);return typeof Au.minItems=="number"&&(Pu=Pu.min(Au.minItems)),typeof Au.maxItems=="number"&&(Pu=Pu.max(Au.maxItems)),Au.uniqueItems===!0&&(Pu=Pu.refine(Ou=>new Set(Ou.map(canonicalJsonStringify)).size===Ou.length,{message:"Array items must be unique"})),finalizePropertyZod(Pu,Au,lo,$u,Ru)}switch(Au.type){case"string":{let Iu=stringType();if(typeof Au.minLength=="number"&&(Iu=Iu.min(Au.minLength)),typeof Au.maxLength=="number"&&(Iu=Iu.max(Au.maxLength)),typeof Au.pattern=="string")try{Iu=Iu.regex(new RegExp(Au.pattern,"u"))}catch{}return finalizePropertyZod(Iu,Au,lo,$u,Ru)}case"integer":case"number":{let Iu=Au.type==="integer"?numberType().int():numberType();return typeof Au.minimum=="number"&&(Iu=Iu.min(Au.minimum)),typeof Au.maximum=="number"&&(Iu=Iu.max(Au.maximum)),typeof Au.exclusiveMinimum=="number"&&(Iu=Iu.gt(Au.exclusiveMinimum)),typeof Au.exclusiveMaximum=="number"&&(Iu=Iu.lt(Au.exclusiveMaximum)),typeof Au.multipleOf=="number"&&(Iu=Iu.multipleOf(Au.multipleOf)),finalizePropertyZod(Iu,Au,lo,$u,Ru)}case"boolean":return finalizePropertyZod(booleanType(),Au,lo,$u,Ru);case"object":{const Iu=Au.properties;let Pu;if(typeof Iu=="object"&&Iu!==null){const Ou=Array.isArray(Au.required)?new Set(Au.required.filter(Lu=>typeof Lu=="string")):new Set,Du=objectType(convertPropertiesToShape(Iu,Ou,!1,lo,$u,Ru));Pu=Au.additionalProperties===!1||Au.unevaluatedProperties===!1?Du.strict():Du.passthrough()}else Pu=recordType(unknownType());return finalizePropertyZod(Pu,Au,lo,$u,Ru)}default:return finalizePropertyZod(unknownType(),Au,lo,$u,Ru)}}function convertPropertiesToShape(Au,lo,$u=!1,Ru,Iu,Pu=new Map){const Ou={};for(const[Du,Mu]of Object.entries(Au)){if($u&&(Du==="component"||Du==="id"))continue;const Lu=convertPropertyToZod(typeof Mu=="object"&&Mu!==null?Mu:{},Ru,Iu?new Set(Iu):new Set,Pu);Ou[Du]=lo.has(Du)?Lu:Lu.optional()}return Ou}function collectComponentSubSchemas(Au,lo,$u=new Set){const Ru=[];if(!Au||typeof Au!="object")return Ru;if(Array.isArray(Au.allOf)){for(const Iu of Au.allOf)if(!(!Iu||typeof Iu!="object"))if(typeof Iu.$ref=="string"){const Pu=Iu.$ref;if(Pu.includes("common_types.json")&&Pu.includes("ComponentCommon"))Ru.push({properties:{accessibility:AccessibilityAttributesSchema$2.optional()}});else if(Pu.startsWith("#/")&&!$u.has(Pu)){$u.add(Pu);const Ou=resolveJsonPointer(lo,Pu);Ou&&Ru.push(...collectComponentSubSchemas(Ou,lo,$u))}}else Ru.push(...collectComponentSubSchemas(Iu,lo,$u))}return Au.properties&&Ru.push(Au),Ru}function convertComponentJsonSchemaToZod(Au,lo,$u=!0,Ru=new Map){const Iu={},Pu=collectComponentSubSchemas(Au,lo),Ou=new Set;for(const Lu of Pu)Array.isArray(Lu.required)&&Lu.required.forEach(Bu=>{typeof Bu=="string"&&Ou.add(Bu)});for(const Lu of Pu){const Bu=convertPropertiesToShape(Lu.properties||{},Ou,$u,lo,void 0,Ru);Object.assign(Iu,Bu)}const Du=objectType(Iu);return Au.unevaluatedProperties===!0||typeof Au.unevaluatedProperties=="object"&&Au.unevaluatedProperties!==null||Au.additionalProperties===!0||typeof Au.additionalProperties=="object"&&Au.additionalProperties!==null?Du.passthrough():Du.strict()}function convertFunctionArgsJsonSchemaToZod(Au,lo,$u=new Map){const Ru=new Set(Array.isArray(Au.required)?Au.required.filter(Du=>typeof Du=="string"):[]),Iu=convertPropertiesToShape(Au.properties||{},Ru,!1,lo,void 0,$u),Pu=objectType(Iu);return Au.unevaluatedProperties===!0||typeof Au.unevaluatedProperties=="object"&&Au.unevaluatedProperties!==null||Au.additionalProperties===!0||typeof Au.additionalProperties=="object"&&Au.additionalProperties!==null?Pu.passthrough():Pu.strict()}function parseFunctionDefinitions(Au,lo,$u,Ru=!1){const Iu=[];if(!Au)return Iu;const Pu=new Map,Ou=(Du,Mu)=>{if(Ru&&(assertUax31Identifier(Du,`function identifier: '${Du}'`),Mu&&typeof Mu=="object"))for(const Lu of Object.keys(Mu))assertUax31Identifier(Lu,`argument identifier: '${Lu}' in function '${Du}'`)};if(Array.isArray(Au)){for(const Du of Au)if(Du&&typeof Du=="object"&&typeof Du.name=="string"){if(Ou(Du.name,Du.parameters),$u&&!$u.has(Du.name))continue;const Mu=Du.parameters&&typeof Du.parameters=="object"?convertFunctionArgsJsonSchemaToZod(Du.parameters,lo,Pu):recordType(unknownType());Iu.push({name:Du.name,description:typeof Du.description=="string"?Du.description:void 0,returnType:typeof Du.returnType=="string"?Du.returnType:"any",allowedCallers:Du.allowedCallers,requiresUserActivation:Du.requiresUserActivation,schema:Mu})}return Iu}if(typeof Au=="object"&&Au!==null)for(const[Du,Mu]of Object.entries(Au)){const Lu=Mu&&typeof Mu=="object"?Mu:{};if(Ou(Du,Lu.properties&&typeof Lu.properties=="object"?Lu.properties:Lu.parameters),$u&&!$u.has(Du)||!Mu||typeof Mu!="object")continue;const Bu=Mu,ju=Bu.properties;let Fu=ju?.args??Bu.args??Bu.parameters;!Fu&&ju&&!("call"in ju)&&!("function"in ju)?Fu=Bu:Fu&&typeof Fu=="object"&&!("properties"in Fu)&&!("type"in Fu)&&(Fu={type:"object",properties:Fu,required:Bu.required,additionalProperties:Bu.additionalProperties});const zu=Fu&&typeof Fu=="object"?convertFunctionArgsJsonSchemaToZod(Fu,lo,Pu):recordType(unknownType()),Uu=(typeof Bu.returnType=="string"?Bu.returnType:void 0)??(typeof ju?.returnType?.const=="string"?(ju?.returnType).const:"any"),Hu=Bu.allowedCallers??ju?.allowedCallers?.const,Vu=Bu.requiresUserActivation??ju?.requiresUserActivation?.const;Iu.push({name:Du,description:typeof Bu.description=="string"?Bu.description:void 0,returnType:Uu,allowedCallers:Hu,requiresUserActivation:Vu,schema:zu})}return Iu}function extractPermittedNames(Au,lo){if(!Array.isArray(Au))return;const $u=new Set;for(const Ru of Au)if(typeof Ru?.$ref=="string"&&Ru.$ref.startsWith(lo)){const Pu=Ru.$ref.slice(lo.length).replace(/~([01])/g,(Ou,Du)=>Du==="1"?"/":"~");$u.add(Pu)}return $u}function parseCatalogComponents(Au,lo,$u,Ru){const Iu=[],Pu=new Map;for(const[Ou,Du]of Object.entries(Au)){const Mu=Du||{};if($u){assertUax31Identifier(Ou,`component identifier: '${Ou}'`);const Bu=Mu.properties;if(Bu&&typeof Bu=="object")for(const ju of Object.keys(Bu))assertUax31Identifier(ju,`property identifier: '${ju}' in component '${Ou}'`)}if(Ru&&!Ru.has(Ou))continue;const Lu=convertComponentJsonSchemaToZod(Mu,lo,!0,Pu);Iu.push({name:Ou,schema:Lu,allowedParents:Array.isArray(Mu.allowedParents)?Mu.allowedParents.filter(Bu=>typeof Bu=="string"):void 0,allowedChildren:Array.isArray(Mu.allowedChildren)?Mu.allowedChildren.filter(Bu=>typeof Bu=="string"):void 0})}return Iu}function parseThemeSchema(Au,lo){const $u=Au.theme??Au.themeSchema??Au.styles??lo?.theme;if($u&&typeof $u=="object")return convertComponentJsonSchemaToZod($u,Au,!1)}function loadCatalogFromSchema(Au,lo){const $u=Au.catalogId??Au.$id??Au.id;if(!$u||typeof $u!="string")throw new Error("Catalog ID must be specified via catalog metadata ('catalogId' or '$id').");const Ru=Au.$defs,Iu=Ru?.anyComponent,Pu=extractPermittedNames(Iu?.oneOf,"#/components/"),Ou=lo??Au.protocolVersion??DEFAULT_PROTOCOL_VERSION,Du=isAtLeastVersion(Ou,"1.0"),Mu=Au.components??{},Lu=parseCatalogComponents(Mu,Au,Du,Pu),Bu=Ru?.anyFunction,ju=extractPermittedNames(Bu?.oneOf,"#/functions/"),Fu=parseFunctionDefinitions(Au.functions,Au,ju,Du),zu=parseThemeSchema(Au,Ru),Uu=typeof Au.instructions=="string"?Au.instructions:void 0;return new Catalog($u,Ou,Lu,Fu,zu,Uu)}const V08_STANDARD_DEFS={ComponentId:{description:"The unique identifier for a component, used for both definitions and references within the same surface.",type:"string"},TextItem:{additionalProperties:!1,description:"The value of the text field. This can be a literal string or a reference to a value in the data model ('path', e.g. '/user/name').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},UrlItem:{additionalProperties:!1,description:"The URL of the audio to be played. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/song/url').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},AltTextItem:{additionalProperties:!1,description:"The alt text for the image. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/thumbnail/altText').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},NameItem:{additionalProperties:!1,description:"The name of the icon to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/form/submit').",properties:{literalString:{enum:["accountCircle","add","arrowBack","arrowForward","attachFile","calendarToday","call","camera","check","close","delete","download","edit","event","error","favorite","favoriteOff","folder","help","home","info","locationOn","lock","lockOpen","mail","menu","moreVert","moreHoriz","notificationsOff","notifications","payment","person","phone","photo","print","refresh","search","send","settings","share","shoppingCart","star","starHalf","starOff","upload","visibility","visibilityOff","warning"],type:"string"},path:{type:"string"}},type:"object"},DescriptionItem:{additionalProperties:!1,description:"A description of the audio, such as a title or summary. This can be a literal string or a reference to a value in the data model ('path', e.g. '/song/title').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},ChildrenItem:{additionalProperties:!1,description:"Defines the children. Use 'explicitList' for a fixed set of children, or 'template' to generate children from a data list.",properties:{explicitList:{items:{type:"string"},type:"array"},template:{$ref:"#/$defs/TemplateItem",description:"A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children."}},type:"object"},TemplateItem:{additionalProperties:!1,description:"A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.",properties:{componentId:{type:"string"},dataBinding:{type:"string"}},required:["componentId","dataBinding"],type:"object"},TabItemItem:{additionalProperties:!1,properties:{child:{type:"string"},title:{$ref:"#/$defs/TitleItem"}},required:["title","child"],type:"object"},TitleItem:{additionalProperties:!1,description:"The tab title. Defines the value as either a literal value or a path to data model value (e.g. '/options/title').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},ActionItem:{additionalProperties:!1,description:"The client-side action to be dispatched when the button is clicked. It includes the action's name and an optional context payload.",properties:{context:{items:{$ref:"#/$defs/ContextItem"},type:"array"},name:{type:"string"}},required:["name"],type:"object"},ContextItem:{additionalProperties:!1,properties:{key:{type:"string"},value:{$ref:"#/$defs/ValueItem",description:"Defines the value to be included in the context as either a literal value or a path to a data model value (e.g. '/user/name')."}},required:["key","value"],type:"object"},ValueItem:{additionalProperties:!1,description:"The current value of the slider. This can be a literal number ('literalNumber') or a reference to a value in the data model ('path', e.g. '/restaurant/cost').",properties:{literalNumber:{type:"number"},path:{type:"string"}},type:"object"},LabelItem:{additionalProperties:!1,description:"The label for the slider. This can be a literal string or a reference to a value in the data model ('path').",properties:{literalString:{type:"string"},path:{type:"string"}},type:"object"},OptionItem:{additionalProperties:!1,properties:{label:{$ref:"#/$defs/LabelItem",description:"The text to display for this option. This can be a literal string or a reference to a value in the data model (e.g. '/option/label')."},value:{description:"The value to be associated with this option when selected.",type:"string"}},required:["label","value"],type:"object"},SelectionItem:{additionalProperties:!1,description:"The currently selected values for the component. This can be a literal array of strings or a path to an array in the data model('path', e.g. '/hotel/options').",properties:{literalArray:{items:{type:"string"},type:"array"},path:{type:"string"}},type:"object"}},V09_CHILD_REF_OPTIONS={childRefNames:new Set(["ComponentId","Child","ChildComponentId"]),childListRefNames:new Set(["ChildList","TemplateChildList","ChildrenItem","TemplateItem"])},V09_STANDARD_DEFS={ComponentId:{type:"string",description:"The unique identifier for a component, used for both definitions and references within the same surface."},AccessibilityAttributes:{type:"object",description:"Attributes to enhance accessibility when using assistive technologies like screen readers.",properties:{label:{$ref:"#/$defs/DynamicString",description:"A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."},description:{$ref:"#/$defs/DynamicString",description:"Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."}}},ComponentCommon:{type:"object",properties:{id:{$ref:"#/$defs/ComponentId"},accessibility:{$ref:"#/$defs/AccessibilityAttributes"}},required:["id"]},ChildList:{oneOf:[{type:"array",items:{$ref:"#/$defs/ComponentId"},description:"A static list of child component IDs."},{type:"object",description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:"#/$defs/ComponentId"},path:{type:"string",description:"The path to the list of component property objects in the data model."}},required:["componentId","path"],additionalProperties:!1}]},DataBinding:{type:"object",properties:{path:{type:"string",description:"A JSON Pointer path to a value in the data model."}},required:["path"],additionalProperties:!1},DynamicValue:{description:"A value that can be a literal, a path, or a function call returning any type.",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicString:{description:"Represents a string",oneOf:[{type:"string"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"string"}}}]}]},DynamicNumber:{description:"Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",oneOf:[{type:"number"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"number"}}}]}]},DynamicBoolean:{description:"A boolean value that can be a literal, a path, or a function call returning a boolean.",oneOf:[{type:"boolean"},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"boolean"}}}]}]},DynamicStringList:{description:"Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",oneOf:[{type:"array",items:{type:"string"}},{$ref:"#/$defs/DataBinding"},{allOf:[{$ref:"#/$defs/FunctionCall"},{properties:{returnType:{const:"array"}}}]}]},FunctionCall:{type:"object",description:"Invokes a named function on the client.",properties:{call:{type:"string",description:"The name of the function to call."},args:{type:"object",description:"Arguments passed to the function.",additionalProperties:{anyOf:[{$ref:"#/$defs/DynamicValue"},{type:"object",description:"A literal object argument (e.g. configuration)."}]}},returnType:{type:"string",description:"The expected return type of the function call.",enum:["string","number","boolean","array","object","any","void"],default:"boolean"}},required:["call"],oneOf:[{$ref:"catalog.json#/$defs/anyFunction"}]},CheckRule:{type:"object",description:"A single validation rule applied to an input component.",properties:{condition:{$ref:"#/$defs/DynamicBoolean"},message:{type:"string",description:"The error message to display if the check fails."}},required:["condition","message"],additionalProperties:!1},Checkable:{description:"Properties for components that support client-side checks.",type:"object",properties:{checks:{type:"array",description:"A list of checks to perform. These are function calls that must return a boolean indicating validity.",items:{$ref:"#/$defs/CheckRule"}}}},Action:{description:"Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.",oneOf:[{type:"object",description:"Triggers a server-side event.",properties:{event:{type:"object",description:"The event to dispatch to the server.",properties:{name:{type:"string",description:"The name of the action to be dispatched to the server."},context:{type:"object",description:"A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",additionalProperties:{$ref:"#/$defs/DynamicValue"}}},required:["name"],additionalProperties:!1}},required:["event"],additionalProperties:!1},{type:"object",description:"Executes a local client-side function.",properties:{functionCall:{$ref:"#/$defs/FunctionCall"}},required:["functionCall"],additionalProperties:!1}]}},V10_STANDARD_DEFS={ComponentId:{type:"string",description:"The unique identifier for a component, used for both definitions and references within the same surface."},CallId:{type:"string",description:"The unique identifier for a function call."},AccessibilityAttributes:{type:"object",description:"Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding.",properties:{label:{$ref:"#/$defs/DynamicString",description:"A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."},description:{$ref:"#/$defs/DynamicString",description:"Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."},live:{type:"string",enum:["off","polite","assertive"],default:"off",description:"Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts."},hidden:{$ref:"#/$defs/DynamicBoolean",description:"Hides the element and its children from assistive technologies when true. Default is false."}},additionalProperties:!1},Extensions:{type:"object",description:"Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.",patternProperties:{"^[\\p{XID_Start}_][\\p{XID_Continue}]*$":{}},additionalProperties:!1},ComponentCommon:{type:"object",properties:{id:{$ref:"#/$defs/ComponentId"},catalogId:{type:"string",description:"The catalog ID for this component, overriding any surface-level default catalogId."},accessibility:{$ref:"#/$defs/AccessibilityAttributes"},metadata:{type:"object",description:"Optional component-level metadata for vendor extensions.",properties:{extensions:{$ref:"#/$defs/Extensions"}},additionalProperties:!1}},required:["id"]},Child:{$ref:"#/$defs/ComponentId",description:"A reference to a single child component ID."},ChildList:{oneOf:[{type:"array",items:{$ref:"#/$defs/ComponentId"},description:"A static list of child component IDs."},{type:"object",description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:"#/$defs/ComponentId"},path:{type:"string",description:"The path to the list of component property objects in the data model."}},required:["componentId","path"],additionalProperties:!1}]},DataBinding:{type:"object",properties:{path:{type:"string",description:"A JSON Pointer path to a value in the data model."}},required:["path"],additionalProperties:!1},DynamicValue:{description:"A value that can be a literal, a path, or a function call returning any type.",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object",not:{anyOf:[{required:["path"]},{required:["call"]}]}},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicString:{description:"Represents a string",oneOf:[{type:"string"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicNumber:{description:"Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",oneOf:[{type:"number"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicBoolean:{description:"A boolean value that can be a literal, a path, or a function call returning a boolean.",oneOf:[{type:"boolean"},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},DynamicStringList:{description:"Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",oneOf:[{type:"array",items:{type:"string"}},{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}]},FunctionCommon:{type:"object",description:"Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog.",properties:{call:{type:"string",description:"The name of the function to call."},catalogId:{type:"string",description:"The catalog ID for this function, overriding any surface-level default catalogId."}},required:["call"]},IndexSystemFunction:{type:"object",description:"Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.",returnType:"number",properties:{call:{const:"@index"},args:{type:"object",properties:{offset:{$ref:"#/$defs/DynamicNumber",description:"Optional. An offset to add to the 0-based index (e.g., 1 for 1-based indexing). Defaults to 0.",default:0}},unevaluatedProperties:!1}},required:["call"],unevaluatedProperties:!1},FunctionCall:{type:"object",description:"Invokes a named function, combining common function properties with the catalog function definition.",allOf:[{$ref:"#/$defs/FunctionCommon"},{oneOf:[{$ref:"catalog.json#/$defs/anyFunction"},{$ref:"#/$defs/IndexSystemFunction"}]}],unevaluatedProperties:!1},CheckRule:{type:"object",description:"A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object.",properties:{condition:{oneOf:[{$ref:"#/$defs/DataBinding"},{$ref:"#/$defs/FunctionCall"}],description:"Path or function call evaluating to a structured validation result object."},message:{type:"string",description:"Optional fallback error message."}},required:["condition"],additionalProperties:!1},Checkable:{description:"Properties for components that support renderer-side checks.",type:"object",properties:{checks:{type:"array",description:"A list of checks to perform. These are function calls that must return a boolean indicating validity.",items:{$ref:"#/$defs/CheckRule"}}}},Action:{description:"Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.",oneOf:[{type:"object",description:"Triggers an agent-side event.",properties:{event:{type:"object",description:"The event to dispatch to the agent.",properties:{name:{type:"string",description:"The name of the action to be dispatched to the agent."},userMessage:{$ref:"#/$defs/DynamicString",description:"An optional human-readable message describing the action performed by the user, to present in conversation history or user feedback."},context:{type:"object",description:"A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",additionalProperties:{$ref:"#/$defs/DynamicValue"}}},required:["name"],additionalProperties:!1}},required:["event"],additionalProperties:!1},{type:"object",description:"Executes a renderer or agent-side function.",properties:{functionCall:{$ref:"#/$defs/FunctionCall"}},required:["functionCall"],additionalProperties:!1}]},Surface:{title:"Surface Container Component",description:"The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.",type:"object",allowedParents:[],properties:{component:{const:"Surface"},child:{const:"root"}},additionalProperties:!1},FunctionResponse:{type:"object",description:"The return response matching a callAgentFunction or callRendererFunction invocation.",properties:{functionCallId:{$ref:"#/$defs/CallId",description:"The unique ID matching the initiating function call."},value:{description:"The return value of the function."},error:{type:"object",description:"An error object indicating failure of the function execution.",properties:{code:{type:"string"},message:{type:"string"}},required:["code","message"],additionalProperties:!1}},required:["functionCallId"],oneOf:[{required:["value"]},{required:["error"]}],additionalProperties:!1}};const STANDARD_DEFS_BY_VERSION={"0.8":V08_STANDARD_DEFS,"0.9":V09_STANDARD_DEFS,"0.9.1":V09_STANDARD_DEFS,"1.0":V10_STANDARD_DEFS};function getStandardDefsForCatalog(Au,lo){if(lo?.standardDefs)return lo.standardDefs;if(lo?.protocolVersion){const $u=toCanonicalVersion(lo.protocolVersion)??normalizeVersionString(lo.protocolVersion);if($u in STANDARD_DEFS_BY_VERSION)return STANDARD_DEFS_BY_VERSION[$u]}return V09_STANDARD_DEFS}function transformRefDescriptionNode(Au){if(typeof Au.description!="string"||!Au.description.startsWith("REF:"))return!1;const lo=Au.description.substring(4),$u=lo.indexOf("|"),Ru=$u===-1?lo:lo.substring(0,$u),Iu=$u===-1?"":lo.substring($u+1),Pu=Au.default;for(const Ou of Object.keys(Au))delete Au[Ou];return Au.$ref=Ru.startsWith("#")?Ru:`#/$defs/${Ru.split("/").pop()}`,Pu!==void 0&&(Au.default=Pu),Iu&&(Au.description=Iu),!0}function cleanSchemaProperties(Au){Array.isArray(Au.anyOf)&&(Au.oneOf=Au.anyOf,delete Au.anyOf),Au.additionalProperties&&typeof Au.additionalProperties=="object"&&Object.keys(Au.additionalProperties).length===0&&(Au.additionalProperties=!0),Au.unevaluatedProperties&&typeof Au.unevaluatedProperties=="object"&&Object.keys(Au.unevaluatedProperties).length===0&&(Au.unevaluatedProperties=!0),"$schema"in Au&&delete Au.$schema}function cleanSchemaNode(Au,lo=new Set){if(typeof Au!="object"||Au===null||lo.has(Au))return;if(lo.add(Au),Array.isArray(Au)){for(const Ru of Au)cleanSchemaNode(Ru,lo);return}const $u=Au;if(!transformRefDescriptionNode($u)){cleanSchemaProperties($u);for(const Ru of Object.keys($u))cleanSchemaNode($u[Ru],lo)}}function processTheme(Au,lo){if(!Au.themeSchema)return;const $u=zodToJsonSchema(Au.themeSchema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode($u),$u.definitions&&typeof $u.definitions=="object"?(Object.assign(lo,$u.definitions),delete $u.definitions):$u.$defs&&typeof $u.$defs=="object"&&(Object.assign(lo,$u.$defs),delete $u.$defs);const Ru=Au.id.includes("v0_8")||Au.id.includes("v0.8"),Iu={type:"object",properties:$u.properties||{},...Array.isArray($u.required)&&$u.required.length>0?{required:$u.required}:{},...Ru?{}:{additionalProperties:$u.additionalProperties!==void 0?$u.additionalProperties:!0}};lo.theme=Iu}function extractZodComponentSchema(Au,lo){if(!Au.schema||typeof Au.schema!="object"||!("safeParse"in Au.schema))return{props:{},reqList:[],additionalProps:void 0};const $u=zodToJsonSchema(Au.schema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode($u),$u.definitions&&typeof $u.definitions=="object"?Object.assign(lo,$u.definitions):$u.$defs&&typeof $u.$defs=="object"&&Object.assign(lo,$u.$defs);const Ru=$u.properties||{},Iu=Array.isArray($u.required)?$u.required.filter(Du=>Du!=="component"&&Du!=="id"):[],Pu=$u.unevaluatedProperties??$u.additionalProperties;return{props:Ru,reqList:Iu,additionalProps:typeof Pu=="boolean"||typeof Pu=="object"&&Pu!==null?Pu:void 0}}function processSingleComponent(Au,lo,$u,Ru,Iu){const{props:Pu,reqList:Ou,additionalProps:Du}=extractZodComponentSchema(lo,$u),{component:Mu,id:Lu,...Bu}=Pu,ju={id:{$ref:"#/$defs/ComponentId"},...Bu,component:{const:Au}},Fu=["id",...Ou,"component"];let zu;return Iu?.componentEnvelopeRef?zu={allOf:[{$ref:Iu.componentEnvelopeRef},{type:"object",properties:ju,required:Fu}],unevaluatedProperties:Du!==void 0?Du:!1}:zu={type:"object",properties:ju,required:Fu,unevaluatedProperties:Du!==void 0?Du:!1},lo.allowedParents&&lo.allowedParents.length>0&&(zu.allowedParents=lo.allowedParents),lo.allowedChildren&&lo.allowedChildren.length>0&&(zu.allowedChildren=lo.allowedChildren),zu}function processComponents(Au,lo,$u,Ru){if(Au.components.size===0){lo.components={};return}const Iu={};for(const[Pu,Ou]of Au.components.entries())Iu[Pu]=processSingleComponent(Pu,Ou,$u,Au,Ru);lo.components=Iu,$u.anyComponent={oneOf:Array.from(Au.components.keys()).map(Pu=>({$ref:`#/components/${Pu}`})),discriminator:{propertyName:"component"}}}function processSingleFunction(Au,lo,$u){let Ru;if(lo.schema&&typeof lo.schema=="object"&&"safeParse"in lo.schema){const Iu=zodToJsonSchema(lo.schema,{target:"jsonSchema2019-09",$refStrategy:"none"});cleanSchemaNode(Iu),Iu.definitions&&typeof Iu.definitions=="object"?(Object.assign($u,Iu.definitions),delete Iu.definitions):Iu.$defs&&typeof Iu.$defs=="object"&&(Object.assign($u,Iu.$defs),delete Iu.$defs),Ru=Iu}else Ru={type:"object",properties:{}};if(lo.description&&Ru.description===void 0&&(Ru.description=lo.description),Ru.type==="object"){const Iu=Ru.unevaluatedProperties??Ru.additionalProperties,Pu=typeof Iu=="boolean"||typeof Iu=="object"&&Iu!==null?Iu:void 0;Ru.additionalProperties!==void 0&&delete Ru.additionalProperties,Ru.unevaluatedProperties=Pu!==void 0?Pu:!1}return Ru}function processFunctions(Au,lo,$u){if(Au.functions.size===0)return;const Ru={};for(const[Iu,Pu]of Au.functions.entries())Ru[Iu]=processSingleFunction(Iu,Pu,$u);lo.functions=Ru,$u.anyFunction={oneOf:Array.from(Au.functions.keys()).map(Iu=>({$ref:`#/functions/${Iu}`}))}}function collectReferencedDefs(Au,lo,$u=new Set){if(!(typeof Au!="object"||Au===null)&&!$u.has(Au)){if($u.add(Au),typeof Au.$ref=="string"){const Ru=Au.$ref;Ru.startsWith("#/$defs/")&&lo.add(Ru.substring(8))}if(Array.isArray(Au))for(const Ru of Au)collectReferencedDefs(Ru,lo,$u);else for(const Ru of Object.values(Au))collectReferencedDefs(Ru,lo,$u)}}function generateCatalogSchema(Au,lo){const $u={$schema:"https://json-schema.org/draft/2020-12/schema",catalogId:Au.id};Au.instructions&&($u.instructions=Au.instructions);const Ru={};processTheme(Au,Ru),processComponents(Au,$u,Ru,lo),processFunctions(Au,$u,Ru);const Iu=getStandardDefsForCatalog(Au,lo);let Pu;do{Pu=Object.keys(Ru).length;const Ou=new Set;collectReferencedDefs($u,Ou),collectReferencedDefs(Ru,Ou),(Ou.has("DynamicString")||Ou.has("DynamicNumber")||Ou.has("DynamicBoolean")||Ou.has("DynamicValue"))&&(Ou.add("DataBinding"),Ou.add("FunctionCall"));for(const Du of Ou)Du in Iu&&!(Du in Ru)&&(Ru[Du]=Iu[Du])}while(Object.keys(Ru).length>Pu);return Object.keys(Ru).length>0&&($u.$defs=Ru),$u}function extractRefDefName(Au){if(!Au)return"";const lo=Au.lastIndexOf("#");return(lo!==-1?Au.slice(lo+1):Au).split("/").filter(Boolean).pop()??""}function unwrapNextZodLayer(Au,lo){if(!Au?._def)return null;if(lo){if(lo.has(Au))return null;lo.add(Au)}switch(Au._def.typeName){case"ZodOptional":case"ZodNullable":case"ZodDefault":case"ZodReadonly":return Au._def.innerType;case"ZodBranded":return Au._def.type;case"ZodEffects":return Au._def.schema;case"ZodLazy":return Au._def.getter();default:return null}}function getDescriptions(Au){const lo=[],$u=new Set;let Ru=Au;for(;Ru;){Ru.description&&lo.push(Ru.description),Ru._def?.description&&lo.push(Ru._def.description);const Iu=unwrapNextZodLayer(Ru,$u);if(!Iu)break;Ru=Iu}return lo}function unwrapZodType(Au){const lo=new Set;let $u=Au;for(;$u;){const Ru=unwrapNextZodLayer($u,lo);if(!Ru)break;$u=Ru}return $u}function checkDirectJsonRef(Au,lo){if(!Au)return null;const $u=extractRefDefName(Au),Ru=lo.childListRefNames,Iu=lo.childRefNames;return Ru.has($u)?{isChild:!1,isChildList:!0}:Iu.has($u)?{isChild:!0,isChildList:!1}:null}function checkCombinerList(Au,lo){let $u=!1;for(const Ru of Au){if(typeof Ru!="object"||Ru===null)continue;const Iu=checkJsonSchemaRef(Ru,lo);if(Iu.isChildList)return{isChild:!1,isChildList:!0};Iu.isChild&&($u=!0)}return $u?{isChild:!0,isChildList:!1}:null}function checkCombinerRefs(Au,lo){let $u=!1;for(const Ru of["oneOf","anyOf","allOf"]){const Iu=Au[Ru];if(!Array.isArray(Iu))continue;const Pu=checkCombinerList(Iu,lo);if(Pu?.isChildList)return Pu;Pu?.isChild&&($u=!0)}return $u?{isChild:!0,isChildList:!1}:null}function checkJsonSchemaRef(Au,lo){const $u=typeof Au.$ref=="string"?Au.$ref:"",Ru=checkDirectJsonRef($u,lo);if(Ru)return Ru;if(Au.type==="array"&&Au.items){const Pu=checkJsonSchemaRef(Au.items,lo);if(Pu.isChild||Pu.isChildList)return{isChild:!1,isChildList:!0}}const Iu=checkCombinerRefs(Au,lo);return Iu||(Au.type==="object"&&Au.properties&&("componentId"in Au.properties&&("path"in Au.properties||"dataBinding"in Au.properties)||"explicitList"in Au.properties||"template"in Au.properties)?{isChild:!1,isChildList:!0}:{isChild:!1,isChildList:!1})}function isTemplateShape(Au){if(Au?._def?.typeName==="ZodObject"&&typeof Au._def.shape=="function"){const lo=Au._def.shape();return!!(lo.componentId&&(lo.path||lo.dataBinding)||lo.explicitList||lo.template)}return!1}function isArrayOfChild(Au,lo){if(Au?._def?.typeName==="ZodArray"){const $u=unwrapZodType(Au._def.type);return analyzeChildRefSchema($u,lo).isChild}return!1}function analyzeUnionOptions(Au,lo){let $u=!1,Ru=!1,Iu=!1;for(const Pu of Au){const Ou=unwrapZodType(Pu);isTemplateShape(Ou)&&($u=!0),isArrayOfChild(Ou,lo)&&(Ru=!0);const Du=analyzeChildRefSchema(Ou,lo);if(Du.isChildList)return{isChild:!1,isChildList:!0};Du.isChild&&(Iu=!0)}return $u||Ru?{isChild:!1,isChildList:!0}:Iu?{isChild:!0,isChildList:!1}:{isChild:!1,isChildList:!1}}function isChildListDescription(Au,lo){if(!Au)return!1;if(Au.startsWith("REF:")){const Iu=extractRefDefName(Au.substring(4).split("|")[0]);if(lo.has(Iu))return!0}const $u=extractRefDefName(Au.split("|")[0]);if($u&&lo.has($u))return!0;const Ru=Au.trim();return!!lo.has(Ru)}function isChildDescription(Au,lo){if(!Au)return!1;if(Au.startsWith("REF:")){const Iu=extractRefDefName(Au.substring(4).split("|")[0]);if(lo.has(Iu))return!0}const $u=extractRefDefName(Au.split("|")[0]);if($u&&lo.has($u))return!0;const Ru=Au.trim();return!!lo.has(Ru)}function checkDescriptionChildRef(Au,lo){const $u=lo.childListRefNames,Ru=lo.childRefNames;for(const Iu of Au){if(isChildListDescription(Iu,$u))return{isChild:!1,isChildList:!0};if(isChildDescription(Iu,Ru))return{isChild:!0,isChildList:!1}}return null}function analyzeZodArray(Au,lo){const $u=analyzeChildRefSchema(Au,lo);return $u.isChild||$u.isChildList?{isChild:!1,isChildList:!0}:{isChild:!1,isChildList:!1}}function analyzeChildRefSchema(Au,lo){if(!Au||typeof Au!="object")return{isChild:!1,isChildList:!1};const $u=childRefKindOf(Au);if($u==="component-id")return{isChild:!0,isChildList:!1};if($u==="child-list")return{isChild:!1,isChildList:!0};const Ru=checkDescriptionChildRef(getDescriptions(Au),lo);if(Ru)return Ru;const Iu=unwrapZodType(Au);if(!Iu?._def)return checkJsonSchemaRef(Au,lo);const Pu=childRefKindOf(Iu);if(Pu==="component-id")return{isChild:!0,isChildList:!1};if(Pu==="child-list")return{isChild:!1,isChildList:!0};const Ou=Iu._def.typeName;if(Ou==="ZodArray"){const Du=unwrapZodType(Iu._def.type);return analyzeZodArray(Du,lo)}if(Ou==="ZodUnion"){const Du=Iu._def.options??[];return analyzeUnionOptions(Du,lo)}if(Ou==="ZodObject"&&typeof Iu._def.shape=="function"){const Du=Iu._def.shape();if(Du.componentId&&(Du.path||Du.dataBinding)||Du.explicitList||Du.template)return{isChild:!1,isChildList:!0}}return{isChild:!1,isChildList:!1}}function addNestedRef(Au,lo,$u){const Ru=Au.nestedRefs[lo];if(Ru){Ru.add($u);return}Au.nestedRefs[lo]=new Set([$u])}function inspectShapeField(Au,lo,$u,Ru){const Iu=analyzeChildRefSchema(lo,Ru);if(Iu.isChildList){$u.listRefs.add(Au);return}if(Iu.isChild){$u.singleRefs.add(Au);return}const Pu=unwrapZodType(lo);if(Pu?._def?.typeName!=="ZodArray")return;const Ou=unwrapZodType(Pu._def.type);if(Ou?._def?.typeName!=="ZodObject"||typeof Ou._def.shape!="function")return;const Du=Ou._def.shape();for(const[Mu,Lu]of Object.entries(Du)){const Bu=analyzeChildRefSchema(Lu,Ru);(Bu.isChild||Bu.isChildList)&&($u.listRefs.add(Au),addNestedRef($u,Au,Mu))}}function rawArrayItemProperties(Au){if(typeof Au!="object"||Au===null)return null;const lo=Au;if(lo.type!=="array"&&!("items"in lo))return null;const $u=lo.items;if(typeof $u!="object"||$u===null)return null;const Ru=$u.properties;return typeof Ru!="object"||Ru===null?null:Ru}function inspectRawProperties(Au,lo,$u){for(const[Ru,Iu]of Object.entries(Au)){const Pu=analyzeChildRefSchema(Iu,$u);if(Pu.isChildList){lo.listRefs.add(Ru);continue}if(Pu.isChild){lo.singleRefs.add(Ru);continue}const Ou=rawArrayItemProperties(Iu);if(Ou)for(const[Du,Mu]of Object.entries(Ou)){const Lu=analyzeChildRefSchema(Mu,$u);(Lu.isChild||Lu.isChildList)&&(lo.listRefs.add(Ru),addNestedRef(lo,Ru,Du))}}}function inspectComponentSchema(Au,lo,$u){if(!Au)return;const Ru=unwrapZodType(Au);if(Ru?._def?.typeName==="ZodObject"&&typeof Ru._def.shape=="function"){const Iu=Ru._def.shape();for(const[Pu,Ou]of Object.entries(Iu))inspectShapeField(Pu,Ou,lo,$u);return}if(typeof Au=="object"&&Au!==null&&"properties"in Au){const Iu=Au.properties;typeof Iu=="object"&&Iu!==null&&inspectRawProperties(Iu,lo,$u)}}function buildComponentRefMap(Au,lo){const $u={},Ru=typeof Au?.components?.values=="function"?Array.from(Au.components.values()):Array.isArray(Au)?Au:Array.from(Au.values());for(const Iu of Ru){const Pu={singleRefs:new Set,listRefs:new Set,nestedRefs:{}};inspectComponentSchema(Iu.schema,Pu,lo),$u[Iu.name]={singleRefs:Pu.singleRefs,listRefs:Pu.listRefs,nestedRefs:Pu.nestedRefs}}return $u}function createFunctionImplementation(Au,lo){return{name:Au.name,returnType:Au.returnType,schema:Au.schema,allowedCallers:Au.allowedCallers,requiresUserActivation:Au.requiresUserActivation,description:Au.description,execute:lo}}class Catalog{get catalogSchema(){return this.cachedCatalogSchema||(this.cachedCatalogSchema=generateCatalogSchema(this)),this.cachedCatalogSchema}get componentRefMap(){return this._componentRefMap||(this._componentRefMap=buildComponentRefMap(this,V09_CHILD_REF_OPTIONS)),this._componentRefMap}constructor(lo,$u,Ru=[],Iu=[],Pu,Ou){if(!$u)throw new A2uiCatalogError("protocolVersion must be provided.");this.id=lo,this.protocolVersion=$u;const Du=new Map;for(const Lu of Ru)Du.set(Lu.name,Lu);this.components=Du;const Mu=new Map;for(const Lu of Iu)Mu.set(Lu.name,Lu);this.functions=Mu,this.themeSchema=Pu,this.instructions=Ou,this.invoker=(Lu,Bu,ju,Fu)=>{const zu=this.functions.get(Lu);if(!zu)throw new A2uiExpressionError(`Function not found in catalog '${this.id}': ${Lu}`,Lu);const Uu=zu.execute;if(typeof Uu!="function")throw new A2uiExpressionError(`Function '${Lu}' in catalog '${this.id}' is schema-only and has no implementation.`,Lu);try{const Hu=zu.schema.parse(Bu);return Uu.call(zu,Hu,ju,Fu)}catch(Hu){throw Hu?.name==="ZodError"||Hu instanceof ZodError?new A2uiExpressionError(`Validation failed for function '${Lu}': ${Hu.message}`,Lu,Hu.errors??Hu.issues):Hu}}}static fromSchema(lo,$u){return loadCatalogFromSchema(lo,$u)}}class EventEmitter{constructor(){this.listeners=new Set}subscribe(lo){return this.listeners.add(lo),{unsubscribe:()=>this.listeners.delete(lo)}}async emit(lo){for(const $u of this.listeners)try{await $u(lo)}catch(Ru){console.error("EventEmitter error:",Ru)}}dispose(){this.listeners.clear()}}var i=Symbol.for("preact-signals");function t(){if(v>1)v--;else{var Au,lo=!1;for((function(){var Iu=c;for(c=void 0;Iu!==void 0;){var Pu=Iu.S;if(Pu.v===Iu.v)for(var Ou=Pu.t;Ou!==void 0;Ou=Ou.x)Ou.i===Iu.i&&(Ou.i=Pu.i);Iu=Iu.o}})();h!==void 0;){var $u=h;for(h=void 0,s++;$u!==void 0;){var Ru=$u.u;if($u.u=void 0,$u.f&=-3,!(8&$u.f)&&w($u))try{$u.c()}catch(Iu){lo||(Au=Iu,lo=!0)}$u=Ru}}if(s=0,v--,lo)throw Au}}function r(Au){if(v>0)return Au();u=++e,v++;try{return Au()}finally{t()}}var n,o=void 0;function f(Au){var lo=o,$u=n;o=void 0,n=void 0;try{return Au()}finally{o=lo,n=$u}}var h=void 0,v=0,s=0,e=0,u=0,c=void 0,a=0;function d(Au){if(o!==void 0){var lo=Au.n;if(lo===void 0||lo.t!==o)return lo={i:0,S:Au,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:lo},o.s!==void 0&&(o.s.n=lo),o.s=lo,Au.n=lo,32&o.f&&Au.S(lo),lo;if(lo.i===-1)return lo.i=0,lo.n!==void 0&&(lo.n.p=lo.p,lo.p!==void 0&&(lo.p.n=lo.n),lo.p=o.s,lo.n=void 0,o.s.n=lo,o.s=lo),lo}}function l(Au,lo){this.v=Au,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=lo?.watched,this.Z=lo?.unwatched,this.name=lo?.name}l.prototype.brand=i;l.prototype.h=function(){return!0};l.prototype.S=function(Au){var lo=this,$u=this.t;$u!==Au&&Au.e===void 0&&(Au.x=$u,this.t=Au,$u!==void 0?$u.e=Au:f(function(){var Ru;(Ru=lo.W)==null||Ru.call(lo)}))};l.prototype.U=function(Au){var lo=this;if(this.t!==void 0){var $u=Au.e,Ru=Au.x;$u!==void 0&&($u.x=Ru,Au.e=void 0),Ru!==void 0&&(Ru.e=$u,Au.x=void 0),Au===this.t&&(this.t=Ru,Ru===void 0&&f(function(){var Iu;(Iu=lo.Z)==null||Iu.call(lo)}))}};l.prototype.subscribe=function(Au){var lo=this;return x(function(){var $u=lo.value;f(function(){return Au($u)})},{name:"sub"})};l.prototype.valueOf=function(){return this.value};l.prototype.toString=function(){return this.value+""};l.prototype.toJSON=function(){return this.value};l.prototype.peek=function(){var Au=this;return f(function(){return Au.value})};Object.defineProperty(l.prototype,"value",{get:function(){var Au=d(this);return Au!==void 0&&(Au.i=this.i),this.v},set:function(Au){if(Au!==this.v){if(s>100)throw new Error("Cycle detected");(function($u){v!==0&&s===0&&$u.l!==u&&($u.l=u,c={S:$u,v:$u.v,i:$u.i,o:c})})(this),this.v=Au,this.i++,a++,v++;try{for(var lo=this.t;lo!==void 0;lo=lo.x)lo.t.N()}finally{t()}}}});function y(Au,lo){return new l(Au,lo)}function w(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n)if(lo.S.i!==lo.i||!lo.S.h()||lo.S.i!==lo.i)return!0;return!1}function b(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n){var $u=lo.S.n;if($u!==void 0&&(lo.r=$u),lo.S.n=lo,lo.i=-1,lo.n===void 0){Au.s=lo;break}}}function _(Au){for(var lo=Au.s,$u=void 0;lo!==void 0;){var Ru=lo.p;lo.i===-1?(lo.S.U(lo),Ru!==void 0&&(Ru.n=lo.n),lo.n!==void 0&&(lo.n.p=Ru)):$u=lo,lo.S.n=lo.r,lo.r!==void 0&&(lo.r=void 0),lo=Ru}Au.s=$u}function j(Au,lo){l.call(this,void 0,lo),this.x=Au,this.s=void 0,this.g=a-1,this.f=4}j.prototype=new l;j.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===a))return!0;if(this.g=a,this.f|=1,this.i>0&&!w(this))return this.f&=-2,!0;var Au=o;try{b(this),o=this;var lo=this.x();(16&this.f||this.v!==lo||this.i===0)&&(this.v=lo,this.f&=-17,this.i++)}catch($u){this.v=$u,this.f|=16,this.i++}return o=Au,_(this),this.f&=-2,!0};j.prototype.S=function(Au){if(this.t===void 0){this.f|=36;for(var lo=this.s;lo!==void 0;lo=lo.n)lo.S.S(lo)}l.prototype.S.call(this,Au)};j.prototype.U=function(Au){if(this.t!==void 0&&(l.prototype.U.call(this,Au),this.t===void 0)){this.f&=-33;for(var lo=this.s;lo!==void 0;lo=lo.n)lo.S.U(lo)}};j.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var Au=this.t;Au!==void 0;Au=Au.x)Au.t.N()}};Object.defineProperty(j.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var Au=d(this);if(this.h(),Au!==void 0&&(Au.i=this.i),16&this.f)throw this.v;return this.v}});function O(Au,lo){return new j(Au,lo)}function p(Au){var lo=Au.j;if(Au.j=void 0,typeof lo=="function"){v++;var $u=o;o=void 0;try{lo()}catch(Ru){throw Au.f&=-2,Au.f|=8,g(Au),Ru}finally{o=$u,t()}}}function g(Au){for(var lo=Au.s;lo!==void 0;lo=lo.n)lo.S.U(lo);Au.x=void 0,Au.s=void 0,p(Au)}function S(Au){if(o!==this)throw new Error("Out-of-order effect");_(this),o=Au,this.f&=-2;try{8&this.f&&g(this)}finally{t()}}function m(Au,lo){this.x=Au,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=lo?.name,n&&n.push(this)}m.prototype.c=function(){var Au=this.S();try{if(8&this.f||this.x===void 0)return;var lo=this.x();typeof lo=="function"&&(this.j=lo)}finally{Au()}};m.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,p(this),b(this),v++;var Au=o;return o=this,S.bind(this,Au)};m.prototype.N=function(){2&this.f||(this.f|=2,this.u=h,h=this)};m.prototype.d=function(){this.f|=8,1&this.f||g(this)};m.prototype.dispose=function(){this.d()};function x(Au,lo){var $u=new m(Au,lo);try{$u.c()}catch(Iu){throw $u.d(),Iu}var Ru=$u.d.bind($u);return Ru[Symbol.dispose]=Ru,Ru}let signalImpl,computedImpl,effectImpl,batchWriteImpl,isSignalImpl,getValueImpl,setValueImpl,peekValueImpl;const _PRIVATE_DEFAULT_SIGNAL_IMPLEMENTATION={signal:y,computed:O,effect:x,batchWrite:r,isSignal:Au=>!!Au&&typeof Au=="object"&&"value"in Au&&"peek"in Au,getValue:Au=>Au.value,setValue:(Au,lo)=>{Au instanceof j||(Au.value=lo)},peekValue:Au=>Au.peek()};setSignalImplementation(_PRIVATE_DEFAULT_SIGNAL_IMPLEMENTATION);function setSignalImplementation(Au){signalImpl=Au.signal,computedImpl=Au.computed,effectImpl=Au.effect,batchWriteImpl=Au.batchWrite,isSignalImpl=Au.isSignal,getValueImpl=Au.getValue,setValueImpl=Au.setValue,peekValueImpl=Au.peekValue}function signal(Au){return signalImpl(Au)}function computed(Au){return computedImpl(Au)}function effect(Au){return effectImpl(Au)}function batchWrite(Au){return batchWriteImpl(Au)}function isSignal(Au){return isSignalImpl(Au)}function getValue(Au){return getValueImpl(Au)}function setValue(Au,lo){setValueImpl(Au,lo)}function peekValue(Au){return peekValueImpl(Au)}function isNumeric(Au){return/^(0|[1-9]\d*)$/.test(Au)}const MAX_ARRAY_INDEX=1e4,FORBIDDEN_KEYS=new Set(["__proto__","constructor","prototype"]);class DataModel{constructor(lo={}){this.data={},this.signals=new Map,this.subscriptions=new Set,this.data=lo}getSignal(lo){const $u=this.normalizePath(lo);return this.signals.has($u)||this.signals.set($u,signal(this.get($u))),this.signals.get($u)}set(lo,$u){if(lo==null)throw new A2uiDataError("Path cannot be null or undefined.");if(lo==="/"||lo==="")return this.data=$u??{},this.notifyAllSignals(),this;const Ru=this.parsePath(lo),Iu=Ru.pop();if($u==null&&this.get(lo)===void 0)return this;if(this.data===void 0||this.data===null)this.data={};else if(typeof this.data!="object")throw new A2uiDataError(`Cannot set path '${lo}': the data model root is a primitive value.`,lo);let Pu=this.data;for(let Ou=0;Ou<Ru.length;Ou++){const Du=Ru[Ou];if(Array.isArray(Pu)){if(!isNumeric(Du))throw new A2uiDataError(`Cannot use non-numeric segment '${Du}' on an array in path '${lo}'.`,lo);const Mu=parseInt(Du,10);if(Mu>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Du}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);const Lu=Pu[Mu];if(Lu!=null&&typeof Lu!="object")throw new A2uiDataError(`Cannot set path '${lo}': segment '${Du}' is a primitive value.`,lo);if(Lu==null){const Bu=Ou<Ru.length-1?Ru[Ou+1]:Iu;if(isNumeric(Bu)){if(parseInt(Bu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Bu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);Pu[Mu]=[]}else Pu[Mu]={}}}else{const Mu=Object.prototype.hasOwnProperty.call(Pu,Du);if(Mu){const Lu=Pu[Du];if(Lu!=null&&typeof Lu!="object")throw new A2uiDataError(`Cannot set path '${lo}': segment '${Du}' is a primitive value.`,lo)}if(!Mu||Pu[Du]===void 0||Pu[Du]===null){const Lu=Ou<Ru.length-1?Ru[Ou+1]:Iu;if(isNumeric(Lu)){if(parseInt(Lu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Lu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo);Pu[Du]=[]}else Pu[Du]={}}}Pu=Pu[Du]}if(Array.isArray(Pu)){if(!isNumeric(Iu))throw new A2uiDataError(`Cannot use non-numeric segment '${Iu}' on an array in path '${lo}'.`,lo);if(parseInt(Iu,10)>MAX_ARRAY_INDEX)throw new A2uiDataError(`Cannot set path '${lo}': array index '${Iu}' exceeds maximum supported index (${MAX_ARRAY_INDEX}).`,lo)}if($u==null)if(Array.isArray(Pu)){const Ou=parseInt(Iu,10);Ou<Pu.length&&(Pu[Ou]=void 0)}else delete Pu[Iu];else Pu[Iu]=$u;return this.notifySignals(lo),this}delete(lo){return this.set(lo,void 0)}static resolvePath(lo,$u){return lo.startsWith("/")?lo:$u?`${$u.endsWith("/")?$u:`${$u}/`}${lo}`:`/${lo}`}get(lo){if(lo==null)throw new A2uiDataError("Path cannot be null or undefined.");if(lo==="/"||lo==="")return this.data;const $u=this.parsePath(lo);let Ru=this.data;for(const Iu of $u){if(Ru==null||typeof Ru!="object")return;if(Array.isArray(Ru)){if(!isNumeric(Iu))return;const Pu=parseInt(Iu,10);if(Pu<0||Pu>=Ru.length)return;Ru=Ru[Pu]}else{if(!Object.prototype.hasOwnProperty.call(Ru,Iu))return;Ru=Ru[Iu]}}return Ru}hasPath(lo){return lo==null?!1:this.get(lo)!==void 0}subscribe(lo,$u){const Ru=this.getSignal(lo);let Iu=!0,Pu=peekValue(Ru);const Ou=effect(()=>{const Du=getValue(Ru);Pu=Du,Iu||$u(Du)});return Iu=!1,this.subscriptions.add(Ou),{get value(){return Pu},unsubscribe:()=>{Ou(),this.subscriptions.delete(Ou)}}}dispose(){for(const lo of this.subscriptions)lo();this.subscriptions.clear(),this.signals.clear()}normalizePath(lo){return lo.length>1&&lo.endsWith("/")?lo.slice(0,-1):lo||"/"}parsePath(lo){return lo.split("/").filter($u=>$u.length>0).map($u=>{const Ru=$u.replace(/~([01])/g,(Iu,Pu)=>Pu==="1"?"/":"~");if(FORBIDDEN_KEYS.has(Ru))throw new A2uiDataError(`Forbidden path segment '${Ru}' in path '${lo}'.`,lo);return Ru})}notifySignals(lo){const $u=this.normalizePath(lo);batchWrite(()=>{this.updateSignal($u);let Ru=$u;for(;Ru!=="/"&&Ru!=="";)Ru=Ru.substring(0,Ru.lastIndexOf("/"))||"/",this.updateSignal(Ru);for(const Iu of this.signals.keys())this.isDescendant(Iu,$u)&&this.updateSignal(Iu)})}updateSignal(lo){const $u=this.signals.get(lo);if($u){const Ru=this.get(lo);Array.isArray(Ru)?setValue($u,Ru.slice()):typeof Ru=="object"&&Ru!==null?setValue($u,{...Ru}):setValue($u,Ru)}}notifyAllSignals(){batchWrite(()=>{for(const lo of this.signals.keys())this.updateSignal(lo)})}isDescendant(lo,$u){return $u==="/"||$u===""?lo!=="/":lo.startsWith($u+"/")}}const MAX_GLOBAL_DEPTH=50,MAX_FUNC_CALL_DEPTH=5,RELAXED_PATH_PATTERN=/^(?:(?:\/(?:[^~/]|~[01])*)*|(?:[^~/]|~[01])+(?:\/(?:[^~/]|~[01])*)*)$/;function*extractPointers(Au,lo,$u){if(typeof Au=="string")yield[Au,lo];else if(Array.isArray(Au))for(let Ru=0;Ru<Au.length;Ru++){const Iu=Au[Ru],Pu=`${lo}[${Ru}]`;yield*extractPointers(Iu,Pu,$u)}else if(typeof Au=="object"&&Au!==null){const Ru=Au;if("componentId"in Ru&&typeof Ru.componentId=="string"&&("path"in Ru||"dataBinding"in Ru))yield[Ru.componentId,`${lo}.componentId`];else if($u?.size)for(const Iu of $u)Iu in Ru&&(yield*extractPointers(Ru[Iu],`${lo}.${Iu}`));else for(const[Iu,Pu]of Object.entries(Ru))yield*extractPointers(Pu,`${lo}.${Iu}`)}}function getOrCreateRefMap(Au){return Au.componentRefMap}function*getComponentReferences(Au,lo){if(!Au||typeof Au!="object")return;const $u=lo instanceof Catalog?getOrCreateRefMap(lo):lo,Ru=Au.component;let Iu="",Pu=Au;if(typeof Ru=="string")Iu=Ru;else if(typeof Ru=="object"&&Ru!==null){const Bu=Ru;Iu=Object.keys(Bu)[0]??"",Pu=Bu[Iu]??{}}if(!Iu||typeof Pu!="object"||Pu===null)return;const Ou=$u[Iu],Du=Ou?Ou.singleRefs:new Set,Mu=Ou?Ou.listRefs:new Set,Lu=Ou?.nestedRefs;for(const[Bu,ju]of Object.entries(Pu))(Du.has(Bu)||Mu.has(Bu))&&(yield*extractPointers(ju,Bu,Lu?.[Bu]))}function traverseRecursionAndPaths(Au,lo,$u){if(lo>MAX_GLOBAL_DEPTH)throw new A2uiRecursionError(`Global recursion limit exceeded: Depth > ${MAX_GLOBAL_DEPTH}`);if(Array.isArray(Au)){for(const Ru of Au)traverseRecursionAndPaths(Ru,lo+1,$u);return}if(typeof Au=="object"&&Au!==null){const Ru=Au;if("path"in Ru&&typeof Ru.path=="string"){const Ou=Ru.path;if(!RELAXED_PATH_PATTERN.test(Ou))throw new A2uiValidationError(`Invalid path syntax: '${Ou}'`)}const Iu="functionCall"in Ru&&typeof Ru.functionCall=="object"&&Ru.functionCall!==null,Pu="call"in Ru&&"args"in Ru;if(Iu){if($u>=MAX_FUNC_CALL_DEPTH)throw new A2uiRecursionError(`Recursion limit exceeded: functionCall depth > ${MAX_FUNC_CALL_DEPTH}`);for(const[Ou,Du]of Object.entries(Ru))Ou==="functionCall"?traverseRecursionAndPaths(Du,lo+1,$u+1):traverseRecursionAndPaths(Du,lo+1,$u)}else if(Pu){if($u>=MAX_FUNC_CALL_DEPTH)throw new A2uiRecursionError(`Recursion limit exceeded: functionCall depth > ${MAX_FUNC_CALL_DEPTH}`);for(const[Ou,Du]of Object.entries(Ru))Ou==="args"?traverseRecursionAndPaths(Du,lo+1,$u+1):traverseRecursionAndPaths(Du,lo+1,$u)}else for(const Ou of Object.values(Ru))traverseRecursionAndPaths(Ou,lo+1,$u)}}function validateRecursionAndPaths(Au){traverseRecursionAndPaths(Au,0,0)}class SurfaceComponentsModel{constructor(lo){this.components=new Map,this._onCreated=new EventEmitter,this._onDeleted=new EventEmitter,this.onCreated=this._onCreated,this.onDeleted=this._onDeleted,lo&&this.setCatalog(lo)}setCatalog(lo){this.refMap=lo instanceof Catalog?lo.componentRefMap:lo}get(lo){return this.components.get(lo)}getAll(){return new Map(this.components)}has(lo){return this.components.has(lo)}get entries(){return this.components.entries()}get keys(){return this.components.keys()}get values(){return this.components.values()}get size(){return this.components.size}get componentsMap(){return this.components}addComponent(lo){if(this.components.has(lo.id))throw new A2uiStateError(`Component with id '${lo.id}' already exists.`);this.components.set(lo.id,lo),this._onCreated.emit(lo)}removeComponent(lo){const $u=this.components.get(lo);$u&&(this.components.delete(lo),$u.dispose(),this._onDeleted.emit(lo))}getChildReferences(lo){const $u=this.components.get(lo);if(!$u)return[];const Ru=$u.catalog?.components.size?$u.catalog.componentRefMap:this.refMap??$u.catalog?.componentRefMap??{};return Array.from(getComponentReferences({id:$u.id,component:$u.type,...$u.properties},Ru))}getChildIds(lo){return this.getChildReferences(lo).map(([$u])=>$u)}detectCycles(lo={}){const $u=lo.rootId??"root",Ru=lo.maxDepth??MAX_GLOBAL_DEPTH,Iu=lo.allowMissingRoot??!1;for(const Mu of this.components.values())for(const[Lu,Bu]of this.getChildReferences(Mu.id))if(Lu===Mu.id)throw new A2uiRecursionError(`Circular reference detected: Component '${Mu.id}' references itself in field '${Bu}' (Self-reference detected)`);const Pu=new Set,Ou=new Set,Du=(Mu,Lu)=>{if(Lu>Ru)throw new A2uiRecursionError(`Global recursion limit exceeded: logical depth > ${Ru}`);Pu.add(Mu),Ou.add(Mu);const Bu=this.getChildIds(Mu);for(const ju of Bu)if(this.components.has(ju)){if(!Pu.has(ju))Du(ju,Lu+1);else if(Ou.has(ju))throw new A2uiRecursionError(`Circular reference detected involving component '${ju}'`)}Ou.delete(Mu)};if(Iu){const Mu=Array.from(this.components.keys()).sort();for(const Lu of Mu)Pu.has(Lu)||Du(Lu,0)}else this.components.has($u)&&Du($u,0);return Pu}validateTopology(lo={}){if(this.components.size===0)return;const $u=lo.rootId??"root",Ru=lo.allowMissingRoot??!1,Iu=lo.allowDanglingReferences??!1,Pu=lo.allowOrphanComponents??!1;if(!Ru&&!this.components.has($u))throw new A2uiIntegrityError(`Missing root component: No component has id='${$u}'`);if(!Iu){for(const Du of this.components.values())for(const[Mu,Lu]of this.getChildReferences(Du.id))if(!this.components.has(Mu))throw new A2uiIntegrityError(`Component '${Du.id}' references non-existent component '${Mu}' in field '${Lu}' (Dangling reference '${Mu}' in component '${Du.id}')`)}const Ou=this.detectCycles({rootId:$u,allowMissingRoot:Ru,maxDepth:lo.maxDepth});if(!Pu&&!Ru&&Ou.size<this.components.size){const Du=Array.from(this.components.keys()).filter(Mu=>!Ou.has(Mu)).sort();if(Du.length>0)throw new A2uiIntegrityError(`Component '${Du[0]}' is not reachable from '${$u}' (Orphaned component '${Du[0]}' is not reachable from root)`)}}validateReferences(lo={}){const $u=[];try{this.validateTopology(lo)}catch(Ru){Ru instanceof A2uiValidationError?$u.push(Ru):Ru instanceof Error&&$u.push(new A2uiValidationError(Ru.message))}return $u}dispose(){for(const lo of this.components.values())lo.dispose();this.components.clear(),this._onCreated.dispose(),this._onDeleted.dispose()}}class SurfaceModel{constructor(lo,$u,Ru=new Map,Iu={},Pu=!1,Ou,Du="root"){if(this.id=lo,this.defaultCatalog=$u,this.theme=Iu,this.sendDataModel=Pu,this.rootId=Du,this._onAction=new EventEmitter,this._onError=new EventEmitter,this._onWarning=new EventEmitter,this.onAction=this._onAction,this.onError=this._onError,this.onWarning=this._onWarning,Ru!=null&&!(Ru instanceof Map))throw new TypeError("availableCatalogs must be a Map, or undefined/null. Note that availableCatalogs is now the 3rd argument to SurfaceModel and theme is the 4th argument.");const Mu=new Map(Ru??[]);$u?.id&&!Mu.has($u.id)&&Mu.set($u.id,$u),this.availableCatalogs=Mu,this.dataModel=Ou??new DataModel({}),this.componentsModel=new SurfaceComponentsModel($u)}get catalog(){return this.defaultCatalog}async dispatchAction(lo,$u){if(!lo||typeof lo!="object")return;const Ru=extractActionTarget(lo);if(!Ru)return;const Iu=Ru.name;if(!Iu||typeof Iu!="string")return;const Pu=Ru.context,Ou=Pu&&typeof Pu=="object"&&!Array.isArray(Pu)?Pu:{},Du={name:Iu,surfaceId:this.id,sourceComponentId:$u,timestamp:new Date().toISOString(),context:Ou},Mu=Ru.catalogId??lo.catalogId;typeof Mu=="string"&&Mu&&(Du.catalogId=Mu),typeof Ru.userMessage=="string"&&Ru.userMessage.length>0&&(Du.userMessage=Ru.userMessage),await this._onAction.emit(Du)}async dispatchError(lo){await this._onError.emit({...lo,surfaceId:this.id})}async dispatchWarning(lo){await this._onWarning.emit({...lo,surfaceId:this.id})}dispose(){this.dataModel.dispose(),this.componentsModel.dispose(),this._onAction.dispose(),this._onError.dispose(),this._onWarning.dispose()}}function extractActionTarget(Au){return"event"in Au&&Au.event&&typeof Au.event=="object"?Au.event:"name"in Au&&typeof Au.name=="string"?Au:null}class SurfaceGroupModel{constructor(){this.surfaces=new Map,this.surfaceUnsubscribers=new Map,this._onSurfaceCreated=new EventEmitter,this._onSurfaceDeleted=new EventEmitter,this._onAction=new EventEmitter,this.onSurfaceCreated=this._onSurfaceCreated,this.onSurfaceDeleted=this._onSurfaceDeleted,this.onAction=this._onAction}addSurface(lo){if(this.surfaces.has(lo.id)){console.warn(`Surface ${lo.id} already exists. Ignoring.`);return}this.surfaces.set(lo.id,lo);const $u=lo.onAction.subscribe(Ru=>this._onAction.emit(Ru));this.surfaceUnsubscribers.set(lo.id,$u),this._onSurfaceCreated.emit(lo)}deleteSurface(lo){const $u=this.surfaces.get(lo);if($u){const Ru=this.surfaceUnsubscribers.get(lo);Ru&&(Ru.unsubscribe(),this.surfaceUnsubscribers.delete(lo)),this.surfaces.delete(lo),$u.dispose(),this._onSurfaceDeleted.emit(lo)}}getSurface(lo){return this.surfaces.get(lo)}get surfacesMap(){return this.surfaces}dispose(){for(const lo of Array.from(this.surfaces.keys()))this.deleteSurface(lo);this._onSurfaceCreated.dispose(),this._onSurfaceDeleted.dispose(),this._onAction.dispose()}}class ComponentModel{constructor(lo,$u,Ru,Iu){this.id=lo,this.type=$u,this.catalog=Iu,this._onUpdated=new EventEmitter,this.onUpdated=this._onUpdated,this._properties=Ru}get properties(){return this._properties}set properties(lo){this._properties=lo,this._onUpdated.emit(this)}dispose(){this._onUpdated.dispose()}get componentTree(){return{id:this.id,type:this.type,...this._properties}}}function formatZodIssue(Au){const lo=Au.path.join(".")||"root";switch(Au.code){case ZodIssueCode.invalid_union:{const $u=Au.unionErrors?.flatMap(Ru=>Ru.issues);return $u&&$u.length>0?$u.map(formatZodIssue).join("; "):`${lo}: Invalid union`}case ZodIssueCode.unrecognized_keys:{const $u=Au.keys.map(Ru=>`'${Ru}'`).join(", ");return`${lo}: Unrecognized key(s) in object: ${$u}`}case ZodIssueCode.invalid_enum_value:{const $u=Au,Ru=$u.options.map(Iu=>String(Iu)).join(" | ");return`${lo}: Invalid enum value. Expected ${Ru}, received '${String($u.received)}'`}case ZodIssueCode.invalid_type:{const $u=Au;return`${lo}: Expected ${$u.expected}, received ${$u.received}`}case ZodIssueCode.custom:return`${lo}: ${Au.message}`;default:return Au.message?`${lo}: ${Au.message}`:`${lo}: Validation error (${Au.code})`}}const DEFAULT_CATALOG_COMPATIBILITY={"0.8":new Set(["0.8"]),"0.9":new Set(["0.9","0.9.1"]),"0.9.1":new Set(["0.9.1","0.9"]),"1.0":new Set(["1.0"])};function isCatalogVersionCompatible(Au,lo,$u=DEFAULT_CATALOG_COMPATIBILITY){if(!Au||!lo)return!1;const Ru=toCanonicalVersion(Au),Iu=toCanonicalVersion(lo);if(Ru&&Iu){if(Ru===Iu)return!0;const Du=$u[Iu];if(Du&&Du.has(Ru))return!0;const Mu=toSemVer(Au),Lu=toSemVer(lo);return!!(Mu&&Lu&&Mu.major>=1&&Mu.major===Lu.major)}if(typeof Au!="string"||typeof lo!="string")return!1;const Pu=normalizeVersionString(Au),Ou=normalizeVersionString(lo);return Pu.length>0&&Pu===Ou}let globalKnownActionsProvider;function registerKnownActionsProvider(Au){globalKnownActionsProvider=Au}function validateActionSurfaceIds(Au,lo){for(const $u of lo){const Ru=Au[$u];if(Ru&&typeof Ru=="object"){const Iu=Ru;if("surfaceId"in Iu&&Iu.surfaceId!==void 0&&typeof Iu.surfaceId!="string")throw new A2uiValidationError("surfaceId must be a string")}}}class BaseVersionAdapter{get compatibleCatalogVersions(){const lo=toCanonicalVersion(this.version);return lo?new Set([lo]):new Set}get validActions(){return new Set(this.getNativeActionKeys())}isCatalogCompatible(lo){return lo?isCatalogVersionCompatible(lo,this.version):!1}extractOperations(lo){if(!lo||typeof lo!="object")return[];if(Array.isArray(lo))return lo.flatMap(Du=>this.extractOperations(Du));const $u=lo;if(Array.isArray($u.messages))return this.extractOperations($u.messages);const Ru=this.getNativeActionKeys();validateActionSurfaceIds($u,Ru);const Iu=Ru.filter(Du=>Du in $u).sort();if(Iu.length>1)throw new A2uiValidationError(`Message contains multiple conflicting update actions: ${Iu.join(", ")}.`);if(Iu.length===0){const Du=globalKnownActionsProvider?globalKnownActionsProvider():new Set(Ru),Mu=Object.keys($u).find(Bu=>Du.has(Bu)&&!Ru.includes(Bu)),Lu=Ru.slice().sort().join(", ");throw Mu?new A2uiValidationError(`Invalid ${this.version} message: action '${Mu}' is not supported in protocol version ${this.version}. Allowed actions: ${Lu}.`):new A2uiValidationError(`Invalid ${this.version} message: message must contain exactly one update action: ${Lu}.`)}const Pu=this.preparePayloadForValidation($u),Ou=this.schema.safeParse(Pu);if(!Ou.success){const Du=Ou.error.errors.map(formatZodIssue).join("; ");throw new A2uiValidationError(`Invalid ${this.version} message: ${Du}`,Ou.error)}return this.extractOperationsFromObject($u)}preparePayloadForValidation(lo){return"version"in lo?lo:{version:this.version,...lo}}}const exactlyOneKey=(Au,lo)=>{const $u=Object.keys(Au).filter(Ru=>Au[Ru]!==void 0);$u.length!==1&&lo.addIssue({code:ZodIssueCode.custom,message:`Must define exactly one property, found ${$u.length} (${$u.join(", ")}).`})},StringValueSchema=objectType({path:stringType().optional(),literalString:stringType().optional(),literal:stringType().optional()}).strict().superRefine(exactlyOneKey),DataValueMapItemSchema=lazyType(()=>objectType({key:stringType(),valueString:stringType().optional(),valueNumber:numberType().optional(),valueBoolean:booleanType().optional(),valueMap:arrayType(DataValueMapItemSchema).optional()}).strict().superRefine((Au,lo)=>{let $u=0;Au.valueString!==void 0&&$u++,Au.valueNumber!==void 0&&$u++,Au.valueBoolean!==void 0&&$u++,Au.valueMap!==void 0&&$u++,$u!==1&&lo.addIssue({code:ZodIssueCode.custom,message:`Value map item must have exactly one value property (valueString, valueNumber, valueBoolean, valueMap), found ${$u}.`})}));function createDataValueSchema(Au={}){const lo=Au.maxDepth??5;return DataValueMapItemSchema.superRefine(($u,Ru)=>{const Iu=(Pu,Ou)=>{if(Ou>lo){Ru.addIssue({code:ZodIssueCode.custom,message:`valueMap recursion exceeded maximum depth of ${lo}.`});return}if(Pu.valueMap&&Array.isArray(Pu.valueMap))for(const Du of Pu.valueMap)Iu(Du,Ou+1)};Iu($u,1)})}const DataValueSchema=createDataValueSchema();objectType({path:stringType().optional(),literalNumber:numberType().optional(),literal:numberType().optional()}).strict().superRefine(exactlyOneKey);objectType({path:stringType().optional(),literalBoolean:booleanType().optional(),literal:booleanType().optional()}).strict().superRefine(exactlyOneKey);const ActionSchema$1=objectType({name:stringType().describe("A unique name identifying the action (e.g., 'submitForm')."),context:arrayType(objectType({key:stringType(),value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional(),literalNumber:numberType().optional(),literalBoolean:booleanType().optional()}).describe("The dynamic value. Define EXACTLY ONE of the nested properties.").strict().superRefine(exactlyOneKey)})).describe("A key-value map of data bindings to be resolved when the action is triggered.").optional()});objectType({text:StringValueSchema,usageHint:enumType(["h1","h2","h3","h4","h5","caption","body"]).optional()});objectType({url:StringValueSchema,usageHint:enumType(["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]).optional(),fit:enumType(["contain","cover","fill","none","scale-down"]).optional(),altText:StringValueSchema.optional()});objectType({name:StringValueSchema});objectType({url:StringValueSchema});objectType({url:StringValueSchema,description:StringValueSchema.optional().describe("A label, title, or placeholder text.")});objectType({tabItems:arrayType(objectType({title:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional()}),child:stringType().describe("A reference to a component instance by its unique ID.")}).strict().superRefine((Au,lo)=>{Au.title||lo.addIssue({code:ZodIssueCode.custom,message:"Tab item is missing 'title'."}),Au.child||lo.addIssue({code:ZodIssueCode.custom,message:"Tab item is missing 'child'."}),Au.title&&exactlyOneKey(Au.title,lo)})).describe("A list of tabs, each with a title and a child component ID.")});objectType({axis:enumType(["horizontal","vertical"]).optional().describe("The orientation."),color:stringType().optional().describe("The color of the divider (e.g., hex code or semantic name)."),thickness:numberType().optional().describe("The thickness of the divider.")});objectType({entryPointChild:stringType().describe("The ID of the component (e.g., a button) that triggers the modal."),contentChild:stringType().describe("The ID of the component to display as the modal's content.")});objectType({child:stringType().describe("The ID of the component to display as the button's content."),action:ActionSchema$1.describe("Represents a user-initiated action."),primary:booleanType().optional().describe("Indicates if this button should be styled as the primary action.")});objectType({label:StringValueSchema,value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalBoolean:booleanType().optional()}).strict().superRefine(exactlyOneKey)});objectType({text:StringValueSchema.optional(),label:StringValueSchema.describe("A label, title, or placeholder text."),textFieldType:enumType(["shortText","number","date","longText","obscured"]).optional(),validationRegexp:stringType().optional().describe("A regex string to validate the input.")});objectType({value:StringValueSchema,enableDate:booleanType().optional(),enableTime:booleanType().optional(),outputFormat:stringType().optional().describe("The string format for the output (e.g., 'YYYY-MM-DD').")});objectType({selections:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalArray:arrayType(stringType()).optional()}).strict().superRefine(exactlyOneKey),options:arrayType(objectType({label:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalString:stringType().describe("A fixed, hardcoded string value.").optional()}).strict().superRefine(exactlyOneKey),value:stringType()})).optional(),maxAllowedSelections:numberType().optional(),type:enumType(["checkbox","chips"]).optional(),filterable:booleanType().optional()});objectType({value:objectType({path:stringType().describe("A data binding reference to a location in the data model (e.g., '/user/name').").optional(),literalNumber:numberType().optional()}).strict().superRefine(exactlyOneKey),minValue:numberType().optional(),maxValue:numberType().optional(),label:StringValueSchema.optional()});const ComponentArrayTemplateSchema=objectType({componentId:stringType(),dataBinding:stringType()}),ComponentArrayReferenceSchema=objectType({explicitList:arrayType(stringType()).optional(),template:ComponentArrayTemplateSchema.describe("A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.").optional()}).strict().superRefine(exactlyOneKey);objectType({children:ComponentArrayReferenceSchema,distribution:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({children:ComponentArrayReferenceSchema,distribution:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({children:ComponentArrayReferenceSchema,direction:enumType(["vertical","horizontal"]).optional(),alignment:enumType(["start","center","end","stretch"]).optional()});objectType({child:stringType().describe("The ID of the component to be rendered inside the card.")});const ValueMapSchema=DataValueSchema.describe("A single data entry. Exactly one 'value*' property should be provided alongside the key."),ComponentPropertiesSchema=recordType(anyType()).refine(Au=>Object.keys(Au).length===1,"A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading')."),ComponentInstanceSchema=objectType({id:stringType().describe("The unique identifier for this component."),weight:numberType().optional().describe("The relative weight of this component within a Row or Column. This corresponds to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column."),component:ComponentPropertiesSchema.describe("A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading'). The value is an object containing the properties for that specific component.")}).strict().describe("Represents a *single* component in a UI widget tree. This component could be one of many supported types."),BeginRenderingMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered."),catalogId:stringType().optional().describe("The identifier of the component catalog to use for this surface. If omitted, the client MUST default to the standard catalog for this A2UI version (https://a2ui.org/specification/v0_8/standard_catalog_definition.json)."),root:stringType().describe("The ID of the root component to render."),styles:objectType({font:stringType().optional().describe("The primary font for the UI."),primaryColor:stringType().regex(/^#[0-9a-fA-F]{6}$/).optional().describe("The primary UI color as a hexadecimal code (e.g., '#00BFFF').")}).strict().optional().describe("Styling information for the UI.")}).strict().describe("Signals the client to begin rendering a surface with a root component and specific styles."),SurfaceUpdateMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated. If you are adding a new surface this *must* be a new, unique identified that has never been used for any existing surfaces shown."),components:arrayType(ComponentInstanceSchema).min(1).describe("A list containing all UI components for the surface.")}).strict().superRefine((Au,lo)=>{const $u=new Set;for(const Iu of Au.components)Iu.id&&($u.has(Iu.id)&&lo.addIssue({code:ZodIssueCode.custom,message:`Duplicate component ID found: ${Iu.id}`,path:["components"]}),$u.add(Iu.id));const Ru=(Iu,Pu)=>{for(const Ou of Iu)Ou&&!$u.has(Ou)&&lo.addIssue({code:ZodIssueCode.custom,message:`Component '${Pu}' references non-existent component ID '${Ou}'.`,path:["components"]})};for(const Iu of Au.components){if(!Iu.id||!Iu.component)continue;const Pu=Object.keys(Iu.component);if(Pu.length!==1)continue;const Ou=Pu[0],Du=Iu.component[Ou];switch(Ou){case"Row":case"Column":case"List":if(Du.children&&!Array.isArray(Du.children)){const Mu=!!Du.children.explicitList,Lu=!!Du.children.template;(Mu&&Lu||!Mu&&!Lu)&&lo.addIssue({code:ZodIssueCode.custom,message:`Component '${Iu.id}' must have either 'explicitList' or 'template' in children, but not both or neither.`}),Mu&&Ru(Du.children.explicitList,Iu.id),Lu&&Ru([Du.children.template?.componentId],Iu.id)}break;case"Card":Du.child&&Ru([Du.child],Iu.id);break;case"Tabs":Du.tabItems&&Array.isArray(Du.tabItems)&&Du.tabItems.forEach(Mu=>{Mu.child&&Ru([Mu.child],Iu.id)});break;case"Modal":Ru([Du.entryPointChild,Du.contentChild],Iu.id);break;case"Button":Du.child&&Ru([Du.child],Iu.id);break}}}).describe("Updates a surface with a new set of components."),DataModelUpdateMessageSchema=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to."),path:stringType().optional().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', the entire data model will be replaced."),contents:arrayType(ValueMapSchema).describe("An array of data entries. Each entry must contain a 'key' and exactly one corresponding typed 'value*' property.")}).strict().describe("Updates the data model for a surface."),DeleteSurfaceMessageSchema$2=objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted.")}).strict().describe("Signals the client to delete the surface identified by 'surfaceId'."),A2uiMessageSchema$1=objectType({beginRendering:BeginRenderingMessageSchema.optional(),surfaceUpdate:SurfaceUpdateMessageSchema.optional(),dataModelUpdate:DataModelUpdateMessageSchema.optional(),deleteSurface:DeleteSurfaceMessageSchema$2.optional()}).strict().superRefine((Au,lo)=>{Object.keys(Au).filter(Ru=>["beginRendering","surfaceUpdate","dataModelUpdate","deleteSurface"].includes(Ru)).length!==1&&lo.addIssue({code:ZodIssueCode.custom,message:"A2UI Protocol message must have exactly one of: surfaceUpdate, dataModelUpdate, beginRendering, deleteSurface."})}).describe("Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.");function normalizeV08Component(Au){if(!Au||typeof Au!="object")return{id:"",component:""};const lo=Au;let $u=typeof lo.component=="string"?lo.component:"";const Ru={};for(const[Iu,Pu]of Object.entries(lo))Iu!=="component"&&Iu!=="id"&&(Ru[Iu]=Pu);if(lo.component&&typeof lo.component=="object"){const Iu=lo.component,Pu=Object.keys(Iu);if(Pu.length>0){$u=Pu[0];const Ou=Iu[Pu[0]];Ou&&typeof Ou=="object"&&Ou!==null&&!Array.isArray(Ou)&&Object.assign(Ru,Ou)}}return{...Ru,id:String(lo.id??""),component:$u}}class V0Point8Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v0.8",this.schema=A2uiMessageSchema$1}getNativeActionKeys(){return["beginRendering","surfaceUpdate","dataModelUpdate","deleteSurface"]}preparePayloadForValidation(lo){const $u={...lo};return delete $u.version,$u}extractOperationsFromObject(lo){const $u=[];if("beginRendering"in lo){const Ru=lo.beginRendering;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId??""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,theme:Ru?.theme??Ru?.styles,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components.map(normalizeV08Component):void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version,rootId:typeof Ru?.root=="string"&&Ru.root?Ru.root:void 0})}if("surfaceUpdate"in lo){const Ru=lo.surfaceUpdate;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId??""),components:Array.isArray(Ru?.components)?Ru.components.map(normalizeV08Component):[]})}if("dataModelUpdate"in lo){const Ru=lo.dataModelUpdate,Iu=String(Ru?.surfaceId??"");if(Array.isArray(Ru?.contents)){for(const Pu of Ru.contents)if(Pu&&typeof Pu=="object"&&typeof Pu.key=="string"){const Ou="valueNumber"in Pu?Pu.valueNumber:"valueString"in Pu?Pu.valueString:"valueBoolean"in Pu?Pu.valueBoolean:"valueObject"in Pu?Pu.valueObject:"valueArray"in Pu?Pu.valueArray:Pu.value;$u.push({type:"updateDataModel",surfaceId:Iu,path:Pu.key,value:Ou})}}else $u.push({type:"updateDataModel",surfaceId:Iu,path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId??"")})}return $u}}const CreateSurfaceMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),createSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered."),catalogId:stringType().describe("A string that uniquely identifies this catalog. It is recommended to prefix this with an internet domain that you own, to avoid conflicts e.g. mycompany.com:somecatalog'."),theme:anyType().optional(),sendDataModel:booleanType().describe("If true, the client will send the full data model of this surface in the metadata of every A2A message sent to the server that created the surface. Defaults to false.").optional()}).strict().describe("Signals the client to create a new surface and begin rendering it. It is an error to send 'createSurface' for a surfaceId that already exists without first deleting it. When this message is sent, the client will expect 'updateComponents' and/or 'updateDataModel' messages for the same surfaceId that define the component tree.")}).strict(),UpdateComponentsMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),updateComponents:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated."),components:arrayType(recordType(stringType(),anyType())).min(1).describe("A list containing all UI components for the surface.")}).strict().describe("Updates a surface with a new set of components. This message can be sent multiple times to update the component tree of an existing surface. One of the components in one of the components lists MUST have an 'id' of 'root' to serve as the root of the component tree. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),UpdateDataModelMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),updateDataModel:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to."),path:stringType().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', refers to the entire data model.").optional(),value:anyType().describe("The data to be updated in the data model. If present, the value at 'path' is replaced (or created). If omitted, the key at 'path' is removed.").optional()}).strict().describe("Updates the data model for an existing surface. This message can be sent multiple times to update the data model. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),DeleteSurfaceMessageSchema$1=objectType({version:enumType(["v0.9","v0.9.1"]),deleteSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted.")}).strict().describe("Signals the client to delete the surface identified by 'surfaceId'. A createSurface message MUST have been previously sent for the 'surfaceId' in this message; the surface's catalog is the one specified by that createSurface.")}).strict(),A2uiMessageSchema=unionType([CreateSurfaceMessageSchema$1,UpdateComponentsMessageSchema$1,UpdateDataModelMessageSchema$1,DeleteSurfaceMessageSchema$1]),A2uiMessageListSchema=arrayType(A2uiMessageSchema).describe("A list of messages.");objectType({messages:A2uiMessageListSchema}).strict().describe("An object wrapping a list of messages.");class V0Point9Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v0.9",this.schema=A2uiMessageSchema}get compatibleCatalogVersions(){return new Set(["0.9","0.9.1"])}getNativeActionKeys(){return["createSurface","updateComponents","updateDataModel","deleteSurface"]}extractOperationsFromObject(lo){const $u=[];if("createSurface"in lo){const Ru=lo.createSurface;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId||""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,theme:Ru?.theme,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components:void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version})}if("updateComponents"in lo){const Ru=lo.updateComponents;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId||""),components:Array.isArray(Ru?.components)?Ru.components:[]})}if("updateDataModel"in lo){const Ru=lo.updateDataModel;$u.push({type:"updateDataModel",surfaceId:String(Ru?.surfaceId||""),path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId||"")})}return $u}}const INTERNAL_OPERATION_TYPES=["createSurface","updateComponents","updateDataModel","deleteSurface","callRendererFunction","agentFunctionResponse"];function isInternalOperation(Au){return typeof Au=="object"&&Au!==null&&"type"in Au&&typeof Au.type=="string"&&INTERNAL_OPERATION_TYPES.includes(Au.type)}objectType({componentId:lazyType(()=>ComponentIdSchema$1),path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("REF:#/$defs/TemplateChildList|A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.");const AnyComponentSchema=lazyType(()=>ComponentCommonSchema.extend({component:stringType()}).passthrough().refine(Au=>Au.component!=="Surface",{message:'Component type cannot be "Surface". "Surface" is a top-level protocol container defined in createSurface, not a child component.'})),ComponentsListSchema=arrayType(AnyComponentSchema).min(1);recordType(stringType(),anyType());const ComponentIdSchema$1=markChildRef(stringType().describe("REF:#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),CallIdSchema=stringType().describe("REF:#/$defs/CallId|The unique identifier for a function call."),DataBindingSchema$1=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).strict().describe("REF:#/$defs/DataBinding"),FunctionCommonSchema=objectType({call:stringType().describe("The name of the function to call."),catalogId:stringType().describe("The catalog ID for this function, overriding any surface-level default catalogId.").optional()}).describe("REF:#/$defs/FunctionCommon|Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog."),FunctionCallSchema$1=recordType(stringType(),anyType()).and(intersectionType(FunctionCommonSchema,anyType())).describe("REF:#/$defs/FunctionCall|Invokes a named function, combining common function properties with the catalog function definition."),DynamicStringSchema$1=unionType([stringType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicString|Represents a string"),DynamicBooleanSchema$1=unionType([booleanType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),AccessibilityAttributesSchema$1=objectType({label:DynamicStringSchema$1.optional(),description:DynamicStringSchema$1.optional(),live:enumType(["off","polite","assertive"]).describe("Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts.").default("off"),hidden:DynamicBooleanSchema$1.optional()}).strict().describe("REF:#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding."),ExtensionsSchema=recordType(stringType(),unknownType()).superRefine((Au,lo)=>{for(const $u in Au)$u.match(/^[\p{XID_Start}_][\p{XID_Continue}:-]*$/u)||lo.addIssue({path:[$u],code:ZodIssueCode.custom,message:`Invalid extension key "${$u}": Keys MUST be Unicode identifiers (UAX #31).`})}).describe("REF:#/$defs/Extensions|Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions."),ComponentCommonSchema=objectType({id:ComponentIdSchema$1,catalogId:stringType().describe("The catalog ID for this component, overriding any surface-level default catalogId.").optional(),accessibility:AccessibilityAttributesSchema$1.optional(),metadata:objectType({extensions:ExtensionsSchema.optional()}).strict().describe("Optional component-level metadata for vendor extensions.").optional()}).describe("REF:#/$defs/ComponentCommon");markChildRef(unionType([arrayType(ComponentIdSchema$1).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema$1,path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.")]).describe("REF:#/$defs/ChildList"),"child-list");const DynamicValueSchema$1=unionType([stringType(),numberType(),booleanType(),arrayType(anyType()),recordType(stringType(),unknownType()).refine(Au=>!Au||!("path"in Au)&&!("call"in Au)),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),DynamicNumberSchema$1=unionType([numberType(),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.");unionType([arrayType(stringType()),DataBindingSchema$1,FunctionCallSchema$1]).describe("REF:#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.");objectType({call:literalType("@index"),args:objectType({offset:DynamicNumberSchema$1.optional()}).optional()}).describe("REF:#/$defs/IndexSystemFunction|Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.");const CheckRuleSchema$1=objectType({condition:unionType([DataBindingSchema$1,FunctionCallSchema$1]).describe("Path or function call evaluating to a structured validation result object."),message:stringType().describe("Optional fallback error message.").optional()}).strict().describe("REF:#/$defs/CheckRule|A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object.");objectType({checks:arrayType(CheckRuleSchema$1).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:#/$defs/Checkable|Properties for components that support renderer-side checks.");unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the agent."),userMessage:DynamicStringSchema$1.optional(),context:recordType(stringType(),DynamicValueSchema$1).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the agent.")}).strict().describe("Triggers an agent-side event."),objectType({functionCall:FunctionCallSchema$1}).strict().describe("Executes a renderer or agent-side function.")]).describe("REF:#/$defs/Action|Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.");objectType({component:literalType("Surface").optional(),child:literalType("root").optional()}).strict().describe("REF:#/$defs/Surface|The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.");const FunctionResponseSchema=objectType({functionCallId:CallIdSchema,value:anyType().describe("The return value of the function.").optional(),error:objectType({code:stringType(),message:stringType()}).strict().describe("An error object indicating failure of the function execution.").optional()}).strict().superRefine((Au,lo)=>{const $u="value"in Au,Ru="error"in Au;($u&&Ru||!$u&&!Ru)&&lo.addIssue({code:ZodIssueCode.custom,message:'FunctionResponse must have either "value" or "error", but not both or neither.'})}).describe("REF:#/$defs/FunctionResponse|The return response matching a callAgentFunction or callRendererFunction invocation."),CreateSurfaceMessageSchema=objectType({version:literalType("v1.0"),createSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be rendered. It must be globally unique for the renderer's lifetime."),catalogId:stringType().describe("A string that uniquely identifies the default catalog for this surface. It is recommended to prefix this with an internet domain that you own, to avoid conflicts e.g. 'mycompany.com:somecatalog'. Components and function calls that do not explicitly specify a catalogId will use this surface-level default catalogId.").optional(),sendDataModel:booleanType().describe("If true, the renderer will send the full data model of this surface in the metadata of every A2A message sent to the agent that created the surface. Defaults to false.").optional(),components:ComponentsListSchema.optional(),dataModel:recordType(stringType(),anyType()).describe("The initial root data model object for the surface.").optional(),metadata:objectType({extensions:ExtensionsSchema.optional()}).strict().describe("Optional surface-level metadata.").optional()}).strict().describe("Signals the renderer to create a new surface and begin rendering it. Creating a surface implicitly instantiates the canonical 'Surface' container component ('common_types.json#/$defs/Surface') with 'child': 'root'. It is an error to try to create a surface with an existing ID without first deleting it; surfaceId MUST be globally unique for the renderer's lifetime. When this message is sent, the renderer expects 'updateComponents' and/or 'updateDataModel' messages for the same surfaceId to define the component tree.")}).strict(),UpdateComponentsMessageSchema=objectType({version:literalType("v1.0"),updateComponents:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be updated. It must be globally unique for the renderer's lifetime."),components:ComponentsListSchema}).strict().describe("Updates a surface with a new set of components. This message can be sent multiple times to update the component tree of an existing surface. One of the components in one of the components lists MUST have an 'id' of 'root' to serve as the root of the component tree. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),UpdateDataModelMessageSchema=objectType({version:literalType("v1.0"),updateDataModel:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface this data model update applies to. It must be globally unique for the renderer's lifetime."),path:stringType().describe("An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', refers to the entire data model.").optional(),value:anyType().describe("The data to be updated in the data model. To delete the key/value at 'path', set 'value' explicitly to null.")}).strict().describe("Updates the data model for an existing surface. This message can be sent multiple times to update the data model. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),DeleteSurfaceMessageSchema=objectType({version:literalType("v1.0"),deleteSurface:objectType({surfaceId:stringType().describe("The unique identifier for the UI surface to be deleted. It must be globally unique for the renderer's lifetime.")}).strict().describe("Signals the renderer to delete the surface identified by 'surfaceId'. The createSurface message MUST have been previously sent for this surfaceId.")}).strict(),CallRendererFunctionMessageSchema=objectType({version:literalType("v1.0"),callRendererFunction:objectType({functionCallId:CallIdSchema,callFunction:intersectionType(FunctionCallSchema$1,anyType())}).strict().describe("Signals the renderer to execute a function locally on behalf of the agent.")}).strict(),AgentFunctionResponseMessageSchema=objectType({version:literalType("v1.0"),agentFunctionResponse:FunctionResponseSchema}).strict(),AgentToRendererMessageSchema=unionType([CreateSurfaceMessageSchema,UpdateComponentsMessageSchema,UpdateDataModelMessageSchema,DeleteSurfaceMessageSchema,CallRendererFunctionMessageSchema,AgentFunctionResponseMessageSchema]);class V1Point0Adapter extends BaseVersionAdapter{constructor(){super(...arguments),this.version="v1.0",this.schema=AgentToRendererMessageSchema}getNativeActionKeys(){return[...INTERNAL_OPERATION_TYPES]}extractOperationsFromObject(lo){const $u=[];if("createSurface"in lo){const Ru=lo.createSurface;$u.push({type:"createSurface",surfaceId:String(Ru?.surfaceId||""),catalogId:typeof Ru?.catalogId=="string"?Ru.catalogId:void 0,sendDataModel:!!Ru?.sendDataModel,components:Array.isArray(Ru?.components)?Ru.components:void 0,dataModel:Ru?.dataModel&&typeof Ru.dataModel=="object"&&!Array.isArray(Ru.dataModel)?Ru.dataModel:void 0,version:typeof lo.version=="string"?lo.version:this.version})}if("updateComponents"in lo){const Ru=lo.updateComponents;$u.push({type:"updateComponents",surfaceId:String(Ru?.surfaceId||""),components:Array.isArray(Ru?.components)?Ru.components:[]})}if("updateDataModel"in lo){const Ru=lo.updateDataModel;$u.push({type:"updateDataModel",surfaceId:String(Ru?.surfaceId||""),path:typeof Ru?.path=="string"?Ru.path:void 0,value:Ru?.value})}if("deleteSurface"in lo){const Ru=lo.deleteSurface;$u.push({type:"deleteSurface",surfaceId:String(Ru?.surfaceId||"")})}if("callRendererFunction"in lo){const Ru=lo.callRendererFunction,Iu=Ru?.callFunction||{};$u.push({type:"callRendererFunction",functionCallId:String(Ru?.functionCallId||""),call:String(Iu?.call||""),version:this.version,catalogId:typeof Iu?.catalogId=="string"?Iu.catalogId:void 0,args:Iu?.args&&typeof Iu.args=="object"&&!Array.isArray(Iu.args)?Iu.args:{}})}if("agentFunctionResponse"in lo){const Ru=lo.agentFunctionResponse;$u.push({type:"agentFunctionResponse",functionCallId:String(Ru?.functionCallId||""),version:this.version,value:Ru?.value,error:Ru?.error&&typeof Ru.error=="object"?Ru.error:void 0})}return $u}}class VersionAdapterFactory{constructor(){this.adapters=new Map([["0.8",new V0Point8Adapter],["0.9",new V0Point9Adapter],["0.9.1",new V0Point9Adapter],["1.0",new V1Point0Adapter]])}getAllKnownActions(){const lo=new Set;for(const $u of this.adapters.values())if($u.validActions)for(const Ru of $u.validActions)lo.add(Ru);return lo}registerAdapter(lo){const $u=toCanonicalVersion(lo.version)??normalizeVersionString(lo.version);this.adapters.set($u,lo)}getAdapter(lo){const $u=toCanonicalVersion(lo)??normalizeVersionString(lo),Ru=this.adapters.get($u);if(!Ru){const Iu=Array.from(new Set(Array.from(this.adapters.keys()).map(Pu=>Pu.startsWith("v")?Pu:`v${Pu}`))).sort().join(", ");throw new A2uiValidationError(`[VersionAdapterFactory] Unsupported protocol version '${lo}'. Supported versions: ${Iu}.`)}return Ru}resolveFromPayload(lo){const $u=Array.isArray(lo)?lo[0]:lo;if(typeof $u=="object"&&$u!==null){if("messages"in $u&&Array.isArray($u.messages))return this.resolveFromPayload($u.messages);if("version"in $u){const Ru=$u.version;if(typeof Ru!="string")throw new A2uiValidationError(`[VersionAdapterFactory] Message payload is missing a valid 'version' string: 'version' property must be a string, got ${typeof Ru}.`);return this.getAdapter(Ru)}if("beginRendering"in $u||"surfaceUpdate"in $u||"dataModelUpdate"in $u||"deleteSurface"in $u)return this.getAdapter("v0.8")}throw new A2uiValidationError("[VersionAdapterFactory] Message payload is missing a valid 'version' string.")}static registerAdapter(lo){defaultVersionAdapterFactory.registerAdapter(lo)}static getAdapter(lo){return defaultVersionAdapterFactory.getAdapter(lo)}static resolveFromPayload(lo){return defaultVersionAdapterFactory.resolveFromPayload(lo)}static getAllKnownActions(){return defaultVersionAdapterFactory.getAllKnownActions()}}const defaultVersionAdapterFactory=new VersionAdapterFactory;registerKnownActionsProvider(()=>defaultVersionAdapterFactory.getAllKnownActions());const schemaKeysCache=new WeakMap;function getKnownSchemaKeys(Au){if(schemaKeysCache.has(Au))return schemaKeysCache.get(Au);const lo=(()=>{let $u=Au;for(;$u;){if($u instanceof ZodObject||$u._def?.typeName==="ZodObject"){if($u._def?.unknownKeys==="passthrough")return null;const Ru=typeof $u.shape=="function"?$u.shape():$u.shape;return Ru&&typeof Ru=="object"?new Set(Object.keys(Ru)):null}if($u instanceof ZodEffects||$u._def?.typeName==="ZodEffects"){$u=$u._def.schema;continue}if($u instanceof ZodOptional||$u instanceof ZodNullable||$u._def?.typeName==="ZodOptional"||$u._def?.typeName==="ZodNullable"){$u=$u._def.innerType;continue}if($u instanceof ZodDefault||$u._def?.typeName==="ZodDefault"){$u=$u._def.innerType;continue}if($u instanceof ZodCatch||$u._def?.typeName==="ZodCatch"){$u=$u._def.innerType;continue}if($u instanceof ZodIntersection||$u._def?.typeName==="ZodIntersection"){const Ru=getKnownSchemaKeys($u._def.left),Iu=getKnownSchemaKeys($u._def.right);return!Ru||!Iu?null:new Set([...Ru,...Iu])}if($u instanceof ZodUnion||$u._def?.typeName==="ZodUnion"){const Ru=$u._def.options,Iu=new Set;for(const Pu of Ru){const Ou=getKnownSchemaKeys(Pu);if(!Ou)return null;for(const Du of Ou)Iu.add(Du)}return Iu}return null}return null})();return schemaKeysCache.set(Au,lo),lo}function validateFunctionArgs(Au,lo,$u){if(!lo||typeof lo!="object"||Array.isArray(lo))return;const Ru=Object.keys(lo);if(Ru.length>MAX_FUNCTION_CALL_ARGS)throw new A2uiExpressionError(`Function call '${Au}' exceeds maximum allowed arguments count (${MAX_FUNCTION_CALL_ARGS})`,Au);const Iu=$u?.functions?.get?.(Au);if(!Iu?.schema)return;const Pu=getKnownSchemaKeys(Iu.schema);if(Pu){for(const Ou of Ru)if(!Pu.has(Ou))throw new A2uiExpressionError(`Unknown argument '${Ou}' passed to function '${Au}'`,Au);if(Ru.length>Pu.size)throw new A2uiExpressionError(`Too many arguments for function '${Au}': expected at most ${Pu.size}, received ${Ru.length}`,Au)}}function resolveContextIndex(Au){let lo=Au;for(;lo;){if(lo.explicitIndex!==void 0&&Number.isFinite(lo.explicitIndex))return lo.explicitIndex;if(!(lo instanceof DataContext)&&typeof lo.getIndex=="function"){const $u=lo.getIndex();if($u!==void 0&&Number.isFinite($u))return $u}if(!(lo instanceof DataContext)&&typeof lo.index=="number"&&Number.isFinite(lo.index))return lo.index;if(typeof lo.path=="string"){const $u=lo.path.split("/").filter(Boolean);if($u.length>0&&/^\d+$/.test($u[$u.length-1]))return parseInt($u[$u.length-1],10)}lo=lo.parent}}const MAX_DYNAMIC_VALUE_DEPTH=1e3;class DataContext{constructor(lo,$u,Ru,Iu){this.surface=lo,this.path=$u,this.dataModel=lo.dataModel,this.functionInvoker=lo.defaultCatalog.invoker,this.explicitIndex=Ru,this.parent=Iu,this.warnedPaths=Iu?Iu.warnedPaths:new Set}getIndex(){return resolveContextIndex(this)}get index(){return this.getIndex()}set(lo,$u){const Ru=this.resolvePath(lo);this.dataModel.set(Ru,$u)}static isDataBindingObject(lo){return"path"in lo&&typeof lo.path=="string"&&!("componentId"in lo)}static isFunctionCallObject(lo){return"call"in lo&&typeof lo.call=="string"}static containsDynamicValue(lo){if(lo===null||typeof lo!="object")return!1;if(Array.isArray(lo))return lo.some(Ru=>DataContext.containsDynamicValue(Ru));const $u=lo;return DataContext.isDataBindingObject($u)||DataContext.isFunctionCallObject($u)?!0:Object.values($u).some(Ru=>DataContext.containsDynamicValue(Ru))}emitMissingDataBindingWarning(lo){typeof this.dataModel?.hasPath=="function"&&!this.dataModel.hasPath(lo)&&!this.warnedPaths.has(lo)&&(this.warnedPaths.add(lo),this.surface?.dispatchWarning?.({code:"MISSING_DATA_BINDING",path:lo,message:`Preflight DataBinding Warning: The bound JSON Pointer '${lo}' does not physically exist in the active DataModel. Evaluating to None.`}))}resolveDynamicValue(lo,$u=0){if($u>MAX_DYNAMIC_VALUE_DEPTH){const Iu=new A2uiExpressionError(`Maximum dynamic value nesting depth exceeded (${MAX_DYNAMIC_VALUE_DEPTH})`);this.dispatchExpressionError(Iu,"DynamicValue");return}if(lo===null||typeof lo!="object")return lo;if(Array.isArray(lo))return DataContext.containsDynamicValue(lo)?lo.map(Iu=>this.resolveDynamicValue(Iu,$u+1)):lo;const Ru=lo;if(DataContext.isDataBindingObject(Ru)){const Iu=this.resolvePath(lo.path),Pu=this.dataModel.get(Iu);return Pu===void 0&&this.emitMissingDataBindingWarning(Iu),Pu}return DataContext.isFunctionCallObject(Ru)?this.resolveFunctionCallValue(lo,$u):this.resolvePlainObjectValue(Ru,$u)}resolveFunctionCallValue(lo,$u=0){let Ru;try{Ru=this.resolveFunctionCatalog(lo.catalogId),validateFunctionArgs(lo.call,lo.args,Ru)}catch(Du){this.dispatchExpressionError(Du,lo.call);return}const Iu={};for(const[Du,Mu]of Object.entries(lo.args??{}))Iu[Du]=this.resolveDynamicValue(Mu,$u+1);const Pu=new AbortController,Ou=this.evaluateFunctionReactive(lo.call,Iu,Pu.signal,lo.catalogId,Ru.invoker);if(Ou!==void 0)return isSignal(Ou)?peekValue(Ou):Ou}resolvePlainObjectValue(lo,$u=0){if(!DataContext.containsDynamicValue(lo))return lo;const Ru={};for(const[Iu,Pu]of Object.entries(lo))Ru[Iu]=this.resolveDynamicValue(Pu,$u+1);return Ru}subscribeDynamicValue(lo,$u){const Ru=this.resolveSignal(lo);let Iu=!0,Pu=peekValue(Ru);const Ou=effect(()=>{const Du=getValue(Ru);Pu=Du,Iu||$u(Du)});return Iu=!1,{get value(){return Pu},unsubscribe:()=>{Ou(),Ru.unsubscribe?.()}}}resolveSignal(lo,$u=0){if($u>MAX_DYNAMIC_VALUE_DEPTH){const Du=new A2uiExpressionError(`Maximum dynamic value nesting depth exceeded (${MAX_DYNAMIC_VALUE_DEPTH})`);return this.dispatchExpressionError(Du,typeof lo=="object"&&lo&&"call"in lo?lo.call:"DynamicValue"),signal(void 0)}if(typeof lo!="object"||lo===null)return signal(lo);if(Array.isArray(lo)){if(!DataContext.containsDynamicValue(lo))return signal(lo);const Du=lo.map(Lu=>this.resolveSignal(Lu,$u+1)),Mu=computed(()=>Du.map(Lu=>getValue(Lu)));return Mu.unsubscribe=()=>{for(const Lu of Du)Lu.unsubscribe?.()},Mu}const Ru=lo;if(DataContext.isDataBindingObject(Ru)){const Du=this.resolvePath(lo.path);return this.emitMissingDataBindingWarning(Du),this.dataModel.getSignal(Du)}if(DataContext.isFunctionCallObject(Ru)){const Du=lo;let Mu;try{Mu=this.resolveFunctionCatalog(Du.catalogId),validateFunctionArgs(Du.call,Du.args,Mu)}catch(Vu){return this.dispatchExpressionError(Vu,Du.call),signal(void 0)}const Lu={};for(const[Vu,Gu]of Object.entries(Du.args??{}))Lu[Vu]=this.resolveSignal(Gu,$u+1);if(Object.keys(Lu).length===0){const Vu=new AbortController,Gu=this.evaluateFunctionReactive(Du.call,{},Vu.signal,Du.catalogId,Mu.invoker),Wu=isSignal(Gu)?Gu:signal(Gu);return Wu.unsubscribe=()=>Vu.abort(),Wu}const Bu=Object.keys(Lu),ju=signal(void 0);let Fu,zu;const Uu=computed(()=>{const Vu={};for(let Gu=0;Gu<Bu.length;Gu++)Vu[Bu[Gu]]=getValue(Lu[Bu[Gu]]);return Vu}),Hu=effect(()=>{try{const Vu=getValue(Uu);Fu&&Fu.abort(),zu&&(zu(),zu=void 0),Fu=new AbortController;const Gu=this.evaluateFunctionReactive(Du.call,Vu,Fu.signal,Du.catalogId,Mu.invoker);isSignal(Gu)?zu=effect(()=>{setValue(ju,getValue(Gu))}):setValue(ju,Gu)}catch(Vu){this.dispatchExpressionError(Vu,Du.call),setValue(ju,void 0)}});return ju.unsubscribe=()=>{Hu(),zu&&zu(),Fu&&Fu.abort();for(let Vu=0;Vu<Bu.length;Vu++)Lu[Bu[Vu]].unsubscribe?.()},ju}if(!DataContext.containsDynamicValue(Ru))return signal(lo);const Iu=Object.entries(Ru).map(([Du,Mu])=>[Du,this.resolveSignal(Mu)]),Pu=computed(()=>{const Du={};for(const[Mu,Lu]of Iu)Du[Mu]=getValue(Lu);return Du}),Ou=Pu.unsubscribe?.bind(Pu);return Pu.unsubscribe=()=>{Ou?.();for(const[,Du]of Iu)Du.unsubscribe?.()},Pu}resolveAction(lo){if("event"in lo){const $u={};if(lo.event.context)for(const[Ru,Iu]of Object.entries(lo.event.context))$u[Ru]=this.resolveDynamicValue(Iu);return{event:{...lo.event,context:$u}}}return"functionCall"in lo?this.resolveDynamicValue(lo.functionCall):lo}resolveFunctionCatalog(lo){if(lo===void 0)return this.surface.defaultCatalog;const $u=this.surface.availableCatalogs?.get(lo);if(!$u)throw new A2uiCatalogError(`Catalog not found: ${lo}`);return $u}evaluateFunctionReactive(lo,$u,Ru,Iu,Pu){const Ou=Pu??(Iu===void 0?this.functionInvoker:this.resolveFunctionCatalog(Iu).invoker);try{return Ou(lo,$u,this,Ru)}catch(Du){this.dispatchExpressionError(Du,lo);return}}dispatchExpressionError(lo,$u){if(lo instanceof ZodError||typeof lo=="object"&&lo!==null&&lo.name==="ZodError"){const Ru=lo,Iu=new A2uiExpressionError(`Validation failed for function '${$u}': ${Ru.message}`,$u,Ru.errors??Ru.issues);this.surface.dispatchError({code:"EXPRESSION_ERROR",message:Iu.message,expression:$u,details:Iu.details})}else if(lo instanceof A2uiExpressionError)this.surface.dispatchError({code:"EXPRESSION_ERROR",message:lo.message,expression:lo.expression,details:lo.details});else{const Ru=typeof lo=="object"&&lo!==null?lo:{};this.surface.dispatchError({code:"EXPRESSION_ERROR",message:Ru.message??`An unexpected error occurred in function ${$u}.`,expression:$u})}}nested(lo,$u){const Ru=this.resolvePath(lo);return new DataContext(this.surface,Ru,$u,this)}resolvePath(lo){if(lo.startsWith("/"))return lo;if(lo===""||lo===".")return this.path;let $u=this.path;return $u.endsWith("/")&&$u.length>1&&($u=$u.slice(0,-1)),$u==="/"&&($u=""),`${$u}/${lo}`}}const IndexApi={name:"@index",returnType:"number",allowedCallers:"rendererOnly",schema:objectType({offset:coerce.number().optional()})};createFunctionImplementation(IndexApi,(Au,lo)=>{const $u=typeof Au.offset=="number"&&Number.isFinite(Au.offset)?Au.offset:0,Ru=resolveContextIndex(lo);if(Ru===void 0||!Number.isFinite(Ru))throw new A2uiValidationError("@index function can only be evaluated inside a collection template iteration scope.");return Ru+$u});const COMPONENT_ENVELOPE_KEYS=["id","component","catalogId","catalogID"];class PayloadValidator{constructor(lo,$u){this.catalog=lo,this.config=$u,this.enforceIdentifiers=isAtLeastVersion(lo.protocolVersion,"1.0")}get allowUnknown(){return this.config?this.config.allowUnknownElements??!1:!0}validateComponent(lo,$u){const Ru=lo.id;if(typeof Ru!="string"||!Ru)throw new A2uiValidationError(`Component '${lo.component}' is missing an 'id'; entries require a valid string 'id'.`);this.assertIdentifier(Ru,`Component id '${Ru}' must be a valid UAX #31 identifier`);const Iu=lo.component,Pu=typeof Iu=="string"?Iu:$u;if(!Pu)throw new A2uiValidationError(`Cannot create component ${Ru} without a type.`);const Ou=this.catalog.components.get(Pu);if(!Ou){if(!this.allowUnknown)throw new A2uiValidationError(`Unknown component type '${Pu}' not found in catalog '${this.catalog.id}'.`);return}const Du=stripEnvelopeKeys(lo),Mu=Ou.schema.safeParse(Du);if(!Mu.success){const Lu=Mu.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for component '${Pu}' (${Ru}): ${Lu}`,Mu.error.issues)}this.validateNestedFunctions(Du)}assertFunctionIdentifiers(lo,$u){if(this.assertIdentifier(lo,`Function name '${lo}' must be a valid UAX #31 identifier`),$u&&typeof $u=="object"&&!Array.isArray($u)){const Ru=Object.keys($u);if(Ru.length>MAX_FUNCTION_CALL_ARGS)throw new A2uiValidationError(`Function call '${lo}' exceeds maximum allowed arguments count (${MAX_FUNCTION_CALL_ARGS})`);for(const Iu of Ru)this.assertIdentifier(Iu,`Function argument '${Iu}' in function '${lo}' must be a valid UAX #31 identifier`)}}validateNestedFunctions(lo){if(Array.isArray(lo)){for(const Iu of lo)this.validateNestedFunctions(Iu);return}if(typeof lo!="object"||lo===null)return;const $u=lo,Ru=$u.call??$u.function;if(typeof Ru=="string"&&Ru.length>0){const Iu=$u.args,Pu=Iu!==void 0?Iu:{},Ou=typeof $u.catalogId=="string"&&$u.catalogId.length>0?$u.catalogId:void 0;Ou&&Ou!==this.catalog.id?this.assertFunctionIdentifiers(Ru,Pu):this.validateFunction(Ru,Pu)}for(const[Iu,Pu]of Object.entries($u))Iu!=="id"&&Iu!=="component"&&this.validateNestedFunctions(Pu)}validateFunction(lo,$u){this.assertFunctionIdentifiers(lo,$u);const Ru=this.catalog.functions.get(lo)??(this.enforceIdentifiers&&lo==="@index"?IndexApi:void 0);if(!Ru){if(!this.allowUnknown)throw new A2uiValidationError(`Unrecognized function '${lo}'`);return $u??{}}if(!Ru.schema){if($u!==void 0&&(typeof $u!="object"||$u===null||Array.isArray($u)))throw new A2uiValidationError(`Validation failed for function '${lo}': Expected object, received ${Array.isArray($u)?"array":typeof $u}`);return $u??{}}const Iu=Ru.schema.safeParse($u??{});if(!Iu.success){const Pu=Iu.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for function '${lo}': ${Pu}`,Iu.error.issues)}return Iu.data}validateTheme(lo){const $u=this.catalog.themeSchema;if(!$u)return lo;const Ru=$u.safeParse(lo);if(!Ru.success){const Iu=Ru.error.errors.map(formatZodIssue).join(", ");throw new A2uiValidationError(`Validation failed for theme: ${Iu}`,Ru.error.issues)}return Ru.data}assertIdentifier(lo,$u){if(this.enforceIdentifiers&&!isValidUax31Identifier(lo))throw new A2uiValidationError($u)}}function stripEnvelopeKeys(Au){const lo={};for(const[$u,Ru]of Object.entries(Au))COMPONENT_ENVELOPE_KEYS.includes($u)||(lo[$u]=Ru);return lo}class RpcHandler{constructor(lo,$u){if(this.pendingAgentCalls=new Map,this.isDisposed=!1,Array.isArray(lo))this.catalogs=lo,this.outboundListener=$u,this.defaultTimeoutMs=3e4;else{const Ru=lo??{};this.catalogs=Ru.catalogs??[],this.outboundListener=Ru.outboundListener,this.defaultTimeoutMs=Ru.defaultTimeoutMs??3e4}}get disposed(){return this.isDisposed}async handleCallRendererFunction(lo,$u,Ru=!1){const Iu=this.validateInboundMessage(lo);if(Iu)return await this.emitOutboundResponse(Iu),Iu;const{version:Pu,callRendererFunction:Ou}=lo,{functionCallId:Du,callFunction:Mu}=Ou,{call:Lu,catalogId:Bu,args:ju}=Mu,Fu=this.resolveFunctionImplementation(Bu,Lu,$u,Pu);if("error"in Fu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,Fu.error,Pu);return await this.emitOutboundResponse(Vu),Vu}const zu=this.checkExecutionPermissions(Fu.funcImpl,Lu,Ru);if(zu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,zu,Pu);return await this.emitOutboundResponse(Vu),Vu}const Uu=this.parseArguments(Fu.catalog,Fu.funcImpl,ju,Lu);if("error"in Uu){const Vu=this.createResponseError(Du,RpcErrorCode.INVALID_FUNCTION_CALL,Uu.error,Pu);return await this.emitOutboundResponse(Vu),Vu}const Hu=await this.executeFunctionSafely(Fu.funcImpl,Uu.args,$u,Du,Pu);return await this.emitOutboundResponse(Hu),Hu}handleAgentFunctionResponse(lo){if(!lo||!lo.agentFunctionResponse)return;const{functionCallId:$u,value:Ru,error:Iu}=lo.agentFunctionResponse,Pu=this.pendingAgentCalls.get($u);if(Pu)if(this.pendingAgentCalls.delete($u),Iu){const Ou=Iu.code??RpcErrorCode.UNKNOWN_ERROR,Du=Iu.message??"Agent function execution failed";Pu.reject(new A2uiRpcError(Du,Ou,$u,Iu))}else Pu.resolve(Ru)}callAgentFunction(lo,$u,Ru){if(this.isDisposed)return Promise.reject(new A2uiRpcError("RpcHandler has been disposed.",RpcErrorCode.DISPOSED));if(!this.outboundListener)return Promise.reject(new A2uiRpcError("Cannot call agent function without outboundListener configured.",RpcErrorCode.NO_LISTENER));if(!$u||!$u.call)return Promise.reject(new A2uiRpcError("Missing or invalid function call name.",RpcErrorCode.INVALID_FUNCTION_CALL));const Iu=Ru??{},Pu=Iu.functionCallId??this.generateFunctionCallId(),Ou=Iu.timeoutMs??this.defaultTimeoutMs;if(this.pendingAgentCalls.has(Pu))return Promise.reject(new A2uiRpcError(`A call with functionCallId '${Pu}' is already pending.`,RpcErrorCode.DUPLICATE,Pu));const Du={functionCallId:Pu,call:$u,effectiveTimeoutMs:Ou,version:Iu.version};return this.dispatchAgentCall(lo,Du)}dispose(){if(!this.isDisposed){this.isDisposed=!0;for(const[lo,$u]of this.pendingAgentCalls.entries())$u.reject(new A2uiRpcError(`RpcHandler disposed while call '${lo}' was pending.`,RpcErrorCode.CANCELLED,lo));this.pendingAgentCalls.clear()}}async emitOutboundResponse(lo){if(this.outboundListener)try{const $u=this.outboundListener(lo);$u&&typeof $u.catch=="function"&&await $u}catch{}}validateInboundMessage(lo){if(!lo)return this.createResponseError("unknown",RpcErrorCode.INVALID_FUNCTION_CALL,"Inbound message is null or undefined.","unknown");const $u=lo.version;return this.isDisposed?this.createResponseError(lo.callRendererFunction?.functionCallId??"unknown",RpcErrorCode.DISPOSED,"RpcHandler has been disposed.",$u):lo.callRendererFunction?.callFunction?null:this.createResponseError(lo.callRendererFunction?.functionCallId??"unknown",RpcErrorCode.INVALID_FUNCTION_CALL,"Malformed message: missing callRendererFunction or callFunction.",$u)}resolveFunctionImplementation(lo,$u,Ru,Iu){let Pu;if(lo){if(Pu=this.catalogs.find(Du=>Du.id===lo),!Pu)return{error:`Catalog not found: ${lo}`}}else Ru?.surface?.defaultCatalog&&(Pu=Ru.surface.defaultCatalog);if(!Pu)return{error:"No catalog available for function resolution."};if(Pu.protocolVersion&&Iu&&!isCatalogVersionCompatible(Pu.protocolVersion,Iu))return{error:`Catalog '${Pu.id}' specification version (${Pu.protocolVersion}) does not match message protocol version (${Iu}).`};const Ou=Pu.functions?.get($u);return Ou?{funcImpl:Ou,catalog:Pu}:{error:`Function not found: ${$u}`}}checkExecutionPermissions(lo,$u,Ru){const Iu=lo.allowedCallers??"rendererOnly";return Iu==="rendererOrAgent"||Iu==="agentOnly"?lo.requiresUserActivation&&!Ru?`Function '${$u}' requires user activation context to execute.`:null:`Function '${$u}' cannot be called by agent (allowedCallers is ${Iu}).`}parseArguments(lo,$u,Ru,Iu){try{return{args:new PayloadValidator(lo,{allowUnknownElements:!1}).validateFunction(Iu,Ru)}}catch(Pu){const Ou=this.extractErrorMessage(Pu);return{error:`Invalid function arguments for '${Iu}': ${Ou}`}}}async executeFunctionSafely(lo,$u,Ru,Iu,Pu){const Ou=Pu||"v1.0";try{const Du=await Promise.resolve(lo.execute($u,Ru)),Mu=isSignal(Du)?getValue(Du):Du;return{version:Ou,rendererFunctionResponse:{functionCallId:Iu,value:Mu!==void 0?Mu:null}}}catch(Du){const Mu=this.extractErrorMessage(Du);return{version:Ou,rendererFunctionResponse:{functionCallId:Iu,error:{code:RpcErrorCode.EXECUTION_ERROR,message:Mu||"An error occurred during function execution."}}}}}generateFunctionCallId(){if(typeof globalThis.crypto?.randomUUID=="function")return globalThis.crypto.randomUUID();const lo=Math.random().toString(36).substring(2,15).padEnd(13,"0");return`call-${Date.now()}-${lo}`}dispatchAgentCall(lo,$u){const{functionCallId:Ru,call:Iu,effectiveTimeoutMs:Pu,version:Ou}=$u;return new Promise((Du,Mu)=>{let Lu;const Bu=()=>{Lu&&(clearTimeout(Lu),Lu=void 0),this.pendingAgentCalls.delete(Ru)};Lu=this.createTimeoutTimer(Ru,Iu.call,Pu,Bu,Mu),this.pendingAgentCalls.set(Ru,{resolve:ju=>{Bu(),Du(ju)},reject:ju=>{Bu(),Mu(ju)}}),this.sendOutboundMessage(lo,Ru,Iu,Ou,Bu,Mu)})}createTimeoutTimer(lo,$u,Ru,Iu,Pu){if(!(Ru<=0))return setTimeout(()=>{this.pendingAgentCalls.delete(lo)&&(Iu(),Pu(new A2uiRpcError(`Agent function call '${$u}' timed out after ${Ru}ms.`,RpcErrorCode.TIMEOUT,lo)))},Ru)}sendOutboundMessage(lo,$u,Ru,Iu,Pu,Ou){const Du={version:Iu||"v1.0",callAgentFunction:{surfaceId:lo,functionCallId:$u,callFunction:Ru}};try{const Mu=this.outboundListener(Du);Mu&&typeof Mu.catch=="function"&&Mu.catch(Lu=>{Pu(),Ou(Lu)})}catch(Mu){Pu(),Ou(Mu)}}extractErrorMessage(lo){return lo instanceof Error?lo.message:String(lo)}createResponseError(lo,$u,Ru,Iu){return{version:Iu||"v1.0",rendererFunctionResponse:{functionCallId:lo,error:{code:$u,message:Ru}}}}}class MessageProcessor{constructor(lo,$u,Ru){this.catalogs=lo,this.actionHandler=$u,this.model=new SurfaceGroupModel,this.adapterRegistry=Ru?.adapterRegistry??defaultVersionAdapterFactory,this.rpc=new RpcHandler({catalogs:this.catalogs,outboundListener:Ru?.outboundListener,defaultTimeoutMs:Ru?.defaultTimeoutMs}),Ru?.validationConfig?this.validationConfig={allowOrphanComponents:!1,allowDanglingReferences:!1,allowMissingRoot:!1,allowUnknownElements:!1,...Ru.validationConfig}:this.validationConfig=void 0,this.actionHandler&&this.model.onAction.subscribe(this.actionHandler)}callAgentFunction(lo,$u,Ru){return this.rpc.callAgentFunction(lo,$u,Ru)}dispose(){this.rpc.dispose()}getRendererCapabilities(lo){if(!lo?.versions||lo.versions.length===0)throw new A2uiValidationError("At least one protocol version must be provided in CapabilitiesOptions to generate renderer capabilities.");const $u=lo.versions,Ru={};for(const Iu of $u){const Pu={supportedCatalogIds:this.catalogs.map(Du=>Du.id)},Ou=lo?.includeInlineCatalogs?this.catalogs.map(Du=>compareSemVer(Iu,"1.0")>=0?generateCatalogSchema(Du,{componentEnvelopeRef:lo?.componentEnvelopeRef,protocolVersion:Iu}):this.generateLegacyInlineCatalog(Du,lo?.componentEnvelopeRef??"common_types.json#/$defs/ComponentCommon")):void 0;Ou&&(Pu.inlineCatalogs=Ou),Ru[Iu]=Pu}return Ru}getClientCapabilities(lo){return this.getRendererCapabilities(lo)}generateLegacyInlineCatalog(lo,$u="common_types.json#/$defs/ComponentCommon"){const Ru=generateCatalogSchema(lo,{componentEnvelopeRef:$u}),Iu=Ru.components||{},Pu=Ru.functions,Ou=[];for(const Lu of lo.functions.values()){const Bu=Pu?.[Lu.name];Ou.push({name:Lu.name,description:Lu.description,returnType:Lu.returnType,parameters:Bu?.properties?.args??{type:"object",properties:{}}})}const Mu=Ru.$defs?.theme?.properties;return{catalogId:lo.id,components:Iu,...Ou.length>0?{functions:Ou}:{},...Mu?{theme:Mu}:{}}}getRendererDataModel(lo){const $u=Array.from(this.model.surfacesMap.values()).filter(Ou=>Ou.sendDataModel);if($u.length===0)return;if(lo!==void 0){const Ou={};for(const Du of $u){const Mu=Du.defaultCatalog?.protocolVersion;(!Mu||isCatalogVersionCompatible(Mu,lo))&&(Ou[Du.id]=Du.dataModel.get("/"))}return Object.keys(Ou).length===0?void 0:{version:lo,surfaces:Ou}}const Ru=new Set;for(const Ou of $u)if(Ou.defaultCatalog?.protocolVersion){const Du=toCanonicalVersion(Ou.defaultCatalog.protocolVersion),Mu=Du?`v${Du}`:Ou.defaultCatalog.protocolVersion;Ru.add(Mu)}if(Ru.size>1)throw new A2uiValidationError(`Multiple protocol versions detected among active surfaces: ${Array.from(Ru).sort().join(", ")}. Specify a target protocol version in getRendererDataModel(version).`);const Iu=Ru.size===1?Ru.values().next().value:"v1.0",Pu={};for(const Ou of $u)Pu[Ou.id]=Ou.dataModel.get("/");return{version:Iu,surfaces:Pu}}getClientDataModel(lo){return this.getRendererDataModel(lo)}resolvePath(lo,$u){return DataModel.resolvePath(lo,$u)}getSurfaces(){return this.model.surfacesMap}getSurface(lo){return this.model.getSurface(lo)}onSurfaceCreated(lo){return this.model.onSurfaceCreated.subscribe(lo)}onSurfaceDeleted(lo){return this.model.onSurfaceDeleted.subscribe(lo)}processMessages(lo,$u){const Ru=this.prepareOperations(lo);for(const Iu of Ru)this.processOperation(Iu,$u)}async processMessagesAsync(lo,$u){const Ru=this.prepareOperations(lo),Iu=[];for(const Pu of Ru){const Ou=await this.processOperationAsync(Pu,$u);Ou&&Iu.push(Ou)}return Iu}prepareOperations(lo){return!lo||Array.isArray(lo)&&lo.length===0?[]:(this.validationConfig&&validateRecursionAndPaths(lo),this.validationConfig?.targetVersion&&this.validateTargetVersion(lo),isInternalOperation(lo)?[lo]:this.adapterRegistry.resolveFromPayload(lo).extractOperations(lo))}validateTargetVersion(lo){const $u=this.validationConfig?.targetVersion;if(!$u)return;const Ru=Iu=>{if(typeof Iu=="object"&&Iu!==null&&"version"in Iu){const Pu=Iu.version;if(Pu){const Ou=toCanonicalVersion(Pu)??Pu,Du=toCanonicalVersion($u)??$u;if(Ou!==Du)throw new A2uiValidationError(`Message version '${Pu}' does not match expected target version '${$u}'`)}}};if(Array.isArray(lo))for(const Iu of lo)Ru(Iu);else Ru(lo)}applyStateOperation(lo){if(this.validationConfig?.allowedMessages&&!this.validationConfig.allowedMessages.includes(lo.type))throw new A2uiValidationError(`Operation '${lo.type}' is not permitted by ValidationConfig.allowedMessages`);switch(lo.type){case"createSurface":this.processCreateSurfaceOp(lo);break;case"deleteSurface":this.processDeleteSurfaceOp(lo);break;case"updateComponents":this.processUpdateComponentsOp(lo);break;case"updateDataModel":this.processUpdateDataModelOp(lo);break;case"agentFunctionResponse":this.rpc.handleAgentFunctionResponse({version:lo.version??"v1.0",agentFunctionResponse:{functionCallId:lo.functionCallId,value:lo.value,error:lo.error}});break}}resolveRpcDataContext(lo){const $u=(lo.catalogId?this.catalogs.find(Ou=>Ou.id===lo.catalogId):void 0)??this.catalogs[0],Ru=(lo.catalogId?Array.from(this.model.surfacesMap.values()).find(Ou=>Ou.defaultCatalog?.id===lo.catalogId||Ou.availableCatalogs?.has(lo.catalogId)):void 0)??this.model.surfacesMap.values().next().value;if(Ru)return new DataContext(Ru,"/");const Iu=`_rpc_fallback_${lo.functionCallId||"default"}`,Pu=new Map;for(const Ou of this.catalogs)$u?.protocolVersion&&Ou.protocolVersion&&isCatalogVersionCompatible($u.protocolVersion,Ou.protocolVersion)&&Pu.set(Ou.id,Ou);return $u&&Pu.set($u.id,$u),new DataContext(new SurfaceModel(Iu,$u,Pu),"/")}processOperation(lo,$u){if(lo.type==="callRendererFunction"){const Ru=this.resolveRpcDataContext(lo),Iu=$u?.isUserActivated??lo.isUserActivated??!1,Pu={version:lo.version??"v1.0",callRendererFunction:{functionCallId:lo.functionCallId,callFunction:{call:lo.call,catalogId:lo.catalogId,args:lo.args}}};this.rpc.handleCallRendererFunction(Pu,Ru,Iu).catch(Ou=>{console.error(`Unhandled error in callRendererFunction (${lo.call}):`,Ou)});return}this.applyStateOperation(lo)}async processOperationAsync(lo,$u){if(lo.type==="callRendererFunction"){const Ru=this.resolveRpcDataContext(lo),Iu=$u?.isUserActivated??lo.isUserActivated??!1,Pu={version:lo.version??"v1.0",callRendererFunction:{functionCallId:lo.functionCallId,callFunction:{call:lo.call,catalogId:lo.catalogId,args:lo.args}}};return await this.rpc.handleCallRendererFunction(Pu,Ru,Iu)}return this.applyStateOperation(lo),null}processCreateSurfaceOp(lo){const{surfaceId:$u,catalogId:Ru,theme:Iu,sendDataModel:Pu,components:Ou,dataModel:Du}=lo,Mu=Ru!==void 0?this.catalogs.find(zu=>zu.id===Ru):this.catalogs[0];if(!Mu)throw new A2uiStateError(`Catalog not found: ${Ru}`);const Lu=lo.version;if(Mu.protocolVersion&&Lu&&!isCatalogVersionCompatible(Mu.protocolVersion,Lu))throw new A2uiValidationError(`Surface '${$u}' catalog '${Ru??Mu.id}' specification version (${Mu.protocolVersion}) does not match message protocol version (${Lu}).`);if(this.model.getSurface($u))throw new A2uiStateError(`Surface ${$u} already exists.`);let Bu=Iu;if(Iu&&Mu.themeSchema)try{Bu=new PayloadValidator(Mu,this.validationConfig).validateTheme(Iu)}catch(zu){throw zu instanceof A2uiValidationError?new A2uiValidationError(zu.message.replace(/^Validation failed for theme:/,`Validation failed for theme on surface '${$u}':`),zu.details):zu}const ju=new Map(this.catalogs.filter(zu=>isCatalogVersionCompatible(zu.protocolVersion,Mu.protocolVersion)).map(zu=>[zu.id,zu])),Fu=new SurfaceModel($u,Mu,ju,Bu,Pu??!1,void 0,lo.rootId??"root");this.model.addSurface(Fu),Du&&Fu.dataModel.set("/",Du),Ou&&Ou.length>0&&this.processUpdateComponentsOp({type:"updateComponents",surfaceId:$u,components:Ou})}processDeleteSurfaceOp(lo){lo.surfaceId&&this.model.deleteSurface(lo.surfaceId)}validateComponentProperties(lo,$u){const{id:Ru,component:Iu}=lo,Pu=lo.catalogId??lo.catalogID;if(typeof Ru!="string"||!Ru)throw new A2uiValidationError(`Component '${Iu}' is missing an 'id'; entries require a valid string 'id'.`);let Ou=$u.defaultCatalog;if(typeof Pu=="string"&&Pu){const Mu=$u.availableCatalogs.get(Pu);if(!Mu){const Lu=this.catalogs.find(Bu=>Bu.id===Pu);throw Lu?new A2uiValidationError(`Component '${Ru}' catalog '${Pu}' specification version (${Lu.protocolVersion}) does not match surface default catalog version (${$u.defaultCatalog.protocolVersion}).`):new A2uiValidationError(`Unknown catalog ID '${Pu}' for component '${Ru}'. Available catalogs: ${this.catalogs.map(Bu=>Bu.id).join(", ")}`)}Ou=Mu}const Du=$u.componentsModel.get(Ru);new PayloadValidator(Ou,this.validationConfig).validateComponent(lo,Du?.type)}applyComponentUpdate(lo,$u){const{id:Ru,component:Iu,...Pu}=lo;if(typeof Ru!="string")return;const Ou=lo.catalogId??lo.catalogID,Du=$u.componentsModel.get(Ru);let Mu=$u.defaultCatalog;if(typeof Ou=="string"&&Ou){const Lu=$u.availableCatalogs.get(Ou);Lu&&(Mu=Lu)}if(Du){const Lu=typeof Iu=="string"?Iu:Du.type;if(Lu!==Du.type||Ou&&Du.catalog?.id!==Mu.id){$u.componentsModel.removeComponent(Ru);const Bu=new ComponentModel(Ru,Lu,Pu,Mu);$u.componentsModel.addComponent(Bu)}else Du.properties=Pu}else{if(typeof Iu!="string"||!Iu)throw new A2uiValidationError(`Cannot create component ${Ru} without a type.`);const Lu=new ComponentModel(Ru,Iu,Pu,Mu);$u.componentsModel.addComponent(Lu)}}processUpdateComponentsOp(lo){if(!lo.surfaceId)return;const $u=this.model.getSurface(lo.surfaceId);if(!$u)throw new A2uiStateError(`Surface not found for message: ${lo.surfaceId}`);for(const Ru of lo.components)this.validateComponentProperties(Ru,$u);this.validateCompositionConstraints($u,lo.components),this.validateCandidateTopology($u,lo.components);for(const Ru of lo.components)this.applyComponentUpdate(Ru,$u)}processUpdateDataModelOp(lo){if(!lo.surfaceId)return;const $u=this.model.getSurface(lo.surfaceId);if(!$u)throw new A2uiStateError(`Surface not found for message: ${lo.surfaceId}`);const Ru=lo.path||"/",Iu=lo.value;$u.dataModel.set(Ru,Iu)}validateParentConstraints(lo,$u,Ru,Iu){if(!Iu||Iu.length===0){if((lo==="root"||this.validationConfig&&this.validationConfig.allowOrphanComponents===!1)&&!Ru.includes("Surface"))throw new A2uiValidationError(`Component '${lo}' (${$u}) cannot be placed under parent 'Surface' (Surface). Allowed parents: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_PARENT");return}for(const Pu of Iu)if(!Ru.includes(Pu.parentType))throw new A2uiValidationError(`Component '${lo}' (${$u}) cannot be placed under parent '${Pu.parentId}' (${Pu.parentType||"unknown"}). Allowed parents: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_PARENT")}validateChildConstraints(lo,$u,Ru,Iu,Pu){for(const Ou of Iu){const Du=Pu.get(Ou);if(Du&&!Ru.includes(Du))throw new A2uiValidationError(`Container '${lo}' (${$u}) cannot contain child '${Ou}' (${Du}). Allowed children: ${JSON.stringify(Ru)}.`,void 0,"UNALLOWED_CHILD")}}buildCompositionTopology(lo,$u){const Ru=new Map,Iu=new Map,Pu=new Map;for(const[Du,Mu]of lo.componentsModel.entries){Ru.set(Du,Mu.type),Mu.catalog&&Iu.set(Du,Mu.catalog);const Lu=lo.componentsModel.getChildIds(Du);Lu.length>0&&Pu.set(Du,Lu)}for(const Du of $u){const{id:Mu,component:Lu,...Bu}=Du;if(typeof Mu!="string")continue;let ju=lo.defaultCatalog;const Fu=Du.catalogId??Du.catalogID;if(typeof Fu=="string"&&Fu){const Gu=lo.availableCatalogs.get(Fu);Gu&&(ju=Gu,Iu.set(Mu,Gu))}const zu=lo.componentsModel.get(Mu),Uu=(typeof Lu=="string"?Lu:zu?.type)??"";Uu&&Ru.set(Mu,Uu);const Hu={id:Mu,component:Uu,...Bu},Vu=Array.from(getComponentReferences(Hu,ju)).map(([Gu])=>Gu);Vu.length>0?Pu.set(Mu,Vu):Pu.delete(Mu)}const Ou=new Map;for(const[Du,Mu]of Pu.entries()){const Lu=Ru.get(Du)||"Unknown";for(const Bu of Mu){const ju=Ou.get(Bu)??[];ju.push({parentId:Du,parentType:Lu}),Ou.set(Bu,ju)}}return{typeMap:Ru,compCatalogMap:Iu,childMap:Pu,parentMap:Ou}}validateCompositionConstraints(lo,$u){const{typeMap:Ru,compCatalogMap:Iu,childMap:Pu,parentMap:Ou}=this.buildCompositionTopology(lo,$u);for(const[Du,Mu]of Ru.entries()){const Bu=(Iu.get(Du)??lo.defaultCatalog).components.get(Mu);Bu&&(Bu.allowedParents&&Bu.allowedParents.length>0&&this.validateParentConstraints(Du,Mu,Bu.allowedParents,Ou.get(Du)),Bu.allowedChildren&&Bu.allowedChildren.length>0&&this.validateChildConstraints(Du,Mu,Bu.allowedChildren,Pu.get(Du)||[],Ru))}}validateCandidateTopology(lo,$u){if(!this.validationConfig)return;const Ru=new SurfaceComponentsModel(lo.defaultCatalog);for(const[Iu,Pu]of lo.componentsModel.entries)Ru.addComponent(new ComponentModel(Iu,Pu.type,Pu.properties,Pu.catalog));for(const Iu of $u){const{id:Pu,component:Ou,...Du}=Iu;if(typeof Pu!="string"||!Pu)continue;const Mu=Iu.catalogId??Iu.catalogID;let Lu=lo.defaultCatalog;if(typeof Mu=="string"&&Mu){const Fu=lo.availableCatalogs.get(Mu);Fu&&(Lu=Fu)}const Bu=Ru.get(Pu),ju=(typeof Ou=="string"?Ou:Bu?.type)||"";ju&&(Bu?ju!==Bu.type||Mu&&Bu.catalog?.id!==Lu.id?(Ru.removeComponent(Pu),Ru.addComponent(new ComponentModel(Pu,ju,Du,Lu))):Bu.properties=Du:Ru.addComponent(new ComponentModel(Pu,ju,Du,Lu)))}Ru.validateTopology({...this.validationConfig,rootId:this.validationConfig.rootId??lo.rootId})}}class ComponentContext{constructor(lo,$u,Ru="/",Iu,Pu){const Ou=lo.componentsModel.get($u);if(!Ou)throw new A2uiStateError(`Component not found: ${$u}`);this.componentModel=Ou,this.surfaceComponents=lo.componentsModel,this.theme=lo.theme,this.dataContext=new DataContext(lo,Ru,Pu,Iu),this._actionDispatcher=Du=>lo.dispatchAction(Du,this.componentModel.id)}dispatchAction(lo){return this._actionDispatcher(lo)}}function scrapeSchemaBehavior(Au){return getFieldBehavior(Au)}function unwrapZodSchema(Au){let lo=Au;for(;lo;){const $u=lo._def?.typeName;if($u==="ZodOptional"||$u==="ZodNullable"||$u==="ZodDefault"||$u==="ZodReadonly")lo=lo._def.innerType;else if($u==="ZodEffects")lo=lo._def.schema;else if($u==="ZodBranded")lo=lo._def.type;else if($u==="ZodLazy")lo=lo._def.getter();else break}return lo}function getRefDefName(Au){let lo=Au,$u="";for(;lo&&($u=lo.description??lo._def?.description??"",!$u);){const Iu=lo._def?.typeName;if(Iu==="ZodOptional"||Iu==="ZodNullable"||Iu==="ZodDefault"||Iu==="ZodReadonly")lo=lo._def.innerType;else if(Iu==="ZodEffects")lo=lo._def.schema;else if(Iu==="ZodBranded")lo=lo._def.type;else if(Iu==="ZodLazy")lo=lo._def.getter();else break}if(!$u||!$u.startsWith("REF:"))return"";const Ru=$u.slice(4);return extractRefDefName(Ru.split("|")[0])}function isCheckableField(Au){const lo=getRefDefName(Au);if(lo==="Checkable"||lo==="CheckRule")return!0;const $u=unwrapZodSchema(Au);if($u?._def?.typeName==="ZodArray"){const Ru=$u._def.type;if(getRefDefName(Ru)==="CheckRule")return!0}return!1}function isActionOption(Au){if(getRefDefName(Au)==="Action")return!0;const $u=unwrapZodSchema(Au)._def;return $u?.typeName==="ZodObject"&&!!$u.shape?.().event}function isDynamicOption(Au){const lo=getRefDefName(Au);if(lo==="DataBinding"||lo.startsWith("Dynamic"))return!0;const Ru=unwrapZodSchema(Au)._def;if(Ru?.typeName!=="ZodObject")return!1;const Iu=Ru.shape?.()||{},Pu=Object.values(Iu).some(Ou=>getRefDefName(Ou)==="ComponentId");return!!Iu.path&&!Pu}function isChildListOption(Au){if(childRefKindOf(Au)==="child-list"||getRefDefName(Au)==="ChildList")return!0;const $u=unwrapZodSchema(Au)._def;if($u?.typeName!=="ZodObject")return!1;const Ru=$u.shape?.()||{};return Object.values(Ru).some(Iu=>getRefDefName(Iu)==="ComponentId")}function isDynamicDef(Au,lo){return(Au==="DataBinding"||Au.startsWith("Dynamic"))&&lo!=="ZodObject"&&lo!=="ZodArray"}function matchUnionBehavior(Au){if(Au.some(isActionOption))return{type:"ACTION"};if(Au.some(isDynamicOption))return{type:"DYNAMIC"};if(Au.some(isChildListOption))return{type:"STRUCTURAL"}}function scrapeObjectShape(Au){const lo={};for(const[$u,Ru]of Object.entries(Au))lo[$u]=getFieldBehavior(Ru);return lo}function getFieldBehavior(Au){const lo=getRefDefName(Au);if(isCheckableField(Au))return{type:"CHECKABLE"};if(lo==="Action")return{type:"ACTION"};const $u=unwrapZodSchema(Au);if(childRefKindOf($u)==="child-list"||lo==="ChildList")return{type:"STRUCTURAL"};if(isDynamicDef(lo,$u._def?.typeName))return{type:"DYNAMIC"};if($u._def.typeName==="ZodUnion"){const Ru=matchUnionBehavior($u._def.options);if(Ru)return Ru}return $u._def.typeName==="ZodArray"?{type:"ARRAY",element:getFieldBehavior($u._def.type)}:$u._def.typeName==="ZodObject"?{type:"OBJECT",shape:scrapeObjectShape($u._def.shape())}:{type:"STATIC"}}const MAX_DYNAMIC_CHILD_LIST_SIZE=1e4;function getSafeChildList(Au){return Array.isArray(Au)?Au.length>MAX_DYNAMIC_CHILD_LIST_SIZE?Au.slice(0,MAX_DYNAMIC_CHILD_LIST_SIZE):Au:[]}class GenericBinder{constructor(lo,$u){this.dataListeners=[],this.propsListeners=[],this.currentProps={},this.isConnected=!1,this.actionClosures=new Map,this.context=lo,this.behaviorTree=scrapeSchemaBehavior($u),this.behaviorTree.type!=="OBJECT"&&(this.behaviorTree={type:"OBJECT",shape:{}}),this.resolveInitialProps()}resolveInitialProps(){const lo=this.context.componentModel.properties,$u=this.resolveAndBind(lo,this.behaviorTree,[],!0);this.currentProps={...this.currentProps,...$u||{}}}connect(){if(this.isConnected)return;this.isConnected=!0;const lo=this.context.componentModel.onUpdated.subscribe(()=>{this.rebuildAllBindings()});this.compUnsub=()=>lo.unsubscribe(),this.rebuildAllBindings()}rebuildAllBindings(){this.dataListeners.forEach(Ru=>Ru()),this.dataListeners=[];const lo=this.context.componentModel.properties,$u=this.resolveAndBind(lo,this.behaviorTree,[],!1);this.currentProps={...this.currentProps,...$u||{}},this.notify()}bindDynamicValue(lo,$u,Ru){const Iu=this.context.dataContext.subscribeDynamicValue(lo,Pu=>{this.updateDeepValue($u,Pu),this.notify()});return Ru?Iu.unsubscribe():this.dataListeners.push(()=>Iu.unsubscribe()),Iu.value}resolveDeepSync(lo,$u=0){if(typeof lo!="object"||lo===null)return lo;if($u>MAX_DYNAMIC_VALUE_DEPTH)return;if("path"in lo||"call"in lo)return this.context.dataContext.resolveDynamicValue(lo,$u);if(Array.isArray(lo))return lo.map(Iu=>this.resolveDeepSync(Iu,$u+1));const Ru={};for(const[Iu,Pu]of Object.entries(lo))Ru[Iu]=this.resolveDeepSync(Pu,$u+1);return Ru}resolveEventAction(lo){if(typeof lo!="object"||lo===null)return lo;const $u=lo;if("event"in $u&&typeof $u.event=="object"&&$u.event!==null){const Ru=$u.event,Iu={...Ru,context:Ru.context?this.resolveDeepSync(Ru.context,1):void 0};return Ru.userMessage!==void 0&&(Iu.userMessage=this.resolveDeepSync(Ru.userMessage,1)),{...$u,event:Iu}}if("name"in $u){const Ru={...$u,context:$u.context?this.resolveDeepSync($u.context,1):void 0};return $u.userMessage!==void 0&&(Ru.userMessage=this.resolveDeepSync($u.userMessage,1)),Ru}return this.resolveDeepSync(lo,0)}bindAction(lo,$u){const Ru=$u.join("/"),Iu=this.actionClosures.get(Ru);if(Iu&&jsonEquals(Iu.raw,lo))return Iu.closure;const Pu=()=>{if(lo&&typeof lo=="object"){const Ou=lo,Du=Ou.functionCall&&typeof Ou.functionCall=="object"?Ou.functionCall:Ou;if(typeof Du.call=="string"){this.context.dataContext.resolveDynamicValue(Du);return}}this.context.dispatchAction(this.resolveEventAction(lo))};return this.actionClosures.set(Ru,{raw:lo,closure:Pu}),Pu}mapTemplateChildren(lo,$u,Ru){const Iu=getSafeChildList(lo),Pu=this.context.dataContext.nested(Ru);return Iu.map((Ou,Du)=>({id:$u,basePath:Pu.nested(String(Du)).path}))}bindStructuralTemplate(lo,$u,Ru){if(!lo||typeof lo!="object"||Array.isArray(lo))return lo;const Iu=lo,Pu=typeof Iu.path=="string"?Iu.path:void 0,Ou=typeof Iu.componentId=="string"?Iu.componentId:void 0;if(!Pu||!Ou)return lo;const Du=this.context.dataContext.subscribeDynamicValue({path:Pu},Mu=>{const Lu=this.mapTemplateChildren(Mu,Ou,Pu);this.updateDeepValue($u,Lu),this.notify()});return Ru?Du.unsubscribe():this.dataListeners.push(()=>Du.unsubscribe()),this.mapTemplateChildren(Du.value,Ou,Pu)}extractValidationResult(lo,$u){if(typeof lo=="object"&&lo!==null&&"valid"in lo){const Ru=lo.message;return{valid:!!lo.valid,message:Ru!=null?String(Ru):$u}}return{valid:!!lo,message:$u}}bindCheckable(lo,$u,Ru){const Iu=Array.isArray(lo)?lo:[],Pu=Iu.map(()=>({valid:!0,message:""})),Ou=$u.slice(0,-1),Du=()=>{const Lu=Pu.filter(Bu=>!Bu.valid).map(Bu=>Bu.message);this.updateDeepValue([...Ou,"isValid"],Lu.length===0),this.updateDeepValue([...Ou,"validationErrors"],Lu),this.notify()};Iu.forEach((Lu,Bu)=>{const ju=typeof Lu=="object"&&Lu!==null?Lu:void 0,Fu=ju&&ju.condition!==void 0?ju.condition:Lu,zu=typeof ju?.message=="string"?ju.message:"Validation failed";Pu[Bu].message=zu;const Uu=this.context.dataContext.subscribeDynamicValue(Fu,Hu=>{Pu[Bu]=this.extractValidationResult(Hu,zu),Du()});Ru?Uu.unsubscribe():this.dataListeners.push(()=>Uu.unsubscribe()),Pu[Bu]=this.extractValidationResult(Uu.value,zu)});const Mu=Pu.filter(Lu=>!Lu.valid).map(Lu=>Lu.message);return this.updateDeepValue([...Ou,"isValid"],Mu.length===0),this.updateDeepValue([...Ou,"validationErrors"],Mu),lo}bindObject(lo,$u,Ru,Iu){const Pu={};for(const[Ou,Du]of Object.entries(lo)){const Mu=$u[Ou]||{type:"STATIC"};Pu[Ou]=this.resolveAndBind(Du,Mu,[...Ru,Ou],Iu)}for(const[Ou,Du]of Object.entries($u))if(Du.type==="DYNAMIC"){const Mu=`set${Ou.charAt(0).toUpperCase()+Ou.slice(1)}`,Lu=lo[Ou];Pu[Mu]=Bu=>{if(Lu&&typeof Lu=="object"&&"path"in Lu){const ju=Lu.path;typeof ju=="string"&&this.context.dataContext.set(ju,Bu)}}}return Pu}resolveAndBind(lo,$u,Ru,Iu){if(lo==null)return lo;switch($u.type){case"DYNAMIC":return this.bindDynamicValue(lo,Ru,Iu);case"ACTION":return this.bindAction(lo,Ru);case"STRUCTURAL":return this.bindStructuralTemplate(lo,Ru,Iu);case"CHECKABLE":return this.bindCheckable(lo,Ru,Iu);case"STATIC":return lo;case"ARRAY":return Array.isArray(lo)?lo.map((Pu,Ou)=>this.resolveAndBind(Pu,$u.element,[...Ru,Ou.toString()],Iu)):lo;case"OBJECT":return typeof lo!="object"?lo:this.bindObject(lo,$u.shape,Ru,Iu)}}updateDeepValue(lo,$u){this.currentProps=this.cloneAndUpdate(this.currentProps,lo,$u)}cloneAndUpdate(lo,$u,Ru){if($u.length===0)return Ru;const[Iu,...Pu]=$u;if(Array.isArray(lo)){const Ou=[...lo];return Ou[Number(Iu)]=this.cloneAndUpdate(Ou[Number(Iu)],Pu,Ru),Ou}else{const Ou=typeof lo=="object"&&lo!==null?lo:{};return{...Ou,[Iu]:this.cloneAndUpdate(Ou[Iu],Pu,Ru)}}}dispose(){this.isConnected&&(this.isConnected=!1,this.dataListeners.forEach(lo=>lo()),this.dataListeners=[],this.compUnsub&&(this.compUnsub(),this.compUnsub=void 0))}notify(){this.propsListeners.forEach(lo=>lo(this.currentProps))}subscribe(lo){return this.propsListeners.length===0&&this.connect(),this.propsListeners.push(lo),{unsubscribe:()=>{this.propsListeners=this.propsListeners.filter($u=>$u!==lo),this.propsListeners.length===0&&this.dispose()}}}get snapshot(){return this.currentProps}}function jsonEquals(Au,lo){if(Object.is(Au,lo))return!0;if(typeof Au!="object"||typeof lo!="object"||Au===null||lo===null)return!1;if(Array.isArray(Au)||Array.isArray(lo))return!Array.isArray(Au)||!Array.isArray(lo)||Au.length!==lo.length?!1:Au.every((Iu,Pu)=>jsonEquals(Iu,lo[Pu]));const $u=Object.keys(Au),Ru=Object.keys(lo);return $u.length!==Ru.length?!1:$u.every(Iu=>Object.prototype.hasOwnProperty.call(lo,Iu)&&jsonEquals(Au[Iu],lo[Iu]))}class ResolvedBinding{constructor(lo){this.value=lo}}class WritableBinding extends ResolvedBinding{constructor(lo,$u,Ru){super(lo),this.set=$u,this.path=Ru}}function isWritable(Au){return Au instanceof WritableBinding}function sameBinding(Au,lo){return isWritable(Au)!==isWritable(lo)||isWritable(Au)&&isWritable(lo)&&Au.path!==lo.path?!1:valueEquals(Au.value,lo.value)}function valueEquals(Au,lo){if(Object.is(Au,lo))return!0;if(Array.isArray(Au)&&Array.isArray(lo))return Au.length===lo.length&&Au.every(($u,Ru)=>valueEquals($u,lo[Ru]));if(isPlainObject$2(Au)&&isPlainObject$2(lo)){const $u=Object.keys(Au),Ru=Object.keys(lo);return $u.length===Ru.length&&$u.every(Iu=>Iu in lo&&valueEquals(Au[Iu],lo[Iu]))}return!1}function isPlainObject$2(Au){if(typeof Au!="object"||Au===null)return!1;const lo=Object.getPrototypeOf(Au);return lo===Object.prototype||lo===null}const PLACEHOLDER_TYPE="Placeholder";function isComponentNode(Au){return Au instanceof MutableComponentNode}class MutableComponentNode{constructor(lo,$u,Ru,Iu,Pu,Ou,Du="resolved"){this._onDestroyed=new EventEmitter,this.onDestroyed=this._onDestroyed,this.cleanups=[],this._disposed=!1,this.instanceId=lo,this.componentId=$u,this.type=Ru,this.dataPath=Iu,this.props=signal(Pu),this.impl=Ou,this.state=Du}get disposed(){return this._disposed}get isPlaceholder(){return this.state!=="resolved"}addCleanup(lo){this.cleanups.push(lo)}toJSON(){if(this.isPlaceholder)return{id:this.componentId,type:this.type,state:this.state};const lo={id:this.componentId,type:this.type},$u=peekValue(this.props);for(const[Ru,Iu]of Object.entries($u))lo[Ru]=serializeValue(Iu);return lo}setProps(lo){if(this._disposed)return;const $u=peekValue(this.props);shallowEqual($u,lo)||setValue(this.props,lo)}dispose(){if(!this._disposed){this._disposed=!0;for(const lo of this.cleanups)try{lo()}catch($u){console.error(`ComponentNode cleanup error (${this.instanceId}):`,$u)}this.cleanups=[],this._onDestroyed.emit(),this._onDestroyed.dispose()}}}function serializeValue(Au){if(isComponentNode(Au))return Au.toJSON();if(Au instanceof ResolvedBinding)return serializeValue(Au.value);if(typeof Au=="function")return"<Action>";if(Array.isArray(Au))return Au.map(serializeValue);if(Au&&typeof Au=="object"){const lo={};for(const[$u,Ru]of Object.entries(Au))lo[$u]=serializeValue(Ru);return lo}return Au}function shallowEqual(Au,lo){if(Object.is(Au,lo))return!0;const $u=Object.keys(Au),Ru=Object.keys(lo);if($u.length!==Ru.length)return!1;for(const Iu of $u)if(!Object.is(Au[Iu],lo[Iu]))return!1;return!0}const COMPONENT_ID_REF="REF:common_types.json#/$defs/ComponentId",CHILD_LIST_REF="REF:common_types.json#/$defs/ChildList",EMPTY_REF_FIELDS$1=new Map,refFieldsCache=new WeakMap;function extractRefFields(Au){const lo=refFieldsCache.get(Au);if(lo)return lo;const $u=unwrap(Au);if($u.schema._def.typeName!=="ZodObject")return refFieldsCache.set(Au,EMPTY_REF_FIELDS$1),EMPTY_REF_FIELDS$1;const Ru=new Map,Iu=$u.schema.shape;for(const[Ou,Du]of Object.entries(Iu)){const Mu=unwrap(Du);if(marksChildList(Mu)||isChildListUnion(Mu.schema)){Ru.set(Ou,{kind:"list"});continue}if(marksComponentId(Mu)){Ru.set(Ou,{kind:"single"});continue}if(Mu.schema._def.typeName==="ZodArray"){const Lu=unwrap(Mu.schema._def.type);if(marksComponentId(Lu)){Ru.set(Ou,{kind:"list"});continue}if(Lu.schema._def.typeName==="ZodObject"){const Bu=new Set,ju=Lu.schema.shape;for(const[Fu,zu]of Object.entries(ju))marksComponentId(unwrap(zu))&&Bu.add(Fu);Bu.size>0&&Ru.set(Ou,{kind:"nested",keys:Bu})}}}const Pu=Ru;return refFieldsCache.set(Au,Pu),Pu}function unwrap(Au){const lo=[],$u=new Set;let Ru=Au;for(;;){Ru.description&&lo.push(Ru.description);const Iu=childRefKindOf(Ru);Iu&&$u.add(Iu);const Pu=Ru._def.typeName;if(Pu==="ZodOptional"||Pu==="ZodNullable"||Pu==="ZodDefault")Ru=Ru._def.innerType;else if(Pu==="ZodEffects")Ru=Ru._def.schema;else return{schema:Ru,descriptions:lo,refs:$u}}}function marksComponentId(Au){return Au.refs.has("component-id")||hasPointer(Au.descriptions,COMPONENT_ID_REF)}function marksChildList(Au){return Au.refs.has("child-list")||hasPointer(Au.descriptions,CHILD_LIST_REF)}function hasPointer(Au,lo){return Au.some($u=>$u.startsWith(lo))}function isChildListUnion(Au){return Au._def.typeName!=="ZodUnion"?!1:Au._def.options.some($u=>{if($u._def.typeName!=="ZodObject")return!1;const Ru=$u.shape;return Ru.componentId&&Ru.path})}const ROOT_COMPONENT_ID="root",ROOT_DATA_PATH="/",EMPTY_REF_FIELDS=new Map;class NodeResolver{constructor(lo,$u){if(this.records=new Map,this.nodesByEdge=new Map,this.nodesByComponentId=new Map,this.pendingParents=new Map,this.dispatchedErrors=new Map,this.modelSubs=[],this._disposed=!1,$u!==lo.defaultCatalog)throw new A2uiStateError("NodeResolver requires the same catalog instance its surface was constructed with.");this.surface=lo,this.catalog=$u,this.rootId=lo.rootId??ROOT_COMPONENT_ID,this.rootNode=signal(void 0),this.modelSubs.push(lo.componentsModel.onCreated.subscribe(Ru=>this.onComponentCreated(Ru))),this.modelSubs.push(lo.componentsModel.onDeleted.subscribe(Ru=>this.onComponentDeleted(Ru))),lo.componentsModel.get(this.rootId)&&this.buildRoot()}dispatchOnce(lo,$u,Ru,Iu){let Pu=this.dispatchedErrors.get($u);Pu||(Pu=new Map,this.dispatchedErrors.set($u,Pu));let Ou=Pu.get(Ru);Ou||(Ou=new Set,Pu.set(Ru,Ou)),!Ou.has(lo)&&(Ou.add(lo),this.surface.dispatchError({code:lo,message:Iu}))}clearDispatched(lo,$u){const Ru=this.dispatchedErrors.get(lo);Ru?.delete($u)&&Ru.size===0&&this.dispatchedErrors.delete(lo)}get activeNodeCount(){return this.records.size}get disposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;for(const lo of this.modelSubs)lo.unsubscribe();this.modelSubs.length=0;for(const lo of[...this.records.keys()])this.disposeNode(lo);this.pendingParents.clear(),this.dispatchedErrors.clear(),this.rootRecord=void 0,setValue(this.rootNode,void 0)}}buildRoot(){if(this.rootRecord)return;const lo=`>${escapeIdPart(this.rootId)}>${escapeIdPart(this.rootId)}@/`,$u=this.createNode(this.rootId,ROOT_DATA_PATH,lo,void 0);this.rootRecord=this.records.get($u),setValue(this.rootNode,$u)}onComponentCreated(lo){if(this._disposed)return;if(lo.id===this.rootId){const Ru=this.surface.componentsModel.get(this.rootId);this.rootRecord&&this.rootRecord.componentModel!==Ru&&(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,Ru||setValue(this.rootNode,void 0)),Ru&&this.buildRoot()}const $u=this.pendingParents.get(lo.id);if($u){this.pendingParents.delete(lo.id);for(const Ru of $u){const Iu=this.records.get(Ru);Iu&&!Ru.disposed&&this.materialize(Iu)}}}onComponentDeleted(lo){if(this._disposed)return;this.dispatchedErrors.delete(lo);const $u=this.surface.componentsModel.get(lo),Ru=this.nodesByComponentId.get(lo);if(!Ru)return;const Iu=new Set;let Pu=!1;for(const Ou of[...Ru]){const Du=this.records.get(Ou);Du&&(Du.parent?Iu.add(Du.parent):Pu=!0)}Pu&&this.rootRecord&&($u?this.rootRecord.componentModel!==$u&&(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,this.buildRoot()):(this.disposeNode(this.rootRecord.node),this.rootRecord=void 0,setValue(this.rootNode,void 0)));for(const Ou of Iu){const Du=this.records.get(Ou);Du&&!Ou.disposed&&this.materialize(Du)}}createNode(lo,$u,Ru,Iu,Pu=1){const Ou=this.surface.componentsModel.get(lo);if(!Ou){const zu=this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,PLACEHOLDER_TYPE,$u,{},void 0,"pending"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS});return Iu&&this.registerPendingParent(lo,Iu),zu.node}const Du=(Ou.catalog?.components.size?Ou.catalog:void 0)??this.catalog,Mu=Du.components.get(Ou.type);if(!Mu)return this.dispatchOnce("UNKNOWN_COMPONENT_TYPE",lo,$u,`Component '${lo}' has type '${Ou.type}', which is not in catalog '${Du.id}'.`),this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,Ou.type,$u,{},void 0,"unknown-type"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS,componentModel:Ou}).node;this.clearDispatched(lo,$u);const Lu=Iu?this.records.get(Iu)?.context?.dataContext:void 0,Bu=new ComponentContext(this.surface,lo,$u,Lu),ju=new GenericBinder(Bu,Mu.schema),Fu=this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,Ou.type,$u,{},Mu),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:extractRefFields(Mu.schema),behavior:scrapeSchemaBehavior(Mu.schema),context:Bu,componentModel:Ou,binder:ju});return Fu.binderSub=ju.subscribe(zu=>{Fu.lastBinderProps=zu,this.materialize(Fu)}),Fu.lastBinderProps=ju.snapshot,this.materialize(Fu),Fu.node}registerNode(lo,$u){const Ru={node:lo,edgeKey:$u.edgeKey,parent:$u.parent,occurrence:$u.occurrence,refFields:$u.refFields,behavior:$u.behavior,context:$u.context,componentModel:$u.componentModel,binder:$u.binder,childEdges:new Map};this.records.set(lo,Ru),this.nodesByEdge.set($u.edgeKey,lo);let Iu=this.nodesByComponentId.get(lo.componentId);return Iu||(Iu=new Set,this.nodesByComponentId.set(lo.componentId,Iu)),Iu.add(lo),Ru}childNode(lo,$u,Ru,Iu,Pu=1){const Ou=this.nodesByEdge.get(Ru);if(this.isCyclic(lo,$u,Iu))return Ou&&!Ou.disposed&&Ou.isPlaceholder&&this.records.get(Ou)?.occurrence===Pu?Ou:(Ou&&!Ou.disposed&&this.disposeNode(Ou),this.dispatchOnce("CYCLIC_REFERENCE",lo,$u,`Component '${lo}' at '${$u}' is referenced by one of its own descendants; rendering a placeholder instead.`),this.registerNode(new MutableComponentNode(instanceIdFor(lo,$u,Pu),lo,PLACEHOLDER_TYPE,$u,{},void 0,"cyclic"),{edgeKey:Ru,parent:Iu,occurrence:Pu,refFields:EMPTY_REF_FIELDS}).node);if(Ou&&!Ou.disposed){const Du=this.surface.componentsModel.get(lo),Mu=(Du?.catalog?.components.size?Du.catalog:void 0)??this.catalog,Lu=Du?Mu.components.get(Du.type):void 0,Bu=this.records.get(Ou);if(Ou.componentId===lo&&Ou.dataPath===$u&&Bu?.occurrence===Pu&&(Ou.isPlaceholder?Du===void 0&&Ou.state==="pending"||Du!==void 0&&Lu===void 0&&Ou.state==="unknown-type"&&Bu?.componentModel===Du:Du!==void 0&&Ou.type===Du.type&&Bu?.componentModel===Du))return Ou.state==="pending"&&this.registerPendingParent(lo,Iu),Ou;this.disposeNode(Ou)}return this.createNode(lo,$u,Ru,Iu,Pu)}registerPendingParent(lo,$u){let Ru=this.pendingParents.get(lo);Ru||(Ru=new Set,this.pendingParents.set(lo,Ru)),Ru.add($u)}isCyclic(lo,$u,Ru){for(let Iu=Ru;Iu;Iu=this.records.get(Iu)?.parent)if(Iu.componentId===lo&&Iu.dataPath===$u)return!0;return!1}materialize(lo){if(lo.node.disposed)return;const Ru={...lo.lastBinderProps??lo.binder?.snapshot??{}},Iu=new Map,Pu=lo.componentModel?.properties;if(Pu)for(const Bu of lo.refFields.keys())Bu in Ru&&!(Bu in Pu)&&delete Ru[Bu];const Ou=new Map,Du=(Bu,ju,Fu)=>{const zu=`${escapeIdPart(ju)}@${escapeIdPart(Fu)}`,Uu=(Ou.get(zu)??0)+1;Ou.set(zu,Uu);const Hu=`${lo.edgeKey}>${Bu}>${zu}`,Vu=this.childNode(ju,Fu,Hu,lo.node,Uu);return Iu.set(Hu,Vu),Vu};for(const[Bu,ju]of lo.refFields)switch(ju.kind){case"single":{const Fu=Ru[Bu];typeof Fu=="string"&&Fu&&(Ru[Bu]=Du(escapeIdPart(Bu),Fu,lo.node.dataPath));break}case"list":{const Fu=Ru[Bu];if(!Array.isArray(Fu))break;const zu=getSafeChildList(Fu);Ru[Bu]=zu.map((Uu,Hu)=>{if(typeof Uu=="string"&&Uu)return Du(`${escapeIdPart(Bu)}[${Hu}]`,Uu,lo.node.dataPath);if(Uu&&typeof Uu=="object"&&!Array.isArray(Uu)){const Vu=Uu;if(typeof Vu.id=="string"&&typeof Vu.basePath=="string")return Du(`${escapeIdPart(Bu)}[${Hu}]`,Vu.id,Vu.basePath);if(typeof Vu.componentId=="string"&&Vu.componentId)return Du(`${escapeIdPart(Bu)}[${Hu}]`,Vu.componentId,lo.node.dataPath)}return Uu});break}case"nested":{const Fu=Ru[Bu];if(!Array.isArray(Fu))break;Ru[Bu]=Fu.map((zu,Uu)=>{if(!zu||typeof zu!="object"||Array.isArray(zu))return zu;const Hu={...zu};let Vu=!1;for(const Gu of ju.keys){const Wu=Hu[Gu];typeof Wu=="string"&&Wu&&(Hu[Gu]=Du(`${escapeIdPart(Bu)}[${Uu}].${escapeIdPart(Gu)}`,Wu,lo.node.dataPath),Vu=!0)}return Vu?Hu:zu});break}}for(const[Bu,ju]of lo.childEdges)if(!Iu.has(Bu)&&(this.disposeNode(ju),ju.isPlaceholder&&![...Iu.values()].some(zu=>zu.isPlaceholder&&zu.componentId===ju.componentId))){const zu=this.pendingParents.get(ju.componentId);zu&&(zu.delete(lo.node),zu.size===0&&this.pendingParents.delete(ju.componentId))}lo.childEdges=Iu;const Mu=lo.behavior&&lo.context?wrapDynamicValues(Ru,lo.behavior,Pu??{},lo.context.dataContext):Ru,Lu=peekValue(lo.node.props);for(const Bu of Object.keys(Mu))Mu[Bu]=stabilize(Lu[Bu],Mu[Bu]);lo.node.setProps(Mu)}disposeNode(lo){if(lo.disposed)return;const $u=this.records.get(lo);if($u){for(const Iu of $u.childEdges.values())this.disposeNode(Iu);$u.childEdges.clear(),$u.binderSub?.unsubscribe(),$u.binderSub=void 0,this.nodesByEdge.get($u.edgeKey)===lo&&this.nodesByEdge.delete($u.edgeKey),this.records.delete(lo)}const Ru=this.nodesByComponentId.get(lo.componentId);Ru&&(Ru.delete(lo),Ru.size===0&&this.nodesByComponentId.delete(lo.componentId));for(const[Iu,Pu]of this.pendingParents)Pu.delete(lo),Pu.size===0&&this.pendingParents.delete(Iu);lo.state==="cyclic"&&this.clearDispatched(lo.componentId,lo.dataPath),lo.dispose()}}const ID_PART_ESCAPES={"~":"~0","#":"~1","[":"~2","]":"~3",">":"~4","@":"~5"};function escapeIdPart(Au){return Au.replace(/[~#[\]>@]/g,lo=>ID_PART_ESCAPES[lo])}function instanceIdFor(Au,lo,$u){const Ru=lo.replace(/\/+$/,"")||ROOT_DATA_PATH,Iu=lo===ROOT_DATA_PATH?escapeIdPart(Au):`${escapeIdPart(Au)}-[${escapeIdPart(Ru)}]`;return $u>1?`${Iu}#${$u}`:Iu}function wrapDynamicValues(Au,lo,$u,Ru){switch(lo.type){case"DYNAMIC":{const Iu=$u&&typeof $u=="object"&&!Array.isArray($u)&&typeof $u.path=="string"?$u.path:void 0;return Iu===void 0?new ResolvedBinding(Au):new WritableBinding(Au,Pu=>Ru.set(Iu,Pu),Iu)}case"ARRAY":{if(!Array.isArray(Au))return Au;const Iu=Array.isArray($u)?$u:[];return Au.map((Pu,Ou)=>wrapDynamicValues(Pu,lo.element,Iu[Ou],Ru))}case"OBJECT":{if(!Au||typeof Au!="object"||Array.isArray(Au))return Au;const Iu=new Set;for(const[Du,Mu]of Object.entries(lo.shape))Mu.type==="DYNAMIC"&&Iu.add(`set${Du.charAt(0).toUpperCase()}${Du.slice(1)}`);const Pu=$u&&typeof $u=="object"&&!Array.isArray($u)?$u:{},Ou={};for(const[Du,Mu]of Object.entries(Au))Iu.has(Du)||(Ou[Du]=wrapDynamicValues(Mu,lo.shape[Du]??{type:"STATIC"},Pu[Du],Ru));for(const[Du,Mu]of Object.entries(lo.shape))Mu.type==="DYNAMIC"&&!(Du in Ou)&&(Ou[Du]=new ResolvedBinding(void 0));return Ou}default:return Au}}function stabilize(Au,lo){if(Object.is(Au,lo))return lo;if(Au instanceof ResolvedBinding&&lo instanceof ResolvedBinding)return sameBinding(Au,lo)?Au:lo;if(isComponentNode(Au)||isComponentNode(lo))return lo;if(Array.isArray(Au)&&Array.isArray(lo)&&Au.length===lo.length){let $u=!0;const Ru=lo.map((Iu,Pu)=>{const Ou=stabilize(Au[Pu],Iu);return Object.is(Ou,Au[Pu])||($u=!1),Ou});return $u?Au:Ru}if(isPlainObject$1(Au)&&isPlainObject$1(lo)){const $u=Object.keys(Au),Ru=Object.keys(lo);if($u.length===Ru.length){let Iu=!0;const Pu={};for(const Ou of Ru){const Du=stabilize(Au[Ou],lo[Ou]);Pu[Ou]=Du,(!(Ou in Au)||!Object.is(Du,Au[Ou]))&&(Iu=!1)}return Iu?Au:Pu}}return lo}function isPlainObject$1(Au){if(!Au||typeof Au!="object"||Array.isArray(Au)||isComponentNode(Au))return!1;const lo=Object.getPrototypeOf(Au);return lo===Object.prototype||lo===null}const ComponentIdSchema=markChildRef(stringType().describe("REF:#/$defs/ComponentId|The unique identifier for a component, used for both definitions and references within the same surface."),"component-id"),DataBindingSchema=objectType({path:stringType().describe("A JSON Pointer path to a value in the data model.")}).strict().describe("REF:#/$defs/DataBinding"),DynamicValueSchema=unionType([stringType(),numberType(),booleanType(),arrayType(anyType()),DataBindingSchema,lazyType(()=>FunctionCallSchema)]).describe("REF:#/$defs/DynamicValue|A value that can be a literal, a path, or a function call returning any type."),FunctionCallSchema=objectType({call:stringType().describe("The name of the function to call."),args:recordType(stringType(),unionType([DynamicValueSchema,recordType(stringType(),anyType()).describe("A literal object argument (e.g. configuration).")])).describe("Arguments passed to the function.").optional(),returnType:enumType(["string","number","boolean","array","object","any","void"]).describe("The expected return type of the function call.").default("boolean")}).describe("REF:#/$defs/FunctionCall|Invokes a named function on the client."),DynamicStringSchema=unionType([stringType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicString|Represents a string"),AccessibilityAttributesSchema=objectType({label:DynamicStringSchema.optional(),description:DynamicStringSchema.optional()}).describe("REF:#/$defs/AccessibilityAttributes|Attributes to enhance accessibility when using assistive technologies like screen readers.");objectType({id:ComponentIdSchema,accessibility:AccessibilityAttributesSchema.optional()}).describe("REF:#/$defs/ComponentCommon");const ChildListSchema=markChildRef(unionType([arrayType(ComponentIdSchema).describe("A static list of child component IDs."),objectType({componentId:ComponentIdSchema,path:stringType().describe("The path to the list of component property objects in the data model.")}).strict().describe("A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.")]).describe("REF:#/$defs/ChildList"),"child-list"),DynamicNumberSchema=unionType([numberType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicNumber|Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number."),DynamicBooleanSchema=unionType([booleanType(),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicBoolean|A boolean value that can be a literal, a path, or a function call returning a boolean."),DynamicStringListSchema=unionType([arrayType(stringType()),DataBindingSchema,FunctionCallSchema]).describe("REF:#/$defs/DynamicStringList|Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array."),CheckRuleSchema=objectType({condition:DynamicBooleanSchema,message:stringType().describe("The error message to display if the check fails.")}).strict().describe("REF:#/$defs/CheckRule|A single validation rule applied to an input component.");objectType({checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional()}).describe("REF:#/$defs/Checkable|Properties for components that support client-side checks.");const ActionSchema=unionType([objectType({event:objectType({name:stringType().describe("The name of the action to be dispatched to the server."),context:recordType(stringType(),DynamicValueSchema).describe("A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.").optional()}).strict().describe("The event to dispatch to the server.")}).strict().describe("Triggers a server-side event."),objectType({functionCall:FunctionCallSchema}).strict().describe("Executes a local client-side function.")]).describe("REF:#/$defs/Action|Defines an interaction handler that can either trigger a server-side event or execute a local client-side function."),TextApi={name:"Text",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),text:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text content to display. While simple Markdown formatting is supported (i.e. without HTML, images, or links), utilizing dedicated UI components is generally preferred for a richer and more structured presentation."),variant:enumType(["h1","h2","h3","h4","h5","caption","body"]).default("body").describe("A hint for the base text style.").optional()}).strict()},ImageApi={name:"Image",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the image to display."),description:DynamicStringSchema.describe("REF:#/$defs/DynamicString|Accessibility text for the image.").optional(),fit:enumType(["contain","cover","fill","none","scaleDown"]).default("fill").describe("Specifies how the image should be resized to fit its container. This corresponds to the CSS 'object-fit' property.").optional(),variant:enumType(["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]).default("mediumFeature").describe("A hint for the image size and style.").optional()}).strict()},IconApi={name:"Icon",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),name:unionType([enumType(["accountCircle","add","arrowBack","arrowForward","attachFile","calendarToday","call","camera","check","close","delete","download","edit","event","error","fastForward","favorite","favoriteOff","folder","help","home","info","locationOn","lock","lockOpen","mail","menu","moreVert","moreHoriz","notificationsOff","notifications","pause","payment","person","phone","photo","play","print","refresh","rewind","search","send","settings","share","shoppingCart","skipNext","skipPrevious","star","starHalf","starOff","stop","upload","visibility","visibilityOff","volumeDown","volumeMute","volumeOff","volumeUp","warning"]),objectType({svgPath:stringType()}),DataBindingSchema.describe("REF:#/$defs/DataBinding")]).describe("The name of the icon to display.")}).strict()},VideoApi={name:"Video",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the video to display.")}).strict()},AudioPlayerApi={name:"AudioPlayer",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),url:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The URL of the audio to be played."),description:DynamicStringSchema.describe("REF:#/$defs/DynamicString|A description of the audio, such as a title or summary.").optional()}).strict()},RowApi={name:"Row",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID."),justify:enumType(["center","end","spaceAround","spaceBetween","spaceEvenly","start","stretch"]).default("start").describe("Defines the arrangement of children along the main axis (horizontally). Use 'spaceBetween' to push items to the edges, or 'start'/'end'/'center' to pack them together.").optional(),align:enumType(["start","center","end","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis (vertically). This is similar to the CSS 'align-items' property, but uses camelCase values (e.g., 'start').").optional()}).strict()},ColumnApi={name:"Column",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID."),justify:enumType(["start","center","end","spaceBetween","spaceAround","spaceEvenly","stretch"]).default("start").describe("Defines the arrangement of children along the main axis (vertically). Use 'spaceBetween' to push items to the edges (e.g. header at top, footer at bottom), or 'start'/'end'/'center' to pack them together.").optional(),align:enumType(["center","end","start","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis (horizontally). This is similar to the CSS 'align-items' property.").optional()}).strict()},ListApi={name:"List",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),children:ChildListSchema.describe("REF:#/$defs/ChildList|Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list."),direction:enumType(["vertical","horizontal"]).default("vertical").describe("The direction in which the list items are laid out.").optional(),align:enumType(["start","center","end","stretch"]).default("stretch").describe("Defines the alignment of children along the cross axis.").optional()}).strict()},CardApi={name:"Card",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the single child component to be rendered inside the card. To display multiple elements, you MUST wrap them in a layout component (like Column or Row) and pass that container's ID here. Do NOT pass multiple IDs or a non-existent ID.")}).strict()},TabsApi={name:"Tabs",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),tabs:arrayType(objectType({title:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The tab title."),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the child component.")})).min(1).describe("An array of objects, where each object defines a tab with a title and a child component.")}).strict()},ModalApi={name:"Modal",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),trigger:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the component that opens the modal when interacted with (e.g., a button)."),content:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the component to be displayed inside the modal.")}).strict()},DividerApi={name:"Divider",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),axis:enumType(["horizontal","vertical"]).default("horizontal").describe("The orientation of the divider.").optional()}).strict()},ButtonApi={name:"Button",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),child:ComponentIdSchema.describe("REF:#/$defs/ComponentId|The ID of the child component. Use a 'Text' component for a labeled button. Only use an 'Icon' if the requirements explicitly ask for an icon-only button."),variant:enumType(["default","primary","borderless"]).default("default").describe("A hint for the button style. If omitted, a default button style is used. 'primary' indicates this is the main call-to-action button. 'borderless' means the button has no visual border or background, making its child content appear like a clickable link.").optional(),action:ActionSchema.describe("REF:#/$defs/Action")}).strict()},TextFieldApi={name:"TextField",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text label for the input field."),value:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The value of the text field.").optional(),variant:enumType(["longText","number","shortText","obscured"]).default("shortText").describe("The type of input field to display.").optional(),validationRegexp:stringType().describe("A regular expression used for client-side validation of the input.").optional()}).strict()},CheckBoxApi={name:"CheckBox",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text to display next to the checkbox."),value:DynamicBooleanSchema.describe("REF:#/$defs/DynamicBoolean|The current state of the checkbox (true for checked, false for unchecked).")}).strict()},ChoicePickerApi={name:"ChoicePicker",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The label for the group of options.").optional(),variant:enumType(["multipleSelection","mutuallyExclusive"]).default("mutuallyExclusive").describe("A hint for how the choice picker should be displayed and behave.").optional(),options:arrayType(objectType({label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text to display for this option."),value:stringType().describe("The stable value associated with this option.")})).describe("The list of available options to choose from."),value:DynamicStringListSchema.describe("REF:#/$defs/DynamicStringList|The list of currently selected values. This should be bound to a string array in the data model."),displayStyle:enumType(["checkbox","chips"]).default("checkbox").describe("The display style of the component.").optional(),filterable:booleanType().default(!1).describe("If true, displays a search input to filter the options.").optional()}).strict()},SliderApi={name:"Slider",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The label for the slider.").optional(),min:numberType().default(0).describe("The minimum value of the slider.").optional(),max:numberType().describe("The maximum value of the slider."),value:DynamicNumberSchema.describe("REF:#/$defs/DynamicNumber|The current value of the slider.")}).strict()},DateTimeInputApi={name:"DateTimeInput",schema:objectType({accessibility:AccessibilityAttributesSchema.describe("REF:#/$defs/AccessibilityAttributes").optional(),weight:numberType().describe("The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.").optional(),checks:arrayType(CheckRuleSchema).describe("A list of checks to perform. These are function calls that must return a boolean indicating validity.").optional(),value:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The selected date and/or time value in ISO 8601 format. If not yet set, initialize with an empty string."),enableDate:booleanType().default(!1).describe("If true, allows the user to select a date.").optional(),enableTime:booleanType().default(!1).describe("If true, allows the user to select a time.").optional(),min:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The minimum allowed date/time in ISO 8601 format.").optional(),max:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The maximum allowed date/time in ISO 8601 format.").optional(),label:DynamicStringSchema.describe("REF:#/$defs/DynamicString|The text label for the input field.").optional()}).strict()},DEFAULT_CSS=`
3403
3403
  :where(:root) {
3404
3404
  color-scheme: light dark;
3405
3405
  }