@w6w/ui 0.2.0 → 0.2.11
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/CHANGELOG.md +7 -0
- package/dist/AppPicker.d.ts +47 -2
- package/dist/CanvasLayer.d.ts +38 -0
- package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
- package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
- package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
- package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
- package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
- package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
- package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
- package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
- package/dist/Copyable-DA6eiU7w.cjs +2 -0
- package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
- package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
- package/dist/Copyable-F4NTaG77.js.map +1 -0
- package/dist/EditConnectionModal.d.ts +6 -1
- package/dist/JsonEditor.d.ts +8 -0
- package/dist/Markdown.d.ts +25 -0
- package/dist/ParamsForm.d.ts +7 -1
- package/dist/StepBuilderModal.d.ts +23 -5
- package/dist/WorkflowFlowEditor.d.ts +14 -3
- package/dist/app-pages.d.ts +2 -0
- package/dist/canvas-types.d.ts +36 -0
- package/dist/canvas-utils.d.ts +44 -0
- package/dist/code.cjs +1 -1
- package/dist/code.mjs +2 -2
- package/dist/components/AuthFieldsForm.d.ts +11 -0
- package/dist/components/BudgetMeter.d.ts +15 -0
- package/dist/components/CallableList.d.ts +3 -2
- package/dist/components/Combobox.d.ts +8 -1
- package/dist/components/ConnectionList.d.ts +2 -3
- package/dist/components/CredentialPicker.d.ts +35 -0
- package/dist/components/DataTable.d.ts +27 -0
- package/dist/components/EmptyState.d.ts +9 -0
- package/dist/components/icons.d.ts +1 -1
- package/dist/dynamic-fields.d.ts +60 -0
- package/dist/editor-theme.d.ts +24 -0
- package/dist/flow-fanout.d.ts +2 -2
- package/dist/flow-types.d.ts +18 -1
- package/dist/flow-utils.d.ts +10 -3
- package/dist/flow.cjs +2 -2
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.d.ts +9 -0
- package/dist/flow.mjs +1519 -1138
- package/dist/flow.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.mjs +1362 -1123
- package/dist/index.mjs.map +1 -1
- package/dist/note-markdown.d.ts +22 -0
- package/dist/provider.d.ts +56 -7
- package/dist/resolve-params.d.ts +5 -0
- package/dist/run-visuals.d.ts +4 -1
- package/dist/step-problems.d.ts +34 -0
- package/dist/types.d.ts +109 -3
- package/dist/use-dynamic-fields.d.ts +23 -0
- package/package.json +4 -2
- package/src/styles/_budget-meter.scss +46 -0
- package/src/styles/_callable-list.scss +15 -6
- package/src/styles/_canvas.scss +318 -0
- package/src/styles/_connections.scss +2 -14
- package/src/styles/_data-table.scss +55 -0
- package/src/styles/_empty-state.scss +21 -0
- package/src/styles/_flow.scss +11 -0
- package/src/styles/_fx.scss +23 -0
- package/src/styles/_layout.scss +10 -0
- package/src/styles/_markdown.scss +20 -0
- package/src/styles/_tester.scss +1 -14
- package/src/styles.css +572 -39
- package/src/styles.scss +5 -0
- package/dist/ConfirmModal-ChoiGy2K.cjs +0 -11
- package/dist/ConfirmModal-ChoiGy2K.cjs.map +0 -1
- package/dist/ConfirmModal-Wx3i8F1n.js +0 -6359
- package/dist/ConfirmModal-Wx3i8F1n.js.map +0 -1
- package/dist/Copyable-1niV9gUa.js.map +0 -1
- package/dist/Copyable-CYZU1o4X.cjs +0 -2
- package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";var Vs=Object.defineProperty;var Ys=(s,t,n)=>t in s?Vs(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n;var te=(s,t,n)=>Ys(s,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./ConfirmModal-ChoiGy2K.cjs"),e=require("react/jsx-runtime"),j=require("react"),re=require("./CodeBlock-CZu4TFSi.cjs"),Gs=require("@codemirror/lang-yaml"),Qs=require("@codemirror/view"),Zs=require("@uiw/react-codemirror"),F=require("./Copyable-CYZU1o4X.cjs");class H extends Error{constructor(n,l,o,i){super(o);te(this,"status");te(this,"code");te(this,"body");this.name="ApiError",this.status=n,this.code=l,this.body=i}}function Xs(s){const t=s.baseUrl.replace(/\/$/,""),n=s.fetch??globalThis.fetch,l=async()=>typeof s.token=="function"?await s.token():s.token;async function o(a,r){const d=new Headers(r==null?void 0:r.headers),u=await l();u&&d.set("authorization",`Bearer ${u}`),r!=null&&r.body&&!d.has("content-type")&&d.set("content-type","application/json");let m;try{m=await n(`${t}${a}`,{...r,headers:d})}catch(v){throw new H(0,"network_error",`Could not reach the w6w server (${(r==null?void 0:r.method)??"GET"} ${t}${a}). It may be down or unreachable. (${v.message})`)}const w=await m.text();let h=null;if(w)try{h=JSON.parse(w)}catch{if(!m.ok)throw new H(m.status,"bad_response",`Server returned a non-JSON ${m.status} response: ${w.slice(0,200)}`)}if(!m.ok){const v=(h==null?void 0:h.error)??{};throw new H(m.status,v.code??"error",v.message??m.statusText,h)}return{status:m.status,data:h}}async function i(a,r){const{data:d}=await o(a,r);return d}return{listApps:async()=>{const a=async()=>{const r=[];let d;for(;;){const u=new URLSearchParams({limit:"200"});d&&u.set("cursor",d);const m=await i(`/apps?${u}`);if(r.push(...m.apps),!m.nextCursor||m.nextCursor===d)return r;d=m.nextCursor}};try{return await a()}catch(r){if(r instanceof H&&(r.code==="snapshot_expired"||r.code==="unknown_snapshot"))return await a();throw r}},listAppsByIds:async a=>{const r=Array.from(new Set(a)),d=[];for(let u=0;u<r.length;u+=100){const w=r.slice(u,u+100).map(encodeURIComponent).join(","),h=await i(`/apps?ids=${w}`);d.push(...h.apps)}return d},getAppAuth:async a=>(await i(`/apps/${encodeURIComponent(a)}/auths`)).auths??[],createConnection:(a,r)=>i(`/apps/${encodeURIComponent(a)}/connections`,{method:"POST",body:JSON.stringify(r)}).then(d=>d.connection),updateConnection:(a,r)=>i(`/connections/${encodeURIComponent(a)}`,{method:"PATCH",body:JSON.stringify(r)}).then(d=>d.connection),startAppOAuthFlow:(a,r,d)=>i(`/apps/${encodeURIComponent(a)}/oauth-config/${encodeURIComponent(r)}/authorize-url`,{method:"POST",body:JSON.stringify(d)}),getAppActions:a=>i(`/apps/${encodeURIComponent(a)}`).then(r=>r.actions??[]),listConnectionsForApp:a=>i(`/apps/${encodeURIComponent(a)}/connections`).then(r=>r.connections??[]),listConnections:()=>i("/connections").then(a=>a.connections??[]),invokeAction:(a,r,d,u={})=>i(`/apps/${encodeURIComponent(a)}/actions/${encodeURIComponent(r)}/invoke`,{method:"POST",body:JSON.stringify({params:d,connectionId:u.connectionId,project:u.project,state:u.state})}),listSavedTests:a=>i(`/connections/${encodeURIComponent(a)}/saved-tests`).then(r=>r.savedTests??[]),createSavedTest:(a,r)=>i(`/connections/${encodeURIComponent(a)}/saved-tests`,{method:"POST",body:JSON.stringify(r)}).then(d=>d.savedTest),updateSavedTest:(a,r,d)=>i(`/connections/${encodeURIComponent(a)}/saved-tests/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify(d)}).then(u=>u.savedTest),deleteSavedTest:(a,r)=>i(`/connections/${encodeURIComponent(a)}/saved-tests/${encodeURIComponent(r)}`,{method:"DELETE"}).then(()=>{}),recordTestRun:(a,r)=>i(`/connections/${encodeURIComponent(a)}/test-runs`,{method:"POST",body:JSON.stringify(r)}).then(()=>{}),listTestRuns:a=>i(`/connections/${encodeURIComponent(a)}/test-runs`).then(r=>r.runs??[]),saveStepTest:(a,r,d)=>i(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(r)}/tests`,{method:"POST",body:JSON.stringify(d)}).then(u=>u.stepTest),listStepTests:(a,r)=>i(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(r)}/tests`).then(d=>d.stepTests??[]),recordStepTestRun:(a,r,d)=>i(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(r)}/test-runs`,{method:"POST",body:JSON.stringify(d)}).then(()=>{}),listFunctions:()=>i("/functions").then(a=>a.functions??[]),getFunction:a=>i(`/functions/${encodeURIComponent(a)}`).then(r=>({...r.function,valid:r.valid})),invokeFunction:(a,r)=>i(`/functions/${encodeURIComponent(a)}/invoke`,{method:"POST",body:JSON.stringify({inputs:r})}).then(d=>d.output),listWorkflows:()=>i("/workflows").then(a=>a.workflows??[]),getWorkflow:a=>i(`/workflows/${encodeURIComponent(a)}`).then(r=>r.workflow),runWorkflow:(a,r={})=>o(`/workflows/${encodeURIComponent(a)}/run?wait=true`,{method:"POST",body:JSON.stringify({variables:r.variables,input:r.input})}).then(({status:d,data:u})=>({...u??{},terminal:d===200}))}}function Ye(s){if(!s)return"";try{return JSON.stringify(JSON.parse(s),null,2)}catch{return s}}function et(s,t){return`${s.method}-${s.url??s.host}-${t}`}function as({calls:s,defaultOpen:t,keyOf:n,title:l}){if(s.length===0)return null;const o=n??et;return e.jsxs("div",{className:"w6w-stack",style:{gap:4},children:[l!==!1&&e.jsx("strong",{className:"w6w-small",children:l??e.jsxs(e.Fragment,{children:["API ",s.length===1?"call":"calls"," (",s.length,")"]})}),s.map((i,a)=>e.jsxs("details",{open:t,className:"w6w-result",style:{padding:8},children:[e.jsx("summary",{style:{cursor:"pointer"},children:e.jsxs("span",{className:"w6w-small",children:[i.method," ",i.url??i.host," →"," ",e.jsx("strong",{children:i.error?"failed":i.status}),i.durationMs!==void 0&&e.jsxs("span",{className:"w6w-muted",children:[" · ",i.durationMs,"ms"]})]})}),e.jsxs("div",{className:"w6w-stack",style:{gap:6,marginTop:8},children:[i.error&&e.jsx("div",{className:"w6w-error w6w-small",children:i.error}),e.jsx("div",{className:"w6w-muted w6w-small",children:"Request headers"}),e.jsx("pre",{className:"w6w-result",children:JSON.stringify(i.requestHeaders??{},null,2)}),i.requestBody&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w6w-muted w6w-small",children:"Request body"}),e.jsx("pre",{className:"w6w-result",children:Ye(i.requestBody)})]}),e.jsx("div",{className:"w6w-muted w6w-small",children:"Response headers"}),e.jsx("pre",{className:"w6w-result",children:JSON.stringify(i.responseHeaders??{},null,2)}),i.responseBody&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w6w-muted w6w-small",children:"Response body"}),e.jsx("pre",{className:"w6w-result",children:Ye(i.responseBody)})]}),i.truncated&&e.jsx("div",{className:"w6w-muted w6w-small",children:"A captured body exceeded the size cap and was truncated."})]})]},o(i,a)))]})}function U({title:s,subtitle:t,icon:n,trailing:l,active:o=!1,onClick:i,href:a,ariaLabel:r}){const d=e.jsxs(e.Fragment,{children:[n!=null&&e.jsx("span",{className:"w6w-list-item-icon",children:n}),e.jsxs("span",{className:"w6w-list-item-body",children:[e.jsx("span",{className:"w6w-list-item-title",children:s}),t!=null&&e.jsx("span",{className:"w6w-list-item-subtitle",children:t})]}),l!=null&&e.jsx("span",{className:"w6w-list-item-trailing",children:l})]}),u=`w6w-list-item${o?" active":""}`;return a!==void 0?e.jsx("a",{className:u,href:a,"aria-current":o?"true":void 0,"aria-label":r,onClick:i,children:d}):i?e.jsx("button",{type:"button",className:u,"aria-pressed":o,"aria-label":r,onClick:i,children:d}):e.jsx("div",{className:u,"aria-label":r,children:d})}function Ne(s){const t=Date.parse(s);if(Number.isNaN(t))return"";const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<45)return"just now";const l=Math.round(n/60);if(l<60)return`${l}m ago`;const o=Math.round(l/60);if(o<24)return`${o}h ago`;const i=Math.round(o/24);return i<7?`${i}d ago`:new Date(t).toLocaleDateString()}function Ge(s){const t={};for(const n of(s==null?void 0:s.params)??[])n.key&&n.default!==void 0&&(t[n.key]=n.default);return t}function st(s){var n,l,o;const t=s.indexOf("{");if(t>=0)try{const i=JSON.parse(s.slice(t)),a=((l=(n=i==null?void 0:i.errors)==null?void 0:n[0])==null?void 0:l.message)??(typeof(i==null?void 0:i.error)=="object"?(o=i.error)==null?void 0:o.message:i==null?void 0:i.error)??(i==null?void 0:i.message);if(typeof a=="string"&&a.trim()){const r=s.slice(0,t).replace(/[:\s]+$/,"");return r?`${r}: ${a.trim()}`:a.trim()}}catch{}return s}function ls(s){return typeof s=="object"&&s!==null&&typeof s.status=="number"&&typeof s.code=="string"}function tt(s){if(!ls(s))return{headline:(s==null?void 0:s.message)??"The action failed to run."};const t=st(s.message??""),n=`${s.status} ${s.code} ${s.message??""}`.toLowerCase();return s.status===401||s.status===403||/\b(401|403)\b|forbidden|unauthorized|not authorized|permission|scope|access denied|invalid api key|invalid credential/.test(n)?{headline:"Permission denied by the provider — this is a credential/scope problem, not a w6w error.",hint:"The connection's API key is missing the permissions this action needs. Fix it at the provider — e.g. SendGrid → Settings → API Keys → give the key the required scopes (or Full Access), or create a new key — then update this connection's credential and try again.",detail:t}:{headline:"The action returned an error.",detail:t}}function nt(s){const t=ls(s)?s.body??s.raw:null;return(t==null?void 0:t.apiCalls)??[]}function ve(){const[s,t]=j.useState(""),[n,l]=j.useState(void 0),[o,i]=j.useState(!1);return{text:s,value:n,invalid:o,onChange:r=>{t(r);const d=r.trim();if(d===""){i(!1);return}try{const u=JSON.parse(d);u!==null&&typeof u=="object"&&!Array.isArray(u)?(l(u),i(!1)):i(!0)}catch{i(!0)}}}}function at({appId:s,actions:t,connectionId:n,action:l,seedValues:o,onSavedTestsChanged:i,seedTestId:a,onDirtyChange:r,onTestSaved:d,onDeleted:u,embedded:m=!1}){var He;const w=x.useW6WApi(),h=j.useMemo(()=>{const c=[...t];return c.sort((y,R)=>(y.title||y.key).localeCompare(R.title||R.key)),c},[t]),[v,S]=j.useState((l==null?void 0:l.key)??""),N=l??t.find(c=>c.key===v)??null,[p,C]=j.useState(!1),[$,A]=j.useState(null),[T,g]=j.useState(void 0),[k,f]=j.useState([]),b=ve(),O=ve(),I=ve(),[ue,bs]=j.useState(""),[we,Ss]=j.useState(""),Re=b.invalid||O.invalid||I.invalid,ks=()=>{const c={};return b.text.trim()!==""&&b.value!==void 0&&(c.body=b.value),O.text.trim()!==""&&O.value!==void 0&&(c.query=O.value),I.text.trim()!==""&&I.value!==void 0&&(c.headers=I.value),ue&&(c.target=ue),we.trim()!==""&&(c.match=we.trim()),Object.keys(c).length>0?c:void 0},[J,me]=j.useState("form"),[Cs,Ie]=j.useState(""),[$s,Me]=j.useState(!1),[B,Oe]=j.useState(!1),M=(N==null?void 0:N.key)??null,Pe=o?{...o}:Ge(N),[Fe,G]=j.useState(()=>({key:M,values:Pe})),[P,W]=j.useState(a??null),[_e,Q]=j.useState(Pe);if(Fe.key!==M){const c=Ge(N);G({key:M,values:c}),Q(c),W(a??null),A(null),g(void 0),f([])}const[As,Ts]=j.useState(a);a!==As&&(Ts(a),W(a??null));const[Le,Es]=j.useState(o);if(o!==Le){const c=JSON.stringify(o??null)!==JSON.stringify(Le??null);if(Es(o),o&&c){const y={...o};G({key:M,values:y}),Q(y),A(null),g(void 0),f([])}}const _=Fe.values,Be=c=>G({key:M,values:c}),De=j.useMemo(()=>JSON.stringify(_)!==JSON.stringify(_e),[_,_e]);j.useEffect(()=>{r==null||r(De)},[De]);const Rs=()=>{Ie(JSON.stringify(_,null,2)),Me(!1),me("json")},Is=async c=>{if(!N||Re)return;const y=N.key;C(!0),A(null),g(void 0),f([]);let R;const ze=ks();try{const D=await w.invokeAction(s,y,c,{connectionId:n,...ze?{overrides:ze}:{}});g(D.value),f(D.apiCalls??[]),R={ok:!0,summary:"OK",result:D.value}}catch(D){const Ve=tt(D);A(Ve),f(nt(D)),R={ok:!1,summary:Ve.headline}}finally{C(!1)}if(n)try{await w.recordTestRun(n,{savedTestId:P??null,actionKey:y,ok:R.ok,summary:R.summary.slice(0,200),result:R.result}),je(),Us(),i==null||i()}catch{}},Ms=()=>Is(_),[Z,Ue]=j.useState(null),[X,q]=j.useState(null),[Os,Ps]=j.useState(0),[Fs,ee]=j.useState(!1),[he,pe]=j.useState(""),[_s,xe]=j.useState(!1),je=()=>Ps(c=>c+1);j.useEffect(()=>{if(!n){Ue(null);return}let c=!1;return q(null),w.listSavedTests(n).then(y=>!c&&Ue(y)).catch(y=>!c&&q(y.message)),()=>{c=!0}},[w,n,Os]);const Je=M?(Z??[]).filter(c=>c.actionKey===M):[],[Ls,fe]=j.useState(null),[Bs,Ds]=j.useState(0),Us=()=>Ds(c=>c+1);j.useEffect(()=>{const c=w.listTestRuns;if(!n||!c){fe(null);return}let y=!1;return c(n).then(R=>!y&&fe(R)).catch(()=>!y&&fe(null)),()=>{y=!0}},[w,n,Bs]);const We=M?(Ls??[]).filter(c=>c.actionKey===M).slice().sort((c,y)=>Date.parse(y.occurredAt)-Date.parse(c.occurredAt)):[],Js=()=>{!n||!N||(pe(""),q(null),ee(!0))},Ws=()=>{!n||!N||(P?qe():Js())},qe=async()=>{if(!(!n||!N))try{let c;if(P)c=await w.updateSavedTest(n,P,{values:_});else{const y=he.trim();if(!y)return;c=await w.createSavedTest(n,{actionKey:N.key,name:y,values:_}),W(c.id)}Q({..._}),ee(!1),pe(""),je(),i==null||i(),d==null||d(c)}catch(c){q(c.message)}},qs=c=>{const y={...c.values};G({key:M,values:y}),Q(y),W(c.id),me("form"),A(null),g(void 0),f([])},Ks=async()=>{if(!n||!P)return;const c=P;try{await w.deleteSavedTest(n,c),W(null),je(),i==null||i(),u==null||u(c)}catch(y){q(y.message)}},Hs=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1-5)"},children:[e.jsxs("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"Parameters"}),e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-1)"},children:[e.jsx("button",{type:"button",className:`w6w-btn w6w-btn-sm w6w-btn-ghost${J==="form"?" active":""}`,"aria-pressed":J==="form",onClick:()=>me("form"),children:"Form"}),e.jsx("button",{type:"button",className:`w6w-btn w6w-btn-sm w6w-btn-ghost${J==="json"?" active":""}`,"aria-pressed":J==="json",onClick:Rs,children:"JSON"}),!m&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-sm w6w-btn-ghost","aria-pressed":B,title:B?"Collapse the params editor":"Open the params editor in a larger view","aria-label":B?"Collapse the params editor":"Open the params editor in a larger view",onClick:()=>Oe(c=>!c),children:B?"⤡":"⤢"})]})]}),J==="form"?e.jsx(x.ParamsForm,{params:(N==null?void 0:N.params)??[],values:_,onChange:Be}):e.jsxs(e.Fragment,{children:[e.jsx(x.JsonEditor,{value:Cs,onChange:Ie,minHeight:B?"50vh":"200px","aria-label":"Params JSON",onValidChange:c=>{c!==null&&typeof c=="object"&&!Array.isArray(c)&&Be(c)},onValidityChange:({valid:c})=>Me(!c)}),$s&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]})]}),zs=e.jsxs("details",{className:"w6w-section","data-testid":"overrides-region",children:[e.jsxs("summary",{className:"w6w-section-summary",children:[e.jsx("span",{className:"w6w-section-title",children:"Overrides"}),e.jsx("span",{className:"w6w-section-subtitle",children:"Reach a vendor field this action's own params don't declare"})]}),e.jsxs("div",{className:"w6w-stack w6w-section-body",style:{gap:"var(--w6w-sp-2)"},children:[e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Body"}),e.jsx(x.JsonEditor,{value:b.text,onChange:b.onChange,minHeight:"80px","aria-label":"Overrides body (JSON)"}),b.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Query"}),e.jsx(x.JsonEditor,{value:O.text,onChange:O.onChange,minHeight:"80px","aria-label":"Overrides query (JSON)"}),O.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Headers"}),e.jsx(x.JsonEditor,{value:I.text,onChange:I.onChange,minHeight:"80px","aria-label":"Overrides headers (JSON)"}),I.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Target"}),e.jsxs("select",{"aria-label":"Overrides target",value:ue,onChange:c=>bs(c.target.value),children:[e.jsx("option",{value:"",children:"— default (first) —"}),e.jsx("option",{value:"first",children:"first"}),e.jsx("option",{value:"first-write",children:"first-write"}),e.jsx("option",{value:"all",children:"all"})]})]}),e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Match"}),e.jsx("input",{type:"text","aria-label":"Overrides match",value:we,placeholder:"Restrict to requests whose URL contains…",onChange:c=>Ss(c.target.value)})]}),e.jsx("span",{className:"w6w-hint",children:"Merged onto the outbound request at the wire, never into the params above — name a field the way the vendor's own API documents it."})]})]}),se=n?e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1-5)"},children:[e.jsx("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:e.jsx("span",{className:"w6w-muted w6w-small",children:"Saved tests"})}),X&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:X}),Je.length===0?e.jsx("p",{className:"w6w-muted w6w-small",children:"No saved tests for this action yet."}):e.jsx("ul",{className:"w6w-stack",style:{listStyle:"none",margin:0,padding:0,gap:"var(--w6w-sp-1-5)"},children:Je.map(c=>e.jsx("li",{children:e.jsx(U,{title:c.name,subtitle:c.lastRunAt?e.jsxs("span",{children:[e.jsx("span",{style:{color:c.lastRunOk?"var(--w6w-success)":"var(--w6w-danger)"},children:c.lastRunOk?"✓":"✗"})," ",c.lastRunSummary?`${c.lastRunSummary} · `:"",Ne(c.lastRunAt)]}):`saved ${Ne(c.updatedAt)}`,active:c.id===P,onClick:()=>qs(c)})},c.id))}),w.listTestRuns&&We.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:e.jsx("span",{className:"w6w-muted w6w-small",children:"Recent runs"})}),e.jsx("ul",{className:"w6w-stack",style:{listStyle:"none",margin:0,padding:0,gap:"var(--w6w-sp-1-5)"},children:We.map(c=>e.jsx("li",{children:e.jsx(U,{title:e.jsxs("span",{children:[e.jsx("span",{style:{color:c.ok?"var(--w6w-success)":"var(--w6w-danger)"},children:c.ok?"✓":"✗"})," ",c.actionKey]}),subtitle:e.jsxs("span",{children:[c.summary?`${c.summary} · `:"",Ne(c.occurredAt)]})})},c.id))})]})]}):null,Ke=(He=Z==null?void 0:Z.find(c=>c.id===P))==null?void 0:He.name;return e.jsxs("div",{className:`w6w-stack${m?" w6w-tester-embedded-root":""}`,children:[!l&&(t.length===0?e.jsx("p",{className:"w6w-muted w6w-small",children:"This app exposes no actions."}):e.jsxs("label",{className:"w6w-field",children:[e.jsxs("span",{children:["Action",M?"":" *"]}),e.jsx(x.Combobox,{value:v,placeholder:"— pick an action —",onChange:S,options:h.map(c=>({value:c.key,label:`${c.title??c.key} (${c.key})`}))})]})),N?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("strong",{children:[N.title??N.key," ",e.jsx("code",{className:"w6w-muted",children:N.key})]}),N.description&&e.jsx("p",{className:"w6w-muted w6w-small",style:{margin:"var(--w6w-sp-0-5) 0 0"},children:N.description})]}),(()=>{const c=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[Hs,zs,$&&e.jsxs("div",{className:"w6w-result w6w-error",children:[e.jsx("strong",{children:$.headline}),$.hint&&e.jsx("div",{style:{marginTop:"var(--w6w-sp-1-5)"},children:$.hint}),$.detail&&e.jsx("div",{className:"w6w-muted w6w-small",style:{marginTop:"var(--w6w-sp-1-5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:$.detail})]}),T!==void 0&&e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1)"},children:[e.jsx("strong",{className:"w6w-small",children:"Result"}),e.jsx("pre",{className:"w6w-result",children:JSON.stringify(T,null,2)})]}),e.jsx(as,{calls:k})]}),y=e.jsxs("div",{className:`w6w-tester-actions${m||B?" w6w-tester-actions-footer":""}`,style:{display:"flex",gap:"var(--w6w-sp-2)"},children:[e.jsx("button",{type:"button",className:"w6w-btn",disabled:p||Re,onClick:Ms,children:p?"Running…":"Run action"}),n&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:Ws,children:"Save test"}),n&&P&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",style:{marginLeft:"auto",color:"var(--w6w-danger)"},onClick:()=>xe(!0),children:"Delete"})]}),R=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[c,y]});return m?e.jsxs("div",{className:"w6w-tester-embedded",children:[e.jsx("div",{className:"w6w-tester-embedded-scroll",children:se?e.jsxs("div",{className:"w6w-tester-embedded-cols",children:[e.jsx("div",{className:"w6w-tester-embedded-main",children:c}),e.jsx("div",{className:"w6w-tester-embedded-rail",children:se})]}):c}),y]}):B?e.jsx(x.Modal,{title:`Edit params — ${N.title??N.key}`,onClose:()=>Oe(!1),size:"full",children:e.jsxs("div",{className:"w6w-tester-popout",children:[e.jsx("div",{className:"w6w-tester-popout-scroll",children:se?e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-4)",alignItems:"flex-start"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:c}),e.jsx("div",{style:{width:260,flexShrink:0},children:se})]}):c}),y]})}):R})(),Fs&&e.jsx(x.Modal,{title:"Save test",onClose:()=>ee(!1),children:e.jsxs("form",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},onSubmit:c=>{c.preventDefault(),qe()},children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Name this saved test"}),e.jsx("input",{type:"text",value:he,placeholder:"e.g. valid sender",onChange:c=>pe(c.target.value)})]}),X&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:X}),e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-2)",justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>ee(!1),children:"Cancel"}),e.jsx("button",{type:"submit",className:"w6w-btn",disabled:!he.trim(),children:"Save"})]})]})}),_s&&e.jsx(x.ConfirmModal,{title:"Delete saved test",message:Ke?`Delete "${Ke}"? This cannot be undone.`:"Delete this saved test? This cannot be undone.",confirmLabel:"Delete",onConfirm:()=>{xe(!1),Ks()},onClose:()=>xe(!1)})]}):!l&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Pick an action above to test it."})]})}function lt(s){const t=x.useEffectiveTheme(s.theme),{copied:n,copy:l}=F.useCopyToClipboard(s.value),o=j.useMemo(()=>[Gs.yaml(),Qs.EditorView.theme({"&":{fontSize:"13px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",backgroundColor:"var(--w6w-panel-2)",color:"var(--w6w-text)",border:"1px solid var(--w6w-border)",borderRadius:"8px"},"&.cm-focused":{outline:"2px solid var(--w6w-accent)"},".cm-gutters":{backgroundColor:"var(--w6w-panel)",color:"var(--w6w-muted)",border:"none",borderRight:"1px solid var(--w6w-border)"},".cm-scroller":{overflow:"auto"}})],[]);function i(a){s.onChange(a)}return e.jsxs("div",{className:"w6w-yaml-editor","aria-label":s["aria-label"]??"YAML editor",children:[e.jsx(Zs,{value:s.value,onChange:i,extensions:o,placeholder:s.placeholder,readOnly:s.readOnly,editable:!s.readOnly,theme:t,height:s.height,minHeight:s.minHeight??"240px",maxHeight:s.maxHeight,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!s.readOnly,autocompletion:!0,bracketMatching:!0,closeBrackets:!0}}),s.copyable&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${n?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void l(),children:n?e.jsx(F.CheckGlyph,{}):e.jsx(F.CopyGlyph,{})}),e.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:n?"Copied":""})]})]})}const ye="…";function is(s,t,n="end"){if(t===void 0||t<1||t>=s.length)return s;if(n==="start")return`${ye}${s.slice(s.length-t)}`;if(n==="end")return`${s.slice(0,t)}${ye}`;const l=Math.ceil(t/2),o=t-l;return`${s.slice(0,l)}${ye}${s.slice(s.length-o)}`}function rs(s){const{value:t,chars:n,crop:l="end",label:o,className:i,copiedMs:a}=s,r=is(t,n,l),d=["w6w-copyable--bare",i].filter(Boolean).join(" ");return e.jsx(F.Copyable,{value:t,readOnly:!0,label:o,className:d,copiedMs:a,children:e.jsx("span",{children:r})})}const it={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function oe({state:s,label:t,ariaLabel:n}){const l=t??it[s];return e.jsxs("span",{className:`w6w-health-pill w6w-health-pill-${s}`,"aria-label":n,children:[e.jsx("span",{className:"w6w-health-pill-dot","aria-hidden":"true"}),e.jsx("span",{className:"w6w-health-pill-label",children:l})]})}const rt={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function os({days:s,ariaLabel:t}){return s.length===0?null:e.jsx("div",{className:"w6w-uptime-strip",role:"img","aria-label":t??`${s.length}-day status`,children:s.map((n,l)=>e.jsx("span",{className:`w6w-uptime-cell w6w-uptime-cell-${n.state}`,title:n.label??`${n.day} — ${rt[n.state]}`},`${n.day}-${l}`))})}const cs="—",Qe=["B","KiB","MiB","GiB","TiB","PiB"];function ot(s){if(s===null||!Number.isFinite(s))return cs;if(s<1024)return`${Math.round(s)} B`;let t=s,n=0;for(;t>=1024&&n<Qe.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${Qe[n]}`}function L(s){return s===null||!Number.isFinite(s)?cs:`${Math.round(s*100)}%`}function V(s){if(s===void 0||s.load1===null)return null;const t=s.cpuLimit??s.cpus;return t===null||t<=0?null:s.load1/t}function Y(s){if(s===void 0)return null;const{memoryTotal:t,memoryAvailable:n}=s;return t===null||n===null||t<=0?null:(t-n)/t}function ct(s,t,n){return s<t?t:s>n?n:s}function dt(s,t,n,l){const o=s.length;if(o<2)return"";const i=[];for(let a=0;a<o;a++){const r=s[a];if(r===null)continue;const d=a/(o-1)*t,u=l<=0?n:n-ct(r,0,l)/l*n;i.push(`${Number(d.toFixed(2))},${Number(u.toFixed(2))}`)}return i.join(" ")}const ut="—",Ze=100,Xe=24;function $e({values:s,max:t,className:n}){const l=dt(s,Ze,Xe,t);return l===""?null:e.jsx("svg",{className:n,viewBox:`0 0 ${Ze} ${Xe}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:e.jsx("polyline",{points:l,fill:"none",stroke:"var(--w6w-accent)",strokeWidth:2,vectorEffect:"non-scaling-stroke"})})}function ge(s){return s===null?ut:s.toFixed(2)}function ie(s){let t=1;for(const n of s)n!==null&&n>t&&(t=n);return t}function ae({label:s,value:t,values:n,max:l}){return e.jsxs("li",{className:"w6w-server-resources__row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:s}),e.jsx("span",{className:"w6w-server-resources__value",children:t}),e.jsx($e,{className:"w6w-server-resources__spark",values:n,max:l})]})}function Ee(s){const t=s[s.length-1],n=s.map(i=>V(i)),l=s.map(i=>Y(i)),o=s.map(i=>i.processRss);return{last:t,cpuValues:n,memoryValues:l,rssValues:o}}function wt({samples:s,title:t="Server resources",intervalMs:n}){const{last:l,cpuValues:o,memoryValues:i,rssValues:a}=Ee(s);return e.jsxs("section",{className:"w6w-server-resources w6w-server-resources--card","aria-label":t,children:[e.jsx("h3",{className:"w6w-server-resources__title",children:t}),e.jsxs("ul",{className:"w6w-server-resources__rows",children:[e.jsx(ae,{label:"CPU",value:L(V(l)),values:o,max:ie(o)}),e.jsx(ae,{label:"Memory",value:L(Y(l)),values:i,max:1}),e.jsx(ae,{label:"Process",value:ot((l==null?void 0:l.processRss)??null),values:a,max:ie(a)})]}),e.jsx("p",{className:"w6w-server-resources__meta",children:`Load ${ge((l==null?void 0:l.load1)??null)} / ${ge((l==null?void 0:l.load5)??null)} / ${ge((l==null?void 0:l.load15)??null)}`}),n!==void 0&&e.jsx("p",{className:"w6w-server-resources__meta",children:`Sampled every ${n/1e3}s`})]})}function mt({samples:s,title:t="Server"}){const{last:n,cpuValues:l}=Ee(s);return e.jsxs("section",{className:"w6w-server-resources w6w-server-resources--small","aria-label":t,children:[e.jsx("h3",{className:"w6w-server-resources__title",children:t}),e.jsxs("ul",{className:"w6w-server-resources__rows",children:[e.jsx(ae,{label:"CPU",value:L(V(n)),values:l,max:ie(l)}),e.jsxs("li",{className:"w6w-server-resources__row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"Memory"}),e.jsx("span",{className:"w6w-server-resources__value",children:L(Y(n))})]})]})]})}function ht({samples:s,onExpand:t}){const{last:n,cpuValues:l,memoryValues:o}=Ee(s);return e.jsxs("aside",{className:"w6w-server-resources w6w-server-resources--rail",children:[e.jsxs("div",{className:"w6w-server-resources__rail-row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"CPU"}),e.jsx("span",{className:"w6w-server-resources__value",children:L(V(n))}),e.jsx($e,{className:"w6w-server-resources__spark",values:l,max:ie(l)})]}),e.jsxs("div",{className:"w6w-server-resources__rail-row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"MEM"}),e.jsx("span",{className:"w6w-server-resources__value",children:L(Y(n))}),e.jsx($e,{className:"w6w-server-resources__spark",values:o,max:1})]}),t!==void 0&&e.jsx("button",{type:"button",className:"w6w-server-resources__expand","aria-label":"Show server resources",onClick:t,children:"Details"})]})}function pt({samples:s}){const t=s[s.length-1],n=L(V(t)),l=L(Y(t));return e.jsx("span",{className:"w6w-server-resources w6w-server-resources--badge",children:`CPU ${n} · MEM ${l}`})}const xt=1,jt=1440*60*1e3;function ft(s,t,n){const l=t.startedAt??t.updatedAt;if(l===void 0)return null;const o=Date.parse(l),i=t.resolvedAt!==void 0?Date.parse(t.resolvedAt):t.startedAt!==void 0?n:o,a=Date.parse(`${s.from}T00:00:00.000Z`),r=Date.parse(`${s.to}T00:00:00.000Z`)+jt,d=r-a;if(i<a||o>=r)return null;const u=o<a,m=i>r,w=Math.max(o,a),h=Math.min(i,r),v=(w-a)/d*100,S=(h-w)/d*100,N=Math.max(S,xt);return{leftPct:v,widthPct:N,clippedStart:u,clippedEnd:m}}const Nt={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"},vt="This vendor publishes no incident history.",yt="No incidents in this window.";function gt(s){const t=s.startedAt??s.updatedAt,n=[s.title];return s.components!==void 0&&s.components.length>0&&n.push(`(${s.components.join(", ")})`),t!==void 0&&n.push(s.resolvedAt!==void 0?`${t} – ${s.resolvedAt}`:`${t} – ongoing`),n.join(" ")}function bt({window:s,days:t,incidents:n,vendorEmptyLabel:l,nowMs:o=Date.now(),ariaLabel:i}){const a=t.length,r=a>0?100/a:0,d=n===void 0?l??vt:n.length===0?l??yt:null;return e.jsx("div",{className:"w6w-history-timeline",role:"img","aria-label":i??`${a}-day history`,children:e.jsxs("div",{className:"w6w-history-plot",children:[e.jsx("div",{className:"w6w-history-lane w6w-history-lane-execution",children:t.map((u,m)=>e.jsx("span",{className:`w6w-history-cell w6w-history-cell-${u.state}`,style:{left:`${m*r}%`,width:`${r}%`},title:u.label??`${u.day} — ${Nt[u.state]}`},`${u.day}-${m}`))}),e.jsx("div",{className:"w6w-history-lane w6w-history-lane-vendor",children:d!==null?e.jsx("span",{className:"w6w-history-empty",title:d,children:d}):n==null?void 0:n.map((u,m)=>{const w=ft(s,u,o);if(w===null)return null;const h=[w.clippedStart?"w6w-history-bar-clip-start":"",w.clippedEnd?"w6w-history-bar-clip-end":""].filter(Boolean).join(" ");return e.jsx("span",{className:`w6w-history-bar w6w-history-bar-${u.state}${h?` ${h}`:""}`,style:{left:`${w.leftPct}%`,width:`${w.widthPct}%`},title:gt(u)},u.id??`${u.title}-${m}`)})}),e.jsxs("div",{className:"w6w-history-axis",children:[e.jsx("span",{className:"w6w-history-tick w6w-history-tick-start",style:{left:"0%"},children:s.from}),e.jsx("span",{className:"w6w-history-tick w6w-history-tick-end",style:{left:"100%"},children:s.to})]})]})})}function St({label:s,children:t,className:n}){const[l,o]=j.useState(!1),i=j.useId();return e.jsxs("span",{className:["w6w-info-tip",n??""].filter(Boolean).join(" "),children:[e.jsx(x.IconButton,{label:s,icon:"info","aria-expanded":l,"aria-controls":i,onClick:()=>o(a=>!a)}),l&&e.jsx("span",{id:i,className:"w6w-info-tip-body w6w-muted w6w-small",children:t})]})}function ds(s){const{label:t,onClick:n,disabled:l,className:o,...i}=s;return e.jsx(x.IconButton,{label:t,onClick:n,disabled:l,className:o,icon:"edit","data-testid":i["data-testid"]})}function us(s){const{label:t,onClick:n,disabled:l,className:o,...i}=s;return e.jsx(x.IconButton,{label:t,onClick:n,disabled:l,className:o,danger:!0,icon:"delete","data-testid":i["data-testid"]})}function kt(s){const{branch:t,shortSha:n,lastSyncLabel:l,onSyncNow:o,syncing:i,className:a,...r}=s,[d,u]=j.useState(!1),m=j.useRef(null);return j.useEffect(()=>{if(!d)return;const w=v=>{m.current&&!m.current.contains(v.target)&&u(!1)},h=v=>v.key==="Escape"&&u(!1);return document.addEventListener("mousedown",w),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",h)}},[d]),e.jsxs("div",{className:`w6w-repo-sync${a?` ${a}`:""}`,ref:m,"data-testid":r["data-testid"],children:[e.jsxs("button",{type:"button",className:"w6w-repo-sync-trigger","aria-haspopup":"menu","aria-expanded":d,"aria-busy":i,onClick:()=>u(w=>!w),children:[e.jsxs("span",{className:"w6w-repo-sync-icon",children:[e.jsx(F.Icon,{name:"github"}),i&&e.jsx(F.Icon,{name:"sync",size:10,className:"w6w-repo-sync-spin"})]}),e.jsx("span",{className:"w6w-repo-sync-branch",children:t}),n!=null&&e.jsx("code",{className:"w6w-repo-sync-sha",children:n})]}),d&&e.jsxs("div",{className:"w6w-repo-sync-menu",role:"menu",children:[e.jsxs("div",{className:"w6w-repo-sync-detail",children:[e.jsx("span",{children:t}),n!=null&&e.jsx("code",{children:n}),l!=null&&e.jsx("span",{children:l})]}),e.jsx("button",{type:"button",role:"menuitem",className:"w6w-repo-sync-item","data-testid":"repo-sync-now",disabled:i,onClick:o,children:i?"Syncing…":"Sync now"})]})]})}const Ct={pending:"Pending",running:"Running",succeeded:"Succeeded",failed:"Failed",skipped:"Skipped",queued:"Queued",canceled:"Canceled"};function ce({state:s,label:t,ariaLabel:n}){const l=t??Ct[s];return e.jsxs("span",{className:`w6w-step-pill w6w-step-pill-${s}`,"aria-label":n,children:[e.jsx("span",{className:"w6w-step-pill-dot","aria-hidden":"true"}),e.jsx("span",{className:"w6w-step-pill-label",children:l})]})}const $t="—",be=1e3,Se=6e4;function de(s){return s==null||!Number.isFinite(s)||s<0?$t:s<be?`${Math.round(s)} ms`:s<Se?`${(s/be).toFixed(1)} s`:`${Math.floor(s/Se)}m ${Math.round(s%Se/be)}s`}function z(s){const t=new Date(s);return Number.isNaN(t.getTime())?s:t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}const At={function:"Function",endpoint:"Endpoint",workflow:"Workflow"};function Tt({items:s,selectedId:t=null,onSelect:n,showCallable:l=!1,loading:o=!1,emptyLabel:i,hasPrev:a,hasNext:r,onPrev:d,onNext:u}){const m=d||u?e.jsxs("div",{className:"w6w-execution-list-pager",children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-list-prev",disabled:!a,onClick:d,children:"Previous"}),e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-list-next",disabled:!r,onClick:u,children:"Next"})]}):null;let w;return o&&s.length===0?w=e.jsx("p",{"data-testid":"execution-list-loading",children:"Loading…"}):s.length===0?w=e.jsx("p",{"data-testid":"execution-list-empty",children:i??"No executions yet."}):w=e.jsx("ul",{className:"w6w-execution-list-rows",children:s.map(h=>e.jsx("li",{"data-testid":"execution-row","data-execution-id":h.id,children:e.jsx(U,{icon:e.jsx(ce,{state:h.status}),title:l?h.callableName:z(h.startedAt),subtitle:l?`${At[h.kind]} · ${z(h.startedAt)}`:h.id,trailing:de(h.durationMs),active:h.id===t,onClick:n?()=>n(h.id):void 0})},h.id))}),e.jsxs("div",{className:"w6w-execution-list","data-testid":"execution-list",children:[w,m]})}function ws({steps:s,emptyLabel:t,onDismiss:n,runError:l,stepErrors:o}){const i=n?e.jsx("div",{className:"w6w-execution-log-head",children:e.jsx(x.IconButton,{label:"Dismiss run log","data-testid":"execution-log-dismiss",onClick:n,children:"×"})}):null,a=o??[],r=l||a.length>0?e.jsxs("div",{className:"w6w-execution-log-errors w6w-stack",children:[l&&e.jsx(Ae,{error:l}),a.map((d,u)=>e.jsx(Ae,{label:d.label??d.stepId,error:d.error},`${d.stepId}:${u}`))]}):null;return s.length===0?e.jsxs(e.Fragment,{children:[i,r,e.jsx("div",{className:"w6w-execution-log-empty",children:e.jsx("p",{className:"w6w-muted w6w-small",children:t??"No steps have run yet."})})]}):e.jsxs(e.Fragment,{children:[i,r,e.jsx("ol",{className:"w6w-execution-log",children:s.map(d=>e.jsx(Et,{step:d},d.id))})]})}function Et({step:s}){const[t,n]=j.useState(!1),l=e.jsxs("div",{className:"w6w-execution-log-row-header",children:[e.jsx(ce,{state:s.status}),e.jsx("span",{className:"w6w-execution-log-row-label",children:s.label??s.id}),e.jsx(Rt,{startedAt:s.startedAt,finishedAt:s.finishedAt})]}),o=s.error?e.jsx(Ae,{error:s.error}):null;return s.input===void 0&&s.output===void 0&&!s.meta?e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsx("div",{className:"w6w-section",children:l}),o]}):e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsxs("details",{className:"w6w-section",open:t,onToggle:i=>n(i.currentTarget.open),children:[e.jsx("summary",{className:"w6w-section-summary",children:l}),t&&e.jsxs("div",{className:"w6w-execution-log-row-body w6w-section-body w6w-stack",children:[e.jsx(es,{title:"Input",value:s.input}),e.jsx(es,{title:"Output",value:s.output}),s.meta&&e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:"Metadata"}),e.jsx(re.CodeBlock,{code:JSON.stringify(s.meta,null,2),language:"json"})]})]})]}),o]})}function Ae({error:s,label:t}){return e.jsxs("div",{className:"w6w-result w6w-error",children:[t!==void 0&&e.jsx("strong",{className:"w6w-execution-log-error-label",children:t}),s.code&&e.jsx("div",{className:"w6w-small w6w-execution-log-error-code",children:e.jsx("code",{children:s.code})}),s.message]})}function Rt({startedAt:s,finishedAt:t}){if(s&&t){const n=It(s,t);return e.jsxs("span",{className:"w6w-execution-log-timing",children:[s," → ",t,n&&e.jsxs("span",{children:[" (",n,")"]})]})}return s?e.jsxs("span",{className:"w6w-execution-log-timing",children:["Started ",s]}):e.jsx("span",{className:"w6w-execution-log-timing",children:"—"})}function It(s,t){const n=Date.parse(s),l=Date.parse(t);if(!Number.isFinite(n)||!Number.isFinite(l)||l<n)return null;const o=l-n;if(o<1e3)return`${o}ms`;const i=o/1e3;if(i<60)return`${i.toFixed(1)}s`;const a=Math.floor(i/60),r=Math.round(i%60);return`${a}m ${r}s`}function es({title:s,value:t}){return e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:s}),t===void 0?e.jsx("p",{className:"w6w-muted w6w-small",children:"Not available."}):e.jsx(re.CodeBlock,{code:JSON.stringify(t,null,2),language:"json"})]})}const Mt={status:"",kind:"",from:"",to:"",q:""},Ot=[{value:"",label:"Any status"},{value:"queued",label:"Queued"},{value:"running",label:"Running"},{value:"succeeded",label:"Succeeded"},{value:"failed",label:"Failed"},{value:"canceled",label:"Canceled"}],Pt=[{value:"",label:"Any type"},{value:"function",label:"Function"},{value:"endpoint",label:"Endpoint"},{value:"workflow",label:"Workflow"}];function Ft({value:s,onChange:t,showKind:n=!1,searchPlaceholder:l="Search by id or name",disabled:o=!1}){const i=s.status!==""||s.kind!==""||s.from!==""||s.to!==""||s.q!=="";return e.jsxs("div",{className:"w6w-execution-filters","data-testid":"execution-filters",children:[e.jsx("input",{type:"search",className:"w6w-execution-filters-search","data-testid":"execution-filter-q","aria-label":"Search executions",placeholder:l,value:s.q,disabled:o,onChange:a=>t({...s,q:a.target.value})}),e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-status","aria-label":"Status",value:s.status,disabled:o,onChange:a=>t({...s,status:a.target.value}),children:Ot.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}),n&&e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-kind","aria-label":"Type",value:s.kind,disabled:o,onChange:a=>t({...s,kind:a.target.value}),children:Pt.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}),e.jsx("input",{type:"date",className:"w6w-execution-filters-date","data-testid":"execution-filter-from","aria-label":"From date",value:s.from,disabled:o,onChange:a=>t({...s,from:a.target.value})}),e.jsx("input",{type:"date",className:"w6w-execution-filters-date","data-testid":"execution-filter-to","aria-label":"To date",value:s.to,disabled:o,onChange:a=>t({...s,to:a.target.value})}),i&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-execution-filters-clear","data-testid":"execution-filter-clear",disabled:o,onClick:()=>t({...Mt}),children:"Clear"})]})}const le="—";function _t({stats:s,label:t}){const n=[{testid:"execution-stat-total",label:"Executions",value:s?String(s.total):le},{testid:"execution-stat-success-rate",label:"Success rate",value:Lt(s==null?void 0:s.successRate)},{testid:"execution-stat-failed",label:"Failed",value:s?String(s.failed):le},{testid:"execution-stat-avg-duration",label:"Avg duration",value:s?de(s.avgDurationMs):le}];return s&&s.inFlight>0&&n.push({testid:"execution-stat-in-flight",label:"In flight",value:String(s.inFlight)}),e.jsxs("section",{className:"w6w-execution-stats","data-testid":"execution-stats",children:[t!=null&&e.jsx("p",{className:"w6w-execution-stats-label",children:t}),e.jsx("div",{className:"w6w-execution-stats-cards",children:n.map(l=>e.jsxs("div",{className:"w6w-execution-stat","data-testid":l.testid,children:[e.jsx("span",{className:"w6w-execution-stat-value","data-stat-value":l.value,children:l.value}),e.jsx("span",{className:"w6w-execution-stat-label",children:l.label})]},l.testid))})]})}function Lt(s){return s==null||!Number.isFinite(s)?le:`${Math.round(s*100)}%`}const Bt={function:"Function",endpoint:"Endpoint",workflow:"Workflow"};function Dt(s){return JSON.stringify(s,null,2)??"null"}function Ut({execution:s,loading:t=!1,errorMessage:n,onClose:l,onOpenInEditor:o}){return e.jsxs("section",{className:"w6w-execution-detail w6w-stack","data-testid":"execution-detail",children:[n!=null&&e.jsx("p",{role:"alert",className:"w6w-execution-detail-error-message","data-testid":"execution-detail-error-message",children:n}),s?e.jsx(Jt,{execution:s,onClose:l,onOpenInEditor:o}):t?e.jsx("p",{className:"w6w-muted","data-testid":"execution-detail-loading",children:"Loading…"}):e.jsx("p",{className:"w6w-muted","data-testid":"execution-detail-empty",children:"No execution selected."})]})}function Jt({execution:s,onClose:t,onOpenInEditor:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"w6w-execution-detail-head",children:[e.jsxs("div",{className:"w6w-execution-detail-title",children:[e.jsx("h3",{className:"w6w-execution-detail-name",children:s.callableName}),e.jsxs("div",{className:"w6w-execution-detail-meta",children:[e.jsx(ce,{state:s.status}),e.jsx("span",{className:"w6w-execution-detail-kind w6w-muted w6w-small",children:Bt[s.kind]})]})]}),(n||t)&&e.jsxs("div",{className:"w6w-execution-detail-actions",children:[n&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-detail-open-editor",onClick:n,children:"Open in visual editor"}),t&&e.jsx(x.IconButton,{label:"Close","data-testid":"execution-detail-close",onClick:t,children:"×"})]})]}),e.jsx("p",{className:"w6w-execution-detail-id-line",children:e.jsx("code",{className:"w6w-execution-detail-id","data-testid":"execution-detail-id",children:s.id})}),e.jsxs("dl",{className:"w6w-execution-detail-timing",children:[e.jsx(ke,{label:"Started",value:z(s.startedAt)}),e.jsx(ke,{label:"Finished",value:s.finishedAt?z(s.finishedAt):"—"}),e.jsx(ke,{label:"Duration",value:de(s.durationMs)})]}),s.steps!==void 0&&e.jsxs("section",{className:"w6w-execution-detail-section w6w-stack","data-testid":"execution-detail-steps",children:[e.jsx("strong",{className:"w6w-small",children:"Steps"}),e.jsx(ws,{steps:s.steps,emptyLabel:"No steps ran."})]}),s.input!==void 0&&e.jsx(Ce,{title:"Input",testid:"execution-detail-input",value:s.input}),s.output!==void 0&&e.jsx(Ce,{title:"Output",testid:"execution-detail-output",value:s.output}),s.error!=null&&e.jsx(Ce,{title:"Error",testid:"execution-detail-error",value:s.error})]})}function ke({label:s,value:t}){return e.jsxs("div",{className:"w6w-execution-detail-timing-item",children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:t})]})}function Ce({title:s,testid:t,value:n}){return e.jsxs("section",{className:"w6w-execution-detail-section w6w-stack","data-testid":t,children:[e.jsx("strong",{className:"w6w-small",children:s}),e.jsx(re.CodeBlock,{code:Dt(n),language:"json"})]})}function ms(s){const t=[];for(const n of s)n.p95Ms!==null&&t.push({appId:n.appId,displayName:n.displayName,calls:n.calls,p95Ms:n.p95Ms,state:n.state,errorCount:n.errors.e4xx+n.errors.e429+n.errors.eAuth+n.errors.e5xx});return t}function Wt(s){return s.attention==="now"||s.attention==="recent"}function hs(s){const t={now:[],recent:[],clear:[]};for(const n of s)n.attention==="now"?t.now.push(n):n.attention==="recent"?t.recent.push(n):t.clear.push(n);return t}function ps(s){return s.uptime.map(t=>({day:t.day,state:t.state}))}const Te=3,xs=5;function js(s,t={}){const n=t.compact??!1,{now:l,recent:o}=hs(s),i=l.length+o.length,a=n?l.slice(0,Te):l,r=n?o.slice(0,Math.max(0,Te-a.length)):o,d=n?s.slice(0,t.limit??xs):[...s];return{attentionCount:i,shownNow:a,shownRecent:r,hiddenAttentionCount:i-a.length-r.length,shownTable:d,hiddenTableCount:s.length-d.length}}const ne=640,K=340,E={top:16,right:24,bottom:40,left:56};function ss(s){if(s<=0)return 1;const t=10**Math.floor(Math.log10(s)),n=[1,2,5,10];for(const l of n)if(s<=l*t)return l*t;return 10*t}function ts(s,t=5){return Array.from({length:t+1},(n,l)=>Math.round(s*l/t))}function fs({services:s,getHref:t,onOpen:n}){const l=ms(s);if(l.length===0)return e.jsx("p",{className:"w6w-muted w6w-small",children:"No timed calls in this window yet."});const o=ss(Math.max(...l.map(p=>p.calls))),i=ss(Math.max(...l.map(p=>p.p95Ms))),a=Math.max(1,...l.map(p=>p.errorCount)),r=ne-E.left-E.right,d=K-E.top-E.bottom,u=p=>E.left+p/o*r,m=p=>E.top+p/i*d,w=p=>16+p/a*14,h=ts(o),v=ts(i),S=18,N=E.top+d/2;return e.jsxs("div",{className:"w6w-rel-scatter",children:[e.jsxs("svg",{viewBox:`0 0 ${ne} ${K}`,style:{aspectRatio:`${ne} / ${K}`},role:"img","aria-label":"API performance: calls versus p95 latency, one point per API",children:[e.jsx("rect",{x:E.left,y:E.top,width:r,height:d,className:"w6w-rel-scatter-plot-bg"}),v.map(p=>e.jsxs("g",{children:[e.jsx("line",{x1:E.left,x2:ne-E.right,y1:m(p),y2:m(p),className:"w6w-rel-scatter-grid"}),e.jsx("text",{x:E.left-8,y:m(p),className:"w6w-rel-scatter-axis-label",textAnchor:"end",children:p})]},`y-${p}`)),h.map(p=>e.jsx("text",{x:u(p),y:K-E.bottom+18,className:"w6w-rel-scatter-axis-label",textAnchor:"middle",children:p},`x-${p}`)),e.jsx("text",{x:S,y:N,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",transform:`rotate(-90, ${S}, ${N})`,children:"p95 (ms)"}),e.jsx("text",{x:E.left+r/2,y:K-4,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",children:"calls in this window"}),l.map(p=>{const C=w(p.errorCount),$=u(p.calls),A=m(p.p95Ms),T=e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:$,cy:A,r:C/2+2.5,className:`w6w-rel-scatter-ring w6w-rel-scatter-ring-${p.state}`,children:e.jsxs("title",{children:[p.displayName," — ",p.calls," calls, ",p.p95Ms," ms p95, ",p.errorCount," errors"]})}),e.jsx("circle",{cx:$,cy:A,r:C/2,className:`w6w-rel-scatter-point w6w-rel-scatter-point-${p.state}`})]});return t?e.jsx("a",{href:t(p.appId),className:"w6w-rel-scatter-point-link",onClick:n?g=>n(p.appId,g):void 0,children:T},p.appId):n?e.jsx("g",{role:"button",tabIndex:0,className:"w6w-rel-scatter-point-link",onClick:g=>n(p.appId,g),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.currentTarget.dispatchEvent(new MouseEvent("click",{bubbles:!0})))},children:T},p.appId):e.jsx("g",{children:T},p.appId)})]}),e.jsx("p",{className:"w6w-muted w6w-small w6w-rel-scatter-note",children:"Up is faster, right is more calls — top-right is the best outcome. Icon size is the error count in this window; ring colour is exec status."})]})}function ns(s){const t=new Date(s);return Number.isNaN(t.getTime())?s:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ns({appId:s,className:t,title:n,getHref:l,onOpen:o,children:i}){return l?e.jsx("a",{className:t,href:l(s),title:n,onClick:o?a=>o(s,a):void 0,children:i}):o?e.jsx("button",{type:"button",className:t,title:n,onClick:a=>o(s,a),children:i}):e.jsx("div",{className:t,title:n,children:i})}function vs({service:s}){return e.jsxs("span",{className:"w6w-rel-signal",children:[e.jsx(oe,{state:s.state}),s.ongoingOutageId&&e.jsx("span",{className:"w6w-rel-tag",children:"outage open"}),s.calls===0&&e.jsx("span",{className:"w6w-muted w6w-small",children:"no calls"})]})}function ys({vendor:s}){if(!s)return e.jsx("span",{className:"w6w-muted w6w-small",children:"not published"});const t=s.state==="unknown";return e.jsxs("span",{className:"w6w-rel-signal",title:s.message??void 0,children:[e.jsx(oe,{state:s.state,label:t?"Unavailable":void 0}),!t&&s.message&&e.jsx("span",{className:"w6w-rel-vendor-msg w6w-small",children:s.message})]})}function qt({service:s,getHref:t,onOpen:n}){return e.jsxs(Ns,{appId:s.appId,className:"w6w-rel-issue-card",title:`${s.displayName} — open service detail`,getHref:t,onOpen:n,children:[e.jsxs("span",{className:"w6w-rel-issue-head",children:[e.jsx(x.AppIcon,{src:s.iconSrc,srcDark:s.iconSrcDark,brandColor:s.brandColor,name:s.displayName,size:24}),e.jsxs("span",{className:"w6w-rel-issue-head-text",children:[e.jsx("strong",{children:s.displayName}),s.attention==="recent"&&e.jsx("span",{className:"w6w-muted w6w-small",children:"trouble earlier in this window"})]})]}),e.jsxs("span",{className:"w6w-rel-issue-signals",children:[e.jsxs("span",{className:"w6w-rel-issue-signal",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"w6w exec"}),e.jsx(vs,{service:s})]}),e.jsxs("span",{className:"w6w-rel-issue-signal",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"API status"}),e.jsx(ys,{vendor:s.vendorStatus})]})]})]})}function Kt({service:s,getHref:t,onOpen:n}){const l=s.calls===0;return e.jsxs("tr",{className:`w6w-rel-tr${s.attention!=="none"?" w6w-rel-attention":""}`,"data-attention":s.attention==="none"?void 0:s.attention,children:[e.jsx("td",{className:"w6w-rel-td-service",children:e.jsxs(Ns,{appId:s.appId,className:"w6w-rel-open",getHref:t,onOpen:n,children:[e.jsx(x.AppIcon,{src:s.iconSrc,srcDark:s.iconSrcDark,brandColor:s.brandColor,name:s.displayName,size:28}),e.jsxs("span",{className:"w6w-rel-td-service-text",children:[e.jsx("strong",{children:s.displayName}),e.jsx("code",{className:"w6w-muted w6w-small",children:s.appId})]})]})}),e.jsxs("td",{className:"w6w-rel-td-status",children:[e.jsxs("span",{className:"w6w-rel-status-row",children:[e.jsx("span",{className:"w6w-rel-status-label w6w-muted w6w-small",children:"Ops"}),e.jsx(vs,{service:s})]}),e.jsxs("span",{className:"w6w-rel-status-row",children:[e.jsx("span",{className:"w6w-rel-status-label w6w-muted w6w-small",children:"API"}),e.jsx(ys,{vendor:s.vendorStatus})]})]}),e.jsx("td",{className:"w6w-rel-td-uptime",children:l?e.jsx("span",{className:"w6w-rel-idle-note",children:"No calls in this window"}):e.jsxs(e.Fragment,{children:[e.jsx(os,{days:ps(s),ariaLabel:`${s.displayName}, ${s.uptime.length}-day status, oldest day first`}),e.jsxs("span",{className:"w6w-muted w6w-small",children:[s.calls," calls"]})]})}),e.jsx("td",{className:"w6w-rel-td-p95",children:s.p95Ms===null?"—":`${s.p95Ms} ms`})]})}function Ht({services:s,window:t,days:n,compact:l=!1,showChart:o,limit:i,getHref:a,onOpen:r,showAllHref:d,onShowAll:u,slots:m}){const w=n??(t==null?void 0:t.days)??30,h=s.length>0&&s.every(k=>k.calls>0&&k.state==="ok"),{attentionCount:v,shownNow:S,shownRecent:N,hiddenAttentionCount:p,shownTable:C,hiddenTableCount:$}=js(s,{compact:l,limit:i}),A=o??!l,T=d!==void 0||u!==void 0,g=k=>{const f=k.startsWith("Show")?"w6w-muted w6w-small":void 0;return d!==void 0?e.jsx("a",{href:d,className:f,onClick:u,children:k}):u?e.jsx("button",{type:"button",className:`w6w-rel-show-all${f?` ${f}`:""}`,onClick:u,children:k}):null};return e.jsxs("section",{className:"w6w-rel-section",children:[e.jsxs("h3",{className:"w6w-rel-heading",children:[e.jsxs("span",{children:[(m==null?void 0:m.header)??"Service reliability"," ",t&&e.jsxs("span",{className:"w6w-muted w6w-small",children:[ns(t.from)," – ",ns(t.to)," · ",t.days," days"]})]}),l&&g("Show all services →"),m==null?void 0:m.actions]}),e.jsxs("div",{className:l?"w6w-rel-card":void 0,children:[e.jsx("p",{className:"w6w-muted w6w-small w6w-rel-intro",children:"Connected services across your account. Performance for the selected project."}),h&&e.jsxs("div",{className:l?"w6w-rel-allclear":"w6w-rel-card w6w-rel-allclear",children:[e.jsx("h4",{children:"All clear"}),e.jsxs("p",{children:["Every service you called in the last ",w," days came back"," ",e.jsx(oe,{state:"ok"})," — no degraded stretches, no outages."]})]}),s.length===0&&((m==null?void 0:m.empty)??e.jsx("div",{className:l?void 0:"w6w-rel-card",children:e.jsx("p",{className:"w6w-muted",children:"No services yet — connect an integration or use a service in this project."})})),s.length>0&&e.jsxs(e.Fragment,{children:[v>0&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsxs("h4",{className:"w6w-rel-group-head",children:["Needs attention"," ",e.jsxs("span",{className:"w6w-muted w6w-small",children:[S.length+N.length," of ",v]})]}),e.jsx("div",{className:"w6w-rel-issues",children:[...S,...N].map(k=>e.jsx(qt,{service:k,getHref:a,onOpen:r},k.appId))}),p>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[p," more ",p===1?"needs":"need"," ","attention",T&&e.jsxs(e.Fragment,{children:[" — ",g("view all →")]})]})]}),A&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsx("h4",{className:"w6w-rel-group-head",children:"Performance across your APIs"}),e.jsx(fs,{services:s,getHref:a,onOpen:r})]}),C.length>0&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsxs("h4",{className:"w6w-rel-group-head",children:[l?"Services":"All services"," ",e.jsx("span",{className:"w6w-muted w6w-small",children:l?`${C.length} of ${s.length}`:s.length})]}),e.jsx("div",{className:"w6w-rel-table-wrap",children:e.jsxs("table",{className:"w6w-rel-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Service"}),e.jsx("th",{children:"Status"}),e.jsxs("th",{children:["Last ",w," days"]}),e.jsx("th",{children:"Latency"})]})}),e.jsx("tbody",{children:C.map(k=>e.jsx(Kt,{service:k,getHref:a,onOpen:r},k.appId))})]})}),$>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[$," more",T&&e.jsxs(e.Fragment,{children:[" — ",g("view all →")]})]})]})]})]})]})}function zt({rows:s,title:t,description:n,emptyCopy:l,newLabel:o="New",openRowTitle:i,testIds:a,loading:r,error:d,onCreate:u,creating:m,onImport:w,onOpen:h,getHref:v,showArchived:S,onShowArchivedChange:N,slots:p}){const[C,$]=j.useState(!1),A=S!==void 0,T=A?S:C,g=T?s:s.filter(f=>!f.archived),k=h!==void 0||v!==void 0;return e.jsxs("section",{className:"w6w-callable-list",children:[e.jsxs("div",{className:"w6w-callable-list-head",children:[e.jsxs("div",{className:"w6w-callable-list-heading",children:[(p==null?void 0:p.header)??e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"w6w-callable-list-title",children:t}),n!=null&&e.jsx("p",{className:"w6w-muted w6w-small w6w-callable-list-description",children:n})]}),e.jsxs("label",{className:"w6w-muted w6w-small w6w-callable-list-toggle",children:[e.jsx("input",{type:"checkbox",checked:T,"data-testid":a==null?void 0:a.showArchived,onChange:f=>{A||$(f.target.checked),N==null||N(f.target.checked)}}),"Show archived"]})]}),e.jsxs("div",{className:"w6w-callable-list-actions",children:[p==null?void 0:p.actions,w&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":a==null?void 0:a.importOpen,onClick:w,children:"Import"}),u&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:m,onClick:u,children:m?"Creating…":o})]})]}),d&&e.jsx("div",{className:"w6w-error",children:d}),e.jsxs("div",{className:"w6w-callable-list-body",children:[r&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),s.length===0&&!r&&e.jsx("div",{className:"w6w-muted",children:(p==null?void 0:p.empty)??l}),e.jsx("ul",{className:"w6w-callable-list-rows",children:g.map(f=>e.jsx("li",{title:k?i:void 0,children:e.jsx(U,{title:f.title,subtitle:f.description,href:v==null?void 0:v(f.id),onClick:h?b=>h(f.id,b):void 0,trailing:f.archived||f.badges!=null||f.trailing!=null?e.jsxs("span",{className:"w6w-callable-list-trail",children:[f.badges,f.archived&&e.jsx("span",{className:"w6w-callable-list-badge","data-testid":a==null?void 0:a.archivedBadge,children:"archived"}),f.trailing]}):void 0})},f.id))})]})]})}function gs(s,t){if(s.app)return s.app;if(s.app!==null)return t.get(s.appId)}function Vt(s){const t=new Set;for(const n of s)n.app===void 0&&t.add(n.appId);return[...t]}function Yt({connections:s,appsById:t,loading:n,error:l,onOpen:o,getHref:i,onEdit:a,onDelete:r,busy:d,slots:u}){const m=t??new Map;return e.jsxs("section",{className:"w6w-connection-list",children:[((u==null?void 0:u.header)!=null||(u==null?void 0:u.actions)!=null)&&e.jsxs("div",{className:"w6w-connection-list-head",children:[e.jsx("div",{className:"w6w-connection-list-heading",children:u==null?void 0:u.header}),e.jsx("div",{className:"w6w-connection-list-actions",children:u==null?void 0:u.actions})]}),l&&e.jsx("div",{className:"w6w-error",children:l}),n&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),s.length===0&&!n&&e.jsx("div",{className:"w6w-muted",children:(u==null?void 0:u.empty)??"No connections yet."}),e.jsx("ul",{className:"w6w-connection-rows",children:s.map(w=>{const h=gs(w,m),v=w.displayName||w.id,S=w.builtIn===!0;return e.jsxs("li",{className:"w6w-connection-row",children:[e.jsx("div",{className:"w6w-connection-row-main",children:e.jsx(U,{href:S||i==null?void 0:i(w.id),onClick:S||!o?void 0:N=>o(w.id,N),icon:e.jsx(x.AppIcon,{src:h==null?void 0:h.iconSvg,srcDark:h==null?void 0:h.iconSvgDark,brandColor:h==null?void 0:h.brandColor,name:(h==null?void 0:h.displayName)??w.appId}),title:e.jsxs(e.Fragment,{children:[e.jsx("strong",{className:"w6w-connection-name",title:v,children:v})," ",e.jsx("span",{className:"w6w-muted",children:(h==null?void 0:h.displayName)??w.appId})]}),subtitle:e.jsxs(e.Fragment,{children:["auth ",e.jsx("code",{children:w.authKey})," ·"," ",e.jsx("span",{className:`w6w-connection-tag${w.state==="connected"?"":" w6w-connection-tag-warn"}`,children:w.state}),w.lastTestOk===!1&&e.jsx("span",{className:"w6w-connection-tag w6w-connection-tag-danger",title:"Last test failed — update or re-test.",children:"invalid"})]})})}),!S&&(a||r)&&e.jsxs("div",{className:"w6w-connection-row-actions",children:[a&&e.jsx(ds,{label:"Edit",onClick:()=>a(w),"data-testid":`connection-edit-${w.id}`}),r&&e.jsx(us,{label:"Delete",onClick:()=>r(w),disabled:d,"data-testid":`connection-delete-${w.id}`})]})]},w.id)})})]})}function Gt({connection:s,onClose:t,onSaved:n}){const l=x.useW6WApi(),o=l.updateConnection,i=s.builtIn===!0,a=!i&&typeof o=="function",[r,d]=j.useState(s.displayName??""),[u,m]=j.useState({}),[w,h]=j.useState(null),[v,S]=j.useState(null),[N,p]=j.useState(!1);j.useEffect(()=>{if(!a)return;let f=!1;return h(null),l.getAppAuth(s.appId).then(b=>!f&&h(b)).catch(b=>!f&&S(b.message)),()=>{f=!0}},[l,a,s.appId]);const C=w==null?void 0:w.find(f=>f.key===s.authKey),$=(C==null?void 0:C.type)==="oauth2",A=$?[]:(C==null?void 0:C.fields)??[];function T(){const f={};for(const O of A){const I=u[O.key];I!==void 0&&I!==""&&(f[O.key]=I)}const b={};return r!==(s.displayName??"")&&(b.displayName=r),Object.keys(f).length>0&&(b.credential=f),b.displayName===void 0&&b.credential===void 0?null:b}async function g(){if(!a||!o||N)return;S(null);const f=T();if(!f){S("Nothing to update — change the name or a credential field.");return}p(!0);try{const b=await o.call(l,s.id,f);m({}),n(b)}catch(b){S(b.message)}finally{p(!1)}}const k=x.useEnterSubmit(g,{enabled:a&&!N});return e.jsx(x.Modal,{title:"Edit connection",onClose:t,children:e.jsxs("div",{className:"w6w-stepconfig",children:[e.jsx("div",{className:"w6w-modal-body",children:e.jsxs("div",{className:"w6w-stack",children:[i&&e.jsx("p",{className:"w6w-muted w6w-small",children:"This connection is built in — it has no stored credential to edit."}),!i&&!a&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Editing connections is not available here."}),a&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Display name"}),e.jsx("input",{type:"text",value:r,onChange:f=>d(f.target.value),placeholder:"Connection name",maxLength:80,name:"w6w-connection-label",autoComplete:"off","data-1p-ignore":"true","data-lpignore":"true","data-bwignore":"true","data-form-type":"other",...k})]}),w===null&&!v&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Loading auth fields…"}),$&&e.jsx("p",{className:"w6w-muted w6w-small",children:"This is an OAuth connection. You can rename it here; its credential is renewed by re-authorizing it."}),A.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"w6w-muted w6w-small",children:"Leave a field blank to keep it unchanged. Filled fields replace the stored credential."}),e.jsx(x.AuthFieldsForm,{mode:"edit",fields:A,values:u,onChange:m,enterSubmitProps:k})]})]}),v&&e.jsx("div",{className:"w6w-result w6w-error",children:v})]})}),e.jsxs("div",{className:"w6w-modal-actions",children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:t,children:"Cancel"}),a&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:N,onClick:g,children:N?"Saving…":"Save"})]})]})})}function Qt({conn:s,app:t,children:n}){return e.jsxs("div",{className:"w6w-connection-header","data-testid":"connection-header",children:[e.jsx(x.AppIcon,{src:t==null?void 0:t.iconSvg,srcDark:t==null?void 0:t.iconSvgDark,brandColor:t==null?void 0:t.brandColor,name:(t==null?void 0:t.displayName)??s.appId,size:56}),e.jsxs("div",{className:"w6w-connection-header-main",children:[e.jsx("h2",{className:"w6w-connection-header-title",children:s.displayName||s.id}),e.jsxs("p",{className:"w6w-muted w6w-small w6w-connection-header-meta",children:[e.jsx(rs,{value:s.id,className:"w6w-connection-id-copy"})," · App"," ",e.jsx("code",{children:s.appId})," · Auth ",e.jsx("code",{children:s.authKey})," ·"," ",e.jsx("span",{className:`w6w-connection-tag${s.state==="connected"?"":" w6w-connection-tag-warn"}`,children:s.state}),s.lastTestOk===!1&&e.jsx("span",{className:"w6w-connection-tag w6w-connection-tag-danger",title:"Last test failed — update or re-test.",children:"invalid"})]})]}),n&&e.jsx("div",{className:"w6w-connection-header-actions",children:n})]})}exports.AddConnectionModal=x.AddConnectionModal;exports.AppIcon=x.AppIcon;exports.AppPicker=x.AppPicker;exports.AuthFieldsForm=x.AuthFieldsForm;exports.CodeEditor=x.CodeEditor;exports.Combobox=x.Combobox;exports.ConfirmModal=x.ConfirmModal;exports.ExpressionInput=x.ExpressionInput;exports.ExpressionOptionsProvider=x.ExpressionOptionsProvider;exports.IconButton=x.IconButton;exports.JsonEditor=x.JsonEditor;exports.Modal=x.Modal;exports.NodeConfigForm=x.NodeConfigForm;exports.ParamsForm=x.ParamsForm;exports.PropertyEntryForm=x.PropertyEntryForm;exports.RetryPolicyFields=x.RetryPolicyFields;exports.StepBuilderModal=x.StepBuilderModal;exports.W6WUIProvider=x.W6WUIProvider;exports.filterOptions=x.filterOptions;exports.isExprValue=x.isExprValue;exports.isSecretValue=x.isSecretValue;exports.isTestRequired=x.isTestRequired;exports.requiredParamsFilled=x.requiredParamsFilled;exports.shouldUseCombobox=x.shouldUseCombobox;exports.startOAuthPopup=x.startOAuthPopup;exports.useEnterSubmit=x.useEnterSubmit;exports.useExpressionOptions=x.useExpressionOptions;exports.useW6WApi=x.useW6WApi;exports.CodeBlock=re.CodeBlock;exports.Copyable=F.Copyable;exports.Icon=F.Icon;exports.iconNames=F.iconNames;exports.ATTENTION_DISPLAY_CAP=Te;exports.ActionTestForm=at;exports.ApiCallsPanel=as;exports.ApiError=H;exports.CallableList=zt;exports.ConnectionHeader=Qt;exports.ConnectionList=Yt;exports.CopyableText=rs;exports.DeleteButton=us;exports.EditButton=ds;exports.EditConnectionModal=Gt;exports.ExecutionDetail=Ut;exports.ExecutionFilters=Ft;exports.ExecutionList=Tt;exports.ExecutionLogPanel=ws;exports.ExecutionStats=_t;exports.HealthStatusPill=oe;exports.HistoryTimeline=bt;exports.InfoTip=St;exports.ListItem=U;exports.RECENT_DISPLAY_CAP=xs;exports.ReliabilityChart=fs;exports.ReliabilityList=Ht;exports.RepoSyncIndicator=kt;exports.ServerResourcesBadge=pt;exports.ServerResourcesCard=wt;exports.ServerResourcesCardSmall=mt;exports.ServerResourcesRail=ht;exports.StepStatusPill=ce;exports.UptimeStrip=os;exports.YamlEditor=lt;exports.connectionAppIdsToLookUp=Vt;exports.createW6WApi=Xs;exports.cropText=is;exports.displayBoard=js;exports.formatDurationMs=de;exports.formatExecutionTime=z;exports.needsAttention=Wt;exports.partitionBoard=hs;exports.performancePoints=ms;exports.resolveConnectionAppMeta=gs;exports.uptimeDays=ps;
|
|
1
|
+
"use client";"use strict";var Yt=Object.defineProperty;var Gt=(t,s,n)=>s in t?Yt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var me=(t,s,n)=>Gt(t,typeof s!="symbol"?s+"":s,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./ConfirmModal-fjHW5rN-.cjs"),e=require("react/jsx-runtime"),j=require("react"),ye=require("./CodeBlock-CulfbnZD.cjs"),Qt=require("@codemirror/lang-yaml"),Zt=require("@codemirror/view"),Xt=require("@uiw/react-codemirror"),W=require("./Copyable-DA6eiU7w.cjs");class se extends Error{constructor(n,l,o,r){super(o);me(this,"status");me(this,"code");me(this,"body");this.name="ApiError",this.status=n,this.code=l,this.body=r}}function es(t){const s=t.baseUrl.replace(/\/$/,""),n=t.fetch??globalThis.fetch,l=async()=>typeof t.token=="function"?await t.token():t.token;async function o(a,i){const c=new Headers(i==null?void 0:i.headers),d=await l();d&&c.set("authorization",`Bearer ${d}`),i!=null&&i.body&&!c.has("content-type")&&c.set("content-type","application/json");let w;try{w=await n(`${s}${a}`,{...i,headers:c})}catch(h){throw new se(0,"network_error",`Could not reach the w6w server (${(i==null?void 0:i.method)??"GET"} ${s}${a}). It may be down or unreachable. (${h.message})`)}const x=await w.text();let f=null;if(x)try{f=JSON.parse(x)}catch{if(!w.ok)throw new se(w.status,"bad_response",`Server returned a non-JSON ${w.status} response: ${x.slice(0,200)}`)}if(!w.ok){const h=(f==null?void 0:f.error)??{};throw new se(w.status,h.code??"error",h.message??w.statusText,f)}return{status:w.status,data:f}}async function r(a,i){const{data:c}=await o(a,i);return c}return{listApps:async()=>{const a=async()=>{const i=[];let c;for(;;){const d=new URLSearchParams({limit:"200"});c&&d.set("cursor",c);const w=await r(`/apps?${d}`);if(i.push(...w.apps),!w.nextCursor||w.nextCursor===c)return i;c=w.nextCursor}};try{return await a()}catch(i){if(i instanceof se&&(i.code==="snapshot_expired"||i.code==="unknown_snapshot"))return await a();throw i}},listAppsByIds:async a=>{const i=Array.from(new Set(a)),c=[];for(let d=0;d<i.length;d+=100){const x=i.slice(d,d+100).map(encodeURIComponent).join(","),f=await r(`/apps?ids=${x}`);c.push(...f.apps)}return c},getAppAuth:async a=>(await r(`/apps/${encodeURIComponent(a)}/auths`)).auths??[],createConnection:(a,i)=>r(`/apps/${encodeURIComponent(a)}/connections`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.connection),updateConnection:(a,i)=>r(`/connections/${encodeURIComponent(a)}`,{method:"PATCH",body:JSON.stringify(i)}).then(c=>c.connection),listCredentials:a=>{const i=new URLSearchParams;(a==null?void 0:a.contract)!==void 0&&i.set("contract",a.contract),(a==null?void 0:a.appId)!==void 0&&i.set("appId",a.appId),(a==null?void 0:a.authKey)!==void 0&&i.set("authKey",a.authKey);const c=i.toString();return r(`/credentials${c?`?${c}`:""}`).then(d=>d.credentials??[])},createCredential:a=>r("/credentials",{method:"POST",body:JSON.stringify(a)}).then(i=>i.credential),getCredential:a=>r(`/credentials/${encodeURIComponent(a)}`).then(i=>i.credential),rotateCredential:(a,i)=>r(`/credentials/${encodeURIComponent(a)}/rotate`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.credential),setCredentialStatus:(a,i)=>r(`/credentials/${encodeURIComponent(a)}/${i==="disabled"?"disable":"enable"}`,{method:"POST"}).then(c=>c.credential),testCredential:a=>r(`/credentials/${encodeURIComponent(a)}/test`,{method:"POST"}),credentialDependents:a=>r(`/credentials/${encodeURIComponent(a)}/dependents`).then(i=>i.dependents),deleteCredential:async a=>{await r(`/credentials/${encodeURIComponent(a)}`,{method:"DELETE"})},startAppOAuthFlow:(a,i,c)=>r(`/apps/${encodeURIComponent(a)}/oauth-config/${encodeURIComponent(i)}/authorize-url`,{method:"POST",body:JSON.stringify(c)}),getAppActions:a=>r(`/apps/${encodeURIComponent(a)}`).then(i=>i.actions??[]),listConnectionsForApp:a=>r(`/apps/${encodeURIComponent(a)}/connections`).then(i=>i.connections??[]),listConnections:()=>r("/connections").then(a=>a.connections??[]),invokeAction:(a,i,c,d={})=>r(`/apps/${encodeURIComponent(a)}/actions/${encodeURIComponent(i)}/invoke`,{method:"POST",body:JSON.stringify({params:c,connectionId:d.connectionId,project:d.project,state:d.state})}),listSavedTests:a=>r(`/connections/${encodeURIComponent(a)}/saved-tests`).then(i=>i.savedTests??[]),createSavedTest:(a,i)=>r(`/connections/${encodeURIComponent(a)}/saved-tests`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.savedTest),updateSavedTest:(a,i,c)=>r(`/connections/${encodeURIComponent(a)}/saved-tests/${encodeURIComponent(i)}`,{method:"PATCH",body:JSON.stringify(c)}).then(d=>d.savedTest),deleteSavedTest:(a,i)=>r(`/connections/${encodeURIComponent(a)}/saved-tests/${encodeURIComponent(i)}`,{method:"DELETE"}).then(()=>{}),recordTestRun:(a,i)=>r(`/connections/${encodeURIComponent(a)}/test-runs`,{method:"POST",body:JSON.stringify(i)}).then(()=>{}),listTestRuns:a=>r(`/connections/${encodeURIComponent(a)}/test-runs`).then(i=>i.runs??[]),saveStepTest:(a,i,c)=>r(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(i)}/tests`,{method:"POST",body:JSON.stringify(c)}).then(d=>d.stepTest),listStepTests:(a,i)=>r(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(i)}/tests`).then(c=>c.stepTests??[]),recordStepTestRun:(a,i,c)=>r(`/workflows/${encodeURIComponent(a)}/steps/${encodeURIComponent(i)}/test-runs`,{method:"POST",body:JSON.stringify(c)}).then(()=>{}),listFunctions:()=>r("/functions").then(a=>a.functions??[]),getFunction:a=>r(`/functions/${encodeURIComponent(a)}`).then(i=>({...i.function,valid:i.valid})),invokeFunction:(a,i)=>r(`/functions/${encodeURIComponent(a)}/invoke`,{method:"POST",body:JSON.stringify({inputs:i})}).then(c=>c.output),listWorkflows:()=>r("/workflows").then(a=>a.workflows??[]),getWorkflow:a=>r(`/workflows/${encodeURIComponent(a)}`).then(i=>i.workflow),runWorkflow:(a,i={})=>o(`/workflows/${encodeURIComponent(a)}/run?wait=true`,{method:"POST",body:JSON.stringify({variables:i.variables,input:i.input})}).then(({status:c,data:d})=>({...d??{},terminal:c===200}))}}function je({title:t,subtitle:s,icon:n,trailing:l,active:o=!1,onClick:r,href:a,ariaLabel:i}){const c=e.jsxs(e.Fragment,{children:[n!=null&&e.jsx("span",{className:"w6w-list-item-icon",children:n}),e.jsxs("span",{className:"w6w-list-item-body",children:[e.jsx("span",{className:"w6w-list-item-title",children:t}),s!=null&&e.jsx("span",{className:"w6w-list-item-subtitle",children:s})]}),l!=null&&e.jsx("span",{className:"w6w-list-item-trailing",children:l})]}),d=`w6w-list-item${o?" active":""}`;return a!==void 0?e.jsx("a",{className:d,href:a,"aria-current":o?"true":void 0,"aria-label":i,onClick:r,children:c}):r?e.jsx("button",{type:"button",className:d,"aria-pressed":o,"aria-label":i,onClick:r,children:c}):e.jsx("div",{className:d,"aria-label":i,children:c})}function Ie(t){const s=Date.parse(t);if(Number.isNaN(s))return"";const n=Math.max(0,Math.round((Date.now()-s)/1e3));if(n<45)return"just now";const l=Math.round(n/60);if(l<60)return`${l}m ago`;const o=Math.round(l/60);if(o<24)return`${o}h ago`;const r=Math.round(o/24);return r<7?`${r}d ago`:new Date(s).toLocaleDateString()}function at(t){const s={};for(const n of(t==null?void 0:t.params)??[])n.key&&n.default!==void 0&&(s[n.key]=n.default);return s}function ts(t){var n,l,o;const s=t.indexOf("{");if(s>=0)try{const r=JSON.parse(t.slice(s)),a=((l=(n=r==null?void 0:r.errors)==null?void 0:n[0])==null?void 0:l.message)??(typeof(r==null?void 0:r.error)=="object"?(o=r.error)==null?void 0:o.message:r==null?void 0:r.error)??(r==null?void 0:r.message);if(typeof a=="string"&&a.trim()){const i=t.slice(0,s).replace(/[:\s]+$/,"");return i?`${i}: ${a.trim()}`:a.trim()}}catch{}return t}function mt(t){return typeof t=="object"&&t!==null&&typeof t.status=="number"&&typeof t.code=="string"}function ss(t){if(!mt(t))return{headline:(t==null?void 0:t.message)??"The action failed to run."};const s=ts(t.message??""),n=`${t.status} ${t.code} ${t.message??""}`.toLowerCase();return t.status===401||t.status===403||/\b(401|403)\b|forbidden|unauthorized|not authorized|permission|scope|access denied|invalid api key|invalid credential/.test(n)?{headline:"Permission denied by the provider — this is a credential/scope problem, not a w6w error.",hint:"The connection's API key is missing the permissions this action needs. Fix it at the provider — e.g. SendGrid → Settings → API Keys → give the key the required scopes (or Full Access), or create a new key — then update this connection's credential and try again.",detail:s}:{headline:"The action returned an error.",detail:s}}function ns(t){const s=mt(t)?t.body??t.raw:null;return(s==null?void 0:s.apiCalls)??[]}function Re(){const[t,s]=j.useState(""),[n,l]=j.useState(void 0),[o,r]=j.useState(!1);return{text:t,value:n,invalid:o,onChange:i=>{s(i);const c=i.trim();if(c===""){r(!1);return}try{const d=JSON.parse(c);d!==null&&typeof d=="object"&&!Array.isArray(d)?(l(d),r(!1)):r(!0)}catch{r(!0)}}}}function as({appId:t,actions:s,connectionId:n,action:l,seedValues:o,onSavedTestsChanged:r,seedTestId:a,onDirtyChange:i,onTestSaved:c,onDeleted:d,embedded:w=!1}){var st;const x=m.useW6WApi(),f=j.useMemo(()=>{const u=[...s];return u.sort((b,O)=>(b.title||b.key).localeCompare(O.title||O.key)),u},[s]),[h,y]=j.useState((l==null?void 0:l.key)??""),v=l??s.find(u=>u.key===h)??null,[p,M]=j.useState(!1),[I,R]=j.useState(null),[T,k]=j.useState(void 0),[S,E]=j.useState([]),_=Re(),F=Re(),g=Re(),[A,Q]=j.useState(""),[B,U]=j.useState(""),L=_.invalid||F.invalid||g.invalid,Z=()=>{const u={};return _.text.trim()!==""&&_.value!==void 0&&(u.body=_.value),F.text.trim()!==""&&F.value!==void 0&&(u.query=F.value),g.text.trim()!==""&&g.value!==void 0&&(u.headers=g.value),A&&(u.target=A),B.trim()!==""&&(u.match=B.trim()),Object.keys(u).length>0?u:void 0},[V,z]=j.useState("form"),[ke,ie]=j.useState(""),[Se,Y]=j.useState(!1),[N,C]=j.useState(!1),$=(v==null?void 0:v.key)??null,D=o?{...o}:at(v),[Ke,re]=j.useState(()=>({key:$,values:D})),[J,X]=j.useState(a??null),[qe,oe]=j.useState(D);if(Ke.key!==$){const u=at(v);re({key:$,values:u}),oe(u),X(a??null),R(null),k(void 0),E([])}const[It,Rt]=j.useState(a);a!==It&&(Rt(a),X(a??null));const[He,Mt]=j.useState(o);if(o!==He){const u=JSON.stringify(o??null)!==JSON.stringify(He??null);if(Mt(o),o&&u){const b={...o};re({key:$,values:b}),oe(b),R(null),k(void 0),E([])}}const K=Ke.values,Ve=u=>re({key:$,values:u}),ze=j.useMemo(()=>JSON.stringify(K)!==JSON.stringify(qe),[K,qe]);j.useEffect(()=>{i==null||i(ze)},[ze]);const Ot=()=>{ie(JSON.stringify(K,null,2)),Y(!1),z("json")},Pt=async u=>{if(!v||L)return;const b=v.key;M(!0),R(null),k(void 0),E([]);let O;const G=Z();try{const q=await x.invokeAction(t,b,u,{connectionId:n,...G?{overrides:G}:{}});k(q.value),E(q.apiCalls??[]),O={ok:!0,summary:"OK",result:q.value}}catch(q){const nt=ss(q);R(nt),E(ns(q)),O={ok:!1,summary:nt.headline}}finally{M(!1)}if(n)try{await x.recordTestRun(n,{savedTestId:J??null,actionKey:b,ok:O.ok,summary:O.summary.slice(0,200),result:O.result}),Te(),Kt(),r==null||r()}catch{}},Ft=()=>Pt(K),[ce,Ye]=j.useState(null),[de,ee]=j.useState(null),[_t,Lt]=j.useState(0),[Bt,ue]=j.useState(!1),[Ce,$e]=j.useState(""),[Ut,Ae]=j.useState(!1),Te=()=>Lt(u=>u+1);j.useEffect(()=>{if(!n){Ye(null);return}let u=!1;return ee(null),x.listSavedTests(n).then(b=>!u&&Ye(b)).catch(b=>!u&&ee(b.message)),()=>{u=!0}},[x,n,_t]);const Ge=$?(ce??[]).filter(u=>u.actionKey===$):[],[Dt,Ee]=j.useState(null),[Jt,Wt]=j.useState(0),Kt=()=>Wt(u=>u+1);j.useEffect(()=>{const u=x.listTestRuns;if(!n||!u){Ee(null);return}let b=!1;return u(n).then(O=>!b&&Ee(O)).catch(()=>!b&&Ee(null)),()=>{b=!0}},[x,n,Jt]);const Qe=$?(Dt??[]).filter(u=>u.actionKey===$).slice().sort((u,b)=>Date.parse(b.occurredAt)-Date.parse(u.occurredAt)):[],qt=()=>{!n||!v||($e(""),ee(null),ue(!0))},Ht=()=>{!n||!v||(J?Ze():qt())},Ze=async()=>{if(!(!n||!v))try{let u;if(J)u=await x.updateSavedTest(n,J,{values:K});else{const b=Ce.trim();if(!b)return;u=await x.createSavedTest(n,{actionKey:v.key,name:b,values:K}),X(u.id)}oe({...K}),ue(!1),$e(""),Te(),r==null||r(),c==null||c(u)}catch(u){ee(u.message)}},Vt=u=>{const b={...u.values};re({key:$,values:b}),oe(b),X(u.id),z("form"),R(null),k(void 0),E([])},zt=async()=>{if(!n||!J)return;const u=J;try{await x.deleteSavedTest(n,u),X(null),Te(),r==null||r(),d==null||d(u)}catch(b){ee(b.message)}},Xe=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1-5)"},children:[e.jsxs("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"Parameters"}),e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-1)"},children:[e.jsx("button",{type:"button",className:`w6w-btn w6w-btn-sm w6w-btn-ghost${V==="form"?" active":""}`,"aria-pressed":V==="form",onClick:()=>z("form"),children:"Form"}),e.jsx("button",{type:"button",className:`w6w-btn w6w-btn-sm w6w-btn-ghost${V==="json"?" active":""}`,"aria-pressed":V==="json",onClick:Ot,children:"JSON"}),!w&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-sm w6w-btn-ghost","aria-pressed":N,title:N?"Collapse the params editor":"Open the params editor in a larger view","aria-label":N?"Collapse the params editor":"Open the params editor in a larger view",onClick:()=>C(u=>!u),children:N?"⤡":"⤢"})]})]}),V==="form"?e.jsx(m.ParamsForm,{params:(v==null?void 0:v.params)??[],values:K,onChange:Ve,dynamic:v?{appId:t,actionKey:v.key,connectionId:n}:void 0}):e.jsxs(e.Fragment,{children:[e.jsx(m.JsonEditor,{value:ke,onChange:ie,minHeight:N?"50vh":"200px","aria-label":"Params JSON",onValidChange:u=>{u!==null&&typeof u=="object"&&!Array.isArray(u)&&Ve(u)},onValidityChange:({valid:u})=>Y(!u)}),Se&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]})]}),et=e.jsxs("details",{className:"w6w-section","data-testid":"overrides-region",children:[e.jsxs("summary",{className:"w6w-section-summary",children:[e.jsx("span",{className:"w6w-section-title",children:"Overrides"}),e.jsx("span",{className:"w6w-section-subtitle",children:"Reach a vendor field this action's own params don't declare"})]}),e.jsxs("div",{className:"w6w-stack w6w-section-body",style:{gap:"var(--w6w-sp-2)"},children:[e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Body"}),e.jsx(m.JsonEditor,{value:_.text,onChange:_.onChange,minHeight:"80px","aria-label":"Overrides body (JSON)"}),_.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Query"}),e.jsx(m.JsonEditor,{value:F.text,onChange:F.onChange,minHeight:"80px","aria-label":"Overrides query (JSON)"}),F.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("div",{className:"w6w-field",children:[e.jsx("span",{children:"Headers"}),e.jsx(m.JsonEditor,{value:g.text,onChange:g.onChange,minHeight:"80px","aria-label":"Overrides headers (JSON)"}),g.invalid&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]}),e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Target"}),e.jsxs("select",{"aria-label":"Overrides target",value:A,onChange:u=>Q(u.target.value),children:[e.jsx("option",{value:"",children:"— default (first) —"}),e.jsx("option",{value:"first",children:"first"}),e.jsx("option",{value:"first-write",children:"first-write"}),e.jsx("option",{value:"all",children:"all"})]})]}),e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Match"}),e.jsx("input",{type:"text","aria-label":"Overrides match",value:B,placeholder:"Restrict to requests whose URL contains…",onChange:u=>U(u.target.value)})]}),e.jsx("span",{className:"w6w-hint",children:"Merged onto the outbound request at the wire, never into the params above — name a field the way the vendor's own API documents it."})]})]}),we=n?e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1-5)"},children:[e.jsx("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:e.jsx("span",{className:"w6w-muted w6w-small",children:"Saved tests"})}),de&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:de}),Ge.length===0?e.jsx("p",{className:"w6w-muted w6w-small",children:"No saved tests for this action yet."}):e.jsx("ul",{className:"w6w-stack",style:{listStyle:"none",margin:0,padding:0,gap:"var(--w6w-sp-1-5)"},children:Ge.map(u=>e.jsx("li",{children:e.jsx(je,{title:u.name,subtitle:u.lastRunAt?e.jsxs("span",{children:[e.jsx("span",{style:{color:u.lastRunOk?"var(--w6w-success)":"var(--w6w-danger)"},children:u.lastRunOk?"✓":"✗"})," ",u.lastRunSummary?`${u.lastRunSummary} · `:"",Ie(u.lastRunAt)]}):`saved ${Ie(u.updatedAt)}`,active:u.id===J,onClick:()=>Vt(u)})},u.id))}),x.listTestRuns&&Qe.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w6w-field-labelrow",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:e.jsx("span",{className:"w6w-muted w6w-small",children:"Recent runs"})}),e.jsx("ul",{className:"w6w-stack",style:{listStyle:"none",margin:0,padding:0,gap:"var(--w6w-sp-1-5)"},children:Qe.map(u=>e.jsx("li",{children:e.jsx(je,{title:e.jsxs("span",{children:[e.jsx("span",{style:{color:u.ok?"var(--w6w-success)":"var(--w6w-danger)"},children:u.ok?"✓":"✗"})," ",u.actionKey]}),subtitle:e.jsxs("span",{children:[u.summary?`${u.summary} · `:"",Ie(u.occurredAt)]})})},u.id))})]})]}):null,tt=(st=ce==null?void 0:ce.find(u=>u.id===J))==null?void 0:st.name;return e.jsxs("div",{className:`w6w-stack${w?" w6w-tester-embedded-root":""}`,children:[!l&&(s.length===0?e.jsx("p",{className:"w6w-muted w6w-small",children:"This app exposes no actions."}):e.jsxs("label",{className:"w6w-field",children:[e.jsxs("span",{children:["Action",$?"":" *"]}),e.jsx(m.Combobox,{value:h,placeholder:"— pick an action —",onChange:y,options:f.map(u=>({value:u.key,label:`${u.title??u.key} (${u.key})`}))})]})),v?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("strong",{children:[v.title??v.key," ",e.jsx("code",{className:"w6w-muted",children:v.key})]}),v.description&&e.jsx("p",{className:"w6w-muted w6w-small",style:{margin:"var(--w6w-sp-0-5) 0 0"},children:v.description})]}),(()=>{const u=I?e.jsxs("div",{className:"w6w-result w6w-error",children:[e.jsx("strong",{children:I.headline}),I.hint&&e.jsx("div",{style:{marginTop:"var(--w6w-sp-1-5)"},children:I.hint}),I.detail&&e.jsx("div",{className:"w6w-muted w6w-small",style:{marginTop:"var(--w6w-sp-1-5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:I.detail})]}):null,b=T!==void 0?e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-1)"},children:[e.jsx("strong",{className:"w6w-small",children:"Result"}),e.jsx("pre",{className:"w6w-result",children:JSON.stringify(T,null,2)})]}):null,O=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[Xe,et,u,b,e.jsx(m.ApiCallsPanel,{calls:S})]}),G=e.jsxs("div",{className:`w6w-tester-actions${w||N?" w6w-tester-actions-footer":""}`,style:{display:"flex",gap:"var(--w6w-sp-2)"},children:[e.jsx("button",{type:"button",className:"w6w-btn",disabled:p||L,onClick:Ft,children:p?"Running…":"Run action"}),n&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:Ht,children:"Save test"}),n&&J&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",style:{marginLeft:"auto",color:"var(--w6w-danger)"},onClick:()=>Ae(!0),children:"Delete"})]}),q=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[O,G]});return w?e.jsxs("div",{className:"w6w-tester-embedded",children:[e.jsx("div",{className:"w6w-tester-embedded-scroll",children:e.jsxs("div",{className:"w6w-card-stack",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-head",children:e.jsx("h3",{children:"Parameters"})}),e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[Xe,et,u]})]}),(b||S.length>0)&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-head",children:e.jsx("h3",{children:"Result"})}),e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[T!==void 0&&e.jsx("pre",{className:"w6w-result",children:JSON.stringify(T,null,2)}),e.jsx(m.ApiCallsPanel,{calls:S})]})]}),we&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-head",children:e.jsx("h3",{children:"Saved tests and history"})}),we]})]})}),G]}):N?e.jsx(m.Modal,{title:`Edit params — ${v.title??v.key}`,onClose:()=>C(!1),size:"full",children:e.jsxs("div",{className:"w6w-tester-popout",children:[e.jsx("div",{className:"w6w-tester-popout-scroll",children:we?e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-4)",alignItems:"flex-start"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:O}),e.jsx("div",{style:{width:260,flexShrink:0},children:we})]}):O}),G]})}):q})(),Bt&&e.jsx(m.Modal,{title:"Save test",onClose:()=>ue(!1),children:e.jsxs("form",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},onSubmit:u=>{u.preventDefault(),Ze()},children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Name this saved test"}),e.jsx("input",{type:"text",value:Ce,placeholder:"e.g. valid sender",onChange:u=>$e(u.target.value)})]}),de&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:de}),e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-2)",justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>ue(!1),children:"Cancel"}),e.jsx("button",{type:"submit",className:"w6w-btn",disabled:!Ce.trim(),children:"Save"})]})]})}),Ut&&e.jsx(m.ConfirmModal,{title:"Delete saved test",message:tt?`Delete "${tt}"? This cannot be undone.`:"Delete this saved test? This cannot be undone.",confirmLabel:"Delete",onConfirm:()=>{Ae(!1),zt()},onClose:()=>Ae(!1)})]}):!l&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Pick an action above to test it."})]})}function ls(t){const s=m.useEffectiveTheme(t.theme),{copied:n,copy:l}=W.useCopyToClipboard(t.value),o=j.useMemo(()=>[Qt.yaml(),Zt.EditorView.theme(m.EDITOR_THEME_SPEC)],[]);function r(a){t.onChange(a)}return e.jsxs("div",{className:"w6w-yaml-editor","aria-label":t["aria-label"]??"YAML editor",children:[e.jsx(Xt,{value:t.value,onChange:r,extensions:o,placeholder:t.placeholder,readOnly:t.readOnly,editable:!t.readOnly,theme:s,height:t.height,minHeight:t.minHeight??"240px",maxHeight:t.maxHeight,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!t.readOnly,autocompletion:!0,bracketMatching:!0,closeBrackets:!0}}),t.copyable&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${n?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void l(),children:n?e.jsx(W.CheckGlyph,{}):e.jsx(W.CopyGlyph,{})}),e.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:n?"Copied":""})]})]})}const Me="…";function ht(t,s,n="end"){if(s===void 0||s<1||s>=t.length)return t;if(n==="start")return`${Me}${t.slice(t.length-s)}`;if(n==="end")return`${t.slice(0,s)}${Me}`;const l=Math.ceil(s/2),o=s-l;return`${t.slice(0,l)}${Me}${t.slice(t.length-o)}`}function pt(t){const{value:s,chars:n,crop:l="end",label:o,className:r,copiedMs:a}=t,i=ht(s,n,l),c=["w6w-copyable--bare",r].filter(Boolean).join(" ");return e.jsx(W.Copyable,{value:s,readOnly:!0,label:o,className:c,copiedMs:a,children:e.jsx("span",{children:i})})}const is={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function Ne({state:t,label:s,ariaLabel:n}){const l=s??is[t];return e.jsxs("span",{className:`w6w-health-pill w6w-health-pill-${t}`,"aria-label":n,children:[e.jsx("span",{className:"w6w-health-pill-dot","aria-hidden":"true"}),e.jsx("span",{className:"w6w-health-pill-label",children:l})]})}const rs={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function xt({days:t,ariaLabel:s}){return t.length===0?null:e.jsx("div",{className:"w6w-uptime-strip",role:"img","aria-label":s??`${t.length}-day status`,children:t.map((n,l)=>e.jsx("span",{className:`w6w-uptime-cell w6w-uptime-cell-${n.state}`,title:n.label??`${n.day} — ${rs[n.state]}`},`${n.day}-${l}`))})}const jt="—",lt=["B","KiB","MiB","GiB","TiB","PiB"];function os(t){if(t===null||!Number.isFinite(t))return jt;if(t<1024)return`${Math.round(t)} B`;let s=t,n=0;for(;s>=1024&&n<lt.length-1;)s/=1024,n+=1;return`${s.toFixed(1)} ${lt[n]}`}function H(t){return t===null||!Number.isFinite(t)?jt:`${Math.round(t*100)}%`}function ae(t){if(t===void 0||t.load1===null)return null;const s=t.cpuLimit??t.cpus;return s===null||s<=0?null:t.load1/s}function le(t){if(t===void 0)return null;const{memoryTotal:s,memoryAvailable:n}=t;return s===null||n===null||s<=0?null:(s-n)/s}function cs(t,s,n){return t<s?s:t>n?n:t}function ds(t,s,n,l){const o=t.length;if(o<2)return"";const r=[];for(let a=0;a<o;a++){const i=t[a];if(i===null)continue;const c=a/(o-1)*s,d=l<=0?n:n-cs(i,0,l)/l*n;r.push(`${Number(c.toFixed(2))},${Number(d.toFixed(2))}`)}return r.join(" ")}const us="—",it=100,rt=24;function Be({values:t,max:s,className:n}){const l=ds(t,it,rt,s);return l===""?null:e.jsx("svg",{className:n,viewBox:`0 0 ${it} ${rt}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:e.jsx("polyline",{points:l,fill:"none",stroke:"var(--w6w-accent)",strokeWidth:2,vectorEffect:"non-scaling-stroke"})})}function Oe(t){return t===null?us:t.toFixed(2)}function fe(t){let s=1;for(const n of t)n!==null&&n>s&&(s=n);return s}function pe({label:t,value:s,values:n,max:l}){return e.jsxs("li",{className:"w6w-server-resources__row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:t}),e.jsx("span",{className:"w6w-server-resources__value",children:s}),e.jsx(Be,{className:"w6w-server-resources__spark",values:n,max:l})]})}function Je(t){const s=t[t.length-1],n=t.map(r=>ae(r)),l=t.map(r=>le(r)),o=t.map(r=>r.processRss);return{last:s,cpuValues:n,memoryValues:l,rssValues:o}}function ws({samples:t,title:s="Server resources",intervalMs:n}){const{last:l,cpuValues:o,memoryValues:r,rssValues:a}=Je(t);return e.jsxs("section",{className:"w6w-server-resources w6w-server-resources--card","aria-label":s,children:[e.jsx("h3",{className:"w6w-server-resources__title",children:s}),e.jsxs("ul",{className:"w6w-server-resources__rows",children:[e.jsx(pe,{label:"CPU",value:H(ae(l)),values:o,max:fe(o)}),e.jsx(pe,{label:"Memory",value:H(le(l)),values:r,max:1}),e.jsx(pe,{label:"Process",value:os((l==null?void 0:l.processRss)??null),values:a,max:fe(a)})]}),e.jsx("p",{className:"w6w-server-resources__meta",children:`Load ${Oe((l==null?void 0:l.load1)??null)} / ${Oe((l==null?void 0:l.load5)??null)} / ${Oe((l==null?void 0:l.load15)??null)}`}),n!==void 0&&e.jsx("p",{className:"w6w-server-resources__meta",children:`Sampled every ${n/1e3}s`})]})}function ms({samples:t,title:s="Server"}){const{last:n,cpuValues:l}=Je(t);return e.jsxs("section",{className:"w6w-server-resources w6w-server-resources--small","aria-label":s,children:[e.jsx("h3",{className:"w6w-server-resources__title",children:s}),e.jsxs("ul",{className:"w6w-server-resources__rows",children:[e.jsx(pe,{label:"CPU",value:H(ae(n)),values:l,max:fe(l)}),e.jsxs("li",{className:"w6w-server-resources__row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"Memory"}),e.jsx("span",{className:"w6w-server-resources__value",children:H(le(n))})]})]})]})}function hs({samples:t,onExpand:s}){const{last:n,cpuValues:l,memoryValues:o}=Je(t);return e.jsxs("aside",{className:"w6w-server-resources w6w-server-resources--rail",children:[e.jsxs("div",{className:"w6w-server-resources__rail-row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"CPU"}),e.jsx("span",{className:"w6w-server-resources__value",children:H(ae(n))}),e.jsx(Be,{className:"w6w-server-resources__spark",values:l,max:fe(l)})]}),e.jsxs("div",{className:"w6w-server-resources__rail-row",children:[e.jsx("span",{className:"w6w-server-resources__label",children:"MEM"}),e.jsx("span",{className:"w6w-server-resources__value",children:H(le(n))}),e.jsx(Be,{className:"w6w-server-resources__spark",values:o,max:1})]}),s!==void 0&&e.jsx("button",{type:"button",className:"w6w-server-resources__expand","aria-label":"Show server resources",onClick:s,children:"Details"})]})}function ps({samples:t}){const s=t[t.length-1],n=H(ae(s)),l=H(le(s));return e.jsx("span",{className:"w6w-server-resources w6w-server-resources--badge",children:`CPU ${n} · MEM ${l}`})}const xs=1,js=1440*60*1e3;function fs(t,s,n){const l=s.startedAt??s.updatedAt;if(l===void 0)return null;const o=Date.parse(l),r=s.resolvedAt!==void 0?Date.parse(s.resolvedAt):s.startedAt!==void 0?n:o,a=Date.parse(`${t.from}T00:00:00.000Z`),i=Date.parse(`${t.to}T00:00:00.000Z`)+js,c=i-a;if(r<a||o>=i)return null;const d=o<a,w=r>i,x=Math.max(o,a),f=Math.min(r,i),h=(x-a)/c*100,y=(f-x)/c*100,v=Math.max(y,xs);return{leftPct:h,widthPct:v,clippedStart:d,clippedEnd:w}}const vs={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"},ys="This vendor publishes no incident history.",Ns="No incidents in this window.";function gs(t){const s=t.startedAt??t.updatedAt,n=[t.title];return t.components!==void 0&&t.components.length>0&&n.push(`(${t.components.join(", ")})`),s!==void 0&&n.push(t.resolvedAt!==void 0?`${s} – ${t.resolvedAt}`:`${s} – ongoing`),n.join(" ")}function bs({window:t,days:s,incidents:n,vendorEmptyLabel:l,nowMs:o=Date.now(),ariaLabel:r}){const a=s.length,i=a>0?100/a:0,c=n===void 0?l??ys:n.length===0?l??Ns:null;return e.jsx("div",{className:"w6w-history-timeline",role:"img","aria-label":r??`${a}-day history`,children:e.jsxs("div",{className:"w6w-history-plot",children:[e.jsx("div",{className:"w6w-history-lane w6w-history-lane-execution",children:s.map((d,w)=>e.jsx("span",{className:`w6w-history-cell w6w-history-cell-${d.state}`,style:{left:`${w*i}%`,width:`${i}%`},title:d.label??`${d.day} — ${vs[d.state]}`},`${d.day}-${w}`))}),e.jsx("div",{className:"w6w-history-lane w6w-history-lane-vendor",children:c!==null?e.jsx("span",{className:"w6w-history-empty",title:c,children:c}):n==null?void 0:n.map((d,w)=>{const x=fs(t,d,o);if(x===null)return null;const f=[x.clippedStart?"w6w-history-bar-clip-start":"",x.clippedEnd?"w6w-history-bar-clip-end":""].filter(Boolean).join(" ");return e.jsx("span",{className:`w6w-history-bar w6w-history-bar-${d.state}${f?` ${f}`:""}`,style:{left:`${x.leftPct}%`,width:`${x.widthPct}%`},title:gs(d)},d.id??`${d.title}-${w}`)})}),e.jsxs("div",{className:"w6w-history-axis",children:[e.jsx("span",{className:"w6w-history-tick w6w-history-tick-start",style:{left:"0%"},children:t.from}),e.jsx("span",{className:"w6w-history-tick w6w-history-tick-end",style:{left:"100%"},children:t.to})]})]})})}function ks({label:t,children:s,className:n}){const[l,o]=j.useState(!1),r=j.useId();return e.jsxs("span",{className:["w6w-info-tip",n??""].filter(Boolean).join(" "),children:[e.jsx(m.IconButton,{label:t,icon:"info","aria-expanded":l,"aria-controls":r,onClick:()=>o(a=>!a)}),l&&e.jsx("span",{id:r,className:"w6w-info-tip-body w6w-muted w6w-small",children:s})]})}function ft(t){const{label:s,onClick:n,disabled:l,className:o,...r}=t;return e.jsx(m.IconButton,{label:s,onClick:n,disabled:l,className:o,icon:"edit","data-testid":r["data-testid"]})}function vt(t){const{label:s,onClick:n,disabled:l,className:o,...r}=t;return e.jsx(m.IconButton,{label:s,onClick:n,disabled:l,className:o,danger:!0,icon:"delete","data-testid":r["data-testid"]})}function Ss(t){const{branch:s,shortSha:n,lastSyncLabel:l,onSyncNow:o,syncing:r,className:a,...i}=t,[c,d]=j.useState(!1),w=j.useRef(null);return j.useEffect(()=>{if(!c)return;const x=h=>{w.current&&!w.current.contains(h.target)&&d(!1)},f=h=>h.key==="Escape"&&d(!1);return document.addEventListener("mousedown",x),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",f)}},[c]),e.jsxs("div",{className:`w6w-repo-sync${a?` ${a}`:""}`,ref:w,"data-testid":i["data-testid"],children:[e.jsxs("button",{type:"button",className:"w6w-repo-sync-trigger","aria-haspopup":"menu","aria-expanded":c,"aria-busy":r,onClick:()=>d(x=>!x),children:[e.jsxs("span",{className:"w6w-repo-sync-icon",children:[e.jsx(W.Icon,{name:"github"}),r&&e.jsx(W.Icon,{name:"sync",size:10,className:"w6w-repo-sync-spin"})]}),e.jsx("span",{className:"w6w-repo-sync-branch",children:s}),n!=null&&e.jsx("code",{className:"w6w-repo-sync-sha",children:n})]}),c&&e.jsxs("div",{className:"w6w-repo-sync-menu",role:"menu",children:[e.jsxs("div",{className:"w6w-repo-sync-detail",children:[e.jsx("span",{children:s}),n!=null&&e.jsx("code",{children:n}),l!=null&&e.jsx("span",{children:l})]}),e.jsx("button",{type:"button",role:"menuitem",className:"w6w-repo-sync-item","data-testid":"repo-sync-now",disabled:r,onClick:o,children:r?"Syncing…":"Sync now"})]})]})}const Cs={pending:"Pending",running:"Running",succeeded:"Succeeded",failed:"Failed",skipped:"Skipped",queued:"Queued",canceled:"Canceled"};function ge({state:t,label:s,ariaLabel:n}){const l=s??Cs[t];return e.jsxs("span",{className:`w6w-step-pill w6w-step-pill-${t}`,"aria-label":n,children:[e.jsx("span",{className:"w6w-step-pill-dot","aria-hidden":"true"}),e.jsx("span",{className:"w6w-step-pill-label",children:l})]})}const $s="—",Pe=1e3,Fe=6e4;function be(t){return t==null||!Number.isFinite(t)||t<0?$s:t<Pe?`${Math.round(t)} ms`:t<Fe?`${(t/Pe).toFixed(1)} s`:`${Math.floor(t/Fe)}m ${Math.round(t%Fe/Pe)}s`}function ne(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}const As={function:"Function",endpoint:"Endpoint",workflow:"Workflow"};function Ts({items:t,selectedId:s=null,onSelect:n,showCallable:l=!1,loading:o=!1,emptyLabel:r,hasPrev:a,hasNext:i,onPrev:c,onNext:d}){const w=c||d?e.jsxs("div",{className:"w6w-execution-list-pager",children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-list-prev",disabled:!a,onClick:c,children:"Previous"}),e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-list-next",disabled:!i,onClick:d,children:"Next"})]}):null;let x;return o&&t.length===0?x=e.jsx("p",{"data-testid":"execution-list-loading",children:"Loading…"}):t.length===0?x=e.jsx("p",{"data-testid":"execution-list-empty",children:r??"No executions yet."}):x=e.jsx("ul",{className:"w6w-execution-list-rows",children:t.map(f=>e.jsx("li",{"data-testid":"execution-row","data-execution-id":f.id,children:e.jsx(je,{icon:e.jsx(ge,{state:f.status}),title:l?f.callableName:ne(f.startedAt),subtitle:l?`${As[f.kind]} · ${ne(f.startedAt)}`:f.id,trailing:be(f.durationMs),active:f.id===s,onClick:n?()=>n(f.id):void 0})},f.id))}),e.jsxs("div",{className:"w6w-execution-list","data-testid":"execution-list",children:[x,w]})}function yt({steps:t,emptyLabel:s,onDismiss:n,runError:l,stepErrors:o}){const r=n?e.jsx("div",{className:"w6w-execution-log-head",children:e.jsx(m.IconButton,{label:"Dismiss run log","data-testid":"execution-log-dismiss",onClick:n,children:"×"})}):null,a=o??[],i=l||a.length>0?e.jsxs("div",{className:"w6w-execution-log-errors w6w-stack",children:[l&&e.jsx(Ue,{error:l}),a.map((c,d)=>e.jsx(Ue,{label:c.label??c.stepId,error:c.error},`${c.stepId}:${d}`))]}):null;return t.length===0?e.jsxs(e.Fragment,{children:[r,i,e.jsx("div",{className:"w6w-execution-log-empty",children:e.jsx("p",{className:"w6w-muted w6w-small",children:s??"No nodes have run yet."})})]}):e.jsxs(e.Fragment,{children:[r,i,e.jsx("ol",{className:"w6w-execution-log",children:t.map(c=>e.jsx(Es,{step:c},c.id))})]})}function Es({step:t}){const[s,n]=j.useState(!1),l=e.jsxs("div",{className:"w6w-execution-log-row-header",children:[e.jsx(ge,{state:t.status}),e.jsx("span",{className:"w6w-execution-log-row-label",children:t.label??t.id}),e.jsx(Is,{startedAt:t.startedAt,finishedAt:t.finishedAt})]}),o=t.error?e.jsx(Ue,{error:t.error}):null;return t.input===void 0&&t.output===void 0&&!t.meta?e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsx("div",{className:"w6w-section",children:l}),o]}):e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsxs("details",{className:"w6w-section",open:s,onToggle:r=>n(r.currentTarget.open),children:[e.jsx("summary",{className:"w6w-section-summary",children:l}),s&&e.jsxs("div",{className:"w6w-execution-log-row-body w6w-section-body w6w-stack",children:[e.jsx(ot,{title:"Input",value:t.input}),e.jsx(ot,{title:"Output",value:t.output}),t.meta&&e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:"Metadata"}),e.jsx(ye.CodeBlock,{code:JSON.stringify(t.meta,null,2),language:"json"})]})]})]}),o]})}function Ue({error:t,label:s}){return e.jsxs("div",{className:"w6w-result w6w-error",children:[s!==void 0&&e.jsx("strong",{className:"w6w-execution-log-error-label",children:s}),t.code&&e.jsx("div",{className:"w6w-small w6w-execution-log-error-code",children:e.jsx("code",{children:t.code})}),t.message]})}function Is({startedAt:t,finishedAt:s}){if(t&&s){const n=Rs(t,s);return e.jsxs("span",{className:"w6w-execution-log-timing",children:[t," → ",s,n&&e.jsxs("span",{children:[" (",n,")"]})]})}return t?e.jsxs("span",{className:"w6w-execution-log-timing",children:["Started ",t]}):e.jsx("span",{className:"w6w-execution-log-timing",children:"—"})}function Rs(t,s){const n=Date.parse(t),l=Date.parse(s);if(!Number.isFinite(n)||!Number.isFinite(l)||l<n)return null;const o=l-n;if(o<1e3)return`${o}ms`;const r=o/1e3;if(r<60)return`${r.toFixed(1)}s`;const a=Math.floor(r/60),i=Math.round(r%60);return`${a}m ${i}s`}function ot({title:t,value:s}){return e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:t}),s===void 0?e.jsx("p",{className:"w6w-muted w6w-small",children:"Not available."}):e.jsx(ye.CodeBlock,{code:JSON.stringify(s,null,2),language:"json"})]})}const Ms={status:"",kind:"",from:"",to:"",q:""},Os=[{value:"",label:"Any status"},{value:"queued",label:"Queued"},{value:"running",label:"Running"},{value:"succeeded",label:"Succeeded"},{value:"failed",label:"Failed"},{value:"canceled",label:"Canceled"}],Ps=[{value:"",label:"Any type"},{value:"function",label:"Function"},{value:"endpoint",label:"Endpoint"},{value:"workflow",label:"Workflow"}];function Fs({value:t,onChange:s,showKind:n=!1,searchPlaceholder:l="Search by id or name",disabled:o=!1}){const r=t.status!==""||t.kind!==""||t.from!==""||t.to!==""||t.q!=="";return e.jsxs("div",{className:"w6w-execution-filters","data-testid":"execution-filters",children:[e.jsx("input",{type:"search",className:"w6w-execution-filters-search","data-testid":"execution-filter-q","aria-label":"Search executions",placeholder:l,value:t.q,disabled:o,onChange:a=>s({...t,q:a.target.value})}),e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-status","aria-label":"Status",value:t.status,disabled:o,onChange:a=>s({...t,status:a.target.value}),children:Os.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}),n&&e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-kind","aria-label":"Type",value:t.kind,disabled:o,onChange:a=>s({...t,kind:a.target.value}),children:Ps.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))}),e.jsx("input",{type:"date",className:"w6w-execution-filters-date","data-testid":"execution-filter-from","aria-label":"From date",value:t.from,disabled:o,onChange:a=>s({...t,from:a.target.value})}),e.jsx("input",{type:"date",className:"w6w-execution-filters-date","data-testid":"execution-filter-to","aria-label":"To date",value:t.to,disabled:o,onChange:a=>s({...t,to:a.target.value})}),r&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-execution-filters-clear","data-testid":"execution-filter-clear",disabled:o,onClick:()=>s({...Ms}),children:"Clear"})]})}const xe="—";function _s({stats:t,label:s}){const n=[{testid:"execution-stat-total",label:"Executions",value:t?String(t.total):xe},{testid:"execution-stat-success-rate",label:"Success rate",value:Ls(t==null?void 0:t.successRate)},{testid:"execution-stat-failed",label:"Failed",value:t?String(t.failed):xe},{testid:"execution-stat-avg-duration",label:"Avg duration",value:t?be(t.avgDurationMs):xe}];return t&&t.inFlight>0&&n.push({testid:"execution-stat-in-flight",label:"In flight",value:String(t.inFlight)}),e.jsxs("section",{className:"w6w-execution-stats","data-testid":"execution-stats",children:[s!=null&&e.jsx("p",{className:"w6w-execution-stats-label",children:s}),e.jsx("div",{className:"w6w-execution-stats-cards",children:n.map(l=>e.jsxs("div",{className:"w6w-execution-stat","data-testid":l.testid,children:[e.jsx("span",{className:"w6w-execution-stat-value","data-stat-value":l.value,children:l.value}),e.jsx("span",{className:"w6w-execution-stat-label",children:l.label})]},l.testid))})]})}function Ls(t){return t==null||!Number.isFinite(t)?xe:`${Math.round(t*100)}%`}const Bs={function:"Function",endpoint:"Endpoint",workflow:"Workflow"};function Us(t){return JSON.stringify(t,null,2)??"null"}function Ds({execution:t,loading:s=!1,errorMessage:n,onClose:l,onOpenInEditor:o}){return e.jsxs("section",{className:"w6w-execution-detail w6w-stack","data-testid":"execution-detail",children:[n!=null&&e.jsx("p",{role:"alert",className:"w6w-execution-detail-error-message","data-testid":"execution-detail-error-message",children:n}),t?e.jsx(Js,{execution:t,onClose:l,onOpenInEditor:o}):s?e.jsx("p",{className:"w6w-muted","data-testid":"execution-detail-loading",children:"Loading…"}):e.jsx("p",{className:"w6w-muted","data-testid":"execution-detail-empty",children:"No execution selected."})]})}function Js({execution:t,onClose:s,onOpenInEditor:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"w6w-execution-detail-head",children:[e.jsxs("div",{className:"w6w-execution-detail-title",children:[e.jsx("h3",{className:"w6w-execution-detail-name",children:t.callableName}),e.jsxs("div",{className:"w6w-execution-detail-meta",children:[e.jsx(ge,{state:t.status}),e.jsx("span",{className:"w6w-execution-detail-kind w6w-muted w6w-small",children:Bs[t.kind]})]})]}),(n||s)&&e.jsxs("div",{className:"w6w-execution-detail-actions",children:[n&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-detail-open-editor",onClick:n,children:"Open in visual editor"}),s&&e.jsx(m.IconButton,{label:"Close","data-testid":"execution-detail-close",onClick:s,children:"×"})]})]}),e.jsx("p",{className:"w6w-execution-detail-id-line",children:e.jsx("code",{className:"w6w-execution-detail-id","data-testid":"execution-detail-id",children:t.id})}),e.jsxs("dl",{className:"w6w-execution-detail-timing",children:[e.jsx(_e,{label:"Started",value:ne(t.startedAt)}),e.jsx(_e,{label:"Finished",value:t.finishedAt?ne(t.finishedAt):"—"}),e.jsx(_e,{label:"Duration",value:be(t.durationMs)})]}),t.steps!==void 0&&e.jsxs("section",{className:"w6w-execution-detail-section w6w-stack","data-testid":"execution-detail-steps",children:[e.jsx("strong",{className:"w6w-small",children:"Nodes"}),e.jsx(yt,{steps:t.steps,emptyLabel:"No nodes ran."})]}),t.input!==void 0&&e.jsx(Le,{title:"Input",testid:"execution-detail-input",value:t.input}),t.output!==void 0&&e.jsx(Le,{title:"Output",testid:"execution-detail-output",value:t.output}),t.error!=null&&e.jsx(Le,{title:"Error",testid:"execution-detail-error",value:t.error})]})}function _e({label:t,value:s}){return e.jsxs("div",{className:"w6w-execution-detail-timing-item",children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function Le({title:t,testid:s,value:n}){return e.jsxs("section",{className:"w6w-execution-detail-section w6w-stack","data-testid":s,children:[e.jsx("strong",{className:"w6w-small",children:t}),e.jsx(ye.CodeBlock,{code:Us(n),language:"json"})]})}function Nt(t){const s=[];for(const n of t)n.p95Ms!==null&&s.push({appId:n.appId,displayName:n.displayName,calls:n.calls,p95Ms:n.p95Ms,state:n.state,errorCount:n.errors.e4xx+n.errors.e429+n.errors.eAuth+n.errors.e5xx});return s}function Ws(t){return t.attention==="now"||t.attention==="recent"}function gt(t){const s={now:[],recent:[],clear:[]};for(const n of t)n.attention==="now"?s.now.push(n):n.attention==="recent"?s.recent.push(n):s.clear.push(n);return s}function bt(t){return t.uptime.map(s=>({day:s.day,state:s.state}))}const De=3,kt=5;function St(t,s={}){const n=s.compact??!1,{now:l,recent:o}=gt(t),r=l.length+o.length,a=n?l.slice(0,De):l,i=n?o.slice(0,Math.max(0,De-a.length)):o,c=n?t.slice(0,s.limit??kt):[...t];return{attentionCount:r,shownNow:a,shownRecent:i,hiddenAttentionCount:r-a.length-i.length,shownTable:c,hiddenTableCount:t.length-c.length}}const he=640,te=340,P={top:16,right:24,bottom:40,left:56};function ct(t){if(t<=0)return 1;const s=10**Math.floor(Math.log10(t)),n=[1,2,5,10];for(const l of n)if(t<=l*s)return l*s;return 10*s}function dt(t,s=5){return Array.from({length:s+1},(n,l)=>Math.round(t*l/s))}function Ct({services:t,getHref:s,onOpen:n}){const l=Nt(t);if(l.length===0)return e.jsx("p",{className:"w6w-muted w6w-small",children:"No timed calls in this window yet."});const o=ct(Math.max(...l.map(p=>p.calls))),r=ct(Math.max(...l.map(p=>p.p95Ms))),a=Math.max(1,...l.map(p=>p.errorCount)),i=he-P.left-P.right,c=te-P.top-P.bottom,d=p=>P.left+p/o*i,w=p=>P.top+p/r*c,x=p=>16+p/a*14,f=dt(o),h=dt(r),y=18,v=P.top+c/2;return e.jsxs("div",{className:"w6w-rel-scatter",children:[e.jsxs("svg",{viewBox:`0 0 ${he} ${te}`,style:{aspectRatio:`${he} / ${te}`},role:"img","aria-label":"API performance: calls versus p95 latency, one point per API",children:[e.jsx("rect",{x:P.left,y:P.top,width:i,height:c,className:"w6w-rel-scatter-plot-bg"}),h.map(p=>e.jsxs("g",{children:[e.jsx("line",{x1:P.left,x2:he-P.right,y1:w(p),y2:w(p),className:"w6w-rel-scatter-grid"}),e.jsx("text",{x:P.left-8,y:w(p),className:"w6w-rel-scatter-axis-label",textAnchor:"end",children:p})]},`y-${p}`)),f.map(p=>e.jsx("text",{x:d(p),y:te-P.bottom+18,className:"w6w-rel-scatter-axis-label",textAnchor:"middle",children:p},`x-${p}`)),e.jsx("text",{x:y,y:v,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",transform:`rotate(-90, ${y}, ${v})`,children:"p95 (ms)"}),e.jsx("text",{x:P.left+i/2,y:te-4,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",children:"calls in this window"}),l.map(p=>{const M=x(p.errorCount),I=d(p.calls),R=w(p.p95Ms),T=e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:I,cy:R,r:M/2+2.5,className:`w6w-rel-scatter-ring w6w-rel-scatter-ring-${p.state}`,children:e.jsxs("title",{children:[p.displayName," — ",p.calls," calls, ",p.p95Ms," ms p95, ",p.errorCount," errors"]})}),e.jsx("circle",{cx:I,cy:R,r:M/2,className:`w6w-rel-scatter-point w6w-rel-scatter-point-${p.state}`})]});return s?e.jsx("a",{href:s(p.appId),className:"w6w-rel-scatter-point-link",onClick:n?k=>n(p.appId,k):void 0,children:T},p.appId):n?e.jsx("g",{role:"button",tabIndex:0,className:"w6w-rel-scatter-point-link",onClick:k=>n(p.appId,k),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.currentTarget.dispatchEvent(new MouseEvent("click",{bubbles:!0})))},children:T},p.appId):e.jsx("g",{children:T},p.appId)})]}),e.jsx("p",{className:"w6w-muted w6w-small w6w-rel-scatter-note",children:"Up is faster, right is more calls — top-right is the best outcome. Icon size is the error count in this window; ring colour is exec status."})]})}function ut(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function $t({appId:t,className:s,title:n,getHref:l,onOpen:o,children:r}){return l?e.jsx("a",{className:s,href:l(t),title:n,onClick:o?a=>o(t,a):void 0,children:r}):o?e.jsx("button",{type:"button",className:s,title:n,onClick:a=>o(t,a),children:r}):e.jsx("div",{className:s,title:n,children:r})}function At({service:t}){return e.jsxs("span",{className:"w6w-rel-signal",children:[e.jsx(Ne,{state:t.state}),t.ongoingOutageId&&e.jsx("span",{className:"w6w-rel-tag",children:"outage open"}),t.calls===0&&e.jsx("span",{className:"w6w-muted w6w-small",children:"no calls"})]})}function Tt({vendor:t}){if(!t)return e.jsx("span",{className:"w6w-muted w6w-small",children:"not published"});const s=t.state==="unknown";return e.jsxs("span",{className:"w6w-rel-signal",title:t.message??void 0,children:[e.jsx(Ne,{state:t.state,label:s?"Unavailable":void 0}),!s&&t.message&&e.jsx("span",{className:"w6w-rel-vendor-msg w6w-small",children:t.message})]})}function Ks({service:t,getHref:s,onOpen:n}){return e.jsxs($t,{appId:t.appId,className:"w6w-rel-issue-card",title:`${t.displayName} — open service detail`,getHref:s,onOpen:n,children:[e.jsxs("span",{className:"w6w-rel-issue-head",children:[e.jsx(m.AppIcon,{src:t.iconSrc,srcDark:t.iconSrcDark,brandColor:t.brandColor,name:t.displayName,size:24}),e.jsxs("span",{className:"w6w-rel-issue-head-text",children:[e.jsx("strong",{children:t.displayName}),t.attention==="recent"&&e.jsx("span",{className:"w6w-muted w6w-small",children:"trouble earlier in this window"})]})]}),e.jsxs("span",{className:"w6w-rel-issue-signals",children:[e.jsxs("span",{className:"w6w-rel-issue-signal",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"w6w exec"}),e.jsx(At,{service:t})]}),e.jsxs("span",{className:"w6w-rel-issue-signal",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"API status"}),e.jsx(Tt,{vendor:t.vendorStatus})]})]})]})}function qs({service:t,getHref:s,onOpen:n}){const l=t.calls===0;return e.jsxs("tr",{className:`w6w-rel-tr${t.attention!=="none"?" w6w-rel-attention":""}`,"data-attention":t.attention==="none"?void 0:t.attention,children:[e.jsx("td",{className:"w6w-rel-td-service",children:e.jsxs($t,{appId:t.appId,className:"w6w-rel-open",getHref:s,onOpen:n,children:[e.jsx(m.AppIcon,{src:t.iconSrc,srcDark:t.iconSrcDark,brandColor:t.brandColor,name:t.displayName,size:28}),e.jsxs("span",{className:"w6w-rel-td-service-text",children:[e.jsx("strong",{children:t.displayName}),e.jsx("code",{className:"w6w-muted w6w-small",children:t.appId})]})]})}),e.jsxs("td",{className:"w6w-rel-td-status",children:[e.jsxs("span",{className:"w6w-rel-status-row",children:[e.jsx("span",{className:"w6w-rel-status-label w6w-muted w6w-small",children:"Ops"}),e.jsx(At,{service:t})]}),e.jsxs("span",{className:"w6w-rel-status-row",children:[e.jsx("span",{className:"w6w-rel-status-label w6w-muted w6w-small",children:"API"}),e.jsx(Tt,{vendor:t.vendorStatus})]})]}),e.jsx("td",{className:"w6w-rel-td-uptime",children:l?e.jsx("span",{className:"w6w-rel-idle-note",children:"No calls in this window"}):e.jsxs(e.Fragment,{children:[e.jsx(xt,{days:bt(t),ariaLabel:`${t.displayName}, ${t.uptime.length}-day status, oldest day first`}),e.jsxs("span",{className:"w6w-muted w6w-small",children:[t.calls," calls"]})]})}),e.jsx("td",{className:"w6w-rel-td-p95",children:t.p95Ms===null?"—":`${t.p95Ms} ms`})]})}function Hs({services:t,window:s,days:n,compact:l=!1,showChart:o,limit:r,getHref:a,onOpen:i,showAllHref:c,onShowAll:d,slots:w}){const x=n??(s==null?void 0:s.days)??30,f=t.length>0&&t.every(S=>S.calls>0&&S.state==="ok"),{attentionCount:h,shownNow:y,shownRecent:v,hiddenAttentionCount:p,shownTable:M,hiddenTableCount:I}=St(t,{compact:l,limit:r}),R=o??!l,T=c!==void 0||d!==void 0,k=S=>{const E=S.startsWith("Show")?"w6w-muted w6w-small":void 0;return c!==void 0?e.jsx("a",{href:c,className:E,onClick:d,children:S}):d?e.jsx("button",{type:"button",className:`w6w-rel-show-all${E?` ${E}`:""}`,onClick:d,children:S}):null};return e.jsxs("section",{className:"w6w-rel-section",children:[e.jsxs("h3",{className:"w6w-rel-heading",children:[e.jsxs("span",{children:[(w==null?void 0:w.header)??"Service reliability"," ",s&&e.jsxs("span",{className:"w6w-muted w6w-small",children:[ut(s.from)," – ",ut(s.to)," · ",s.days," days"]})]}),l&&k("Show all services →"),w==null?void 0:w.actions]}),e.jsxs("div",{className:l?"w6w-rel-card":void 0,children:[e.jsx("p",{className:"w6w-muted w6w-small w6w-rel-intro",children:"Connected services across your account. Performance for the selected project."}),f&&e.jsxs("div",{className:l?"w6w-rel-allclear":"w6w-rel-card w6w-rel-allclear",children:[e.jsx("h4",{children:"All clear"}),e.jsxs("p",{children:["Every service you called in the last ",x," days came back"," ",e.jsx(Ne,{state:"ok"})," — no degraded stretches, no outages."]})]}),t.length===0&&((w==null?void 0:w.empty)??e.jsx("div",{className:l?void 0:"w6w-rel-card",children:e.jsx("p",{className:"w6w-muted",children:"No services yet — connect an integration or use a service in this project."})})),t.length>0&&e.jsxs(e.Fragment,{children:[h>0&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsxs("h4",{className:"w6w-rel-group-head",children:["Needs attention"," ",e.jsxs("span",{className:"w6w-muted w6w-small",children:[y.length+v.length," of ",h]})]}),e.jsx("div",{className:"w6w-rel-issues",children:[...y,...v].map(S=>e.jsx(Ks,{service:S,getHref:a,onOpen:i},S.appId))}),p>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[p," more ",p===1?"needs":"need"," ","attention",T&&e.jsxs(e.Fragment,{children:[" — ",k("view all →")]})]})]}),R&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsx("h4",{className:"w6w-rel-group-head",children:"Performance across your APIs"}),e.jsx(Ct,{services:t,getHref:a,onOpen:i})]}),M.length>0&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsxs("h4",{className:"w6w-rel-group-head",children:[l?"Services":"All services"," ",e.jsx("span",{className:"w6w-muted w6w-small",children:l?`${M.length} of ${t.length}`:t.length})]}),e.jsx("div",{className:"w6w-rel-table-wrap",children:e.jsxs("table",{className:"w6w-rel-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Service"}),e.jsx("th",{children:"Status"}),e.jsxs("th",{children:["Last ",x," days"]}),e.jsx("th",{children:"Latency"})]})}),e.jsx("tbody",{children:M.map(S=>e.jsx(qs,{service:S,getHref:a,onOpen:i},S.appId))})]})}),I>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[I," more",T&&e.jsxs(e.Fragment,{children:[" — ",k("view all →")]})]})]})]})]})]})}function Vs(t,s){return t.render?t.render(s):String(s[t.key]??"")}function We(t){const{columns:s,rows:n,rowKey:l,onRowClick:o,getRowHref:r,empty:a,loading:i,className:c,testId:d}=t;return n.length===0&&!i&&a!==void 0&&a!==null?e.jsx(e.Fragment,{children:a}):e.jsx("div",{className:"w6w-data-table-frame",children:e.jsxs("table",{className:c?`w6w-data-table ${c}`:"w6w-data-table","data-testid":d,"aria-busy":i?!0:void 0,children:[e.jsx("thead",{children:e.jsx("tr",{children:s.map(w=>e.jsx("th",{style:{width:w.width,textAlign:w.align},scope:"col",children:w.header},w.key))})}),e.jsx("tbody",{children:n.map(w=>{var f;const x=r==null?void 0:r(w);return e.jsx("tr",{"data-testid":(f=t.rowTestId)==null?void 0:f.call(t,w),className:o?"w6w-data-table-row-clickable":void 0,onClick:o?h=>o(w,h):void 0,children:s.map(h=>{const y=Vs(h,w);return e.jsx("td",{style:{textAlign:h.align},children:x!==void 0&&h.link!==!1?e.jsx("a",{className:"w6w-data-table-link",href:x,children:y}):y},h.key)})},l(w))})})]})})}function ve({title:t,children:s,action:n,className:l,testId:o}){return e.jsx("div",{className:l?`w6w-empty-state ${l}`:"w6w-empty-state","data-testid":o,children:e.jsxs("div",{className:"w6w-empty-state-inner",children:[t!=null&&e.jsx("div",{className:"w6w-empty-state-title",children:t}),s!=null&&e.jsx("div",{className:"w6w-empty-state-body",children:s}),n!=null&&e.jsx("div",{className:"w6w-empty-state-action",children:n})]})})}function zs({rows:t,title:s,description:n,emptyCopy:l,newLabel:o="New",openRowTitle:r,testIds:a,loading:i,error:c,onCreate:d,creating:w,onImport:x,onOpen:f,getHref:h,showArchived:y,onShowArchivedChange:v,slots:p}){const[M,I]=j.useState(!1),R=y!==void 0,T=R?y:M,k=T?t:t.filter(g=>!g.archived),S=f!==void 0||h!==void 0,E=g=>{R||I(g),v==null||v(g)},_=[{key:"main",header:"Name",render:g=>{const A=e.jsxs("span",{className:"w6w-callable-list-main",title:S?r:void 0,children:[e.jsx("span",{children:g.title}),g.description!=null&&e.jsx("span",{className:"w6w-muted w6w-small w6w-callable-list-row-desc",children:g.description})]});return f&&!h?e.jsx("button",{type:"button",className:"w6w-callable-list-open",children:A}):A}},{key:"trail",header:"",align:"right",render:g=>g.archived||g.badges!=null||g.trailing!=null?e.jsxs("span",{className:"w6w-callable-list-trail",children:[g.badges,g.archived&&e.jsx("span",{className:"w6w-callable-list-badge","data-testid":a==null?void 0:a.archivedBadge,children:"archived"}),g.trailing]}):null}],F=t.length>0&&k.length===0;return e.jsxs("section",{className:"w6w-callable-list",children:[e.jsxs("div",{className:"w6w-callable-list-head",children:[e.jsxs("div",{className:"w6w-callable-list-heading",children:[(p==null?void 0:p.header)??e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"w6w-callable-list-title",children:s}),n!=null&&e.jsx("p",{className:"w6w-muted w6w-small w6w-callable-list-description",children:n})]}),e.jsxs("label",{className:"w6w-muted w6w-small w6w-callable-list-toggle",children:[e.jsx("input",{type:"checkbox",checked:T,"data-testid":a==null?void 0:a.showArchived,onChange:g=>E(g.target.checked)}),"Show archived"]})]}),e.jsxs("div",{className:"w6w-callable-list-actions",children:[p==null?void 0:p.actions,x&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":a==null?void 0:a.importOpen,onClick:x,children:"Import"}),d&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:w,onClick:d,children:w?"Creating…":o})]})]}),c&&e.jsx("div",{className:"w6w-error",children:c}),e.jsxs("div",{className:"w6w-callable-list-body",children:[i&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),k.length===0&&!i?F?e.jsx(ve,{testId:"w6w-callable-list-empty",action:e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>E(!0),children:"Show archived"}),children:t.length===1?"The only item is archived.":`All ${t.length} items are archived.`}):e.jsx(ve,{testId:"w6w-callable-list-empty",children:(p==null?void 0:p.empty)??l}):e.jsx(We,{columns:_,rows:k,rowKey:g=>g.id,loading:i,getRowHref:h?g=>h(g.id):void 0,onRowClick:f?(g,A)=>f(g.id,A):void 0})]})]})}function Et(t,s){if(t.app)return t.app;if(t.app!==null)return s.get(t.appId)}function Ys(t){const s=new Set;for(const n of t)n.app===void 0&&s.add(n.appId);return[...s]}function Gs({connections:t,appsById:s,loading:n,error:l,onOpen:o,getHref:r,onEdit:a,onDelete:i,busy:c,slots:d}){const w=s??new Map,x=a!==void 0||i!==void 0,f=[{key:"name",header:"Name",render:h=>{const y=Et(h,w),v=h.displayName||h.id;return e.jsxs("span",{className:"w6w-connection-cell-name",children:[e.jsx(m.AppIcon,{src:y==null?void 0:y.iconSvg,srcDark:y==null?void 0:y.iconSvgDark,brandColor:y==null?void 0:y.brandColor,name:(y==null?void 0:y.displayName)??h.appId}),e.jsx("strong",{className:"w6w-connection-name",title:v,children:v})," ",e.jsx("span",{className:"w6w-muted",children:(y==null?void 0:y.displayName)??h.appId})]})}},{key:"status",header:"Status",render:h=>e.jsxs(e.Fragment,{children:["auth ",e.jsx("code",{children:h.authKey})," ·"," ",e.jsx("span",{className:`w6w-connection-tag${h.state==="connected"?"":" w6w-connection-tag-warn"}`,children:h.state}),h.lastTestOk===!1&&e.jsx("span",{className:"w6w-connection-tag w6w-connection-tag-danger",title:"Last test failed — update or re-test.",children:"invalid"})]})}];return x&&f.push({key:"actions",header:"",align:"right",link:!1,render:h=>h.builtIn===!0?null:e.jsxs("div",{className:"w6w-connection-row-actions",onClick:y=>y.stopPropagation(),children:[a&&e.jsx(ft,{label:"Edit",onClick:()=>a(h),"data-testid":`connection-edit-${h.id}`}),i&&e.jsx(vt,{label:"Delete",onClick:()=>i(h),disabled:c,"data-testid":`connection-delete-${h.id}`})]})}),e.jsxs("section",{className:"w6w-connection-list",children:[((d==null?void 0:d.header)!=null||(d==null?void 0:d.actions)!=null)&&e.jsxs("div",{className:"w6w-connection-list-head",children:[e.jsx("div",{className:"w6w-connection-list-heading",children:d==null?void 0:d.header}),e.jsx("div",{className:"w6w-connection-list-actions",children:d==null?void 0:d.actions})]}),l&&e.jsx("div",{className:"w6w-error",children:l}),n&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),t.length===0&&!n?e.jsx(ve,{testId:"w6w-connection-list-empty",children:(d==null?void 0:d.empty)??"No connections yet."}):e.jsx(We,{columns:f,rows:t,rowKey:h=>h.id,loading:n,getRowHref:r?h=>h.builtIn===!0?void 0:r(h.id):void 0,onRowClick:o?(h,y)=>h.builtIn===!0?void 0:o(h.id,y):void 0})]})}function Qs({connection:t,onClose:s,onSaved:n}){const l=m.useW6WApi(),o=l.updateConnection,r=t.builtIn===!0,a=!r&&typeof o=="function",[i,c]=j.useState(t.displayName??""),[d,w]=j.useState({}),[x,f]=j.useState(null),[h,y]=j.useState(null),[v,p]=j.useState(!1),[M,I]=j.useState({}),[R,T]=j.useState(!1),[k,S]=j.useState(!1),[E,_]=j.useState(null),[F,g]=j.useState(null);j.useEffect(()=>{if(!a)return;let N=!1;return f(null),l.getAppAuth(t.appId).then(C=>!N&&f(C)).catch(C=>!N&&y(C.message)),()=>{N=!0}},[l,a,t.appId]);const A=x==null?void 0:x.find(N=>N.key===t.authKey),Q=(A==null?void 0:A.type)==="oauth2",B=Q?[]:(A==null?void 0:A.fields)??[],U=t.credentialId,L=!!U&&typeof l.rotateCredential=="function"&&!Q,Z=L&&(A!=null&&A.serviceAccount)?m.bindingFieldsFor(A.serviceAccount):[];j.useEffect(()=>{if(!a||!L||!U||typeof l.getCredential!="function")return;let N=!1;return l.getCredential(U).then(C=>!N&&_(C.connectionCount)).catch(()=>{}),()=>{N=!0}},[l,a,L,U]);function V(){if(L){const $={};i!==(t.displayName??"")&&($.displayName=i);const D=m.buildBinding(Z,M);return D&&($.binding=D),$.displayName===void 0&&$.binding===void 0?null:$}const N={};for(const $ of B){const D=d[$.key];D!==void 0&&D!==""&&(N[$.key]=D)}const C={};return i!==(t.displayName??"")&&(C.displayName=i),Object.keys(N).length>0&&(C.credential=N),C.displayName===void 0&&C.credential===void 0?null:C}async function z(){if(!a||!o||v)return;y(null);const N=V();if(!N){y(L?"Nothing to update — change the name or a binding field.":"Nothing to update — change the name or a credential field.");return}p(!0);try{const C=await o.call(l,t.id,N);w({}),n(C)}catch(C){y(C.message)}finally{p(!1)}}const ke=B.some(N=>N.required&&(d[N.key]===void 0||d[N.key]===""));async function ie(){if(!U||!l.rotateCredential||v)return;y(null);const N=m.parseJsonFields(B,d);if("error"in N){y(N.error);return}p(!0);try{await l.rotateCredential(U,{source:N.values}),w({}),T(!1),S(!0),g(null)}catch(C){y(C.message)}finally{p(!1)}}async function Se(){if(!(!U||!l.testCredential)){y(null);try{g(await l.testCredential(U))}catch(N){y(N.message)}}}const Y=m.useEnterSubmit(z,{enabled:a&&!v});return e.jsx(m.Modal,{title:"Edit connection",onClose:s,children:e.jsxs("div",{className:"w6w-stepconfig",children:[e.jsx("div",{className:"w6w-modal-body",children:e.jsxs("div",{className:"w6w-stack",children:[r&&e.jsx("p",{className:"w6w-muted w6w-small",children:"This connection is built in — it has no stored credential to edit."}),!r&&!a&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Editing connections is not available here."}),a&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Display name"}),e.jsx("input",{type:"text",value:i,onChange:N=>c(N.target.value),placeholder:"Connection name",maxLength:80,name:"w6w-connection-label",autoComplete:"off","data-1p-ignore":"true","data-lpignore":"true","data-bwignore":"true","data-form-type":"other",...Y})]}),x===null&&!h&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Loading auth fields…"}),Q&&e.jsx("p",{className:"w6w-muted w6w-small",children:"This is an OAuth connection. You can rename it here; its credential is renewed by re-authorizing it."}),L&&Z.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"w6w-muted w6w-small",children:"Leave a binding field blank to keep it unchanged."}),e.jsx(m.AuthFieldsForm,{mode:"edit",fields:Z,values:M,onChange:I,enterSubmitProps:Y})]}),L&&e.jsxs("div",{className:"w6w-stack","data-w6w":"credential-section",children:[typeof l.testCredential=="function"&&e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:Se,children:"Test credential"}),F&&e.jsxs("p",{className:"w6w-small","data-w6w":"credential-health",children:["Credential health: ",F.ok?"ok":F.code??"failed"]})]}),e.jsxs("p",{className:"w6w-small","data-w6w":"app-access",children:["App access:"," ",t.lastTestOk===!0?"passed":t.lastTestOk===!1?"failed":"never tested"]}),k&&e.jsx("p",{className:"w6w-small",children:"Credential rotated."}),R?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"w6w-muted w6w-small",children:["Enter the full new credential; it replaces the stored one.",E!==null&&` It is used by ${E} connection${E===1?"":"s"}, and all of them switch to it.`]}),e.jsx(m.AuthFieldsForm,{fields:B,values:d,onChange:w}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"w6w-btn",disabled:v||ke,onClick:ie,children:"Rotate"})," ",e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>{T(!1),w({})},children:"Cancel rotation"})]})]}):e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>T(!0),children:"Rotate credential"})]}),!L&&B.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"w6w-muted w6w-small",children:"Leave a field blank to keep it unchanged. Filled fields replace the stored credential."}),e.jsx(m.AuthFieldsForm,{mode:"edit",fields:B,values:d,onChange:w,enterSubmitProps:Y})]})]}),h&&e.jsx("div",{className:"w6w-result w6w-error",children:h})]})}),e.jsxs("div",{className:"w6w-modal-actions",children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:s,children:"Cancel"}),a&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:v,onClick:z,children:v?"Saving…":"Save"})]})]})})}function Zs({conn:t,app:s,children:n}){return e.jsxs("div",{className:"w6w-connection-header","data-testid":"connection-header",children:[e.jsx(m.AppIcon,{src:s==null?void 0:s.iconSvg,srcDark:s==null?void 0:s.iconSvgDark,brandColor:s==null?void 0:s.brandColor,name:(s==null?void 0:s.displayName)??t.appId,size:56}),e.jsxs("div",{className:"w6w-connection-header-main",children:[e.jsx("h2",{className:"w6w-connection-header-title",children:t.displayName||t.id}),e.jsxs("p",{className:"w6w-muted w6w-small w6w-connection-header-meta",children:[e.jsx(pt,{value:t.id,className:"w6w-connection-id-copy"})," · App"," ",e.jsx("code",{children:t.appId})," · Auth ",e.jsx("code",{children:t.authKey})," ·"," ",e.jsx("span",{className:`w6w-connection-tag${t.state==="connected"?"":" w6w-connection-tag-warn"}`,children:t.state}),t.lastTestOk===!1&&e.jsx("span",{className:"w6w-connection-tag w6w-connection-tag-danger",title:"Last test failed — update or re-test.",children:"invalid"})]})]}),n&&e.jsx("div",{className:"w6w-connection-header-actions",children:n})]})}const Xs=t=>String(t);function wt(t){const s=Math.min(100,Math.max(0,t));return Number(s.toFixed(4))}function en({label:t,used:s,limit:n,reserved:l=0,format:o,className:r,testId:a}){const i=o??Xs,c=Number.isFinite(l)&&l>0,d=n>0?wt(s/n*100):100,w=c&&n>0?wt(Math.min(100-d,l/n*100)):0,x=s>=n,f=`${i(s)} / ${i(n)}`,h=["w6w-budget-meter"];return x&&h.push("w6w-budget-meter-over"),r&&h.push(r),e.jsxs("div",{role:"meter",className:h.join(" "),"aria-label":t,"aria-valuemin":0,"aria-valuenow":s,"aria-valuemax":n,"aria-valuetext":f,"data-testid":a,children:[e.jsxs("div",{className:"w6w-budget-meter-head",children:[e.jsx("span",{className:"w6w-budget-meter-label",children:t}),e.jsx("span",{className:"w6w-budget-meter-value",children:f})]}),e.jsxs("div",{className:"w6w-budget-meter-track",children:[e.jsx("div",{className:"w6w-budget-meter-used",style:{width:`${d}%`}}),c&&e.jsx("div",{className:"w6w-budget-meter-reserved",style:{width:`${w}%`}})]})]})}exports.AddConnectionModal=m.AddConnectionModal;exports.ApiCallsPanel=m.ApiCallsPanel;exports.AppIcon=m.AppIcon;exports.AppPicker=m.AppPicker;exports.AuthFieldsForm=m.AuthFieldsForm;exports.CanvasLayer=m.CanvasLayer;exports.CodeEditor=m.CodeEditor;exports.Combobox=m.Combobox;exports.ConfirmModal=m.ConfirmModal;exports.CredentialPicker=m.CredentialPicker;exports.ExpressionInput=m.ExpressionInput;exports.ExpressionOptionsProvider=m.ExpressionOptionsProvider;exports.IconButton=m.IconButton;exports.JsonEditor=m.JsonEditor;exports.Markdown=m.Markdown;exports.Modal=m.Modal;exports.NodeConfigForm=m.NodeConfigForm;exports.ParamsForm=m.ParamsForm;exports.PropertyEntryForm=m.PropertyEntryForm;exports.RetryPolicyFields=m.RetryPolicyFields;exports.StepBuilderModal=m.StepBuilderModal;exports.W6WUIProvider=m.W6WUIProvider;exports.filterOptions=m.filterOptions;exports.isExprValue=m.isExprValue;exports.isFormResolvedOptions=m.isFormResolvedOptions;exports.isSecretValue=m.isSecretValue;exports.isTestRequired=m.isTestRequired;exports.requiredParamsFilled=m.requiredParamsFilled;exports.shouldUseCombobox=m.shouldUseCombobox;exports.splitFrontmatter=m.splitFrontmatter;exports.startOAuthPopup=m.startOAuthPopup;exports.useEnterSubmit=m.useEnterSubmit;exports.useExpressionOptions=m.useExpressionOptions;exports.useW6WApi=m.useW6WApi;exports.CodeBlock=ye.CodeBlock;exports.Copyable=W.Copyable;exports.Icon=W.Icon;exports.iconNames=W.iconNames;exports.ATTENTION_DISPLAY_CAP=De;exports.ActionTestForm=as;exports.ApiError=se;exports.BudgetMeter=en;exports.CallableList=zs;exports.ConnectionHeader=Zs;exports.ConnectionList=Gs;exports.CopyableText=pt;exports.DataTable=We;exports.DeleteButton=vt;exports.EditButton=ft;exports.EditConnectionModal=Qs;exports.EmptyState=ve;exports.ExecutionDetail=Ds;exports.ExecutionFilters=Fs;exports.ExecutionList=Ts;exports.ExecutionLogPanel=yt;exports.ExecutionStats=_s;exports.HealthStatusPill=Ne;exports.HistoryTimeline=bs;exports.InfoTip=ks;exports.ListItem=je;exports.RECENT_DISPLAY_CAP=kt;exports.ReliabilityChart=Ct;exports.ReliabilityList=Hs;exports.RepoSyncIndicator=Ss;exports.ServerResourcesBadge=ps;exports.ServerResourcesCard=ws;exports.ServerResourcesCardSmall=ms;exports.ServerResourcesRail=hs;exports.StepStatusPill=ge;exports.UptimeStrip=xt;exports.YamlEditor=ls;exports.connectionAppIdsToLookUp=Ys;exports.createW6WApi=es;exports.cropText=ht;exports.displayBoard=St;exports.formatDurationMs=be;exports.formatExecutionTime=ne;exports.needsAttention=Ws;exports.partitionBoard=gt;exports.performancePoints=Nt;exports.resolveConnectionAppMeta=Et;exports.uptimeDays=bt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|