@alexkroman1/aai-ui 6.1.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/upload-progress.d.ts +52 -0
- package/dist/default-client/assets/index-BZlePk3y.css +2 -0
- package/dist/default-client/assets/{index-4u908fff.js → index-aXDcAQ6M.js} +2 -2
- package/dist/default-client/assets/{playback-processor-DUsmALNH.js → playback-processor-DwQ9tE7X.js} +6 -10
- package/dist/default-client/index.html +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +170 -9
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/dist/use-workflow-form.d.ts +31 -0
- package/dist/worklets/_playback-bench-harness.d.ts +181 -0
- package/dist/worklets/_playback-bench-host.d.ts +63 -0
- package/dist/worklets/_playback-bench-page.d.ts +65 -0
- package/dist/worklets/_tts-trace-harness.d.ts +142 -0
- package/dist/worklets/_worklet-test-utils.d.ts +27 -0
- package/dist/worklets/playback-processor.d.ts +1 -1
- package/dist/worklets/playback-processor.js +7 -11
- package/package.json +2 -2
- package/dist/default-client/assets/index-CDugAuLK.css +0 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UploadStatus } from "../use-workflow-form.ts";
|
|
3
|
+
/**
|
|
4
|
+
* How far a form's files have got, rendered as a bar.
|
|
5
|
+
*
|
|
6
|
+
* The wait this covers is the one a run cannot describe: a workflow run does not
|
|
7
|
+
* EXIST until its input is stored, so from the moment a form is submitted until
|
|
8
|
+
* the last byte lands there is no run id, no status, and nothing for
|
|
9
|
+
* `<WorkflowProgress>` to read — which for a 200 MB recording is minutes of a
|
|
10
|
+
* page that looks stuck. `useWorkflowSubmit` reports the bytes as they go and
|
|
11
|
+
* this is what draws them.
|
|
12
|
+
*
|
|
13
|
+
* Three things it decides, so a page does not:
|
|
14
|
+
*
|
|
15
|
+
* - **It renders nothing when there is nothing to describe.** `upload` is
|
|
16
|
+
* undefined before the first byte and again from the moment the last one
|
|
17
|
+
* lands, so `<UploadProgressBar upload={upload} />` is correct unguarded and a
|
|
18
|
+
* form with no files never shows a bar at all.
|
|
19
|
+
* - **An unknown total is INDETERMINATE, not zero.** A body whose length the
|
|
20
|
+
* transport cannot state up front (see `UploadProgress.total`) has no honest
|
|
21
|
+
* width, and a bar pinned at 0% reads as an upload that is not moving.
|
|
22
|
+
* - **The file is NAMED, and counted when there is more than one.** Files are
|
|
23
|
+
* sent one after another, so a single bar otherwise appears to restart from
|
|
24
|
+
* zero partway through with nothing to say why.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { Form, SubmitButton, UploadProgressBar, useWorkflowSubmit, WorkflowFields } from "@alexkroman1/aai-ui";
|
|
29
|
+
*
|
|
30
|
+
* function TranscribeForm() {
|
|
31
|
+
* const { submit, upload, pending, error } = useWorkflowSubmit("transcribe");
|
|
32
|
+
* return (
|
|
33
|
+
* <Form onSubmit={(values) => submit(values)} error={error}>
|
|
34
|
+
* <WorkflowFields workflow="transcribe" />
|
|
35
|
+
* <UploadProgressBar upload={upload} />
|
|
36
|
+
* <SubmitButton pending={pending}>Transcribe</SubmitButton>
|
|
37
|
+
* </Form>
|
|
38
|
+
* );
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param upload - What `useWorkflowSubmit` reports. `undefined` renders nothing,
|
|
43
|
+
* so a page may pass its state straight through.
|
|
44
|
+
* @param className - Replaces the default classes rather than extending them,
|
|
45
|
+
* so a custom chrome is not fighting a default it did not ask for.
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare function UploadProgressBar({ upload, className, }: {
|
|
50
|
+
upload?: UploadStatus | undefined;
|
|
51
|
+
className?: string | undefined;
|
|
52
|
+
}): ReactNode;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-aai:"Monument Grotesk", "ABC Monument Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-aai-serif:"Source Serif 4", "Source Serif Pro", Charter, "Iowan Old Style", Georgia, serif;--font-aai-mono:"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--radius-aai:4px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html,body{margin:0;padding:0}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.order-last{order:9999}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-9{height:calc(var(--spacing) * 9)}.h-11{height:calc(var(--spacing) * 11)}.h-\[7px\]{height:7px}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[40vh\]{max-height:40vh}.min-h-0{min-height:0}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-\[7px\]{width:7px}.w-fit{width:fit-content}.w-full{width:100%}.max-w-75{max-width:calc(var(--spacing) * 75)}.max-w-105{max-width:calc(var(--spacing) * 105)}.max-w-190{max-width:calc(var(--spacing) * 190)}.max-w-\[82\%\]{max-width:82%}.max-w-\[min\(78\%\,64ch\)\]{max-width:min(78%,64ch)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.\[scrollbar-width\:none\]{scrollbar-width:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-aai{border-radius:var(--radius-aai)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\(--aai-btn-bd\){border-color:var(--aai-btn-bd)}.bg-\(--aai-btn-bg\){background-color:var(--aai-btn-bg)}.bg-transparent{background-color:#0000}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-7{padding:calc(var(--spacing) * 7)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-aai{font-family:var(--font-aai)}.font-aai-mono{font-family:var(--font-aai-mono)}.font-aai-serif{font-family:var(--font-aai-serif)}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[22px\]{font-size:22px}.text-\[32px\]{font-size:32px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-\[23px\]{--tw-leading:23px;line-height:23px}.leading-\[130\%\]{--tw-leading:130%;line-height:130%}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.2px\]{--tw-tracking:-.2px;letter-spacing:-.2px}.tracking-\[1\.2px\]{--tw-tracking:1.2px;letter-spacing:1.2px}.tracking-\[1\.4px\]{--tw-tracking:1.4px;letter-spacing:1.4px}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-balance{text-wrap:balance}.wrap-break-word{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\(--aai-btn-fg\){color:var(--aai-btn-fg)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.file\:mr-3::file-selector-button{margin-right:calc(var(--spacing) * 3)}.file\:cursor-pointer::file-selector-button{cursor:pointer}.file\:rounded-aai::file-selector-button{border-radius:var(--radius-aai)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:px-3::file-selector-button{padding-inline:calc(var(--spacing) * 3)}.file\:py-1\.5::file-selector-button{padding-block:calc(var(--spacing) * 1.5)}.file\:font-aai::file-selector-button{font-family:var(--font-aai)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:\[color\:var\(--aai-file-button-fg\)\]::file-selector-button{color:var(--aai-file-button-fg)}.file\:\[background\:var\(--aai-file-button-bg\)\]::file-selector-button{background:var(--aai-file-button-bg)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}.focus-visible\:\[outline\:2px_solid\]:focus-visible{outline:2px solid}.focus-visible\:\[outline-offset\:2px\]:focus-visible{outline-offset:2px}@media (hover:hover){.enabled\:hover\:border-\(--aai-btn-bd-hover\):enabled:hover{border-color:var(--aai-btn-bd-hover)}.enabled\:hover\:bg-\(--aai-btn-bg-hover\):enabled:hover{background-color:var(--aai-btn-bg-hover)}.enabled\:hover\:text-\(--aai-btn-fg-hover\):enabled:hover{color:var(--aai-btn-fg-hover)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:ml-auto{margin-left:auto}.sm\:max-w-\[60\%\]{max-width:60%}.sm\:basis-auto{flex-basis:auto}.sm\:px-16{padding-inline:calc(var(--spacing) * 16)}.sm\:py-14{padding-block:calc(var(--spacing) * 14)}}@media (width>=48rem){.md\:order-none{order:0}.md\:h-screen{height:100vh}.md\:max-h-none{max-height:none}.md\:w-\(--aai-sidebar-w\){width:var(--aai-sidebar-w)}.md\:flex-row{flex-direction:row}.md\:border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.md\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.md\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}}}@keyframes aai-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.82)}}@keyframes aai-bounce{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes aai-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.tool-shimmer{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,currentColor 25%,#0000 50%,currentColor 75%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2s infinite aai-shimmer}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./audio-fO7SVU64.js","./client-audio-constants-Ck0IJO4c.js","./capture-processor-Dmc-KEpb.js","./_module-url-BX0RuRU2.js","./playback-processor-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./audio-fO7SVU64.js","./client-audio-constants-Ck0IJO4c.js","./capture-processor-Dmc-KEpb.js","./_module-url-BX0RuRU2.js","./playback-processor-DwQ9tE7X.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{t as e}from"./client-audio-constants-Ck0IJO4c.js";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function w(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return w(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return w(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return w(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=T,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.2.8`})),f=s(((e,t)=>{t.exports=d()})),p=s((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),m=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,ee||(ee=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var ee=!1,S=-1,C=5,te=-1;function w(){return g?!0:!(e.unstable_now()-te<C)}function ne(){if(g=!1,ee){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?T():ee=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,T()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),g=s(((e,t)=>{t.exports=h()})),_=s((e=>{var t=g(),n=f(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case te:return`Suspense`;case w:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case S:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},O=[],de=-1;function fe(e){return{current:e}}function pe(e){0>de||(e.current=O[de],O[de]=null,de--)}function k(e,t){de++,O[de]=e.current,e.current=t}var me=fe(null),he=fe(null),ge=fe(null),_e=fe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),k(me,e)}function ye(){pe(me),pe(he),pe(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Hd(t,e.type);t!==n&&(k(he,e),k(me,n))}function A(e){he.current===e&&(pe(me),pe(he)),_e.current===e&&(pe(_e),Qf._currentValue=ue)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -269,7 +269,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
269
269
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ch(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=bg.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Ag(){return{exit:{taskListCheckValueChecked:Mg,taskListCheckValueUnchecked:Mg,paragraph:Ng}}}function jg(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Pg}}}function Mg(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Ng(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Pg(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=bg.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Fg(){return[Vm(),dh(),gh(),xg(),Ag()]}function Ig(e){return{extensions:[Hm(),fh(e),_h(),kg(e),jg()]}}var Lg={tokenize:Zg,partial:!0},Rg={tokenize:Qg,partial:!0},zg={tokenize:$g,partial:!0},Bg={tokenize:e_,partial:!0},Vg={tokenize:t_,partial:!0},Hg={name:`wwwAutolink`,tokenize:Yg,previous:n_},Ug={name:`protocolAutolink`,tokenize:Xg,previous:r_},Wg={name:`emailAutolink`,tokenize:Jg,previous:i_},Gg={};function Kg(){return{text:Gg}}for(var qg=48;qg<123;)Gg[qg]=Wg,qg++,qg===58?qg=65:qg===91&&(qg=97);Gg[43]=Wg,Gg[45]=Wg,Gg[46]=Wg,Gg[95]=Wg,Gg[72]=[Wg,Ug],Gg[104]=[Wg,Ug],Gg[87]=[Wg,Hg],Gg[119]=[Wg,Hg];function Jg(e,t,n){let r=this,i,a;return o;function o(t){return!a_(t)||!i_.call(r,r.previous)||o_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return a_(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Vg,u,l)(t):t===45||t===95||Kl(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Gl(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Yg(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!n_.call(r,r.previous)||o_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Lg,e.attempt(Rg,e.attempt(zg,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Xg(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&r_.call(r,r.previous)&&!o_(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Gl(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Jl(t)||J(t)||$l(t)||Ql(t)?n(t):e.attempt(Rg,e.attempt(zg,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Zg(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Qg(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Bg,c,s)(t):t===null||J(t)||$l(t)||t!==45&&Ql(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function $g(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Bg,t,a)(o):o===null||J(o)||$l(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function e_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||J(o)||$l(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||J(e)||$l(e)?t(e):r(e)}function a(e){return Gl(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Gl(t)?(e.consume(t),o):n(t)}}function t_(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Kl(e)?n(e):t(e)}}function n_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||J(e)}function r_(e){return!Gl(e)}function i_(e){return!(e===47||a_(e))}function a_(e){return e===43||e===45||e===46||e===95||Kl(e)}function o_(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var s_={tokenize:h_,partial:!0};function c_(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:f_,continuation:{tokenize:p_},exit:m_}},text:{91:{name:`gfmFootnoteCall`,tokenize:d_},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:l_,resolveTo:u_}}}}function l_(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Wl(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function u_(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function d_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||J(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Wl(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return J(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function f_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||J(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Wl(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return J(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),X(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function p_(e,t,n){return e.check(gu,t,e.attempt(s_,t,n))}function m_(e){e.exit(`gfmFootnoteDefinition`)}function h_(e,t,n){let r=this;return X(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function g_(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Vl(o,o.length,0,lu(s,e.slice(r+1,n),t)),Vl(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Vl(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=cu(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=cu(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var __=class{constructor(){this.map=[]}add(e,t,n){v_(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function v_(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function y_(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function b_(){return{flow:{null:{name:`table`,tokenize:x_,resolveAll:S_}}}}function x_(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?ee:c;return a===ee&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Y(t)?X(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||J(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Y(t)?X(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Y(t)?X(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Y(t)?X(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function ee(t){return e.enter(`tableRow`),S(t)}function S(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),S):n===null||q(n)?(e.exit(`tableRow`),t(n)):Y(n)?X(e,S,`whitespace`)(n):(e.enter(`data`),C(n))}function C(t){return t===null||t===124||J(t)?(e.exit(`data`),S(t)):(e.consume(t),t===92?te:C)}function te(t){return t===92||t===124?(e.consume(t),C):C(t)}}function S_(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new __;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(w_(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=C_(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=C_(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=C_(f,t,o,i,n,d)):(o[0]=o[1],d=C_(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&w_(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=y_(t.events,n))}return e}function C_(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},T_(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=T_(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=T_(t.events,n[2]),a=T_(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},T_(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function w_(e,t,n,r,i){let a=[],o=T_(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function T_(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var E_={name:`tasklistCheck`,tokenize:O_};function D_(){return{text:{91:E_}}}function O_(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return J(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return q(r)?t(r):Y(r)?e.check({tokenize:k_},t,n)(r):n(r)}}function k_(e,t,n){return X(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function A_(e){return W([Kg(),c_(),g_(e),b_(),D_()])}var j_={};function M_(e){let t=this,n=e||j_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(A_(n)),a.push(Fg()),o.push(Ig(n))}var N_=/^(\s*)(\d{1,9})([.)])\s*$/,P_=/^(\s*)([-*+])\s*$/,F_=/^\s*(```|~~~)/;function I_(e){let t=!1;return e.split(`
|
|
270
270
|
`).map(e=>{if(F_.test(e))return t=!t,e;if(t)return e;let n=N_.exec(e);if(n)return`${n[1]}${n[2]}\\${n[3]}`;let r=P_.exec(e);return r?`${r[1]}\\${r[2]}`:e}).join(`
|
|
271
271
|
`)}var L_={default:{h1:`mt-3 mb-1.5 text-[17px] font-semibold`,h2:`mt-3 mb-1.5 text-[16px] font-semibold`,h3:`mt-3 mb-1.5 text-[15px] font-semibold`,code:`text-[12.5px]`,table:`my-1.5 w-full border-collapse text-sm`},compact:{h1:`mt-3 mb-1.5 text-[15px] font-medium`,h2:`mt-3 mb-1.5 text-[14px] font-medium`,h3:`mt-3 mb-1.5 text-[13px] font-medium`,code:`text-[11px]`,table:`my-1.5 w-full border-collapse text-[12px]`}},R_=(0,y.memo)(function({text:e,variant:t=`default`}){let n=Ts(),r=L_[t],i=(0,y.useMemo)(()=>({p:e=>(0,z.jsx)(`p`,{className:`my-1.5 first:mt-0 last:mb-0`,...e}),ul:e=>(0,z.jsx)(`ul`,{className:`my-1.5 list-disc pl-5`,...e}),ol:e=>(0,z.jsx)(`ol`,{className:`my-1.5 list-decimal pl-5`,...e}),li:e=>(0,z.jsx)(`li`,{className:`my-0.5`,...e}),h1:e=>(0,z.jsx)(`h1`,{className:r.h1,...e}),h2:e=>(0,z.jsx)(`h2`,{className:r.h2,...e}),h3:e=>(0,z.jsx)(`h3`,{className:r.h3,...e}),a:({style:e,...t})=>(0,z.jsx)(`a`,{className:`underline underline-offset-2`,style:{color:n.primary,...e},target:`_blank`,rel:`noreferrer noopener`,...t}),code:({className:e,style:t,children:i,...a})=>/language-/.test(e??``)?(0,z.jsx)(`code`,{className:Ds(`font-aai-mono`,r.code),...a,children:i}):(0,z.jsx)(`code`,{className:Ds(`rounded-sm border px-1 py-0.5 font-aai-mono`,r.code),style:{borderColor:n.border,background:Os(n.text,n.surface,3),...t},...a,children:i}),pre:({style:e,...t})=>(0,z.jsx)(`pre`,{className:`my-1.5 overflow-x-auto rounded-md border p-2.5 whitespace-pre-wrap wrap-break-word`,style:{borderColor:n.border,background:Os(n.text,n.surface,3),...e},...t}),blockquote:({style:e,...t})=>(0,z.jsx)(`blockquote`,{className:`my-1.5 border-l-2 pl-3`,style:{borderColor:n.border,color:Os(n.text,n.surface,75),...e},...t}),table:e=>(0,z.jsx)(`table`,{className:r.table,...e}),th:({style:e,...t})=>(0,z.jsx)(`th`,{className:`border px-2 py-1 text-left font-medium`,style:{borderColor:n.border,...e},...t}),td:({style:e,...t})=>(0,z.jsx)(`td`,{className:`border px-2 py-1`,style:{borderColor:n.border,...e},...t}),hr:({style:e,...t})=>(0,z.jsx)(`hr`,{className:`my-2.5 border-t`,style:{borderColor:n.border,...e},...t})}),[n,r]);return(0,z.jsx)(Om,{remarkPlugins:[M_],components:i,children:I_(e)})}),z_={default:{button:`gap-2.5 px-3.5 py-2.5`,title:`text-[13px]`,chevron:`text-[10px]`},compact:{button:`gap-2 px-3 py-2`,title:`text-[11px]`,chevron:`text-[9px]`}};function B_({title:e,detail:t,pending:n=!1,icon:r,variant:i=`default`,className:a,children:o}){let[s,c]=(0,y.useState)(!1),l=Ts(),u=z_[i],d=o!=null;return(0,z.jsxs)(`div`,{className:Ds(`flex flex-col rounded-md border overflow-hidden`,a),style:{borderColor:l.border,background:l.bg},children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":d?s:void 0,disabled:!d,className:Ds(`flex items-center select-none text-left w-full appearance-none border-none bg-transparent`,u.button,d&&`cursor-pointer`),onClick:()=>{d&&c(!s)},children:[r?(0,z.jsx)(`span`,{className:`w-4 h-4 shrink-0 text-center leading-4`,children:r}):(0,z.jsx)(Ps,{className:`shrink-0`,style:{color:Os(l.text,l.bg,65)},children:`Tool`}),(0,z.jsx)(`span`,{className:Ds(`min-w-0 truncate font-aai-mono font-medium`,u.title,n&&`tool-shimmer`),style:{color:l.text},children:e}),(0,z.jsx)(`span`,{className:Ds(`font-aai-mono truncate flex-1 min-w-0`,u.title),style:{color:Os(l.text,l.bg,65)},children:t}),d&&(0,z.jsx)(`span`,{className:Ds(`shrink-0 transition-transform duration-150`,u.chevron,s&&`rotate-90`),style:{color:Os(l.text,l.bg,65)},children:`▶`})]}),s&&d&&(0,z.jsx)(`div`,{className:`border-t max-h-64 overflow-auto`,style:{borderColor:l.border,background:l.surface},children:o})]})}var V_=(0,y.createContext)({});function H_(){return(0,y.useContext)(V_)}function U_(e){let t=le(e);return t===e?e:JSON.stringify(t,null,2)}var W_=(0,y.memo)(function({toolCall:e,className:t}){let n=Ts(),r=H_(),i=Object.hasOwn(r,e.name)?r[e.name]:void 0,a=e.status===`pending`,o=i?.label||e.name,s=i?.icon,c=!a&&!!e.result,l=(0,y.useMemo)(()=>e.result?U_(e.result):``,[e.result]),u=(0,y.useMemo)(()=>{let t=e.args;if(e.name===`run_code`&&t.code)return E(String(t.code).split(`
|
|
272
|
-
`)[0]??``);for(let e of[`query`,`url`,`question`])if(t[e])return String(t[e]);return E(JSON.stringify(t))},[e.name,e.args]);return(0,z.jsx)(B_,{title:o,detail:u,pending:a,icon:s,className:t,children:c?(0,z.jsxs)(z.Fragment,{children:[e.name===`run_code`&&!!e.args.code&&(0,z.jsx)(`pre`,{className:`font-aai-mono text-xs px-3.5 py-3 m-0 whitespace-pre-wrap wrap-break-word border-b`,style:{color:n.text,borderColor:n.border},children:String(e.args.code)}),l&&(0,z.jsx)(`pre`,{className:`font-aai-mono text-xs px-3.5 py-3 m-0 whitespace-pre-wrap wrap-break-word`,style:{color:Os(n.text,n.surface,75)},children:l})]}):void 0})}),G_=[0,.16,.32].map(e=>({animation:`aai-bounce 1.4s infinite ease-in-out both`,animationDelay:`${e}s`}));function K_(){let e=Ts(),t=Os(e.text,e.surface,75);return(0,z.jsx)(`div`,{role:`status`,"aria-label":`Thinking`,className:`flex items-center gap-2 text-sm font-medium min-h-5`,style:{color:t},children:G_.map((e,n)=>(0,z.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{...e,background:t}},n))})}function q_({theme:e,color:t,children:n}){return(0,z.jsx)(`div`,{className:`flex flex-col w-full items-end`,children:(0,z.jsx)(`div`,{className:`max-w-[min(78%,64ch)] border px-3.5 py-2.5 rounded-md whitespace-pre-wrap wrap-break-word text-[15px] font-normal leading-[22px]`,style:{background:js(e.primary,e.surface,7),borderColor:js(e.primary,e.surface,16),color:t},children:n})})}var J_=(0,y.memo)(function({message:e,theme:t}){return e.role===`user`?(0,z.jsx)(q_,{theme:t,color:t.text,children:e.content}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-1 max-w-[82%]`,children:[(0,z.jsx)(`span`,{className:`text-[10px] font-medium tracking-[1.2px] uppercase leading-none`,style:{color:Os(t.text,t.surface,65)},children:`Agent`}),(0,z.jsx)(`div`,{className:`wrap-break-word text-[15px] font-normal leading-[23px]`,style:{color:t.text},children:(0,z.jsx)(R_,{text:e.content})})]})});function Y_(e,t,n,r){let i=[],a=0,o=e=>{let n=t[a];for(;n&&n.afterMessageId<=e;)i.push(r(n)),a++,n=t[a]},s=e[0];s&&o(s.id-1);for(let t of e)i.push(n(t)),o(t.id);return o(1/0),i}var X_=(0,y.memo)(function({className:e}){let t=xs(e=>e.state),n=xs(e=>e.messages),r=xs(e=>e.toolCalls),i=xs(e=>e.userTranscript),a=xs(e=>e.agentTranscript),o=Ts(),s=(0,y.useMemo)(()=>{if(t!==`thinking`)return!1;let e=r.at(-1);if(e?.status===`pending`)return!1;let i=n.at(-1);return!i||i.role===`user`||!!e},[t,r,n]),c=(0,y.useMemo)(()=>a?{role:`assistant`,content:a}:null,[a]),l=(0,y.useMemo)(()=>Y_(n,r,e=>(0,z.jsx)(J_,{message:e,theme:o},e.id),e=>(0,z.jsx)(W_,{toolCall:e},e.callId)),[n,r,o]);return(0,z.jsxs)(rc,{className:e,style:{background:o.surface},contentClassName:`flex flex-col gap-4 p-7`,children:[l,c&&(0,z.jsx)(J_,{message:c,theme:o}),i!==null&&(0,z.jsx)(q_,{theme:o,color:Os(o.text,o.surface,65),children:i||(0,z.jsx)(K_,{})}),s&&(0,z.jsx)(K_,{})]})}),Z_=new Set([`listening`,`speaking`]);function Q_({icon:e,title:t,className:n}){let r=xs(e=>e.state),i=xs(e=>e.error);return(0,z.jsx)(Is,{icon:e,title:t,state:r,pulsing:Z_.has(r),error:i?.message,className:n,footer:(0,z.jsx)(Us,{}),children:(0,z.jsx)(X_,{})})}function $_({sidebar:e,children:t,sidebarWidth:n=`18rem`,sidebarPosition:r=`left`,className:i}){let a=Ts(),o=(0,z.jsx)(`div`,{className:Ds(`shrink-0 flex flex-col overflow-y-auto`,`w-full max-h-[40vh] md:w-(--aai-sidebar-w) md:max-h-none`,r===`left`?`border-b md:border-b-0 md:border-r`:`border-t md:border-t-0 md:border-l order-last md:order-none`),style:{borderColor:a.border},children:e}),s={background:a.bg,"--aai-sidebar-w":n};return(0,z.jsxs)(`div`,{className:Ds(`flex flex-col md:flex-row min-h-screen md:h-screen`,i),style:s,children:[r===`left`&&o,(0,z.jsx)(`div`,{className:`flex-1 min-w-0 min-h-0`,children:t}),r===`right`&&o]})}function ev({children:e,icon:t,title:n,subtitle:r,buttonText:i=`Start Conversation`,className:a}){let o=xs(e=>e.started),{start:s}=bs(),c=Ts();return o?e:(0,z.jsx)(`div`,{className:Ds(`flex items-center justify-center h-screen font-aai`,a),style:{background:c.bg},children:(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-5 border rounded-xl px-10 py-12 sm:px-16 sm:py-14 max-w-105 text-center`,style:{background:c.surface,borderColor:c.border,boxShadow:`0 4px 12px -2px rgb(20 18 12 / 0.08)`},children:[t??(0,z.jsx)(Ns,{size:24}),(0,z.jsx)(Ps,{children:`Voice Agent`}),n&&(0,z.jsx)(`h1`,{className:`font-aai-serif font-normal text-[32px] leading-[1.15] tracking-[-0.2px] m-0 text-balance`,style:{color:c.text},children:n}),r&&(0,z.jsx)(`p`,{className:`text-[15px] leading-[22px] m-0 max-w-75`,style:{color:Os(c.text,c.surface,75)},children:r}),(0,z.jsx)(Ls,{size:`lg`,className:`mt-2`,onClick:s,children:i})]})})}function tv(){let e=0;return{current:()=>e,bump(){e+=1},isCurrent:t=>t===e}}var nv=`modulepreload`,rv=function(e,t){return new URL(e,t).href},iv={},av=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=rv(t,n),t=s(t),t in iv)return;iv[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:nv,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ov=null;function sv(){return ov??=Promise.all([av(()=>import(`./audio-fO7SVU64.js`),__vite__mapDeps([0,1]),import.meta.url),av(()=>import(`./capture-processor-Dmc-KEpb.js`).then(e=>e.default),__vite__mapDeps([2,1,3]),import.meta.url),av(()=>import(`./playback-processor-
|
|
272
|
+
`)[0]??``);for(let e of[`query`,`url`,`question`])if(t[e])return String(t[e]);return E(JSON.stringify(t))},[e.name,e.args]);return(0,z.jsx)(B_,{title:o,detail:u,pending:a,icon:s,className:t,children:c?(0,z.jsxs)(z.Fragment,{children:[e.name===`run_code`&&!!e.args.code&&(0,z.jsx)(`pre`,{className:`font-aai-mono text-xs px-3.5 py-3 m-0 whitespace-pre-wrap wrap-break-word border-b`,style:{color:n.text,borderColor:n.border},children:String(e.args.code)}),l&&(0,z.jsx)(`pre`,{className:`font-aai-mono text-xs px-3.5 py-3 m-0 whitespace-pre-wrap wrap-break-word`,style:{color:Os(n.text,n.surface,75)},children:l})]}):void 0})}),G_=[0,.16,.32].map(e=>({animation:`aai-bounce 1.4s infinite ease-in-out both`,animationDelay:`${e}s`}));function K_(){let e=Ts(),t=Os(e.text,e.surface,75);return(0,z.jsx)(`div`,{role:`status`,"aria-label":`Thinking`,className:`flex items-center gap-2 text-sm font-medium min-h-5`,style:{color:t},children:G_.map((e,n)=>(0,z.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{...e,background:t}},n))})}function q_({theme:e,color:t,children:n}){return(0,z.jsx)(`div`,{className:`flex flex-col w-full items-end`,children:(0,z.jsx)(`div`,{className:`max-w-[min(78%,64ch)] border px-3.5 py-2.5 rounded-md whitespace-pre-wrap wrap-break-word text-[15px] font-normal leading-[22px]`,style:{background:js(e.primary,e.surface,7),borderColor:js(e.primary,e.surface,16),color:t},children:n})})}var J_=(0,y.memo)(function({message:e,theme:t}){return e.role===`user`?(0,z.jsx)(q_,{theme:t,color:t.text,children:e.content}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-1 max-w-[82%]`,children:[(0,z.jsx)(`span`,{className:`text-[10px] font-medium tracking-[1.2px] uppercase leading-none`,style:{color:Os(t.text,t.surface,65)},children:`Agent`}),(0,z.jsx)(`div`,{className:`wrap-break-word text-[15px] font-normal leading-[23px]`,style:{color:t.text},children:(0,z.jsx)(R_,{text:e.content})})]})});function Y_(e,t,n,r){let i=[],a=0,o=e=>{let n=t[a];for(;n&&n.afterMessageId<=e;)i.push(r(n)),a++,n=t[a]},s=e[0];s&&o(s.id-1);for(let t of e)i.push(n(t)),o(t.id);return o(1/0),i}var X_=(0,y.memo)(function({className:e}){let t=xs(e=>e.state),n=xs(e=>e.messages),r=xs(e=>e.toolCalls),i=xs(e=>e.userTranscript),a=xs(e=>e.agentTranscript),o=Ts(),s=(0,y.useMemo)(()=>{if(t!==`thinking`)return!1;let e=r.at(-1);if(e?.status===`pending`)return!1;let i=n.at(-1);return!i||i.role===`user`||!!e},[t,r,n]),c=(0,y.useMemo)(()=>a?{role:`assistant`,content:a}:null,[a]),l=(0,y.useMemo)(()=>Y_(n,r,e=>(0,z.jsx)(J_,{message:e,theme:o},e.id),e=>(0,z.jsx)(W_,{toolCall:e},e.callId)),[n,r,o]);return(0,z.jsxs)(rc,{className:e,style:{background:o.surface},contentClassName:`flex flex-col gap-4 p-7`,children:[l,c&&(0,z.jsx)(J_,{message:c,theme:o}),i!==null&&(0,z.jsx)(q_,{theme:o,color:Os(o.text,o.surface,65),children:i||(0,z.jsx)(K_,{})}),s&&(0,z.jsx)(K_,{})]})}),Z_=new Set([`listening`,`speaking`]);function Q_({icon:e,title:t,className:n}){let r=xs(e=>e.state),i=xs(e=>e.error);return(0,z.jsx)(Is,{icon:e,title:t,state:r,pulsing:Z_.has(r),error:i?.message,className:n,footer:(0,z.jsx)(Us,{}),children:(0,z.jsx)(X_,{})})}function $_({sidebar:e,children:t,sidebarWidth:n=`18rem`,sidebarPosition:r=`left`,className:i}){let a=Ts(),o=(0,z.jsx)(`div`,{className:Ds(`shrink-0 flex flex-col overflow-y-auto`,`w-full max-h-[40vh] md:w-(--aai-sidebar-w) md:max-h-none`,r===`left`?`border-b md:border-b-0 md:border-r`:`border-t md:border-t-0 md:border-l order-last md:order-none`),style:{borderColor:a.border},children:e}),s={background:a.bg,"--aai-sidebar-w":n};return(0,z.jsxs)(`div`,{className:Ds(`flex flex-col md:flex-row min-h-screen md:h-screen`,i),style:s,children:[r===`left`&&o,(0,z.jsx)(`div`,{className:`flex-1 min-w-0 min-h-0`,children:t}),r===`right`&&o]})}function ev({children:e,icon:t,title:n,subtitle:r,buttonText:i=`Start Conversation`,className:a}){let o=xs(e=>e.started),{start:s}=bs(),c=Ts();return o?e:(0,z.jsx)(`div`,{className:Ds(`flex items-center justify-center h-screen font-aai`,a),style:{background:c.bg},children:(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-5 border rounded-xl px-10 py-12 sm:px-16 sm:py-14 max-w-105 text-center`,style:{background:c.surface,borderColor:c.border,boxShadow:`0 4px 12px -2px rgb(20 18 12 / 0.08)`},children:[t??(0,z.jsx)(Ns,{size:24}),(0,z.jsx)(Ps,{children:`Voice Agent`}),n&&(0,z.jsx)(`h1`,{className:`font-aai-serif font-normal text-[32px] leading-[1.15] tracking-[-0.2px] m-0 text-balance`,style:{color:c.text},children:n}),r&&(0,z.jsx)(`p`,{className:`text-[15px] leading-[22px] m-0 max-w-75`,style:{color:Os(c.text,c.surface,75)},children:r}),(0,z.jsx)(Ls,{size:`lg`,className:`mt-2`,onClick:s,children:i})]})})}function tv(){let e=0;return{current:()=>e,bump(){e+=1},isCurrent:t=>t===e}}var nv=`modulepreload`,rv=function(e,t){return new URL(e,t).href},iv={},av=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=rv(t,n),t=s(t),t in iv)return;iv[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:nv,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ov=null;function sv(){return ov??=Promise.all([av(()=>import(`./audio-fO7SVU64.js`),__vite__mapDeps([0,1]),import.meta.url),av(()=>import(`./capture-processor-Dmc-KEpb.js`).then(e=>e.default),__vite__mapDeps([2,1,3]),import.meta.url),av(()=>import(`./playback-processor-DwQ9tE7X.js`).then(e=>e.default),__vite__mapDeps([4,1,3]),import.meta.url)]).catch(e=>{throw ov=null,e}),ov}async function cv(e,t,n){if(e.audioSetupInFlight)return;e.audioSetupInFlight=!0;let r=e.generation.current(),i=()=>!(e.generation.isCurrent(r)&&e.ws)||e.ws.readyState!==1,a=e=>{n.cleanupAudio(),n.updateState({state:`error`,error:{code:`audio`,message:e},running:!1,recording:!1})};try{let[{createVoiceIO:o},s,c]=await sv(),l=await o({sttSampleRate:t.sampleRate,ttsSampleRate:t.ttsSampleRate,captureWorkletSrc:s,playbackWorkletSrc:c,onMicData:e=>{try{n.sendAudio(e)}catch{console.debug(`[aai-ui] sendAudio dropped: connection closed`)}},onPlaybackProgress:t=>{if(e.generation.isCurrent(r))try{n.sendJson({type:`playback_progress`,bufferedMs:t})}catch{}},onError:t=>{e.generation.isCurrent(r)&&a(t.message)}});if(i()){l.close().catch(()=>{});return}if(e.voiceIO?.close().catch(()=>{}),e.voiceIO=l,e.preInitAudio.length>0){for(let t of e.preInitAudio)l.enqueue(t);e.preInitAudio=[]}n.sendJson({type:`audio_ready`}),n.updateState({recording:!0}),e.preInitDone?(e.preInitDone=!1,n.settleWhenAudioDrained(l)):n.updateState({state:`listening`})}catch(e){if(i())return;a(`Microphone access failed: ${oe(e)}`)}finally{e.generation.isCurrent(r)&&(e.audioSetupInFlight=!1)}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
|
|
273
273
|
PartySocket requires a global 'EventTarget' class to be available!
|
|
274
274
|
You can polyfill this global by adding this to your code before any partysocket imports:
|
|
275
275
|
|
package/dist/default-client/assets/{playback-processor-DUsmALNH.js → playback-processor-DwQ9tE7X.js}
RENAMED
|
@@ -14,12 +14,10 @@ class PlaybackProcessor extends AudioWorkletProcessor {
|
|
|
14
14
|
// could ever assert on the reported backlog, so the divergence made the
|
|
15
15
|
// number untestable rather than wrong.
|
|
16
16
|
this.rate = rate;
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// never coming.
|
|
20
|
-
this.
|
|
21
|
-
// Fill target after an underrun — see PLAYBACK_REFILL_MS.
|
|
22
|
-
this.refillSamples = Math.floor((rate * (opts.refillMs ?? 200)) / 1000);
|
|
17
|
+
// The one fill target — for the start of a turn and for recovery after an
|
|
18
|
+
// underrun alike. If 'done' arrives first (short utterance), start
|
|
19
|
+
// immediately instead of waiting for audio that is never coming.
|
|
20
|
+
this.fillSamples = Math.floor((rate * (opts.fillMs ?? 200)) / 1000);
|
|
23
21
|
// Concealment source: a ring of the most recently played samples, looped
|
|
24
22
|
// under a decaying gain to cover a gap. Sized to the fade window, with a
|
|
25
23
|
// per-sample decay that reaches the floor exactly at its end.
|
|
@@ -76,7 +74,6 @@ class PlaybackProcessor extends AudioWorkletProcessor {
|
|
|
76
74
|
// pre-roll (nothing to extrapolate from, and not a defect) from a
|
|
77
75
|
// mid-turn underrun.
|
|
78
76
|
this.hasPlayed = false;
|
|
79
|
-
this.fillTarget = this.jitterSamples;
|
|
80
77
|
// Carry-over byte for split samples across chunks
|
|
81
78
|
this.carry = null;
|
|
82
79
|
this.writePos = 0;
|
|
@@ -268,7 +265,7 @@ class PlaybackProcessor extends AudioWorkletProcessor {
|
|
|
268
265
|
// Filling: wait for the target. 'done' short-circuits it — what is
|
|
269
266
|
// buffered is all there will be, so there is nothing left to wait for.
|
|
270
267
|
if (!this.playing) {
|
|
271
|
-
if (avail >= this.
|
|
268
|
+
if (avail >= this.fillSamples || this.isDone) {
|
|
272
269
|
this.playing = true;
|
|
273
270
|
} else {
|
|
274
271
|
this.coverGap(out, 0);
|
|
@@ -277,13 +274,12 @@ class PlaybackProcessor extends AudioWorkletProcessor {
|
|
|
277
274
|
}
|
|
278
275
|
|
|
279
276
|
// Underrun: this quantum cannot be filled and more audio is still coming.
|
|
280
|
-
// Go back to filling
|
|
277
|
+
// Go back to filling and cover the gap, leaving
|
|
281
278
|
// readPos untouched — the fragment stays buffered and plays intact once
|
|
282
279
|
// the buffer recovers, instead of being dribbled out a few samples at a
|
|
283
280
|
// time for the rest of the turn.
|
|
284
281
|
if (avail < out.length && !this.isDone) {
|
|
285
282
|
this.playing = false;
|
|
286
|
-
this.fillTarget = this.refillSamples;
|
|
287
283
|
this.coverGap(out, 0);
|
|
288
284
|
return true;
|
|
289
285
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<title>aai</title>
|
|
7
7
|
<link rel="icon" href="./favicon.ico" />
|
|
8
8
|
<style>html, body { background: #FBF8F2; margin: 0; }</style>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-aXDcAQ6M.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="./assets/client-audio-constants-Ck0IJO4c.js">
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/index-BZlePk3y.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main id="app"></main>
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { StartScreen } from "./components/start-screen.tsx";
|
|
|
11
11
|
export { ToolCallRow, type ToolCallRowProps, type ToolCallRowVariant, } from "./components/tool-call-row.tsx";
|
|
12
12
|
export type { ToolDisplayConfig } from "./components/tool-config-context.ts";
|
|
13
13
|
export { ToolConfigContext } from "./components/tool-config-context.ts";
|
|
14
|
+
export { UploadProgressBar } from "./components/upload-progress.tsx";
|
|
14
15
|
export { ApiUrlChip, SessionUrlChips, UiUrlChip } from "./components/url-chips.tsx";
|
|
15
16
|
export { WorkflowFields } from "./components/workflow-fields.tsx";
|
|
16
17
|
export { WorkflowProgress } from "./components/workflow-progress.tsx";
|
|
@@ -25,7 +26,7 @@ export type { AgentCustomEvent, SessionCore, SessionCoreOptions, SessionSnapshot
|
|
|
25
26
|
export type { AgentState, ChatMessage, ClientTheme, SessionError, SessionErrorCode, ToolCallInfo, VoiceSessionOptions, WebSocketConstructor, } from "./types.ts";
|
|
26
27
|
export { VOICE_CAPTURE_CONSTRAINTS } from "./types.ts";
|
|
27
28
|
export { TRANSCRIBING_PLACEHOLDER, type UseUserTranscriptResult, useUserTranscript, } from "./use-user-transcript.ts";
|
|
28
|
-
export { type UseWorkflowSubmitOptions, type UseWorkflowsOptions, type UseWorkflowsResult, useWorkflowSubmit, useWorkflows, type WorkflowSubmission, } from "./use-workflow-form.ts";
|
|
29
|
+
export { type UploadStatus, type UseWorkflowSubmitOptions, type UseWorkflowsOptions, type UseWorkflowsResult, useWorkflowSubmit, useWorkflows, type WorkflowSubmission, } from "./use-workflow-form.ts";
|
|
29
30
|
export { DEFAULT_PROGRESS_POLL_MS, type UseWorkflowProgressResult, useWorkflowProgress, } from "./use-workflow-progress.ts";
|
|
30
31
|
export { DEFAULT_WORKFLOW_POLL_MS, MAX_MISSING_READS, type UseWorkflowRunResult, useWorkflowRun, } from "./use-workflow-run.ts";
|
|
31
32
|
export { type UseWorkflowRunsOptions, type UseWorkflowRunsResult, useWorkflowRuns, } from "./use-workflow-runs.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { i as loadClientConfig, n as buildAgentUrl, r as fetchClientConfig, t as createSessionCore } from "./session-core-ClKdVgRU.js";
|
|
2
2
|
import { n as Markdown, r as AutoScroll, t as MessageList } from "./message-list-BwA3rdPi.js";
|
|
3
3
|
import { SessionProvider, ThemeProvider, useSession, useSessionSelector, useTheme } from "./context.js";
|
|
4
|
+
import { r as inkTint } from "./_colors-CcAi2FOU.js";
|
|
4
5
|
import { Button } from "./components/button.js";
|
|
5
6
|
import { t as ChatView } from "./chat-view-CK61bWWx.js";
|
|
6
7
|
import { t as pageBaseUrl } from "./_utils-CsqbIVGI.js";
|
|
@@ -439,6 +440,125 @@ function SubmitButton({ children, pending = false, pendingLabel = "Working…",
|
|
|
439
440
|
});
|
|
440
441
|
}
|
|
441
442
|
//#endregion
|
|
443
|
+
//#region components/upload-progress.tsx
|
|
444
|
+
/** @jsxImportSource react */
|
|
445
|
+
/**
|
|
446
|
+
* The track behind the fill, as a tint of the theme's own ink.
|
|
447
|
+
*
|
|
448
|
+
* Its own step rather than `INK_SURFACE_PCT`: that one is for a filled surface
|
|
449
|
+
* behind text (a code span, a message bubble), where a 1.5px rule needs to read
|
|
450
|
+
* as a groove against the page.
|
|
451
|
+
*/
|
|
452
|
+
const TRACK_TINT_PCT = 12;
|
|
453
|
+
/** Bytes per KB/MB/GB step, as a file manager counts them. */
|
|
454
|
+
const BYTE_STEP = 1024;
|
|
455
|
+
/** Unit labels, largest last — the index is how many times the size divides. */
|
|
456
|
+
const BYTE_UNITS = [
|
|
457
|
+
"B",
|
|
458
|
+
"KB",
|
|
459
|
+
"MB",
|
|
460
|
+
"GB"
|
|
461
|
+
];
|
|
462
|
+
/**
|
|
463
|
+
* A size a person can read, because the number that matters is the SCALE.
|
|
464
|
+
*
|
|
465
|
+
* `12.4 MB of 48.0 MB` says how much is left in the terms someone chose the
|
|
466
|
+
* file in; `13002343 of 50331648` says the same thing and answers nothing.
|
|
467
|
+
*/
|
|
468
|
+
function formatBytes(bytes) {
|
|
469
|
+
let value = bytes;
|
|
470
|
+
let unit = 0;
|
|
471
|
+
while (value >= BYTE_STEP && unit < BYTE_UNITS.length - 1) {
|
|
472
|
+
value /= BYTE_STEP;
|
|
473
|
+
unit += 1;
|
|
474
|
+
}
|
|
475
|
+
return `${unit === 0 ? value : value.toFixed(1)} ${BYTE_UNITS[unit]}`;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* How far a form's files have got, rendered as a bar.
|
|
479
|
+
*
|
|
480
|
+
* The wait this covers is the one a run cannot describe: a workflow run does not
|
|
481
|
+
* EXIST until its input is stored, so from the moment a form is submitted until
|
|
482
|
+
* the last byte lands there is no run id, no status, and nothing for
|
|
483
|
+
* `<WorkflowProgress>` to read — which for a 200 MB recording is minutes of a
|
|
484
|
+
* page that looks stuck. `useWorkflowSubmit` reports the bytes as they go and
|
|
485
|
+
* this is what draws them.
|
|
486
|
+
*
|
|
487
|
+
* Three things it decides, so a page does not:
|
|
488
|
+
*
|
|
489
|
+
* - **It renders nothing when there is nothing to describe.** `upload` is
|
|
490
|
+
* undefined before the first byte and again from the moment the last one
|
|
491
|
+
* lands, so `<UploadProgressBar upload={upload} />` is correct unguarded and a
|
|
492
|
+
* form with no files never shows a bar at all.
|
|
493
|
+
* - **An unknown total is INDETERMINATE, not zero.** A body whose length the
|
|
494
|
+
* transport cannot state up front (see `UploadProgress.total`) has no honest
|
|
495
|
+
* width, and a bar pinned at 0% reads as an upload that is not moving.
|
|
496
|
+
* - **The file is NAMED, and counted when there is more than one.** Files are
|
|
497
|
+
* sent one after another, so a single bar otherwise appears to restart from
|
|
498
|
+
* zero partway through with nothing to say why.
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* ```tsx
|
|
502
|
+
* import { Form, SubmitButton, UploadProgressBar, useWorkflowSubmit, WorkflowFields } from "@alexkroman1/aai-ui";
|
|
503
|
+
*
|
|
504
|
+
* function TranscribeForm() {
|
|
505
|
+
* const { submit, upload, pending, error } = useWorkflowSubmit("transcribe");
|
|
506
|
+
* return (
|
|
507
|
+
* <Form onSubmit={(values) => submit(values)} error={error}>
|
|
508
|
+
* <WorkflowFields workflow="transcribe" />
|
|
509
|
+
* <UploadProgressBar upload={upload} />
|
|
510
|
+
* <SubmitButton pending={pending}>Transcribe</SubmitButton>
|
|
511
|
+
* </Form>
|
|
512
|
+
* );
|
|
513
|
+
* }
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* @param upload - What `useWorkflowSubmit` reports. `undefined` renders nothing,
|
|
517
|
+
* so a page may pass its state straight through.
|
|
518
|
+
* @param className - Replaces the default classes rather than extending them,
|
|
519
|
+
* so a custom chrome is not fighting a default it did not ask for.
|
|
520
|
+
*
|
|
521
|
+
* @public
|
|
522
|
+
*/
|
|
523
|
+
function UploadProgressBar({ upload, className }) {
|
|
524
|
+
const theme = useTheme();
|
|
525
|
+
const labelId = useId();
|
|
526
|
+
if (!upload) return null;
|
|
527
|
+
const { name, index, count, loaded, total, fraction } = upload;
|
|
528
|
+
const percent = fraction === void 0 ? void 0 : Math.round(fraction * 100);
|
|
529
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
530
|
+
className: clsx(className ?? "flex flex-col gap-1.5"),
|
|
531
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
532
|
+
className: "flex items-baseline justify-between gap-4 text-xs",
|
|
533
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
534
|
+
id: labelId,
|
|
535
|
+
className: "truncate",
|
|
536
|
+
style: { color: inkTint(theme.text, theme.surface, 65) },
|
|
537
|
+
children: count > 1 ? `Uploading ${name} (${index} of ${count})` : `Uploading ${name}`
|
|
538
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
539
|
+
className: "shrink-0 tabular-nums",
|
|
540
|
+
style: { color: inkTint(theme.text, theme.surface, 65) },
|
|
541
|
+
children: total === void 0 ? formatBytes(loaded) : `${formatBytes(loaded)} of ${formatBytes(total)}`
|
|
542
|
+
})]
|
|
543
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
544
|
+
role: "progressbar",
|
|
545
|
+
"aria-labelledby": labelId,
|
|
546
|
+
"aria-valuemin": 0,
|
|
547
|
+
"aria-valuemax": 100,
|
|
548
|
+
...omitUndefined({ "aria-valuenow": percent }),
|
|
549
|
+
className: "h-1.5 w-full overflow-hidden rounded-full",
|
|
550
|
+
style: { backgroundColor: inkTint(theme.text, theme.surface, TRACK_TINT_PCT) },
|
|
551
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
552
|
+
className: clsx("h-full rounded-full transition-[width] duration-200 ease-out", percent === void 0 && "animate-pulse"),
|
|
553
|
+
style: {
|
|
554
|
+
backgroundColor: theme.primary,
|
|
555
|
+
width: percent === void 0 ? "100%" : `${percent}%`
|
|
556
|
+
}
|
|
557
|
+
})
|
|
558
|
+
})]
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
//#endregion
|
|
442
562
|
//#region workflow-client.ts
|
|
443
563
|
/**
|
|
444
564
|
* Create a workflow API client aimed at the agent serving this page.
|
|
@@ -911,26 +1031,63 @@ function useWorkflows(opts = {}) {
|
|
|
911
1031
|
return state;
|
|
912
1032
|
}
|
|
913
1033
|
/**
|
|
914
|
-
*
|
|
1034
|
+
* The files a submitted field carries, if that is what it carries.
|
|
1035
|
+
*
|
|
1036
|
+
* An array counts only when it is files ALL the way through — a mixed array is
|
|
1037
|
+
* some other field's value that happens to contain one, and turning half of it
|
|
1038
|
+
* into ids would corrupt it silently.
|
|
1039
|
+
*/
|
|
1040
|
+
function filesOf(value) {
|
|
1041
|
+
if (value instanceof File) return [value];
|
|
1042
|
+
if (!Array.isArray(value)) return [];
|
|
1043
|
+
const files = value.filter((one) => one instanceof File);
|
|
1044
|
+
return files.length > 0 && files.length === value.length ? files : [];
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Replace every `File` in a submitted form with the id of a stored upload,
|
|
1048
|
+
* reporting how far each one has got.
|
|
915
1049
|
*
|
|
916
1050
|
* Sequential rather than `Promise.all`: these are large bodies, and a form with
|
|
917
1051
|
* two 200 MB recordings should send them one after another rather than compete
|
|
918
|
-
* for the same connection.
|
|
1052
|
+
* for the same connection. That is also what makes a single bar honest — one
|
|
1053
|
+
* file is in flight at a time, and `index`/`count` say which.
|
|
919
1054
|
*
|
|
920
1055
|
* Anything that is not a `File` (or an array of them) passes through untouched,
|
|
921
1056
|
* so this is invisible to every form that has none — including one whose values
|
|
922
1057
|
* are not an object at all, which `submit` accepts.
|
|
923
1058
|
*/
|
|
924
|
-
async function uploadFiles(api, input) {
|
|
1059
|
+
async function uploadFiles(api, input, report) {
|
|
925
1060
|
if (!isRecord(input)) return input;
|
|
926
1061
|
const entries = Object.entries(input);
|
|
1062
|
+
const count = entries.reduce((total, [, value]) => total + filesOf(value).length, 0);
|
|
1063
|
+
let index = 0;
|
|
1064
|
+
const store = async (file) => {
|
|
1065
|
+
index += 1;
|
|
1066
|
+
const position = {
|
|
1067
|
+
name: file.name,
|
|
1068
|
+
index,
|
|
1069
|
+
count
|
|
1070
|
+
};
|
|
1071
|
+
return (await api.upload(file, { onProgress: (progress) => report({
|
|
1072
|
+
...position,
|
|
1073
|
+
...progress
|
|
1074
|
+
}) })).id;
|
|
1075
|
+
};
|
|
927
1076
|
const out = {};
|
|
928
|
-
for (const [name, value] of entries)
|
|
929
|
-
|
|
1077
|
+
for (const [name, value] of entries) {
|
|
1078
|
+
if (value instanceof File) {
|
|
1079
|
+
out[name] = await store(value);
|
|
1080
|
+
continue;
|
|
1081
|
+
}
|
|
1082
|
+
const chosen = filesOf(value);
|
|
1083
|
+
if (chosen.length === 0) {
|
|
1084
|
+
out[name] = value;
|
|
1085
|
+
continue;
|
|
1086
|
+
}
|
|
930
1087
|
const ids = [];
|
|
931
|
-
for (const file of
|
|
1088
|
+
for (const file of chosen) ids.push(await store(file));
|
|
932
1089
|
out[name] = ids;
|
|
933
|
-
}
|
|
1090
|
+
}
|
|
934
1091
|
return out;
|
|
935
1092
|
}
|
|
936
1093
|
/**
|
|
@@ -963,6 +1120,7 @@ function useWorkflowSubmit(workflow, opts = {}) {
|
|
|
963
1120
|
const [runId, setRunId] = useState(void 0);
|
|
964
1121
|
const [starting, setStarting] = useState(false);
|
|
965
1122
|
const [startError, setStartError] = useState(void 0);
|
|
1123
|
+
const [upload, setUpload] = useState(void 0);
|
|
966
1124
|
const getClient = useWorkflowApiRef(api);
|
|
967
1125
|
const tracked = useWorkflowRun(runId, {
|
|
968
1126
|
...api && { api },
|
|
@@ -976,7 +1134,7 @@ function useWorkflowSubmit(workflow, opts = {}) {
|
|
|
976
1134
|
setRunId(void 0);
|
|
977
1135
|
try {
|
|
978
1136
|
const options = omitUndefined({ key });
|
|
979
|
-
const started = await uploadFiles(client, input);
|
|
1137
|
+
const started = await uploadFiles(client, input, setUpload);
|
|
980
1138
|
setRunId(wait === void 0 ? await client.start(workflow, started, options) : (await client.startAndWait(workflow, started, {
|
|
981
1139
|
...options,
|
|
982
1140
|
wait
|
|
@@ -985,6 +1143,7 @@ function useWorkflowSubmit(workflow, opts = {}) {
|
|
|
985
1143
|
setStartError(errorMessage(err));
|
|
986
1144
|
} finally {
|
|
987
1145
|
setStarting(false);
|
|
1146
|
+
setUpload(void 0);
|
|
988
1147
|
}
|
|
989
1148
|
}, [
|
|
990
1149
|
workflow,
|
|
@@ -995,9 +1154,11 @@ function useWorkflowSubmit(workflow, opts = {}) {
|
|
|
995
1154
|
reset: useCallback(() => {
|
|
996
1155
|
setRunId(void 0);
|
|
997
1156
|
setStartError(void 0);
|
|
1157
|
+
setUpload(void 0);
|
|
998
1158
|
}, []),
|
|
999
1159
|
run: tracked.run,
|
|
1000
1160
|
pending: starting || tracked.polling,
|
|
1161
|
+
upload,
|
|
1001
1162
|
error: startError ?? tracked.error
|
|
1002
1163
|
};
|
|
1003
1164
|
}
|
|
@@ -1600,4 +1761,4 @@ function useWorkflowRuns(workflow, opts = {}) {
|
|
|
1600
1761
|
};
|
|
1601
1762
|
}
|
|
1602
1763
|
//#endregion
|
|
1603
|
-
export { ApiUrlChip, AutoScroll, Button, ChatView, CheckboxField, Controls, DEFAULT_PROGRESS_POLL_MS, DEFAULT_WORKFLOW_POLL_MS, Field, FileField, Form, MAX_MISSING_READS, Markdown, MessageList, NumberField, SelectField, SessionProvider, SessionUrlChips, SidebarLayout, StartScreen, SubmitButton, TRANSCRIBING_PLACEHOLDER, TextAreaField, TextField, ThemeProvider, ToolCallRow, ToolConfigContext, UiUrlChip, VOICE_CAPTURE_CONSTRAINTS, WorkflowFields, WorkflowProgress, buildAgentUrl, client, createSessionCore, createWorkflowApi, fetchClientConfig, isTerminal, loadClientConfig, page, useAgentState, useEvent, useSession, useSessionSelector, useTheme, useToolCallStart, useToolResult, useUserTranscript, useWorkflowProgress, useWorkflowRun, useWorkflowRuns, useWorkflowSubmit, useWorkflows };
|
|
1764
|
+
export { ApiUrlChip, AutoScroll, Button, ChatView, CheckboxField, Controls, DEFAULT_PROGRESS_POLL_MS, DEFAULT_WORKFLOW_POLL_MS, Field, FileField, Form, MAX_MISSING_READS, Markdown, MessageList, NumberField, SelectField, SessionProvider, SessionUrlChips, SidebarLayout, StartScreen, SubmitButton, TRANSCRIBING_PLACEHOLDER, TextAreaField, TextField, ThemeProvider, ToolCallRow, ToolConfigContext, UiUrlChip, UploadProgressBar, VOICE_CAPTURE_CONSTRAINTS, WorkflowFields, WorkflowProgress, buildAgentUrl, client, createSessionCore, createWorkflowApi, fetchClientConfig, isTerminal, loadClientConfig, page, useAgentState, useEvent, useSession, useSessionSelector, useTheme, useToolCallStart, useToolResult, useUserTranscript, useWorkflowProgress, useWorkflowRun, useWorkflowRuns, useWorkflowSubmit, useWorkflows };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefaultToolResult } from "@alexkroman1/aai";
|
|
2
2
|
import type { SessionErrorCode } from "@alexkroman1/aai/protocol";
|
|
3
|
-
export { CAPTURE_STOP_ACK_TIMEOUT_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS,
|
|
3
|
+
export { CAPTURE_STOP_ACK_TIMEOUT_MS, CLIENT_AUDIO_LEAD_MS, HEARD_AUDIO_LAG_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PACER_BURST_MS, PIPELINE_PLAYBACK_GRACE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS, PLAYBACK_FILL_MS, PLAYBACK_PROGRESS_INTERVAL_MS, } from "@alexkroman1/aai/internal";
|
|
4
4
|
/**
|
|
5
5
|
* `getUserMedia` audio constraints for every capture path in this package.
|
|
6
6
|
*
|
package/dist/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CAPTURE_STOP_ACK_TIMEOUT_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS,
|
|
1
|
+
import { CAPTURE_STOP_ACK_TIMEOUT_MS, CLIENT_AUDIO_LEAD_MS, HEARD_AUDIO_LAG_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PACER_BURST_MS, PIPELINE_PLAYBACK_GRACE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS, PLAYBACK_FILL_MS, PLAYBACK_PROGRESS_INTERVAL_MS } from "@alexkroman1/aai/internal";
|
|
2
2
|
//#region types.ts
|
|
3
3
|
/**
|
|
4
4
|
* `getUserMedia` audio constraints for every capture path in this package.
|
|
@@ -32,4 +32,4 @@ const VOICE_CAPTURE_CONSTRAINTS = {
|
|
|
32
32
|
voiceIsolation: false
|
|
33
33
|
};
|
|
34
34
|
//#endregion
|
|
35
|
-
export { CAPTURE_STOP_ACK_TIMEOUT_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS,
|
|
35
|
+
export { CAPTURE_STOP_ACK_TIMEOUT_MS, CLIENT_AUDIO_LEAD_MS, HEARD_AUDIO_LAG_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_BYTES, MIC_SILENCE_PROBE_MS, PACER_BURST_MS, PIPELINE_PLAYBACK_GRACE_MS, PLAYBACK_BUFFER_SECONDS, PLAYBACK_CONCEAL_FADE_MS, PLAYBACK_CONCEAL_FLOOR, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS, PLAYBACK_FILL_MS, PLAYBACK_PROGRESS_INTERVAL_MS, VOICE_CAPTURE_CONSTRAINTS };
|