@theoremjs/studio 0.3.4-next.550.gf20b9cd → 0.3.4-next.556.g19d4fbb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/page/assets/{Banner-Bvkdyf59.js → Banner-B8V-qXaP.js} +2 -2
- package/page/assets/{ConsoleFrame-BTL67qHr.js → ConsoleFrame-COfuswTl.js} +1 -1
- package/page/assets/{ContextMenu-BngxR9na.js → ContextMenu-DmeF1Dvz.js} +2 -2
- package/page/assets/{MenuBottomSheet-C4fG_GyZ.js → MenuBottomSheet-Dz3uSt3X.js} +1 -1
- package/page/assets/{SchemaFields-BT2XCbid.js → SchemaFields-B9fjod6m.js} +1 -1
- package/page/assets/{ToolResultCharts-rJr0Ksno.js → ToolResultCharts-CEMYALNI.js} +1 -1
- package/page/assets/{TraceInspector-DQI_wNzL.js → TraceInspector-8-F3jBOY.js} +1 -1
- package/page/assets/{TraceOverview-DmfmwSR6.js → TraceOverview-Bh3WLZ-O.js} +1 -1
- package/page/assets/{browser-engine-B1PxEekk.js → browser-engine-9KoPqhyC.js} +1 -1
- package/page/assets/{browser-transport-BOHBmYvp.js → browser-transport-DPhlVtK9.js} +3 -3
- package/page/assets/{crypto-Dd6XxhqK.js → crypto-CrMpJY2D.js} +1 -1
- package/page/assets/{encode-files-CiyHxnUC.js → encode-files-BCf3-Q7y.js} +1 -1
- package/page/assets/{export-agent-BvEVKW_C.js → export-agent-CztwHpHH.js} +1 -1
- package/page/assets/{guardrail-tester-08T-hMFL.js → guardrail-tester-Br8aOs7G.js} +1 -1
- package/page/assets/{index-eSb7kilv.js → index-DTXkdk9F.js} +7 -7
- package/page/assets/{live-messages-DmTC8qc8.js → live-messages-D1DPu8uD.js} +1 -1
- package/page/assets/{reader-DoTXxl0W.js → reader-BJZH_Cmn.js} +1 -1
- package/page/assets/{shaped-data-DYOBdvLJ.js → shaped-data-AVV4e7rW.js} +1 -1
- package/page/assets/{stub-CKo_lxer.js → stub-BMUhx6B5.js} +1 -1
- package/page/assets/{studio-code-pane-CEG07Zk7.js → studio-code-pane-DEHxQLAS.js} +1 -1
- package/page/assets/{studio-console-udt4MmTi.js → studio-console-Da2lR2pI.js} +1 -1
- package/page/assets/{studio-decision-tocwLzxr.js → studio-decision-BeJF9S45.js} +1 -1
- package/page/assets/{studio-embedding-DQ84xzlj.js → studio-embedding-BSYD04tz.js} +1 -1
- package/page/assets/{studio-host-console-BJOUpXHR.js → studio-host-console-3aVzR9Pg.js} +2 -2
- package/page/assets/{studio-labels-Zqd84hcs.js → studio-labels-BqzL7-p0.js} +1 -1
- package/page/assets/{studio-live-BmuHpeF4.js → studio-live-btHtbVCo.js} +1 -1
- package/page/assets/{studio-map-qP_i4hWG.js → studio-map-BbUTXZxZ.js} +1 -1
- package/page/assets/{studio-trace-replay-JUMs6EMA.js → studio-trace-replay-NMZRvbt7.js} +1 -1
- package/page/assets/{tool-schema-CWGccblZ.js → tool-schema-DCF2M0n_.js} +1 -1
- package/page/assets/{trace-record-B2MF8flo.js → trace-record-Dtrz7WQ7.js} +1 -1
- package/page/assets/{tree-B7VVMg1s.js → tree-Cy9xwG_l.js} +1 -1
- package/page/assets/{turn-client-CoLR6hrl.js → turn-client-mCvAwEgO.js} +1 -1
- package/page/assets/types-CB42MysU.js +1 -0
- package/page/assets/{use-one-call-BKeMtY5F.js → use-one-call-C6QrIyrt.js} +1 -1
- package/page/assets/{workspace-NGa3jjDc.js → workspace-BFrc6kx2.js} +1 -1
- package/page/index.html +15 -15
- package/page/assets/types-CL44MvsT.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/studio",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.556.g19d4fbb",
|
|
4
4
|
"description": "Theorem Studio: open a project's agents in a local studio on Deno, edit and run them, and save back to its files; or show the studio screen in a Vite app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"zod": "^4.6.5",
|
|
80
|
-
"@theoremjs/agents": "0.3.4-next.
|
|
81
|
-
"@theoremjs/web": "0.3.4-next.
|
|
82
|
-
"@theoremjs/react": "0.3.4-next.
|
|
80
|
+
"@theoremjs/agents": "0.3.4-next.556.g19d4fbb",
|
|
81
|
+
"@theoremjs/web": "0.3.4-next.556.g19d4fbb",
|
|
82
|
+
"@theoremjs/react": "0.3.4-next.556.g19d4fbb"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"@theoremjs/react": {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TraceInspector-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{x as s}from"./fieldParts-B7DYLgh4.js";import{t as c}from"./isRenderable-DHkzpAoQ.js";import{t as l,x as u}from"./Icon-BqkS-pIq.js";import{b as d,d as f,f as p,g as m,h,l as g,n as _,p as v,t as y,u as b}from"./use-trace-records-B1vrKQmA.js";import{t as x}from"./preload-helper-DpV6A1kQ.js";import{n as S,t as C}from"./labels-provider-DkA22zkP.js";import{c as w,n as T,t as E}from"./IconButton-DVUFx-8p.js";import{t as D}from"./createReactComponent-CZwsv6DD.js";import{a as O}from"./ScrollableArea-BHfY7sWH.js";var k=D(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),A=D(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),j=D(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),M=e(i(),1),N=t(),P=(0,M.lazy)(()=>x(()=>import(`./TraceInspector-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TraceInspector-8-F3jBOY.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/tokens.stylex-DkHf0P9C.js","assets/SegmentedControlItem-BBGRPrxp.js","assets/padding.stylex-B76907Zf.js","assets/VStack-CkVMcNiK.js","assets/mergeProps-ptS-gIMz.js","assets/StackItem-CQviqAfM.js","assets/useLayerDismissal-BAnTRYTt.js","assets/fieldParts-B7DYLgh4.js","assets/Icon-BqkS-pIq.js","assets/devWarning-DxuplmRl.js","assets/Text-BOqCfzZC.js","assets/sharedResizeObserver-4U9Xq5Oq.js","assets/preload-helper-DpV6A1kQ.js","assets/useMediaQuery-BCT0NUeZ.js","assets/useResolvedRequired-DbsOcDqy.js","assets/useAnnounce-DTSHZvjg.js","assets/Tooltip-BWs5DLrM.js","assets/useTooltip-c097gL_-.js","assets/focusOutline.stylex-BT0kfa4t.js","assets/IconButton-DVUFx-8p.js","assets/focusableSelector-DXZeMU85.js","assets/useDevWarning-Z9SoixOP.js","assets/createReactComponent-CZwsv6DD.js","assets/isRtlElement-BG33-k_H.js","assets/plainDate-BHiJcj7o.js","assets/DateInput-B1ICJtHn.js","assets/focusReturn-CTppP2k0.js","assets/Card-DruykyeB.js","assets/container.stylex-BmOi-8DQ.js","assets/ScrollableArea-BHfY7sWH.js","assets/useScrollableArea-DuF_pz9m.js","assets/chainEventHandlers-C6ttXGfW.js","assets/BottomSheet-Dbh6A5Vl.js","assets/useScrollLock-Dyf6PHJt.js","assets/use-trace-records-B1vrKQmA.js","assets/CheckboxInput-CFZ_Wq8-.js","assets/isRenderable-DHkzpAoQ.js","assets/IconAlertTriangle-BqAEqqdU.js","assets/arrive-DvbqpeRS.js","assets/IconShield-DDOh7Gr5.js","assets/shaped-data-AVV4e7rW.js","assets/host-patterns-F-KZIzkF.js","assets/trace-record-Dtrz7WQ7.js","assets/TraceOverview-Bh3WLZ-O.js","assets/labels-provider-DkA22zkP.js","assets/CodeBlock-CfVOtDeO.js","assets/useClipboard-CbN9bb4J.js","assets/index-DTXkdk9F.js","assets/browser-transport-DPhlVtK9.js","assets/Center-nHS1JSux.js","assets/IconSearch-BTx66a40.js","assets/schemas-BQ9Jydzb.js","assets/tool-schema-DCF2M0n_.js","assets/reader-BJZH_Cmn.js","assets/live-ingress-OuSlQ6q7.js","assets/trace-schema-9CdEyG6Q.js","assets/stub-BMUhx6B5.js","assets/tree-Cy9xwG_l.js","assets/types-CB42MysU.js","assets/useContainerReveal-BFy8N_QU.js","assets/Dialog-Sd04KQS2.js","assets/HoverCard-DMyWUvwP.js","assets/IconEye-BB5aY-wQ.js","assets/studio-labels-BqzL7-p0.js","assets/turn-client-mCvAwEgO.js","assets/encode-files-BCf3-Q7y.js","assets/CollapsibleGroup-FIawJRo4.js","assets/crypto-CrMpJY2D.js","assets/workspace-BFrc6kx2.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/studio-session-yEqFQo5o.js","assets/EmptyState-C_uF9Wyj.js","assets/use-second-ticker-DhbZ0Soz.js","assets/use-second-ticker-GWBt83pd.css","assets/ContextMenu-DmeF1Dvz.js","assets/MenuBottomSheetActionList-3L0HS4Kf.js","assets/useMenuPress-DLG1QOiE.js","assets/ListItem-QF7KFt0h.js","assets/useAdaptivePresentation-Bma4-u1a.js","assets/useFocusReturnVisibility-BHKv5Jwr.js","assets/index-C9rhrCGT.css","assets/trace-patterns-D6TbkLLr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{x as s}from"./fieldParts-B7DYLgh4.js";import{t as c}from"./isRenderable-DHkzpAoQ.js";import{t as l,x as u}from"./Icon-BqkS-pIq.js";import{b as d,d as f,f as p,g as m,h,l as g,n as _,p as v,t as y,u as b}from"./use-trace-records-B1vrKQmA.js";import{t as x}from"./preload-helper-DpV6A1kQ.js";import{n as S,t as C}from"./labels-provider-DkA22zkP.js";import{c as w,n as T,t as E}from"./IconButton-DVUFx-8p.js";import{t as D}from"./createReactComponent-CZwsv6DD.js";import{a as O}from"./ScrollableArea-BHfY7sWH.js";var k=D(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),A=D(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),j=D(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),M=e(i(),1),N=t(),P=(0,M.lazy)(()=>x(()=>import(`./TraceInspector-8-F3jBOY.js`).then(e=>({default:e.TraceGuardrailsBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]))),F=(0,M.lazy)(()=>x(()=>import(`./TraceInspector-8-F3jBOY.js`).then(e=>({default:e.TraceFeedBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]))),I=(0,M.createContext)(`replace`);function L({value:e,children:t}){return(0,N.jsx)(I,{value:e,children:t})}function R({id:e,header:t,traces:n}){return(0,N.jsx)(g,{id:e,header:t,children:e=>(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:e})})})}function z(e,t,n){let r=S(),i=(0,M.useId)(),[a,o]=(0,M.useState)(!1),s=(0,M.use)(I),c={name:r(`@theorem.panel.trace.name`),show:r(`@theorem.panel.trace.show`),hide:r(`@theorem.panel.trace.hide`),resize:r(`@theorem.panel.trace.resize`)};if(e.observability?.record!==!0)return{toggle:null,view:null,labels:c,offered:!1};let u=n??a,d=n===void 0?(0,N.jsx)(p,{labels:c,icon:(0,N.jsx)(l,{icon:O}),panelId:i,open:u,onToggle:()=>o(e=>!e)}):null;return{toggle:d,view:u?B(s===`panel`,i,t,d):null,labels:c,offered:!0}}function B(e,t,n,r){let i=(0,N.jsxs)(f,{floating:!0,children:[(0,N.jsx)(U,{traces:n}),r]});return e?(0,N.jsx)(V,{id:t,header:i,traces:n}):(0,N.jsx)(R,{id:t,header:i,traces:n})}function V({id:e,header:t,traces:n}){let{ref:r,width:i}=m();return(0,N.jsxs)(`div`,{id:e,ref:r,style:{height:`100%`,position:`relative`},children:[t,(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:v(i)})})]})}function H(e){for(let t of e)for(let e of t.spans){let t=e.attributes[`gen_ai.agent.name`];if(typeof t==`string`&&t)return t}return`trace`}function U({traces:e}){let t=S(),n=y(e);if(n.length===0)return null;let r=t(`@theorem.panel.trace.download`);return(0,N.jsx)(E,{label:r,variant:`ghost`,tooltip:r,icon:(0,N.jsx)(l,{icon:j,size:`sm`}),onClick:()=>{let e=new Date().toISOString().replaceAll(`:`,`-`).slice(0,19),t=new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=`${H(n)}-${e}.trace.json`,i.click(),URL.revokeObjectURL(r)}})}function W({inspector:e,children:t}){let n=(0,M.useRef)(null),r=h(n,!1),i=(0,M.useRef)(void 0),a=(0,M.useCallback)(e=>{n.current=e;let t=i.current;typeof t==`function`?t(e):t!=null&&(t.current=e)},[]);if(!(0,M.isValidElement)(t))return(0,N.jsx)(_,{view:e.view,children:t});i.current=t.props.ref;let o=e.view!=null;return(0,M.cloneElement)(t,{ref:a,end:(0,N.jsx)(b,{labels:e.labels,resizable:r.resizable,open:o,children:e.view})})}function G({inspector:e,children:t}){return(0,M.use)(I)===`panel`&&e.offered?(0,N.jsx)(W,{inspector:e,children:t}):(0,N.jsx)(_,{view:e.view,children:t})}function K({records:e,head:t}){return(0,N.jsx)(C,{children:(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(P,{records:e,head:t})})})}var q={info:`info`,warning:`warning`,error:`error`,success:`success`},ee={info:`accent`,warning:`warning`,error:`error`,success:`success`},J={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},Y={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function te(e){return Object.prototype.hasOwnProperty.call(Y,e)}var ne={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function X({status:e,title:t,description:i,icon:f,isDismissable:p=!1,onDismiss:m,dismissLabel:h,endContent:g,container:_=`card`,elevation:v=`none`,collapsible:y=!0,children:b,xstyle:x,className:S,style:C,ref:E,onFocusCapture:D,onPointerDownCapture:O,...k}){let A=u(),[j,P]=(0,M.useState)(!1),F=typeof y==`object`&&y?y:{},{isEnabled:I,isOpen:L,toggle:R}=d({isCollapsible:y!==!1&&{...F,defaultIsOpen:F.defaultIsOpen??!1}}),z=(0,M.useRef)(null),B=(0,M.useId)(),V=q[e],H=ee[e],U=c(b),W=A(`@astryx.banner.dismiss`),G=h??W,K=h??(typeof t==`string`?A(`@astryx.banner.dismissTitled`,{dismiss:W,title:t}):W);if(j)return null;let X=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(z.current=e)},re=e=>{X(e.relatedTarget,e.currentTarget)},ie=e=>{X(document.activeElement,e.currentTarget)},ae=()=>{let e=z.current;P(!0),m?.(),e?.isConnected&&e.focus()},Z=I&&U,oe=c(g)||p||Z,se=c(g)||p,ce=!c(i)&&se,Q=U&&(!I||L),$=_===`card`;return(0,N.jsxs)(`div`,{ref:E,onFocusCapture:s(D,re),onPointerDownCapture:s(O,ie),...o(r(`banner-frame`,{container:_,elevation:v}),n(J.root,ne[v],$&&v!==`none`&&J.rootElevatedCard,x),S,C),...k,children:[(0,N.jsxs)(`div`,{...o(r(`banner`,{container:_,status:e}),n(J.header,ce&&J.headerCentered,te(e)&&Y[e],$&&(Q?J.headerCardWithContent:J.headerCardStandalone))),children:[(0,N.jsx)(`div`,{...c(f)?o(r(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:c(f)?f:V==null?null:(0,N.jsx)(l,{icon:V,size:`md`,color:H,...r(`banner-icon`,{status:e})})}),(0,N.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!c(g)|0],children:[(0,N.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),c(i)&&(0,N.jsx)(`div`,{...o(r(`banner-description`),{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`}),children:i})]}),oe&&(0,N.jsxs)(`div`,{...n(J.endArea,w.inset(a[`--spacing-2`])),children:[g,Z&&(0,N.jsx)(T,{variant:`ghost`,size:`sm`,label:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,N.jsx)(l,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[J.chevron,L&&J.chevronExpanded]}),onClick:R,"aria-expanded":L,"aria-controls":Q?B:void 0,isIconOnly:!0}),p&&(0,N.jsx)(T,{variant:`ghost`,size:`sm`,label:K,tooltip:G,icon:(0,N.jsx)(l,{icon:`close`,size:`sm`,color:`inherit`}),onClick:ae,isIconOnly:!0})]})]}),Q&&(0,N.jsx)(`div`,{id:Z?B:void 0,...o(r(`banner-content`,{container:_,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!$|0]),children:b})]})}X.displayName=`Banner`;export{z as a,G as i,K as n,A as o,L as r,k as s,X as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{c as r,l as i,n as a,t as o}from"./SegmentedControlItem-BBGRPrxp.js";import{t as s}from"./VStack-CkVMcNiK.js";import{n as c,t as l}from"./StackItem-CQviqAfM.js";import{c as u,u as d}from"./browser-transport-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{c as r,l as i,n as a,t as o}from"./SegmentedControlItem-BBGRPrxp.js";import{t as s}from"./VStack-CkVMcNiK.js";import{n as c,t as l}from"./StackItem-CQviqAfM.js";import{c as u,u as d}from"./browser-transport-DPhlVtK9.js";import{p as f}from"./fieldParts-B7DYLgh4.js";import{i as p}from"./useResolvedRequired-DbsOcDqy.js";import{a as m,c as ee,d as te,m as ne,o as h,u as re,v as g}from"./use-trace-records-B1vrKQmA.js";import{t as _}from"./Text-BOqCfzZC.js";import{n as v}from"./labels-provider-DkA22zkP.js";import{n as ie,t as y}from"./Card-DruykyeB.js";import{n as b,t as ae}from"./IconButton-DVUFx-8p.js";import{n as x}from"./ScrollableArea-BHfY7sWH.js";import{i as S}from"./Banner-B8V-qXaP.js";import{a as oe}from"./arrive-DvbqpeRS.js";import{t as se}from"./Center-nHS1JSux.js";import{a as C,o as ce}from"./shaped-data-AVV4e7rW.js";import{n as w}from"./trace-patterns-D6TbkLLr.js";import{E as le,b as T,w as ue,x as E,xt as de,y as fe}from"./index-DTXkdk9F.js";var D=e(n(),1),pe=new Set([`image/png`,`image/jpeg`]),O=`image/png,image/jpeg`;function me(e,t){let n=e.replace(/\.[^.]*$/,``).toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`image`,r=`<${n}>`;for(let e=2;t.includes(r);e+=1)r=`<${n}_${String(e)}>`;return r}async function he(e){if(!pe.has(e.type))return null;let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return{mimeType:e.type,data:btoa(n)}}function k(e){return`data:${e.mimeType};base64,${e.data}`}function A(e,t){return typeof e==`string`?e===t:Array.isArray(e)?e.some(e=>A(e,t)):typeof e==`object`&&e?Object.values(e).some(e=>A(e,t)):!1}function j(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>A(t,e)))}function M(e,t,n){let r=me(e,[...Object.keys(t),...n.map(e=>`<${e}>`)]);return{key:r.slice(1,-1),reference:r}}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){let{images:n,state:r}=t;for(let[i,a]of e){let{key:e,reference:o}=M(i.name,{...t.host,...n},Object.keys(r));n={...n,[o]:a},r={...r,[e]:o}}return{images:n,state:r}}function F(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=Array.isArray(n)?n[Number(e)]:n[e]}return n}function I(e,t,n){let r=n===void 0||n in e?n:F(t,n);if(typeof r==`string`&&r in e)return e[r];let i=Object.values(e);return n===void 0&&i.length===1?i[0]:void 0}function L(e,t,n){return{x:e.left*t,y:e.top*n,width:(e.right-e.left)*t,height:(e.bottom-e.top)*n,line:Math.max(2,Math.round(Math.min(t,n)/200))}}var R=.45;async function ge(e,t,n){let r=new Image;r.src=e,await r.decode();let i=document.createElement(`canvas`);i.width=r.naturalWidth,i.height=r.naturalHeight;let a=i.getContext(`2d`);if(!a)return e;let o=L(t,i.width,i.height);return a.drawImage(r,0,0),a.fillStyle=n.shade,a.globalAlpha=R,a.beginPath(),a.rect(0,0,i.width,i.height),a.rect(o.x,o.y,o.width,o.height),a.fill(`evenodd`),a.globalAlpha=1,a.strokeStyle=n.outline,a.lineWidth=o.line,a.strokeRect(o.x,o.y,o.width,o.height),i.toDataURL(`image/png`)}function _e(e){let t=e.right-e.left,n=e.bottom-e.top;return{width:100/t,height:100/n,left:-e.left/t*100,top:-e.top/n*100}}function ve(e){return e.every(e=>typeof e==`string`)}function z(e){return e==null||typeof e==`string`?``:typeof e==`number`?0:typeof e==`boolean`?!1:Array.isArray(e)?[]:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,z(t)]))}function ye(e){let t=e[0];if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=Object.keys(t);return n.length===0||n.length>4||!e.every(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).join()===n.join()&&Object.values(e).every(e=>typeof e!=`object`||!e))?null:n.map(t=>{let n=e.map(e=>String(e[t]??``).length),r=Math.max(t.length,...n);return{key:t,weight:Math.min(4,Math.max(1,Math.round(r/10)))}})}var B=t();function be(e){return e===null?[]:Array.isArray(e)?e:[e]}function V(){let e=v(),[t,n]=(0,D.useState)(null);return{read:async e=>{n(null);let t=[];for(let r of be(e)){let e=await he(r);e?t.push([r,e]):n(r.name)}return t},status:t===null?void 0:{type:`error`,message:e(`@theorem.decision.image_bad`,{file:t})}}}function xe({onImages:e}){let t=v(),{read:n,status:r}=V();return(0,B.jsx)(T,{label:t(`@theorem.decision.add_image`),isLabelHidden:!0,mode:`dropzone`,isMultiple:!0,accept:O,value:null,placeholder:t(`@theorem.decision.add_image_hint`),status:r,statusVariant:`detached`,onChange:t=>{n(t).then(t=>{t.length>0&&e(t)})}})}var Se={search:()=>[],bootstrap:()=>[]},Ce=48;function H(e,t,n){return Math.min(Math.max(e.split(`
|
|
2
2
|
`).length,t),n)}var U=(0,D.createContext)({images:{},onImages:()=>{}});function we({value:e,label:t,isLabelHidden:n}){let r=v(),{images:i,onImages:a}=(0,D.useContext)(U),{read:o,status:s}=V(),[f,p]=(0,D.useState)(!1),m=Object.hasOwn(i,e)?k(i[e]):void 0;return(0,B.jsxs)(c,{gap:2,vAlign:`center`,children:[(0,B.jsx)(d,{src:m,alt:t,label:e,onClick:m?()=>p(!0):void 0}),m?(0,B.jsx)(u,{isOpen:f,onOpenChange:p,media:{src:m,alt:t,caption:e},hasZoom:!0}):null,(0,B.jsx)(l,{size:`fill`,children:(0,B.jsx)(T,{label:t,isLabelHidden:n,accept:O,value:null,placeholder:r(`@theorem.decision.replace_image`),status:s,statusVariant:`detached`,onChange:t=>{o(t).then(([t])=>{t&&a({...i,[e]:t[1]})})}})})]})}function W({value:e,onChange:t,label:n,isLabelHidden:r}){let{images:i}=(0,D.useContext)(U),[a]=(0,D.useState)(()=>typeof e==`string`&&(e.length>Ce||e.includes(`
|
|
3
3
|
`))),[o]=(0,D.useState)(()=>typeof e==`string`&&Object.hasOwn(i,e));if(o&&typeof e==`string`)return(0,B.jsx)(we,{value:e,label:n,isLabelHidden:r});if(typeof e==`boolean`)return(0,B.jsx)(fe,{label:n,value:e,onChange:t});if(typeof e==`number`)return(0,B.jsx)(le,{label:n,isLabelHidden:r,size:`sm`,value:e,isWheelEnabled:!1,onChange:t});if(e===null)return(0,B.jsx)(x,{label:n,isLabelHidden:r,size:`sm`,value:``,placeholder:`null`,isDisabled:!0,onChange:()=>{}});let s=String(e);return a?(0,B.jsx)(E,{label:n,isLabelHidden:r,size:`sm`,rows:H(s,2,12),value:s,onChange:t}):(0,B.jsx)(x,{label:n,isLabelHidden:r,size:`sm`,value:s,onChange:t})}function G({label:e,isRequired:t,description:n,children:r}){let i=(0,D.useId)();return(0,B.jsxs)(s,{gap:2,role:`group`,"aria-labelledby":i,children:[(0,B.jsx)(p,{label:e,inputID:``,labelID:i,isGroupLabel:!0,isRequired:t,description:n}),r]})}function K({children:e,...t}){return(0,B.jsx)(G,{...t,children:(0,B.jsx)(`div`,{style:{paddingInlineStart:12,borderInlineStart:`1px solid var(--color-border)`},children:e})})}function q({field:e,onAdd:t}){let n=v();return(0,B.jsx)(c,{children:(0,B.jsx)(b,{label:n(`@theorem.decision.add_item`,{field:e}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(de,{size:14}),onClick:t})})}function J({index:e,onRemove:t}){let n=v();return(0,B.jsx)(ae,{label:n(`@theorem.decision.remove_item`,{item:n(`@theorem.data.item`,{index:String(e+1)})}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(f,{size:14}),onClick:t})}function Y({value:e,onChange:t}){return(0,B.jsx)(s,{gap:3,children:Object.entries(e).map(([n,r])=>(0,B.jsx)(X,{label:C(n),value:r,onChange:r=>t({...e,[n]:r})},n))})}function Te({value:e,onChange:t,label:n}){let r=v(),i=oe(e);if(ve(e))return(0,B.jsx)(ue,{label:n,size:`sm`,value:e.map((e,t)=>({id:`${String(t)}:${e}`,label:e})),searchSource:Se,hasCreate:!0,debounceMs:0,placeholder:r(`@theorem.decision.add_value`),onChange:e=>t(e.map(e=>e.label))});let a=ye(e),o=(0,B.jsx)(q,{field:n,onAdd:()=>t([...e,z(e.at(-1))])}),u=n=>(0,B.jsx)(J,{index:n,onRemove:()=>{i.drop(n),t(e.filter((e,t)=>t!==n))}});if(a){let r={display:`grid`,gap:8,alignItems:`start`,gridTemplateColumns:`${a.map(e=>`minmax(0, ${String(e.weight)}fr)`).join(` `)} auto`},s=e;return(0,B.jsxs)(G,{label:n,children:[(0,B.jsxs)(`div`,{style:r,"aria-hidden":!0,children:[a.map(e=>(0,B.jsx)(_,{type:`supporting`,color:`secondary`,maxLines:1,children:C(e.key)},e.key)),(0,B.jsx)(`span`,{style:{width:28}})]}),i.rows.map(({index:e,key:n})=>{let i=s[e];return(0,B.jsxs)(`div`,{style:r,children:[a.map(n=>(0,B.jsx)(W,{label:`${C(n.key)} ${String(e+1)}`,isLabelHidden:!0,value:i[n.key]??null,onChange:r=>t(s.map((t,i)=>i===e?{...t,[n.key]:r}:t))},n.key)),u(e)]},n)}),o]})}return(0,B.jsx)(K,{label:n,children:(0,B.jsxs)(s,{gap:3,children:[i.rows.map(({item:n,index:i,key:a})=>{let o=r(`@theorem.data.item`,{index:String(i+1)}),s=n=>t(e.map((e,t)=>t===i?n:e));return(0,B.jsxs)(c,{gap:2,vAlign:`start`,children:[(0,B.jsx)(l,{size:`fill`,children:ce(n)?(0,B.jsx)(W,{label:o,isLabelHidden:!0,value:n,onChange:s}):(0,B.jsx)(X,{label:o,value:n,onChange:s})}),u(i)]},a)}),o]})})}function X({value:e,onChange:t,label:n}){return Array.isArray(e)?(0,B.jsx)(Te,{label:n,value:e,onChange:t}):typeof e==`object`&&e?(0,B.jsx)(K,{label:n,children:(0,B.jsx)(Y,{value:e,onChange:t})}):(0,B.jsx)(W,{label:n,value:e,onChange:t})}function Ee({value:e,onChange:t,label:n}){return typeof e==`object`&&e&&!Array.isArray(e)?(0,B.jsx)(Y,{value:e,onChange:t}):(0,B.jsx)(X,{label:n,value:e,onChange:t})}var De={"--theorem-console-card":`var(--color-background-muted)`},Z=`(width < 768px)`,Q=(0,D.createContext)(!0);function $(){return(0,D.useSyncExternalStore)(e=>{let t=globalThis.matchMedia(Z);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},()=>globalThis.matchMedia(Z).matches,()=>!1)}function Oe({flush:e,wide:t,maxWidth:n,children:r}){return(0,B.jsx)(s,{height:`100%`,paddingInlineStart:3,style:{...e?De:void 0,paddingInlineEnd:ne(3)},children:(0,B.jsx)(y,{variant:`transparent`,height:`100%`,padding:0,style:e?{overflowY:`auto`}:{...ee,overflowY:`auto`},children:(0,B.jsx)(se,{axis:`horizontal`,width:`100%`,minHeight:`100%`,children:(0,B.jsx)(s,{width:`100%`,maxWidth:t?void 0:n,gap:3,padding:4,children:r})})})})}function ke({inspector:e,maxWidth:t,flush:n=!1,columns:a=!1,requestLabel:o,className:s,style:c,children:l}){let u=(0,D.useRef)(null),d=e.toggle?(0,B.jsx)(te,{floating:!0,children:e.toggle}):void 0;return(0,B.jsx)(S,{inspector:e,children:(0,B.jsx)(i,{ref:u,height:`fill`,className:s,style:{position:`relative`,...c},header:d,content:(0,B.jsx)(r,{padding:0,isScrollable:!1,children:(0,B.jsx)(Ae,{layoutRef:u,flush:n,columns:a,maxWidth:t,requestLabel:o,children:l})})})})}function Ae({layoutRef:e,flush:t,columns:n,maxWidth:r,requestLabel:i,children:a}){let o=$(),s=D.Children.toArray(a).length,c=n&&s>1;return c&&!o?(0,B.jsx)(je,{requestLabel:i,basisWidth:e.current?.clientWidth??0,children:a}):(0,B.jsx)(Oe,{flush:t,wide:c,maxWidth:r,children:a})}function je({requestLabel:e=`Request`,basisWidth:t,children:n}){let a=v(),o=(0,D.useRef)(null),s=g({defaultSize:t>0?Math.round(t*.4):`40%`,minSize:280,maxSize:`70%`,containerRef:o}),[c,l]=D.Children.toArray(n),u={name:e,show:e,hide:e,resize:a(`@theorem.panel.resize`,{name:e})};return(0,B.jsx)(Q,{value:!1,children:(0,B.jsx)(i,{ref:o,height:`fill`,start:(0,B.jsx)(re,{side:`start`,className:`theorem-console-request`,labels:u,resizable:s,open:!0,children:(0,B.jsx)(h,{label:e,children:c})}),content:(0,B.jsx)(r,{padding:0,isScrollable:!1,children:(0,B.jsx)(m,{inset:`beside`,className:`theorem-console-response`,children:l})})})})}function Me({children:e}){return(0,B.jsx)(y,{variant:`muted`,padding:0,className:`theorem-console-card`,style:w,children:(0,B.jsx)(Q,{value:!1,children:e})})}function Ne({label:e,fill:t=!1,children:n}){return(0,D.use)(Q)?(0,B.jsx)(y,{variant:`muted`,padding:t?0:4,className:`theorem-console-card`,style:w,children:t?n:(0,B.jsx)(s,{height:`100%`,gap:3,children:n})}):t?n:(0,B.jsx)(h,{label:e,padding:4,children:n})}function Pe(e){return t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e())}}function Fe({title:e,onRun:t,children:n,...r}){let i=v(),l=(0,D.use)(Q),u=(0,B.jsxs)(s,{gap:3,padding:l?void 0:4,onKeyDown:Pe(t),children:[(0,B.jsxs)(c,{gap:2,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(_,{type:`supporting`,color:`secondary`,as:`h3`,children:e}),r.onView?(0,B.jsxs)(a,{label:i(`@theorem.decision.view`),size:`sm`,value:r.view,onChange:e=>{r.onView(e===`json`?`json`:`fields`)},children:[(0,B.jsx)(o,{value:`fields`,label:i(`@theorem.decision.fields`),isDisabled:!r.hasFields}),(0,B.jsx)(o,{value:`json`,label:i(`@theorem.data.json`)})]}):r.actions]}),n]});return l?(0,B.jsx)(y,{variant:`muted`,padding:4,className:`theorem-console-card`,style:w,children:u}):u}var Ie={"--font-family-body":`var(--font-family-code)`};function Le({label:e,text:t,isInvalid:n,onChange:r}){return(0,B.jsx)(E,{label:e,isLabelHidden:!0,value:t,onChange:r,rows:H(t,8,24),hasSpellCheck:!1,status:n?{type:`error`}:void 0,controlStyle:Ie})}function Re({note:e,isReady:t,isRunning:n,runLabel:r,runningLabel:i,stopLabel:a,onRun:o,onStop:s}){return(0,B.jsxs)(c,{gap:3,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(_,{type:`supporting`,color:`secondary`,style:t?void 0:{color:`var(--color-error)`},hasTabularNumbers:!0,children:e}),(0,B.jsxs)(c,{gap:2,vAlign:`center`,children:[n?(0,B.jsx)(b,{label:a,variant:`ghost`,onClick:s}):null,(0,B.jsx)(b,{label:n?i:r,variant:`primary`,isLoading:n,isDisabled:!t,onClick:o})]})]})}function ze(){let e=ie();return(0,D.useMemo)(()=>{let t=new Intl.NumberFormat(e,{style:`unit`,unit:`byte`,unitDisplay:`narrow`}),n=new Intl.NumberFormat(e,{style:`unit`,unit:`kilobyte`,unitDisplay:`narrow`,maximumFractionDigits:1});return e=>e<1024?t.format(e):n.format(e/1024)},[e])}export{N as S,_e as _,Ne as a,ge as b,q as c,J as d,Ee as f,I as g,xe as h,Fe as i,K as l,H as m,Me as n,Re as o,U as p,Le as r,ze as s,ke as t,G as u,P as v,j as x,k as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MenuBottomSheet-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{y as o}from"./padding.stylex-B76907Zf.js";import{t as s}from"./mergeProps-ptS-gIMz.js";import{n as c,o as l,r as u,s as d,t as f}from"./useLayerDismissal-BAnTRYTt.js";import{_ as p,g as m,h,l as ee,x as g}from"./fieldParts-B7DYLgh4.js";import{t as _}from"./isRenderable-DHkzpAoQ.js";import{b as v,n as y,t as b,x}from"./Icon-BqkS-pIq.js";import{c as S,f as te}from"./useResolvedRequired-DbsOcDqy.js";import{i as C}from"./focusOutline.stylex-BT0kfa4t.js";import{n as ne,r as w}from"./useAnnounce-DTSHZvjg.js";import{a as T,d as E,l as D,n as re}from"./useTooltip-c097gL_-.js";import{r as ie}from"./Text-BOqCfzZC.js";import{t as O}from"./preload-helper-DpV6A1kQ.js";import{n as ae}from"./IconButton-DVUFx-8p.js";import{t as oe}from"./useMediaQuery-BCT0NUeZ.js";import{a as k,c as A,l as se}from"./CheckboxInput-CFZ_Wq8-.js";import{t as ce}from"./useDevWarning-Z9SoixOP.js";import{a as le,i as ue,o as de,r as fe,s as pe,t as me}from"./MenuBottomSheetActionList-3L0HS4Kf.js";import{i as he,n as ge,r as _e,t as ve}from"./useMenuPress-DLG1QOiE.js";import{i as ye,n as be,r as xe}from"./useAdaptivePresentation-Bma4-u1a.js";var j=e(i(),1),Se=o(null);Se.displayName=`DropdownMenuSurfaceContext`;var Ce=o(null);Ce.displayName=`DropdownMenuRootOpenContext`;function we(){return(0,j.use)(Ce)!==!1}var Te=o(null);Te.displayName=`DropdownMenuContext`;function Ee(){return(0,j.use)(Te)}var De=(0,j.createContext)(null);De.displayName=`DropdownMenuRadioGroupContext`;function Oe(e,t){if(t||e.pointerType!==`mouse`)return;let n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus({preventScroll:!0})}var M=t(),N={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz xprvw0a`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0},destructive:{kMwMTN:`xjt36v0`,"--_item-label-color":`xufyqxy`,"--_item-description-color":`xqlix59`,$$css:!0}},ke={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}};function P({icon:e,label:t,description:n,onClick:i,href:a,target:o,rel:c,isDisabled:l=!1,endContent:u,hasCloseOnSelect:d=!0,variant:f=`default`,xstyle:p,className:m,style:h,ref:ee,onPointerMove:_,onAuxClick:v,...b}){let x=Ee(),S=x?.menuSize??`md`,te=ne(),C=(0,j.useCallback)(e=>{l?e.preventDefault():(a!=null&&pe(e)||i?.(e),d&&x?.closeMenu())},[l,a,i,d,x]),T=(0,j.useCallback)(e=>{l?e.preventDefault():a!=null&&e.button===1&&d&&x?.closeMenu()},[l,a,d,x]),E=(0,j.useCallback)(e=>Oe(e,l),[l]),D=f===`destructive`,re=w();return(0,M.jsx)(k,{...b,ref:ee,as:a==null?void 0:re,role:`menuitem`,tabIndex:l?void 0:-1,onPointerMove:g(E,_),...te,startContent:e?y(e,{size:`sm`,color:D?`error`:`secondary`}):void 0,label:t,description:n,endContent:u,onClick:C,onAuxClick:g(T,v),href:a,target:o,rel:c,draggable:a==null&&void 0,isDisabled:l,xstyle:[N.root,ke[S],D&&N.destructive,l&&N.disabled,p],...s(r(`dropdown-menu-item`,{size:S,variant:D?`destructive`:null}),{className:m,style:h})})}P.displayName=`DropdownMenuItem`;var Ae={divider:{kqGvvJ:`xsq74q5`,$$css:!0}},F=r(`dropdown-menu-divider`).className;function I({xstyle:e,className:t,style:n,ref:r,...i}){return(0,M.jsx)(A,{...i,ref:r,xstyle:[Ae.divider,e],className:t?`${F} ${t}`:F,style:n})}I.displayName=`DropdownMenuDivider`;var je=E(),Me=(0,j.createContext)(!1);Me.displayName=`MenuRegionsContext`;function L(e){return e==null?[]:p(e).filter(t=>t.tabIndex>=0&&!R(t,e))}function R(e,t){if(typeof window>`u`||!window.getComputedStyle)return!1;for(let n=e.parentElement;n!=null&&n!==t.parentElement;n=n.parentElement)if(window.getComputedStyle(n).display===`none`)return!0;return!1}function z(e,t,n){let r=new Map,i=e=>e instanceof HTMLInputElement&&e.getAttribute(`type`)===`radio`&&e.name!==``?`${e.form?.id??``}\u0000${e.name}`:null;for(let t of e){let e=i(t);if(e!=null){let n=r.get(e)??[];n.push(t),r.set(e,n)}}let a=new Set,o=[];for(let s of e){let e=i(s);if(e==null){o.push(s);continue}if(a.has(e))continue;a.add(e);let c=r.get(e)??[],l=c.find(e=>e===t)??c.find(e=>e.checked)??(n?c[c.length-1]:c[0]);o.push(l)}return o}function Ne(e){return e.focus(),e.ownerDocument.activeElement===e}function Pe(e,t,n,r,i=!1){if(t==null)return;e.preventDefault(),e.stopPropagation();let a=document.activeElement,o=z([...L(n),t,...L(r)],a,e.shiftKey);if(o.length===1){i&&t.focus();return}let s=o.indexOf(t),c=t.contains(a)?s:o.findIndex(e=>e===a||e.contains(a));c<0&&(c=s);let l=e.shiftKey?-1:1,u=o[(c+l+o.length)%o.length];Ne(u)||t.focus()}var B=500,V=300,Fe=8;function Ie(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}function Le(e,t,n,r){let i=Ie(e,t,n),a=Ie(e,n,r),o=Ie(e,r,t);return!((i<0||a<0||o<0)&&(i>0||a>0||o>0))}function Re(e,t,n){let r=Fe,i,a;if(t.x<=n.left)i={x:n.left,y:n.top-r},a={x:n.left,y:n.bottom+r};else if(t.x>=n.right)i={x:n.right,y:n.top-r},a={x:n.right,y:n.bottom+r};else if(t.y<=n.top)i={x:n.left-r,y:n.top},a={x:n.right+r,y:n.top};else if(t.y>=n.bottom)i={x:n.left-r,y:n.bottom},a={x:n.right+r,y:n.bottom};else return!1;return Le(e,t,i,a)}function ze(e){let{show:t,hide:n,isOpen:r,isEnabled:i,showDelay:a=150,hideDelay:o=200,clickGuardMs:s=B,itemSelector:c,popoverId:l,ownsFocus:d=!0,flyoutRef:f}=e,p=oe(`(hover: hover)`),m=(0,j.useRef)(null),h=(0,j.useRef)(null),g=(0,j.useRef)(null),_=(0,j.useRef)(null),v=(0,j.useRef)(!1),y=(0,j.useRef)(0),b=(0,j.useRef)(0),x=(0,j.useRef)(r),S=(0,j.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null),h.current&&=(clearTimeout(h.current),null),_.current?.(),_.current=null},[]);u(()=>{let e=x.current;x.current=r,e&&!r&&(S(),v.current=!1,b.current=0,y.current=Date.now())},[r,S]);let te=(0,j.useRef)(()=>{}),{listRef:C,handleKeyDown:ne,focusFirst:w}=ee({itemSelector:c,onEscape:()=>te.current()}),T=(0,j.useCallback)(()=>{let e=C.current?.contains(document.activeElement)??!1;n(),e&&g.current?.focus()},[n,C]);(0,j.useEffect)(()=>{te.current=()=>{S(),T()}},[S,T]),(0,j.useEffect)(()=>()=>S(),[S]),(0,j.useEffect)(()=>{i||S()},[i,S]);let E=(0,j.useCallback)(()=>{w()||C.current?.focus()},[w,C]),D=(0,j.useCallback)(()=>{d?(t({skipAutoFocus:!0}),E()):t()},[d,t,E]),re=(0,j.useCallback)(()=>s>0&&b.current>0&&Date.now()-b.current<s&&(v.current=!1,b.current=0,!0),[s]),ie=(0,j.useCallback)(e=>{l&&e?.preventDefault(),S(),e!=null&&e.detail===0?(y.current=0,v.current=!1,b.current=0,r?d&&E():D()):r?re()?d&&E():T():(y.current=0,v.current=!1,b.current=0,D())},[l,S,r,d,re,D,E,T]),O=(0,j.useCallback)(()=>{if(!p||y.current>0&&Date.now()-y.current<V)return;if(r){S();return}v.current=!0,S();let e=()=>{b.current=Date.now(),t({skipAutoFocus:!0})};a>0?m.current=setTimeout(e,a):e()},[p,r,S,t,a]),ae=(0,j.useCallback)(e=>{if(y.current=0,!v.current)return;S();let t=null,i=!1,a=()=>!1,s=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{i&&t!=null&&a(t)?s():n()},o)};s();let c=f?.current??C.current,l=e==null?null:{x:e.clientX,y:e.clientY};if(c==null||l==null||!r)return;let u=c.getBoundingClientRect();if(u.width<=0||u.height<=0)return;let d=c.ownerDocument;a=e=>Re(e,l,u),i=!0,t=l;let p=e=>{let n={x:e.clientX,y:e.clientY};t=n,a(n)?s():(i=!1,_.current?.(),_.current=null)};d.addEventListener(`pointermove`,p,!0),_.current=()=>{d.removeEventListener(`pointermove`,p,!0)}},[S,n,o,r,C,f]),k=(0,j.useCallback)(()=>{S()},[S]),A=(0,j.useCallback)(e=>{g.current=e},[]),se=(0,j.useCallback)(()=>{},[]),ce=(0,j.useCallback)(e=>{},[]),le=(0,j.useCallback)(e=>{},[]);return i?{triggerProps:{onClick:ie,onMouseEnter:O,onMouseLeave:ae,...l?{popoverTarget:l}:null},contentProps:{onMouseEnter:k,onMouseLeave:ae,onKeyDown:ne},menuRef:C,focusFirst:w,focusMenu:E,confirmHoverOpen:re,close:T,setTriggerEl:A}:{triggerProps:{onClick:se,onMouseEnter:se,onMouseLeave:se},contentProps:{onMouseEnter:se,onMouseLeave:se,onKeyDown:le},menuRef:C,focusFirst:w,focusMenu:E,confirmHoverOpen:re,close:T,setTriggerEl:ce}}function Be(e,t){return typeof e==`string`&&m(e)?{property:`inlineSize`,value:e.trim()}:{property:`minWidth`,value:h(e,t)}}`${D.maxBlockSize}`,`${D.maxBlockSizeFallback}`;var Ve={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},open:{kWkggS:`x1lmrjuc`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},He={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},Ue={kzqmXN:`x1uyokj7`,$$css:!0},H={scrollable:{kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kZeWKH:`xish69e`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popoverViewport:{kB7OPa:`x9f619`,kskxy:`x1uh1i8a`,$$css:!0},popover:{k7Eaqz:`x1b27s9g`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:e==null?e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],popoverCustomIntrinsicWidth:e=>[Ue,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]},We={kskxy:`x1jols5v`,$$css:!0},Ge={viewMaxHeight:e=>[We,{"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${D.maxBlockSize})`)}]},Ke={frame:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kaIpWk:`x1n97fys`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,kAzted:`x2lwn1j`,kmVPX3:`x9epnlk`,kI3sdo:`x1a2a7pz`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},hidden:{k1xSpc:`x1s85apg`,$$css:!0}};function qe(e){if(e==null)return;let t=e.ownerDocument,n=e.querySelectorAll(`[aria-expanded="true"][aria-controls]`);for(let e of[...n].reverse()){let n=t.getElementById(e.getAttribute(`aria-controls`)??``);if(n?.getAttribute(`data-astryx-submenu-regions`)!==`flyout`)continue;let r=n.closest(`[popover]`);if(r!=null){if(typeof r.hidePopover==`function`)r.matches(`:popover-open`)&&r.hidePopover();else if(r.style.display===`block`){r.style.display=`none`;let e=new Event(`toggle`,{bubbles:!1});Object.defineProperty(e,"newState",{value:`closed`,configurable:!0}),r.dispatchEvent(e)}}}}function Je(e){let{icon:t,label:i,description:o,isDisabled:c=!1,hasSpinner:u=!1,menuWidth:f,onOpenChange:p,presentation:m=`adaptive`,header:h,footer:ne,children:w,xstyle:E,className:O,style:ae,"data-testid":oe,menuDataTestId:A,ref:se,id:pe,onMouseEnter:me,onMouseLeave:he,onPointerMove:be,onClick:De,onKeyDown:N,...ke}=e,Ae=x(),F=Ee(),I=(0,j.use)(Se),L=(0,j.use)(Me),R=F?.menuSize??`md`,z=!c,Ne=_(h)||_(ne),B=I!=null,V=Ne&&B,Fe=I?.host.getElement()??null;ce(`DropdownMenuSubMenu`,`header and footer show only inside a DropdownMenu; this menu has no place outside its rows for them, so they are not rendered.`,Ne&&!B);let Ie=(0,j.useId)(),Le=(0,j.useRef)(null),Re=(0,j.useRef)(null),Ue=(0,j.useRef)(null),[We,Je]=(0,j.useState)(!1),U=(0,j.useId)(),Ye=(0,j.useId)(),W=pe??Ye,G=(0,j.useRef)(null),Xe=F?.drillIn,K=Xe!=null&&(m===`drill-in`||m===`adaptive`&&Xe.isCompactTouch)?Xe:null,Ze=K!=null,q=(0,j.useId)(),J=K?.viewStack.includes(q)===!0,Y=J&&K?.viewStack.at(-1)===q,X=typeof i==`string`?i:void 0,Qe=F?.menuLabel,$e=Qe==null?Ae(`@astryx.dropdownMenu.back`):Ae(`@astryx.dropdownMenu.backTo`,{parent:Qe}),[et,tt]=(0,j.useState)(!1),nt=Ze?J:et,rt=(0,j.useRef)(!1),it=(0,j.useRef)(!1),Z=T({mode:`context`,lightDismiss:!1,onShow:(0,j.useCallback)(()=>{it.current=!1,tt(!0),p?.(!0)},[p]),onHide:(0,j.useCallback)(()=>{it.current=!1,qe(G.current?.ownerDocument.getElementById(U)??null),tt(!1),p?.(!1)},[p,U])}),at=(0,j.useCallback)(()=>{z&&Z.show()},[z,Z]),ot=(0,j.useCallback)(()=>{V&&rt.current?it.current=!0:Z.hide()},[Z,V]),st=(0,j.useCallback)(()=>{rt.current=!0},[]),ct=(0,j.useCallback)(e=>{if(rt.current=!1,!it.current)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||setTimeout(()=>{!rt.current&&it.current&&G.current?.isConnected===!0&&(it.current=!1,Z.hide())},0)},[Z]),lt=(0,j.useCallback)(()=>{it.current=!1},[]),{listRef:Q,handleKeyDown:ut,focusFirst:dt,focusItem:ft,ownsEvent:pt,getItems:mt}=ee({itemSelector:le,boundarySelector:fe,wrap:!0,hasPaging:!0,onEscape:()=>$({focusTrigger:!0})}),ht=xe(Q,w,nt&&(!Ze||V)),gt=ye({getItemLabels:()=>mt().map(e=>e.textContent),onMatch:ft,getCurrentIndex:()=>mt().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))}),_t=we();S(u&&_t,Ae(`@astryx.spinner.loading`),G);let{triggerProps:vt,contentProps:yt,confirmHoverOpen:bt}=ze({show:at,hide:ot,isOpen:et,isEnabled:z&&!Ze&&_t,flyoutRef:V?Le:Q}),xt=(0,j.useRef)(null),St=(0,j.useRef)(!1),Ct=(0,j.useCallback)(e=>{z&&(K==null?(Z.show(),e?.focusFirst&&(dt()||Q.current?.focus())):(xt.current=e?.focusFirst?`first`:`container`,K.push(q),p?.(!0)))},[z,K,q,p,Z,dt,Q]),$=(0,j.useCallback)(e=>{K==null?(Z.hide(),e?.focusTrigger!==!1&&G.current?.focus()):J&&(St.current=e?.focusTrigger!==!1,K.pop(),p?.(!1))},[K,J,p,Z]);(0,j.useEffect)(()=>{if(!Y||K?.host==null)return;let e=xt.current;if(e==null)return;xt.current=null;let t=mt(),n=e===`first`?t[1]??t[0]:null;n==null?Q.current?.focus({preventScroll:!0}):n.focus({preventScroll:!0})},[Y,K?.host,mt,Q]),(0,j.useEffect)(()=>{!J&&St.current&&(St.current=!1,G.current?.focus({preventScroll:!0}))},[J]);let wt=Z.ref,Tt=(0,j.useCallback)(e=>{G.current=e,wt(e)},[wt]),Et=ie(Tt,se),Dt=(0,j.useCallback)(e=>{if(c)e.preventDefault();else if(Ze){let t=e.detail>0||ge();Ct({focusFirst:!t})}else if(et){if(bt()){dt()||Q.current?.focus();return}$({focusTrigger:!0})}else Ct({focusFirst:!0})},[c,Ze,et,Ct,$,bt,dt,Q]),Ot=(0,j.useCallback)(e=>{g(Dt,De)(e)},[Dt,De]),kt=(0,j.useCallback)(e=>{if(c)return;let t=typeof window<`u`&&G.current&&window.getComputedStyle(G.current).direction===`rtl`?`ArrowLeft`:`ArrowRight`;(e.key===t||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),Ct({focusFirst:!0}))},[c,Ct]),At=(0,j.useCallback)(e=>Oe(e,c),[c]),jt=(0,j.useCallback)(e=>{if(e.key===`Tab`){if(V){Pe(e,Q.current,Re.current,Ue.current,!pt(e));return}if(L){$({focusTrigger:!1});return}}if(!pt(e))return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0});return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&ue.has(t.getAttribute(`role`)??``)&&de(t,e);return}let t=typeof window<`u`&&Q.current&&window.getComputedStyle(Q.current).direction===`rtl`?`ArrowRight`:`ArrowLeft`;e.key===t?(e.preventDefault(),$({focusTrigger:!0})):gt.onKeyDown(e)?e.preventDefault():ut(e)},[pt,$,ut,gt,Q,L,V]),Mt=(0,j.useCallback)(e=>{e.key===`Tab`?Pe(e,Q.current,Re.current,Ue.current):e.key===`Escape`&&!e.defaultPrevented&&!l(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0}))},[Q,$]),Nt=(0,j.useMemo)(()=>({menuSize:R,closeMenu:()=>{$({focusTrigger:!1}),F?.closeMenu()},drillIn:Xe,menuLabel:X}),[R,$,F,Xe,X]),Pt=_e({menuRef:Q,itemSelector:le,onDismiss:Nt.closeMenu}),Ft=u?(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(v,{size:`sm`,"aria-hidden":`true`})}):(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(b,{icon:`chevronRight`,size:`sm`,color:`secondary`,xstyle:te.mirror,...r(`dropdown-menu-indicator-icon`)})}),It=f?Be(f,D.maxInlineSizeFallback):null,Lt=It?It.property===`inlineSize`?H.popoverCustomIntrinsicWidth(It.value):H.popoverCustomWidth(It.value):H.popover,Rt=(0,M.jsx)(Te,{value:Nt,children:(0,M.jsxs)(Se,{value:I,children:[Ze&&(0,M.jsx)(P,{icon:(0,M.jsx)(b,{icon:`chevronLeft`,size:`sm`,color:`secondary`,xstyle:te.mirror}),label:$e,hasCloseOnSelect:!1,onClick:()=>$({focusTrigger:!0})}),w]})}),zt=(0,M.jsx)(Ce,{value:_t&&nt,children:V?(0,M.jsx)(Me,{value:!0,children:Rt}):Rt}),Bt=V&&I!=null?{[ve]:I.ownerId}:void 0,Vt=(e,t,i)=>(0,M.jsxs)(`div`,{ref:Le,id:Ie,role:`dialog`,"aria-modal":`true`,"data-astryx-submenu-regions":i,...t,...i===`flyout`?{onFocus:st,onBlur:ct,onPointerEnter:lt}:void 0,...i===`flyout`?s(r(`dropdown-menu`),{className:`x9f619 x78zum5 xdt5ytf x1uh1i8a x1fcsqxe xgory14 x1n97fys xc0b1yq x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92`}):n(Ke.frame,I?.menuMaxHeight!=null&&Ge.viewMaxHeight(I.menuMaxHeight),t.hidden===!0&&Ke.hidden),children:[_(h)&&(0,M.jsx)(`div`,{ref:Re,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:h}),e,_(ne)&&(0,M.jsx)(`div`,{ref:Ue,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:ne})]}),Ht=e=>V&&Fe!=null?(0,je.createPortal)(e,Fe):e,Ut=e=>{V&&e.target===e.currentTarget&&Je(d()===`keyboard`)},Wt=e=>{V&&e.target===e.currentTarget&&Je(!1)};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(k,{...ke,ref:Et,id:W,role:`menuitem`,tabIndex:c?void 0:-1,"aria-haspopup":V?`dialog`:`menu`,"aria-expanded":nt,"aria-controls":nt?V?Ie:U:void 0,"aria-disabled":c||void 0,"data-testid":oe,onMouseEnter:g(vt.onMouseEnter,me),onMouseLeave:g(vt.onMouseLeave,he),onPointerMove:g(At,be),startContent:t?y(t,{size:`sm`,color:`secondary`}):void 0,label:i,description:o,endContent:Ft,onClick:Ot,onKeyDown:g(kt,N),isDisabled:c,xstyle:[Ve.root,He[R],nt&&Ve.open,c&&Ve.disabled,E],...s(r(`dropdown-menu-item`,{size:R}),{className:O,style:ae})}),K==null?Ht(Z.render(V?Vt((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:0,"aria-labelledby":W,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":A,...Pt.menuProps,...Bt,...n(Ke.menu,ht?H.touchPanYPinchZoom:H.touchPinchZoom,ht&&H.scrollable,We&&C.focusVisible),children:zt}),{"aria-labelledby":W,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave},`flyout`):(0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:ht?0:-1,"aria-labelledby":W,onKeyDown:jt,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave,"data-testid":A,...Pt.menuProps,...s(r(`dropdown-menu`),{0:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261`},2:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e xish69e`},1:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261 x1odjw0f x6ikm8r xish69e`},3:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e x1odjw0f x6ikm8r xish69e`}}[!!ht<<1|!!ht]),children:zt}),{placement:`end`,alignment:`start`,offset:a[`--spacing-1`],xstyle:[H.popoverViewport,Lt,re.end]})):J&&K.host!=null&&(V?(0,je.createPortal)(Vt((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:0,"aria-label":X,"aria-labelledby":X==null?W:void 0,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":A,...Pt.menuProps,...Bt,...n(Ke.menu,ht&&H.scrollable,ht?H.touchPanYPinchZoom:H.touchPinchZoom,We&&C.focusVisible),children:zt}),{"aria-label":X,"aria-labelledby":X==null?W:void 0,hidden:!Y,inert:!Y},`view`),Fe??K.host):(0,je.createPortal)((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:-1,"aria-label":X,"aria-labelledby":X==null?W:void 0,hidden:!Y,inert:!Y,onKeyDown:jt,"data-testid":A,...Pt.menuProps,...{0:{className:`x78zum5 xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o`},1:{className:`xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o x1s85apg`}}[!Y|0],children:zt}),K.host))]})}Je.displayName=`DropdownMenuSubMenu`;function U(e,t){return`item-${e.id??t}`}function Ye(e,t){return`section-${e.id??t}`}function W(e,t){let{items:n,id:r,...i}=e;return(0,M.jsx)(P,{...i},U(e,t))}function G(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];`type`in i&&i.type===`divider`?t.push((0,M.jsx)(I,{},`divider-${n}`)):`type`in i&&i.type===`section`?t.push((0,M.jsxs)(`div`,{role:`group`,"aria-label":i.title,children:[i.title&&(0,M.jsx)(`div`,{"aria-hidden":`true`,...s(r(`dropdown-menu-section-heading`),{className:`xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o`}),children:i.title}),i.items.map(W)]},Ye(i,n))):`type`in i||(i.items&&i.items.length>0?t.push((0,M.jsx)(Je,{icon:i.icon,label:i.label,isDisabled:i.isDisabled,children:G(i.items)},U(i,n))):t.push(W(i,n)))}return t}function Xe(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 768px) and (pointer: coarse)`).matches}function K(e){let[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)([]),[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)(e);s!==e&&(c(e),e?n(Xe()):r.length>0&&i([]));let l=(0,j.useCallback)(e=>{i(t=>t.includes(e)?t:[...t,e])},[]),u=(0,j.useCallback)(()=>{i(e=>e.length===0?e:e.slice(0,-1))},[]),d=(0,j.useMemo)(()=>({isCompactTouch:t,viewStack:r,host:a,push:l,pop:u}),[t,r,a,l,u]),f=r.length>0;return{drillIn:d,isDrilled:f,wrapContent:(0,j.useCallback)(e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{hidden:f,inert:f,...{0:{className:`xjp7ctv`},1:{className:`x1s85apg`}}[!!f|0],children:e}),(0,M.jsx)(`div`,{ref:o,className:`xjp7ctv`})]}),[f])}}var Ze=(0,j.lazy)(async()=>O(()=>import(`./MenuBottomSheet-C4fG_GyZ.js`).then(e=>({default:e.MenuBottomSheet})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]))),q={trigger:{kVAEAm:`x1n2onr6`,k7VYTy:`xpdipgo`,kO7zv1:`x1winvzj`,kfSwDN:`x87ps6o`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kskxy:`xuyqlj2`,kORKVm:`x1odjw0f`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kWkggS:`x1prclbq`,kGVxlE:`x1i5ehqx`,kSiTet:`x1hc1fzr`,k1ekBW:`x19991ni`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,kfSwDN:`x87ps6o`,k7VYTy:`xpdipgo`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popover:{k7Eaqz:`x5w4yej`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}],sheetMenu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzqmXN:`xh8yej3`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kWkggS:`x10xzikg`,kI3sdo:`x1a2a7pz`,kfSwDN:`x87ps6o`,$$css:!0},sheetRootHeading:{keTefX:`x6i7dpz`,$$css:!0},sheetViewHeading:{kI3sdo:`x1a2a7pz`,$$css:!0}};function J(e,t){return e>t-1&&e<=t?Math.max(t-1,0):e}function Y({children:e,menuWidth:t,size:i=`md`,label:a,isDisabled:o=!1,onOpenChange:l,presentation:u=`popover`,triggerAs:d=`div`,ref:p,className:m,style:h,xstyle:g,triggerXstyle:_,onContextMenu:v,onTouchStart:y,onTouchMove:S,onTouchEnd:C,onTouchCancel:ne,"data-testid":w,...E}){let D=x(),O=a??D(`@astryx.contextMenu.label`),oe=D(`@astryx.dropdownMenu.back`),k=be(u)===`bottom-sheet`,{items:A,menuContent:ce,...pe}=E,ge=A??[],ve=ce,Se=(0,j.useId)(),we=(0,j.useRef)({x:0,y:0}),Ee=(0,j.useRef)(null),De=(0,j.useRef)(null),Oe=(0,j.useRef)(null),[N,ke]=(0,j.useState)(!1),[P,Ae]=(0,j.useState)([]),F=P.at(-1),I=F?.items??ge,je=F?.label??O,Me=typeof je==`string`?je:O,L=(0,j.useCallback)(e=>{e||Ae([]),ke(e),l?.(e)},[l]),R=T({mode:`context`,onHide:(0,j.useCallback)(()=>{ke(!1),l?.(!1);let e=Oe.current;Oe.current=null,e&&document.contains(e)&&e.focus()},[l]),onShow:(0,j.useCallback)(()=>{ke(!0),l?.(!0)},[l]),lightDismiss:!1}),z=(0,j.useCallback)(()=>{k?L(!1):R.hide()},[R,L,k]),Ne=(0,j.useCallback)((e,t)=>{e.isDisabled||(e.onClick?.(t),e.hasCloseOnSelect!==!1&&z())},[z]),Pe=(0,j.useCallback)(e=>{e&&N&&P.length>0&&e.focus({preventScroll:!0})},[N,P.length]),{listRef:B,handleKeyDown:V,focusFirst:Fe,focusItem:Ie,ownsEvent:Le,getItems:Re}=ee({itemSelector:le,boundarySelector:fe,wrap:!0,hasPaging:!0});f({isActive:N&&!k,onDismiss:z,getContainer:()=>B.current});let ze=ye({getItemLabels:()=>Re().map(e=>e.textContent),onMatch:Ie,getCurrentIndex:()=>Re().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))});(0,j.useEffect)(()=>{if(!N||k)return;let e=B.current?.getRootNode(),t=e instanceof ShadowRoot?e:null,n=new WeakSet,r=e=>{let t=B.current;n.has(e)||(n.add(e),t&&!t.contains(e.target)&&z())};return document.addEventListener(`mousedown`,r),t?.addEventListener(`mousedown`,r),()=>{document.removeEventListener(`mousedown`,r),t?.removeEventListener(`mousedown`,r)}},[N,z,B,k]);let Be=(0,j.useCallback)(e=>{if(Le(e)){if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&ue.has(t.getAttribute(`role`)??``)&&de(t,e)}else e.key===`Tab`?z():ze.onKeyDown(e)?e.preventDefault():V(e)}},[V,z,ze,Le]),Ve=(0,j.useCallback)((e,t,n)=>{let r=De.current?.getBoundingClientRect(),i=r?J(e,r.width):e,a=r?J(t,r.height):t;we.current={x:i,y:a};let o=Ee.current;o&&(o.style.left=`${i}px`,o.style.top=`${a}px`),Oe.current=document.activeElement instanceof HTMLElement?document.activeElement:n,k?L(!0):(R.show(),requestAnimationFrame(()=>Fe()))},[R,Fe,L,k]),He=(0,j.useCallback)(()=>De.current?.getBoundingClientRect(),[]),Ue=(0,j.useCallback)(e=>{if(o)return;e.preventDefault();let t=He(),n=e.clientX===0&&e.clientY===0&&e.detail===0,r=n||!t?0:e.clientX-t.left,i=n||!t?t?.height??0:e.clientY-t.top;Ve(r,i,e.currentTarget)},[o,Ve,He]),{onTouchStart:H,onTouchMove:We,onTouchEnd:Ge,onTouchCancel:Ke}=he({disabled:o,onLongPress:(0,j.useCallback)(e=>{let t=He();Ve(t?e.x-t.left:e.x,t?e.y-t.top:e.y,De.current)},[Ve,He])}),qe=(0,j.useCallback)(e=>{Ue(e),v?.(e)},[Ue,v]),Je=(0,j.useCallback)(e=>{H(e),y?.(e)},[H,y]),U=(0,j.useCallback)(e=>{We(e),S?.(e)},[We,S]),Ye=(0,j.useCallback)(e=>{Ge(),C?.(e)},[Ge,C]),W=(0,j.useCallback)(e=>{Ke(),ne?.(e)},[Ke,ne]),Xe=t?q.popoverCustomWidth(t):q.popover,{drillIn:Y,wrapContent:X}=K(N&&!k),Qe=(0,j.useMemo)(()=>({closeMenu:z,menuSize:i,drillIn:Y,menuLabel:O}),[z,i,Y,O]),$e=X(A===void 0?ve:G(ge)),et=xe(B,$e,N&&!k),tt=_e({menuRef:B,itemSelector:le,onDismiss:z,isEnabled:!k}),nt=(0,M.jsx)(`div`,{ref:B,id:Se,role:`menu`,"data-autofocus":k?``:void 0,tabIndex:k?0:-1,"aria-label":O,onKeyDown:Be,onContextMenu:e=>e.preventDefault(),...tt.menuProps,...s(r(`context-menu`),n(k?q.sheetMenu:q.menu,!k&&(et?q.touchPanYPinchZoom:q.touchPinchZoom),g),m,h),children:(0,M.jsx)(Te,{value:Qe,children:(0,M.jsx)(Ce,{value:N,children:$e})})}),rt=A===void 0?nt:(0,M.jsxs)(`div`,{ref:B,"data-autofocus":``,tabIndex:0,...s(r(`context-menu`),n(q.sheetMenu,g),m,h),children:[(0,M.jsxs)(`div`,{className:`x78zum5 x1q0g3np x6s0dn4 xzye2dw x1p37lm5`,children:[P.length>0&&(0,M.jsx)(ae,{label:oe,variant:`ghost`,size:`sm`,icon:(0,M.jsx)(b,{icon:`chevronLeft`,size:`sm`,xstyle:te.mirror}),isIconOnly:!0,onClick:()=>Ae(e=>e.slice(0,-1))}),(0,M.jsx)(se,{ref:Pe,level:3,tabIndex:-1,xstyle:[q.sheetViewHeading,P.length===0&&q.sheetRootHeading],children:je})]}),(0,M.jsx)(me,{items:I,onSelect:Ne,onOpenSubmenu:e=>Ae(t=>[...t,e])})]});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(d===`div`?`div`:`span`,{ref:ie(p,De),...pe,onContextMenu:qe,onTouchStart:Je,onTouchMove:U,onTouchEnd:Ye,onTouchCancel:W,"data-testid":w,...n(q.trigger,..._?Array.isArray(_)?_:[_]:[]),children:[e,(0,M.jsx)(`span`,{ref:ie(Ee,R.ref),"aria-hidden":`true`,...s({className:`x10l6tqk x1i1rx1s xjm9jq1 x47corl`},{style:{left:`${we.current.x}px`,top:`${we.current.y}px`}})})]}),k?(0,M.jsx)(j.Suspense,{fallback:null,children:(0,M.jsx)(Ze,{isOpen:N,onOpenChange:L,label:Me,children:rt})}):R.render((0,M.jsx)(c,{children:nt}),{placement:`below`,alignment:`start`,xstyle:[Xe,re.below]})]})}Y.displayName=`ContextMenu`;export{ze as a,Te as c,Be as i,Ce as l,K as n,Pe as o,G as r,Me as s,Y as t,Se as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MenuBottomSheet-Dz3uSt3X.js","assets/themeProps-3IqahpCr.js","assets/rolldown-runtime-hePW80VL.js","assets/BottomSheet-Dbh6A5Vl.js","assets/tokens.stylex-DkHf0P9C.js","assets/padding.stylex-B76907Zf.js","assets/mergeProps-ptS-gIMz.js","assets/useLayerDismissal-BAnTRYTt.js","assets/focusReturn-CTppP2k0.js","assets/focusOutline.stylex-BT0kfa4t.js","assets/useMediaQuery-BCT0NUeZ.js","assets/useScrollLock-Dyf6PHJt.js","assets/useDevWarning-Z9SoixOP.js","assets/devWarning-DxuplmRl.js","assets/useScrollableArea-DuF_pz9m.js","assets/sharedResizeObserver-4U9Xq5Oq.js","assets/focusableSelector-DXZeMU85.js","assets/container.stylex-BmOi-8DQ.js","assets/index-DTXkdk9F.js","assets/SegmentedControlItem-BBGRPrxp.js","assets/VStack-CkVMcNiK.js","assets/StackItem-CQviqAfM.js","assets/fieldParts-B7DYLgh4.js","assets/Icon-BqkS-pIq.js","assets/Text-BOqCfzZC.js","assets/preload-helper-DpV6A1kQ.js","assets/useResolvedRequired-DbsOcDqy.js","assets/useAnnounce-DTSHZvjg.js","assets/Tooltip-BWs5DLrM.js","assets/useTooltip-c097gL_-.js","assets/IconButton-DVUFx-8p.js","assets/createReactComponent-CZwsv6DD.js","assets/isRtlElement-BG33-k_H.js","assets/plainDate-BHiJcj7o.js","assets/browser-transport-DPhlVtK9.js","assets/use-trace-records-B1vrKQmA.js","assets/Card-DruykyeB.js","assets/ScrollableArea-BHfY7sWH.js","assets/IconAlertTriangle-BqAEqqdU.js","assets/Banner-B8V-qXaP.js","assets/isRenderable-DHkzpAoQ.js","assets/labels-provider-DkA22zkP.js","assets/arrive-DvbqpeRS.js","assets/Center-nHS1JSux.js","assets/IconSearch-BTx66a40.js","assets/schemas-BQ9Jydzb.js","assets/tool-schema-DCF2M0n_.js","assets/host-patterns-F-KZIzkF.js","assets/shaped-data-AVV4e7rW.js","assets/reader-BJZH_Cmn.js","assets/live-ingress-OuSlQ6q7.js","assets/trace-schema-9CdEyG6Q.js","assets/stub-BMUhx6B5.js","assets/tree-Cy9xwG_l.js","assets/types-CB42MysU.js","assets/useContainerReveal-BFy8N_QU.js","assets/CheckboxInput-CFZ_Wq8-.js","assets/Dialog-Sd04KQS2.js","assets/chainEventHandlers-C6ttXGfW.js","assets/CodeBlock-CfVOtDeO.js","assets/useClipboard-CbN9bb4J.js","assets/HoverCard-DMyWUvwP.js","assets/IconEye-BB5aY-wQ.js","assets/studio-labels-BqzL7-p0.js","assets/turn-client-mCvAwEgO.js","assets/encode-files-BCf3-Q7y.js","assets/CollapsibleGroup-FIawJRo4.js","assets/crypto-CrMpJY2D.js","assets/workspace-BFrc6kx2.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/studio-session-yEqFQo5o.js","assets/EmptyState-C_uF9Wyj.js","assets/use-second-ticker-DhbZ0Soz.js","assets/use-second-ticker-GWBt83pd.css","assets/MenuBottomSheetActionList-3L0HS4Kf.js","assets/useMenuPress-DLG1QOiE.js","assets/ListItem-QF7KFt0h.js","assets/useAdaptivePresentation-Bma4-u1a.js","assets/useFocusReturnVisibility-BHKv5Jwr.js","assets/index-C9rhrCGT.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{y as o}from"./padding.stylex-B76907Zf.js";import{t as s}from"./mergeProps-ptS-gIMz.js";import{n as c,o as l,r as u,s as d,t as f}from"./useLayerDismissal-BAnTRYTt.js";import{_ as p,g as m,h,l as ee,x as g}from"./fieldParts-B7DYLgh4.js";import{t as _}from"./isRenderable-DHkzpAoQ.js";import{b as v,n as y,t as b,x}from"./Icon-BqkS-pIq.js";import{c as S,f as te}from"./useResolvedRequired-DbsOcDqy.js";import{i as C}from"./focusOutline.stylex-BT0kfa4t.js";import{n as ne,r as w}from"./useAnnounce-DTSHZvjg.js";import{a as T,d as E,l as D,n as re}from"./useTooltip-c097gL_-.js";import{r as ie}from"./Text-BOqCfzZC.js";import{t as O}from"./preload-helper-DpV6A1kQ.js";import{n as ae}from"./IconButton-DVUFx-8p.js";import{t as oe}from"./useMediaQuery-BCT0NUeZ.js";import{a as k,c as A,l as se}from"./CheckboxInput-CFZ_Wq8-.js";import{t as ce}from"./useDevWarning-Z9SoixOP.js";import{a as le,i as ue,o as de,r as fe,s as pe,t as me}from"./MenuBottomSheetActionList-3L0HS4Kf.js";import{i as he,n as ge,r as _e,t as ve}from"./useMenuPress-DLG1QOiE.js";import{i as ye,n as be,r as xe}from"./useAdaptivePresentation-Bma4-u1a.js";var j=e(i(),1),Se=o(null);Se.displayName=`DropdownMenuSurfaceContext`;var Ce=o(null);Ce.displayName=`DropdownMenuRootOpenContext`;function we(){return(0,j.use)(Ce)!==!1}var Te=o(null);Te.displayName=`DropdownMenuContext`;function Ee(){return(0,j.use)(Te)}var De=(0,j.createContext)(null);De.displayName=`DropdownMenuRadioGroupContext`;function Oe(e,t){if(t||e.pointerType!==`mouse`)return;let n=e.currentTarget;n!==n.ownerDocument.activeElement&&n.focus({preventScroll:!0})}var M=t(),N={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz xprvw0a`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0},destructive:{kMwMTN:`xjt36v0`,"--_item-label-color":`xufyqxy`,"--_item-description-color":`xqlix59`,$$css:!0}},ke={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}};function P({icon:e,label:t,description:n,onClick:i,href:a,target:o,rel:c,isDisabled:l=!1,endContent:u,hasCloseOnSelect:d=!0,variant:f=`default`,xstyle:p,className:m,style:h,ref:ee,onPointerMove:_,onAuxClick:v,...b}){let x=Ee(),S=x?.menuSize??`md`,te=ne(),C=(0,j.useCallback)(e=>{l?e.preventDefault():(a!=null&&pe(e)||i?.(e),d&&x?.closeMenu())},[l,a,i,d,x]),T=(0,j.useCallback)(e=>{l?e.preventDefault():a!=null&&e.button===1&&d&&x?.closeMenu()},[l,a,d,x]),E=(0,j.useCallback)(e=>Oe(e,l),[l]),D=f===`destructive`,re=w();return(0,M.jsx)(k,{...b,ref:ee,as:a==null?void 0:re,role:`menuitem`,tabIndex:l?void 0:-1,onPointerMove:g(E,_),...te,startContent:e?y(e,{size:`sm`,color:D?`error`:`secondary`}):void 0,label:t,description:n,endContent:u,onClick:C,onAuxClick:g(T,v),href:a,target:o,rel:c,draggable:a==null&&void 0,isDisabled:l,xstyle:[N.root,ke[S],D&&N.destructive,l&&N.disabled,p],...s(r(`dropdown-menu-item`,{size:S,variant:D?`destructive`:null}),{className:m,style:h})})}P.displayName=`DropdownMenuItem`;var Ae={divider:{kqGvvJ:`xsq74q5`,$$css:!0}},F=r(`dropdown-menu-divider`).className;function I({xstyle:e,className:t,style:n,ref:r,...i}){return(0,M.jsx)(A,{...i,ref:r,xstyle:[Ae.divider,e],className:t?`${F} ${t}`:F,style:n})}I.displayName=`DropdownMenuDivider`;var je=E(),Me=(0,j.createContext)(!1);Me.displayName=`MenuRegionsContext`;function L(e){return e==null?[]:p(e).filter(t=>t.tabIndex>=0&&!R(t,e))}function R(e,t){if(typeof window>`u`||!window.getComputedStyle)return!1;for(let n=e.parentElement;n!=null&&n!==t.parentElement;n=n.parentElement)if(window.getComputedStyle(n).display===`none`)return!0;return!1}function z(e,t,n){let r=new Map,i=e=>e instanceof HTMLInputElement&&e.getAttribute(`type`)===`radio`&&e.name!==``?`${e.form?.id??``}\u0000${e.name}`:null;for(let t of e){let e=i(t);if(e!=null){let n=r.get(e)??[];n.push(t),r.set(e,n)}}let a=new Set,o=[];for(let s of e){let e=i(s);if(e==null){o.push(s);continue}if(a.has(e))continue;a.add(e);let c=r.get(e)??[],l=c.find(e=>e===t)??c.find(e=>e.checked)??(n?c[c.length-1]:c[0]);o.push(l)}return o}function Ne(e){return e.focus(),e.ownerDocument.activeElement===e}function Pe(e,t,n,r,i=!1){if(t==null)return;e.preventDefault(),e.stopPropagation();let a=document.activeElement,o=z([...L(n),t,...L(r)],a,e.shiftKey);if(o.length===1){i&&t.focus();return}let s=o.indexOf(t),c=t.contains(a)?s:o.findIndex(e=>e===a||e.contains(a));c<0&&(c=s);let l=e.shiftKey?-1:1,u=o[(c+l+o.length)%o.length];Ne(u)||t.focus()}var B=500,V=300,Fe=8;function Ie(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}function Le(e,t,n,r){let i=Ie(e,t,n),a=Ie(e,n,r),o=Ie(e,r,t);return!((i<0||a<0||o<0)&&(i>0||a>0||o>0))}function Re(e,t,n){let r=Fe,i,a;if(t.x<=n.left)i={x:n.left,y:n.top-r},a={x:n.left,y:n.bottom+r};else if(t.x>=n.right)i={x:n.right,y:n.top-r},a={x:n.right,y:n.bottom+r};else if(t.y<=n.top)i={x:n.left-r,y:n.top},a={x:n.right+r,y:n.top};else if(t.y>=n.bottom)i={x:n.left-r,y:n.bottom},a={x:n.right+r,y:n.bottom};else return!1;return Le(e,t,i,a)}function ze(e){let{show:t,hide:n,isOpen:r,isEnabled:i,showDelay:a=150,hideDelay:o=200,clickGuardMs:s=B,itemSelector:c,popoverId:l,ownsFocus:d=!0,flyoutRef:f}=e,p=oe(`(hover: hover)`),m=(0,j.useRef)(null),h=(0,j.useRef)(null),g=(0,j.useRef)(null),_=(0,j.useRef)(null),v=(0,j.useRef)(!1),y=(0,j.useRef)(0),b=(0,j.useRef)(0),x=(0,j.useRef)(r),S=(0,j.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null),h.current&&=(clearTimeout(h.current),null),_.current?.(),_.current=null},[]);u(()=>{let e=x.current;x.current=r,e&&!r&&(S(),v.current=!1,b.current=0,y.current=Date.now())},[r,S]);let te=(0,j.useRef)(()=>{}),{listRef:C,handleKeyDown:ne,focusFirst:w}=ee({itemSelector:c,onEscape:()=>te.current()}),T=(0,j.useCallback)(()=>{let e=C.current?.contains(document.activeElement)??!1;n(),e&&g.current?.focus()},[n,C]);(0,j.useEffect)(()=>{te.current=()=>{S(),T()}},[S,T]),(0,j.useEffect)(()=>()=>S(),[S]),(0,j.useEffect)(()=>{i||S()},[i,S]);let E=(0,j.useCallback)(()=>{w()||C.current?.focus()},[w,C]),D=(0,j.useCallback)(()=>{d?(t({skipAutoFocus:!0}),E()):t()},[d,t,E]),re=(0,j.useCallback)(()=>s>0&&b.current>0&&Date.now()-b.current<s&&(v.current=!1,b.current=0,!0),[s]),ie=(0,j.useCallback)(e=>{l&&e?.preventDefault(),S(),e!=null&&e.detail===0?(y.current=0,v.current=!1,b.current=0,r?d&&E():D()):r?re()?d&&E():T():(y.current=0,v.current=!1,b.current=0,D())},[l,S,r,d,re,D,E,T]),O=(0,j.useCallback)(()=>{if(!p||y.current>0&&Date.now()-y.current<V)return;if(r){S();return}v.current=!0,S();let e=()=>{b.current=Date.now(),t({skipAutoFocus:!0})};a>0?m.current=setTimeout(e,a):e()},[p,r,S,t,a]),ae=(0,j.useCallback)(e=>{if(y.current=0,!v.current)return;S();let t=null,i=!1,a=()=>!1,s=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{i&&t!=null&&a(t)?s():n()},o)};s();let c=f?.current??C.current,l=e==null?null:{x:e.clientX,y:e.clientY};if(c==null||l==null||!r)return;let u=c.getBoundingClientRect();if(u.width<=0||u.height<=0)return;let d=c.ownerDocument;a=e=>Re(e,l,u),i=!0,t=l;let p=e=>{let n={x:e.clientX,y:e.clientY};t=n,a(n)?s():(i=!1,_.current?.(),_.current=null)};d.addEventListener(`pointermove`,p,!0),_.current=()=>{d.removeEventListener(`pointermove`,p,!0)}},[S,n,o,r,C,f]),k=(0,j.useCallback)(()=>{S()},[S]),A=(0,j.useCallback)(e=>{g.current=e},[]),se=(0,j.useCallback)(()=>{},[]),ce=(0,j.useCallback)(e=>{},[]),le=(0,j.useCallback)(e=>{},[]);return i?{triggerProps:{onClick:ie,onMouseEnter:O,onMouseLeave:ae,...l?{popoverTarget:l}:null},contentProps:{onMouseEnter:k,onMouseLeave:ae,onKeyDown:ne},menuRef:C,focusFirst:w,focusMenu:E,confirmHoverOpen:re,close:T,setTriggerEl:A}:{triggerProps:{onClick:se,onMouseEnter:se,onMouseLeave:se},contentProps:{onMouseEnter:se,onMouseLeave:se,onKeyDown:le},menuRef:C,focusFirst:w,focusMenu:E,confirmHoverOpen:re,close:T,setTriggerEl:ce}}function Be(e,t){return typeof e==`string`&&m(e)?{property:`inlineSize`,value:e.trim()}:{property:`minWidth`,value:h(e,t)}}`${D.maxBlockSize}`,`${D.maxBlockSizeFallback}`;var Ve={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kaIpWk:`x1ws5lxm`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1c52tdz`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},open:{kWkggS:`x1lmrjuc`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},He={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},Ue={kzqmXN:`x1uyokj7`,$$css:!0},H={scrollable:{kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kZeWKH:`xish69e`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popoverViewport:{kB7OPa:`x9f619`,kskxy:`x1uh1i8a`,$$css:!0},popover:{k7Eaqz:`x1b27s9g`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:e==null?e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],popoverCustomIntrinsicWidth:e=>[Ue,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]},We={kskxy:`x1jols5v`,$$css:!0},Ge={viewMaxHeight:e=>[We,{"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${D.maxBlockSize})`)}]},Ke={frame:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kaIpWk:`x1n97fys`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,kAzted:`x2lwn1j`,kmVPX3:`x9epnlk`,kI3sdo:`x1a2a7pz`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},hidden:{k1xSpc:`x1s85apg`,$$css:!0}};function qe(e){if(e==null)return;let t=e.ownerDocument,n=e.querySelectorAll(`[aria-expanded="true"][aria-controls]`);for(let e of[...n].reverse()){let n=t.getElementById(e.getAttribute(`aria-controls`)??``);if(n?.getAttribute(`data-astryx-submenu-regions`)!==`flyout`)continue;let r=n.closest(`[popover]`);if(r!=null){if(typeof r.hidePopover==`function`)r.matches(`:popover-open`)&&r.hidePopover();else if(r.style.display===`block`){r.style.display=`none`;let e=new Event(`toggle`,{bubbles:!1});Object.defineProperty(e,"newState",{value:`closed`,configurable:!0}),r.dispatchEvent(e)}}}}function Je(e){let{icon:t,label:i,description:o,isDisabled:c=!1,hasSpinner:u=!1,menuWidth:f,onOpenChange:p,presentation:m=`adaptive`,header:h,footer:ne,children:w,xstyle:E,className:O,style:ae,"data-testid":oe,menuDataTestId:A,ref:se,id:pe,onMouseEnter:me,onMouseLeave:he,onPointerMove:be,onClick:De,onKeyDown:N,...ke}=e,Ae=x(),F=Ee(),I=(0,j.use)(Se),L=(0,j.use)(Me),R=F?.menuSize??`md`,z=!c,Ne=_(h)||_(ne),B=I!=null,V=Ne&&B,Fe=I?.host.getElement()??null;ce(`DropdownMenuSubMenu`,`header and footer show only inside a DropdownMenu; this menu has no place outside its rows for them, so they are not rendered.`,Ne&&!B);let Ie=(0,j.useId)(),Le=(0,j.useRef)(null),Re=(0,j.useRef)(null),Ue=(0,j.useRef)(null),[We,Je]=(0,j.useState)(!1),U=(0,j.useId)(),Ye=(0,j.useId)(),W=pe??Ye,G=(0,j.useRef)(null),Xe=F?.drillIn,K=Xe!=null&&(m===`drill-in`||m===`adaptive`&&Xe.isCompactTouch)?Xe:null,Ze=K!=null,q=(0,j.useId)(),J=K?.viewStack.includes(q)===!0,Y=J&&K?.viewStack.at(-1)===q,X=typeof i==`string`?i:void 0,Qe=F?.menuLabel,$e=Qe==null?Ae(`@astryx.dropdownMenu.back`):Ae(`@astryx.dropdownMenu.backTo`,{parent:Qe}),[et,tt]=(0,j.useState)(!1),nt=Ze?J:et,rt=(0,j.useRef)(!1),it=(0,j.useRef)(!1),Z=T({mode:`context`,lightDismiss:!1,onShow:(0,j.useCallback)(()=>{it.current=!1,tt(!0),p?.(!0)},[p]),onHide:(0,j.useCallback)(()=>{it.current=!1,qe(G.current?.ownerDocument.getElementById(U)??null),tt(!1),p?.(!1)},[p,U])}),at=(0,j.useCallback)(()=>{z&&Z.show()},[z,Z]),ot=(0,j.useCallback)(()=>{V&&rt.current?it.current=!0:Z.hide()},[Z,V]),st=(0,j.useCallback)(()=>{rt.current=!0},[]),ct=(0,j.useCallback)(e=>{if(rt.current=!1,!it.current)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||setTimeout(()=>{!rt.current&&it.current&&G.current?.isConnected===!0&&(it.current=!1,Z.hide())},0)},[Z]),lt=(0,j.useCallback)(()=>{it.current=!1},[]),{listRef:Q,handleKeyDown:ut,focusFirst:dt,focusItem:ft,ownsEvent:pt,getItems:mt}=ee({itemSelector:le,boundarySelector:fe,wrap:!0,hasPaging:!0,onEscape:()=>$({focusTrigger:!0})}),ht=xe(Q,w,nt&&(!Ze||V)),gt=ye({getItemLabels:()=>mt().map(e=>e.textContent),onMatch:ft,getCurrentIndex:()=>mt().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))}),_t=we();S(u&&_t,Ae(`@astryx.spinner.loading`),G);let{triggerProps:vt,contentProps:yt,confirmHoverOpen:bt}=ze({show:at,hide:ot,isOpen:et,isEnabled:z&&!Ze&&_t,flyoutRef:V?Le:Q}),xt=(0,j.useRef)(null),St=(0,j.useRef)(!1),Ct=(0,j.useCallback)(e=>{z&&(K==null?(Z.show(),e?.focusFirst&&(dt()||Q.current?.focus())):(xt.current=e?.focusFirst?`first`:`container`,K.push(q),p?.(!0)))},[z,K,q,p,Z,dt,Q]),$=(0,j.useCallback)(e=>{K==null?(Z.hide(),e?.focusTrigger!==!1&&G.current?.focus()):J&&(St.current=e?.focusTrigger!==!1,K.pop(),p?.(!1))},[K,J,p,Z]);(0,j.useEffect)(()=>{if(!Y||K?.host==null)return;let e=xt.current;if(e==null)return;xt.current=null;let t=mt(),n=e===`first`?t[1]??t[0]:null;n==null?Q.current?.focus({preventScroll:!0}):n.focus({preventScroll:!0})},[Y,K?.host,mt,Q]),(0,j.useEffect)(()=>{!J&&St.current&&(St.current=!1,G.current?.focus({preventScroll:!0}))},[J]);let wt=Z.ref,Tt=(0,j.useCallback)(e=>{G.current=e,wt(e)},[wt]),Et=ie(Tt,se),Dt=(0,j.useCallback)(e=>{if(c)e.preventDefault();else if(Ze){let t=e.detail>0||ge();Ct({focusFirst:!t})}else if(et){if(bt()){dt()||Q.current?.focus();return}$({focusTrigger:!0})}else Ct({focusFirst:!0})},[c,Ze,et,Ct,$,bt,dt,Q]),Ot=(0,j.useCallback)(e=>{g(Dt,De)(e)},[Dt,De]),kt=(0,j.useCallback)(e=>{if(c)return;let t=typeof window<`u`&&G.current&&window.getComputedStyle(G.current).direction===`rtl`?`ArrowLeft`:`ArrowRight`;(e.key===t||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),Ct({focusFirst:!0}))},[c,Ct]),At=(0,j.useCallback)(e=>Oe(e,c),[c]),jt=(0,j.useCallback)(e=>{if(e.key===`Tab`){if(V){Pe(e,Q.current,Re.current,Ue.current,!pt(e));return}if(L){$({focusTrigger:!1});return}}if(!pt(e))return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0});return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&ue.has(t.getAttribute(`role`)??``)&&de(t,e);return}let t=typeof window<`u`&&Q.current&&window.getComputedStyle(Q.current).direction===`rtl`?`ArrowRight`:`ArrowLeft`;e.key===t?(e.preventDefault(),$({focusTrigger:!0})):gt.onKeyDown(e)?e.preventDefault():ut(e)},[pt,$,ut,gt,Q,L,V]),Mt=(0,j.useCallback)(e=>{e.key===`Tab`?Pe(e,Q.current,Re.current,Ue.current):e.key===`Escape`&&!e.defaultPrevented&&!l(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),$({focusTrigger:!0}))},[Q,$]),Nt=(0,j.useMemo)(()=>({menuSize:R,closeMenu:()=>{$({focusTrigger:!1}),F?.closeMenu()},drillIn:Xe,menuLabel:X}),[R,$,F,Xe,X]),Pt=_e({menuRef:Q,itemSelector:le,onDismiss:Nt.closeMenu}),Ft=u?(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(v,{size:`sm`,"aria-hidden":`true`})}):(0,M.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,M.jsx)(b,{icon:`chevronRight`,size:`sm`,color:`secondary`,xstyle:te.mirror,...r(`dropdown-menu-indicator-icon`)})}),It=f?Be(f,D.maxInlineSizeFallback):null,Lt=It?It.property===`inlineSize`?H.popoverCustomIntrinsicWidth(It.value):H.popoverCustomWidth(It.value):H.popover,Rt=(0,M.jsx)(Te,{value:Nt,children:(0,M.jsxs)(Se,{value:I,children:[Ze&&(0,M.jsx)(P,{icon:(0,M.jsx)(b,{icon:`chevronLeft`,size:`sm`,color:`secondary`,xstyle:te.mirror}),label:$e,hasCloseOnSelect:!1,onClick:()=>$({focusTrigger:!0})}),w]})}),zt=(0,M.jsx)(Ce,{value:_t&&nt,children:V?(0,M.jsx)(Me,{value:!0,children:Rt}):Rt}),Bt=V&&I!=null?{[ve]:I.ownerId}:void 0,Vt=(e,t,i)=>(0,M.jsxs)(`div`,{ref:Le,id:Ie,role:`dialog`,"aria-modal":`true`,"data-astryx-submenu-regions":i,...t,...i===`flyout`?{onFocus:st,onBlur:ct,onPointerEnter:lt}:void 0,...i===`flyout`?s(r(`dropdown-menu`),{className:`x9f619 x78zum5 xdt5ytf x1uh1i8a x1fcsqxe xgory14 x1n97fys xc0b1yq x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92`}):n(Ke.frame,I?.menuMaxHeight!=null&&Ge.viewMaxHeight(I.menuMaxHeight),t.hidden===!0&&Ke.hidden),children:[_(h)&&(0,M.jsx)(`div`,{ref:Re,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:h}),e,_(ne)&&(0,M.jsx)(`div`,{ref:Ue,onKeyDown:Mt,className:`x2lah0s x9epnlk`,children:ne})]}),Ht=e=>V&&Fe!=null?(0,je.createPortal)(e,Fe):e,Ut=e=>{V&&e.target===e.currentTarget&&Je(d()===`keyboard`)},Wt=e=>{V&&e.target===e.currentTarget&&Je(!1)};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(k,{...ke,ref:Et,id:W,role:`menuitem`,tabIndex:c?void 0:-1,"aria-haspopup":V?`dialog`:`menu`,"aria-expanded":nt,"aria-controls":nt?V?Ie:U:void 0,"aria-disabled":c||void 0,"data-testid":oe,onMouseEnter:g(vt.onMouseEnter,me),onMouseLeave:g(vt.onMouseLeave,he),onPointerMove:g(At,be),startContent:t?y(t,{size:`sm`,color:`secondary`}):void 0,label:i,description:o,endContent:Ft,onClick:Ot,onKeyDown:g(kt,N),isDisabled:c,xstyle:[Ve.root,He[R],nt&&Ve.open,c&&Ve.disabled,E],...s(r(`dropdown-menu-item`,{size:R}),{className:O,style:ae})}),K==null?Ht(Z.render(V?Vt((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:0,"aria-labelledby":W,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":A,...Pt.menuProps,...Bt,...n(Ke.menu,ht?H.touchPanYPinchZoom:H.touchPinchZoom,ht&&H.scrollable,We&&C.focusVisible),children:zt}),{"aria-labelledby":W,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave},`flyout`):(0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:ht?0:-1,"aria-labelledby":W,onKeyDown:jt,onMouseEnter:yt.onMouseEnter,onMouseLeave:yt.onMouseLeave,"data-testid":A,...Pt.menuProps,...s(r(`dropdown-menu`),{0:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261`},2:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e xish69e`},1:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261 x1odjw0f x6ikm8r xish69e`},3:{className:`x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e x1odjw0f x6ikm8r xish69e`}}[!!ht<<1|!!ht]),children:zt}),{placement:`end`,alignment:`start`,offset:a[`--spacing-1`],xstyle:[H.popoverViewport,Lt,re.end]})):J&&K.host!=null&&(V?(0,je.createPortal)(Vt((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:0,"aria-label":X,"aria-labelledby":X==null?W:void 0,onKeyDown:jt,onFocus:Ut,onBlur:Wt,"data-testid":A,...Pt.menuProps,...Bt,...n(Ke.menu,ht&&H.scrollable,ht?H.touchPanYPinchZoom:H.touchPinchZoom,We&&C.focusVisible),children:zt}),{"aria-label":X,"aria-labelledby":X==null?W:void 0,hidden:!Y,inert:!Y},`view`),Fe??K.host):(0,je.createPortal)((0,M.jsx)(`div`,{ref:Q,id:U,role:`menu`,tabIndex:-1,"aria-label":X,"aria-labelledby":X==null?W:void 0,hidden:!Y,inert:!Y,onKeyDown:jt,"data-testid":A,...Pt.menuProps,...{0:{className:`x78zum5 xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o`},1:{className:`xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o x1s85apg`}}[!Y|0],children:zt}),K.host))]})}Je.displayName=`DropdownMenuSubMenu`;function U(e,t){return`item-${e.id??t}`}function Ye(e,t){return`section-${e.id??t}`}function W(e,t){let{items:n,id:r,...i}=e;return(0,M.jsx)(P,{...i},U(e,t))}function G(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];`type`in i&&i.type===`divider`?t.push((0,M.jsx)(I,{},`divider-${n}`)):`type`in i&&i.type===`section`?t.push((0,M.jsxs)(`div`,{role:`group`,"aria-label":i.title,children:[i.title&&(0,M.jsx)(`div`,{"aria-hidden":`true`,...s(r(`dropdown-menu-section-heading`),{className:`xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o`}),children:i.title}),i.items.map(W)]},Ye(i,n))):`type`in i||(i.items&&i.items.length>0?t.push((0,M.jsx)(Je,{icon:i.icon,label:i.label,isDisabled:i.isDisabled,children:G(i.items)},U(i,n))):t.push(W(i,n)))}return t}function Xe(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(max-width: 768px) and (pointer: coarse)`).matches}function K(e){let[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)([]),[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)(e);s!==e&&(c(e),e?n(Xe()):r.length>0&&i([]));let l=(0,j.useCallback)(e=>{i(t=>t.includes(e)?t:[...t,e])},[]),u=(0,j.useCallback)(()=>{i(e=>e.length===0?e:e.slice(0,-1))},[]),d=(0,j.useMemo)(()=>({isCompactTouch:t,viewStack:r,host:a,push:l,pop:u}),[t,r,a,l,u]),f=r.length>0;return{drillIn:d,isDrilled:f,wrapContent:(0,j.useCallback)(e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{hidden:f,inert:f,...{0:{className:`xjp7ctv`},1:{className:`x1s85apg`}}[!!f|0],children:e}),(0,M.jsx)(`div`,{ref:o,className:`xjp7ctv`})]}),[f])}}var Ze=(0,j.lazy)(async()=>O(()=>import(`./MenuBottomSheet-Dz3uSt3X.js`).then(e=>({default:e.MenuBottomSheet})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]))),q={trigger:{kVAEAm:`x1n2onr6`,k7VYTy:`xpdipgo`,kO7zv1:`x1winvzj`,kfSwDN:`x87ps6o`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kskxy:`xuyqlj2`,kORKVm:`x1odjw0f`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kWkggS:`x1prclbq`,kGVxlE:`x1i5ehqx`,kSiTet:`x1hc1fzr`,k1ekBW:`x19991ni`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,kfSwDN:`x87ps6o`,k7VYTy:`xpdipgo`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popover:{k7Eaqz:`x5w4yej`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}],sheetMenu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzqmXN:`xh8yej3`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kWkggS:`x10xzikg`,kI3sdo:`x1a2a7pz`,kfSwDN:`x87ps6o`,$$css:!0},sheetRootHeading:{keTefX:`x6i7dpz`,$$css:!0},sheetViewHeading:{kI3sdo:`x1a2a7pz`,$$css:!0}};function J(e,t){return e>t-1&&e<=t?Math.max(t-1,0):e}function Y({children:e,menuWidth:t,size:i=`md`,label:a,isDisabled:o=!1,onOpenChange:l,presentation:u=`popover`,triggerAs:d=`div`,ref:p,className:m,style:h,xstyle:g,triggerXstyle:_,onContextMenu:v,onTouchStart:y,onTouchMove:S,onTouchEnd:C,onTouchCancel:ne,"data-testid":w,...E}){let D=x(),O=a??D(`@astryx.contextMenu.label`),oe=D(`@astryx.dropdownMenu.back`),k=be(u)===`bottom-sheet`,{items:A,menuContent:ce,...pe}=E,ge=A??[],ve=ce,Se=(0,j.useId)(),we=(0,j.useRef)({x:0,y:0}),Ee=(0,j.useRef)(null),De=(0,j.useRef)(null),Oe=(0,j.useRef)(null),[N,ke]=(0,j.useState)(!1),[P,Ae]=(0,j.useState)([]),F=P.at(-1),I=F?.items??ge,je=F?.label??O,Me=typeof je==`string`?je:O,L=(0,j.useCallback)(e=>{e||Ae([]),ke(e),l?.(e)},[l]),R=T({mode:`context`,onHide:(0,j.useCallback)(()=>{ke(!1),l?.(!1);let e=Oe.current;Oe.current=null,e&&document.contains(e)&&e.focus()},[l]),onShow:(0,j.useCallback)(()=>{ke(!0),l?.(!0)},[l]),lightDismiss:!1}),z=(0,j.useCallback)(()=>{k?L(!1):R.hide()},[R,L,k]),Ne=(0,j.useCallback)((e,t)=>{e.isDisabled||(e.onClick?.(t),e.hasCloseOnSelect!==!1&&z())},[z]),Pe=(0,j.useCallback)(e=>{e&&N&&P.length>0&&e.focus({preventScroll:!0})},[N,P.length]),{listRef:B,handleKeyDown:V,focusFirst:Fe,focusItem:Ie,ownsEvent:Le,getItems:Re}=ee({itemSelector:le,boundarySelector:fe,wrap:!0,hasPaging:!0});f({isActive:N&&!k,onDismiss:z,getContainer:()=>B.current});let ze=ye({getItemLabels:()=>Re().map(e=>e.textContent),onMatch:Ie,getCurrentIndex:()=>Re().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))});(0,j.useEffect)(()=>{if(!N||k)return;let e=B.current?.getRootNode(),t=e instanceof ShadowRoot?e:null,n=new WeakSet,r=e=>{let t=B.current;n.has(e)||(n.add(e),t&&!t.contains(e.target)&&z())};return document.addEventListener(`mousedown`,r),t?.addEventListener(`mousedown`,r),()=>{document.removeEventListener(`mousedown`,r),t?.removeEventListener(`mousedown`,r)}},[N,z,B,k]);let Be=(0,j.useCallback)(e=>{if(Le(e)){if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&ue.has(t.getAttribute(`role`)??``)&&de(t,e)}else e.key===`Tab`?z():ze.onKeyDown(e)?e.preventDefault():V(e)}},[V,z,ze,Le]),Ve=(0,j.useCallback)((e,t,n)=>{let r=De.current?.getBoundingClientRect(),i=r?J(e,r.width):e,a=r?J(t,r.height):t;we.current={x:i,y:a};let o=Ee.current;o&&(o.style.left=`${i}px`,o.style.top=`${a}px`),Oe.current=document.activeElement instanceof HTMLElement?document.activeElement:n,k?L(!0):(R.show(),requestAnimationFrame(()=>Fe()))},[R,Fe,L,k]),He=(0,j.useCallback)(()=>De.current?.getBoundingClientRect(),[]),Ue=(0,j.useCallback)(e=>{if(o)return;e.preventDefault();let t=He(),n=e.clientX===0&&e.clientY===0&&e.detail===0,r=n||!t?0:e.clientX-t.left,i=n||!t?t?.height??0:e.clientY-t.top;Ve(r,i,e.currentTarget)},[o,Ve,He]),{onTouchStart:H,onTouchMove:We,onTouchEnd:Ge,onTouchCancel:Ke}=he({disabled:o,onLongPress:(0,j.useCallback)(e=>{let t=He();Ve(t?e.x-t.left:e.x,t?e.y-t.top:e.y,De.current)},[Ve,He])}),qe=(0,j.useCallback)(e=>{Ue(e),v?.(e)},[Ue,v]),Je=(0,j.useCallback)(e=>{H(e),y?.(e)},[H,y]),U=(0,j.useCallback)(e=>{We(e),S?.(e)},[We,S]),Ye=(0,j.useCallback)(e=>{Ge(),C?.(e)},[Ge,C]),W=(0,j.useCallback)(e=>{Ke(),ne?.(e)},[Ke,ne]),Xe=t?q.popoverCustomWidth(t):q.popover,{drillIn:Y,wrapContent:X}=K(N&&!k),Qe=(0,j.useMemo)(()=>({closeMenu:z,menuSize:i,drillIn:Y,menuLabel:O}),[z,i,Y,O]),$e=X(A===void 0?ve:G(ge)),et=xe(B,$e,N&&!k),tt=_e({menuRef:B,itemSelector:le,onDismiss:z,isEnabled:!k}),nt=(0,M.jsx)(`div`,{ref:B,id:Se,role:`menu`,"data-autofocus":k?``:void 0,tabIndex:k?0:-1,"aria-label":O,onKeyDown:Be,onContextMenu:e=>e.preventDefault(),...tt.menuProps,...s(r(`context-menu`),n(k?q.sheetMenu:q.menu,!k&&(et?q.touchPanYPinchZoom:q.touchPinchZoom),g),m,h),children:(0,M.jsx)(Te,{value:Qe,children:(0,M.jsx)(Ce,{value:N,children:$e})})}),rt=A===void 0?nt:(0,M.jsxs)(`div`,{ref:B,"data-autofocus":``,tabIndex:0,...s(r(`context-menu`),n(q.sheetMenu,g),m,h),children:[(0,M.jsxs)(`div`,{className:`x78zum5 x1q0g3np x6s0dn4 xzye2dw x1p37lm5`,children:[P.length>0&&(0,M.jsx)(ae,{label:oe,variant:`ghost`,size:`sm`,icon:(0,M.jsx)(b,{icon:`chevronLeft`,size:`sm`,xstyle:te.mirror}),isIconOnly:!0,onClick:()=>Ae(e=>e.slice(0,-1))}),(0,M.jsx)(se,{ref:Pe,level:3,tabIndex:-1,xstyle:[q.sheetViewHeading,P.length===0&&q.sheetRootHeading],children:je})]}),(0,M.jsx)(me,{items:I,onSelect:Ne,onOpenSubmenu:e=>Ae(t=>[...t,e])})]});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(d===`div`?`div`:`span`,{ref:ie(p,De),...pe,onContextMenu:qe,onTouchStart:Je,onTouchMove:U,onTouchEnd:Ye,onTouchCancel:W,"data-testid":w,...n(q.trigger,..._?Array.isArray(_)?_:[_]:[]),children:[e,(0,M.jsx)(`span`,{ref:ie(Ee,R.ref),"aria-hidden":`true`,...s({className:`x10l6tqk x1i1rx1s xjm9jq1 x47corl`},{style:{left:`${we.current.x}px`,top:`${we.current.y}px`}})})]}),k?(0,M.jsx)(j.Suspense,{fallback:null,children:(0,M.jsx)(Ze,{isOpen:N,onOpenChange:L,label:Me,children:rt})}):R.render((0,M.jsx)(c,{children:nt}),{placement:`below`,alignment:`start`,xstyle:[Xe,re.below]})]})}Y.displayName=`ContextMenu`;export{ze as a,Te as c,Be as i,Ce as l,K as n,Pe as o,G as r,Me as s,Y as t,Se as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./themeProps-3IqahpCr.js";import{t}from"./BottomSheet-Dbh6A5Vl.js";import{I as n}from"./index-
|
|
1
|
+
import{c as e}from"./themeProps-3IqahpCr.js";import{t}from"./BottomSheet-Dbh6A5Vl.js";import{I as n}from"./index-DTXkdk9F.js";var r=e();function i({finalFocusRef:e,isOpen:i,onOpenChange:a,label:o,children:s}){return(0,r.jsx)(t,{finalFocusRef:e,isOpen:i,onOpenChange:a,label:o,height:`hug`,purpose:`info`,children:(0,r.jsx)(n,{paddingBlockStart:4,paddingBlockEnd:0,paddingInline:1,children:s})})}i.displayName=`MenuBottomSheet`;export{i as MenuBottomSheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{n as r,t as i}from"./SegmentedControlItem-BBGRPrxp.js";import{t as a}from"./VStack-CkVMcNiK.js";import{n as o,t as s}from"./StackItem-CQviqAfM.js";import{t as c}from"./DateInput-B1ICJtHn.js";import{t as l}from"./Text-BOqCfzZC.js";import{n as u}from"./labels-provider-DkA22zkP.js";import{n as d}from"./ScrollableArea-BHfY7sWH.js";import{a as f}from"./arrive-DvbqpeRS.js";import{c as p,d as m,f as h}from"./tool-schema-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{n as r,t as i}from"./SegmentedControlItem-BBGRPrxp.js";import{t as a}from"./VStack-CkVMcNiK.js";import{n as o,t as s}from"./StackItem-CQviqAfM.js";import{t as c}from"./DateInput-B1ICJtHn.js";import{t as l}from"./Text-BOqCfzZC.js";import{n as u}from"./labels-provider-DkA22zkP.js";import{n as d}from"./ScrollableArea-BHfY7sWH.js";import{a as f}from"./arrive-DvbqpeRS.js";import{c as p,d as m,f as h}from"./tool-schema-DCF2M0n_.js";import{c as g,l as _}from"./shaped-data-AVV4e7rW.js";import{c as v,d as y,l as b,u as x}from"./ConsoleFrame-COfuswTl.js";import{E as S,F as C,M as w,N as T,d as E,f as D,w as O,x as k,y as A}from"./index-DTXkdk9F.js";var j=e(n(),1),M=t(),N={search:()=>[],bootstrap:()=>[]},P={"--font-family-body":`var(--font-family-code)`},F=2;function I({text:e}){return(0,M.jsx)(l,{type:`supporting`,color:`secondary`,maxLines:F,children:e})}function L({field:e,children:t}){return(0,M.jsx)(x,{label:e.label,isRequired:e.isRequired,children:t})}function R({field:e,value:t,onChange:n}){let r=u(),[i,a]=(0,j.useState)(()=>t===void 0?``:_(t)),[o,s]=(0,j.useState)(!0);return(0,M.jsx)(k,{label:e.label,isRequired:e.isRequired,size:`sm`,rows:3,value:i,hasSpellCheck:!1,status:o?void 0:{type:`error`,message:r(`@theorem.decision.invalid_json`)},controlStyle:P,onChange:e=>{if(a(e),e.trim()===``)s(!0),n(void 0);else try{n(JSON.parse(e)),s(!0)}catch{s(!1)}}})}function z({field:e,item:t,value:n,onChange:r}){let i=Array.isArray(n)?n:[],c=f(i);return(0,M.jsx)(b,{label:e.label,isRequired:e.isRequired,description:e.description&&(0,M.jsx)(I,{text:e.description}),children:(0,M.jsxs)(a,{gap:3,children:[c.rows.map(({item:e,index:n,key:a})=>(0,M.jsxs)(o,{gap:2,vAlign:`start`,children:[(0,M.jsx)(s,{size:`fill`,children:(0,M.jsx)(Y,{schema:t,value:g(e)?e:{},onChange:e=>r(i.map((t,r)=>r===n?e:t))})}),(0,M.jsx)(y,{index:n,onRemove:()=>{c.drop(n),r(i.filter((e,t)=>t!==n))}})]},a)),(0,M.jsx)(v,{field:e.label,onAdd:()=>r([...i,p(t)])})]})})}function B(e){return{label:e.label,isRequired:e.isRequired,size:`sm`}}function V({field:e,options:t,isMenu:n,value:a,onChange:s}){return n?(0,M.jsx)(C,{...B(e),options:t,value:typeof a==`string`?a:void 0,hasSearch:t.length>10,onChange:s}):(0,M.jsx)(L,{field:e,children:(0,M.jsx)(o,{children:(0,M.jsx)(r,{label:e.label,size:`sm`,value:typeof a==`string`?a:``,onChange:s,children:t.map(e=>(0,M.jsx)(i,{value:e,label:e},e))})})})}function H({field:e,isLong:t,type:n,value:r,onChange:i}){let a=typeof r==`string`?r:``;return t?(0,M.jsx)(k,{...B(e),rows:3,value:a,onChange:i}):(0,M.jsx)(d,{...B(e),type:n,value:a,onChange:i})}function U({field:e,value:t,onChange:n}){let r=u(),i=Array.isArray(t)?t:[];return(0,M.jsx)(O,{...B(e),value:i.map((e,t)=>({id:`${String(t)}:${String(e)}`,label:String(e)})),searchSource:N,hasCreate:!0,debounceMs:0,placeholder:r(`@theorem.decision.add_value`),onChange:e=>n(e.map(e=>typeof i[0]==`number`&&Number.isFinite(Number(e.label))?Number(e.label):e.label))})}var W={choice:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(V,{field:e,options:t.options,isMenu:t.isMenu,value:n,onChange:r}),range:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(E,{label:e.label,isRequired:e.isRequired,min:t.min,max:t.max,step:1,value:typeof n==`number`?n:t.min,valueDisplay:`text`,onChange:r}),number:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(S,{...B(e),value:typeof n==`number`?n:void 0,min:t.min,max:t.max,isIntegerOnly:t.isInteger,isWheelEnabled:!1,onChange:e=>r(e??void 0)}),switch:({field:e,value:t,onChange:n})=>(0,M.jsx)(A,{label:e.label,value:t===!0,onChange:n}),date:({field:e,value:t,onChange:n})=>(0,M.jsx)(c,{...B(e),value:typeof t==`string`?t:void 0,onChange:n}),text:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(H,{field:e,isLong:t.isLong,type:t.type,value:n,onChange:r}),choices:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(T,{label:e.label,value:Array.isArray(n)?n.filter(e=>typeof e==`string`):[],onChange:r,children:t.options.map(e=>(0,M.jsx)(w,{label:e,value:e},e))}),words:({field:e,value:t,onChange:n})=>(0,M.jsx)(U,{field:e,value:t,onChange:n}),rows:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(z,{field:e,item:t.item,value:n,onChange:r}),group:({field:e,control:t,value:n,onChange:r})=>(0,M.jsx)(b,{label:e.label,isRequired:e.isRequired,description:e.description&&(0,M.jsx)(I,{text:e.description}),children:(0,M.jsx)(Y,{schema:t.schema,value:g(n)?n:{},onChange:r})}),json:({field:e,value:t,onChange:n})=>(0,M.jsx)(R,{field:e,value:t,onChange:n})};function G({field:e,value:t,onChange:n}){let r=W[e.control.kind],i=r({field:e,control:e.control,value:t,onChange:n}),o=e.control.kind===`rows`||e.control.kind===`group`;return!e.description||o?i:(0,M.jsxs)(a,{gap:1,children:[i,(0,M.jsx)(I,{text:e.description})]})}var K=200,q=18;function J({control:e}){switch(e.kind){case`number`:case`switch`:case`date`:return!0;case`choice`:return e.isMenu||e.options.join(``).length<=q;case`text`:return!e.isLong;default:return!1}}function Y({schema:e,value:t,onChange:n}){return(0,M.jsx)(D,{columns:{minWidth:K,repeat:`fill`},gap:3,children:m(e).map(e=>(0,M.jsx)(`div`,{style:J(e)?{minWidth:0,alignSelf:`start`}:{gridColumn:`1 / -1`,minWidth:0},children:(0,M.jsx)(G,{field:e,value:t[e.key],onChange:r=>n(h(t,e.key,r))})},e.key))})}function X({schema:e,value:t,onChange:n}){return(0,M.jsx)(Y,{schema:e,value:t,onChange:n})}export{X as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{t as r}from"./VStack-CkVMcNiK.js";import{n as i}from"./StackItem-CQviqAfM.js";import{t as a}from"./Text-BOqCfzZC.js";import{n as o}from"./Card-DruykyeB.js";import{t as s}from"./arrive-DvbqpeRS.js";import{b as c}from"./shaped-data-DYOBdvLJ.js";import{$ as l,B as u,Ct as d,Et as f,F as p,H as m,Ht as h,I as g,It as _,Jt as v,M as y,Mt as b,N as x,Nt as S,P as C,Q as ee,Qt as w,Ut as T,V as te,Vt as E,X as ne,Y as re,Yt as ie,Z as ae,_t as oe,an as D,at as se,cn as ce,ct as le,dn as ue,dt as de,en as fe,fn as pe,gt as me,ht as O,jt as he,kt as ge,ln as _e,lt as ve,mt as ye,n as be,nn as k,nt as xe,ot as Se,pn as Ce,qt as A,st as we,t as j,tn as M,tt as Te,un as Ee,ut as De,wt as Oe,xt as N,z as ke,zt as P}from"./TraceOverview-DmfmwSR6.js";import{a as Ae,c as F,i as I,s as L}from"./trace-patterns-D6TbkLLr.js";import{t as je}from"./CardWall-CBRLdDZW.js";import{n as Me}from"./studio-host-console-BJOUpXHR.js";var R=e(n()),Ne=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function Pe(e,t){if(e==null)return{};var n,r,i=Fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ie(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function B(e,t){return`${t}px ${e}px`}function Le(e){return e.length%2==0?e:[...e,...e]}function Re(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function ze(e,t,n){var r=Le(n),i=r.reduce((e,t)=>e+t,0);if(!i)return B(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;c<r.length;l+=(u=r[c])??0,++c){var u,d=r[c];if(d!=null&&l+d>o){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...Re(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function Be(e,t,n){return e?ze(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):B(t,n)}function Ve(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Pe(e,Ne),a=r??!1,o;if(t!=null){var s=i.pathRef;o=Be(n,Ie(s?.current??null),t)}else n!=null&&(o=String(n));return R.createElement(he,z({},i,{connectNulls:a,strokeDasharray:o}))}function He(e){var t=(0,R.useRef)(0),n=(0,R.useRef)(0),r=(0,R.useRef)(!1),i=(0,R.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,R.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(_e(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var V=(e,t,n,r)=>N(e,`xAxis`,t,r),H=(e,t,n,r)=>d(e,`xAxis`,t,r),U=(e,t,n,r)=>N(e,`yAxis`,n,r),W=(e,t,n,r)=>d(e,`yAxis`,n,r),Ue=w([S,V,U,H,W],(e,t,n,r,i)=>ie(e,`xAxis`)?h(t,r,!1):h(n,i,!1)),We=(e,t,n,r,i)=>i;function Ge(e){return e.type===`line`}var Ke=w([Oe,We],(e,t)=>e.filter(Ge).find(e=>e.id===t)),qe=w([S,V,U,H,W,Ke,Ue,ge],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return pt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),Je=[`id`],Ye=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],Xe=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}function K(e,t){if(e==null)return{};var n,r,i=Ze(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ze(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?q(Object(n),!0).forEach(function(t){Qe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qe(e,t,n){return(t=$e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(e){var t=et(e,`string`);return typeof t==`symbol`?t:t+``}function et(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tt(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function nt(e){var t=0,n=0;for(var r of e)r.status===`matched`&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var Y={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=nt(e),r=[];for(var i of e)if(i.status===`matched`)r.push(J(J({},i.next),{},{x:k(i.prev.x,i.next.x,t),y:k(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(J(J({},i.next),{},{x:k(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(J(J({},i.prev),{},{x:k(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:se,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Ve,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:f.line,type:`linear`},rt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:A(n,t),payload:e}]},it=R.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:ce,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:A(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return R.createElement(we,{tooltipEntrySettings:f})});function at(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=K(r,Je),c=pe(s);return R.createElement(ae,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function ot(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,R.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return J(J({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return R.createElement(De,{value:t?i:void 0},n)}function st(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,f=i.needClip,p=i.shape,m=i.strokeDasharray,h=K(i,Ye),g=J(J({},ue(h)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:f?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:m??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return R.createElement(R.Fragment,null,r?.length>1&&R.createElement(le,{option:p,DefaultShape:Y.shape,shapeProps:g}),R.createElement(at,{points:r,clipPathId:t,props:i}))}function ct(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,p=tt(r.current),m=xe(n.onAnimationStart,n.onAnimationEnd),h=m.isAnimating,g=m.handleAnimationStart,_=m.handleAnimationEnd,v=!h,y=He(a),b=(0,R.useCallback)(e=>e>0&&p>0,[p]);return R.createElement(ot,{points:a,showLabels:v},n.children,R.createElement(Te,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:g,onAnimationEnd:_,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:b,layout:f},(e,i,a)=>{var o=h||i<1,s=o?y(i,p):null;return R.createElement(st,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),R.createElement(de,{label:n.label}))}function lt(e){var t=e.clipPathId,n=e.props,r=(0,R.useRef)(null),i=(0,R.useRef)(null);return R.createElement(ct,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var ut=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:v(e.payload,t)}),dt=class extends R.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,c=e.left,l=e.width,d=e.height,f=e.id,p=e.needClip,h=e.zIndex;if(t)return null;var g=Ce(`recharts-line`,i),_=f,v=ke(n),y=v.r,b=v.strokeWidth,x=ve(n),S=y*2+b,C=p?`url(#clipPath-${x?``:`dots-`}${_})`:void 0;return R.createElement(oe,{zIndex:h},R.createElement(Ee,{className:g},p&&R.createElement(`defs`,null,R.createElement(u,{clipPathId:_,xAxisId:a,yAxisId:o}),!x&&R.createElement(`clipPath`,{id:`clipPath-dots-${_}`},R.createElement(`rect`,{x:c-S/2,y:s-S/2,width:l+S,height:d+S}))),R.createElement(m,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:ut,errorBarOffset:0},R.createElement(lt,{props:this.props,clipPathId:_}))),R.createElement(re,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}};function ft(e){var t=M(e,Y),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,f=t.legendType,p=t.xAxisId,m=t.yAxisId,h=t.id,g=K(t,Xe),v=te(p,m).needClip,y=ne(),b=_(),x=E(),S=fe(e=>qe(e,p,m,x,h));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,ee=y.width,w=y.x,T=y.y;return R.createElement(dt,G({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:ee,left:w,top:T,needClip:v}))}function pt(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=v(e,o);if(t===`horizontal`)return{x:T({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(D(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=D(l)?null:n.scale.map(l),d=T({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function mt(e){var t=M(e,Y),n=E();return R.createElement(l,{id:t.id,type:`line`},e=>R.createElement(R.Fragment,null,R.createElement(Se,{legendPayload:rt(t)}),R.createElement(it,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),R.createElement(ee,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),R.createElement(ft,G({},t,{id:e}))))}var X=R.memo(mt,b);X.displayName=`Line`;var ht=[`axis`],gt=(0,R.forwardRef)((e,t)=>R.createElement(x,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:ht,tooltipPayloadSearcher:me,categoricalChartProps:e,ref:t})),Z=t(),_t=140,vt=22,Q={fill:`var(--color-text-secondary)`,fontSize:11},yt={radius:4,stroke:Ae,strokeWidth:2,isAnimationActive:!1},$=[`clear`,`shade1`,`shade2`];function bt(e){let t=o();return(0,R.useMemo)(()=>{let n=new Intl.NumberFormat(t,{maximumFractionDigits:2}),r=(e,t)=>c(n.format(e),t),i=e.kind===`time`?e.rows.map(t=>String(t[e.x])):[],a=Me(i),o=new Intl.DateTimeFormat(t,a.tick),s=new Intl.DateTimeFormat(t,a.when),l=e=>t=>{let n=Date.parse(t);return Number.isNaN(n)?t:e.format(n)};return{number:r,tick:l(o),when:l(s)}},[e,t])}function xt({active:e,payload:t,label:n,chart:o,formats:s}){return!e||!t?.length?null:(0,Z.jsx)(be,{children:(0,Z.jsxs)(r,{gap:0,children:[(0,Z.jsx)(a,{weight:`medium`,children:s.when(String(n))}),o.series.map((e,n)=>{let r=t.find(t=>t.dataKey===e.key)?.value;return typeof r==`number`?(0,Z.jsxs)(i,{gap:2,vAlign:`center`,children:[o.series.length>1?(0,Z.jsx)(L,{fill:$[n]??`clear`}):null,(0,Z.jsxs)(a,{type:`supporting`,hasTabularNumbers:!0,children:[o.series.length>1?`${e.label} `:``,s.number(r,e.unit)]})]},e.key):null})]})})}function St({chart:e}){let t=bt(e),[n]=e.series,r=e.series.flatMap(t=>e.rows.map(e=>e[t.key]).filter(e=>typeof e==`number`)),o=n?e.rows.map(e=>e[n.key]).find(e=>typeof e==`number`):void 0;if(!n||o===void 0)return null;let s=n.unit,c=`${t.number(Math.min(...r))}–${t.number(Math.max(...r),s)}`;return(0,Z.jsxs)(I,{title:e.title,value:t.number(o,s),note:c,children:[(0,Z.jsx)(j,{children:(0,Z.jsx)(P,{width:`100%`,height:_t,initialDimension:{width:280,height:_t},children:(0,Z.jsxs)(gt,{data:e.rows,margin:{top:4,right:4,bottom:0,left:0},accessibilityLayer:!1,children:[(0,Z.jsx)(p,{dataKey:e.x,tick:Q,tickLine:!1,axisLine:!1,tickFormatter:t.tick,minTickGap:16}),(0,Z.jsx)(C,{tick:Q,tickLine:!1,axisLine:!1,width:36,domain:[`auto`,`auto`],tickFormatter:e=>t.number(e)}),(0,Z.jsx)(O,{content:n=>(0,Z.jsx)(xt,{...n,chart:e,formats:t}),cursor:{stroke:`var(--color-border-emphasized)`},isAnimationActive:!1}),e.series.map((e,t)=>(0,Z.jsx)(X,{type:`monotone`,dataKey:e.key,stroke:F($[t]??`clear`),strokeWidth:2,dot:!1,activeDot:{r:3,strokeWidth:0},connectNulls:!0,isAnimationActive:!1},e.key))]})})}),e.series.length>1?(0,Z.jsx)(i,{gap:3,wrap:`wrap`,children:e.series.map((e,t)=>(0,Z.jsxs)(i,{gap:2,vAlign:`center`,children:[(0,Z.jsx)(L,{fill:$[t]??`clear`}),(0,Z.jsx)(a,{type:`supporting`,color:`secondary`,children:e.label})]},e.key))}):null]})}function Ct({active:e,payload:t,chart:n,formats:i}){let o=t?.[0]?.payload;return!e||!o?null:(0,Z.jsx)(be,{children:(0,Z.jsxs)(r,{gap:0,children:[(0,Z.jsx)(a,{weight:`medium`,children:o.label}),(0,Z.jsx)(a,{type:`supporting`,hasTabularNumbers:!0,children:i.number(o.value,n.series.unit)})]})})}function wt({chart:e}){let t=bt(e),n=(0,R.useMemo)(()=>e.rows.map((e,t)=>({...e,id:String(t)})),[e]),[r]=n;if(!r)return null;let i=n.length*vt;return(0,Z.jsx)(I,{title:e.title,value:t.number(r.value,e.series.unit),note:r.label,children:(0,Z.jsx)(j,{children:(0,Z.jsx)(P,{width:`100%`,height:i,initialDimension:{width:280,height:i},children:(0,Z.jsxs)(y,{data:n,layout:`vertical`,margin:{top:0,right:56,bottom:0,left:0},accessibilityLayer:!1,barCategoryGap:5,children:[(0,Z.jsx)(p,{type:`number`,hide:!0}),(0,Z.jsx)(C,{type:`category`,dataKey:`id`,width:104,tick:Q,tickLine:!1,axisLine:!1,interval:0,tickFormatter:e=>{let t=n[Number(e)]?.label??``;return t.length>15?`${t.slice(0,14)}…`:t}}),(0,Z.jsx)(O,{content:n=>(0,Z.jsx)(Ct,{...n,chart:e,formats:t}),cursor:{fill:`var(--color-overlay-hover)`,radius:4},isAnimationActive:!1}),(0,Z.jsx)(g,{dataKey:`value`,...yt,label:{position:`right`,fill:`var(--color-text-secondary)`,fontSize:11,formatter:n=>t.number(Number(n),e.series.unit)},children:n.map((e,t)=>(0,Z.jsx)(ye,{fill:F(t===0?`clear`:`shade2`)},e.id))})]})})})})}function Tt({charts:e}){return(0,Z.jsx)(je,{minWidth:260,children:e.map(e=>(0,Z.jsx)(s,{children:e.kind===`time`?(0,Z.jsx)(St,{chart:e}):(0,Z.jsx)(wt,{chart:e})},e.key))})}export{Tt as ToolResultCharts};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{t as r}from"./VStack-CkVMcNiK.js";import{n as i}from"./StackItem-CQviqAfM.js";import{t as a}from"./Text-BOqCfzZC.js";import{n as o}from"./Card-DruykyeB.js";import{t as s}from"./arrive-DvbqpeRS.js";import{b as c}from"./shaped-data-AVV4e7rW.js";import{$ as l,B as u,Ct as d,Et as f,F as p,H as m,Ht as h,I as g,It as _,Jt as v,M as y,Mt as b,N as x,Nt as S,P as C,Q as ee,Qt as w,Ut as T,V as te,Vt as E,X as ne,Y as re,Yt as ie,Z as ae,_t as oe,an as D,at as se,cn as ce,ct as le,dn as ue,dt as de,en as fe,fn as pe,gt as me,ht as O,jt as he,kt as ge,ln as _e,lt as ve,mt as ye,n as be,nn as k,nt as xe,ot as Se,pn as Ce,qt as A,st as we,t as j,tn as M,tt as Te,un as Ee,ut as De,wt as Oe,xt as N,z as ke,zt as P}from"./TraceOverview-Bh3WLZ-O.js";import{a as Ae,c as F,i as I,s as L}from"./trace-patterns-D6TbkLLr.js";import{t as je}from"./CardWall-CBRLdDZW.js";import{n as Me}from"./studio-host-console-3aVzR9Pg.js";var R=e(n()),Ne=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function Pe(e,t){if(e==null)return{};var n,r,i=Fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ie(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function B(e,t){return`${t}px ${e}px`}function Le(e){return e.length%2==0?e:[...e,...e]}function Re(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function ze(e,t,n){var r=Le(n),i=r.reduce((e,t)=>e+t,0);if(!i)return B(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;c<r.length;l+=(u=r[c])??0,++c){var u,d=r[c];if(d!=null&&l+d>o){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...Re(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function Be(e,t,n){return e?ze(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):B(t,n)}function Ve(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Pe(e,Ne),a=r??!1,o;if(t!=null){var s=i.pathRef;o=Be(n,Ie(s?.current??null),t)}else n!=null&&(o=String(n));return R.createElement(he,z({},i,{connectNulls:a,strokeDasharray:o}))}function He(e){var t=(0,R.useRef)(0),n=(0,R.useRef)(0),r=(0,R.useRef)(!1),i=(0,R.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,R.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(_e(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var V=(e,t,n,r)=>N(e,`xAxis`,t,r),H=(e,t,n,r)=>d(e,`xAxis`,t,r),U=(e,t,n,r)=>N(e,`yAxis`,n,r),W=(e,t,n,r)=>d(e,`yAxis`,n,r),Ue=w([S,V,U,H,W],(e,t,n,r,i)=>ie(e,`xAxis`)?h(t,r,!1):h(n,i,!1)),We=(e,t,n,r,i)=>i;function Ge(e){return e.type===`line`}var Ke=w([Oe,We],(e,t)=>e.filter(Ge).find(e=>e.id===t)),qe=w([S,V,U,H,W,Ke,Ue,ge],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return pt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),Je=[`id`],Ye=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],Xe=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}function K(e,t){if(e==null)return{};var n,r,i=Ze(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ze(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?q(Object(n),!0).forEach(function(t){Qe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qe(e,t,n){return(t=$e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(e){var t=et(e,`string`);return typeof t==`symbol`?t:t+``}function et(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tt(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function nt(e){var t=0,n=0;for(var r of e)r.status===`matched`&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var Y={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=nt(e),r=[];for(var i of e)if(i.status===`matched`)r.push(J(J({},i.next),{},{x:k(i.prev.x,i.next.x,t),y:k(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(J(J({},i.next),{},{x:k(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(J(J({},i.prev),{},{x:k(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:se,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Ve,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:f.line,type:`linear`},rt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:A(n,t),payload:e}]},it=R.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:ce,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:A(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return R.createElement(we,{tooltipEntrySettings:f})});function at(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=K(r,Je),c=pe(s);return R.createElement(ae,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function ot(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,R.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return J(J({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return R.createElement(De,{value:t?i:void 0},n)}function st(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,f=i.needClip,p=i.shape,m=i.strokeDasharray,h=K(i,Ye),g=J(J({},ue(h)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:f?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:m??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return R.createElement(R.Fragment,null,r?.length>1&&R.createElement(le,{option:p,DefaultShape:Y.shape,shapeProps:g}),R.createElement(at,{points:r,clipPathId:t,props:i}))}function ct(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,p=tt(r.current),m=xe(n.onAnimationStart,n.onAnimationEnd),h=m.isAnimating,g=m.handleAnimationStart,_=m.handleAnimationEnd,v=!h,y=He(a),b=(0,R.useCallback)(e=>e>0&&p>0,[p]);return R.createElement(ot,{points:a,showLabels:v},n.children,R.createElement(Te,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:g,onAnimationEnd:_,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:b,layout:f},(e,i,a)=>{var o=h||i<1,s=o?y(i,p):null;return R.createElement(st,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),R.createElement(de,{label:n.label}))}function lt(e){var t=e.clipPathId,n=e.props,r=(0,R.useRef)(null),i=(0,R.useRef)(null);return R.createElement(ct,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var ut=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:v(e.payload,t)}),dt=class extends R.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,c=e.left,l=e.width,d=e.height,f=e.id,p=e.needClip,h=e.zIndex;if(t)return null;var g=Ce(`recharts-line`,i),_=f,v=ke(n),y=v.r,b=v.strokeWidth,x=ve(n),S=y*2+b,C=p?`url(#clipPath-${x?``:`dots-`}${_})`:void 0;return R.createElement(oe,{zIndex:h},R.createElement(Ee,{className:g},p&&R.createElement(`defs`,null,R.createElement(u,{clipPathId:_,xAxisId:a,yAxisId:o}),!x&&R.createElement(`clipPath`,{id:`clipPath-dots-${_}`},R.createElement(`rect`,{x:c-S/2,y:s-S/2,width:l+S,height:d+S}))),R.createElement(m,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:ut,errorBarOffset:0},R.createElement(lt,{props:this.props,clipPathId:_}))),R.createElement(re,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}};function ft(e){var t=M(e,Y),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,f=t.legendType,p=t.xAxisId,m=t.yAxisId,h=t.id,g=K(t,Xe),v=te(p,m).needClip,y=ne(),b=_(),x=E(),S=fe(e=>qe(e,p,m,x,h));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,ee=y.width,w=y.x,T=y.y;return R.createElement(dt,G({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:ee,left:w,top:T,needClip:v}))}function pt(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=v(e,o);if(t===`horizontal`)return{x:T({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(D(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=D(l)?null:n.scale.map(l),d=T({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function mt(e){var t=M(e,Y),n=E();return R.createElement(l,{id:t.id,type:`line`},e=>R.createElement(R.Fragment,null,R.createElement(Se,{legendPayload:rt(t)}),R.createElement(it,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),R.createElement(ee,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),R.createElement(ft,G({},t,{id:e}))))}var X=R.memo(mt,b);X.displayName=`Line`;var ht=[`axis`],gt=(0,R.forwardRef)((e,t)=>R.createElement(x,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:ht,tooltipPayloadSearcher:me,categoricalChartProps:e,ref:t})),Z=t(),_t=140,vt=22,Q={fill:`var(--color-text-secondary)`,fontSize:11},yt={radius:4,stroke:Ae,strokeWidth:2,isAnimationActive:!1},$=[`clear`,`shade1`,`shade2`];function bt(e){let t=o();return(0,R.useMemo)(()=>{let n=new Intl.NumberFormat(t,{maximumFractionDigits:2}),r=(e,t)=>c(n.format(e),t),i=e.kind===`time`?e.rows.map(t=>String(t[e.x])):[],a=Me(i),o=new Intl.DateTimeFormat(t,a.tick),s=new Intl.DateTimeFormat(t,a.when),l=e=>t=>{let n=Date.parse(t);return Number.isNaN(n)?t:e.format(n)};return{number:r,tick:l(o),when:l(s)}},[e,t])}function xt({active:e,payload:t,label:n,chart:o,formats:s}){return!e||!t?.length?null:(0,Z.jsx)(be,{children:(0,Z.jsxs)(r,{gap:0,children:[(0,Z.jsx)(a,{weight:`medium`,children:s.when(String(n))}),o.series.map((e,n)=>{let r=t.find(t=>t.dataKey===e.key)?.value;return typeof r==`number`?(0,Z.jsxs)(i,{gap:2,vAlign:`center`,children:[o.series.length>1?(0,Z.jsx)(L,{fill:$[n]??`clear`}):null,(0,Z.jsxs)(a,{type:`supporting`,hasTabularNumbers:!0,children:[o.series.length>1?`${e.label} `:``,s.number(r,e.unit)]})]},e.key):null})]})})}function St({chart:e}){let t=bt(e),[n]=e.series,r=e.series.flatMap(t=>e.rows.map(e=>e[t.key]).filter(e=>typeof e==`number`)),o=n?e.rows.map(e=>e[n.key]).find(e=>typeof e==`number`):void 0;if(!n||o===void 0)return null;let s=n.unit,c=`${t.number(Math.min(...r))}–${t.number(Math.max(...r),s)}`;return(0,Z.jsxs)(I,{title:e.title,value:t.number(o,s),note:c,children:[(0,Z.jsx)(j,{children:(0,Z.jsx)(P,{width:`100%`,height:_t,initialDimension:{width:280,height:_t},children:(0,Z.jsxs)(gt,{data:e.rows,margin:{top:4,right:4,bottom:0,left:0},accessibilityLayer:!1,children:[(0,Z.jsx)(p,{dataKey:e.x,tick:Q,tickLine:!1,axisLine:!1,tickFormatter:t.tick,minTickGap:16}),(0,Z.jsx)(C,{tick:Q,tickLine:!1,axisLine:!1,width:36,domain:[`auto`,`auto`],tickFormatter:e=>t.number(e)}),(0,Z.jsx)(O,{content:n=>(0,Z.jsx)(xt,{...n,chart:e,formats:t}),cursor:{stroke:`var(--color-border-emphasized)`},isAnimationActive:!1}),e.series.map((e,t)=>(0,Z.jsx)(X,{type:`monotone`,dataKey:e.key,stroke:F($[t]??`clear`),strokeWidth:2,dot:!1,activeDot:{r:3,strokeWidth:0},connectNulls:!0,isAnimationActive:!1},e.key))]})})}),e.series.length>1?(0,Z.jsx)(i,{gap:3,wrap:`wrap`,children:e.series.map((e,t)=>(0,Z.jsxs)(i,{gap:2,vAlign:`center`,children:[(0,Z.jsx)(L,{fill:$[t]??`clear`}),(0,Z.jsx)(a,{type:`supporting`,color:`secondary`,children:e.label})]},e.key))}):null]})}function Ct({active:e,payload:t,chart:n,formats:i}){let o=t?.[0]?.payload;return!e||!o?null:(0,Z.jsx)(be,{children:(0,Z.jsxs)(r,{gap:0,children:[(0,Z.jsx)(a,{weight:`medium`,children:o.label}),(0,Z.jsx)(a,{type:`supporting`,hasTabularNumbers:!0,children:i.number(o.value,n.series.unit)})]})})}function wt({chart:e}){let t=bt(e),n=(0,R.useMemo)(()=>e.rows.map((e,t)=>({...e,id:String(t)})),[e]),[r]=n;if(!r)return null;let i=n.length*vt;return(0,Z.jsx)(I,{title:e.title,value:t.number(r.value,e.series.unit),note:r.label,children:(0,Z.jsx)(j,{children:(0,Z.jsx)(P,{width:`100%`,height:i,initialDimension:{width:280,height:i},children:(0,Z.jsxs)(y,{data:n,layout:`vertical`,margin:{top:0,right:56,bottom:0,left:0},accessibilityLayer:!1,barCategoryGap:5,children:[(0,Z.jsx)(p,{type:`number`,hide:!0}),(0,Z.jsx)(C,{type:`category`,dataKey:`id`,width:104,tick:Q,tickLine:!1,axisLine:!1,interval:0,tickFormatter:e=>{let t=n[Number(e)]?.label??``;return t.length>15?`${t.slice(0,14)}…`:t}}),(0,Z.jsx)(O,{content:n=>(0,Z.jsx)(Ct,{...n,chart:e,formats:t}),cursor:{fill:`var(--color-overlay-hover)`,radius:4},isAnimationActive:!1}),(0,Z.jsx)(g,{dataKey:`value`,...yt,label:{position:`right`,fill:`var(--color-text-secondary)`,fontSize:11,formatter:n=>t.number(Number(n),e.series.unit)},children:n.map((e,t)=>(0,Z.jsx)(ye,{fill:F(t===0?`clear`:`shade2`)},e.id))})]})})})})}function Tt({charts:e}){return(0,Z.jsx)(je,{minWidth:260,children:e.map(e=>(0,Z.jsx)(s,{children:e.kind===`time`?(0,Z.jsx)(St,{chart:e}):(0,Z.jsx)(wt,{chart:e})},e.key))})}export{Tt as ToolResultCharts};
|