UNPKG

miniflare

Version:

Fun, full-featured, fully-local simulator for Cloudflare Workers

1 lines 42.2 kB
import{c as e,s as t,z as n}from"./useRouterState-DkU0JPAO.js";import{Bt as r,Vt as i,n as a,r as o}from"./button-cdxnqcgzwko8ooha-DW4HgSd6.js";import{t as s}from"./CaretDown.es-Bia_8FMa.js";import{C as c,E as l,S as u,T as d,_ as f,a as ee,b as te,c as ne,d as p,f as m,g as h,h as g,i as _,l as v,m as re,n as ie,o as ae,r as y,s as b,t as x,u as S,v as C,x as oe,y as w}from"./observability-OhToSqn-.js";import{n as T}from"./label-latndvb1ngem7we8-M6HmFWt4.js";import{t as se}from"./ListBullets.es-CjgHN86n.js";import{t as E}from"./Warning.es-Bgaquy77.js";import{t as ce}from"./X.es-Cti8Pwro.js";import{t as le}from"./input-group-lxdd09p60cf27pe1-FmDFsFZv.js";import{t as D}from"./select-kva5ru5f673kah1m-DMJc8LO6.js";import{At as ue,Ft as O,Mt as de,ct as k,et as fe,lt as pe,ot as me,st as he}from"./index-CkemaNd1.js";var A=n(t(),1),ge=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z`}))]]),j=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M56.88,31.93A12,12,0,1,0,39.12,48.07l16,17.65C20.67,88.66,5.72,121.58,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212a131.34,131.34,0,0,0,51-10l20.09,22.1a12,12,0,0,0,17.76-16.14ZM128,188c-29.59,0-55.47-10.73-76.91-31.88A130.69,130.69,0,0,1,29.52,128c5.27-9.31,18.79-29.9,42-44.29l90.09,99.11A109.33,109.33,0,0,1,128,188Zm123-55.12c-.36.81-9,20-28,39.16a12,12,0,1,1-17-16.9A130.48,130.48,0,0,0,226.48,128a130.36,130.36,0,0,0-21.57-28.12C183.46,78.73,157.59,68,128,68c-3.35,0-6.7.14-10,.42a12,12,0,1,1-2-23.91c3.93-.34,8-.51,12-.51,36,0,68.63,13.67,94.49,39.52,19.35,19.35,28.11,38.8,28.48,39.61A12.08,12.08,0,0,1,251,132.88Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M96.68,57.87a4,4,0,0,1,2.08-6.6A130.13,130.13,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41a8,8,0,0,1,0,6.5c-.35.79-8.82,19.57-27.65,38.4q-4.28,4.26-8.79,8.07a4,4,0,0,1-5.55-.36ZM213.92,210.62a8,8,0,1,1-11.84,10.76L180,197.13A127.21,127.21,0,0,1,128,208c-34.88,0-66.57-13.26-91.66-38.34C17.51,150.83,9,132.05,8.69,131.26a8,8,0,0,1,0-6.5C9,124,17.51,105.18,36.34,86.35a135,135,0,0,1,25-19.78L42.08,45.38A8,8,0,1,1,53.92,34.62Zm-65.49-48.25-52.69-58a40,40,0,0,0,52.69,58Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M52.44,36A6,6,0,0,0,43.56,44L64.44,67c-37.28,21.9-53.23,57-53.92,58.57a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206a124.91,124.91,0,0,0,52.57-11.25l23,25.29a6,6,0,0,0,8.88-8.08Zm48.62,71.32,45,49.52a34,34,0,0,1-45-49.52ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.57,134.57,0,0,1,22.69,128c4.29-8.2,20.1-35.18,50-51.91L92.89,98.3a46,46,0,0,0,61.35,67.48l17.81,19.6A113.47,113.47,0,0,1,128,194Zm6.4-99.4a6,6,0,0,1,2.25-11.79,46.17,46.17,0,0,1,37.15,40.87,6,6,0,0,1-5.42,6.53l-.56,0a6,6,0,0,1-6-5.45A34.1,34.1,0,0,0,134.4,94.6Zm111.08,35.85c-.41.92-10.37,23-32.86,43.12a6,6,0,1,1-8-8.94A134.07,134.07,0,0,0,233.31,128a134.67,134.67,0,0,0-23.86-32.07C186.78,73.42,159.38,62,128,62a120.19,120.19,0,0,0-19.69,1.6,6,6,0,1,1-2-11.83A131.12,131.12,0,0,1,128,50c43.38,0,73,20.54,90.24,37.76,18.58,18.58,26.9,37,27.24,37.81A6,6,0,0,1,245.48,130.45Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M51,37.31A4,4,0,0,0,45,42.69L67.59,67.5C29.34,89,13,124.81,12.34,126.38a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17a122.59,122.59,0,0,0,53.06-11.69l24,26.38a4,4,0,1,0,5.92-5.38ZM149.1,157.16A36,36,0,0,1,101,104.22ZM128,196c-32,0-59.89-11.65-83-34.62A135.81,135.81,0,0,1,20.44,128c3.65-7.23,20.09-36.81,52.68-54.43l22.45,24.7a44,44,0,0,0,59,64.83l20.89,23A114.94,114.94,0,0,1,128,196Zm6.78-103.36a4,4,0,0,1,1.49-7.86,44.15,44.15,0,0,1,35.54,39.09,4,4,0,0,1-3.61,4.35l-.38,0a4,4,0,0,1-4-3.63A36.1,36.1,0,0,0,134.78,92.64Zm108.88,37c-.41.91-10.2,22.58-32.38,42.45a4,4,0,0,1-2.67,1,4,4,0,0,1-2.67-7A136.71,136.71,0,0,0,235.56,128,136.07,136.07,0,0,0,211,94.62C187.89,71.65,160,60,128,60a122,122,0,0,0-20,1.63,4,4,0,0,1-1.32-7.89A129.3,129.3,0,0,1,128,52c42.7,0,71.87,20.22,88.83,37.18,18.31,18.31,26.49,36.44,26.83,37.2A4.08,4.08,0,0,1,243.66,129.63Z`}))]]),M=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z`}))]]),N=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M96,240l16-80L48,136,160,16,144,96l64,24Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z`}))]]),_e=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,136H48a20,20,0,0,0-20,20v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V156A20,20,0,0,0,208,136Zm-4,52H52V160H204Zm4-144H48A20,20,0,0,0,28,64v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm-4,52H52V68H204Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,152v40a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8H208A8,8,0,0,1,216,152Zm-8-96H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V64A8,8,0,0,0,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224,152v40a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V152a16,16,0,0,1,16-16H208A16,16,0,0,1,224,152ZM208,48H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,138H48a14,14,0,0,0-14,14v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V152A14,14,0,0,0,208,138Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM208,50H48A14,14,0,0,0,34,64v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V64A14,14,0,0,0,208,50Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,140H48a12,12,0,0,0-12,12v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V152A12,12,0,0,0,208,140Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM208,52H48A12,12,0,0,0,36,64v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V64A12,12,0,0,0,208,52Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z`}))]]),ve=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ge}));ve.displayName=`EyeIcon`;var ye=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:j}));ye.displayName=`EyeSlashIcon`;var P=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:M}));P.displayName=`GlobeIcon`;var F=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:N}));F.displayName=`LightningIcon`;var I=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:_e}));I.displayName=`RowsIcon`;var L=e();function R(e){switch(e){case`error`:return`bg-red-500/15 text-red-500`;case`warn`:return`bg-amber-500/15 text-amber-600 dark:text-amber-400`;case`debug`:return`bg-gray-500/15 text-kumo-subtle`;default:return`bg-blue-500/15 text-blue-600 dark:text-blue-400`}}function be({traceId:e}){let[t,n]=(0,A.useState)([]),[r,a]=(0,A.useState)(!0),[o,s]=(0,A.useState)(null);return(0,A.useEffect)(()=>{let t=!0;return a(!0),y(e).then(e=>{t&&(n(e),s(null),a(!1))}).catch(e=>{t&&(s(e instanceof Error?e.message:`Failed to load logs`),a(!1))}),()=>{t=!1}},[e]),(0,L.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-kumo-fill bg-kumo-base`,children:[(0,L.jsxs)(`div`,{className:`border-b border-kumo-fill px-4 py-2 text-xs font-medium text-kumo-subtle`,children:[`Logs`,t.length?` (${t.length})`:``]}),o?(0,L.jsx)(`div`,{className:`px-4 py-3 text-xs text-red-500`,children:o}):r?(0,L.jsx)(`div`,{className:`px-4 py-3 text-xs text-kumo-subtle`,children:`Loading logs…`}):t.length===0?(0,L.jsx)(`div`,{className:`px-4 py-3 text-xs text-kumo-subtle italic`,children:`No logs for this invocation.`}):(0,L.jsx)(`ul`,{children:t.map(e=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2 border-b border-kumo-fill px-4 py-1.5 last:border-b-0`,children:[(0,L.jsx)(`span`,{className:i(`mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase`,R(e.level)),children:e.level??`log`}),(0,L.jsx)(`span`,{className:`font-mono text-xs break-all text-kumo-default`,children:b(e.message??void 0)||(0,L.jsx)(`span`,{className:`text-kumo-subtle italic`,children:`(no message)`})})]},`${e.span_id??`-`}-${e.seq}`))})]})}function z(e,t){return function({size:n=16,className:r}){return(0,L.jsx)(e,{width:n,height:n,className:i(t,r)})}}function B(e,t){return function({size:n=16,className:r}){return(0,L.jsx)(e,{size:n,className:i(t,r)})}}var V=z(pe,`text-orange-500`),xe=z(he,`text-orange-500`),Se=z(me,`text-orange-500`),H=z(k,`text-orange-500`),U=B(P,`text-violet-500`),W=B(F,`text-orange-500`),G=B(I,`text-kumo-subtle`);function K(e){if(e.depth===0)return W;switch(C(e)){case`http`:case`fetch`:return U;case`d1`:return V;case`kv`:return xe;case`r2`:return Se;case`do`:return H;default:return G}}var Ce=256,q=160,we=`wobs-waterfall-name-width`,J=[1,2,5,10,20,25,50,100,200,250,500,1e3,2e3,2500,5e3,1e4,15e3,2e4,3e4,6e4,12e4,3e5];function Te(e,t){let n=e/Math.min(9,Math.max(2,Math.floor(t/40)));for(let e of J)if(e>=n)return e;return J[J.length-1]??3e5}function Y(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${Math.round(e)}ms`:`${e.toFixed(2)}ms`}function Ee(){let e=(0,A.useRef)(null),[t,n]=(0,A.useState)(0);return(0,A.useEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(e=>{for(let t of e)n(t.contentRect.width)});return r.observe(t),()=>r.disconnect()},[]),{ref:e,width:t}}function X(e){return f(e)}function De({spans:e,rootSpanId:t,traceDurationMs:n,invocationRootIds:r,hideDevRunner:a=!1}){let o=(0,A.useMemo)(()=>x(e,t,a),[e,t,a]),s=(0,A.useMemo)(()=>new Set(r??[]),[r]),c=(0,A.useCallback)(e=>e.span_id!==t&&s.has(e.span_id),[s,t]),{ref:l,width:u}=Ee(),[d,f]=(0,A.useState)([]),[ee,te]=(0,A.useState)(null),[ne,p]=(0,A.useState)(null),[m,h]=(0,A.useState)(()=>{try{let e=Number(localStorage.getItem(we));return e>=q?e:Ce}catch{return Ce}});(0,A.useEffect)(()=>{try{localStorage.setItem(we,String(m))}catch{}},[m]);let g=u>0?Math.max(q,u-200):640,_=(0,A.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=m,r=e=>{h(Math.min(Math.max(n+(e.clientX-t),q),g))},i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)},[m,g]),v=(0,A.useCallback)(e=>{f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),re=(0,A.useCallback)(e=>{e.hasChildren?(v(e.layoutId),te(e.span_id)):te(t=>t===e.span_id?null:e.span_id)},[v]),ie=(0,A.useCallback)(e=>!d.some(t=>e.layoutId.startsWith(t+`.`)&&t!==e.layoutId),[d]),ae=(0,A.useMemo)(()=>o.filter(ie),[o,ie]),y=o.reduce((e,t)=>Math.max(e,t.end_ms??t.start_ms+t.duration_ms),0),b=Math.max(0,u-m),S=(y>0?y:Math.max(1,n))*1.05,C=b>0?b/S:0,oe=Te(S,b),w=[];for(let e=0;e<=S;e+=oe){let t=e*C;t<=b&&w.push({time:e,left:t})}let T=o.find(e=>e.span_id===ee)??null,se=e=>ee===e?`bg-blue-100 dark:bg-blue-900/30`:ne===e?`bg-black/5 dark:bg-white/5`:``;return(0,L.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-kumo-fill bg-kumo-base`,children:[(0,L.jsx)(`div`,{ref:l,className:`outline-none`,role:`region`,"aria-label":`Trace timeline`,children:(0,L.jsxs)(`div`,{className:`flex`,children:[(0,L.jsxs)(`div`,{style:{width:m},className:`relative shrink-0 border-r border-kumo-fill`,children:[(0,L.jsx)(`div`,{className:`flex h-[41px] items-center border-b border-kumo-fill px-4 py-2.5`,children:(0,L.jsx)(`span`,{className:`text-sm font-medium text-kumo-default`,children:`Name`})}),ae.map(e=>(0,L.jsx)(`div`,{role:`button`,tabIndex:0,className:i(`h-8 cursor-pointer border-l-2 border-l-transparent`,c(e)&&`border-t border-dashed border-kumo-line`,se(e.span_id)),onClick:()=>re(e),onMouseEnter:()=>p(e.span_id),onMouseLeave:()=>p(null),children:(0,L.jsx)(Oe,{span:e,isCollapsed:d.includes(e.layoutId),isInvocationStart:c(e),onToggleCollapsed:v})},e.layoutId)),(0,L.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize name column`,onPointerDown:_,className:`absolute top-0 right-0 h-full w-1.5 translate-x-1/2 cursor-col-resize hover:bg-blue-500/40`})]}),(0,L.jsxs)(`div`,{className:`relative flex-1`,style:{width:b},children:[(0,L.jsx)(`div`,{className:`relative flex h-[41px] items-center overflow-hidden border-b border-kumo-fill py-2.5`,children:w.map(({time:e,left:t})=>(0,L.jsx)(`div`,{className:`absolute text-[10px] text-kumo-subtle`,style:{left:`${t+2}px`},children:Y(e)},e))}),w.slice(1).map(({time:e,left:t})=>(0,L.jsx)(`div`,{className:`pointer-events-none absolute w-px bg-kumo-fill`,style:{left:`${t}px`,top:`40px`,height:`calc(100% - 40px)`}},`m-${e}`)),ae.map(e=>(0,L.jsx)(`div`,{className:i(`flex h-8 cursor-pointer items-center pl-0.5`,c(e)&&`border-t border-dashed border-kumo-line`,se(e.span_id)),onClick:()=>re(e),onMouseEnter:()=>p(e.span_id),onMouseLeave:()=>p(null),children:(0,L.jsx)(ke,{span:e,pxToMS:C,traceAreaWidth:b})},e.layoutId))]})]})}),T?(0,L.jsx)(Ae,{span:T}):null]})}function Oe({span:e,isCollapsed:t,isInvocationStart:n,onToggleCollapsed:r}){let a=X(e),c=K(e);return(0,L.jsxs)(`div`,{className:`relative flex h-full w-full items-center gap-2 overflow-hidden pl-4 font-mono text-sm text-ellipsis whitespace-nowrap`,style:{paddingLeft:4+e.depth*32,maxWidth:`100%`},children:[n?(0,L.jsx)(`span`,{title:`Start of a new worker invocation`,className:`shrink-0 rounded-sm bg-purple-500/15 px-1 text-[9px] font-medium tracking-wide text-purple-500 uppercase`,children:`inv`}):null,e.hasChildren?(0,L.jsx)(o,{shape:`square`,variant:`ghost`,size:`xs`,"aria-label":t?`Expand span`:`Collapse span`,icon:t?O:s,onClick:t=>{t.stopPropagation(),r(e.layoutId)}}):null,(0,L.jsxs)(`div`,{className:i(`relative flex min-w-0 items-center gap-2`,a&&`text-red-500`),children:[(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,L.jsx)(c,{size:16})}),a?(0,L.jsx)(`span`,{title:e.error??`An error occurred in this span`,className:`flex shrink-0 items-center justify-center rounded-sm bg-red-500/15 p-1 text-red-500`,children:(0,L.jsx)(E,{size:12,weight:`bold`})}):null,(0,L.jsx)(`span`,{className:`min-w-0 overflow-hidden text-sm text-ellipsis whitespace-nowrap`,children:g(e)||`span`})]})]})}function ke({span:e,pxToMS:t,traceAreaWidth:n}){let r=X(e),a=e.depth===0,o=e.duration_ms,s=o*t,c=Math.max(e.start_ms*t,0),l=s<40,u=c<n/2,d=e.running?`bg-blue-500/60 animate-pulse`:r?`bg-red-500`:a?`bg-orange-500`:`bg-neutral-600 dark:bg-neutral-400`,f=e.running?`running…`:Y(o);return(0,L.jsx)(`div`,{className:`flex w-full items-center`,style:{maxWidth:n},children:(0,L.jsxs)(`div`,{className:`relative w-full`,children:[l&&!u?(0,L.jsx)(`div`,{className:`absolute top-0 flex h-5 items-center text-[10px] font-medium text-kumo-subtle`,style:{right:`${n-c+4}px`},children:f}):null,(0,L.jsx)(`div`,{className:i(`relative flex h-5 items-center rounded-sm`,d),style:{width:`${Math.max(s,8)}px`,left:`${c+2}px`},children:l?null:(0,L.jsx)(`span`,{className:`relative left-1 flex items-center px-px text-[10px] font-medium text-white`,children:f})}),l&&u?(0,L.jsx)(`div`,{className:i(`absolute top-0 flex h-5 items-center text-[10px] text-kumo-subtle`,r&&`text-red-500`),style:{left:`${c+Math.max(s,8)+4}px`},children:f}):null]})})}function Ae({span:e}){let t=h(e.attributes),n=Object.entries(t),r=X(e);return(0,L.jsxs)(`div`,{className:`border-t border-kumo-fill bg-kumo-elevated p-4`,children:[(0,L.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,L.jsx)(K(e),{size:16}),(0,L.jsx)(`span`,{className:`font-mono text-sm font-semibold text-kumo-default`,children:g(e)||`span`}),(0,L.jsx)(`span`,{className:i(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r?`bg-red-500/15 text-red-500`:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`),children:e.running?`running`:e.outcome??`?`}),(0,L.jsx)(`span`,{className:`text-xs text-kumo-subtle`,children:e.running?`running…`:Y(e.duration_ms)})]}),e.error?(0,L.jsx)(`div`,{className:`mb-3 rounded bg-red-500/10 px-2 py-1.5 text-xs text-red-500`,children:e.error}):null,n.length?(0,L.jsx)(`div`,{className:`overflow-hidden rounded border border-kumo-fill`,children:(0,L.jsx)(`table`,{className:`w-full text-xs`,children:(0,L.jsx)(`tbody`,{children:n.map(([e,t],n)=>(0,L.jsxs)(`tr`,{className:i(`align-top`,n%2&&`bg-kumo-base`),children:[(0,L.jsx)(`td`,{className:`w-1/3 px-3 py-1.5 font-mono whitespace-nowrap text-kumo-subtle`,children:e}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 font-mono break-all text-kumo-default`,children:typeof t==`object`?JSON.stringify(t):String(t)})]},e))})})}):(0,L.jsx)(`div`,{className:`text-xs text-kumo-subtle italic`,children:`No attributes`})]})}var je=`wobs-hide-dev-runner`,Me={success:`Success`,error:`Errors`},Ne={http:`HTTP`,fetch:`Fetch`,d1:`D1`,kv:`KV`,r2:`R2`,do:`Durable Object`};function Pe(e){return f(e)||(e.error_count??0)>0}function Fe(e){return e>=1e3?{value:(e/1e3).toFixed(2),unit:`s`}:{value:String(Math.round(e)),unit:`ms`}}function Z(e){return`${e.trace_id}:${e.root_span_id}`}function Ie(e,t){return!e.outcome||(e.span_count??t.length)!==t.length?!1:!t.some(p)}function Q(){let[e,t]=(0,A.useState)([]),[n,r]=(0,A.useState)(new Set),[s,f]=(0,A.useState)({}),[p,h]=(0,A.useState)({}),y=(0,A.useRef)(s);y.current=s;let b=fe.useSearch(),x=fe.useNavigate(),C=(0,A.useRef)(null);C.current??={trace:b.trace,span:b.span};let E=C.current.trace,O=C.current.span,k=(0,A.useRef)(null),pe=(0,A.useRef)(null),[me,he]=(0,A.useState)(!1),[ge,j]=(0,A.useState)(null),[M,N]=(0,A.useState)(!1),[_e,P]=(0,A.useState)(!1),[F,I]=(0,A.useState)(()=>{try{return localStorage.getItem(je)!==`false`}catch{return!0}}),R=(0,A.useCallback)(()=>{I(e=>{let t=!e;try{localStorage.setItem(je,String(t))}catch{}return t})},[]),[z,B]=(0,A.useState)(!1),[V,xe]=(0,A.useState)(new Set),Se=(0,A.useCallback)(e=>{xe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[H,U]=(0,A.useState)(``),[W,G]=(0,A.useState)(``),[K,Ce]=(0,A.useState)(`all`),[q,we]=(0,A.useState)(`all`),[J,Te]=(0,A.useState)([]),[Y,Ee]=(0,A.useState)([]),X=H!==W,Oe=(0,A.useCallback)(()=>G(H),[H]),ke=(0,A.useCallback)(()=>{U(``),G(``)},[]);(0,A.useEffect)(()=>{v().then(Ee).catch(()=>Ee([]))},[]);let Ae=(0,A.useMemo)(()=>[{key:`duration`,label:`Duration (ms)`,type:`number`},...Y.map(e=>({key:e,label:e,type:`string`}))],[Y]),Q=(0,A.useCallback)(async()=>{he(!0),j(null);try{let e=d(W);t(await re({search:e.text,status:e.status??K,kind:e.kind??q,traceId:e.traceId,spanId:e.spanId,clauses:[...e.clauses,...J]})),N(!1)}catch(e){S(e)?(N(!0),j(null)):j(e instanceof Error?e.message:`Failed to load traces`)}finally{he(!1)}},[W,K,q,J]),Re=(0,A.useCallback)(async()=>{P(!0);try{await ie(),r(new Set),f({}),h({}),await Q()}catch(e){j(e instanceof Error?e.message:`Failed to clear data`)}finally{P(!1)}},[Q]);(0,A.useEffect)(()=>{Q()},[Q]),(0,A.useEffect)(()=>{if(M)return;let e=setInterval(()=>void Q(),3e3);return()=>clearInterval(e)},[Q,M]);let $=(0,A.useCallback)(async e=>{let t=Z(e);try{let[n,r]=await Promise.all([_(e.trace_id),ne(e.trace_id)]);f(e=>({...e,[t]:n})),h(e=>({...e,[t]:r}))}catch(e){j(e instanceof Error?e.message:`Failed to load spans`)}},[]),ze=(0,A.useCallback)(async e=>{let t=Z(e);r(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}),!s[t]&&await $(e)},[s,$]);(0,A.useEffect)(()=>{for(let t of e){let e=Z(t);if(!n.has(e))continue;let r=y.current[e];r&&(Ie(t,r)||$(t))}},[e,n,$]),(0,A.useEffect)(()=>{b.trace===void 0&&b.span===void 0||x({search:e=>({...e,trace:void 0,span:void 0}),replace:!0})},[x,b.trace,b.span]),(0,A.useEffect)(()=>{if(!E||pe.current===E)return;pe.current=E;let e=`trace:${E}`;U(e),G(e)},[E]),(0,A.useEffect)(()=>{if(!E||k.current===E)return;let t=e.filter(e=>e.trace_id===E),n=t[0];if(!n)return;k.current=E;let i=e=>{let t=Z(e);r(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n}),y.current[t]||$(e),requestAnimationFrame(()=>{document.getElementById(`trace-row-${t}`)?.scrollIntoView({block:`center`})})};if(t.length===1||!O){i(n);return}_(E).then(e=>{let r=ee(e,O);i(t.find(e=>e.root_span_id===r)??n)}).catch(()=>i(n))},[E,O,e,$]);let Be=(0,A.useMemo)(()=>Math.max(1,...e.map(e=>e.duration_ms??0)),[e]),Ve=(0,A.useMemo)(()=>e.some(e=>m(e)),[e])&&!z;return M?(0,L.jsx)(u,{}):(0,L.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,L.jsxs)(`header`,{className:`flex min-h-14 items-center gap-2.5 border-b border-kumo-fill px-6`,children:[(0,L.jsx)(ue,{size:18,className:`text-kumo-subtle`}),(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[(0,L.jsx)(`span`,{className:`pl-1 text-sm leading-tight font-semibold text-kumo-default`,children:`Traces`}),(0,L.jsxs)(`span`,{className:`pl-1 text-[11px] leading-tight text-kumo-subtle`,children:[e.length,` trace`,e.length===1?``:`s`]})]}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(o,{size:`sm`,variant:F?`secondary`:`ghost`,icon:F?ve:ye,title:F?`Show Vite dev module-runner plumbing spans (vite dev only)`:`Hide Vite dev module-runner plumbing spans (vite dev only)`,"aria-pressed":F,onClick:R,children:F?`Show Vite runner spans`:`Hide Vite runner spans`}),(0,L.jsx)(l,{onConfirm:Re,loading:_e,disabled:e.length===0}),(0,L.jsx)(a,{size:`sm`,"aria-label":`Refresh traces`,loading:me,onClick:()=>void Q()})]}),Ve?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-kumo-fill bg-blue-500/10 px-6 py-2 text-xs text-kumo-default`,children:[(0,L.jsx)(T,{size:14,className:`shrink-0 text-blue-500`}),(0,L.jsx)(`span`,{className:`flex-1`,children:F?`Running under Vite dev — some spans come from Vite's module runner (module loading, RPC dispatch) rather than your code. They're hidden by “Hide Vite runner spans”.`:`Running under Vite dev — Vite module-runner spans (module loading, RPC dispatch) are shown and may add noise to your traces.`}),(0,L.jsx)(o,{size:`sm`,variant:`secondary`,onClick:R,children:F?`Show Vite runner spans`:`Hide Vite runner spans`}),(0,L.jsx)(o,{size:`sm`,variant:`ghost`,icon:ce,"aria-label":`Dismiss notice`,onClick:()=>B(!0)})]}):null,(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-kumo-fill px-6 py-3`,children:[(0,L.jsxs)(le,{size:`sm`,className:`flex-1`,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-center pl-2 text-kumo-subtle`,children:(0,L.jsx)(de,{size:14})}),(0,L.jsx)(`input`,{"aria-label":`Search traces`,value:H,onChange:e=>U(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&Oe()},placeholder:`Search, or query e.g. status:error kind:d1 dur:>100 db.query.text:orders — press Enter`,className:`w-full bg-transparent px-2 text-xs text-kumo-default outline-none placeholder:text-kumo-subtle`}),H?(0,L.jsx)(le.Button,{shape:`square`,variant:`ghost`,"aria-label":`Clear search`,onClick:ke,children:(0,L.jsx)(ce,{size:12})}):null]}),(0,L.jsx)(oe,{variant:`traces`}),(0,L.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-kumo-subtle`,children:[`Status`,(0,L.jsxs)(D,{"aria-label":`Filter by status`,value:K,onValueChange:e=>Ce(String(e)),renderValue:e=>e===`all`?(0,L.jsx)(`span`,{className:`text-kumo-subtle`,children:`Any`}):Me[String(e)],children:[(0,L.jsx)(D.Option,{value:`all`,children:`Any status`}),(0,L.jsx)(D.Option,{value:`success`,children:`Success`}),(0,L.jsx)(D.Option,{value:`error`,children:`Errors`})]})]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-kumo-subtle`,children:[`Type`,(0,L.jsxs)(D,{"aria-label":`Filter by type`,value:q,onValueChange:e=>we(String(e)),renderValue:e=>e===`all`?(0,L.jsx)(`span`,{className:`text-kumo-subtle`,children:`Any`}):Ne[String(e)],children:[(0,L.jsx)(D.Option,{value:`all`,children:`Any type`}),(0,L.jsx)(D.Option,{value:`http`,children:`HTTP`}),(0,L.jsx)(D.Option,{value:`fetch`,children:`Fetch`}),(0,L.jsx)(D.Option,{value:`d1`,children:`D1`}),(0,L.jsx)(D.Option,{value:`kv`,children:`KV`}),(0,L.jsx)(D.Option,{value:`r2`,children:`R2`}),(0,L.jsx)(D.Option,{value:`do`,children:`Durable Object`})]})]}),(0,L.jsx)(c,{fields:Ae,clauses:J,onApply:Te,itemNoun:`traces`})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:[ge?(0,L.jsx)(`div`,{className:`mb-3 rounded bg-red-500/10 px-3 py-2 text-xs text-red-500`,children:ge}):null,(0,L.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-kumo-fill bg-kumo-base`,children:e.length===0&&!me&&!X?H||K!==`all`||q!==`all`||J.length>0?(0,L.jsx)(Le,{title:`No matching traces`,body:`No traces match your current search or filters. Try clearing them.`,inline:!0}):(0,L.jsx)(Le,{title:`No traces yet`,body:`Send some requests to your Worker and each trace will show up here.`,inline:!0}):(0,L.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-kumo-fill text-left text-xs text-kumo-subtle`,children:[(0,L.jsx)(`th`,{className:`py-2 pr-3 pl-4 font-medium`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[`Timestamp `,(0,L.jsx)(`span`,{className:`text-blue-500`,children:`↓`})]})}),(0,L.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Operation`}),(0,L.jsx)(`th`,{className:`w-48 py-2 pr-3 font-medium`,children:(0,L.jsxs)(`span`,{className:`inline-flex cursor-help items-center gap-1`,title:`Local durations are approximate — they reflect this machine and the local simulator, not production, and are not a basis for cost or billing estimates.`,children:[`Duration (ms)`,(0,L.jsx)(T,{size:12,className:`text-kumo-subtle`})]})}),(0,L.jsx)(`th`,{className:`w-20 py-2 pr-3 font-medium`,children:`Spans`}),(0,L.jsx)(`th`,{className:`w-24 py-2 pr-3 font-medium`,children:`Errors`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>{let t=Z(e),r=n.has(t),a=s[t]??[],c=Pe(e),l=e.duration_ms??0,u=r&&a.length?te(a,F):a,d=r&&a.length?w(u):l,f=r&&a.length?u.length:e.span_count??a.length;return(0,L.jsxs)(A.Fragment,{children:[(0,L.jsxs)(`tr`,{id:`trace-row-${t}`,onClick:()=>void ze(e),className:i(`cursor-pointer border-b border-kumo-fill hover:bg-black/[0.03] dark:hover:bg-white/5`,r&&`bg-blue-100 dark:bg-blue-900/30`),children:[(0,L.jsx)(`td`,{className:`py-2.5 pr-3 pl-4`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(`span`,{className:i(`h-4 w-[3px] shrink-0 rounded-full`,c?`bg-red-500`:`bg-blue-500`)}),(0,L.jsxs)(`span`,{className:`font-mono text-xs text-kumo-default underline decoration-kumo-line decoration-dotted underline-offset-2`,children:[e.created_at??``,(0,L.jsx)(`span`,{className:`text-kumo-subtle`,children:` UTC`})]})]})}),(0,L.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs text-kumo-default`,children:e.name?g(e):e.trace_id.slice(0,16)}),(0,L.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`text-sm tabular-nums`,children:[(0,L.jsx)(`span`,{className:`text-kumo-default`,children:Fe(l).value}),(0,L.jsx)(`span`,{className:`text-kumo-subtle`,children:Fe(l).unit})]}),(0,L.jsx)(`div`,{className:`h-1 w-24 overflow-hidden rounded-full bg-kumo-fill`,children:(0,L.jsx)(`div`,{className:`h-full rounded-full bg-blue-500`,style:{width:`${Math.max(l/Be*100,2)}%`}})})]})}),(0,L.jsx)(`td`,{className:`py-2.5 pr-3 text-xs text-kumo-default tabular-nums`,children:e.span_count??`-`}),(0,L.jsx)(`td`,{className:`py-2.5 pr-3 text-xs tabular-nums`,children:(e.error_count??0)>0?(0,L.jsx)(`span`,{className:`text-red-500`,children:e.error_count}):(0,L.jsx)(`span`,{className:`text-kumo-subtle`,children:`-`})})]}),r&&a.length>0?(0,L.jsx)(`tr`,{className:`bg-black/[0.02] dark:bg-white/[0.02]`,children:(0,L.jsxs)(`td`,{colSpan:5,className:`border-b border-kumo-fill p-4`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-sm font-semibold text-kumo-default`,children:e.name?g(e):e.trace_id}),(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-kumo-subtle`,children:e.trace_id.slice(0,16)}),(0,L.jsxs)(`span`,{className:`text-[11px] text-kumo-subtle`,children:[`· `,ae(d),` · `,f,` `,`spans`]}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(o,{size:`sm`,variant:V.has(t)?`secondary`:`ghost`,icon:se,"aria-pressed":V.has(t),title:`Show all logs for this invocation`,onClick:e=>{e.stopPropagation(),Se(t)},children:V.has(t)?`Hide logs`:`Show logs`})]}),(0,L.jsx)(De,{spans:a,rootSpanId:e.root_span_id,traceDurationMs:d,invocationRootIds:p[t],hideDevRunner:F},t),V.has(t)?(0,L.jsx)(be,{traceId:e.trace_id}):null]})}):null]},t)})})]})})]})]})}function Le({title:e,body:t,inline:n}){return(0,L.jsxs)(`div`,{className:i(`flex flex-col items-center justify-center text-center`,n?`py-16`:`h-full`),children:[(0,L.jsx)(ue,{size:32,className:`mb-3 text-kumo-subtle`}),(0,L.jsx)(`h3`,{className:`text-base font-semibold text-kumo-default`,children:e}),(0,L.jsx)(`p`,{className:`mt-2 max-w-md text-sm text-kumo-subtle`,children:t})]})}export{Q as component};