@w6w/ui 0.2.11 → 0.2.55
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 +139 -2
- package/README.md +28 -10
- package/dist/AppPicker.d.ts +12 -1
- package/dist/CanvasContextMenu.d.ts +19 -0
- package/dist/{CodeBlock-BqXDA35P.js → CodeBlock-C-oIIYfC.js} +1436 -555
- package/dist/CodeBlock-C-oIIYfC.js.map +1 -0
- package/dist/CodeBlock-CymlfyeA.cjs +15 -0
- package/dist/CodeBlock-CymlfyeA.cjs.map +1 -0
- package/dist/CodeEditor.d.ts +4 -1
- package/dist/ConditionEditor.d.ts +11 -0
- package/dist/JsonEditor.d.ts +12 -0
- package/dist/ParamCustomization.d.ts +5 -0
- package/dist/ParamsForm.d.ts +11 -3
- package/dist/RouterEditor.d.ts +5 -0
- package/dist/StepBuilderModal.d.ts +83 -13
- package/dist/StepNameEditor.d.ts +11 -0
- package/dist/StopEditor.d.ts +5 -0
- package/dist/TriggerFillForm.d.ts +14 -1
- package/dist/WebhookListenPanel.d.ts +28 -0
- package/dist/WorkflowConnections.d.ts +29 -0
- package/dist/WorkflowConnectionsPanel.d.ts +5 -0
- package/dist/WorkflowFlowEditor.d.ts +67 -8
- package/dist/assets/script-completion.worker-DDJKkj5M.js +8290 -0
- package/dist/assets/script-completion.worker-DDJKkj5M.js.map +1 -0
- package/dist/canvas-context-menu.d.ts +27 -0
- package/dist/code.cjs +1 -1
- package/dist/code.mjs +3 -4
- package/dist/code.mjs.map +1 -1
- package/dist/components/AnchoredFlyout.d.ts +7 -0
- package/dist/components/ColumnsEditor.d.ts +27 -0
- package/dist/components/Combobox.d.ts +12 -1
- package/dist/components/ConfirmModal.d.ts +3 -1
- package/dist/components/CsvPanel.d.ts +21 -0
- package/dist/components/DataEntryEditor.d.ts +38 -0
- package/dist/components/DataEntryList.d.ts +33 -0
- package/dist/components/DataStoreList.d.ts +33 -0
- package/dist/components/DataTableGrid.d.ts +46 -0
- package/dist/components/EventbriteTriggerPicker.d.ts +7 -0
- package/dist/components/ExecutionDetail.d.ts +17 -1
- package/dist/components/ExecutionList.d.ts +19 -1
- package/dist/components/ExecutionLogPanel.d.ts +61 -3
- package/dist/components/ExpressionEditorModal.d.ts +33 -10
- package/dist/components/ExpressionOptions.d.ts +101 -15
- package/dist/components/HtmlPreview.d.ts +7 -0
- package/dist/components/JsonTree.d.ts +32 -0
- package/dist/components/ResolvedParams.d.ts +6 -1
- package/dist/components/ResultViewer.d.ts +46 -0
- package/dist/components/ScriptBindingsNotice.d.ts +31 -0
- package/dist/components/ScriptCodeField.d.ts +13 -0
- package/dist/components/StepStatusPill.d.ts +7 -0
- package/dist/components/expression-authoring.d.ts +13 -0
- package/dist/components/expression-dom.d.ts +17 -2
- package/dist/components/expression-template.d.ts +25 -3
- package/dist/components/icons.d.ts +1 -1
- package/dist/components/json-compose.d.ts +53 -0
- package/dist/components/result-format.d.ts +13 -0
- package/dist/condition-editor.d.ts +44 -0
- package/dist/connection-app-meta-BEXlKBgV.cjs +22 -0
- package/dist/connection-app-meta-BEXlKBgV.cjs.map +1 -0
- package/dist/connection-app-meta-ZCPakGjD.js +12422 -0
- package/dist/connection-app-meta-ZCPakGjD.js.map +1 -0
- package/dist/data-stores/data-store-view.d.ts +371 -0
- package/dist/eventbrite-trigger-selection.d.ts +13 -0
- package/dist/flow-connect.d.ts +22 -16
- package/dist/flow-delete.d.ts +16 -0
- package/dist/flow-history.d.ts +75 -0
- package/dist/flow-layout.d.ts +13 -0
- package/dist/flow-loop-colors.d.ts +39 -0
- package/dist/flow-loop.d.ts +98 -0
- package/dist/flow-node-flags.d.ts +14 -0
- package/dist/flow-problems.d.ts +69 -0
- package/dist/flow-state.d.ts +20 -0
- package/dist/flow-types.d.ts +137 -9
- package/dist/flow-utils.d.ts +27 -13
- package/dist/flow.cjs +4 -2
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.d.ts +9 -3
- package/dist/flow.mjs +4028 -1585
- package/dist/flow.mjs.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.mjs +2559 -1287
- package/dist/index.mjs.map +1 -1
- package/dist/node-samples.d.ts +80 -0
- package/dist/output-shape.d.ts +30 -14
- package/dist/param-customization.d.ts +7 -0
- package/dist/provider.d.ts +119 -7
- package/dist/resolve-params.d.ts +45 -11
- package/dist/run-visuals.d.ts +14 -21
- package/dist/script-bindings.d.ts +63 -0
- package/dist/script-completion-service.d.ts +9 -0
- package/dist/script-completion.worker.d.ts +1 -0
- package/dist/script-completions.d.ts +2 -0
- package/dist/state-shape.d.ts +38 -0
- package/dist/step-preview-state.d.ts +155 -6
- package/dist/step-problems.d.ts +42 -12
- package/dist/test-inputs.d.ts +25 -0
- package/dist/trigger-registration.d.ts +28 -0
- package/dist/types.d.ts +70 -8
- package/dist/use-app-action-defs.d.ts +9 -1
- package/dist/use-test-input.d.ts +18 -0
- package/dist/workflow-connections.d.ts +78 -0
- package/package.json +16 -7
- package/src/code.css +60 -6
- package/src/styles/_canvas.scss +35 -0
- package/src/styles/_code-editor.scss +35 -0
- package/src/styles/_code.scss +6 -5
- package/src/styles/_connections.scss +64 -0
- package/src/styles/_copyable.scss +24 -0
- package/src/styles/_data-stores.scss +138 -0
- package/src/styles/_data-vars.scss +17 -6
- package/src/styles/_execution-history.scss +73 -0
- package/src/styles/_execution-log.scss +145 -1
- package/src/styles/_expression-modal.scss +106 -16
- package/src/styles/_fields.scss +11 -0
- package/src/styles/_flow.scss +166 -0
- package/src/styles/_fx.scss +3 -1
- package/src/styles/_incoming-state.scss +33 -0
- package/src/styles/_modal.scss +12 -0
- package/src/styles/_multiselect.scss +35 -0
- package/src/styles/_sections.scss +36 -0
- package/src/styles/_step-builder.scss +145 -0
- package/src/styles/_tester.scss +56 -0
- package/src/styles/_tokens.scss +27 -1
- package/src/styles.css +1347 -41
- package/src/styles.scss +2 -0
- package/dist/CodeBlock-BqXDA35P.js.map +0 -1
- package/dist/CodeBlock-CulfbnZD.cjs +0 -15
- package/dist/CodeBlock-CulfbnZD.cjs.map +0 -1
- package/dist/ConfirmModal-Ln99S9NT.js +0 -7919
- package/dist/ConfirmModal-Ln99S9NT.js.map +0 -1
- package/dist/ConfirmModal-fjHW5rN-.cjs +0 -14
- package/dist/ConfirmModal-fjHW5rN-.cjs.map +0 -1
- package/dist/Copyable-DA6eiU7w.cjs +0 -2
- package/dist/Copyable-DA6eiU7w.cjs.map +0 -1
- package/dist/Copyable-F4NTaG77.js +0 -847
- package/dist/Copyable-F4NTaG77.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
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;
|
|
1
|
+
"use client";"use strict";var Es=Object.defineProperty;var $s=(t,s,n)=>s in t?Es(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var je=(t,s,n)=>$s(t,typeof s!="symbol"?s+"":s,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./connection-app-meta-BEXlKBgV.cjs"),e=require("react/jsx-runtime"),g=require("react"),P=require("./CodeBlock-CymlfyeA.cjs"),As=require("@codemirror/lang-yaml"),Ts=require("@codemirror/view"),Rs=require("@uiw/react-codemirror");class ie extends Error{constructor(n,a,i,r){super(i);je(this,"status");je(this,"code");je(this,"body");this.name="ApiError",this.status=n,this.code=a,this.body=r}}function _s(t){const s=t.baseUrl.replace(/\/$/,""),n=t.fetch??globalThis.fetch,a=async()=>typeof t.token=="function"?await t.token():t.token;async function i(l,o){const c=new Headers(o==null?void 0:o.headers),d=await a();d&&c.set("authorization",`Bearer ${d}`),o!=null&&o.body&&!c.has("content-type")&&c.set("content-type","application/json");let x;try{x=await n(`${s}${l}`,{...o,headers:c})}catch(u){throw new ie(0,"network_error",`Could not reach the w6w server (${(o==null?void 0:o.method)??"GET"} ${s}${l}). It may be down or unreachable. (${u.message})`)}const h=await x.text();let y=null;if(h)try{y=JSON.parse(h)}catch{if(!x.ok)throw new ie(x.status,"bad_response",`Server returned a non-JSON ${x.status} response: ${h.slice(0,200)}`)}if(!x.ok){const u=(y==null?void 0:y.error)??{};throw new ie(x.status,u.code??"error",u.message??x.statusText,y)}return{status:x.status,data:y}}async function r(l,o){const{data:c}=await i(l,o);return c}return{listApps:async()=>{const l=async()=>{const o=[];let c;for(;;){const d=new URLSearchParams({limit:"200"});c&&d.set("cursor",c);const x=await r(`/apps?${d}`);if(o.push(...x.apps),!x.nextCursor||x.nextCursor===c)return o;c=x.nextCursor}};try{return await l()}catch(o){if(o instanceof ie&&(o.code==="snapshot_expired"||o.code==="unknown_snapshot"))return await l();throw o}},listAppsByIds:async l=>{const o=Array.from(new Set(l)),c=[];for(let d=0;d<o.length;d+=100){const h=o.slice(d,d+100).map(encodeURIComponent).join(","),y=await r(`/apps?ids=${h}`);c.push(...y.apps)}return c},getAppAuth:async l=>(await r(`/apps/${encodeURIComponent(l)}/auths`)).auths??[],createConnection:(l,o)=>r(`/apps/${encodeURIComponent(l)}/connections`,{method:"POST",body:JSON.stringify(o)}).then(c=>c.connection),updateConnection:(l,o)=>r(`/connections/${encodeURIComponent(l)}`,{method:"PATCH",body:JSON.stringify(o)}).then(c=>c.connection),listCredentials:l=>{const o=new URLSearchParams;(l==null?void 0:l.contract)!==void 0&&o.set("contract",l.contract),(l==null?void 0:l.appId)!==void 0&&o.set("appId",l.appId),(l==null?void 0:l.authKey)!==void 0&&o.set("authKey",l.authKey);const c=o.toString();return r(`/credentials${c?`?${c}`:""}`).then(d=>d.credentials??[])},createCredential:l=>r("/credentials",{method:"POST",body:JSON.stringify(l)}).then(o=>o.credential),getCredential:l=>r(`/credentials/${encodeURIComponent(l)}`).then(o=>o.credential),rotateCredential:(l,o)=>r(`/credentials/${encodeURIComponent(l)}/rotate`,{method:"POST",body:JSON.stringify(o)}).then(c=>c.credential),setCredentialStatus:(l,o)=>r(`/credentials/${encodeURIComponent(l)}/${o==="disabled"?"disable":"enable"}`,{method:"POST"}).then(c=>c.credential),testCredential:l=>r(`/credentials/${encodeURIComponent(l)}/test`,{method:"POST"}),credentialDependents:l=>r(`/credentials/${encodeURIComponent(l)}/dependents`).then(o=>o.dependents),deleteCredential:async l=>{await r(`/credentials/${encodeURIComponent(l)}`,{method:"DELETE"})},startAppOAuthFlow:(l,o,c)=>r(`/apps/${encodeURIComponent(l)}/oauth-config/${encodeURIComponent(o)}/authorize-url`,{method:"POST",body:JSON.stringify(c)}),getAppActions:l=>r(`/apps/${encodeURIComponent(l)}`).then(o=>o.actions??[]),listConnectionsForApp:l=>r(`/apps/${encodeURIComponent(l)}/connections`).then(o=>o.connections??[]),listConnections:()=>r("/connections").then(l=>l.connections??[]),invokeAction:(l,o,c,d={})=>r(`/apps/${encodeURIComponent(l)}/actions/${encodeURIComponent(o)}/invoke`,{method:"POST",body:JSON.stringify({params:c,connectionId:d.connectionId,project:d.project,state:d.state,workflowId:d.workflowId})}),listSavedTests:l=>r(`/connections/${encodeURIComponent(l)}/saved-tests`).then(o=>o.savedTests??[]),createSavedTest:(l,o)=>r(`/connections/${encodeURIComponent(l)}/saved-tests`,{method:"POST",body:JSON.stringify(o)}).then(c=>c.savedTest),updateSavedTest:(l,o,c)=>r(`/connections/${encodeURIComponent(l)}/saved-tests/${encodeURIComponent(o)}`,{method:"PATCH",body:JSON.stringify(c)}).then(d=>d.savedTest),deleteSavedTest:(l,o)=>r(`/connections/${encodeURIComponent(l)}/saved-tests/${encodeURIComponent(o)}`,{method:"DELETE"}).then(()=>{}),recordTestRun:(l,o)=>r(`/connections/${encodeURIComponent(l)}/test-runs`,{method:"POST",body:JSON.stringify(o)}).then(()=>{}),listTestRuns:l=>r(`/connections/${encodeURIComponent(l)}/test-runs`).then(o=>o.runs??[]),saveStepTest:(l,o,c)=>r(`/workflows/${encodeURIComponent(l)}/steps/${encodeURIComponent(o)}/tests`,{method:"POST",body:JSON.stringify(c)}).then(d=>d.stepTest),listStepTests:(l,o)=>r(`/workflows/${encodeURIComponent(l)}/steps/${encodeURIComponent(o)}/tests`).then(c=>c.stepTests??[]),loadNodeSamples:l=>r(`/workflows/${encodeURIComponent(l)}/node-samples`).then(o=>o.nodeSamples??[]),loadTestInputs:l=>r(`/workflows/${encodeURIComponent(l)}/test-inputs`).then(o=>o.testInputs??[]),saveTestInput:(l,o,c)=>r(`/workflows/${encodeURIComponent(l)}/nodes/${encodeURIComponent(o)}/test-input`,{method:"PUT",body:JSON.stringify({input:c})}).then(()=>{}),recordStepTestRun:(l,o,c)=>r(`/workflows/${encodeURIComponent(l)}/steps/${encodeURIComponent(o)}/test-runs`,{method:"POST",body:JSON.stringify(c)}).then(()=>{}),listFunctions:()=>r("/functions").then(l=>l.functions??[]),getFunction:l=>r(`/functions/${encodeURIComponent(l)}`).then(o=>({...o.function,valid:o.valid})),invokeFunction:(l,o)=>r(`/functions/${encodeURIComponent(l)}/invoke`,{method:"POST",body:JSON.stringify({inputs:o})}).then(c=>c.output),listWorkflows:()=>r("/workflows").then(l=>l.workflows??[]),getWorkflow:l=>r(`/workflows/${encodeURIComponent(l)}`).then(o=>o.workflow),runWorkflow:(l,o={})=>i(`/workflows/${encodeURIComponent(l)}/run?wait=true`,{method:"POST",body:JSON.stringify({variables:o.variables,input:o.input})}).then(({status:c,data:d})=>({...d??{},terminal:c===200}))}}function be({title:t,subtitle:s,icon:n,trailing:a,active:i=!1,onClick:r,href:l,ariaLabel:o}){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})]}),a!=null&&e.jsx("span",{className:"w6w-list-item-trailing",children:a})]}),d=`w6w-list-item${i?" active":""}`;return l!==void 0?e.jsx("a",{className:d,href:l,"aria-current":i?"true":void 0,"aria-label":o,onClick:r,children:c}):r?e.jsx("button",{type:"button",className:d,"aria-pressed":i,"aria-label":o,onClick:r,children:c}):e.jsx("div",{className:d,"aria-label":o,children:c})}function De(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 a=Math.round(n/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);if(i<24)return`${i}h ago`;const r=Math.round(i/24);return r<7?`${r}d ago`:new Date(s).toLocaleDateString()}function ft(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 Os(t){var n,a,i;const s=t.indexOf("{");if(s>=0)try{const r=JSON.parse(t.slice(s)),l=((a=(n=r==null?void 0:r.errors)==null?void 0:n[0])==null?void 0:a.message)??(typeof(r==null?void 0:r.error)=="object"?(i=r.error)==null?void 0:i.message:r==null?void 0:r.error)??(r==null?void 0:r.message);if(typeof l=="string"&&l.trim()){const o=t.slice(0,s).replace(/[:\s]+$/,"");return o?`${o}: ${l.trim()}`:l.trim()}}catch{}return t}function Ot(t){return typeof t=="object"&&t!==null&&typeof t.status=="number"&&typeof t.code=="string"}function Is(t){if(!Ot(t))return{headline:(t==null?void 0:t.message)??"The action failed to run."};const s=Os(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 Ps(t){const s=Ot(t)?t.body??t.raw:null;return(s==null?void 0:s.apiCalls)??[]}function Fe(){const[t,s]=g.useState(""),[n,a]=g.useState(void 0),[i,r]=g.useState(!1);return{text:t,value:n,invalid:i,onChange:o=>{s(o);const c=o.trim();if(c===""){r(!1);return}try{const d=JSON.parse(c);d!==null&&typeof d=="object"&&!Array.isArray(d)?(a(d),r(!1)):r(!0)}catch{r(!0)}}}}function Ls({appId:t,actions:s,connectionId:n,action:a,seedValues:i,onSavedTestsChanged:r,seedTestId:l,onDirtyChange:o,onTestSaved:c,onDeleted:d,embedded:x=!1}){var pt;const h=m.useW6WApi(),y=g.useMemo(()=>{const p=[...s];return p.sort((E,L)=>(E.title||E.key).localeCompare(L.title||L.key)),p},[s]),[u,w]=g.useState((a==null?void 0:a.key)??""),j=a??s.find(p=>p.key===u)??null,[f,$]=g.useState(!1),[N,v]=g.useState(null),[S,b]=g.useState(void 0),[A,T]=g.useState([]),D=Fe(),R=Fe(),C=Fe(),[I,te]=g.useState(""),[B,U]=g.useState(""),F=D.invalid||R.invalid||C.invalid,se=()=>{const p={};return D.text.trim()!==""&&D.value!==void 0&&(p.body=D.value),R.text.trim()!==""&&R.value!==void 0&&(p.query=R.value),C.text.trim()!==""&&C.value!==void 0&&(p.headers=C.value),I&&(p.target=I),B.trim()!==""&&(p.match=B.trim()),Object.keys(p).length>0?p:void 0},[Y,G]=g.useState("form"),[Re,ue]=g.useState(""),[_e,X]=g.useState(!1),[k,_]=g.useState(!1),O=(j==null?void 0:j.key)??null,J=i?{...i}:ft(j),[nt,we]=g.useState(()=>({key:O,values:J})),[V,ne]=g.useState(l??null),[at,me]=g.useState(J);if(nt.key!==O){const p=ft(j);we({key:O,values:p}),me(p),ne(l??null),v(null),b(void 0),T([])}const[cs,ds]=g.useState(l);l!==cs&&(ds(l),ne(l??null));const[lt,us]=g.useState(i);if(i!==lt){const p=JSON.stringify(i??null)!==JSON.stringify(lt??null);if(us(i),i&&p){const E={...i};we({key:O,values:E}),me(E),v(null),b(void 0),T([])}}const K=nt.values,it=p=>we({key:O,values:p}),rt=g.useMemo(()=>JSON.stringify(K)!==JSON.stringify(at),[K,at]);g.useEffect(()=>{o==null||o(rt)},[rt]);const ws=()=>{ue(JSON.stringify(K,null,2)),X(!1),G("json")},ms=async p=>{if(!j||F)return;const E=j.key;$(!0),v(null),b(void 0),T([]);let L;const Z=se();try{const W=await h.invokeAction(t,E,p,{connectionId:n,...Z?{overrides:Z}:{}});b(W.value),T(W.apiCalls??[]),L={ok:!0,summary:"OK",result:W.value}}catch(W){const xt=Is(W);v(xt),T(Ps(W)),L={ok:!1,summary:xt.headline}}finally{$(!1)}if(n)try{await h.recordTestRun(n,{savedTestId:V??null,actionKey:E,ok:L.ok,summary:L.summary.slice(0,200),result:L.result}),Le(),Ns(),r==null||r()}catch{}},hs=()=>ms(K),[he,ot]=g.useState(null),[pe,ae]=g.useState(null),[ps,xs]=g.useState(0),[fs,xe]=g.useState(!1),[Oe,Ie]=g.useState(""),[js,Pe]=g.useState(!1),Le=()=>xs(p=>p+1);g.useEffect(()=>{if(!n){ot(null);return}let p=!1;return ae(null),h.listSavedTests(n).then(E=>!p&&ot(E)).catch(E=>!p&&ae(E.message)),()=>{p=!0}},[h,n,ps]);const ct=O?(he??[]).filter(p=>p.actionKey===O):[],[gs,Me]=g.useState(null),[ys,vs]=g.useState(0),Ns=()=>vs(p=>p+1);g.useEffect(()=>{const p=h.listTestRuns;if(!n||!p){Me(null);return}let E=!1;return p(n).then(L=>!E&&Me(L)).catch(()=>!E&&Me(null)),()=>{E=!0}},[h,n,ys]);const dt=O?(gs??[]).filter(p=>p.actionKey===O).slice().sort((p,E)=>Date.parse(E.occurredAt)-Date.parse(p.occurredAt)):[],bs=()=>{!n||!j||(Ie(""),ae(null),xe(!0))},ks=()=>{!n||!j||(V?ut():bs())},ut=async()=>{if(!(!n||!j))try{let p;if(V)p=await h.updateSavedTest(n,V,{values:K});else{const E=Oe.trim();if(!E)return;p=await h.createSavedTest(n,{actionKey:j.key,name:E,values:K}),ne(p.id)}me({...K}),xe(!1),Ie(""),Le(),r==null||r(),c==null||c(p)}catch(p){ae(p.message)}},Cs=p=>{const E={...p.values};we({key:O,values:E}),me(E),ne(p.id),G("form"),v(null),b(void 0),T([])},Ss=async()=>{if(!n||!V)return;const p=V;try{await h.deleteSavedTest(n,p),ne(null),Le(),r==null||r(),d==null||d(p)}catch(E){ae(E.message)}},wt=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${Y==="form"?" active":""}`,"aria-pressed":Y==="form",onClick:()=>G("form"),children:"Form"}),e.jsx("button",{type:"button",className:`w6w-btn w6w-btn-sm w6w-btn-ghost${Y==="json"?" active":""}`,"aria-pressed":Y==="json",onClick:ws,children:"JSON"}),!x&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-sm w6w-btn-ghost","aria-pressed":k,title:k?"Collapse the params editor":"Open the params editor in a larger view","aria-label":k?"Collapse the params editor":"Open the params editor in a larger view",onClick:()=>_(p=>!p),children:k?"⤡":"⤢"})]})]}),Y==="form"?e.jsx(m.ParamsForm,{params:(j==null?void 0:j.params)??[],values:K,onChange:it,dynamic:j?{appId:t,actionKey:j.key,connectionId:n}:void 0}):e.jsxs(e.Fragment,{children:[e.jsx(m.JsonEditor,{value:Re,onChange:ue,minHeight:k?"50vh":"200px","aria-label":"Params JSON",onValidChange:p=>{p!==null&&typeof p=="object"&&!Array.isArray(p)&&it(p)},onValidityChange:({valid:p})=>X(!p)}),_e&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:"Invalid JSON"})]})]}),mt=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:D.text,onChange:D.onChange,minHeight:"80px","aria-label":"Overrides body (JSON)"}),D.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:R.text,onChange:R.onChange,minHeight:"80px","aria-label":"Overrides query (JSON)"}),R.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:C.text,onChange:C.onChange,minHeight:"80px","aria-label":"Overrides headers (JSON)"}),C.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:I,onChange:p=>te(p.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:p=>U(p.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."})]})]}),fe=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"})}),pe&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:pe}),ct.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:ct.map(p=>e.jsx("li",{children:e.jsx(be,{title:p.name,subtitle:p.lastRunAt?e.jsxs("span",{children:[e.jsx("span",{style:{color:p.lastRunOk?"var(--w6w-success)":"var(--w6w-danger)"},children:p.lastRunOk?"✓":"✗"})," ",p.lastRunSummary?`${p.lastRunSummary} · `:"",De(p.lastRunAt)]}):`saved ${De(p.updatedAt)}`,active:p.id===V,onClick:()=>Cs(p)})},p.id))}),h.listTestRuns&&dt.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:dt.map(p=>e.jsx("li",{children:e.jsx(be,{title:e.jsxs("span",{children:[e.jsx("span",{style:{color:p.ok?"var(--w6w-success)":"var(--w6w-danger)"},children:p.ok?"✓":"✗"})," ",p.actionKey]}),subtitle:e.jsxs("span",{children:[p.summary?`${p.summary} · `:"",De(p.occurredAt)]})})},p.id))})]})]}):null,ht=(pt=he==null?void 0:he.find(p=>p.id===V))==null?void 0:pt.name;return e.jsxs("div",{className:`w6w-stack${x?" w6w-tester-embedded-root":""}`,children:[!a&&(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",O?"":" *"]}),e.jsx(m.Combobox,{value:u,placeholder:"— pick an action —",onChange:w,options:y.map(p=>({value:p.key,label:`${p.title??p.key} (${p.key})`}))})]})),j?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("strong",{children:[j.title??j.key," ",e.jsx("code",{className:"w6w-muted",children:j.key})]}),j.description&&e.jsx("p",{className:"w6w-muted w6w-small",style:{margin:"var(--w6w-sp-0-5) 0 0"},children:j.description})]}),(()=>{const p=N?e.jsxs("div",{className:"w6w-result w6w-error",children:[e.jsx("strong",{children:N.headline}),N.hint&&e.jsx("div",{style:{marginTop:"var(--w6w-sp-1-5)"},children:N.hint}),N.detail&&e.jsx("div",{className:"w6w-muted w6w-small",style:{marginTop:"var(--w6w-sp-1-5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:N.detail})]}):null,E=S!==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(m.ResultViewer,{value:S})]}):null,L=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[wt,mt,p,E,e.jsx(m.ApiCallsPanel,{calls:A})]}),Z=e.jsxs("div",{className:`w6w-tester-actions${x||k?" w6w-tester-actions-footer":""}`,style:{display:"flex",gap:"var(--w6w-sp-2)"},children:[e.jsx("button",{type:"button",className:"w6w-btn",disabled:f||F,onClick:hs,children:f?"Running…":"Run action"}),n&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:ks,children:"Save test"}),n&&V&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",style:{marginLeft:"auto",color:"var(--w6w-danger)"},onClick:()=>Pe(!0),children:"Delete"})]}),W=e.jsxs("div",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},children:[L,Z]});return x?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:[wt,mt,p]})]}),(E||A.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:[S!==void 0&&e.jsx(m.ResultViewer,{value:S}),e.jsx(m.ApiCallsPanel,{calls:A})]})]}),fe&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-head",children:e.jsx("h3",{children:"Saved tests and history"})}),fe]})]})}),Z]}):k?e.jsx(m.Modal,{title:`Edit params — ${j.title??j.key}`,onClose:()=>_(!1),size:"full",children:e.jsxs("div",{className:"w6w-tester-popout",children:[e.jsx("div",{className:"w6w-tester-popout-scroll",children:fe?e.jsxs("div",{style:{display:"flex",gap:"var(--w6w-sp-4)",alignItems:"flex-start"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:L}),e.jsx("div",{style:{width:260,flexShrink:0},children:fe})]}):L}),Z]})}):W})(),fs&&e.jsx(m.Modal,{title:"Save test",onClose:()=>xe(!1),children:e.jsxs("form",{className:"w6w-stack",style:{gap:"var(--w6w-sp-3)"},onSubmit:p=>{p.preventDefault(),ut()},children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Name this saved test"}),e.jsx("input",{type:"text",value:Oe,placeholder:"e.g. valid sender",onChange:p=>Ie(p.target.value)})]}),pe&&e.jsx("span",{className:"w6w-hint",style:{color:"var(--w6w-danger)"},children:pe}),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:()=>xe(!1),children:"Cancel"}),e.jsx("button",{type:"submit",className:"w6w-btn",disabled:!Oe.trim(),children:"Save"})]})]})}),js&&e.jsx(m.ConfirmModal,{title:"Delete saved test",message:ht?`Delete "${ht}"? This cannot be undone.`:"Delete this saved test? This cannot be undone.",confirmLabel:"Delete",onConfirm:()=>{Pe(!1),Ss()},onClose:()=>Pe(!1)})]}):!a&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Pick an action above to test it."})]})}function Ms(t){const s=m.useEffectiveTheme(t.theme),{copied:n,copy:a}=P.useCopyToClipboard(t.value),i=g.useMemo(()=>[As.yaml(),Ts.EditorView.theme(m.EDITOR_THEME_SPEC)],[]);function r(l){t.onChange(l)}return e.jsxs("div",{className:"w6w-yaml-editor","aria-label":t["aria-label"]??"YAML editor",children:[e.jsx(Rs,{value:t.value,onChange:r,extensions:i,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 a(),children:n?e.jsx(P.CheckGlyph,{}):e.jsx(P.CopyGlyph,{})}),e.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:n?"Copied":""})]})]})}const Be="…";function It(t,s,n="end"){if(s===void 0||s<1||s>=t.length)return t;if(n==="start")return`${Be}${t.slice(t.length-s)}`;if(n==="end")return`${t.slice(0,s)}${Be}`;const a=Math.ceil(s/2),i=s-a;return`${t.slice(0,a)}${Be}${t.slice(t.length-i)}`}function Pt(t){const{value:s,chars:n,crop:a="end",label:i,className:r,copiedMs:l}=t,o=It(s,n,a),c=["w6w-copyable--bare",r].filter(Boolean).join(" ");return e.jsx(P.Copyable,{value:s,readOnly:!0,label:i,className:c,copiedMs:l,children:e.jsx("span",{children:o})})}const Ds={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function Se({state:t,label:s,ariaLabel:n}){const a=s??Ds[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:a})]})}const Fs={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"};function Lt({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,a)=>e.jsx("span",{className:`w6w-uptime-cell w6w-uptime-cell-${n.state}`,title:n.label??`${n.day} — ${Fs[n.state]}`},`${n.day}-${a}`))})}const Mt="—",jt=["B","KiB","MiB","GiB","TiB","PiB"];function Dt(t){if(t===null||!Number.isFinite(t))return Mt;if(t<1024)return`${Math.round(t)} B`;let s=t,n=0;for(;s>=1024&&n<jt.length-1;)s/=1024,n+=1;return`${s.toFixed(1)} ${jt[n]}`}function H(t){return t===null||!Number.isFinite(t)?Mt:`${Math.round(t*100)}%`}function ce(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 de(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 Bs(t,s,n){return t<s?s:t>n?n:t}function Us(t,s,n,a){const i=t.length;if(i<2)return"";const r=[];for(let l=0;l<i;l++){const o=t[l];if(o===null)continue;const c=l/(i-1)*s,d=a<=0?n:n-Bs(o,0,a)/a*n;r.push(`${Number(c.toFixed(2))},${Number(d.toFixed(2))}`)}return r.join(" ")}const Js="—",gt=100,yt=24;function qe({values:t,max:s,className:n}){const a=Us(t,gt,yt,s);return a===""?null:e.jsx("svg",{className:n,viewBox:`0 0 ${gt} ${yt}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:e.jsx("polyline",{points:a,fill:"none",stroke:"var(--w6w-accent)",strokeWidth:2,vectorEffect:"non-scaling-stroke"})})}function Ue(t){return t===null?Js:t.toFixed(2)}function ke(t){let s=1;for(const n of t)n!==null&&n>s&&(s=n);return s}function ve({label:t,value:s,values:n,max:a}){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(qe,{className:"w6w-server-resources__spark",values:n,max:a})]})}function Xe(t){const s=t[t.length-1],n=t.map(r=>ce(r)),a=t.map(r=>de(r)),i=t.map(r=>r.processRss);return{last:s,cpuValues:n,memoryValues:a,rssValues:i}}function Vs({samples:t,title:s="Server resources",intervalMs:n}){const{last:a,cpuValues:i,memoryValues:r,rssValues:l}=Xe(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(ve,{label:"CPU",value:H(ce(a)),values:i,max:ke(i)}),e.jsx(ve,{label:"Memory",value:H(de(a)),values:r,max:1}),e.jsx(ve,{label:"Process",value:Dt((a==null?void 0:a.processRss)??null),values:l,max:ke(l)})]}),e.jsx("p",{className:"w6w-server-resources__meta",children:`Load ${Ue((a==null?void 0:a.load1)??null)} / ${Ue((a==null?void 0:a.load5)??null)} / ${Ue((a==null?void 0:a.load15)??null)}`}),n!==void 0&&e.jsx("p",{className:"w6w-server-resources__meta",children:`Sampled every ${n/1e3}s`})]})}function Ks({samples:t,title:s="Server"}){const{last:n,cpuValues:a}=Xe(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(ve,{label:"CPU",value:H(ce(n)),values:a,max:ke(a)}),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(de(n))})]})]})]})}function Ws({samples:t,onExpand:s}){const{last:n,cpuValues:a,memoryValues:i}=Xe(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(ce(n))}),e.jsx(qe,{className:"w6w-server-resources__spark",values:a,max:ke(a)})]}),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(de(n))}),e.jsx(qe,{className:"w6w-server-resources__spark",values:i,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 qs({samples:t}){const s=t[t.length-1],n=H(ce(s)),a=H(de(s));return e.jsx("span",{className:"w6w-server-resources w6w-server-resources--badge",children:`CPU ${n} · MEM ${a}`})}const Hs=1,Ys=1440*60*1e3;function zs(t,s,n){const a=s.startedAt??s.updatedAt;if(a===void 0)return null;const i=Date.parse(a),r=s.resolvedAt!==void 0?Date.parse(s.resolvedAt):s.startedAt!==void 0?n:i,l=Date.parse(`${t.from}T00:00:00.000Z`),o=Date.parse(`${t.to}T00:00:00.000Z`)+Ys,c=o-l;if(r<l||i>=o)return null;const d=i<l,x=r>o,h=Math.max(i,l),y=Math.min(r,o),u=(h-l)/c*100,w=(y-h)/c*100,j=Math.max(w,Hs);return{leftPct:u,widthPct:j,clippedStart:d,clippedEnd:x}}const Gs={ok:"Operational",degraded:"Degraded",down:"Down",unknown:"Unknown"},Xs="This vendor publishes no incident history.",Zs="No incidents in this window.";function Qs(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 en({window:t,days:s,incidents:n,vendorEmptyLabel:a,nowMs:i=Date.now(),ariaLabel:r}){const l=s.length,o=l>0?100/l:0,c=n===void 0?a??Xs:n.length===0?a??Zs:null;return e.jsx("div",{className:"w6w-history-timeline",role:"img","aria-label":r??`${l}-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,x)=>e.jsx("span",{className:`w6w-history-cell w6w-history-cell-${d.state}`,style:{left:`${x*o}%`,width:`${o}%`},title:d.label??`${d.day} — ${Gs[d.state]}`},`${d.day}-${x}`))}),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,x)=>{const h=zs(t,d,i);if(h===null)return null;const y=[h.clippedStart?"w6w-history-bar-clip-start":"",h.clippedEnd?"w6w-history-bar-clip-end":""].filter(Boolean).join(" ");return e.jsx("span",{className:`w6w-history-bar w6w-history-bar-${d.state}${y?` ${y}`:""}`,style:{left:`${h.leftPct}%`,width:`${h.widthPct}%`},title:Qs(d)},d.id??`${d.title}-${x}`)})}),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 tn({label:t,children:s,className:n}){const[a,i]=g.useState(!1),r=g.useId();return e.jsxs("span",{className:["w6w-info-tip",n??""].filter(Boolean).join(" "),children:[e.jsx(m.IconButton,{label:t,icon:"info","aria-expanded":a,"aria-controls":r,onClick:()=>i(l=>!l)}),a&&e.jsx("span",{id:r,className:"w6w-info-tip-body w6w-muted w6w-small",children:s})]})}function Ze(t){const{label:s,onClick:n,disabled:a,className:i,...r}=t;return e.jsx(m.IconButton,{label:s,onClick:n,disabled:a,className:i,icon:"edit","data-testid":r["data-testid"]})}function sn(t){const{branch:s,shortSha:n,lastSyncLabel:a,onSyncNow:i,syncing:r,className:l,...o}=t,[c,d]=g.useState(!1),x=g.useRef(null);return g.useEffect(()=>{if(!c)return;const h=u=>{x.current&&!x.current.contains(u.target)&&d(!1)},y=u=>u.key==="Escape"&&d(!1);return document.addEventListener("mousedown",h),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",y)}},[c]),e.jsxs("div",{className:`w6w-repo-sync${l?` ${l}`:""}`,ref:x,"data-testid":o["data-testid"],children:[e.jsxs("button",{type:"button",className:"w6w-repo-sync-trigger","aria-haspopup":"menu","aria-expanded":c,"aria-busy":r,onClick:()=>d(h=>!h),children:[e.jsxs("span",{className:"w6w-repo-sync-icon",children:[e.jsx(P.Icon,{name:"github"}),r&&e.jsx(P.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}),a!=null&&e.jsx("span",{children:a})]}),e.jsx("button",{type:"button",role:"menuitem",className:"w6w-repo-sync-item","data-testid":"repo-sync-now",disabled:r,onClick:i,children:r?"Syncing…":"Sync now"})]})]})}const nn={pending:"Pending",running:"Running",succeeded:"Succeeded",failed:"Failed",skipped:"Skipped",queued:"Queued",canceled:"Canceled"};function Ee({state:t,label:s,ariaLabel:n}){const a=s??nn[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:a})]})}const an="—",Je=1e3,Ve=6e4;function $e(t){return t==null||!Number.isFinite(t)||t<0?an:t<Je?`${Math.round(t)} ms`:t<Ve?`${(t/Je).toFixed(1)} s`:`${Math.floor(t/Ve)}m ${Math.round(t%Ve/Je)}s`}function re(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}const ln={function:"Function",endpoint:"Endpoint",workflow:"Workflow"},rn={manual:"Manual",schedule:"Schedule",webhook:"Webhook",event:"Event",replay:"Replay"};function vt(t){if(!t.trigger)return null;const s=rn[t.trigger]??t.trigger;return t.triggerNodeId?`${s} · ${t.triggerNodeId}`:s}function on({items:t,selectedId:s=null,onSelect:n,showCallable:a=!1,loading:i=!1,emptyLabel:r,hasPrev:l,hasNext:o,onPrev:c,onNext:d,onRerun:x,rerunningId:h=null}){const y=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:!l,onClick:c,children:"Previous"}),e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-list-next",disabled:!o,onClick:d,children:"Next"})]}):null;let u;return i&&t.length===0?u=e.jsx("p",{"data-testid":"execution-list-loading",children:"Loading…"}):t.length===0?u=e.jsx("p",{"data-testid":"execution-list-empty",children:r??"No executions yet."}):u=e.jsx("ul",{className:"w6w-execution-list-rows",children:t.map(w=>e.jsxs("li",{"data-testid":"execution-row","data-execution-id":w.id,children:[e.jsx(be,{icon:e.jsx(Ee,{state:w.status}),title:e.jsxs(e.Fragment,{children:[a?w.callableName:re(w.startedAt),w.rerunOf&&e.jsx("span",{className:"w6w-execution-rerun-tag","data-testid":"execution-row-rerun-tag",title:`Re-run of ${w.rerunOf}`,children:"Re-run"})]}),subtitle:e.jsxs(e.Fragment,{children:[a?`${ln[w.kind]} · ${re(w.startedAt)}`:w.id,vt(w)&&e.jsx("span",{className:"w6w-execution-trigger","data-testid":"execution-row-trigger",children:` · ${vt(w)}`}),w.inputPreview&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("code",{className:"w6w-execution-input-preview","data-testid":"execution-row-input",title:w.inputPreview,children:w.inputPreview})]})]}),trailing:$e(w.durationMs),active:w.id===s,onClick:n?()=>n(w.id):void 0}),x&&e.jsx(m.IconButton,{icon:"sync",label:"Re-run",title:w.id===h?"Re-running…":"Re-run with the same input",className:"w6w-execution-list-rerun","data-testid":"execution-row-rerun",disabled:h!==null,onClick:()=>x(w.id)})]},w.id))}),e.jsxs("div",{className:"w6w-execution-list","data-testid":"execution-list",children:[u,y]})}function cn(t){const s=m.internalNodeDef(t.app,t.action);return{trigger:t.trigger===!0||(s==null?void 0:s.group)==="trigger",appName:t.appName??(s==null?void 0:s.displayName)??t.app,actionName:t.actionName??(s==null?void 0:s.label)??t.action}}function Ft(t){const s=n=>{for(const a of[n.startedAt,n.finishedAt]){const i=Date.parse(a??"");if(Number.isFinite(i))return i}return Number.POSITIVE_INFINITY};return t.map(n=>({step:n,time:s(n)})).sort((n,a)=>n.time===a.time?0:n.time-a.time).map(({step:n})=>n)}function Bt({steps:t,emptyLabel:s,onDismiss:n,runError:a,stepErrors:i}){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,l=i??[],o=a||l.length>0?e.jsxs("div",{className:"w6w-execution-log-errors w6w-stack",children:[a&&e.jsx(He,{error:a}),l.map((h,y)=>e.jsx(He,{label:h.label??h.stepId,error:h.error},`${h.stepId}:${y}`))]}):null,c=Ft(t.filter(h=>!Nt(h))),d=t.filter(Nt),x=d.length>0?e.jsx(un,{steps:d}):null;return c.length===0?e.jsxs(e.Fragment,{children:[r,o,e.jsx("div",{className:"w6w-execution-log-empty",children:e.jsx("p",{className:"w6w-muted w6w-small",children:s??"No nodes have run yet."})}),x]}):e.jsxs(e.Fragment,{children:[r,o,e.jsx("ol",{className:"w6w-execution-log",children:c.map(h=>e.jsx(Ut,{step:h},h.id))}),x]})}const Nt=t=>t.status==="skipped"&&t.skipReason==="not_on_path",dn={condition:"condition false",stopped:"run stopped",disabled:"disabled"};function un({steps:t}){const s=t.length;return e.jsxs("details",{className:"w6w-execution-log-off-path","data-testid":"execution-log-off-path",children:[e.jsx("summary",{className:"w6w-muted w6w-small",children:`${s} ${s===1?"step":"steps"} on other paths, not part of this run`}),e.jsx("ul",{className:"w6w-muted w6w-small",children:t.map(n=>e.jsx("li",{children:n.label??n.id},n.id))})]})}function Ut({step:t}){var c,d;const[s,n]=g.useState(!1),a=t.node?cn(t.node):null,i=e.jsxs("div",{className:"w6w-execution-log-row-header",children:[e.jsx(Ee,{state:t.status}),a&&e.jsx("span",{className:`w6w-execution-log-kind${a.trigger?" w6w-execution-log-kind-trigger":""}`,"data-testid":"execution-log-kind",children:a.trigger?"Trigger":"Node"}),e.jsxs("span",{className:"w6w-execution-log-row-title",children:[e.jsx("span",{className:"w6w-execution-log-row-label",children:t.label??t.id}),a&&e.jsx("span",{className:"w6w-execution-log-row-uses","data-testid":"execution-log-uses",children:a.appName===a.actionName?a.appName:`${a.appName} · ${a.actionName}`})]}),t.status==="skipped"&&t.skipReason&&t.skipReason!=="not_on_path"&&e.jsx("span",{className:"w6w-execution-log-skip-reason","data-testid":"execution-log-skip-reason",children:dn[t.skipReason]}),e.jsx(hn,{startedAt:t.startedAt,finishedAt:t.finishedAt})]}),r=t.error?e.jsx(He,{error:t.error}):null,l=Array.isArray(t.iterations)?e.jsx(wn,{step:t}):null,o=jn(t)?e.jsx(gn,{step:t}):null;return t.input===void 0&&t.output===void 0&&!t.meta&&!o&&!((c=t.logs)!=null&&c.length)?e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsx("div",{className:"w6w-section",children:i}),r,l]}):e.jsxs("li",{className:"w6w-execution-log-row",children:[e.jsxs("details",{className:"w6w-section",open:s,onToggle:x=>n(x.currentTarget.open),children:[e.jsx("summary",{className:"w6w-section-summary",children:i}),s&&e.jsxs("div",{className:"w6w-execution-log-row-body w6w-section-body w6w-stack",children:[e.jsx(xn,{input:t.input}),e.jsx(bt,{title:"Input",value:t.input}),e.jsx(bt,{title:"Output",value:t.output}),!!((d=t.logs)!=null&&d.length)&&e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:"Console"}),e.jsx(P.CodeBlock,{code:t.logs.join(`
|
|
2
|
+
`),language:"plaintext"})]}),t.meta&&e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:"Metadata"}),e.jsx(P.CodeBlock,{code:JSON.stringify(t.meta,null,2),language:"json"})]}),o]})]}),r,l]})}function wn({step:t}){var d,x;const s=[...t.iterations??[]].sort((h,y)=>h.index-y.index),n=t.iterationsTotal??s.length,a=t.iterationsFailed??s.filter(h=>h.status==="failed").length,i=s.find(h=>h.status==="failed"),r=(i==null?void 0:i.index)??((d=s[s.length-1])==null?void 0:d.index),l=[],o=new Map;for(const h of Ft(s.flatMap(y=>y.steps)))o.has(h.id)||(l.push(h.id),o.set(h.id,h.label??h.id));const c=(i==null?void 0:i.failedNodeId)??((x=i==null?void 0:i.steps.find(h=>h.status==="failed"))==null?void 0:x.id);return e.jsxs("div",{className:"w6w-execution-log-foreach w6w-stack",children:[e.jsxs("div",{className:"w6w-small","data-testid":"execution-log-foreach-summary",children:[e.jsxs("span",{children:[n===1?"1 item":`${n} items`,a>0?` · ${a} failed`:""]}),i&&c!==void 0&&e.jsxs("div",{children:[o.get(c)??c," failed in iteration ",i.index]}),t.iterationsTruncated===!0&&e.jsx("div",{className:"w6w-muted",children:`showing ${s.length} of ${n}`})]}),e.jsx("div",{className:"w6w-execution-log-iteration-chips",children:s.map(h=>e.jsxs("span",{className:`w6w-execution-log-iteration-chip w6w-execution-log-iteration-chip-${h.status}`,"data-testid":"execution-log-iteration-chip","data-status":h.status,children:[h.index," · ",h.status]},h.index))}),e.jsx("ul",{className:"w6w-execution-log-subrows",children:l.map(h=>e.jsx(mn,{id:h,label:o.get(h)??h,iterations:s,initial:r},h))})]})}function mn({id:t,label:s,iterations:n,initial:a}){var o;const[i,r]=g.useState(a),l=(o=n.find(c=>c.index===i))==null?void 0:o.steps.find(c=>c.id===t);return e.jsxs("li",{className:"w6w-execution-log-subrow w6w-stack",children:[e.jsxs("div",{className:"w6w-execution-log-subrow-head",children:[e.jsx("strong",{className:"w6w-small",children:s}),e.jsx("select",{className:"w6w-select","aria-label":`Iteration for ${s}`,"data-testid":"execution-log-iteration-select",value:i===void 0?"":String(i),onChange:c=>r(Number(c.currentTarget.value)),children:n.map(c=>e.jsx("option",{value:String(c.index),children:`iteration ${c.index} (${c.status})`},c.index))})]}),l?e.jsx("ol",{className:"w6w-execution-log",children:e.jsx(Ut,{step:l},i)}):e.jsx("p",{className:"w6w-muted w6w-small",children:"Did not run in this iteration."})]})}function He({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 hn({startedAt:t,finishedAt:s}){if(t&&s){const n=pn(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 pn(t,s){const n=Date.parse(t),a=Date.parse(s);if(!Number.isFinite(n)||!Number.isFinite(a)||a<n)return null;const i=a-n;if(i<1e3)return`${i}ms`;const r=i/1e3;if(r<60)return`${r.toFixed(1)}s`;const l=Math.floor(r/60),o=Math.round(r%60);return`${l}m ${o}s`}function bt({title:t,value:s}){const[n,a]=g.useState(!1);return s===void 0?e.jsxs("div",{className:"w6w-execution-log-json w6w-stack",children:[e.jsx("strong",{className:"w6w-small",children:t}),e.jsx("p",{className:"w6w-muted w6w-small",children:"Not available."})]}):e.jsxs("details",{className:"w6w-execution-log-json",open:n,onToggle:i=>{i.target===i.currentTarget&&a(i.currentTarget.open)},children:[e.jsx("summary",{children:e.jsx("strong",{className:"w6w-small",children:t})}),n&&e.jsx(m.ResultViewer,{value:s,format:"json"})]})}const Ce=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function kt(t){if(!Ce(t)||!Array.isArray(t.conditions))return;const s=t.conditions.filter(n=>Ce(n)&&typeof n.op=="string"&&"result"in n);if(s.length!==0)return{rows:s,combinator:typeof t.combinator=="string"?t.combinator:void 0,result:typeof t.condition=="boolean"?t.condition:void 0}}function xn({input:t}){const s=[],n=kt(t);if(n&&s.push({trace:n}),Ce(t)&&Array.isArray(t.routes))for(const a of t.routes){const i=kt(a);!i||!Ce(a)||s.push({title:String(a.label??a.id??"Route"),trace:i})}return s.length===0?null:e.jsxs("div",{className:"w6w-execution-log-json w6w-stack","data-testid":"execution-log-conditions",children:[e.jsx("strong",{className:"w6w-small",children:"Condition"}),s.map(({title:a,trace:i},r)=>e.jsxs("div",{className:"w6w-stack",children:[a&&e.jsx("span",{className:"w6w-small w6w-muted",children:a}),(i.combinator&&i.rows.length>1||i.result!==void 0)&&e.jsxs("span",{className:"w6w-small w6w-muted","data-testid":"execution-log-condition-summary",children:[i.combinator&&i.rows.length>1&&m.conditionCombinatorLabel(i.combinator),i.combinator&&i.rows.length>1&&i.result!==void 0&&" · ",i.result!==void 0&&e.jsxs(e.Fragment,{children:["Result:"," ",e.jsx("span",{className:i.result?"w6w-execution-log-condition-true":"w6w-execution-log-condition-false",children:i.result?"true":"false"})]})]}),e.jsx("div",{className:"w6w-data-table-frame",children:e.jsxs("table",{className:"w6w-data-table w6w-execution-log-conditions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Left"}),e.jsx("th",{children:"Operator"}),e.jsx("th",{children:"Right"}),e.jsx("th",{children:"Result"})]})}),e.jsx("tbody",{children:i.rows.map((l,o)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("code",{children:Ct(l.left)})}),e.jsx("td",{children:m.conditionOperatorLabel(l.op)}),e.jsx("td",{children:e.jsx("code",{children:Ct(l.right)})}),e.jsx("td",{className:l.result?"w6w-execution-log-condition-true":"w6w-execution-log-condition-false",children:l.result?"true":"false"})]},o))})]})})]},a??r))]})}function Ct(t){return JSON.stringify(t)??"undefined"}const St={not_object:"Not written — the output isn't an object, so it can't be merged at the root",missing_source:"Not written — the output has no value at that field",null_append:"Not appended — the value was null",append_not_array:"Not appended — the existing value isn't a list",write_too_large:"Not written — the value is too large",run_too_large:"Not written — the run's state would grow past its size limit",too_deep:"Not written — the value is nested too deeply",key_too_long:"Not written — a key in the value is too long",forbidden_key:"Not written — the value uses a reserved key name",log_truncated:"Later state changes aren't shown — the run's state log reached its limit"};function fn(t){return Object.hasOwn(St,t)?St[t]:t}function jn(t){const s=Array.isArray(t.stateWrites)&&t.stateWrites.length>0,n=t.stateAfter;return s||typeof n=="object"&&n!==null&&Object.keys(n).length>0}const Et=120;function $t(t){if(t===void 0)return"(not set)";const s=JSON.stringify(t)??String(t);return s.length>Et?`${s.slice(0,Et)}…`:s}function gn({step:t}){const s=Array.isArray(t.stateWrites)?t.stateWrites:[],n=t.stateAfter;return e.jsxs("div",{className:"w6w-execution-log-state w6w-stack","data-testid":"execution-log-state",children:[e.jsx("strong",{className:"w6w-small",children:"State"}),s.length>0&&e.jsx("ul",{className:"w6w-execution-log-state-writes",children:s.map((a,i)=>{const r=Array.isArray(a.path)?a.path:[],l=`state${r.length?`.${r.join(".")}`:""}${a.item!==void 0?` (item ${a.item})`:""}`;return a.warning!==void 0?e.jsx("li",{className:"w6w-execution-log-state-write w6w-execution-log-state-warning w6w-small","data-testid":"execution-log-state-write","data-warning":a.warning,children:`${l}: ${fn(a.warning)}`},i):e.jsx("li",{className:"w6w-execution-log-state-write w6w-small","data-testid":"execution-log-state-write",children:`${l}: ${$t(a.old)} → ${$t(a.new)}`},i)})}),typeof n=="object"&&n!==null&&e.jsxs("div",{className:"w6w-stack","data-testid":"execution-log-state-after",children:[e.jsx("span",{className:"w6w-small w6w-muted",children:"State after this step"}),e.jsx(P.CodeBlock,{code:JSON.stringify(n,null,2),language:"json"})]})]})}const yn={status:"",kind:"",from:"",to:"",q:""},vn=[{value:"",label:"Any status"},{value:"queued",label:"Queued"},{value:"running",label:"Running"},{value:"succeeded",label:"Succeeded"},{value:"failed",label:"Failed"},{value:"canceled",label:"Canceled"}],Nn=[{value:"",label:"Any type"},{value:"function",label:"Function"},{value:"endpoint",label:"Endpoint"},{value:"workflow",label:"Workflow"}];function bn({value:t,onChange:s,showKind:n=!1,searchPlaceholder:a="Search by id or name",disabled:i=!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:a,value:t.q,disabled:i,onChange:l=>s({...t,q:l.target.value})}),e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-status","aria-label":"Status",value:t.status,disabled:i,onChange:l=>s({...t,status:l.target.value}),children:vn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))}),n&&e.jsx("select",{className:"w6w-execution-filters-select","data-testid":"execution-filter-kind","aria-label":"Type",value:t.kind,disabled:i,onChange:l=>s({...t,kind:l.target.value}),children:Nn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))}),e.jsx("input",{type:"date",className:"w6w-execution-filters-date","data-testid":"execution-filter-from","aria-label":"From date",value:t.from,disabled:i,onChange:l=>s({...t,from:l.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:i,onChange:l=>s({...t,to:l.target.value})}),r&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-execution-filters-clear","data-testid":"execution-filter-clear",disabled:i,onClick:()=>s({...yn}),children:"Clear"})]})}const Ne="—";function kn({stats:t,label:s}){const n=[{testid:"execution-stat-total",label:"Executions",value:t?String(t.total):Ne},{testid:"execution-stat-success-rate",label:"Success rate",value:Cn(t==null?void 0:t.successRate)},{testid:"execution-stat-failed",label:"Failed",value:t?String(t.failed):Ne},{testid:"execution-stat-avg-duration",label:"Avg duration",value:t?$e(t.avgDurationMs):Ne}];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(a=>e.jsxs("div",{className:"w6w-execution-stat","data-testid":a.testid,children:[e.jsx("span",{className:"w6w-execution-stat-value","data-stat-value":a.value,children:a.value}),e.jsx("span",{className:"w6w-execution-stat-label",children:a.label})]},a.testid))})]})}function Cn(t){return t==null||!Number.isFinite(t)?Ne:`${Math.round(t*100)}%`}const Sn={function:"Function",endpoint:"Endpoint",workflow:"Workflow"};function En(t){return JSON.stringify(t,null,2)??"null"}function $n({execution:t,loading:s=!1,errorMessage:n,onClose:a,onOpenInEditor:i,onBack:r,onRerun:l,rerunning:o=!1,onOpenExecution:c}){return e.jsxs("section",{className:"w6w-execution-detail w6w-stack","data-testid":"execution-detail",children:[r&&e.jsx("div",{className:"w6w-execution-detail-back",children:e.jsxs("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":"execution-detail-back",onClick:r,children:[e.jsx("span",{"aria-hidden":"true",children:"←"})," Back"]})}),n!=null&&e.jsx("p",{role:"alert",className:"w6w-execution-detail-error-message","data-testid":"execution-detail-error-message",children:n}),t?e.jsx(An,{execution:t,onClose:a,onOpenInEditor:i,onRerun:l,rerunning:o,onOpenExecution:c}):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 An({execution:t,onClose:s,onOpenInEditor:n,onRerun:a,rerunning:i,onOpenExecution:r}){const l=t.rerunOf;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(Ee,{state:t.status}),e.jsx("span",{className:"w6w-execution-detail-kind w6w-muted w6w-small",children:Sn[t.kind]})]})]}),(a||n||s)&&e.jsxs("div",{className:"w6w-execution-detail-actions",children:[a&&e.jsxs("button",{type:"button",className:"w6w-btn w6w-execution-detail-rerun","data-testid":"execution-detail-rerun",title:"Run it again with the same input",disabled:i,onClick:a,children:[e.jsx(P.Icon,{name:"sync",size:14})," ",i?"Re-running…":"Re-run"]}),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})}),l&&e.jsxs("p",{className:"w6w-execution-detail-rerun-of","data-testid":"execution-detail-rerun-of",children:[e.jsx("span",{className:"w6w-execution-rerun-tag",children:"Re-run"}),e.jsx("span",{className:"w6w-muted w6w-small",children:"of"}),r?e.jsx("button",{type:"button",className:"w6w-execution-detail-rerun-of-link","data-testid":"execution-detail-rerun-of-link",onClick:()=>r(l),children:e.jsx("code",{children:l})}):e.jsx("code",{children:l})]}),e.jsxs("dl",{className:"w6w-execution-detail-timing",children:[e.jsx(Ke,{label:"Started",value:re(t.startedAt)}),e.jsx(Ke,{label:"Finished",value:t.finishedAt?re(t.finishedAt):"—"}),e.jsx(Ke,{label:"Duration",value:$e(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(Bt,{steps:t.steps,emptyLabel:"No nodes ran."})]}),t.input!==void 0&&e.jsx(We,{title:"Input",testid:"execution-detail-input",value:t.input}),t.output!==void 0&&e.jsx(We,{title:"Output",testid:"execution-detail-output",value:t.output}),t.error!=null&&e.jsx(We,{title:"Error",testid:"execution-detail-error",value:t.error})]})}function Ke({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 We({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(P.CodeBlock,{code:En(n),language:"json"})]})}function Jt(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 Tn(t){return t.attention==="now"||t.attention==="recent"}function Vt(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 Kt(t){return t.uptime.map(s=>({day:s.day,state:s.state}))}const Ye=3,Wt=5;function qt(t,s={}){const n=s.compact??!1,{now:a,recent:i}=Vt(t),r=a.length+i.length,l=n?a.slice(0,Ye):a,o=n?i.slice(0,Math.max(0,Ye-l.length)):i,c=n?t.slice(0,s.limit??Wt):[...t];return{attentionCount:r,shownNow:l,shownRecent:o,hiddenAttentionCount:r-l.length-o.length,shownTable:c,hiddenTableCount:t.length-c.length}}const ge=640,le=340,M={top:16,right:24,bottom:40,left:56};function At(t){if(t<=0)return 1;const s=10**Math.floor(Math.log10(t)),n=[1,2,5,10];for(const a of n)if(t<=a*s)return a*s;return 10*s}function Tt(t,s=5){return Array.from({length:s+1},(n,a)=>Math.round(t*a/s))}function Ht({services:t,getHref:s,onOpen:n}){const a=Jt(t);if(a.length===0)return e.jsx("p",{className:"w6w-muted w6w-small",children:"No timed calls in this window yet."});const i=At(Math.max(...a.map(f=>f.calls))),r=At(Math.max(...a.map(f=>f.p95Ms))),l=Math.max(1,...a.map(f=>f.errorCount)),o=ge-M.left-M.right,c=le-M.top-M.bottom,d=f=>M.left+f/i*o,x=f=>M.top+f/r*c,h=f=>16+f/l*14,y=Tt(i),u=Tt(r),w=18,j=M.top+c/2;return e.jsxs("div",{className:"w6w-rel-scatter",children:[e.jsxs("svg",{viewBox:`0 0 ${ge} ${le}`,style:{aspectRatio:`${ge} / ${le}`},role:"img","aria-label":"API performance: calls versus p95 latency, one point per API",children:[e.jsx("rect",{x:M.left,y:M.top,width:o,height:c,className:"w6w-rel-scatter-plot-bg"}),u.map(f=>e.jsxs("g",{children:[e.jsx("line",{x1:M.left,x2:ge-M.right,y1:x(f),y2:x(f),className:"w6w-rel-scatter-grid"}),e.jsx("text",{x:M.left-8,y:x(f),className:"w6w-rel-scatter-axis-label",textAnchor:"end",children:f})]},`y-${f}`)),y.map(f=>e.jsx("text",{x:d(f),y:le-M.bottom+18,className:"w6w-rel-scatter-axis-label",textAnchor:"middle",children:f},`x-${f}`)),e.jsx("text",{x:w,y:j,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",transform:`rotate(-90, ${w}, ${j})`,children:"p95 (ms)"}),e.jsx("text",{x:M.left+o/2,y:le-4,className:"w6w-rel-scatter-axis-title",textAnchor:"middle",children:"calls in this window"}),a.map(f=>{const $=h(f.errorCount),N=d(f.calls),v=x(f.p95Ms),S=e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:N,cy:v,r:$/2+2.5,className:`w6w-rel-scatter-ring w6w-rel-scatter-ring-${f.state}`,children:e.jsxs("title",{children:[f.displayName," — ",f.calls," calls, ",f.p95Ms," ms p95, ",f.errorCount," errors"]})}),e.jsx("circle",{cx:N,cy:v,r:$/2,className:`w6w-rel-scatter-point w6w-rel-scatter-point-${f.state}`})]});return s?e.jsx("a",{href:s(f.appId),className:"w6w-rel-scatter-point-link",onClick:n?b=>n(f.appId,b):void 0,children:S},f.appId):n?e.jsx("g",{role:"button",tabIndex:0,className:"w6w-rel-scatter-point-link",onClick:b=>n(f.appId,b),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.currentTarget.dispatchEvent(new MouseEvent("click",{bubbles:!0})))},children:S},f.appId):e.jsx("g",{children:S},f.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 Rt(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Yt({appId:t,className:s,title:n,getHref:a,onOpen:i,children:r}){return a?e.jsx("a",{className:s,href:a(t),title:n,onClick:i?l=>i(t,l):void 0,children:r}):i?e.jsx("button",{type:"button",className:s,title:n,onClick:l=>i(t,l),children:r}):e.jsx("div",{className:s,title:n,children:r})}function zt({service:t}){return e.jsxs("span",{className:"w6w-rel-signal",children:[e.jsx(Se,{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 Gt({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(Se,{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 Rn({service:t,getHref:s,onOpen:n}){return e.jsxs(Yt,{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(zt,{service:t})]}),e.jsxs("span",{className:"w6w-rel-issue-signal",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:"API status"}),e.jsx(Gt,{vendor:t.vendorStatus})]})]})]})}function _n({service:t,getHref:s,onOpen:n}){const a=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(Yt,{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(zt,{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(Gt,{vendor:t.vendorStatus})]})]}),e.jsx("td",{className:"w6w-rel-td-uptime",children:a?e.jsx("span",{className:"w6w-rel-idle-note",children:"No calls in this window"}):e.jsxs(e.Fragment,{children:[e.jsx(Lt,{days:Kt(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 On({services:t,window:s,days:n,compact:a=!1,showChart:i,limit:r,getHref:l,onOpen:o,showAllHref:c,onShowAll:d,slots:x}){const h=n??(s==null?void 0:s.days)??30,y=t.length>0&&t.every(A=>A.calls>0&&A.state==="ok"),{attentionCount:u,shownNow:w,shownRecent:j,hiddenAttentionCount:f,shownTable:$,hiddenTableCount:N}=qt(t,{compact:a,limit:r}),v=i??!a,S=c!==void 0||d!==void 0,b=A=>{const T=A.startsWith("Show")?"w6w-muted w6w-small":void 0;return c!==void 0?e.jsx("a",{href:c,className:T,onClick:d,children:A}):d?e.jsx("button",{type:"button",className:`w6w-rel-show-all${T?` ${T}`:""}`,onClick:d,children:A}):null};return e.jsxs("section",{className:"w6w-rel-section",children:[e.jsxs("h3",{className:"w6w-rel-heading",children:[e.jsxs("span",{children:[(x==null?void 0:x.header)??"Service reliability"," ",s&&e.jsxs("span",{className:"w6w-muted w6w-small",children:[Rt(s.from)," – ",Rt(s.to)," · ",s.days," days"]})]}),a&&b("Show all services →"),x==null?void 0:x.actions]}),e.jsxs("div",{className:a?"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."}),y&&e.jsxs("div",{className:a?"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 ",h," days came back"," ",e.jsx(Se,{state:"ok"})," — no degraded stretches, no outages."]})]}),t.length===0&&((x==null?void 0:x.empty)??e.jsx("div",{className:a?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:[u>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:[w.length+j.length," of ",u]})]}),e.jsx("div",{className:"w6w-rel-issues",children:[...w,...j].map(A=>e.jsx(Rn,{service:A,getHref:l,onOpen:o},A.appId))}),f>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[f," more ",f===1?"needs":"need"," ","attention",S&&e.jsxs(e.Fragment,{children:[" — ",b("view all →")]})]})]}),v&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsx("h4",{className:"w6w-rel-group-head",children:"Performance across your APIs"}),e.jsx(Ht,{services:t,getHref:l,onOpen:o})]}),$.length>0&&e.jsxs("div",{className:"w6w-rel-group",children:[e.jsxs("h4",{className:"w6w-rel-group-head",children:[a?"Services":"All services"," ",e.jsx("span",{className:"w6w-muted w6w-small",children:a?`${$.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 ",h," days"]}),e.jsx("th",{children:"Latency"})]})}),e.jsx("tbody",{children:$.map(A=>e.jsx(_n,{service:A,getHref:l,onOpen:o},A.appId))})]})}),N>0&&e.jsxs("p",{className:"w6w-muted w6w-small w6w-rel-more-note",children:[N," more",S&&e.jsxs(e.Fragment,{children:[" — ",b("view all →")]})]})]})]})]})]})}function In(t,s){return t.render?t.render(s):String(s[t.key]??"")}function ee(t){const{columns:s,rows:n,rowKey:a,onRowClick:i,getRowHref:r,empty:l,loading:o,className:c,testId:d}=t;return n.length===0&&!o&&l!==void 0&&l!==null?e.jsx(e.Fragment,{children:l}):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":o?!0:void 0,children:[e.jsx("thead",{children:e.jsx("tr",{children:s.map(x=>e.jsx("th",{style:{width:x.width,textAlign:x.align},scope:"col",children:x.header},x.key))})}),e.jsx("tbody",{children:n.map(x=>{var y;const h=r==null?void 0:r(x);return e.jsx("tr",{"data-testid":(y=t.rowTestId)==null?void 0:y.call(t,x),className:i?"w6w-data-table-row-clickable":void 0,onClick:i?u=>i(x,u):void 0,children:s.map(u=>{const w=In(u,x);return e.jsx("td",{style:{textAlign:u.align},children:h!==void 0&&u.link!==!1?e.jsx("a",{className:"w6w-data-table-link",href:h,children:w}):w},u.key)})},a(x))})})]})})}function oe({title:t,children:s,action:n,className:a,testId:i}){return e.jsx("div",{className:a?`w6w-empty-state ${a}`:"w6w-empty-state","data-testid":i,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 Pn({rows:t,title:s,description:n,emptyCopy:a,newLabel:i="New",openRowTitle:r,testIds:l,loading:o,error:c,onCreate:d,creating:x,onImport:h,onOpen:y,getHref:u,showArchived:w,onShowArchivedChange:j,slots:f}){const[$,N]=g.useState(!1),v=w!==void 0,S=v?w:$,b=S?t:t.filter(C=>!C.archived),A=y!==void 0||u!==void 0,T=C=>{v||N(C),j==null||j(C)},D=[{key:"main",header:"Name",render:C=>{const I=e.jsxs("span",{className:"w6w-callable-list-main",title:A?r:void 0,children:[e.jsx("span",{children:C.title}),C.description!=null&&e.jsx("span",{className:"w6w-muted w6w-small w6w-callable-list-row-desc",children:C.description})]});return y&&!u?e.jsx("button",{type:"button",className:"w6w-callable-list-open",children:I}):I}},{key:"trail",header:"",align:"right",render:C=>C.archived||C.badges!=null||C.trailing!=null?e.jsxs("span",{className:"w6w-callable-list-trail",children:[C.badges,C.archived&&e.jsx("span",{className:"w6w-callable-list-badge","data-testid":l==null?void 0:l.archivedBadge,children:"archived"}),C.trailing]}):null}],R=t.length>0&&b.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:[(f==null?void 0:f.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:S,"data-testid":l==null?void 0:l.showArchived,onChange:C=>T(C.target.checked)}),"Show archived"]})]}),e.jsxs("div",{className:"w6w-callable-list-actions",children:[f==null?void 0:f.actions,h&&e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost","data-testid":l==null?void 0:l.importOpen,onClick:h,children:"Import"}),d&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:x,onClick:d,children:x?"Creating…":i})]})]}),c&&e.jsx("div",{className:"w6w-error",children:c}),e.jsxs("div",{className:"w6w-callable-list-body",children:[o&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),b.length===0&&!o?R?e.jsx(oe,{testId:"w6w-callable-list-empty",action:e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>T(!0),children:"Show archived"}),children:t.length===1?"The only item is archived.":`All ${t.length} items are archived.`}):e.jsx(oe,{testId:"w6w-callable-list-empty",children:(f==null?void 0:f.empty)??a}):e.jsx(ee,{columns:D,rows:b,rowKey:C=>C.id,loading:o,getRowHref:u?C=>u(C.id):void 0,onRowClick:y?(C,I)=>y(C.id,I):void 0})]})]})}function Ln({connections:t,appsById:s,loading:n,error:a,onOpen:i,getHref:r,onEdit:l,onDelete:o,busy:c,slots:d}){const x=s??new Map,h=l!==void 0||o!==void 0,y=[{key:"name",header:"Name",render:u=>{const w=m.resolveConnectionAppMeta(u,x),j=u.displayName||u.id;return e.jsxs("span",{className:"w6w-connection-cell-name",children:[e.jsx(m.AppIcon,{src:w==null?void 0:w.iconSvg,srcDark:w==null?void 0:w.iconSvgDark,brandColor:w==null?void 0:w.brandColor,name:(w==null?void 0:w.displayName)??u.appId}),e.jsx("strong",{className:"w6w-connection-name",title:j,children:j})," ",e.jsx("span",{className:"w6w-muted",children:(w==null?void 0:w.displayName)??u.appId})]})}},{key:"status",header:"Status",render:u=>e.jsxs(e.Fragment,{children:["auth ",e.jsx("code",{children:u.authKey})," ·"," ",e.jsx("span",{className:`w6w-connection-tag${u.state==="connected"?"":" w6w-connection-tag-warn"}`,children:u.state}),u.lastTestOk===!1&&e.jsx("span",{className:"w6w-connection-tag w6w-connection-tag-danger",title:"Last test failed — update or re-test.",children:"invalid"})]})}];return h&&y.push({key:"actions",header:"",align:"right",link:!1,render:u=>u.builtIn===!0?null:e.jsxs("div",{className:"w6w-connection-row-actions",onClick:w=>w.stopPropagation(),children:[l&&e.jsx(Ze,{label:"Edit",onClick:()=>l(u),"data-testid":`connection-edit-${u.id}`}),o&&e.jsx(m.DeleteButton,{label:"Delete",onClick:()=>o(u),disabled:c,"data-testid":`connection-delete-${u.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})]}),a&&e.jsx("div",{className:"w6w-error",children:a}),n&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),t.length===0&&!n?e.jsx(oe,{testId:"w6w-connection-list-empty",children:(d==null?void 0:d.empty)??"No connections yet."}):e.jsx(ee,{columns:y,rows:t,rowKey:u=>u.id,loading:n,getRowHref:r?u=>u.builtIn===!0?void 0:r(u.id):void 0,onRowClick:i?(u,w)=>u.builtIn===!0?void 0:i(u.id,w):void 0})]})}function Mn({connection:t,onClose:s,onSaved:n}){const a=m.useW6WApi(),i=a.updateConnection,r=t.builtIn===!0,l=!r&&typeof i=="function",[o,c]=g.useState(t.displayName??""),[d,x]=g.useState({}),[h,y]=g.useState(null),[u,w]=g.useState(null),[j,f]=g.useState(!1),[$,N]=g.useState({}),[v,S]=g.useState(!1),[b,A]=g.useState(!1),[T,D]=g.useState(null),[R,C]=g.useState(null);g.useEffect(()=>{if(!l)return;let k=!1;return y(null),a.getAppAuth(t.appId).then(_=>!k&&y(_)).catch(_=>!k&&w(_.message)),()=>{k=!0}},[a,l,t.appId]);const I=h==null?void 0:h.find(k=>k.key===t.authKey),te=(I==null?void 0:I.type)==="oauth2",B=te?[]:(I==null?void 0:I.fields)??[],U=t.credentialId,F=!!U&&typeof a.rotateCredential=="function"&&!te,se=F&&(I!=null&&I.serviceAccount)?m.bindingFieldsFor(I.serviceAccount):[];g.useEffect(()=>{if(!l||!F||!U||typeof a.getCredential!="function")return;let k=!1;return a.getCredential(U).then(_=>!k&&D(_.connectionCount)).catch(()=>{}),()=>{k=!0}},[a,l,F,U]);function Y(){if(F){const O={};o!==(t.displayName??"")&&(O.displayName=o);const J=m.buildBinding(se,$);return J&&(O.binding=J),O.displayName===void 0&&O.binding===void 0?null:O}const k={};for(const O of B){const J=d[O.key];J!==void 0&&J!==""&&(k[O.key]=J)}const _={};return o!==(t.displayName??"")&&(_.displayName=o),Object.keys(k).length>0&&(_.credential=k),_.displayName===void 0&&_.credential===void 0?null:_}async function G(){if(!l||!i||j)return;w(null);const k=Y();if(!k){w(F?"Nothing to update — change the name or a binding field.":"Nothing to update — change the name or a credential field.");return}f(!0);try{const _=await i.call(a,t.id,k);x({}),n(_)}catch(_){w(_.message)}finally{f(!1)}}const Re=B.some(k=>k.required&&(d[k.key]===void 0||d[k.key]===""));async function ue(){if(!U||!a.rotateCredential||j)return;w(null);const k=m.parseJsonFields(B,d);if("error"in k){w(k.error);return}f(!0);try{await a.rotateCredential(U,{source:k.values}),x({}),S(!1),A(!0),C(null)}catch(_){w(_.message)}finally{f(!1)}}async function _e(){if(!(!U||!a.testCredential)){w(null);try{C(await a.testCredential(U))}catch(k){w(k.message)}}}const X=m.useEnterSubmit(G,{enabled:l&&!j});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&&!l&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Editing connections is not available here."}),l&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Display name"}),e.jsx("input",{type:"text",value:o,onChange:k=>c(k.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",...X})]}),h===null&&!u&&e.jsx("p",{className:"w6w-muted w6w-small",children:"Loading auth fields…"}),te&&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."}),F&&se.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:se,values:$,onChange:N,enterSubmitProps:X})]}),F&&e.jsxs("div",{className:"w6w-stack","data-w6w":"credential-section",children:[typeof a.testCredential=="function"&&e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:_e,children:"Test credential"}),R&&e.jsxs("p",{className:"w6w-small","data-w6w":"credential-health",children:["Credential health: ",R.ok?"ok":R.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"]}),b&&e.jsx("p",{className:"w6w-small",children:"Credential rotated."}),v?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"w6w-muted w6w-small",children:["Enter the full new credential; it replaces the stored one.",T!==null&&` It is used by ${T} connection${T===1?"":"s"}, and all of them switch to it.`]}),e.jsx(m.AuthFieldsForm,{fields:B,values:d,onChange:x}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"w6w-btn",disabled:j||Re,onClick:ue,children:"Rotate"})," ",e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>{S(!1),x({})},children:"Cancel rotation"})]})]}):e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:()=>S(!0),children:"Rotate credential"})]}),!F&&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:x,enterSubmitProps:X})]})]}),u&&e.jsx("div",{className:"w6w-result w6w-error",children:u})]})}),e.jsxs("div",{className:"w6w-modal-actions",children:[e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:s,children:"Cancel"}),l&&e.jsx("button",{type:"button",className:"w6w-btn",disabled:j,onClick:G,children:j?"Saving…":"Save"})]})]})})}function Dn({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 Fn=t=>String(t);function _t(t){const s=Math.min(100,Math.max(0,t));return Number(s.toFixed(4))}function Bn({label:t,used:s,limit:n,reserved:a=0,format:i,className:r,testId:l}){const o=i??Fn,c=Number.isFinite(a)&&a>0,d=n>0?_t(s/n*100):100,x=c&&n>0?_t(Math.min(100-d,a/n*100)):0,h=s>=n,y=`${o(s)} / ${o(n)}`,u=["w6w-budget-meter"];return h&&u.push("w6w-budget-meter-over"),r&&u.push(r),e.jsxs("div",{role:"meter",className:u.join(" "),"aria-label":t,"aria-valuemin":0,"aria-valuenow":s,"aria-valuemax":n,"aria-valuetext":y,"data-testid":l,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:y})]}),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:`${x}%`}})]})]})}const Xt={kv:"Key-value",doc:"Document",table:"Table"},Un=["kv","doc","table"],Qe=["string","number","integer","boolean","date","datetime"],Zt=5242880;function Jn(t){var n;const s=(n=t.schema)==null?void 0:n.valueType;return typeof s=="string"&&Qe.includes(s)?s:"string"}function Vn(t){var a,i;if(t.kind!=="table")return null;const s=(a=t.schema)==null?void 0:a.columns;if(!Array.isArray(s))return null;const n=(i=t.schema)==null?void 0:i.key;return typeof n=="string"?{columns:s,key:n}:{columns:s}}function Kn(t,s){const n=t==null?void 0:t.match(/filename="([^"]*)"/),a=n==null?void 0:n[1];return a!==void 0&&a!==""?a:`${s}.csv`}const Qt={required:"Required.",not_a_number:"Enter a number.",not_an_integer:"Enter a whole number.",not_a_boolean:"Enter true or false.",not_a_date:"Enter a date as YYYY-MM-DD.",not_a_datetime:"Enter a date-time like 2026-01-31T09:30:00Z."},Wn=/^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?$/,qn=/^-?(0|[1-9]\d*)$/,Hn=/^\d{4}-\d{2}-\d{2}$/,Yn=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;function zn(t,s){return s===2?t%4===0&&t%100!==0||t%400===0?29:28:[31,0,31,30,31,30,31,31,30,31,30,31][s-1]}function et(t){if(!Hn.test(t))return null;const s=Number(t.slice(0,4)),n=Number(t.slice(5,7)),a=Number(t.slice(8,10));return n<1||n>12||a<1||a>zn(s,n)?null:{year:s,month:n,day:a}}function q(t){return{ok:!1,problem:t,message:Qt[t]}}function Ae(t,s,n){const a=s.trim();if(a==="")return n?q("required"):{ok:!0,value:void 0};switch(t){case"string":return{ok:!0,value:s};case"number":{if(!Wn.test(a))return q("not_a_number");const i=Number(a);return Number.isFinite(i)?{ok:!0,value:i}:q("not_a_number")}case"integer":{if(!qn.test(a))return q("not_an_integer");const i=Number(a);return Number.isSafeInteger(i)?{ok:!0,value:i}:q("not_an_integer")}case"boolean":return a==="true"?{ok:!0,value:!0}:a==="false"?{ok:!0,value:!1}:q("not_a_boolean");case"date":return et(a)===null?q("not_a_date"):{ok:!0,value:a};case"datetime":return es(a)?{ok:!0,value:a}:q("not_a_datetime")}}function es(t){if(!Yn.test(t)||et(t.slice(0,10))===null)return!1;const s=Number(t.slice(11,13)),n=Number(t.slice(14,16)),a=Number(t.slice(17,19));if(s>23||n>59||a>59)return!1;const r=t.slice(19).match(/(Z|([+-])(\d{2}):(\d{2}))$/);return r===null||r[1]==="Z"?!0:Number(r[3])<=23&&Number(r[4])<=59}function Te(t,s){if(s==null)return"";if((t==="string"||t==="date"||t==="datetime")&&typeof s=="string")return s;if((t==="number"||t==="integer")&&typeof s=="number"&&Number.isFinite(s))return String(s);if(t==="boolean"&&typeof s=="boolean")return s?"true":"false";const n=JSON.stringify(s);return n===void 0?"":n}function Gn(t,s){switch(t){case"string":return typeof s=="string";case"number":return typeof s=="number"&&Number.isFinite(s);case"integer":return Number.isSafeInteger(s);case"boolean":return typeof s=="boolean";case"date":return typeof s=="string"&&et(s)!==null;case"datetime":return typeof s=="string"&&es(s)}}const Q="The request failed.",ts="Could not reach the server.";function z(t){return typeof t=="string"&&t.length>0?t:void 0}function ss(t){return Number.isInteger(t)&&t>=0?t:void 0}function ns(t,s,n){const a={message:Q};typeof n=="number"&&(a.status=n);const i=t!==null&&typeof t=="object"?t.error:void 0;if(i!==null&&typeof i=="object"){const r=i,l=z(r.code);l!==void 0&&(a.code=l);const o=z(r.field);o!==void 0&&(a.field=o);const c=z(r.column);c!==void 0&&(a.column=c);const d=ss(r.row);d!==void 0&&(a.row=d);const x=z(r.message);x!==void 0&&(a.message=x)}if(a.message===Q)for(const r of s){const l=z(r);if(l!==void 0){a.message=l;break}}return a}function Xn(t){try{const s=t!==null&&typeof t=="object"?t:void 0,n=s==null?void 0:s.raw,a=s==null?void 0:s.message;return ns(n,[a],s==null?void 0:s.status)}catch{return{message:Q}}}function as(t){try{if(t.status===0)return{status:0,code:"network_error",message:ts};let s;try{s=JSON.parse(t.text)}catch{return{status:t.status,message:Q}}return ns(s,[],t.status)}catch{return{message:Q}}}function ls(t){const s=z(t.column);if(s!==void 0){const a=ss(t.row);return a===void 0?{kind:"cell",column:s}:{kind:"cell",column:s,row:a}}const n=z(t.field);return n!==void 0?{kind:"field",field:n}:{kind:"form"}}function ze(t){return t+2}const tt="\0new",st="Changed by someone else since you loaded it.",Ge="Enter a JSON object or array.",is="The file is larger than 5 MB.";function rs(t){const s=t.value;return s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{}}function Zn(t,s){const n=rs(t),a={};for(const i of s)a[i.name]=Te(i.type,n[i.name]);return{id:t.key,version:t.version,cells:a}}function Qn(t){const s={};for(const n of t)s[n.name]=n.default===void 0?"":Te(n.type,n.default);return{id:tt,version:null,cells:s}}function ea(t,s,n){const a=[];for(const i of n)(t.cells[i.name]??"")!==(s.cells[i.name]??"")&&a.push(i.name);return a}function ta(t,s){const n={},a={};for(const i of s){const r=Ae(i.type,t.cells[i.name]??"",i.required);r.ok?r.value!==void 0&&(n[i.name]=r.value):a[i.name]=r.message}return Object.keys(a).length>0?{ok:!1,errors:a}:{ok:!0,value:n}}function sa(t,s){if(t===null)return;const n=Date.parse(t);if(!Number.isFinite(n))return;const a=Math.ceil((n-s)/1e3);return a>0?a:void 0}function na(t,s,n){if(t.id===tt)return n===void 0?{kind:"insert",value:s}:{kind:"insert",value:s,ttlSeconds:n};const a={kind:"put",key:t.id,value:s,ifVersion:t.version??0};return n===void 0?a:{...a,ttlSeconds:n}}function aa(t,s){const n=ls(t);return n.kind!=="cell"||!s.some(a=>a.name===n.column)?null:{[n.column]:t.message}}function la(t){return t.status===409&&t.code==="version_conflict"}function os(t){let s;try{s=JSON.parse(t)}catch{return{ok:!1,message:Ge}}return s===null||typeof s!="object"?{ok:!1,message:Ge}:{ok:!0,value:s}}function ia(t,s){if(t==="string")return{ok:!0,value:s};const n=Ae(t,s,!0);return n.ok?{ok:!0,value:n.value}:{ok:!1,message:n.message}}function ra(t){if(t.status===200){let a=0;try{const i=JSON.parse(t.text);typeof i.imported=="number"&&Number.isFinite(i.imported)&&(a=i.imported)}catch{a=0}return{ok:!0,message:`Imported ${a} row${a===1?"":"s"}.`}}const s=as(t);return s.row===void 0?{ok:!1,message:s.message}:{ok:!1,message:`${s.column?`Line ${ze(s.row)}, column ${s.column}`:`Line ${ze(s.row)}`}: ${s.message}`}}function oa({stores:t,loading:s,error:n,onOpen:a,getHref:i,onEdit:r,onArchive:l,busy:o,formatSize:c,slots:d}){const x=c??Dt,h=r!==void 0||l!==void 0,y=[{key:"name",header:"Name",render:u=>e.jsx("strong",{children:u.name})},{key:"kind",header:"Kind",render:u=>Xt[u.kind]},{key:"entries",header:"Entries",align:"right",render:u=>String(u.entryCount)},{key:"size",header:"Size",align:"right",render:u=>x(u.sizeBytes)},{key:"updated",header:"Updated",render:u=>new Date(u.updatedAt).toLocaleString()}];return h&&y.push({key:"actions",header:"",align:"right",link:!1,render:u=>e.jsxs("div",{className:"w6w-data-row-actions",onClick:w=>w.stopPropagation(),children:[r&&e.jsx(Ze,{label:"Edit",onClick:()=>r(u),"data-testid":`data-store-edit-${u.id}`}),l&&e.jsx(m.DeleteButton,{label:"Archive",onClick:()=>l(u),disabled:o,"data-testid":`data-store-archive-${u.id}`})]})}),e.jsxs("section",{className:"w6w-data-store-list",children:[((d==null?void 0:d.header)!=null||(d==null?void 0:d.actions)!=null)&&e.jsxs("div",{className:"w6w-data-store-list-head",children:[e.jsx("div",{className:"w6w-data-store-list-heading",children:d==null?void 0:d.header}),e.jsx("div",{className:"w6w-data-store-list-actions",children:d==null?void 0:d.actions})]}),n&&e.jsx("div",{className:"w6w-error",children:n}),s&&e.jsx("p",{className:"w6w-muted",children:"Loading…"}),t.length===0&&!s?e.jsx(oe,{testId:"w6w-data-store-list-empty",children:(d==null?void 0:d.empty)??"No data stores yet."}):e.jsx(ee,{columns:y,rows:t,rowKey:u=>u.id,loading:s,getRowHref:i?u=>i(u.id):void 0,onRowClick:a?(u,w)=>a(u.id,w):void 0})]})}function ca(t){return t.name!==""&&t.required===!0&&(t.type==="string"||t.type==="integer")}function da(t,s){const{default:n,...a}=t,i=Ae(t.type,s,!1);return i.ok?i.value===void 0?{column:a}:{column:{...a,default:i.value}}:{column:a,error:i.message}}function ua(t){const{columns:s,onChange:n,keyColumn:a,onKeyColumnChange:i,columnErrors:r}=t,[l,o]=g.useState({}),c=s.filter(ca),d=c.some(w=>w.name===a)?a:"";g.useEffect(()=>{a!==""&&d===""&&i("")},[a,d,i]);function x(){n([...s,{name:"",type:"string",required:!1}])}function h(w,j){n(s.map((f,$)=>$===w?{...f,...j}:f))}function y(w,j,f,$){const N={...s[w],...$,type:j},{column:v,error:S}=da(N,f);o(b=>({...b,[w]:S===void 0?{text:f}:{text:f,error:S}})),n(s.map((b,A)=>A===w?v:b))}function u(w){o(j=>{const f={};for(const[$,N]of Object.entries(j)){const v=Number($);v<w?f[v]=N:v>w&&(f[v-1]=N)}return f}),n(s.filter((j,f)=>f!==w))}return e.jsxs("div",{className:"w6w-data-columns",children:[e.jsxs("div",{className:"w6w-data-columns-head",children:[e.jsx("h3",{children:"Columns"}),e.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:x,children:"+ Add column"})]}),e.jsx("p",{className:"w6w-muted w6w-small",children:"Each column has a name, a scalar type, whether it must be set, and an optional default."}),s.length===0&&e.jsx("p",{className:"w6w-muted w6w-small",children:"No columns yet."}),e.jsx("ul",{className:"w6w-data-columns-list","data-testid":"data-columns",children:s.map((w,j)=>{const f=l[j],$=(f==null?void 0:f.text)??Te(w.type,w.default);return e.jsxs("li",{className:"w6w-data-columns-row",children:[e.jsx("input",{type:"text",value:w.name,placeholder:"name","aria-label":"Column name",onChange:N=>h(j,{name:N.target.value})}),e.jsx("select",{value:w.type,"aria-label":"Column type",onChange:N=>y(j,N.target.value,$),children:Qe.map(N=>e.jsx("option",{value:N,children:N},N))}),e.jsxs("label",{className:"w6w-data-columns-required",children:[e.jsx("input",{type:"checkbox",checked:w.required,"aria-label":"Required",onChange:N=>h(j,{required:N.target.checked})}),e.jsx("span",{className:"w6w-muted w6w-small",children:"required"})]}),e.jsx("input",{type:"text",value:$,placeholder:"default","aria-label":"Column default",onChange:N=>y(j,w.type,N.target.value)}),e.jsx(m.DeleteButton,{label:`Remove column ${w.name||j+1}`,onClick:()=>u(j)}),(f==null?void 0:f.error)!==void 0&&e.jsx("div",{className:"w6w-result w6w-error w6w-data-columns-error","data-testid":`data-store-column-default-error-${j}`,children:f.error}),w.name!==""&&r[w.name]!==void 0&&e.jsx("div",{className:"w6w-result w6w-error w6w-data-columns-error","data-testid":`data-store-column-error-${w.name}`,children:r[w.name]})]},j)})}),e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Key column"}),e.jsxs("select",{value:d,onChange:w=>i(w.target.value),children:[e.jsx("option",{value:"",children:"(none — rows get generated keys)"}),c.map(w=>e.jsx("option",{value:w.name,children:w.name},w.name))]}),e.jsx("span",{className:"w6w-hint",children:"Only a required, string or integer column can name a row's key."})]})]})}function wa({result:t,busy:s,onImport:n,onRefuse:a,onExport:i}){function r(l){var d;const o=l.target,c=(d=o.files)==null?void 0:d[0];if(c!==void 0){if(o.value="",c.size>Zt){a(is);return}n(c)}}return e.jsxs("div",{className:"w6w-data-csv-panel","data-testid":"csv-panel",children:[e.jsxs("div",{className:"w6w-data-csv-panel-actions",children:[e.jsx("input",{type:"file",accept:".csv,text/csv","data-testid":"csv-file","aria-label":"Import CSV",onChange:r}),e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"csv-export",disabled:s,onClick:i,children:"Export CSV"})]}),t!==null&&e.jsx("div",{className:t.ok?"w6w-result":"w6w-result w6w-error","data-testid":"csv-result",children:t.message})]})}function ma({rows:t,empty:s,loading:n,searchValue:a,hasMore:i,onOpen:r,onSearch:l,onNew:o,onLoadMore:c}){const[d,x]=g.useState(a??""),h=u=>{u.preventDefault(),l(d)},y=[{key:"key",header:"Key",width:"38%",render:u=>e.jsx("button",{type:"button",className:"w6w-data-entry-key",title:u.key,"data-testid":"entry-key",onClick:w=>{w.stopPropagation(),r(u.key)},children:u.key})},{key:"value",header:"Value",render:u=>e.jsx("span",{className:"w6w-muted w6w-small w6w-data-entry-preview",children:u.preview})}];return e.jsxs("div",{children:[e.jsxs("form",{className:"w6w-data-entries-toolbar","data-testid":"entry-search",onSubmit:h,children:[e.jsx("input",{type:"search","data-testid":"entry-prefix",value:d,placeholder:"Key prefix","aria-label":"Key prefix",onChange:u=>x(u.target.value)}),e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"submit",children:"Search"}),e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"entry-new",onClick:o,children:"New entry"})]}),e.jsx(ee,{className:"w6w-data-entry-list",onRowClick:u=>r(u.key),columns:y,rows:t,rowKey:u=>u.key,empty:e.jsx("div",{className:"w6w-muted w6w-small",children:n?"Loading…":s??"No entries match this key prefix."})}),i&&e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"entries-load-more",onClick:c,children:"Load more"})]})}function ha({kind:t,isNew:s,entryKey:n,newKey:a,expiresAt:i,text:r,error:l,conflict:o,saving:c,onTextChange:d,onKeyChange:x,onDelete:h,onSave:y,onCancel:u,onReload:w}){const[j,f]=g.useState(s),[$,N]=g.useState(!1),v=g.useRef(null);g.useEffect(()=>{var R;s||(R=v.current)==null||R.focus()},[s]);const S=t==="doc"?"document":"entry",b=t==="doc"?os(r):void 0,A=b!==void 0&&!b.ok,T=l||($&&b&&!b.ok?b.message:null),D=e.jsxs(e.Fragment,{children:[s?e.jsxs("label",{className:"w6w-field",children:[e.jsx("span",{children:"Key"}),e.jsx("input",{"data-testid":"entry-new-key",value:a??"",placeholder:"Key","aria-label":"Key",onChange:R=>x(R.target.value)})]}):i?e.jsxs("p",{className:"w6w-muted w6w-small",children:["Expires ",i]}):null,t==="doc"?e.jsx(m.JsonEditor,{value:r,readOnly:!j,onChange:R=>{N(!1),d(R)},onFocus:()=>N(!1),onBlur:()=>N(!0),showDiagnostics:$,minHeight:"min(50vh, 400px)",maxHeight:"60vh"}):e.jsx("input",{"data-testid":"entry-value",value:r,"aria-label":"Value",readOnly:!j,onChange:R=>d(R.target.value)}),T&&e.jsx("div",{className:"w6w-field-error",role:"alert","data-testid":"entry-value-error",children:T}),o&&e.jsxs("div",{className:"w6w-error","data-testid":"entry-conflict",children:[st," ",e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"entry-reload",onClick:w,children:"Reload"})]})]});return e.jsxs(m.Modal,{title:s?`New ${S}`:j?`Edit ${S}`:t==="doc"?"Document":"Entry",subtitle:s?void 0:n,size:t==="doc"?"wide":"default",onClose:c?()=>{}:u,children:[e.jsx("div",{className:"w6w-modal-body","data-testid":"entry-editor",children:D}),e.jsxs("div",{className:"w6w-modal-actions",children:[!s&&h&&e.jsx(m.DeleteButton,{label:"Delete entry",className:"w6w-data-entry-delete",disabled:c,onClick:h}),e.jsx("button",{ref:v,className:"w6w-btn w6w-btn-ghost",type:"button",disabled:c,onClick:u,children:j?"Cancel":"Close"}),j?e.jsx("button",{className:"w6w-btn",type:"button","data-testid":"entry-save",disabled:!!o||!!c||A||s&&!(a!=null&&a.trim()),onClick:y,children:"Save"}):e.jsx("button",{className:"w6w-btn",type:"button",disabled:c,onClick:()=>f(!0),children:"Edit"})]})]})}const ye=t=>t.isNew?"new":t.id;function pa({columns:t,keyColumn:s,rows:n,error:a,loading:i,empty:r,searchValue:l,hasMore:o,onCellChange:c,onSave:d,onDelete:x,onReload:h,onAddRow:y,onLoadMore:u,onSearch:w}){const[j,f]=g.useState(l??""),$=v=>{v.preventDefault(),w(j)},N=[...t.map(v=>({key:v.name,header:e.jsxs(e.Fragment,{children:[v.name," ",e.jsx("span",{className:"w6w-muted w6w-small",children:v.type})]}),render:S=>{var A;const b=(A=S.cellErrors)==null?void 0:A[v.name];return e.jsxs("div",{className:"w6w-data-cell",children:[e.jsx("input",{"data-row":ye(S),"data-column":v.name,value:S.cells[v.name]??"",readOnly:v.name===s&&!S.isNew,"aria-label":`${v.name} (${v.type})`,onChange:T=>c(S.id,v.name,T.target.value)}),b!==void 0&&e.jsx("div",{className:"w6w-data-cell-error","data-row":ye(S),"data-column":v.name,children:b})]})}})),{key:"actions",header:"",render:v=>e.jsxs("div",{className:"w6w-data-row-actions",children:[e.jsx("span",{className:"w6w-muted w6w-small",children:v.version===null?"":`v${v.version}`}),e.jsx("button",{className:"w6w-btn",type:"button","data-row":ye(v),"data-testid":"row-save",disabled:!v.isNew&&!v.dirty||!!v.conflict,onClick:()=>d(v.id),children:"Save"}),e.jsx(m.DeleteButton,{label:"Delete entry",onClick:()=>x(v.id)}),v.conflict&&e.jsxs("div",{className:"w6w-error","data-row":ye(v),"data-testid":"row-conflict",children:[st," ",e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"row-reload",onClick:()=>h(v.id),children:"Reload"})]})]})}];return e.jsxs("div",{children:[a!=null&&a!==""&&e.jsx("div",{className:"w6w-error","data-testid":"grid-error",children:a}),e.jsxs("form",{className:"w6w-data-entries-toolbar","data-testid":"entry-search",onSubmit:$,children:[e.jsx("input",{type:"search","data-testid":"entry-prefix",value:j,placeholder:"Key prefix","aria-label":"Key prefix",onChange:v=>f(v.target.value)}),e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"submit",children:"Search"}),e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"grid-add-row",onClick:y,children:"Add row"})]}),e.jsx("div",{className:"w6w-data-grid-scroll","data-testid":"data-grid-scroll",children:e.jsx(ee,{columns:N,rows:n,rowKey:v=>v.id,empty:e.jsx("div",{className:"w6w-muted w6w-small",children:i?"Loading…":r??"No rows match this key prefix."})})}),o&&e.jsx("button",{className:"w6w-btn w6w-btn-ghost",type:"button","data-testid":"entries-load-more",onClick:u,children:"Load more"})]})}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.DeleteButton=m.DeleteButton;exports.ExpressionEditorModal=m.ExpressionEditorModal;exports.ExpressionInput=m.ExpressionInput;exports.ExpressionOptionsProvider=m.ExpressionOptionsProvider;exports.HTML_PREVIEW_CSP=m.HTML_PREVIEW_CSP;exports.HtmlPreview=m.HtmlPreview;exports.IconButton=m.IconButton;exports.JsonEditor=m.JsonEditor;exports.LastUsedNote=m.LastUsedNote;exports.Markdown=m.Markdown;exports.Modal=m.Modal;exports.NodeConfigForm=m.NodeConfigForm;exports.ParamsForm=m.ParamsForm;exports.PropertyEntryForm=m.PropertyEntryForm;exports.RESULT_RENDER_MAX_CHARS=m.RESULT_RENDER_MAX_CHARS;exports.ResultViewer=m.ResultViewer;exports.RetryPolicyFields=m.RetryPolicyFields;exports.StepBuilderModal=m.StepBuilderModal;exports.W6WUIProvider=m.W6WUIProvider;exports.connectionAppIdsToLookUp=m.connectionAppIdsToLookUp;exports.detectResultFormat=m.detectResultFormat;exports.effectiveNodeOutput=m.effectiveNodeOutput;exports.effectiveNodeOutputs=m.effectiveNodeOutputs;exports.filterOptions=m.filterOptions;exports.findTestInput=m.findTestInput;exports.htmlPreviewSrcDoc=m.htmlPreviewSrcDoc;exports.indexNodeSamples=m.indexNodeSamples;exports.isExprValue=m.isExprValue;exports.isFormResolvedOptions=m.isFormResolvedOptions;exports.isSecretValue=m.isSecretValue;exports.isTestRequired=m.isTestRequired;exports.previewNodeOutputs=m.previewNodeOutputs;exports.rememberableInput=m.rememberableInput;exports.requiredParamsFilled=m.requiredParamsFilled;exports.resolveConnectionAppMeta=m.resolveConnectionAppMeta;exports.resultCopyText=m.resultCopyText;exports.shapeToSkeleton=m.shapeToSkeleton;exports.shouldUseCombobox=m.shouldUseCombobox;exports.splitFrontmatter=m.splitFrontmatter;exports.startOAuthPopup=m.startOAuthPopup;exports.testInputSavesSettled=m.testInputSavesSettled;exports.trackTestInputSave=m.trackTestInputSave;exports.useEnterSubmit=m.useEnterSubmit;exports.useExpressionOptions=m.useExpressionOptions;exports.useRememberedTestInput=m.useRememberedTestInput;exports.useW6WApi=m.useW6WApi;exports.CodeBlock=P.CodeBlock;exports.Copyable=P.Copyable;exports.Icon=P.Icon;exports.iconNames=P.iconNames;exports.ATTENTION_DISPLAY_CAP=Ye;exports.ActionTestForm=Ls;exports.ApiError=ie;exports.BudgetMeter=Bn;exports.CELL_PROBLEM_COPY=Qt;exports.CSV_MAX_BYTES=Zt;exports.CSV_TOO_LARGE_COPY=is;exports.CallableList=Pn;exports.ColumnsEditor=ua;exports.ConnectionHeader=Dn;exports.ConnectionList=Ln;exports.CopyableText=Pt;exports.CsvPanel=wa;exports.DATA_STORE_ERROR_FALLBACK=Q;exports.DATA_STORE_KINDS=Un;exports.DATA_STORE_KIND_LABEL=Xt;exports.DATA_STORE_NETWORK_ERROR=ts;exports.DOC_VALUE_COPY=Ge;exports.DataEntryEditor=ha;exports.DataEntryList=ma;exports.DataStoreList=oa;exports.DataTable=ee;exports.DataTableGrid=pa;exports.EditButton=Ze;exports.EditConnectionModal=Mn;exports.EmptyState=oe;exports.ExecutionDetail=$n;exports.ExecutionFilters=bn;exports.ExecutionList=on;exports.ExecutionLogPanel=Bt;exports.ExecutionStats=kn;exports.HealthStatusPill=Se;exports.HistoryTimeline=en;exports.InfoTip=tn;exports.ListItem=be;exports.NEW_ROW_ID=tt;exports.RECENT_DISPLAY_CAP=Wt;exports.ReliabilityChart=Ht;exports.ReliabilityList=On;exports.RepoSyncIndicator=sn;exports.SCALAR_TYPES=Qe;exports.ServerResourcesBadge=qs;exports.ServerResourcesCard=Vs;exports.ServerResourcesCardSmall=Ks;exports.ServerResourcesRail=Ws;exports.StepStatusPill=Ee;exports.UptimeStrip=Lt;exports.VERSION_CONFLICT_COPY=st;exports.YamlEditor=Ms;exports.buildRowValue=ta;exports.cellErrorsOf=aa;exports.createW6WApi=_s;exports.cropText=It;exports.csvFilenameOf=Kn;exports.csvImportMessage=ra;exports.csvLineOf=ze;exports.dirtyColumns=ea;exports.displayBoard=qt;exports.draftFromEntry=Zn;exports.errorPlacement=ls;exports.formatDurationMs=$e;exports.formatExecutionTime=re;exports.isCellValue=Gn;exports.isVersionConflict=la;exports.kvValueOf=ia;exports.kvValueTypeOf=Jn;exports.locateDataStoreError=Xn;exports.locateRawResponseError=as;exports.needsAttention=Tn;exports.newRowDraft=Qn;exports.parseCell=Ae;exports.parseDocText=os;exports.partitionBoard=Vt;exports.performancePoints=Jt;exports.remainingTtlSeconds=sa;exports.rowValueOf=rs;exports.rowWriteOf=na;exports.serializeCell=Te;exports.tableSchemaOf=Vn;exports.uptimeDays=Kt;
|
|
2
3
|
//# sourceMappingURL=index.cjs.map
|