@asymmetric-effort/specifyjs 0.2.98 → 0.2.103

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.
Files changed (570) hide show
  1. package/dist/esm/chunks/chunk-3J4RXW7E.js +3 -0
  2. package/dist/esm/chunks/chunk-3J4RXW7E.js.map +7 -0
  3. package/dist/esm/chunks/chunk-3SXNLMCH.js +3 -0
  4. package/dist/esm/chunks/chunk-3SXNLMCH.js.map +7 -0
  5. package/dist/esm/chunks/chunk-A7AAS5ZR.js +3 -0
  6. package/dist/esm/chunks/chunk-A7AAS5ZR.js.map +7 -0
  7. package/dist/esm/chunks/chunk-E43OK6IZ.js +3 -0
  8. package/dist/esm/chunks/chunk-E43OK6IZ.js.map +7 -0
  9. package/dist/esm/chunks/chunk-LWOMFZ4C.js +3 -0
  10. package/dist/esm/chunks/chunk-LWOMFZ4C.js.map +7 -0
  11. package/dist/esm/chunks/chunk-MCXU6QF3.js +3 -0
  12. package/dist/esm/chunks/chunk-MCXU6QF3.js.map +7 -0
  13. package/dist/esm/chunks/chunk-ODCBJ22O.js +3 -0
  14. package/dist/esm/chunks/chunk-ODCBJ22O.js.map +7 -0
  15. package/dist/esm/chunks/chunk-TVDAY42P.js +3 -0
  16. package/dist/esm/chunks/chunk-TVDAY42P.js.map +7 -0
  17. package/dist/esm/chunks/chunk-VAF4KNDP.js +3 -0
  18. package/dist/esm/chunks/chunk-VAF4KNDP.js.map +7 -0
  19. package/dist/esm/chunks/chunk-ZDPD2MPQ.js +3 -0
  20. package/dist/esm/chunks/chunk-ZDPD2MPQ.js.map +7 -0
  21. package/dist/esm/chunks/metrics-56RIK7JQ.js +3 -0
  22. package/dist/esm/chunks/metrics-56RIK7JQ.js.map +7 -0
  23. package/dist/esm/client/index.js +3 -0
  24. package/dist/esm/components-barrel.js +9 -0
  25. package/dist/esm/dom/index.js +3 -0
  26. package/dist/esm/index.js +3 -0
  27. package/dist/esm/jsx-dev-runtime.js +3 -0
  28. package/dist/esm/jsx-runtime.js +3 -0
  29. package/dist/esm/server/index.js +3 -0
  30. package/dist/esm/telemetry/index.js +3 -0
  31. package/dist/specifyjs-build.cjs.js +160 -1
  32. package/dist/specifyjs-build.cjs.js.map +7 -1
  33. package/dist/specifyjs-build.d.ts +1 -110
  34. package/dist/specifyjs-build.esm.js +160 -1
  35. package/dist/specifyjs-build.esm.js.map +7 -1
  36. package/dist/specifyjs-client.cjs.js +2 -1
  37. package/dist/specifyjs-client.cjs.js.map +7 -1
  38. package/dist/specifyjs-client.d.ts +1 -159
  39. package/dist/specifyjs-client.esm.js +3 -2
  40. package/dist/specifyjs-client.esm.js.map +7 -1
  41. package/dist/specifyjs-components.cjs.js +8 -1
  42. package/dist/specifyjs-components.cjs.js.map +7 -1
  43. package/dist/specifyjs-components.d.ts +1 -3334
  44. package/dist/specifyjs-components.esm.js +9 -2
  45. package/dist/specifyjs-components.esm.js.map +7 -1
  46. package/dist/specifyjs-dom.cjs.js +2 -1
  47. package/dist/specifyjs-dom.cjs.js.map +7 -1
  48. package/dist/specifyjs-dom.d.ts +1 -107
  49. package/dist/specifyjs-dom.esm.js +3 -2
  50. package/dist/specifyjs-dom.esm.js.map +7 -1
  51. package/dist/specifyjs-jsx-dev-runtime.cjs.js +2 -1
  52. package/dist/specifyjs-jsx-dev-runtime.cjs.js.map +7 -1
  53. package/dist/specifyjs-jsx-dev-runtime.esm.js +3 -2
  54. package/dist/specifyjs-jsx-dev-runtime.esm.js.map +7 -1
  55. package/dist/specifyjs-jsx-runtime.cjs.js +2 -1
  56. package/dist/specifyjs-jsx-runtime.cjs.js.map +7 -1
  57. package/dist/specifyjs-jsx-runtime.esm.js +3 -2
  58. package/dist/specifyjs-jsx-runtime.esm.js.map +7 -1
  59. package/dist/specifyjs-server.cjs.js +2 -1
  60. package/dist/specifyjs-server.cjs.js.map +7 -1
  61. package/dist/specifyjs-server.d.ts +1 -136
  62. package/dist/specifyjs-server.esm.js +3 -2
  63. package/dist/specifyjs-server.esm.js.map +7 -1
  64. package/dist/specifyjs-telemetry.cjs.js +2 -1
  65. package/dist/specifyjs-telemetry.cjs.js.map +7 -1
  66. package/dist/specifyjs-telemetry.d.ts +1 -165
  67. package/dist/specifyjs-telemetry.esm.js +3 -2
  68. package/dist/specifyjs-telemetry.esm.js.map +7 -1
  69. package/dist/specifyjs.cjs.js +2 -1
  70. package/dist/specifyjs.cjs.js.map +7 -1
  71. package/dist/specifyjs.d.ts +1 -581
  72. package/dist/specifyjs.esm.js +3 -2
  73. package/dist/specifyjs.esm.js.map +7 -1
  74. package/dist/types/build/index.d.ts +5 -0
  75. package/dist/types/build/index.d.ts.map +1 -0
  76. package/dist/types/build/noscript-plugin.d.ts +63 -0
  77. package/dist/types/build/noscript-plugin.d.ts.map +1 -0
  78. package/dist/types/build/seo-plugin.d.ts +43 -0
  79. package/dist/types/build/seo-plugin.d.ts.map +1 -0
  80. package/dist/types/client/graphql.d.ts +64 -0
  81. package/dist/types/client/graphql.d.ts.map +1 -0
  82. package/dist/types/client/index.d.ts +4 -0
  83. package/dist/types/client/index.d.ts.map +1 -0
  84. package/dist/types/client/protobuf.d.ts +40 -0
  85. package/dist/types/client/protobuf.d.ts.map +1 -0
  86. package/dist/types/client/rest.d.ts +61 -0
  87. package/dist/types/client/rest.d.ts.map +1 -0
  88. package/dist/types/components/ad/adsense/src/AdSense.d.ts +19 -0
  89. package/dist/types/components/ad/adsense/src/index.d.ts +2 -0
  90. package/dist/types/components/analytics/google-analytics/src/GoogleAnalytics.d.ts +13 -0
  91. package/dist/types/components/analytics/google-analytics/src/index.d.ts +2 -0
  92. package/dist/types/components/component.d.ts +39 -0
  93. package/dist/types/components/component.d.ts.map +1 -0
  94. package/dist/types/components/data/analog-clock/src/AnalogClock.d.ts +17 -0
  95. package/dist/types/components/data/analog-clock/src/index.d.ts +2 -0
  96. package/dist/types/components/data/avatar/src/Avatar.d.ts +19 -0
  97. package/dist/types/components/data/avatar/src/index.d.ts +2 -0
  98. package/dist/types/components/data/badge/src/Badge.d.ts +17 -0
  99. package/dist/types/components/data/badge/src/index.d.ts +2 -0
  100. package/dist/types/components/data/data-grid/src/DataGrid.d.ts +47 -0
  101. package/dist/types/components/data/data-grid/src/index.d.ts +2 -0
  102. package/dist/types/components/data/digital-clock/src/DigitalClock.d.ts +15 -0
  103. package/dist/types/components/data/digital-clock/src/index.d.ts +2 -0
  104. package/dist/types/components/data/list-view/src/ListView.d.ts +23 -0
  105. package/dist/types/components/data/list-view/src/index.d.ts +2 -0
  106. package/dist/types/components/data/tag/src/Tag.d.ts +21 -0
  107. package/dist/types/components/data/tag/src/index.d.ts +2 -0
  108. package/dist/types/components/data/virtual-scroll/src/VirtualScroll.d.ts +13 -0
  109. package/dist/types/components/data/virtual-scroll/src/index.d.ts +2 -0
  110. package/dist/types/components/error-boundary.d.ts +23 -0
  111. package/dist/types/components/error-boundary.d.ts.map +1 -0
  112. package/dist/types/components/errors/_shared/src/HttpErrorPage.d.ts +15 -0
  113. package/dist/types/components/errors/_shared/src/index.d.ts +2 -0
  114. package/dist/types/components/errors/http-400/src/Http400.d.ts +9 -0
  115. package/dist/types/components/errors/http-400/src/index.d.ts +2 -0
  116. package/dist/types/components/errors/http-401/src/Http401.d.ts +9 -0
  117. package/dist/types/components/errors/http-401/src/index.d.ts +2 -0
  118. package/dist/types/components/errors/http-403/src/Http403.d.ts +9 -0
  119. package/dist/types/components/errors/http-403/src/index.d.ts +2 -0
  120. package/dist/types/components/errors/http-404/src/Http404.d.ts +9 -0
  121. package/dist/types/components/errors/http-404/src/index.d.ts +2 -0
  122. package/dist/types/components/errors/http-405/src/Http405.d.ts +9 -0
  123. package/dist/types/components/errors/http-405/src/index.d.ts +2 -0
  124. package/dist/types/components/errors/http-408/src/Http408.d.ts +9 -0
  125. package/dist/types/components/errors/http-408/src/index.d.ts +2 -0
  126. package/dist/types/components/errors/http-429/src/Http429.d.ts +9 -0
  127. package/dist/types/components/errors/http-429/src/index.d.ts +2 -0
  128. package/dist/types/components/errors/http-500/src/Http500.d.ts +9 -0
  129. package/dist/types/components/errors/http-500/src/index.d.ts +2 -0
  130. package/dist/types/components/errors/http-502/src/Http502.d.ts +9 -0
  131. package/dist/types/components/errors/http-502/src/index.d.ts +2 -0
  132. package/dist/types/components/errors/http-503/src/Http503.d.ts +9 -0
  133. package/dist/types/components/errors/http-503/src/index.d.ts +2 -0
  134. package/dist/types/components/errors/http-504/src/Http504.d.ts +9 -0
  135. package/dist/types/components/errors/http-504/src/index.d.ts +2 -0
  136. package/dist/types/components/feedback/alert/src/Alert.d.ts +25 -0
  137. package/dist/types/components/feedback/alert/src/index.d.ts +2 -0
  138. package/dist/types/components/feedback/empty-state/src/EmptyState.d.ts +17 -0
  139. package/dist/types/components/feedback/empty-state/src/index.d.ts +2 -0
  140. package/dist/types/components/feedback/progress-bar/src/ProgressBar.d.ts +23 -0
  141. package/dist/types/components/feedback/progress-bar/src/index.d.ts +2 -0
  142. package/dist/types/components/feedback/skeleton/src/Skeleton.d.ts +15 -0
  143. package/dist/types/components/feedback/skeleton/src/index.d.ts +2 -0
  144. package/dist/types/components/feedback/spinner/src/Spinner.d.ts +13 -0
  145. package/dist/types/components/feedback/spinner/src/index.d.ts +2 -0
  146. package/dist/types/components/form/button/src/Button.d.ts +25 -0
  147. package/dist/types/components/form/button/src/index.d.ts +2 -0
  148. package/dist/types/components/form/checkbox/src/Checkbox.d.ts +19 -0
  149. package/dist/types/components/form/checkbox/src/index.d.ts +2 -0
  150. package/dist/types/components/form/color-picker/src/ColorPicker.d.ts +19 -0
  151. package/dist/types/components/form/color-picker/src/index.d.ts +2 -0
  152. package/dist/types/components/form/color-wheel/src/ColorWheel.d.ts +17 -0
  153. package/dist/types/components/form/color-wheel/src/index.d.ts +2 -0
  154. package/dist/types/components/form/datepicker/src/DatePicker.d.ts +23 -0
  155. package/dist/types/components/form/datepicker/src/index.d.ts +2 -0
  156. package/dist/types/components/form/file-upload/src/FileUpload.d.ts +19 -0
  157. package/dist/types/components/form/file-upload/src/index.d.ts +2 -0
  158. package/dist/types/components/form/multiline/src/MultilineField.d.ts +41 -0
  159. package/dist/types/components/form/multiline/src/index.d.ts +2 -0
  160. package/dist/types/components/form/number-spinner/src/NumberSpinner.d.ts +25 -0
  161. package/dist/types/components/form/number-spinner/src/index.d.ts +2 -0
  162. package/dist/types/components/form/radio/src/RadioGroup.d.ts +26 -0
  163. package/dist/types/components/form/radio/src/index.d.ts +2 -0
  164. package/dist/types/components/form/select/src/Select.d.ts +33 -0
  165. package/dist/types/components/form/select/src/index.d.ts +2 -0
  166. package/dist/types/components/form/slider/src/Slider.d.ts +33 -0
  167. package/dist/types/components/form/slider/src/index.d.ts +2 -0
  168. package/dist/types/components/form/texteditor/src/TextEditor.d.ts +46 -0
  169. package/dist/types/components/form/texteditor/src/index.d.ts +2 -0
  170. package/dist/types/components/form/textfield/src/TextField.d.ts +48 -0
  171. package/dist/types/components/form/textfield/src/index.d.ts +2 -0
  172. package/dist/types/components/form/timepicker/src/TimePicker.d.ts +29 -0
  173. package/dist/types/components/form/timepicker/src/index.d.ts +2 -0
  174. package/dist/types/components/form/toggle/src/Toggle.d.ts +19 -0
  175. package/dist/types/components/form/toggle/src/index.d.ts +2 -0
  176. package/dist/types/components/form/wrapper/src/FormFieldWrapper.d.ts +67 -0
  177. package/dist/types/components/form/wrapper/src/index.d.ts +2 -0
  178. package/dist/types/components/layout/card/src/Card.d.ts +31 -0
  179. package/dist/types/components/layout/card/src/index.d.ts +2 -0
  180. package/dist/types/components/layout/desktop-background/src/DesktopBackground.d.ts +23 -0
  181. package/dist/types/components/layout/desktop-background/src/index.d.ts +2 -0
  182. package/dist/types/components/layout/draggable-window/src/DraggableWindow.d.ts +59 -0
  183. package/dist/types/components/layout/draggable-window/src/index.d.ts +2 -0
  184. package/dist/types/components/layout/flex-container/src/FlexContainer.d.ts +42 -0
  185. package/dist/types/components/layout/flex-container/src/index.d.ts +2 -0
  186. package/dist/types/components/layout/footer/src/Footer.d.ts +25 -0
  187. package/dist/types/components/layout/footer/src/index.d.ts +2 -0
  188. package/dist/types/components/layout/grid/src/Grid.d.ts +54 -0
  189. package/dist/types/components/layout/grid/src/index.d.ts +2 -0
  190. package/dist/types/components/layout/panel/src/Panel.d.ts +23 -0
  191. package/dist/types/components/layout/panel/src/index.d.ts +2 -0
  192. package/dist/types/components/layout/scroll-container/src/ScrollContainer.d.ts +21 -0
  193. package/dist/types/components/layout/scroll-container/src/index.d.ts +2 -0
  194. package/dist/types/components/layout/splitter/src/Splitter.d.ts +19 -0
  195. package/dist/types/components/layout/splitter/src/index.d.ts +2 -0
  196. package/dist/types/components/layout/tabs/src/Tabs.d.ts +29 -0
  197. package/dist/types/components/layout/tabs/src/index.d.ts +2 -0
  198. package/dist/types/components/layout/window-manager/src/WindowManager.d.ts +106 -0
  199. package/dist/types/components/layout/window-manager/src/index.d.ts +2 -0
  200. package/dist/types/components/math/src/index.d.ts +5 -0
  201. package/dist/types/components/math/src/mat.d.ts +71 -0
  202. package/dist/types/components/math/src/mat4.d.ts +101 -0
  203. package/dist/types/components/math/src/quaternion.d.ts +62 -0
  204. package/dist/types/components/math/src/solver.d.ts +55 -0
  205. package/dist/types/components/math/src/vec.d.ts +54 -0
  206. package/dist/types/components/media/carousel/src/Carousel.d.ts +23 -0
  207. package/dist/types/components/media/carousel/src/index.d.ts +2 -0
  208. package/dist/types/components/media/image/src/Image.d.ts +23 -0
  209. package/dist/types/components/media/image/src/index.d.ts +2 -0
  210. package/dist/types/components/media/video-player/src/VideoPlayer.d.ts +27 -0
  211. package/dist/types/components/media/video-player/src/index.d.ts +2 -0
  212. package/dist/types/components/nav/accordion/src/Accordion.d.ts +52 -0
  213. package/dist/types/components/nav/accordion/src/index.d.ts +2 -0
  214. package/dist/types/components/nav/breadcrumb/src/Breadcrumb.d.ts +20 -0
  215. package/dist/types/components/nav/breadcrumb/src/index.d.ts +2 -0
  216. package/dist/types/components/nav/dock/src/Dock.d.ts +46 -0
  217. package/dist/types/components/nav/dock/src/index.d.ts +2 -0
  218. package/dist/types/components/nav/dropdown/src/Dropdown.d.ts +36 -0
  219. package/dist/types/components/nav/dropdown/src/index.d.ts +2 -0
  220. package/dist/types/components/nav/menubar/src/Menubar.d.ts +27 -0
  221. package/dist/types/components/nav/menubar/src/index.d.ts +2 -0
  222. package/dist/types/components/nav/pagination/src/Pagination.d.ts +19 -0
  223. package/dist/types/components/nav/pagination/src/index.d.ts +2 -0
  224. package/dist/types/components/nav/sidebar/src/Sidebar.d.ts +29 -0
  225. package/dist/types/components/nav/sidebar/src/index.d.ts +2 -0
  226. package/dist/types/components/nav/stepper/src/Stepper.d.ts +25 -0
  227. package/dist/types/components/nav/stepper/src/index.d.ts +2 -0
  228. package/dist/types/components/nav/system-tray/src/SystemTray.d.ts +47 -0
  229. package/dist/types/components/nav/system-tray/src/index.d.ts +2 -0
  230. package/dist/types/components/nav/toolbar/src/Toolbar.d.ts +27 -0
  231. package/dist/types/components/nav/toolbar/src/index.d.ts +2 -0
  232. package/dist/types/components/nav/treenav/src/TreeNav.d.ts +34 -0
  233. package/dist/types/components/nav/treenav/src/TreeNode.d.ts +74 -0
  234. package/dist/types/components/nav/treenav/src/index.d.ts +4 -0
  235. package/dist/types/components/nav/wrapper/src/NavWrapper.d.ts +73 -0
  236. package/dist/types/components/nav/wrapper/src/index.d.ts +2 -0
  237. package/dist/types/components/overlay/context-menu/src/ContextMenu.d.ts +21 -0
  238. package/dist/types/components/overlay/context-menu/src/index.d.ts +2 -0
  239. package/dist/types/components/overlay/drawer/src/Drawer.d.ts +22 -0
  240. package/dist/types/components/overlay/drawer/src/index.d.ts +2 -0
  241. package/dist/types/components/overlay/modal/src/Modal.d.ts +22 -0
  242. package/dist/types/components/overlay/modal/src/index.d.ts +2 -0
  243. package/dist/types/components/overlay/popover/src/Popover.d.ts +20 -0
  244. package/dist/types/components/overlay/popover/src/index.d.ts +2 -0
  245. package/dist/types/components/overlay/toast/src/Toast.d.ts +59 -0
  246. package/dist/types/components/overlay/toast/src/index.d.ts +2 -0
  247. package/dist/types/components/overlay/tooltip/src/Tooltip.d.ts +14 -0
  248. package/dist/types/components/overlay/tooltip/src/index.d.ts +2 -0
  249. package/dist/types/components/page/ide/src/IDE.d.ts +5 -0
  250. package/dist/types/components/page/ide/src/index.d.ts +2 -0
  251. package/dist/types/components/page/trading-dashboard/src/TradingDashboard.d.ts +5 -0
  252. package/dist/types/components/page/trading-dashboard/src/index.d.ts +2 -0
  253. package/dist/types/components/page/unity-desktop/src/UnityApp.d.ts +30 -0
  254. package/dist/types/components/page/unity-desktop/src/UnityDesktop.d.ts +30 -0
  255. package/dist/types/components/page/unity-desktop/src/index.d.ts +4 -0
  256. package/dist/types/components/page/word-processor/src/WordProcessor.d.ts +7 -0
  257. package/dist/types/components/page/word-processor/src/index.d.ts +2 -0
  258. package/dist/types/components/profiler.d.ts +6 -0
  259. package/dist/types/components/profiler.d.ts.map +1 -0
  260. package/dist/types/components/strict-mode.d.ts +6 -0
  261. package/dist/types/components/strict-mode.d.ts.map +1 -0
  262. package/dist/types/components/suspense.d.ts +6 -0
  263. package/dist/types/components/suspense.d.ts.map +1 -0
  264. package/dist/types/components/viz/2D-bar-graph/src/BarGraph.d.ts +61 -0
  265. package/dist/types/components/viz/2D-bar-graph/src/index.d.ts +2 -0
  266. package/dist/types/components/viz/2D-cartesian-raw/src/CartesianGraph2D.d.ts +40 -0
  267. package/dist/types/components/viz/2D-cartesian-raw/src/index.d.ts +2 -0
  268. package/dist/types/components/viz/2D-complex-graph/src/ComplexGraph2D.d.ts +33 -0
  269. package/dist/types/components/viz/2D-complex-graph/src/index.d.ts +2 -0
  270. package/dist/types/components/viz/2D-discrete-cartesian/src/DiscreteCartesian2D.d.ts +31 -0
  271. package/dist/types/components/viz/2D-discrete-cartesian/src/index.d.ts +2 -0
  272. package/dist/types/components/viz/2D-line-graph/src/LineGraph.d.ts +53 -0
  273. package/dist/types/components/viz/2D-line-graph/src/index.d.ts +2 -0
  274. package/dist/types/components/viz/2D-pie-graph/src/PieGraph.d.ts +49 -0
  275. package/dist/types/components/viz/2D-pie-graph/src/index.d.ts +3 -0
  276. package/dist/types/components/viz/2D-polar-graph/src/PolarGraph2D.d.ts +35 -0
  277. package/dist/types/components/viz/2D-polar-graph/src/index.d.ts +2 -0
  278. package/dist/types/components/viz/3d-force-graph/src/ForceGraph3D.d.ts +123 -0
  279. package/dist/types/components/viz/3d-force-graph/src/index.d.ts +2 -0
  280. package/dist/types/components/viz/3d-layers/src/ThreeDLayers.d.ts +35 -0
  281. package/dist/types/components/viz/3d-layers/src/index.d.ts +2 -0
  282. package/dist/types/components/viz/3dSpace/src/Space3D.d.ts +63 -0
  283. package/dist/types/components/viz/3dSpace/src/animation.d.ts +75 -0
  284. package/dist/types/components/viz/3dSpace/src/bounds.d.ts +36 -0
  285. package/dist/types/components/viz/3dSpace/src/camera-controller.d.ts +59 -0
  286. package/dist/types/components/viz/3dSpace/src/camera.d.ts +43 -0
  287. package/dist/types/components/viz/3dSpace/src/collision.d.ts +54 -0
  288. package/dist/types/components/viz/3dSpace/src/cpu-pipeline.d.ts +47 -0
  289. package/dist/types/components/viz/3dSpace/src/index.d.ts +32 -0
  290. package/dist/types/components/viz/3dSpace/src/light.d.ts +23 -0
  291. package/dist/types/components/viz/3dSpace/src/lighting-model.d.ts +34 -0
  292. package/dist/types/components/viz/3dSpace/src/material.d.ts +12 -0
  293. package/dist/types/components/viz/3dSpace/src/mesh.d.ts +35 -0
  294. package/dist/types/components/viz/3dSpace/src/picking.d.ts +51 -0
  295. package/dist/types/components/viz/3dSpace/src/render-pipeline.d.ts +12 -0
  296. package/dist/types/components/viz/3dSpace/src/scene-graph.d.ts +20 -0
  297. package/dist/types/components/viz/3dSpace/src/scene-object.d.ts +31 -0
  298. package/dist/types/components/viz/3dSpace/src/terrain.d.ts +34 -0
  299. package/dist/types/components/viz/3dSpace/src/texture.d.ts +22 -0
  300. package/dist/types/components/viz/3dSpace/src/types.d.ts +42 -0
  301. package/dist/types/components/viz/3dSpace/src/viewport.d.ts +19 -0
  302. package/dist/types/components/viz/3dSpace/src/webgl-pipeline.d.ts +54 -0
  303. package/dist/types/components/viz/big-number/src/BigNumber.d.ts +29 -0
  304. package/dist/types/components/viz/big-number/src/index.d.ts +2 -0
  305. package/dist/types/components/viz/bloch-sphere/src/BlochSphere.d.ts +73 -0
  306. package/dist/types/components/viz/bloch-sphere/src/index.d.ts +2 -0
  307. package/dist/types/components/viz/box-plot/src/BoxPlot.d.ts +47 -0
  308. package/dist/types/components/viz/box-plot/src/index.d.ts +2 -0
  309. package/dist/types/components/viz/bubble-chart/src/BubbleChart.d.ts +38 -0
  310. package/dist/types/components/viz/bubble-chart/src/index.d.ts +2 -0
  311. package/dist/types/components/viz/calendar-heat-map/src/CalendarHeatMap.d.ts +29 -0
  312. package/dist/types/components/viz/calendar-heat-map/src/index.d.ts +2 -0
  313. package/dist/types/components/viz/chord/src/ChordDiagram.d.ts +25 -0
  314. package/dist/types/components/viz/chord/src/index.d.ts +2 -0
  315. package/dist/types/components/viz/decomposition-tree/src/DecompositionTree.d.ts +33 -0
  316. package/dist/types/components/viz/decomposition-tree/src/index.d.ts +2 -0
  317. package/dist/types/components/viz/earth-globe/src/EarthGlobe.d.ts +62 -0
  318. package/dist/types/components/viz/earth-globe/src/globe-data.d.ts +23 -0
  319. package/dist/types/components/viz/earth-globe/src/index.d.ts +5 -0
  320. package/dist/types/components/viz/force-graph/src/ForceGraph.d.ts +99 -0
  321. package/dist/types/components/viz/force-graph/src/index.d.ts +2 -0
  322. package/dist/types/components/viz/funnel/src/FunnelChart.d.ts +28 -0
  323. package/dist/types/components/viz/funnel/src/index.d.ts +2 -0
  324. package/dist/types/components/viz/gantt-chart/src/GanttChart.d.ts +33 -0
  325. package/dist/types/components/viz/gantt-chart/src/index.d.ts +2 -0
  326. package/dist/types/components/viz/gauge/src/Gauge.d.ts +37 -0
  327. package/dist/types/components/viz/gauge/src/index.d.ts +2 -0
  328. package/dist/types/components/viz/graph/src/HypercubeGraph.d.ts +43 -0
  329. package/dist/types/components/viz/graph/src/hypercube.d.ts +78 -0
  330. package/dist/types/components/viz/graph/src/index.d.ts +4 -0
  331. package/dist/types/components/viz/heat-map/src/HeatMap.d.ts +29 -0
  332. package/dist/types/components/viz/heat-map/src/index.d.ts +2 -0
  333. package/dist/types/components/viz/histogram/src/Histogram.d.ts +27 -0
  334. package/dist/types/components/viz/histogram/src/index.d.ts +2 -0
  335. package/dist/types/components/viz/lollipop/src/LollipopChart.d.ts +32 -0
  336. package/dist/types/components/viz/lollipop/src/index.d.ts +2 -0
  337. package/dist/types/components/viz/matrix/src/Matrix.d.ts +29 -0
  338. package/dist/types/components/viz/matrix/src/index.d.ts +2 -0
  339. package/dist/types/components/viz/partition/src/Partition.d.ts +31 -0
  340. package/dist/types/components/viz/partition/src/index.d.ts +2 -0
  341. package/dist/types/components/viz/pivot-table/src/PivotTable.d.ts +25 -0
  342. package/dist/types/components/viz/pivot-table/src/index.d.ts +2 -0
  343. package/dist/types/components/viz/radar-chart/src/RadarChart.d.ts +35 -0
  344. package/dist/types/components/viz/radar-chart/src/index.d.ts +2 -0
  345. package/dist/types/components/viz/sankey/src/SankeyDiagram.d.ts +38 -0
  346. package/dist/types/components/viz/sankey/src/index.d.ts +2 -0
  347. package/dist/types/components/viz/sunburst/src/Sunburst.d.ts +27 -0
  348. package/dist/types/components/viz/sunburst/src/index.d.ts +2 -0
  349. package/dist/types/components/viz/tree-map/src/TreeMap.d.ts +29 -0
  350. package/dist/types/components/viz/tree-map/src/index.d.ts +2 -0
  351. package/dist/types/components/viz/us-state-map/src/USStateMap.d.ts +23 -0
  352. package/dist/types/components/viz/us-state-map/src/index.d.ts +4 -0
  353. package/dist/types/components/viz/us-state-map/src/us-state-paths.d.ts +10 -0
  354. package/dist/types/components/viz/vector-field/src/VectorField.d.ts +61 -0
  355. package/dist/types/components/viz/vector-field/src/index.d.ts +2 -0
  356. package/dist/types/components/viz/waterfall/src/WaterfallChart.d.ts +32 -0
  357. package/dist/types/components/viz/waterfall/src/index.d.ts +2 -0
  358. package/dist/types/components/viz/word-cloud/src/WordCloud.d.ts +30 -0
  359. package/dist/types/components/viz/word-cloud/src/index.d.ts +2 -0
  360. package/dist/types/components/viz/wrapper/src/VizWrapper.d.ts +60 -0
  361. package/dist/types/components/viz/wrapper/src/index.d.ts +2 -0
  362. package/dist/types/compute/context.d.ts +20 -0
  363. package/dist/types/compute/context.d.ts.map +1 -0
  364. package/dist/types/compute/cpu-backend.d.ts +15 -0
  365. package/dist/types/compute/cpu-backend.d.ts.map +1 -0
  366. package/dist/types/compute/index.d.ts +3 -0
  367. package/dist/types/compute/index.d.ts.map +1 -0
  368. package/dist/types/compute/types.d.ts +57 -0
  369. package/dist/types/compute/types.d.ts.map +1 -0
  370. package/dist/types/compute/webgl-backend.d.ts +33 -0
  371. package/dist/types/compute/webgl-backend.d.ts.map +1 -0
  372. package/dist/types/compute/webgpu-backend.d.ts +50 -0
  373. package/dist/types/compute/webgpu-backend.d.ts.map +1 -0
  374. package/dist/types/context/create-context.d.ts +15 -0
  375. package/dist/types/context/create-context.d.ts.map +1 -0
  376. package/dist/types/core/children.d.ts +15 -0
  377. package/dist/types/core/children.d.ts.map +1 -0
  378. package/dist/types/core/clone-element.d.ts +10 -0
  379. package/dist/types/core/clone-element.d.ts.map +1 -0
  380. package/dist/types/core/create-element.d.ts +20 -0
  381. package/dist/types/core/create-element.d.ts.map +1 -0
  382. package/dist/types/core/create-ref.d.ts +7 -0
  383. package/dist/types/core/create-ref.d.ts.map +1 -0
  384. package/dist/types/core/fiber.d.ts +30 -0
  385. package/dist/types/core/fiber.d.ts.map +1 -0
  386. package/dist/types/core/forward-ref.d.ts +16 -0
  387. package/dist/types/core/forward-ref.d.ts.map +1 -0
  388. package/dist/types/core/fragment.d.ts +6 -0
  389. package/dist/types/core/fragment.d.ts.map +1 -0
  390. package/dist/types/core/is-valid-element.d.ts +7 -0
  391. package/dist/types/core/is-valid-element.d.ts.map +1 -0
  392. package/dist/types/core/lanes.d.ts +47 -0
  393. package/dist/types/core/lanes.d.ts.map +1 -0
  394. package/dist/types/core/lazy.d.ts +20 -0
  395. package/dist/types/core/lazy.d.ts.map +1 -0
  396. package/dist/types/core/memo.d.ts +13 -0
  397. package/dist/types/core/memo.d.ts.map +1 -0
  398. package/dist/types/core/reconciler.d.ts +12 -0
  399. package/dist/types/core/reconciler.d.ts.map +1 -0
  400. package/dist/types/core/scheduler-host-config.d.ts +37 -0
  401. package/dist/types/core/scheduler-host-config.d.ts.map +1 -0
  402. package/dist/types/core/scheduler.d.ts +29 -0
  403. package/dist/types/core/scheduler.d.ts.map +1 -0
  404. package/dist/types/core/src/build/index.d.ts +4 -0
  405. package/dist/types/core/src/build/noscript-plugin.d.ts +62 -0
  406. package/dist/types/core/src/build/seo-plugin.d.ts +42 -0
  407. package/dist/types/core/src/client/graphql.d.ts +63 -0
  408. package/dist/types/core/src/client/index.d.ts +3 -0
  409. package/dist/types/core/src/client/protobuf.d.ts +39 -0
  410. package/dist/types/core/src/client/rest.d.ts +60 -0
  411. package/dist/types/core/src/components/component.d.ts +38 -0
  412. package/dist/types/core/src/components/error-boundary.d.ts +22 -0
  413. package/dist/types/core/src/components/profiler.d.ts +5 -0
  414. package/dist/types/core/src/components/strict-mode.d.ts +5 -0
  415. package/dist/types/core/src/components/suspense.d.ts +5 -0
  416. package/dist/types/core/src/components-barrel.d.ts +100 -0
  417. package/dist/types/core/src/compute/context.d.ts +19 -0
  418. package/dist/types/core/src/compute/cpu-backend.d.ts +14 -0
  419. package/dist/types/core/src/compute/index.d.ts +2 -0
  420. package/dist/types/core/src/compute/types.d.ts +56 -0
  421. package/dist/types/core/src/compute/webgl-backend.d.ts +32 -0
  422. package/dist/types/core/src/compute/webgpu-backend.d.ts +49 -0
  423. package/dist/types/core/src/context/create-context.d.ts +14 -0
  424. package/dist/types/core/src/core/children.d.ts +14 -0
  425. package/dist/types/core/src/core/clone-element.d.ts +9 -0
  426. package/dist/types/core/src/core/create-element.d.ts +19 -0
  427. package/dist/types/core/src/core/create-ref.d.ts +6 -0
  428. package/dist/types/core/src/core/fiber.d.ts +29 -0
  429. package/dist/types/core/src/core/forward-ref.d.ts +15 -0
  430. package/dist/types/core/src/core/fragment.d.ts +5 -0
  431. package/dist/types/core/src/core/is-valid-element.d.ts +6 -0
  432. package/dist/types/core/src/core/lanes.d.ts +46 -0
  433. package/dist/types/core/src/core/lazy.d.ts +19 -0
  434. package/dist/types/core/src/core/memo.d.ts +12 -0
  435. package/dist/types/core/src/core/reconciler.d.ts +11 -0
  436. package/dist/types/core/src/core/scheduler-host-config.d.ts +36 -0
  437. package/dist/types/core/src/core/scheduler.d.ts +28 -0
  438. package/dist/types/core/src/core/transitions.d.ts +31 -0
  439. package/dist/types/core/src/devtools/index.d.ts +21 -0
  440. package/dist/types/core/src/dom/create-portal.d.ts +6 -0
  441. package/dist/types/core/src/dom/create-root.d.ts +23 -0
  442. package/dist/types/core/src/dom/flush-sync.d.ts +1 -0
  443. package/dist/types/core/src/dom/index.d.ts +4 -0
  444. package/dist/types/core/src/dom/legacy.d.ts +16 -0
  445. package/dist/types/core/src/dom/synthetic-event.d.ts +90 -0
  446. package/dist/types/core/src/dom/work-loop.d.ts +34 -0
  447. package/dist/types/core/src/features/feature-flags.d.ts +38 -0
  448. package/dist/types/core/src/features/index.d.ts +27 -0
  449. package/dist/types/core/src/hooks/dispatcher.d.ts +26 -0
  450. package/dist/types/core/src/hooks/hook-state.d.ts +46 -0
  451. package/dist/types/core/src/hooks/index.d.ts +47 -0
  452. package/dist/types/core/src/hooks/install-dispatcher.d.ts +2 -0
  453. package/dist/types/core/src/hooks/use-head.d.ts +54 -0
  454. package/dist/types/core/src/index.d.ts +23 -0
  455. package/dist/types/core/src/jsx-dev-runtime.d.ts +1 -0
  456. package/dist/types/core/src/jsx-runtime.d.ts +7 -0
  457. package/dist/types/core/src/router/index.d.ts +12 -0
  458. package/dist/types/core/src/router/link-component.d.ts +16 -0
  459. package/dist/types/core/src/router/match-path.d.ts +28 -0
  460. package/dist/types/core/src/router/route-component.d.ts +12 -0
  461. package/dist/types/core/src/router/router-component.d.ts +5 -0
  462. package/dist/types/core/src/router/router-context.d.ts +13 -0
  463. package/dist/types/core/src/router/router-store.d.ts +22 -0
  464. package/dist/types/core/src/router/use-navigate.d.ts +4 -0
  465. package/dist/types/core/src/router/use-params.d.ts +2 -0
  466. package/dist/types/core/src/router/use-router.d.ts +3 -0
  467. package/dist/types/core/src/server/index.d.ts +3 -0
  468. package/dist/types/core/src/server/render-to-pipeable-stream.d.ts +31 -0
  469. package/dist/types/core/src/server/render-to-readable-stream.d.ts +19 -0
  470. package/dist/types/core/src/server/render-to-string.d.ts +25 -0
  471. package/dist/types/core/src/shared/act.d.ts +1 -0
  472. package/dist/types/core/src/shared/aria-warnings.d.ts +1 -0
  473. package/dist/types/core/src/shared/async-compute.d.ts +63 -0
  474. package/dist/types/core/src/shared/component-registry.d.ts +53 -0
  475. package/dist/types/core/src/shared/render-guard.d.ts +47 -0
  476. package/dist/types/core/src/shared/secure-fetch.d.ts +21 -0
  477. package/dist/types/core/src/shared/types.d.ts +127 -0
  478. package/dist/types/core/src/shared/warnings.d.ts +19 -0
  479. package/dist/types/core/src/telemetry/index.d.ts +2 -0
  480. package/dist/types/core/src/telemetry/metrics.d.ts +67 -0
  481. package/dist/types/core/src/telemetry/tracing.d.ts +95 -0
  482. package/dist/types/core/transitions.d.ts +32 -0
  483. package/dist/types/core/transitions.d.ts.map +1 -0
  484. package/dist/types/devtools/index.d.ts +22 -0
  485. package/dist/types/devtools/index.d.ts.map +1 -0
  486. package/dist/types/dom/create-portal.d.ts +7 -0
  487. package/dist/types/dom/create-portal.d.ts.map +1 -0
  488. package/dist/types/dom/create-root.d.ts +24 -0
  489. package/dist/types/dom/create-root.d.ts.map +1 -0
  490. package/dist/types/dom/flush-sync.d.ts +2 -0
  491. package/dist/types/dom/flush-sync.d.ts.map +1 -0
  492. package/dist/types/dom/index.d.ts +5 -0
  493. package/dist/types/dom/index.d.ts.map +1 -0
  494. package/dist/types/dom/legacy.d.ts +17 -0
  495. package/dist/types/dom/legacy.d.ts.map +1 -0
  496. package/dist/types/dom/synthetic-event.d.ts +91 -0
  497. package/dist/types/dom/synthetic-event.d.ts.map +1 -0
  498. package/dist/types/dom/work-loop.d.ts +35 -0
  499. package/dist/types/dom/work-loop.d.ts.map +1 -0
  500. package/dist/types/features/feature-flags.d.ts +39 -0
  501. package/dist/types/features/feature-flags.d.ts.map +1 -0
  502. package/dist/types/features/index.d.ts +28 -0
  503. package/dist/types/features/index.d.ts.map +1 -0
  504. package/dist/types/hooks/dispatcher.d.ts +27 -0
  505. package/dist/types/hooks/dispatcher.d.ts.map +1 -0
  506. package/dist/types/hooks/hook-state.d.ts +47 -0
  507. package/dist/types/hooks/hook-state.d.ts.map +1 -0
  508. package/dist/types/hooks/index.d.ts +48 -0
  509. package/dist/types/hooks/index.d.ts.map +1 -0
  510. package/dist/types/hooks/install-dispatcher.d.ts +3 -0
  511. package/dist/types/hooks/install-dispatcher.d.ts.map +1 -0
  512. package/dist/types/hooks/use-head.d.ts +55 -0
  513. package/dist/types/hooks/use-head.d.ts.map +1 -0
  514. package/dist/types/index.d.ts +24 -0
  515. package/dist/types/index.d.ts.map +1 -0
  516. package/dist/types/jsx-dev-runtime.d.ts +2 -0
  517. package/dist/types/jsx-dev-runtime.d.ts.map +1 -0
  518. package/dist/types/jsx-runtime.d.ts +8 -0
  519. package/dist/types/jsx-runtime.d.ts.map +1 -0
  520. package/dist/types/router/index.d.ts +13 -0
  521. package/dist/types/router/index.d.ts.map +1 -0
  522. package/dist/types/router/link-component.d.ts +17 -0
  523. package/dist/types/router/link-component.d.ts.map +1 -0
  524. package/dist/types/router/match-path.d.ts +29 -0
  525. package/dist/types/router/match-path.d.ts.map +1 -0
  526. package/dist/types/router/route-component.d.ts +13 -0
  527. package/dist/types/router/route-component.d.ts.map +1 -0
  528. package/dist/types/router/router-component.d.ts +6 -0
  529. package/dist/types/router/router-component.d.ts.map +1 -0
  530. package/dist/types/router/router-context.d.ts +14 -0
  531. package/dist/types/router/router-context.d.ts.map +1 -0
  532. package/dist/types/router/router-store.d.ts +23 -0
  533. package/dist/types/router/router-store.d.ts.map +1 -0
  534. package/dist/types/router/use-navigate.d.ts +5 -0
  535. package/dist/types/router/use-navigate.d.ts.map +1 -0
  536. package/dist/types/router/use-params.d.ts +3 -0
  537. package/dist/types/router/use-params.d.ts.map +1 -0
  538. package/dist/types/router/use-router.d.ts +4 -0
  539. package/dist/types/router/use-router.d.ts.map +1 -0
  540. package/dist/types/server/index.d.ts +4 -0
  541. package/dist/types/server/index.d.ts.map +1 -0
  542. package/dist/types/server/render-to-pipeable-stream.d.ts +32 -0
  543. package/dist/types/server/render-to-pipeable-stream.d.ts.map +1 -0
  544. package/dist/types/server/render-to-readable-stream.d.ts +20 -0
  545. package/dist/types/server/render-to-readable-stream.d.ts.map +1 -0
  546. package/dist/types/server/render-to-string.d.ts +26 -0
  547. package/dist/types/server/render-to-string.d.ts.map +1 -0
  548. package/dist/types/shared/act.d.ts +2 -0
  549. package/dist/types/shared/act.d.ts.map +1 -0
  550. package/dist/types/shared/aria-warnings.d.ts +2 -0
  551. package/dist/types/shared/aria-warnings.d.ts.map +1 -0
  552. package/dist/types/shared/async-compute.d.ts +64 -0
  553. package/dist/types/shared/async-compute.d.ts.map +1 -0
  554. package/dist/types/shared/component-registry.d.ts +54 -0
  555. package/dist/types/shared/component-registry.d.ts.map +1 -0
  556. package/dist/types/shared/render-guard.d.ts +48 -0
  557. package/dist/types/shared/render-guard.d.ts.map +1 -0
  558. package/dist/types/shared/secure-fetch.d.ts +22 -0
  559. package/dist/types/shared/secure-fetch.d.ts.map +1 -0
  560. package/dist/types/shared/types.d.ts +128 -0
  561. package/dist/types/shared/types.d.ts.map +1 -0
  562. package/dist/types/shared/warnings.d.ts +20 -0
  563. package/dist/types/shared/warnings.d.ts.map +1 -0
  564. package/dist/types/telemetry/index.d.ts +3 -0
  565. package/dist/types/telemetry/index.d.ts.map +1 -0
  566. package/dist/types/telemetry/metrics.d.ts +68 -0
  567. package/dist/types/telemetry/metrics.d.ts.map +1 -0
  568. package/dist/types/telemetry/tracing.d.ts +96 -0
  569. package/dist/types/telemetry/tracing.d.ts.map +1 -0
  570. package/package.json +8 -17
@@ -1,165 +1 @@
1
- /** 16-byte (32 hex char) trace identifier. */
2
- type TraceId = string;
3
- /** 8-byte (16 hex char) span identifier. */
4
- type SpanId = string;
5
- /** W3C Trace Context carrier. */
6
- interface TraceContext {
7
- traceId: TraceId;
8
- spanId: SpanId;
9
- traceFlags: string;
10
- parentSpanId?: SpanId;
11
- }
12
- /** Generate a 32-hex-char trace ID (16 random bytes). */
13
- declare function generateTraceId(): TraceId;
14
- /** Generate a 16-hex-char span ID (8 random bytes). */
15
- declare function generateSpanId(): SpanId;
16
- /**
17
- * Parse a W3C `traceparent` header.
18
- *
19
- * Format: `{version}-{traceId}-{spanId}-{traceFlags}`
20
- * Returns `null` when the header is invalid.
21
- */
22
- declare function parseTraceparent(header: string): TraceContext | null;
23
- /**
24
- * Format a {@link TraceContext} as a W3C `traceparent` header string.
25
- *
26
- * Output: `00-{traceId}-{spanId}-{traceFlags}`
27
- */
28
- declare function formatTraceparent(ctx: TraceContext): string;
29
- type SpanKind = 'internal' | 'server' | 'client' | 'producer' | 'consumer';
30
- interface SpanStatus {
31
- code: 'unset' | 'ok' | 'error';
32
- message?: string;
33
- }
34
- interface SpanEvent {
35
- name: string;
36
- timestamp: number;
37
- attributes?: Record<string, string | number | boolean>;
38
- }
39
- interface Span {
40
- traceId: TraceId;
41
- spanId: SpanId;
42
- parentSpanId?: SpanId;
43
- name: string;
44
- kind: SpanKind;
45
- startTime: number;
46
- endTime?: number;
47
- status: SpanStatus;
48
- attributes: Record<string, string | number | boolean>;
49
- events: SpanEvent[];
50
- }
51
- interface StartSpanOptions {
52
- kind?: SpanKind;
53
- parentSpanId?: SpanId;
54
- traceId?: TraceId;
55
- attributes?: Record<string, string | number | boolean>;
56
- }
57
- /**
58
- * Create and start a new span. The span is **not** automatically associated
59
- * with a tracer — use {@link Tracer.startSpan} for automatic parent tracking.
60
- */
61
- declare function startSpan(name: string, opts?: StartSpanOptions): Span;
62
- /** End a span by recording its end time. */
63
- declare function endSpan(span: Span): void;
64
- interface TracerConfig {
65
- serviceName: string;
66
- serviceVersion?: string;
67
- endpoint?: string;
68
- headers?: Record<string, string>;
69
- batchSize?: number;
70
- flushInterval?: number;
71
- }
72
- interface Tracer {
73
- /** Create a span, automatically parented to the current active span. */
74
- startSpan(name: string, opts?: StartSpanOptions): Span;
75
- /**
76
- * Execute `fn` with `span` as the active span. The span is automatically
77
- * ended when `fn` completes (sync or async). The previous active span is
78
- * restored afterward.
79
- */
80
- withSpan<T>(span: Span, fn: () => T): T;
81
- /** Export all pending (buffered) spans to the configured endpoint. */
82
- flush(): Promise<void>;
83
- /** Access the currently-active span (top of the span stack), or `undefined`. */
84
- activeSpan(): Span | undefined;
85
- /** Read-only view of the pending span buffer. */
86
- readonly pendingSpans: ReadonlyArray<Span>;
87
- /** Tracer configuration. */
88
- readonly config: Readonly<TracerConfig>;
89
- }
90
- declare function createTracer(config: TracerConfig): Tracer;
91
- /**
92
- * Hook that creates a span for the component render lifecycle.
93
- * Auto-starts on mount, records render duration, ends on unmount.
94
- */
95
- declare function useTracing(tracer: Tracer, name: string): void;
96
-
97
- interface DataPoint {
98
- value: number;
99
- attributes: Record<string, string | number | boolean>;
100
- timestamp: number;
101
- }
102
- interface Counter {
103
- readonly name: string;
104
- readonly description: string;
105
- /** Monotonically increment the counter. */
106
- add(value: number, attributes?: Record<string, string | number | boolean>): void;
107
- /** Read-only snapshot of data points. */
108
- readonly dataPoints: ReadonlyArray<DataPoint>;
109
- }
110
- interface Histogram {
111
- readonly name: string;
112
- readonly description: string;
113
- /** Record a measurement. */
114
- record(value: number, attributes?: Record<string, string | number | boolean>): void;
115
- /** Read-only snapshot of data points. */
116
- readonly dataPoints: ReadonlyArray<DataPoint>;
117
- }
118
- interface Gauge {
119
- readonly name: string;
120
- readonly description: string;
121
- /** Set the current value. */
122
- set(value: number, attributes?: Record<string, string | number | boolean>): void;
123
- /** Read-only snapshot of data points. */
124
- readonly dataPoints: ReadonlyArray<DataPoint>;
125
- }
126
- type Instrument = Counter | Histogram | Gauge;
127
- interface InstrumentOptions {
128
- description?: string;
129
- unit?: string;
130
- }
131
- interface MeterProviderConfig {
132
- serviceName: string;
133
- endpoint?: string;
134
- headers?: Record<string, string>;
135
- exportInterval?: number;
136
- }
137
- interface MeterProvider {
138
- counter(name: string, opts?: InstrumentOptions): Counter;
139
- histogram(name: string, opts?: InstrumentOptions): Histogram;
140
- gauge(name: string, opts?: InstrumentOptions): Gauge;
141
- /** Export all instrument data to the configured endpoint. */
142
- flush(): Promise<void>;
143
- /** Read-only access to all registered instruments. */
144
- readonly instruments: ReadonlyArray<Instrument>;
145
- readonly config: Readonly<MeterProviderConfig>;
146
- }
147
- declare function createMeterProvider(config: MeterProviderConfig): MeterProvider;
148
- /**
149
- * Build an OTLP-compatible JSON payload for metrics.
150
- *
151
- * Structure follows the OTLP/HTTP JSON proto mapping:
152
- * https://opentelemetry.io/docs/specs/otlp/#otlphttp
153
- */
154
- declare function formatOtlpMetrics(instruments: ReadonlyArray<Instrument>, serviceName?: string): Record<string, unknown>;
155
- /**
156
- * Build an OTLP-compatible JSON payload for traces/spans.
157
- */
158
- declare function formatOtlpTraces(spans: ReadonlyArray<Span>, serviceName?: string, serviceVersion?: string): Record<string, unknown>;
159
- /**
160
- * Send a JSON payload to an OTLP-compatible endpoint via `fetch`.
161
- */
162
- declare function exportToEndpoint(url: string, headers: Record<string, string>, body: Record<string, unknown>): Promise<void>;
163
-
164
- export { createMeterProvider, createTracer, endSpan, exportToEndpoint, formatOtlpMetrics, formatOtlpTraces, formatTraceparent, generateSpanId, generateTraceId, parseTraceparent, startSpan, useTracing };
165
- export type { Counter, DataPoint, Gauge, Histogram, Instrument, InstrumentOptions, MeterProvider, MeterProviderConfig, Span, SpanEvent, SpanId, SpanKind, SpanStatus, StartSpanOptions, TraceContext, TraceId, Tracer, TracerConfig };
1
+ export * from "./types/telemetry/index";
@@ -1,2 +1,3 @@
1
- function t(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function e(t){const e=new Uint8Array(t);try{crypto.getRandomValues(e)}catch{for(let n=0;n<t;n++)e[n]=Math.floor(256*Math.random())}return e}function n(t){let e="";for(let n=0;n<t.length;n++)e+=(t[n]??0).toString(16).padStart(2,"0");return e}function r(){return n(e(16))}function a(){return n(e(8))}const o=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function s(t){const e=o.exec(t.trim());if(!e)return null;const n=e[2],r=e[3],a=e[4];return/^0+$/.test(n)||/^0+$/.test(r)?null:{traceId:n,spanId:r,traceFlags:a}}function i(t){return`00-${t.traceId}-${t.spanId}-${t.traceFlags}`}function c(t,e){return{traceId:e?.traceId??r(),spanId:a(),parentSpanId:e?.parentSpanId,name:t,kind:e?.kind??"internal",startTime:performance.now(),status:{code:"unset"},attributes:e?.attributes?{...e.attributes}:{},events:[]}}function u(t){t.endTime=performance.now()}function p(t){const e=t.batchSize??1e3,n=[],r=[];function a(t){r.length>=e&&r.splice(0,Math.floor(e/2)),r.push(t)}let o;t.flushInterval&&t.flushInterval>0&&(o=setInterval(()=>{s.flush()},t.flushInterval),"object"==typeof o&&"unref"in o&&o.unref());const s={config:t,get pendingSpans(){return r},activeSpan:()=>n.length>0?n[n.length-1]:void 0,startSpan(t,e){const r=s.activeSpan(),a=c(t,{kind:e?.kind,attributes:e?.attributes,traceId:e?.traceId??r?.traceId,parentSpanId:e?.parentSpanId??r?.spanId});return n.push(a),a},withSpan(t,e){n.includes(t)||n.push(t);const r=()=>{for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)};try{const n=e();return n&&"function"==typeof n.then?n.then(e=>(u(t),a(t),r(),e),e=>{throw t.status={code:"error",message:String(e)},u(t),a(t),r(),e}):(u(t),a(t),r(),n)}catch(e){throw t.status={code:"error",message:String(e)},u(t),a(t),r(),e}},async flush(){if(0===r.length)return;const e=r.splice(0,r.length);if(t.endpoint){const{formatOtlpTraces:n,exportToEndpoint:r}=await Promise.resolve().then(function(){return I}),a=n(e,t.serviceName,t.serviceVersion);await r(t.endpoint,t.headers??{},a)}}};return s}function l(e,n){const r=t().useRef(null);var a,o;a=()=>{const t=e.startSpan(n,{kind:"internal"});return t.events.push({name:"mount",timestamp:performance.now()}),r.current=t,()=>{r.current&&(r.current.events.push({name:"unmount",timestamp:performance.now()}),u(r.current))}},o=[],t().useEffect(a,o)}function d(t,e,n){t.length>=1e4&&t.splice(0,Math.floor(5e3)),t.push({value:e,attributes:n?{...n}:{},timestamp:performance.now()})}function f(t){const e=[];let n;t.exportInterval&&t.exportInterval>0&&(n=setInterval(()=>{r.flush()},t.exportInterval),"object"==typeof n&&"unref"in n&&n.unref());const r={config:t,get instruments(){return e},counter(t,n){const r=function(t,e){const n=[];return{name:t,description:e?.description??"",add(t,e){t<0||d(n,t,e)},get dataPoints(){return n}}}(t,n);return e.push(r),r},histogram(t,n){const r=function(t,e){const n=[];return{name:t,description:e?.description??"",record(t,e){d(n,t,e)},get dataPoints(){return n}}}(t,n);return e.push(r),r},gauge(t,n){const r=function(t,e){const n=[];return{name:t,description:e?.description??"",set(t,e){d(n,t,e)},get dataPoints(){return n}}}(t,n);return e.push(r),r},async flush(){if(!t.endpoint)return;const n=g(e,t.serviceName);await y(t.endpoint,t.headers??{},n)}};return r}function m(t){return Object.entries(t).map(([t,e])=>"string"==typeof e?{key:t,value:{stringValue:e}}:"boolean"==typeof e?{key:t,value:{boolValue:e}}:{key:t,value:{intValue:e}})}function h(t){return String(Math.round(1e6*t))}function g(t,e){const n=t.map(t=>{const e=t.dataPoints.map(t=>({attributes:m(t.attributes),timeUnixNano:h(t.timestamp),asDouble:t.value}));let n;return n="add"in t?{sum:{dataPoints:e,isMonotonic:!0,aggregationTemporality:2}}:"record"in t?{histogram:{dataPoints:e,aggregationTemporality:2}}:{gauge:{dataPoints:e}},{name:t.name,description:t.description,...n}});return{resourceMetrics:[{resource:{attributes:m({"service.name":e??"unknown"})},scopeMetrics:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},metrics:n}]}]}}function v(t,e,n){const r={"service.name":e??"unknown"};n&&(r["service.version"]=n);const a={internal:1,server:2,client:3,producer:4,consumer:5},o={unset:0,ok:1,error:2},s=t.map(t=>({traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId??"",name:t.name,kind:a[t.kind]??1,startTimeUnixNano:h(t.startTime),endTimeUnixNano:void 0!==t.endTime?h(t.endTime):"0",attributes:m(t.attributes),status:{code:o[t.status.code]??0,message:t.status.message??""},events:t.events.map(t=>({name:t.name,timeUnixNano:h(t.timestamp),attributes:t.attributes?m(t.attributes):[]}))}));return{resourceSpans:[{resource:{attributes:m(r)},scopeSpans:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},spans:s}]}]}}async function y(t,e,n){try{!function(t){if(t.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${t}". Use an explicit https:// prefix.`);if(t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))return;if(t.startsWith("data:"))return;let e;try{e=new URL(t,"undefined"!=typeof window?window.location.href:void 0)}catch{return}if("https:"!==e.protocol&&"localhost"!==e.hostname&&"127.0.0.1"!==e.hostname)throw new Error(`[SpecifyJS] Insecure URL rejected: "${t}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}(t),await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...e},body:JSON.stringify(n)})}catch{}}var I=Object.freeze({__proto__:null,createMeterProvider:f,exportToEndpoint:y,formatOtlpMetrics:g,formatOtlpTraces:v});export{f as createMeterProvider,p as createTracer,u as endSpan,y as exportToEndpoint,g as formatOtlpMetrics,v as formatOtlpTraces,i as formatTraceparent,a as generateSpanId,r as generateTraceId,s as parseTraceparent,c as startSpan,l as useTracing};
2
- //# sourceMappingURL=specifyjs-telemetry.esm.js.map
1
+ /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
+ import{a as v,b as x,c as b,d as k}from "./esm/chunks/chunk-3SXNLMCH.js";import"../chunks/chunk-TVDAY42P.js";import{d as l,i as m}from "./esm/chunks/chunk-MCXU6QF3.js";import"../chunks/chunk-ZDPD2MPQ.js";function I(e){let n=new Uint8Array(e);try{crypto.getRandomValues(n)}catch{for(let t=0;t<e;t++)n[t]=Math.floor(Math.random()*256)}return n}function T(e){let n="";for(let t=0;t<e.length;t++)n+=(e[t]??0).toString(16).padStart(2,"0");return n}function g(){return T(I(16))}function y(){return T(I(8))}var w=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function R(e){let n=w.exec(e.trim());if(!n)return null;let t=n[2],a=n[3],s=n[4];return/^0+$/.test(t)||/^0+$/.test(a)?null:{traceId:t,spanId:a,traceFlags:s}}function E(e){return`00-${e.traceId}-${e.spanId}-${e.traceFlags}`}function h(e,n){return{traceId:n?.traceId??g(),spanId:y(),parentSpanId:n?.parentSpanId,name:e,kind:n?.kind??"internal",startTime:performance.now(),status:{code:"unset"},attributes:n?.attributes?{...n.attributes}:{},events:[]}}function c(e){e.endTime=performance.now()}function C(e){let n=e.batchSize??1e3,t=[],a=[];function s(r){a.length>=n&&a.splice(0,Math.floor(n/2)),a.push(r)}let d;e.flushInterval&&e.flushInterval>0&&(d=setInterval(()=>{f.flush()},e.flushInterval),typeof d=="object"&&"unref"in d&&d.unref());let f={config:e,get pendingSpans(){return a},activeSpan(){return t.length>0?t[t.length-1]:void 0},startSpan(r,i){let u=f.activeSpan(),p=h(r,{kind:i?.kind,attributes:i?.attributes,traceId:i?.traceId??u?.traceId,parentSpanId:i?.parentSpanId??u?.spanId});return t.push(p),p},withSpan(r,i){t.includes(r)||t.push(r);let p=()=>{for(let o=t.length-1;o>=0;o--)t[o]===r&&t.splice(o,1)};try{let o=i();return o&&typeof o.then=="function"?o.then(S=>(c(r),s(r),p(),S),S=>{throw r.status={code:"error",message:String(S)},c(r),s(r),p(),S}):(c(r),s(r),p(),o)}catch(o){throw r.status={code:"error",message:String(o)},c(r),s(r),p(),o}},async flush(){if(a.length===0)return;let r=a.splice(0,a.length);if(e.endpoint){let{formatOtlpTraces:i,exportToEndpoint:u}=await import("../chunks/metrics-56RIK7JQ.js"),p=i(r,e.serviceName,e.serviceVersion);await u(e.endpoint,e.headers??{},p)}}};return f}function O(e,n){let t=m(null);l(()=>{let a=e.startSpan(n,{kind:"internal"});return a.events.push({name:"mount",timestamp:performance.now()}),t.current=a,()=>{t.current&&(t.current.events.push({name:"unmount",timestamp:performance.now()}),c(t.current))}},[])}export{v as createMeterProvider,C as createTracer,c as endSpan,k as exportToEndpoint,x as formatOtlpMetrics,b as formatOtlpTraces,E as formatTraceparent,y as generateSpanId,g as generateTraceId,R as parseTraceparent,h as startSpan,O as useTracing};
3
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"specifyjs-telemetry.esm.js","sources":["../../src/hooks/index.ts","../../src/telemetry/tracing.ts","../../src/telemetry/metrics.ts","../../src/shared/secure-fetch.ts"],"sourcesContent":[null,null,null,null],"names":["resolveDispatcher","Error","randomBytes","length","buf","Uint8Array","crypto","getRandomValues","i","Math","floor","random","bytesToHex","bytes","hex","toString","padStart","generateTraceId","generateSpanId","TRACEPARENT_RE","parseTraceparent","header","match","exec","trim","traceId","spanId","traceFlags","test","formatTraceparent","ctx","startSpan","name","opts","parentSpanId","kind","startTime","performance","now","status","code","attributes","events","endSpan","span","endTime","createTracer","config","MAX_BUFFER_SIZE","batchSize","spanStack","buffer","bufferSpan","splice","push","flushTimer","flushInterval","setInterval","tracer","flush","unref","pendingSpans","activeSpan","undefined","active","withSpan","fn","includes","removeFromStack","result","then","value","err","message","String","toExport","endpoint","formatOtlpTraces","exportToEndpoint","Promise","resolve","metrics","body","serviceName","serviceVersion","headers","useTracing","spanRef","useRef","create","deps","timestamp","current","useEffect","addDataPoint","points","MAX_DATA_POINTS","createMeterProvider","instruments","exportTimer","exportInterval","provider","counter","c","description","add","dataPoints","createCounter","histogram","h","record","createHistogram","gauge","g","set","createGauge","formatOtlpMetrics","toOtlpAttributes","attrs","Object","entries","map","key","val","stringValue","boolValue","intValue","toNanos","ms","round","inst","dp","timeUnixNano","asDouble","metricData","sum","isMonotonic","aggregationTemporality","resourceMetrics","resource","scopeMetrics","scope","version","spans","resourceAttrs","SPAN_KIND_MAP","internal","server","client","producer","consumer","STATUS_CODE_MAP","unset","ok","error","otlpSpans","s","startTimeUnixNano","endTimeUnixNano","e","resourceSpans","scopeSpans","async","url","startsWith","parsed","URL","window","location","href","protocol","hostname","assertSecureUrl","fetch","method","JSON","stringify"],"mappings":"AAqCA,SAASA,IAEL,MAAM,IAAIC,MACR,uFAIN,CCfA,SAASC,EAAYC,GACnB,MAAMC,EAAM,IAAIC,WAAWF,GAC3B,IAEEG,OAAOC,gBAAgBH,EACzB,CAAE,MAEA,IAAK,IAAII,EAAI,EAAGA,EAAIL,EAAQK,IAC1BJ,EAAII,GAAKC,KAAKC,MAAsB,IAAhBD,KAAKE,SAE7B,CACA,OAAOP,CACT,CAEA,SAASQ,EAAWC,GAClB,IAAIC,EAAM,GACV,IAAK,IAAIN,EAAI,EAAGA,EAAIK,EAAMV,OAAQK,IAChCM,IAAQD,EAAML,IAAM,GAAGO,SAAS,IAAIC,SAAS,EAAG,KAElD,OAAOF,CACT,UAGgBG,IACd,OAAOL,EAAWV,EAAY,IAChC,UAGgBgB,IACd,OAAON,EAAWV,EAAY,GAChC,CAIA,MAAMiB,EAAiB,8DAQjB,SAAUC,EAAiBC,GAC/B,MAAMC,EAAQH,EAAeI,KAAKF,EAAOG,QACzC,IAAKF,EAAO,OAAO,KAEnB,MAAMG,EAAUH,EAAM,GAChBI,EAASJ,EAAM,GACfK,EAAaL,EAAM,GAGzB,MA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KAAM,sBAAuB8G,QAAS,SAC/CC,MAAOY,MAMnB,CAKOO,eAAepF,EACpBqF,EACA9E,EACAH,GAEA,KCpUI,SAA0BiF,GAE9B,GAAIA,EAAIC,WAAW,MACjB,MAAM,IAAInK,MACR,gDAAgDkK,wCAKpD,GAAIA,EAAIC,WAAW,MAAQD,EAAIC,WAAW,OAASD,EAAIC,WAAW,OAChE,OAIF,GAAID,EAAIC,WAAW,SACjB,OAIF,IAAIC,EACJ,IACEA,EAAS,IAAIC,IAAIH,EAAuB,oBAAXI,OAAyBA,OAAOC,SAASC,UAAO1G,EAC/E,CAAE,MAEA,MACF,CAGA,GAAwB,WAApBsG,EAAOK,UAKa,cAApBL,EAAOM,UAAgD,cAApBN,EAAOM,SAK9C,MAAM,IAAI1K,MACR,uCAAuCkK,0IAK3C,CDyRIS,CAAgBT,SACVU,MAAMV,EAAK,CACfW,OAAQ,OACRzF,QAAS,CACP,eAAgB,sBACbA,GAELH,KAAM6F,KAAKC,UAAU9F,IAEzB,CAAE,MAGF,CACF"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/telemetry/tracing.ts"],
4
+ "sourcesContent": ["// ============================================================================\n// SpecifyJS Telemetry \u2014 Distributed Tracing (OpenTelemetry-compatible)\n// Zero third-party dependencies \u2014 OTEL protocols implemented from scratch.\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { useEffect, useRef } from '../hooks/index';\n\n// ---------------------------------------------------------------------------\n// Trace Context \u2014 W3C Trace Context propagation\n// ---------------------------------------------------------------------------\n\n/** 16-byte (32 hex char) trace identifier. */\nexport type TraceId = string;\n\n/** 8-byte (16 hex char) span identifier. */\nexport type SpanId = string;\n\n/** W3C Trace Context carrier. */\nexport interface TraceContext {\n traceId: TraceId;\n spanId: SpanId;\n traceFlags: string;\n parentSpanId?: SpanId;\n}\n\n// -- ID generation ----------------------------------------------------------\n\nfunction randomBytes(length: number): Uint8Array {\n const buf = new Uint8Array(length);\n try {\n // Works in browsers and Node >=15 (globalThis.crypto)\n crypto.getRandomValues(buf);\n } catch {\n /* v8 ignore next 3 -- fallback for environments without Web Crypto */\n for (let i = 0; i < length; i++) {\n buf[i] = Math.floor(Math.random() * 256);\n }\n }\n return buf;\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += (bytes[i] ?? 0).toString(16).padStart(2, '0');\n }\n return hex;\n}\n\n/** Generate a 32-hex-char trace ID (16 random bytes). */\nexport function generateTraceId(): TraceId {\n return bytesToHex(randomBytes(16));\n}\n\n/** Generate a 16-hex-char span ID (8 random bytes). */\nexport function generateSpanId(): SpanId {\n return bytesToHex(randomBytes(8));\n}\n\n// -- W3C traceparent parsing / formatting -----------------------------------\n\nconst TRACEPARENT_RE = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;\n\n/**\n * Parse a W3C `traceparent` header.\n *\n * Format: `{version}-{traceId}-{spanId}-{traceFlags}`\n * Returns `null` when the header is invalid.\n */\nexport function parseTraceparent(header: string): TraceContext | null {\n const match = TRACEPARENT_RE.exec(header.trim());\n if (!match) return null;\n\n const traceId = match[2]!;\n const spanId = match[3]!;\n const traceFlags = match[4]!;\n\n // All-zero trace/span IDs are invalid per the spec.\n if (/^0+$/.test(traceId) || /^0+$/.test(spanId)) return null;\n\n return { traceId, spanId, traceFlags };\n}\n\n/**\n * Format a {@link TraceContext} as a W3C `traceparent` header string.\n *\n * Output: `00-{traceId}-{spanId}-{traceFlags}`\n */\nexport function formatTraceparent(ctx: TraceContext): string {\n return `00-${ctx.traceId}-${ctx.spanId}-${ctx.traceFlags}`;\n}\n\n// ---------------------------------------------------------------------------\n// Spans\n// ---------------------------------------------------------------------------\n\nexport type SpanKind = 'internal' | 'server' | 'client' | 'producer' | 'consumer';\n\nexport interface SpanStatus {\n code: 'unset' | 'ok' | 'error';\n message?: string;\n}\n\nexport interface SpanEvent {\n name: string;\n timestamp: number;\n attributes?: Record<string, string | number | boolean>;\n}\n\nexport interface Span {\n traceId: TraceId;\n spanId: SpanId;\n parentSpanId?: SpanId;\n name: string;\n kind: SpanKind;\n startTime: number;\n endTime?: number;\n status: SpanStatus;\n attributes: Record<string, string | number | boolean>;\n events: SpanEvent[];\n}\n\nexport interface StartSpanOptions {\n kind?: SpanKind;\n parentSpanId?: SpanId;\n traceId?: TraceId;\n attributes?: Record<string, string | number | boolean>;\n}\n\n/**\n * Create and start a new span. The span is **not** automatically associated\n * with a tracer \u2014 use {@link Tracer.startSpan} for automatic parent tracking.\n */\nexport function startSpan(name: string, opts?: StartSpanOptions): Span {\n return {\n traceId: opts?.traceId ?? generateTraceId(),\n spanId: generateSpanId(),\n parentSpanId: opts?.parentSpanId,\n name,\n kind: opts?.kind ?? 'internal',\n startTime: performance.now(),\n status: { code: 'unset' },\n attributes: opts?.attributes ? { ...opts.attributes } : {},\n events: [],\n };\n}\n\n/** End a span by recording its end time. */\nexport function endSpan(span: Span): void {\n span.endTime = performance.now();\n}\n\n// ---------------------------------------------------------------------------\n// Tracer\n// ---------------------------------------------------------------------------\n\nexport interface TracerConfig {\n serviceName: string;\n serviceVersion?: string;\n endpoint?: string;\n headers?: Record<string, string>;\n batchSize?: number;\n flushInterval?: number;\n}\n\nexport interface Tracer {\n /** Create a span, automatically parented to the current active span. */\n startSpan(name: string, opts?: StartSpanOptions): Span;\n\n /**\n * Execute `fn` with `span` as the active span. The span is automatically\n * ended when `fn` completes (sync or async). The previous active span is\n * restored afterward.\n */\n withSpan<T>(span: Span, fn: () => T): T;\n\n /** Export all pending (buffered) spans to the configured endpoint. */\n flush(): Promise<void>;\n\n /** Access the currently-active span (top of the span stack), or `undefined`. */\n activeSpan(): Span | undefined;\n\n /** Read-only view of the pending span buffer. */\n readonly pendingSpans: ReadonlyArray<Span>;\n\n /** Tracer configuration. */\n readonly config: Readonly<TracerConfig>;\n}\n\nexport function createTracer(config: TracerConfig): Tracer {\n const MAX_BUFFER_SIZE = config.batchSize ?? 1000;\n const spanStack: Span[] = [];\n const buffer: Span[] = [];\n\n function bufferSpan(span: Span): void {\n if (buffer.length >= MAX_BUFFER_SIZE) {\n buffer.splice(0, Math.floor(MAX_BUFFER_SIZE / 2)); // drop oldest half\n }\n buffer.push(span);\n }\n\n // Auto-flush timer (if configured)\n let flushTimer: ReturnType<typeof setInterval> | undefined;\n if (config.flushInterval && config.flushInterval > 0) {\n flushTimer = setInterval(() => {\n void tracer.flush();\n }, config.flushInterval);\n // Allow the process to exit even if the timer is running (Node.js).\n if (typeof flushTimer === 'object' && 'unref' in flushTimer) {\n (flushTimer as { unref: () => void }).unref();\n }\n }\n\n const tracer: Tracer = {\n config,\n\n get pendingSpans(): ReadonlyArray<Span> {\n return buffer;\n },\n\n activeSpan(): Span | undefined {\n return spanStack.length > 0 ? spanStack[spanStack.length - 1] : undefined;\n },\n\n startSpan(name: string, opts?: StartSpanOptions): Span {\n const active = tracer.activeSpan();\n const span = startSpan(name, {\n kind: opts?.kind,\n attributes: opts?.attributes,\n traceId: opts?.traceId ?? active?.traceId,\n parentSpanId: opts?.parentSpanId ?? active?.spanId,\n });\n spanStack.push(span);\n return span;\n },\n\n withSpan<T>(span: Span, fn: () => T): T {\n // Only push if not already on the stack (startSpan may have pushed it).\n const alreadyOnStack = spanStack.includes(span);\n if (!alreadyOnStack) {\n spanStack.push(span);\n }\n\n const removeFromStack = (): void => {\n // Remove ALL occurrences of the span from the stack.\n for (let i = spanStack.length - 1; i >= 0; i--) {\n if (spanStack[i] === span) {\n spanStack.splice(i, 1);\n }\n }\n };\n\n try {\n const result = fn();\n // Handle thenables (Promises) without importing anything.\n if (result && typeof (result as unknown as Promise<unknown>).then === 'function') {\n return (result as unknown as Promise<unknown>).then(\n (value) => {\n endSpan(span);\n bufferSpan(span);\n removeFromStack();\n return value;\n },\n (err) => {\n span.status = { code: 'error', message: String(err) };\n endSpan(span);\n bufferSpan(span);\n removeFromStack();\n throw err;\n },\n ) as unknown as T;\n }\n endSpan(span);\n bufferSpan(span);\n removeFromStack();\n return result;\n } catch (err) {\n span.status = { code: 'error', message: String(err) };\n endSpan(span);\n bufferSpan(span);\n removeFromStack();\n throw err;\n }\n },\n\n async flush(): Promise<void> {\n if (buffer.length === 0) return;\n\n const toExport = buffer.splice(0, buffer.length);\n\n if (config.endpoint) {\n // Lazy-import format helper to avoid circular deps at module level.\n const { formatOtlpTraces, exportToEndpoint } = await import('./metrics');\n const body = formatOtlpTraces(toExport, config.serviceName, config.serviceVersion);\n await exportToEndpoint(config.endpoint, config.headers ?? {}, body);\n }\n },\n };\n\n return tracer;\n}\n\n// ---------------------------------------------------------------------------\n// useTracing hook\n// ---------------------------------------------------------------------------\n\n/**\n * Hook that creates a span for the component render lifecycle.\n * Auto-starts on mount, records render duration, ends on unmount.\n */\nexport function useTracing(tracer: Tracer, name: string): void {\n const spanRef = useRef<Span | null>(null);\n\n useEffect(() => {\n // Mount \u2014 start span\n const span = tracer.startSpan(name, { kind: 'internal' });\n span.events.push({ name: 'mount', timestamp: performance.now() });\n spanRef.current = span;\n\n return () => {\n // Unmount \u2014 end span\n if (spanRef.current) {\n spanRef.current.events.push({ name: 'unmount', timestamp: performance.now() });\n endSpan(spanRef.current);\n }\n };\n }, []);\n}\n"],
5
+ "mappings": ";oMA6BA,SAASA,EAAYC,EAA4B,CAC/C,IAAMC,EAAM,IAAI,WAAWD,CAAM,EACjC,GAAI,CAEF,OAAO,gBAAgBC,CAAG,CAC5B,MAAQ,CAEN,QAASC,EAAI,EAAGA,EAAIF,EAAQE,IAC1BD,EAAIC,CAAC,EAAI,KAAK,MAAM,KAAK,OAAO,EAAI,GAAG,CAE3C,CACA,OAAOD,CACT,CAEA,SAASE,EAAWC,EAA2B,CAC7C,IAAIC,EAAM,GACV,QAASH,EAAI,EAAGA,EAAIE,EAAM,OAAQF,IAChCG,IAAQD,EAAMF,CAAC,GAAK,GAAG,SAAS,EAAE,EAAE,SAAS,EAA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QAAS,OAAOc,CAAG,CAAE,EACpDf,EAAQC,CAAI,EACZM,EAAWN,CAAI,EACfW,EAAgB,EACVG,CACR,CACF,EAEA,MAAM,OAAuB,CAC3B,GAAIT,EAAO,SAAW,EAAG,OAEzB,IAAMU,EAAWV,EAAO,OAAO,EAAGA,EAAO,MAAM,EAE/C,GAAIH,EAAO,SAAU,CAEnB,GAAM,CAAE,iBAAAc,EAAkB,iBAAAC,CAAiB,EAAI,KAAM,QAAO,+BAAW,EACjEC,EAAOF,EAAiBD,EAAUb,EAAO,YAAaA,EAAO,cAAc,EACjF,MAAMe,EAAiBf,EAAO,SAAUA,EAAO,SAAW,CAAC,EAAGgB,CAAI,CACpE,CACF,CACF,EAEA,OAAOV,CACT,CAUO,SAASW,EAAWX,EAAgBX,EAAoB,CAC7D,IAAMuB,EAAUC,EAAoB,IAAI,EAExCC,EAAU,IAAM,CAEd,IAAMtB,EAAOQ,EAAO,UAAUX,EAAM,CAAE,KAAM,UAAW,CAAC,EACxD,OAAAG,EAAK,OAAO,KAAK,CAAE,KAAM,QAAS,UAAW,YAAY,IAAI,CAAE,CAAC,EAChEoB,EAAQ,QAAUpB,EAEX,IAAM,CAEPoB,EAAQ,UACVA,EAAQ,QAAQ,OAAO,KAAK,CAAE,KAAM,UAAW,UAAW,YAAY,IAAI,CAAE,CAAC,EAC7ErB,EAAQqB,EAAQ,OAAO,EAE3B,CACF,EAAG,CAAC,CAAC,CACP",
6
+ "names": ["randomBytes", "length", "buf", "i", "bytesToHex", "bytes", "hex", "generateTraceId", "generateSpanId", "TRACEPARENT_RE", "parseTraceparent", "header", "match", "traceId", "spanId", "traceFlags", "formatTraceparent", "ctx", "startSpan", "name", "opts", "endSpan", "span", "createTracer", "config", "MAX_BUFFER_SIZE", "spanStack", "buffer", "bufferSpan", "flushTimer", "tracer", "active", "fn", "removeFromStack", "result", "value", "err", "toExport", "formatOtlpTraces", "exportToEndpoint", "body", "useTracing", "spanRef", "useRef", "useEffect"]
7
+ }
@@ -1,2 +1,3 @@
1
- "use strict";const e=Symbol.for("spec.element"),t=Symbol.for("spec.fragment"),n=Symbol.for("spec.provider"),o=Symbol.for("spec.consumer"),r=Symbol.for("spec.forward_ref"),s=Symbol.for("spec.memo"),a=Symbol.for("spec.lazy"),c=Symbol.for("spec.suspense"),u=Symbol.for("spec.strict_mode"),i=Symbol.for("spec.profiler");function l(t,n,...o){let r=null,s=null;const a={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(s=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(a[e]=n[e])}if(1===o.length?a.children=o[0]:o.length>1&&(a.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===a[t]&&(a[t]=e[t])}return{$$typeof:e,type:t,props:a,key:r,ref:s}}const p=t;function f(e){const t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:n,_context:t},s={$$typeof:o,_context:t};return t.Provider=r,t.Consumer=s,t}function h(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}function d(e){const t=[],n=[e];for(;n.length>0;){const e=n.pop();if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)n.push(e[t]);else t.push(e)}return t}const m={map:function(e,t){const n=d(e),o=[];for(let e=0;e<n.length;e++){const r=n[e];null!=r&&"boolean"!=typeof r&&o.push(t(r,e))}return o},forEach:function(e,t){const n=d(e);let o=0;for(const e of n)null!=e&&"boolean"!=typeof e&&t(e,o++)},count:function(e){const t=d(e);let n=0;for(const e of t)null!=e&&"boolean"!=typeof e&&n++;return n},only:function(e){if(!h(e))throw new Error("Children.only: expected a single SpecifyJS element child");return e},toArray:function(e){return d(e).filter(e=>null!=e&&"boolean"!=typeof e)}};class y{constructor(e){this._fiber=null,this._pendingState=[],this._forceUpdate=!1,this.props=e,this.state={},this.context=void 0}setState(e,t){this._pendingState.push(e),this._enqueueUpdate(t)}forceUpdate(e){this._forceUpdate=!0,this._enqueueUpdate(e)}render(){return null}_enqueueUpdate(e){}}y.prototype.isSpecComponent=!0;class x extends y{shouldComponentUpdate(e,t){return!w(this.props,e)||!w(this.state,t)}}function w(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;const r=e,s=t;for(const e of n)if(!Object.prototype.hasOwnProperty.call(s,e)||!Object.is(r[e],s[e]))return!1;return!0}function g(e){return e.replace(/["\\]/g,"\\$&")}function b(e,t,n){const o=`meta[${e}="${g(t)}"]`;let r=document.querySelector(o);const s=null!==r,a=r?.content;return r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=n,()=>{s&&void 0!==a?r.content=a:s||r.remove()}}function v(e,t){const n=`meta[http-equiv="${g(e)}"]`;let o=document.querySelector(n);const r=null!==o,s=o?.content;return o||(o=document.createElement("meta"),o.setAttribute("http-equiv",e),document.head.appendChild(o)),o.content=t,()=>{r&&void 0!==s?o.content=s:r||o.remove()}}function S(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function _(e){return S().useState(e)}function E(e,t){return S().useEffect(e,t)}function C(e){return S().useContext(e)}function k(e,t){return S().useCallback(e,t)}function $(e,t){return S().useMemo(e,t)}function P(e){return S().useRef(e)}x.prototype.isPureSpecComponent=!0;const j=c,O=u,R=i,U=f({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function I(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}let L={pathname:I(),hash:"undefined"!=typeof window?window.location.hash:""};const F=new Set;function N(){L={pathname:I(),hash:"undefined"!=typeof window?window.location.hash:""};for(const e of F)e()}function q(){return L}function T(e){let t=e.length;for(;t>1&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function D(e,t,n){const o=n?.exact??!1,r="/"===e?"/":T(e),s="/"===t?"/":T(t);if("/"===r){const t="/"===s;return o&&!t?null:{params:{},isExact:t,path:e,url:"/"}}const a=r.split("/").filter(Boolean),c=s.split("/").filter(Boolean),u="*"===a[a.length-1];if(!u&&o&&c.length!==a.length)return null;if(!u&&c.length<a.length)return null;const i={},l=[];for(let t=0;t<a.length;t++){const n=a[t];if("*"===n){const n=c.slice(t).join("/");return i["*"]=n,{params:i,isExact:!0,path:e,url:"/"+c.join("/")}}if(t>=c.length)return null;const o=c[t];if(n.startsWith(":"))i[n.slice(1)]=decodeURIComponent(o),l.push(o);else{if(n.toLowerCase()!==o.toLowerCase())return null;l.push(o)}}const p="/"+l.join("/"),f=c.length===a.length;return o&&!f?null:{params:i,isExact:f,path:e,url:p}}"undefined"!=typeof window&&window.addEventListener("hashchange",N);let V=[],W=[];function A(){const e=W;W=[];for(const t of e)t()}function H(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:"))return;let t;try{t=new URL(e,"undefined"!=typeof window?window.location.href:void 0)}catch{return}if("https:"!==t.protocol&&"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname)throw new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}function J(e,t){return H("string"==typeof e?e:e instanceof URL?e.href:e.url),fetch(e,t)}const M=new Map,B=f({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});exports.Children=m,exports.Component=y,exports.ErrorBoundary=class extends y{static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(e){super(e),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){return this.state.hasError?this.props.fallback??null:this.props.children??null}},exports.FeatureFlagProvider=function(e){const[t,n]=_(()=>({...e.defaults})),[o,r]=_(!!e.url);E(()=>{if(!e.url)return;let t=!1;return r(!0),J(e.url).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{if(!t&&"object"==typeof e&&null!==e){const t={};for(const n of Object.keys(e))"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(t[n]=!0===e[n]);n(e=>({...e,...t}))}t||r(!1)}).catch(()=>{t||r(!1)}),()=>{t=!0}},[e.url]);const s=k((...e)=>{const n=e[0];return!0===t[n]},[t]),a=k((...e)=>{const t=e[0],o=e[1];n(e=>({...e,[t]:o}))},[]),c={flags:t,isEnabled:s,setFlag:a,loading:o};return l(B.Provider,{value:c},e.children)},exports.FeatureGate=function(e){const{isEnabled:t}=C(B);return t(e.flag)?e.children:e.fallback??null},exports.Fragment=p,exports.Link=function(e){const{to:t,className:n,activeClassName:o,exact:r,children:s,...a}=e,c=C(U),u=null!==D(t,c.pathname,{exact:r??!1}),i=k((...e)=>{e[0].preventDefault(),c.navigate(t)},[t,c.navigate]),p=[n,u?o:null].filter(Boolean).join(" ")||void 0;return l("a",{...a,href:"#"+t,onClick:i,className:p},s)},exports.Profiler=R,exports.PureComponent=x,exports.Route=function(e){const t=C(U),n=D(t.basePath+e.path,t.pathname,{exact:e.exact??!1}),o=$(()=>({pathname:t.pathname,params:{...t.params,...n?n.params:{}},navigate:t.navigate,basePath:n?n.url:t.basePath}),[t.pathname,t.navigate,t.params,t.basePath,n]);if(!n)return null;for(const e of Object.keys(t.params))e in o.params||(o.params[e]=t.params[e]);const r=e.component?l(e.component,{...o.params}):e.children;return l(U.Provider,{value:o},r)},exports.Router=function(e){const[t,n]=_(()=>q().pathname);E(()=>{var e;return n(q().pathname),e=()=>{n(q().pathname)},F.add(e),()=>{F.delete(e)}},[]);const o=k((...e)=>{!function(e,t){const n=e.startsWith("#")?e:"#"+e;if(t?.replace){const e=window.location.pathname+window.location.search+n;window.history.replaceState(null,"",e)}else window.location.hash=n;N()}(e[0],e[1])},[]),r=$(()=>({pathname:t,params:{},navigate:o,basePath:""}),[t,o]);return l(U.Provider,{value:r},e.children)},exports.StrictMode=O,exports.Suspense=j,exports.act=function(e){const t=e();A(),t&&"function"==typeof t.then&&t.then(()=>{A()})},exports.assertSecureUrl=H,exports.cloneElement=function(t,n,...o){if(!h(t))throw new Error("cloneElement: argument must be a valid SpecifyJS element");let r=t.key,s=t.ref;const a={...t.props};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(s=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(a[e]=n[e])}return 1===o.length?a.children=o[0]:o.length>1&&(a.children=o),{$$typeof:e,type:t.type,props:a,key:r,ref:s}},exports.createContext=f,exports.createElement=l,exports.createFactory=function(e){return(t,...n)=>l(e,t??null,...n)},exports.createRef=function(){return{current:null}},exports.forwardRef=function(e){return{$$typeof:r,render:e,displayName:e.displayName||e.name||"ForwardRef"}},exports.getComponentTypeTable=function(){return M},exports.h=l,exports.isValidElement=h,exports.lazy=function(e){const t={_status:"pending",_result:void 0};return{$$typeof:a,_payload:t,_init:()=>{if("resolved"===t._status)return t._result;if("rejected"===t._status)throw t._result;const n=e();throw t._status="pending",n.then(e=>{t._status="resolved",t._result=e.default},e=>{t._status="rejected",t._result=e}),n},displayName:"Lazy"}},exports.matchPath=D,exports.memo=function(e,t){return{$$typeof:s,type:e,compare:t||null,displayName:e.displayName||e.name||"Memo"}},exports.resolveComponentId=function(e){const t=e.match(/^s-(\d+)-(\d+)$/);if(!t||!t[1]||!t[2])return null;const n=parseInt(t[1],10),o=parseInt(t[2],10);for(const e of M.values())if(e.index===n)return{typeName:e.name,typeIndex:n,instanceId:o};return null},exports.secureFetch=J,exports.setComponentIdsEnabled=function(e){},exports.startTransition=function(e){try{e()}finally{!function(){const e=V;V=[];for(const t of e)t()}()}},exports.useCallback=k,exports.useContext=C,exports.useDebugValue=function(e,t){return S().useDebugValue(e,t)},exports.useDeferredValue=function(e){return S().useDeferredValue(e)},exports.useEffect=E,exports.useFeatureFlags=function(){return C(B)},exports.useHead=function(e){const t=P(e);t.current=e,E(()=>{const e=t.current,n=[],o=document.title;if(e.title&&(document.title=e.title,n.push(()=>{document.title=o})),e.description&&n.push(b("name","description",e.description)),e.keywords&&n.push(b("name","keywords",e.keywords)),e.author&&n.push(b("name","author",e.author)),e.canonical){const t=document.createElement("link");t.rel="canonical",t.href=e.canonical,document.head.appendChild(t),n.push(()=>t.remove())}if(e.og)for(const[t,o]of Object.entries(e.og))n.push(b("property",`og:${t}`,o));if(e.twitter)for(const[t,o]of Object.entries(e.twitter))n.push(b("name",`twitter:${t}`,o));if(e.httpEquiv){const t={csp:"Content-Security-Policy",referrer:"Referrer-Policy",contentType:"X-Content-Type-Options",frameOptions:"X-Frame-Options",cacheControl:"Cache-Control"};for(const[o,r]of Object.entries(e.httpEquiv)){if(void 0===r)continue;const e=t[o]??o;n.push(v(e,r))}}if(e.meta)for(const t of e.meta)t.name?n.push(b("name",t.name,t.content)):t.property&&n.push(b("property",t.property,t.content));return()=>{for(const e of n)e()}},[JSON.stringify([e.title,e.description,e.keywords,e.author,e.canonical,e.og,e.twitter,e.httpEquiv,e.meta])])},exports.useId=function(){return S().useId()},exports.useImperativeHandle=function(e,t,n){return S().useImperativeHandle(e,t,n)},exports.useInsertionEffect=function(e,t){return S().useInsertionEffect(e,t)},exports.useLayoutEffect=function(e,t){return S().useLayoutEffect(e,t)},exports.useMemo=$,exports.useNavigate=function(){return C(U).navigate},exports.useParams=function(){return C(U).params},exports.useReducer=function(e,t,n){return S().useReducer(e,t,n)},exports.useRef=P,exports.useRouter=function(){return C(U)},exports.useState=_,exports.useSyncExternalStore=function(e,t,n){return S().useSyncExternalStore(e,t,n)},exports.useTransition=function(){return S().useTransition()};
1
+ /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
+ "use strict";var U=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Xe=(e,t)=>{for(var o in t)U(e,o,{get:t[o],enumerable:!0})},Ze=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ge(t))!Je.call(e,r)&&r!==o&&U(e,r,{get:()=>t[r],enumerable:!(n=We(t,r))||n.enumerable});return e};var Qe=e=>Ze(U({},"__esModule",{value:!0}),e);var ut={};Xe(ut,{Children:()=>xe,Component:()=>P,ErrorBoundary:()=>L,FeatureFlagProvider:()=>X,FeatureGate:()=>Z,Fragment:()=>ce,Link:()=>j,Profiler:()=>Le,PureComponent:()=>w,Route:()=>A,Router:()=>Y,StrictMode:()=>Ne,Suspense:()=>_e,act:()=>He,assertSecureUrl:()=>G,cloneElement:()=>ye,createContext:()=>k,createElement:()=>d,createFactory:()=>ue,createRef:()=>le,forwardRef:()=>fe,getComponentTypeTable:()=>ze,h:()=>d,isValidElement:()=>R,lazy:()=>me,matchPath:()=>E,memo:()=>de,resolveComponentId:()=>Ke,secureFetch:()=>M,setComponentIdsEnabled:()=>Be,startTransition:()=>Ae,useCallback:()=>h,useContext:()=>l,useDebugValue:()=>ve,useDeferredValue:()=>Re,useEffect:()=>S,useFeatureFlags:()=>Q,useHead:()=>$,useId:()=>ke,useImperativeHandle:()=>ge,useInsertionEffect:()=>Te,useLayoutEffect:()=>Ee,useMemo:()=>b,useNavigate:()=>B,useParams:()=>q,useReducer:()=>Ce,useRef:()=>F,useRouter:()=>H,useState:()=>g,useSyncExternalStore:()=>we,useTransition:()=>be});module.exports=Qe(ut);var v=Symbol.for("spec.element"),ee=Symbol.for("spec.fragment"),lt=Symbol.for("spec.portal"),te=Symbol.for("spec.provider"),ne=Symbol.for("spec.consumer"),oe=Symbol.for("spec.forward_ref"),re=Symbol.for("spec.memo"),se=Symbol.for("spec.lazy"),ae=Symbol.for("spec.suspense"),ie=Symbol.for("spec.strict_mode"),pe=Symbol.for("spec.profiler");function d(e,t,...o){let n=null,r=null,a={};if(t!=null){t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}if(o.length===1?a.children=o[0]:o.length>1&&(a.children=o),typeof e=="function"&&e.defaultProps){let s=e.defaultProps;for(let i of Object.keys(s))i!=="__proto__"&&i!=="constructor"&&a[i]===void 0&&(a[i]=s[i])}return{$$typeof:v,type:e,props:a,key:n,ref:r}}function ue(e){return(t,...o)=>d(e,t??null,...o)}var ce=ee;function k(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},o={$$typeof:te,_context:t},n={$$typeof:ne,_context:t};return t.Provider=o,t.Consumer=n,t}function le(){return{current:null}}function fe(e){return{$$typeof:oe,render:e,displayName:e.displayName||e.name||"ForwardRef"}}function de(e,t){return{$$typeof:re,type:e,compare:t||null,displayName:e.displayName||e.name||"Memo"}}function me(e){let t={_status:"pending",_result:void 0};return{$$typeof:se,_payload:t,_init:()=>{if(t._status==="resolved")return t._result;if(t._status==="rejected")throw t._result;let n=e();throw t._status="pending",n.then(r=>{t._status="resolved",t._result=r.default},r=>{t._status="rejected",t._result=r}),n},displayName:"Lazy"}}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function ye(e,t,...o){if(!R(e))throw new Error("cloneElement: argument must be a valid SpecifyJS element");let n=e.key,r=e.ref,a={...e.props};if(t!=null){t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}return o.length===1?a.children=o[0]:o.length>1&&(a.children=o),{$$typeof:v,type:e.type,props:a,key:n,ref:r}}function N(e){let t=[],o=[e];for(;o.length>0;){let n=o.pop();if(Array.isArray(n))for(let r=n.length-1;r>=0;r--)o.push(n[r]);else t.push(n)}return t}function et(e,t){let o=N(e),n=[];for(let r=0;r<o.length;r++){let a=o[r];a==null||typeof a=="boolean"||n.push(t(a,r))}return n}function tt(e,t){let o=N(e),n=0;for(let r of o)r==null||typeof r=="boolean"||t(r,n++)}function nt(e){let t=N(e),o=0;for(let n of t)n!=null&&typeof n!="boolean"&&o++;return o}function ot(e){if(!R(e))throw new Error("Children.only: expected a single SpecifyJS element child");return e}function rt(e){return N(e).filter(o=>o!=null&&typeof o!="boolean")}var xe={map:et,forEach:tt,count:nt,only:ot,toArray:rt};var P=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,o){this._pendingState.push(t),this._enqueueUpdate(o)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};P.prototype.isSpecComponent=!0;var w=class extends P{shouldComponentUpdate(t,o){return!he(this.props,t)||!he(this.state,o)}};w.prototype.isPureSpecComponent=!0;function he(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;let r=e,a=t;for(let s of o)if(!Object.prototype.hasOwnProperty.call(a,s)||!Object.is(r[s],a[s]))return!1;return!0}var L=class extends P{static getDerivedStateFromError(t){return{hasError:!0,error:t}}constructor(t){super(t),this.state={hasError:!1,error:null}}componentDidCatch(t,o){this.props.onError?.(t,o)}render(){return this.state.hasError?this.props.fallback??null:this.props.children??null}};function $(e){let t=F(e);t.current=e;let o=JSON.stringify([e.title,e.description,e.keywords,e.author,e.canonical,e.og,e.twitter,e.httpEquiv,e.meta]);S(()=>{let n=t.current,r=[],a=document.title;if(n.title&&(document.title=n.title,r.push(()=>{document.title=a})),n.description&&r.push(C("name","description",n.description)),n.keywords&&r.push(C("name","keywords",n.keywords)),n.author&&r.push(C("name","author",n.author)),n.canonical){let s=document.createElement("link");s.rel="canonical",s.href=n.canonical,document.head.appendChild(s),r.push(()=>s.remove())}if(n.og)for(let[s,i]of Object.entries(n.og))r.push(C("property",`og:${s}`,i));if(n.twitter)for(let[s,i]of Object.entries(n.twitter))r.push(C("name",`twitter:${s}`,i));if(n.httpEquiv){let s={csp:"Content-Security-Policy",referrer:"Referrer-Policy",contentType:"X-Content-Type-Options",frameOptions:"X-Frame-Options",cacheControl:"Cache-Control"};for(let[i,u]of Object.entries(n.httpEquiv)){if(u===void 0)continue;let p=s[i]??i;r.push(st(p,u))}}if(n.meta)for(let s of n.meta)s.name?r.push(C("name",s.name,s.content)):s.property&&r.push(C("property",s.property,s.content));return()=>{for(let s of r)s()}},[o])}function Pe(e){return e.replace(/["\\]/g,"\\$&")}function C(e,t,o){let n=`meta[${e}="${Pe(t)}"]`,r=document.querySelector(n),a=r!==null,s=r?.content;return r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=o,()=>{a&&s!==void 0?r.content=s:a||r.remove()}}function st(e,t){let o=`meta[http-equiv="${Pe(e)}"]`,n=document.querySelector(o),r=n!==null,a=n?.content;return n||(n=document.createElement("meta"),n.setAttribute("http-equiv",e),document.head.appendChild(n)),n.content=t,()=>{r&&a!==void 0?n.content=a:r||n.remove()}}var Se=null;function c(){if(Se===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Se}function g(e){return c().useState(e)}function S(e,t){return c().useEffect(e,t)}function l(e){return c().useContext(e)}function Ce(e,t,o){return c().useReducer(e,t,o)}function h(e,t){return c().useCallback(e,t)}function b(e,t){return c().useMemo(e,t)}function F(e){return c().useRef(e)}function ge(e,t,o){return c().useImperativeHandle(e,t,o)}function Ee(e,t){return c().useLayoutEffect(e,t)}function ve(e,t){return c().useDebugValue(e,t)}function ke(){return c().useId()}function Re(e){return c().useDeferredValue(e)}function be(){return c().useTransition()}function we(e,t,o){return c().useSyncExternalStore(e,t,o)}function Te(e,t){return c().useInsertionEffect(e,t)}var _e=ae;var Ne=ie;var Le=pe;var m=k({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Fe(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""},V=new Set;function Me(){Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""};for(let e of V)e()}typeof window<"u"&&window.addEventListener("hashchange",Me);function Oe(e){return V.add(e),()=>{V.delete(e)}}function I(){return Ie}function De(e,t){let o=e.startsWith("#")?e:"#"+e;if(t?.replace){let n=window.location.pathname+window.location.search+o;window.history.replaceState(null,"",n)}else window.location.hash=o;Me()}function Y(e){let[t,o]=g(()=>I().pathname);S(()=>(o(I().pathname),Oe(()=>{o(I().pathname)})),[]);let n=h((...a)=>{De(a[0],a[1])},[]),r=b(()=>({pathname:t,params:{},navigate:n,basePath:""}),[t,n]);return d(m.Provider,{value:r},e.children)}function Ue(e){let t=e.length;for(;t>1&&e.charCodeAt(t-1)===47;)t--;return t===e.length?e:e.slice(0,t)}function E(e,t,o){let n=o?.exact??!1,r=e==="/"?"/":Ue(e),a=t==="/"?"/":Ue(t);if(r==="/"){let x=a==="/";return n&&!x?null:{params:{},isExact:x,path:e,url:"/"}}let s=r.split("/").filter(Boolean),i=a.split("/").filter(Boolean),u=s[s.length-1]==="*";if(!u&&n&&i.length!==s.length||!u&&i.length<s.length)return null;let p={},y=[];for(let x=0;x<s.length;x++){let T=s[x];if(T==="*"){let D=i.slice(x).join("/");return p["*"]=D,{params:p,isExact:!0,path:e,url:"/"+i.join("/")}}if(x>=i.length)return null;let _=i[x];if(T.startsWith(":")){let D=T.slice(1);p[D]=decodeURIComponent(_),y.push(_);continue}if(T.toLowerCase()!==_.toLowerCase())return null;y.push(_)}let f="/"+y.join("/"),O=i.length===s.length;return n&&!O?null:{params:p,isExact:O,path:e,url:f}}function A(e){let t=l(m),o=t.basePath+e.path,n=E(o,t.pathname,{exact:e.exact??!1}),r=b(()=>({pathname:t.pathname,params:{...t.params,...n?n.params:{}},navigate:t.navigate,basePath:n?n.url:t.basePath}),[t.pathname,t.navigate,t.params,t.basePath,n]);if(!n)return null;for(let s of Object.keys(t.params))s in r.params||(r.params[s]=t.params[s]);let a=e.component?d(e.component,{...r.params}):e.children;return d(m.Provider,{value:r},a)}function j(e){let{to:t,className:o,activeClassName:n,exact:r,children:a,...s}=e,i=l(m),u=E(t,i.pathname,{exact:r??!1})!==null,p=h(((...f)=>{f[0].preventDefault(),i.navigate(t)}),[t,i.navigate]),y=[o,u?n:null].filter(Boolean).join(" ")||void 0;return d("a",{...s,href:"#"+t,onClick:p,className:y},a)}function H(){return l(m)}function q(){return l(m).params}function B(){return l(m).navigate}var $e=8;function Ve(){let e=$e;return $e=e===8?16:8,e}var K=4,z=!1;var Ye=[];function Ae(e){let t=K,o=z;K=Ve(),z=!0;try{e()}finally{K=t,z=o,it()}}function it(){let e=Ye;Ye=[];for(let t of e)t()}var je=[];function W(){let e=je;je=[];for(let t of e)t()}function He(e){let t=e();W(),t&&typeof t.then=="function"&&t.then(()=>{W()})}function G(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("data:"))return;let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{return}if(t.protocol!=="https:"&&!(t.hostname==="localhost"||t.hostname==="127.0.0.1"))throw new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}function M(e,t){let o=typeof e=="string"?e:e instanceof URL?e.href:e.url;return G(o),fetch(e,t)}var qe=new Map;var pt=!0;function Be(e){pt=e}function Ke(e){let t=e.match(/^s-(\d+)-(\d+)$/);if(!t||!t[1]||!t[2])return null;let o=parseInt(t[1],10),n=parseInt(t[2],10);for(let r of qe.values())if(r.index===o)return{typeName:r.name,typeIndex:o,instanceId:n};return null}function ze(){return qe}var J=k({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function X(e){let[t,o]=g(()=>({...e.defaults})),[n,r]=g(!!e.url);S(()=>{if(!e.url)return;let u=!1;return r(!0),M(e.url).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>{if(!u&&typeof p=="object"&&p!==null){let y={};for(let f of Object.keys(p))f!=="__proto__"&&f!=="constructor"&&f!=="prototype"&&(y[f]=p[f]===!0);o(f=>({...f,...y}))}u||r(!1)}).catch(()=>{u||r(!1)}),()=>{u=!0}},[e.url]);let a=h(((...u)=>{let p=u[0];return t[p]===!0}),[t]),s=h(((...u)=>{let p=u[0],y=u[1];o(f=>({...f,[p]:y}))}),[]),i={flags:t,isEnabled:a,setFlag:s,loading:n};return d(J.Provider,{value:i},e.children)}function Z(e){let{isEnabled:t}=l(J);return t(e.flag)?e.children:e.fallback??null}function Q(){return l(J)}
2
3
  //# sourceMappingURL=specifyjs.cjs.js.map