@superinterface/react 5.2.3-beta.1 → 5.3.0-beta.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/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  function _array_like_to_array(arr, len) {
3
4
  if (len == null || len > arr.length) len = arr.length;
@@ -5608,7 +5609,7 @@ var require_lib = __commonJS({
5608
5609
  key: "parseMaybeAssign",
5609
5610
  value: function parseMaybeAssign(refExpressionErrors, afterLeftParse) {
5610
5611
  var _this = this;
5611
- var _jsx110;
5612
+ var _jsx109;
5612
5613
  var state = null;
5613
5614
  var jsx2;
5614
5615
  if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
@@ -5623,7 +5624,7 @@ var require_lib = __commonJS({
5623
5624
  context.pop();
5624
5625
  }
5625
5626
  }
5626
- if ((_jsx110 = jsx2) != null && _jsx110.error || this.match(47)) {
5627
+ if ((_jsx109 = jsx2) != null && _jsx109.error || this.match(47)) {
5627
5628
  var _jsx210, _jsx310;
5628
5629
  state = state || this.state.clone();
5629
5630
  var typeParameters;
@@ -13401,7 +13402,7 @@ var require_lib = __commonJS({
13401
13402
  key: "parseMaybeAssign",
13402
13403
  value: function parseMaybeAssign(refExpressionErrors, afterLeftParse) {
13403
13404
  var _this = this;
13404
- var _jsx110, _jsx210, _typeCast, _jsx310, _typeCast2;
13405
+ var _jsx109, _jsx210, _typeCast, _jsx310, _typeCast2;
13405
13406
  var state;
13406
13407
  var jsx2;
13407
13408
  var typeCast;
@@ -13417,7 +13418,7 @@ var require_lib = __commonJS({
13417
13418
  context.pop();
13418
13419
  }
13419
13420
  }
13420
- if (!((_jsx110 = jsx2) != null && _jsx110.error) && !this.match(47)) {
13421
+ if (!((_jsx109 = jsx2) != null && _jsx109.error) && !this.match(47)) {
13421
13422
  return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeAssign", this).call(this, refExpressionErrors, afterLeftParse);
13422
13423
  }
13423
13424
  if (!state || state === this.state) state = this.state.clone();
@@ -37220,7 +37221,7 @@ var SuperinterfaceProvider = function(_ref) {
37220
37221
  });
37221
37222
  };
37222
37223
  // src/components/threads/Thread/index.tsx
37223
- var import_react_compiler_runtime78 = require("react-compiler-runtime");
37224
+ var import_react_compiler_runtime77 = require("react-compiler-runtime");
37224
37225
  // src/components/threads/Thread/Messages/index.tsx
37225
37226
  var import_react_compiler_runtime66 = require("react-compiler-runtime");
37226
37227
  var import_themes45 = require("@radix-ui/themes");
@@ -44091,7 +44092,7 @@ Messages2.Message = Message;
44091
44092
  Messages2.NextPageSkeleton = NextPageSkeleton;
44092
44093
  Messages2.Content = Content7;
44093
44094
  // src/components/threads/Thread/MessageForm/index.tsx
44094
- var import_react_compiler_runtime74 = require("react-compiler-runtime");
44095
+ var import_react_compiler_runtime73 = require("react-compiler-runtime");
44095
44096
  // src/components/threads/Thread/MessageForm/Submit/index.tsx
44096
44097
  var import_react_compiler_runtime67 = require("react-compiler-runtime");
44097
44098
  var import_react_icons11 = require("@radix-ui/react-icons");
@@ -44266,41 +44267,8 @@ Submit.Root = Root7;
44266
44267
  Submit.Button = Button3;
44267
44268
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44268
44269
  var import_react_query6 = require("@tanstack/react-query");
44269
- var import_react52 = require("react");
44270
- var import_react_hook_form = require("react-hook-form");
44271
- // src/lib/reactHookForm/FormProvider.tsx
44272
- var import_react_compiler_runtime68 = require("react-compiler-runtime");
44273
44270
  var import_react51 = require("react");
44274
- var import_jsx_runtime69 = require("react/jsx-runtime");
44275
- var FormContext = /* @__PURE__ */ (0, import_react51.createContext)(null);
44276
- var useFormContext = function() {
44277
- var value = (0, import_react51.useContext)(FormContext);
44278
- if (!value) {
44279
- throw new Error("useFormContext must be used within FormProvider");
44280
- }
44281
- return value;
44282
- };
44283
- var FormProvider = function(t0) {
44284
- var $ = (0, import_react_compiler_runtime68.c)(3);
44285
- var children = t0.children, form = t0.form;
44286
- var t1;
44287
- t1 = form;
44288
- var contextValue = t1;
44289
- var t2;
44290
- if ($[0] !== children || $[1] !== contextValue) {
44291
- t2 = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FormContext.Provider, {
44292
- value: contextValue,
44293
- children: children
44294
- });
44295
- $[0] = children;
44296
- $[1] = contextValue;
44297
- $[2] = t2;
44298
- } else {
44299
- t2 = $[2];
44300
- }
44301
- return t2;
44302
- };
44303
- // src/components/threads/Thread/MessageForm/Root/index.tsx
44271
+ var import_react_hook_form = require("react-hook-form");
44304
44272
  var import_themes47 = require("@radix-ui/themes");
44305
44273
  // src/components/threads/Thread/MessageForm/Root/lib/formOptions.ts
44306
44274
  var import_zod = require("zod");
@@ -44313,7 +44281,7 @@ var formOptions = {
44313
44281
  };
44314
44282
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44315
44283
  var import_radash14 = require("radash");
44316
- var import_jsx_runtime70 = require("react/jsx-runtime");
44284
+ var import_jsx_runtime69 = require("react/jsx-runtime");
44317
44285
  function ownKeys30(e, r) {
44318
44286
  var t = Object.keys(e);
44319
44287
  if (Object.getOwnPropertySymbols) {
@@ -44383,7 +44351,7 @@ function _asyncToGenerator6(n) {
44383
44351
  var Root8 = function(_ref) {
44384
44352
  "use no memo";
44385
44353
  var children = _ref.children, onSubmitArg = _ref.onSubmit, isDisabledArg = _ref.isDisabled, style = _ref.style, className = _ref.className;
44386
- var _$_ref = _sliced_to_array((0, import_react52.useState)([]), 2), files = _$_ref[0], setFiles = _$_ref[1];
44354
+ var _$_ref = _sliced_to_array((0, import_react51.useState)([]), 2), files = _$_ref[0], setFiles = _$_ref[1];
44387
44355
  var formProps = (0, import_react_hook_form.useForm)(formOptions);
44388
44356
  var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, formReset = formProps.reset, watch = formProps.watch;
44389
44357
  var addToast = useToasts().addToast;
@@ -44397,7 +44365,7 @@ var Root8 = function(_ref) {
44397
44365
  })
44398
44366
  }).createMessage;
44399
44367
  var isMutatingMessage = useIsMutatingMessage();
44400
- var isFileLoading = (0, import_react52.useMemo)(function() {
44368
+ var isFileLoading = (0, import_react51.useMemo)(function() {
44401
44369
  return files.some(function(file) {
44402
44370
  return isOptimistic({
44403
44371
  id: file.id
@@ -44406,21 +44374,21 @@ var Root8 = function(_ref) {
44406
44374
  }, [
44407
44375
  files
44408
44376
  ]);
44409
- var isLoading = (0, import_react52.useMemo)(function() {
44377
+ var isLoading = (0, import_react51.useMemo)(function() {
44410
44378
  return isMutatingMessage || isSubmitting;
44411
44379
  }, [
44412
44380
  isMutatingMessage,
44413
44381
  isSubmitting
44414
44382
  ]);
44415
44383
  var latestMessage = useLatestMessage().latestMessage;
44416
- var isDisabled = (0, import_react52.useMemo)(function() {
44384
+ var isDisabled = (0, import_react51.useMemo)(function() {
44417
44385
  var _latestMessage$metada;
44418
44386
  return !!(latestMessage !== null && latestMessage !== void 0 && (_latestMessage$metada = latestMessage.metadata) !== null && _latestMessage$metada !== void 0 && _latestMessage$metada.isBlocking) || !!isDisabledArg;
44419
44387
  }, [
44420
44388
  latestMessage,
44421
44389
  isDisabledArg
44422
44390
  ]);
44423
- var reset = (0, import_react52.useCallback)(function() {
44391
+ var reset = (0, import_react51.useCallback)(function() {
44424
44392
  formReset();
44425
44393
  setFiles([]);
44426
44394
  }, [
@@ -44495,7 +44463,7 @@ var Root8 = function(_ref) {
44495
44463
  };
44496
44464
  }();
44497
44465
  var content_0 = watch("content");
44498
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(MessageFormContext.Provider, {
44466
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MessageFormContext.Provider, {
44499
44467
  value: {
44500
44468
  isDisabled: isDisabled,
44501
44469
  isLoading: isLoading,
@@ -44504,42 +44472,43 @@ var Root8 = function(_ref) {
44504
44472
  isFileLoading: isFileLoading,
44505
44473
  content: content_0
44506
44474
  },
44507
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormProvider, {
44508
- form: formProps,
44509
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_themes47.Box, {
44475
+ children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_hook_form.FormProvider, _objectSpread30(_objectSpread30({}, formProps), {}, {
44476
+ children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_themes47.Box, {
44510
44477
  asChild: true,
44511
44478
  flexShrink: "0",
44512
44479
  style: style,
44513
44480
  className: className,
44514
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("form", {
44481
+ children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("form", {
44515
44482
  onSubmit: handleSubmit(onSubmit),
44516
44483
  children: children
44517
44484
  })
44518
44485
  })
44519
- })
44486
+ }))
44520
44487
  });
44521
44488
  };
44522
44489
  // src/components/threads/Thread/MessageForm/Field/index.tsx
44490
+ var import_react_hook_form3 = require("react-hook-form");
44523
44491
  var import_themes51 = require("@radix-ui/themes");
44524
44492
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44525
- var import_react_compiler_runtime70 = require("react-compiler-runtime");
44493
+ var import_react_compiler_runtime69 = require("react-compiler-runtime");
44526
44494
  var import_themes48 = require("@radix-ui/themes");
44495
+ var import_react_hook_form2 = require("react-hook-form");
44527
44496
  // src/hooks/misc/usePrevious.ts
44528
- var import_react53 = require("react");
44497
+ var import_react52 = require("react");
44529
44498
  var usePrevious = function(state) {
44530
- var ref = (0, import_react53.useRef)(void 0);
44531
- (0, import_react53.useEffect)(function() {
44499
+ var ref = (0, import_react52.useRef)(void 0);
44500
+ (0, import_react52.useEffect)(function() {
44532
44501
  ref.current = state;
44533
44502
  });
44534
44503
  return ref.current;
44535
44504
  };
44536
44505
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44537
- var import_react55 = require("react");
44538
- // src/components/textareas/TextareaBase/index.tsx
44539
- var import_react_compiler_runtime69 = require("react-compiler-runtime");
44540
44506
  var import_react54 = require("react");
44507
+ // src/components/textareas/TextareaBase/index.tsx
44508
+ var import_react_compiler_runtime68 = require("react-compiler-runtime");
44509
+ var import_react53 = require("react");
44541
44510
  var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"), 1);
44542
- var import_jsx_runtime71 = require("react/jsx-runtime");
44511
+ var import_jsx_runtime70 = require("react/jsx-runtime");
44543
44512
  var _excluded3 = [
44544
44513
  "style",
44545
44514
  "className"
@@ -44605,8 +44574,8 @@ function _objectWithoutPropertiesLoose3(r, e) {
44605
44574
  }
44606
44575
  return t;
44607
44576
  }
44608
- var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function TextareaBase2(t0, ref) {
44609
- var $ = (0, import_react_compiler_runtime69.c)(14);
44577
+ var TextareaBase = /* @__PURE__ */ (0, import_react53.forwardRef)(function TextareaBase2(t0, ref) {
44578
+ var $ = (0, import_react_compiler_runtime68.c)(14);
44610
44579
  var className;
44611
44580
  var rest;
44612
44581
  var style;
@@ -44627,7 +44596,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44627
44596
  }
44628
44597
  var t1;
44629
44598
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
44630
- t1 = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("style", {
44599
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("style", {
44631
44600
  children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
44632
44601
  });
44633
44602
  $[4] = t1;
@@ -44661,10 +44630,10 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44661
44630
  }
44662
44631
  var t5;
44663
44632
  if ($[9] !== ref || $[10] !== rest || $[11] !== t2 || $[12] !== t4) {
44664
- t5 = /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, {
44633
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, {
44665
44634
  children: [
44666
44635
  t1,
44667
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react_textarea_autosize.default, _objectSpread31({
44636
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react_textarea_autosize.default, _objectSpread31({
44668
44637
  ref: ref,
44669
44638
  className: t2,
44670
44639
  style: t4
@@ -44682,7 +44651,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44682
44651
  return t5;
44683
44652
  });
44684
44653
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44685
- var import_jsx_runtime72 = require("react/jsx-runtime");
44654
+ var import_jsx_runtime71 = require("react/jsx-runtime");
44686
44655
  function ownKeys32(e, r) {
44687
44656
  var t = Object.keys(e);
44688
44657
  if (Object.getOwnPropertySymbols) {
@@ -44727,11 +44696,11 @@ function _toPrimitive32(t, r) {
44727
44696
  return ("string" === r ? String : Number)(t);
44728
44697
  }
44729
44698
  var Root9 = function(t0) {
44730
- var $ = (0, import_react_compiler_runtime70.c)(4);
44699
+ var $ = (0, import_react_compiler_runtime69.c)(4);
44731
44700
  var children = t0.children, style = t0.style, className = t0.className;
44732
44701
  var t1;
44733
44702
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
44734
- t1 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes48.Flex, {
44703
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_themes48.Flex, {
44735
44704
  flexGrow: "1",
44736
44705
  pt: "4px",
44737
44706
  style: style,
@@ -44750,19 +44719,19 @@ var Root9 = function(t0) {
44750
44719
  var Input = function(props) {
44751
44720
  "use no memo";
44752
44721
  var _props$placeholder;
44753
- var assistantNameContext = (0, import_react55.useContext)(AssistantNameContext);
44754
- var register = useFormContext().register;
44722
+ var assistantNameContext = (0, import_react54.useContext)(AssistantNameContext);
44723
+ var register = (0, import_react_hook_form2.useFormContext)().register;
44755
44724
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
44756
- var isSubmitDisabled = (0, import_react55.useMemo)(function() {
44725
+ var isSubmitDisabled = (0, import_react54.useMemo)(function() {
44757
44726
  return isDisabled || isLoading;
44758
44727
  }, [
44759
44728
  isDisabled,
44760
44729
  isLoading
44761
44730
  ]);
44762
44731
  var isDisabledPrevious = usePrevious(isDisabled);
44763
- var textareaRef = (0, import_react55.useRef)(null);
44732
+ var textareaRef = (0, import_react54.useRef)(null);
44764
44733
  var textareaProps = register("content");
44765
- (0, import_react55.useEffect)(function() {
44734
+ (0, import_react54.useEffect)(function() {
44766
44735
  if (isDisabled) return;
44767
44736
  if (!isDisabledPrevious) return;
44768
44737
  if (!textareaRef.current) return;
@@ -44772,7 +44741,7 @@ var Input = function(props) {
44772
44741
  isDisabledPrevious,
44773
44742
  textareaProps
44774
44743
  ]);
44775
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TextareaBase, _objectSpread32(_objectSpread32(_objectSpread32({
44744
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextareaBase, _objectSpread32(_objectSpread32(_objectSpread32({
44776
44745
  minRows: 1,
44777
44746
  placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : "Message ".concat(assistantNameContext, "..."),
44778
44747
  disabled: isDisabled,
@@ -44792,17 +44761,17 @@ var Input = function(props) {
44792
44761
  }));
44793
44762
  };
44794
44763
  var Control = function(props) {
44795
- var $ = (0, import_react_compiler_runtime70.c)(3);
44764
+ var $ = (0, import_react_compiler_runtime69.c)(3);
44796
44765
  var t0;
44797
44766
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44798
- t0 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Input, {});
44767
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Input, {});
44799
44768
  $[0] = t0;
44800
44769
  } else {
44801
44770
  t0 = $[0];
44802
44771
  }
44803
44772
  var t1;
44804
44773
  if ($[1] !== props) {
44805
- t1 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Root9, _objectSpread32(_objectSpread32({}, props), {}, {
44774
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Root9, _objectSpread32(_objectSpread32({}, props), {}, {
44806
44775
  children: t0
44807
44776
  }));
44808
44777
  $[1] = props;
@@ -44815,10 +44784,10 @@ var Control = function(props) {
44815
44784
  Control.Root = Root9;
44816
44785
  Control.Input = Input;
44817
44786
  // src/components/threads/Thread/MessageForm/Field/Files/Preview.tsx
44818
- var import_react_compiler_runtime71 = require("react-compiler-runtime");
44787
+ var import_react_compiler_runtime70 = require("react-compiler-runtime");
44819
44788
  var import_themes49 = require("@radix-ui/themes");
44820
44789
  var import_react_icons12 = require("@radix-ui/react-icons");
44821
- var import_jsx_runtime73 = require("react/jsx-runtime");
44790
+ var import_jsx_runtime72 = require("react/jsx-runtime");
44822
44791
  function ownKeys33(e, r) {
44823
44792
  var t = Object.keys(e);
44824
44793
  if (Object.getOwnPropertySymbols) {
@@ -44863,7 +44832,7 @@ function _toPrimitive33(t, r) {
44863
44832
  return ("string" === r ? String : Number)(t);
44864
44833
  }
44865
44834
  var Preview = function(props) {
44866
- var $ = (0, import_react_compiler_runtime71.c)(8);
44835
+ var $ = (0, import_react_compiler_runtime70.c)(8);
44867
44836
  var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
44868
44837
  if (!files.length) {
44869
44838
  return null;
@@ -44873,30 +44842,30 @@ var Preview = function(props) {
44873
44842
  var _t;
44874
44843
  if ($[3] !== setFiles) {
44875
44844
  _t = function(file) {
44876
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Card, {
44845
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Card, {
44877
44846
  variant: "ghost",
44878
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_themes49.Flex, {
44847
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_themes49.Flex, {
44879
44848
  align: "center",
44880
44849
  justify: "between",
44881
44850
  gap: "1",
44882
44851
  children: [
44883
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_themes49.Flex, {
44852
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_themes49.Flex, {
44884
44853
  align: "center",
44885
44854
  gap: "1",
44886
44855
  flexShrink: "1",
44887
44856
  minWidth: "0",
44888
44857
  maxWidth: "250px",
44889
44858
  children: [
44890
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Flex, {
44859
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Flex, {
44891
44860
  flexShrink: "0",
44892
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Spinner, {
44861
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Spinner, {
44893
44862
  loading: isOptimistic({
44894
44863
  id: file.id
44895
44864
  }),
44896
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react_icons12.FileIcon, {})
44865
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react_icons12.FileIcon, {})
44897
44866
  })
44898
44867
  }),
44899
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Text, {
44868
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Text, {
44900
44869
  size: "2",
44901
44870
  truncate: true,
44902
44871
  wrap: "nowrap",
@@ -44904,9 +44873,9 @@ var Preview = function(props) {
44904
44873
  })
44905
44874
  ]
44906
44875
  }),
44907
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Flex, {
44876
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Flex, {
44908
44877
  flexShrink: "0",
44909
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.IconButton, {
44878
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.IconButton, {
44910
44879
  onClick: function() {
44911
44880
  return setFiles(function(prev) {
44912
44881
  return prev.filter(function(prevFile) {
@@ -44917,7 +44886,7 @@ var Preview = function(props) {
44917
44886
  color: "gray",
44918
44887
  variant: "ghost",
44919
44888
  size: "1",
44920
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react_icons12.Cross2Icon, {})
44889
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react_icons12.Cross2Icon, {})
44921
44890
  })
44922
44891
  })
44923
44892
  ]
@@ -44938,7 +44907,7 @@ var Preview = function(props) {
44938
44907
  }
44939
44908
  var t1;
44940
44909
  if ($[5] !== props || $[6] !== t0) {
44941
- t1 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Flex, _objectSpread33(_objectSpread33({
44910
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_themes49.Flex, _objectSpread33(_objectSpread33({
44942
44911
  flexBasis: "100%",
44943
44912
  direction: "column",
44944
44913
  pb: "2",
@@ -44955,15 +44924,15 @@ var Preview = function(props) {
44955
44924
  return t1;
44956
44925
  };
44957
44926
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
44958
- var import_react_compiler_runtime73 = require("react-compiler-runtime");
44927
+ var import_react_compiler_runtime72 = require("react-compiler-runtime");
44959
44928
  var import_react_icons13 = require("@radix-ui/react-icons");
44960
44929
  var import_themes50 = require("@radix-ui/themes");
44961
44930
  // src/hooks/files/useChangeFilesField/index.ts
44962
- var import_react56 = require("react");
44931
+ var import_react55 = require("react");
44963
44932
  var import_radash15 = require("radash");
44964
44933
  var import_dayjs2 = __toESM(require("dayjs"), 1);
44965
44934
  // src/hooks/files/useCreateFile/index.ts
44966
- var import_react_compiler_runtime72 = require("react-compiler-runtime");
44935
+ var import_react_compiler_runtime71 = require("react-compiler-runtime");
44967
44936
  var import_react_query7 = require("@tanstack/react-query");
44968
44937
  // src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/formData.ts
44969
44938
  var formData = function(variables) {
@@ -45199,7 +45168,7 @@ function _toPrimitive36(t, r) {
45199
45168
  return ("string" === r ? String : Number)(t);
45200
45169
  }
45201
45170
  var useCreateFile = function(t0) {
45202
- var $ = (0, import_react_compiler_runtime72.c)(15);
45171
+ var $ = (0, import_react_compiler_runtime71.c)(15);
45203
45172
  var t1;
45204
45173
  if ($[0] !== t0) {
45205
45174
  t1 = t0 === void 0 ? {
@@ -45350,7 +45319,7 @@ var useChangeFilesField = function() {
45350
45319
  var setFiles = useMessageFormContext().setFiles;
45351
45320
  var createFile = useCreateFile().createFile;
45352
45321
  var addToast = useToasts().addToast;
45353
- var changeFilesField = (0, import_react56.useCallback)(/* @__PURE__ */ function() {
45322
+ var changeFilesField = (0, import_react55.useCallback)(/* @__PURE__ */ function() {
45354
45323
  var _ref2 = _asyncToGenerator8(function(event) {
45355
45324
  var fileObjects, newFiles, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, err;
45356
45325
  return _ts_generator(this, function(_state) {
@@ -45528,7 +45497,7 @@ var useChangeFilesField = function() {
45528
45497
  // src/lib/files/filesFieldAccept.ts
45529
45498
  var filesFieldAccept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript,\n.png,image/png,\n.jpeg,image/jpeg,\n.jpg,image/jpeg,\n.webp,image/webp,\n.gif,image/gif";
45530
45499
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
45531
- var import_jsx_runtime74 = require("react/jsx-runtime");
45500
+ var import_jsx_runtime73 = require("react/jsx-runtime");
45532
45501
  function ownKeys37(e, r) {
45533
45502
  var t = Object.keys(e);
45534
45503
  if (Object.getOwnPropertySymbols) {
@@ -45573,7 +45542,7 @@ function _toPrimitive37(t, r) {
45573
45542
  return ("string" === r ? String : Number)(t);
45574
45543
  }
45575
45544
  var Control2 = function(props) {
45576
- var $ = (0, import_react_compiler_runtime73.c)(11);
45545
+ var $ = (0, import_react_compiler_runtime72.c)(11);
45577
45546
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
45578
45547
  var changeFilesField = useChangeFilesField().changeFilesField;
45579
45548
  var t0 = isDisabled || isLoading;
@@ -45584,7 +45553,7 @@ var Control2 = function(props) {
45584
45553
  position: "relative",
45585
45554
  overflow: "hidden"
45586
45555
  };
45587
- t2 = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react_icons13.FilePlusIcon, {});
45556
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react_icons13.FilePlusIcon, {});
45588
45557
  $[0] = t1;
45589
45558
  $[1] = t2;
45590
45559
  } else {
@@ -45608,7 +45577,7 @@ var Control2 = function(props) {
45608
45577
  }
45609
45578
  var t4;
45610
45579
  if ($[3] !== changeFilesField) {
45611
- t4 = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("input", {
45580
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("input", {
45612
45581
  type: "file",
45613
45582
  multiple: true,
45614
45583
  accept: filesFieldAccept,
@@ -45622,7 +45591,7 @@ var Control2 = function(props) {
45622
45591
  }
45623
45592
  var t5;
45624
45593
  if ($[5] !== t0 || $[6] !== t4) {
45625
- t5 = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_themes50.IconButton, {
45594
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_themes50.IconButton, {
45626
45595
  type: "button",
45627
45596
  variant: "ghost",
45628
45597
  color: "gray",
@@ -45641,7 +45610,7 @@ var Control2 = function(props) {
45641
45610
  }
45642
45611
  var t6;
45643
45612
  if ($[8] !== props || $[9] !== t5) {
45644
- t6 = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes50.Flex, _objectSpread37(_objectSpread37({
45613
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes50.Flex, _objectSpread37(_objectSpread37({
45645
45614
  pt: "2",
45646
45615
  pr: "2",
45647
45616
  flexGrow: "0"
@@ -45662,7 +45631,7 @@ var Files = {
45662
45631
  Control: Control2
45663
45632
  };
45664
45633
  // src/components/threads/Thread/MessageForm/Field/index.tsx
45665
- var import_jsx_runtime75 = require("react/jsx-runtime");
45634
+ var import_jsx_runtime74 = require("react/jsx-runtime");
45666
45635
  function ownKeys38(e, r) {
45667
45636
  var t = Object.keys(e);
45668
45637
  if (Object.getOwnPropertySymbols) {
@@ -45709,19 +45678,19 @@ function _toPrimitive38(t, r) {
45709
45678
  var Root10 = function(_ref) {
45710
45679
  "use no memo";
45711
45680
  var children = _ref.children, className = _ref.className, style = _ref.style;
45712
- var _useFormContext = useFormContext(), errors = _useFormContext.formState.errors;
45713
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_themes51.Container, {
45681
+ var _$_ref = (0, import_react_hook_form3.useFormContext)(), errors = _$_ref.formState.errors;
45682
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes51.Container, {
45714
45683
  size: "2",
45715
45684
  flexGrow: "0",
45716
45685
  className: className,
45717
45686
  style: style,
45718
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_themes51.Flex, {
45687
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes51.Flex, {
45719
45688
  direction: "column",
45720
45689
  flexShrink: "0",
45721
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_themes51.Flex, {
45690
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes51.Flex, {
45722
45691
  direction: "column",
45723
45692
  flexShrink: "0",
45724
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_themes51.Flex, {
45693
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes51.Flex, {
45725
45694
  style: _objectSpread38({
45726
45695
  borderRadius: "var(--radius-2)",
45727
45696
  borderWidth: "1px",
@@ -45745,7 +45714,7 @@ var Field = {
45745
45714
  Files: Files
45746
45715
  };
45747
45716
  // src/components/threads/Thread/MessageForm/index.tsx
45748
- var import_jsx_runtime76 = require("react/jsx-runtime");
45717
+ var import_jsx_runtime75 = require("react/jsx-runtime");
45749
45718
  function ownKeys39(e, r) {
45750
45719
  var t = Object.keys(e);
45751
45720
  if (Object.getOwnPropertySymbols) {
@@ -45790,13 +45759,13 @@ function _toPrimitive39(t, r) {
45790
45759
  return ("string" === r ? String : Number)(t);
45791
45760
  }
45792
45761
  var MessageForm = function(props) {
45793
- var $ = (0, import_react_compiler_runtime74.c)(3);
45762
+ var $ = (0, import_react_compiler_runtime73.c)(3);
45794
45763
  var t0;
45795
45764
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
45796
- t0 = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Field.Root, {
45765
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Field.Root, {
45797
45766
  children: [
45798
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Field.Control, {}),
45799
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Submit, {})
45767
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Field.Control, {}),
45768
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Submit, {})
45800
45769
  ]
45801
45770
  });
45802
45771
  $[0] = t0;
@@ -45805,7 +45774,7 @@ var MessageForm = function(props) {
45805
45774
  }
45806
45775
  var t1;
45807
45776
  if ($[1] !== props) {
45808
- t1 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Root8, _objectSpread39(_objectSpread39({}, props), {}, {
45777
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Root8, _objectSpread39(_objectSpread39({}, props), {}, {
45809
45778
  children: t0
45810
45779
  }));
45811
45780
  $[1] = props;
@@ -45819,32 +45788,32 @@ MessageForm.Root = Root8;
45819
45788
  MessageForm.Field = Field;
45820
45789
  MessageForm.Submit = Submit;
45821
45790
  // src/components/threads/Thread/Root/index.tsx
45822
- var import_react_compiler_runtime77 = require("react-compiler-runtime");
45791
+ var import_react_compiler_runtime76 = require("react-compiler-runtime");
45823
45792
  var import_themes53 = require("@radix-ui/themes");
45824
45793
  // src/components/threads/Thread/Provider/index.tsx
45825
45794
  var Provider2 = SuperinterfaceProvider;
45826
45795
  // src/components/toasts/ToastsProvider/index.tsx
45827
- var import_react_compiler_runtime76 = require("react-compiler-runtime");
45828
- var import_react57 = require("react");
45796
+ var import_react_compiler_runtime75 = require("react-compiler-runtime");
45797
+ var import_react56 = require("react");
45829
45798
  var Toast2 = __toESM(require("@radix-ui/react-toast"), 1);
45830
45799
  // src/components/toasts/ToastsProvider/CustomToast.tsx
45831
- var import_react_compiler_runtime75 = require("react-compiler-runtime");
45800
+ var import_react_compiler_runtime74 = require("react-compiler-runtime");
45832
45801
  var Toast = __toESM(require("@radix-ui/react-toast"), 1);
45833
45802
  var import_themes52 = require("@radix-ui/themes");
45834
45803
  var import_react_icons14 = require("@radix-ui/react-icons");
45835
- var import_jsx_runtime77 = require("react/jsx-runtime");
45804
+ var import_jsx_runtime76 = require("react/jsx-runtime");
45836
45805
  var CustomToast = function(t0) {
45837
- var $ = (0, import_react_compiler_runtime75.c)(7);
45806
+ var $ = (0, import_react_compiler_runtime74.c)(7);
45838
45807
  var toast = t0.toast;
45839
45808
  var t1;
45840
45809
  if ($[0] !== toast.type) {
45841
- t1 = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_themes52.Flex, {
45810
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_themes52.Flex, {
45842
45811
  pr: "2",
45843
45812
  height: "14px",
45844
45813
  align: "center",
45845
- children: toast.type === "success" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_icons14.CheckCircledIcon, {
45814
+ children: toast.type === "success" ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_react_icons14.CheckCircledIcon, {
45846
45815
  color: "var(--accent-9)"
45847
- }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_icons14.CrossCircledIcon, {
45816
+ }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_react_icons14.CrossCircledIcon, {
45848
45817
  color: "var(--red-9)"
45849
45818
  })
45850
45819
  });
@@ -45855,7 +45824,7 @@ var CustomToast = function(t0) {
45855
45824
  }
45856
45825
  var t2;
45857
45826
  if ($[2] !== toast.message) {
45858
- t2 = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_themes52.Text, {
45827
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_themes52.Text, {
45859
45828
  weight: "medium",
45860
45829
  size: "1",
45861
45830
  children: toast.message
@@ -45867,10 +45836,10 @@ var CustomToast = function(t0) {
45867
45836
  }
45868
45837
  var t3;
45869
45838
  if ($[4] !== t1 || $[5] !== t2) {
45870
- t3 = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Toast.Root, {
45871
- children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_themes52.Card, {
45872
- children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Toast.Title, {
45873
- children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_themes52.Flex, {
45839
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Toast.Root, {
45840
+ children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_themes52.Card, {
45841
+ children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Toast.Title, {
45842
+ children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_themes52.Flex, {
45874
45843
  children: [
45875
45844
  t1,
45876
45845
  t2
@@ -45888,9 +45857,9 @@ var CustomToast = function(t0) {
45888
45857
  return t3;
45889
45858
  };
45890
45859
  // src/components/toasts/ToastsProvider/index.tsx
45891
- var import_jsx_runtime78 = require("react/jsx-runtime");
45860
+ var import_jsx_runtime77 = require("react/jsx-runtime");
45892
45861
  var ToastsProvider = function(t0) {
45893
- var $ = (0, import_react_compiler_runtime76.c)(15);
45862
+ var $ = (0, import_react_compiler_runtime75.c)(15);
45894
45863
  var children = t0.children, t1 = t0.bottom;
45895
45864
  var bottom = t1 === void 0 ? 0 : t1;
45896
45865
  var t2;
@@ -45900,7 +45869,7 @@ var ToastsProvider = function(t0) {
45900
45869
  } else {
45901
45870
  t2 = $[0];
45902
45871
  }
45903
- var _ref = _sliced_to_array((0, import_react57.useState)(t2), 2), toasts = _ref[0], setToasts = _ref[1];
45872
+ var _ref = _sliced_to_array((0, import_react56.useState)(t2), 2), toasts = _ref[0], setToasts = _ref[1];
45904
45873
  var t3;
45905
45874
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
45906
45875
  t3 = function(toast) {
@@ -45936,7 +45905,7 @@ var ToastsProvider = function(t0) {
45936
45905
  }
45937
45906
  var t6;
45938
45907
  if ($[6] !== bottom) {
45939
- t6 = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Toast2.Viewport, {
45908
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Toast2.Viewport, {
45940
45909
  style: {
45941
45910
  position: "absolute",
45942
45911
  bottom: bottom,
@@ -45960,7 +45929,7 @@ var ToastsProvider = function(t0) {
45960
45929
  }
45961
45930
  var t7;
45962
45931
  if ($[8] !== children || $[9] !== t5 || $[10] !== t6) {
45963
- t7 = /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Toast2.Provider, {
45932
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Toast2.Provider, {
45964
45933
  children: [
45965
45934
  children,
45966
45935
  t5,
@@ -45976,7 +45945,7 @@ var ToastsProvider = function(t0) {
45976
45945
  }
45977
45946
  var t8;
45978
45947
  if ($[12] !== t4 || $[13] !== t7) {
45979
- t8 = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ToastsContext.Provider, {
45948
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ToastsContext.Provider, {
45980
45949
  value: t4,
45981
45950
  children: t7
45982
45951
  });
@@ -45989,12 +45958,12 @@ var ToastsProvider = function(t0) {
45989
45958
  return t8;
45990
45959
  };
45991
45960
  function _temp5(toast_0, index) {
45992
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CustomToast, {
45961
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(CustomToast, {
45993
45962
  toast: toast_0
45994
45963
  }, index);
45995
45964
  }
45996
45965
  // src/components/threads/Thread/Root/index.tsx
45997
- var import_jsx_runtime79 = require("react/jsx-runtime");
45966
+ var import_jsx_runtime78 = require("react/jsx-runtime");
45998
45967
  var _excluded4 = [
45999
45968
  "children",
46000
45969
  "style",
@@ -46062,7 +46031,7 @@ function _objectWithoutPropertiesLoose4(r, e) {
46062
46031
  return t;
46063
46032
  }
46064
46033
  var Root12 = function(t0) {
46065
- var $ = (0, import_react_compiler_runtime77.c)(12);
46034
+ var $ = (0, import_react_compiler_runtime76.c)(12);
46066
46035
  var children;
46067
46036
  var className;
46068
46037
  var rest;
@@ -46086,7 +46055,7 @@ var Root12 = function(t0) {
46086
46055
  }
46087
46056
  var t1;
46088
46057
  if ($[5] !== children || $[6] !== className || $[7] !== style) {
46089
- t1 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_themes53.Flex, {
46058
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_themes53.Flex, {
46090
46059
  direction: "column",
46091
46060
  flexGrow: "1",
46092
46061
  className: className,
@@ -46102,9 +46071,9 @@ var Root12 = function(t0) {
46102
46071
  }
46103
46072
  var t2;
46104
46073
  if ($[9] !== rest || $[10] !== t1) {
46105
- t2 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ToastsProvider, {
46074
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ToastsProvider, {
46106
46075
  bottom: "var(--space-9)",
46107
- children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Provider2, _objectSpread40(_objectSpread40({}, rest), {}, {
46076
+ children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Provider2, _objectSpread40(_objectSpread40({}, rest), {}, {
46108
46077
  children: t1
46109
46078
  }))
46110
46079
  });
@@ -46117,7 +46086,7 @@ var Root12 = function(t0) {
46117
46086
  return t2;
46118
46087
  };
46119
46088
  // src/components/threads/Thread/index.tsx
46120
- var import_jsx_runtime80 = require("react/jsx-runtime");
46089
+ var import_jsx_runtime79 = require("react/jsx-runtime");
46121
46090
  function ownKeys41(e, r) {
46122
46091
  var t = Object.keys(e);
46123
46092
  if (Object.getOwnPropertySymbols) {
@@ -46162,12 +46131,12 @@ function _toPrimitive41(t, r) {
46162
46131
  return ("string" === r ? String : Number)(t);
46163
46132
  }
46164
46133
  var Thread = function(props) {
46165
- var $ = (0, import_react_compiler_runtime78.c)(4);
46134
+ var $ = (0, import_react_compiler_runtime77.c)(4);
46166
46135
  var t0;
46167
46136
  var t1;
46168
46137
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46169
- t0 = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Messages2, {});
46170
- t1 = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MessageForm, {});
46138
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Messages2, {});
46139
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(MessageForm, {});
46171
46140
  $[0] = t0;
46172
46141
  $[1] = t1;
46173
46142
  } else {
@@ -46176,7 +46145,7 @@ var Thread = function(props) {
46176
46145
  }
46177
46146
  var t2;
46178
46147
  if ($[2] !== props) {
46179
- t2 = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Root12, _objectSpread41(_objectSpread41({}, props), {}, {
46148
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Root12, _objectSpread41(_objectSpread41({}, props), {}, {
46180
46149
  children: [
46181
46150
  t0,
46182
46151
  t1
@@ -46193,13 +46162,13 @@ Thread.Root = Root12;
46193
46162
  Thread.Messages = Messages2;
46194
46163
  Thread.MessageForm = MessageForm;
46195
46164
  // src/hooks/messages/useMessageContext/index.ts
46196
- var import_react58 = require("react");
46165
+ var import_react57 = require("react");
46197
46166
  var useMessageContext = function() {
46198
- return (0, import_react58.useContext)(MessageContext);
46167
+ return (0, import_react57.useContext)(MessageContext);
46199
46168
  };
46200
46169
  // src/hooks/assistants/useAssistant/index.ts
46201
- var import_react_compiler_runtime79 = require("react-compiler-runtime");
46202
- var import_react59 = require("react");
46170
+ var import_react_compiler_runtime78 = require("react-compiler-runtime");
46171
+ var import_react58 = require("react");
46203
46172
  var import_react_query9 = require("@tanstack/react-query");
46204
46173
  // src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
46205
46174
  var import_react_query8 = require("@tanstack/react-query");
@@ -46348,7 +46317,7 @@ function _toPrimitive42(t, r) {
46348
46317
  return ("string" === r ? String : Number)(t);
46349
46318
  }
46350
46319
  var useAssistant = function(t0) {
46351
- var $ = (0, import_react_compiler_runtime79.c)(6);
46320
+ var $ = (0, import_react_compiler_runtime78.c)(6);
46352
46321
  var assistantId = t0.assistantId;
46353
46322
  var superinterfaceContext = useSuperinterfaceContext();
46354
46323
  var t1;
@@ -46381,30 +46350,30 @@ var useAssistant = function(t0) {
46381
46350
  return t2;
46382
46351
  };
46383
46352
  // src/components/threads/ThreadDialog/index.tsx
46384
- var import_react_compiler_runtime86 = require("react-compiler-runtime");
46353
+ var import_react_compiler_runtime85 = require("react-compiler-runtime");
46385
46354
  // src/components/threads/ThreadDialog/Root/index.tsx
46386
- var import_react_compiler_runtime81 = require("react-compiler-runtime");
46387
- // src/components/threads/ThreadDialog/Provider/index.tsx
46388
46355
  var import_react_compiler_runtime80 = require("react-compiler-runtime");
46389
- var import_react62 = require("react");
46356
+ // src/components/threads/ThreadDialog/Provider/index.tsx
46357
+ var import_react_compiler_runtime79 = require("react-compiler-runtime");
46358
+ var import_react61 = require("react");
46390
46359
  // src/contexts/threads/ThreadDialogContext/index.ts
46391
- var import_react60 = require("react");
46392
- var ThreadDialogContext = /* @__PURE__ */ (0, import_react60.createContext)({
46360
+ var import_react59 = require("react");
46361
+ var ThreadDialogContext = /* @__PURE__ */ (0, import_react59.createContext)({
46393
46362
  isOpen: false,
46394
46363
  setIsOpen: function() {}
46395
46364
  });
46396
46365
  // src/hooks/threads/useThreadDialogContext/index.ts
46397
- var import_react61 = require("react");
46366
+ var import_react60 = require("react");
46398
46367
  var useThreadDialogContext = function() {
46399
- return (0, import_react61.useContext)(ThreadDialogContext);
46368
+ return (0, import_react60.useContext)(ThreadDialogContext);
46400
46369
  };
46401
46370
  // src/components/threads/ThreadDialog/Provider/index.tsx
46402
- var import_jsx_runtime81 = require("react/jsx-runtime");
46371
+ var import_jsx_runtime80 = require("react/jsx-runtime");
46403
46372
  var Provider4 = function(t0) {
46404
- var $ = (0, import_react_compiler_runtime80.c)(5);
46373
+ var $ = (0, import_react_compiler_runtime79.c)(5);
46405
46374
  var children = t0.children;
46406
46375
  var threadDialogContext = useThreadDialogContext();
46407
- var _ref = _sliced_to_array((0, import_react62.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
46376
+ var _ref = _sliced_to_array((0, import_react61.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
46408
46377
  var t1;
46409
46378
  if ($[0] !== isOpen) {
46410
46379
  t1 = {
@@ -46418,7 +46387,7 @@ var Provider4 = function(t0) {
46418
46387
  }
46419
46388
  var t2;
46420
46389
  if ($[2] !== children || $[3] !== t1) {
46421
- t2 = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ThreadDialogContext.Provider, {
46390
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ThreadDialogContext.Provider, {
46422
46391
  value: t1,
46423
46392
  children: children
46424
46393
  });
@@ -46431,13 +46400,13 @@ var Provider4 = function(t0) {
46431
46400
  return t2;
46432
46401
  };
46433
46402
  // src/components/threads/ThreadDialog/Root/index.tsx
46434
- var import_jsx_runtime82 = require("react/jsx-runtime");
46403
+ var import_jsx_runtime81 = require("react/jsx-runtime");
46435
46404
  var Root13 = function(t0) {
46436
- var $ = (0, import_react_compiler_runtime81.c)(2);
46405
+ var $ = (0, import_react_compiler_runtime80.c)(2);
46437
46406
  var children = t0.children;
46438
46407
  var t1;
46439
46408
  if ($[0] !== children) {
46440
- t1 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Provider4, {
46409
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Provider4, {
46441
46410
  children: children
46442
46411
  });
46443
46412
  $[0] = children;
@@ -46448,13 +46417,13 @@ var Root13 = function(t0) {
46448
46417
  return t1;
46449
46418
  };
46450
46419
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46451
- var import_react_compiler_runtime83 = require("react-compiler-runtime");
46420
+ var import_react_compiler_runtime82 = require("react-compiler-runtime");
46452
46421
  var import_themes55 = require("@radix-ui/themes");
46453
46422
  // src/components/threads/ThreadDialog/Trigger/Button.tsx
46454
- var import_react_compiler_runtime82 = require("react-compiler-runtime");
46423
+ var import_react_compiler_runtime81 = require("react-compiler-runtime");
46455
46424
  var import_themes54 = require("@radix-ui/themes");
46456
46425
  var import_react_icons15 = require("@radix-ui/react-icons");
46457
- var import_jsx_runtime83 = require("react/jsx-runtime");
46426
+ var import_jsx_runtime82 = require("react/jsx-runtime");
46458
46427
  function ownKeys43(e, r) {
46459
46428
  var t = Object.keys(e);
46460
46429
  if (Object.getOwnPropertySymbols) {
@@ -46499,17 +46468,17 @@ function _toPrimitive43(t, r) {
46499
46468
  return ("string" === r ? String : Number)(t);
46500
46469
  }
46501
46470
  var Button4 = function(props) {
46502
- var $ = (0, import_react_compiler_runtime82.c)(3);
46471
+ var $ = (0, import_react_compiler_runtime81.c)(3);
46503
46472
  var t0;
46504
46473
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46505
- t0 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react_icons15.ChatBubbleIcon, {});
46474
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react_icons15.ChatBubbleIcon, {});
46506
46475
  $[0] = t0;
46507
46476
  } else {
46508
46477
  t0 = $[0];
46509
46478
  }
46510
46479
  var t1;
46511
46480
  if ($[1] !== props) {
46512
- t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes54.IconButton, _objectSpread43(_objectSpread43({
46481
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_themes54.IconButton, _objectSpread43(_objectSpread43({
46513
46482
  size: "4",
46514
46483
  radius: "full"
46515
46484
  }, props), {}, {
@@ -46523,7 +46492,7 @@ var Button4 = function(props) {
46523
46492
  return t1;
46524
46493
  };
46525
46494
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46526
- var import_jsx_runtime84 = require("react/jsx-runtime");
46495
+ var import_jsx_runtime83 = require("react/jsx-runtime");
46527
46496
  function ownKeys44(e, r) {
46528
46497
  var t = Object.keys(e);
46529
46498
  if (Object.getOwnPropertySymbols) {
@@ -46568,7 +46537,7 @@ function _toPrimitive44(t, r) {
46568
46537
  return ("string" === r ? String : Number)(t);
46569
46538
  }
46570
46539
  var Root14 = function(t0) {
46571
- var $ = (0, import_react_compiler_runtime83.c)(14);
46540
+ var $ = (0, import_react_compiler_runtime82.c)(14);
46572
46541
  var children = t0.children, style = t0.style, className = t0.className;
46573
46542
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46574
46543
  var t1 = isOpen ? "none" : "flex";
@@ -46613,7 +46582,7 @@ var Root14 = function(t0) {
46613
46582
  }
46614
46583
  var t6;
46615
46584
  if ($[8] !== children || $[9] !== className || $[10] !== t2 || $[11] !== t3 || $[12] !== t5) {
46616
- t6 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes55.Flex, {
46585
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes55.Flex, {
46617
46586
  display: t2,
46618
46587
  onClick: t3,
46619
46588
  direction: "column",
@@ -46639,17 +46608,17 @@ var Root14 = function(t0) {
46639
46608
  return t6;
46640
46609
  };
46641
46610
  var Trigger = function(args) {
46642
- var $ = (0, import_react_compiler_runtime83.c)(3);
46611
+ var $ = (0, import_react_compiler_runtime82.c)(3);
46643
46612
  var t0;
46644
46613
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46645
- t0 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button4, {});
46614
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button4, {});
46646
46615
  $[0] = t0;
46647
46616
  } else {
46648
46617
  t0 = $[0];
46649
46618
  }
46650
46619
  var t1;
46651
46620
  if ($[1] !== args) {
46652
- t1 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Root14, _objectSpread44(_objectSpread44({}, args), {}, {
46621
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Root14, _objectSpread44(_objectSpread44({}, args), {}, {
46653
46622
  children: t0
46654
46623
  }));
46655
46624
  $[1] = args;
@@ -46665,15 +46634,15 @@ function _temp6(prev) {
46665
46634
  return !prev;
46666
46635
  }
46667
46636
  // src/components/threads/ThreadDialog/Content/index.tsx
46668
- var import_react_compiler_runtime85 = require("react-compiler-runtime");
46637
+ var import_react_compiler_runtime84 = require("react-compiler-runtime");
46669
46638
  var import_themes57 = require("@radix-ui/themes");
46670
46639
  // src/components/threads/ThreadDialog/Close/index.tsx
46671
- var import_react_compiler_runtime84 = require("react-compiler-runtime");
46640
+ var import_react_compiler_runtime83 = require("react-compiler-runtime");
46672
46641
  var import_react_icons16 = require("@radix-ui/react-icons");
46673
46642
  var import_themes56 = require("@radix-ui/themes");
46674
- var import_jsx_runtime85 = require("react/jsx-runtime");
46643
+ var import_jsx_runtime84 = require("react/jsx-runtime");
46675
46644
  var Close = function() {
46676
- var $ = (0, import_react_compiler_runtime84.c)(9);
46645
+ var $ = (0, import_react_compiler_runtime83.c)(9);
46677
46646
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46678
46647
  var t0 = isOpen ? "flex" : "none";
46679
46648
  var t1;
@@ -46708,10 +46677,10 @@ var Close = function() {
46708
46677
  }
46709
46678
  var t4;
46710
46679
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
46711
- t4 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes56.IconButton, {
46680
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes56.IconButton, {
46712
46681
  size: "2",
46713
46682
  variant: "soft",
46714
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_icons16.Cross1Icon, {})
46683
+ children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_icons16.Cross1Icon, {})
46715
46684
  });
46716
46685
  $[5] = t4;
46717
46686
  } else {
@@ -46719,7 +46688,7 @@ var Close = function() {
46719
46688
  }
46720
46689
  var t5;
46721
46690
  if ($[6] !== t1 || $[7] !== t2) {
46722
- t5 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes56.Flex, {
46691
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes56.Flex, {
46723
46692
  display: t1,
46724
46693
  onClick: t2,
46725
46694
  direction: "column",
@@ -46744,7 +46713,7 @@ function _temp7(prev) {
46744
46713
  return !prev;
46745
46714
  }
46746
46715
  // src/components/threads/ThreadDialog/Content/index.tsx
46747
- var import_jsx_runtime86 = require("react/jsx-runtime");
46716
+ var import_jsx_runtime85 = require("react/jsx-runtime");
46748
46717
  function ownKeys45(e, r) {
46749
46718
  var t = Object.keys(e);
46750
46719
  if (Object.getOwnPropertySymbols) {
@@ -46789,7 +46758,7 @@ function _toPrimitive45(t, r) {
46789
46758
  return ("string" === r ? String : Number)(t);
46790
46759
  }
46791
46760
  var Root15 = function(t0) {
46792
- var $ = (0, import_react_compiler_runtime85.c)(19);
46761
+ var $ = (0, import_react_compiler_runtime84.c)(19);
46793
46762
  var children = t0.children, className = t0.className, style = t0.style;
46794
46763
  var isOpen = useThreadDialogContext().isOpen;
46795
46764
  if (!isOpen) {
@@ -46876,7 +46845,7 @@ var Root15 = function(t0) {
46876
46845
  }
46877
46846
  var t10;
46878
46847
  if ($[10] !== children) {
46879
- t10 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_themes57.Inset, {
46848
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes57.Inset, {
46880
46849
  clip: "padding-box",
46881
46850
  side: "all",
46882
46851
  pb: "current",
@@ -46890,14 +46859,14 @@ var Root15 = function(t0) {
46890
46859
  }
46891
46860
  var t11;
46892
46861
  if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
46893
- t11 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Close, {});
46862
+ t11 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Close, {});
46894
46863
  $[12] = t11;
46895
46864
  } else {
46896
46865
  t11 = $[12];
46897
46866
  }
46898
46867
  var t12;
46899
46868
  if ($[13] !== t10) {
46900
- t12 = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_themes57.Card, {
46869
+ t12 = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes57.Card, {
46901
46870
  mb: t7,
46902
46871
  style: t8,
46903
46872
  children: [
@@ -46912,7 +46881,7 @@ var Root15 = function(t0) {
46912
46881
  }
46913
46882
  var t13;
46914
46883
  if ($[15] !== className || $[16] !== t12 || $[17] !== t6) {
46915
- t13 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_themes57.Flex, {
46884
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes57.Flex, {
46916
46885
  className: className,
46917
46886
  direction: "column",
46918
46887
  justify: "end",
@@ -46936,7 +46905,7 @@ var Root15 = function(t0) {
46936
46905
  return t13;
46937
46906
  };
46938
46907
  var Messages3 = function(t0) {
46939
- var $ = (0, import_react_compiler_runtime85.c)(5);
46908
+ var $ = (0, import_react_compiler_runtime84.c)(5);
46940
46909
  var className = t0.className, style = t0.style;
46941
46910
  var t1;
46942
46911
  if ($[0] !== style) {
@@ -46952,7 +46921,7 @@ var Messages3 = function(t0) {
46952
46921
  }
46953
46922
  var t2;
46954
46923
  if ($[2] !== className || $[3] !== t1) {
46955
- t2 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Thread.Messages, {
46924
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Thread.Messages, {
46956
46925
  className: className,
46957
46926
  style: t1
46958
46927
  });
@@ -46965,11 +46934,11 @@ var Messages3 = function(t0) {
46965
46934
  return t2;
46966
46935
  };
46967
46936
  var FormContainer = function(t0) {
46968
- var $ = (0, import_react_compiler_runtime85.c)(4);
46937
+ var $ = (0, import_react_compiler_runtime84.c)(4);
46969
46938
  var children = t0.children, className = t0.className, style = t0.style;
46970
46939
  var t1;
46971
46940
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
46972
- t1 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_themes57.Flex, {
46941
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes57.Flex, {
46973
46942
  direction: "column",
46974
46943
  pl: "5",
46975
46944
  pr: "5",
@@ -46989,21 +46958,21 @@ var FormContainer = function(t0) {
46989
46958
  return t1;
46990
46959
  };
46991
46960
  var Content8 = function(props) {
46992
- var $ = (0, import_react_compiler_runtime85.c)(4);
46961
+ var $ = (0, import_react_compiler_runtime84.c)(4);
46993
46962
  var t0;
46994
46963
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46995
- t0 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Messages3, {});
46964
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Messages3, {});
46996
46965
  $[0] = t0;
46997
46966
  } else {
46998
46967
  t0 = $[0];
46999
46968
  }
47000
46969
  var t1;
47001
46970
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
47002
- t1 = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Thread.Root, {
46971
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Thread.Root, {
47003
46972
  children: [
47004
46973
  t0,
47005
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(FormContainer, {
47006
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Thread.MessageForm, {})
46974
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormContainer, {
46975
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Thread.MessageForm, {})
47007
46976
  })
47008
46977
  ]
47009
46978
  });
@@ -47013,7 +46982,7 @@ var Content8 = function(props) {
47013
46982
  }
47014
46983
  var t2;
47015
46984
  if ($[2] !== props) {
47016
- t2 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Root15, _objectSpread45(_objectSpread45({}, props), {}, {
46985
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Root15, _objectSpread45(_objectSpread45({}, props), {}, {
47017
46986
  children: t1
47018
46987
  }));
47019
46988
  $[2] = props;
@@ -47027,15 +46996,15 @@ Content8.Root = Root15;
47027
46996
  Content8.Messages = Messages3;
47028
46997
  Content8.FormContainer = FormContainer;
47029
46998
  // src/components/threads/ThreadDialog/index.tsx
47030
- var import_jsx_runtime87 = require("react/jsx-runtime");
46999
+ var import_jsx_runtime86 = require("react/jsx-runtime");
47031
47000
  var ThreadDialog = function() {
47032
- var $ = (0, import_react_compiler_runtime86.c)(1);
47001
+ var $ = (0, import_react_compiler_runtime85.c)(1);
47033
47002
  var t0;
47034
47003
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
47035
- t0 = /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Root13, {
47004
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Root13, {
47036
47005
  children: [
47037
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Content8, {}),
47038
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Trigger, {})
47006
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Content8, {}),
47007
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Trigger, {})
47039
47008
  ]
47040
47009
  });
47041
47010
  $[0] = t0;
@@ -47048,30 +47017,30 @@ ThreadDialog.Root = Root13;
47048
47017
  ThreadDialog.Trigger = Trigger;
47049
47018
  ThreadDialog.Content = Content8;
47050
47019
  // src/components/threads/AudioThreadDialog/index.tsx
47051
- var import_react_compiler_runtime101 = require("react-compiler-runtime");
47020
+ var import_react_compiler_runtime99 = require("react-compiler-runtime");
47052
47021
  // src/components/threads/AudioThread/index.tsx
47053
- var import_react_compiler_runtime100 = require("react-compiler-runtime");
47022
+ var import_react_compiler_runtime98 = require("react-compiler-runtime");
47054
47023
  // src/components/threads/AudioThread/Root/index.tsx
47055
- var import_react_compiler_runtime92 = require("react-compiler-runtime");
47024
+ var import_react_compiler_runtime90 = require("react-compiler-runtime");
47056
47025
  var import_themes58 = require("@radix-ui/themes");
47057
47026
  // src/contexts/threads/AudioThreadContext/index.ts
47058
- var import_react63 = require("react");
47059
- var AudioThreadContext = /* @__PURE__ */ (0, import_react63.createContext)({
47027
+ var import_react62 = require("react");
47028
+ var AudioThreadContext = /* @__PURE__ */ (0, import_react62.createContext)({
47060
47029
  audioRuntime: null
47061
47030
  });
47062
47031
  // src/hooks/threads/useAudioThreadContext/index.ts
47063
- var import_react64 = require("react");
47032
+ var import_react63 = require("react");
47064
47033
  var useAudioThreadContext = function() {
47065
- return (0, import_react64.useContext)(AudioThreadContext);
47034
+ return (0, import_react63.useContext)(AudioThreadContext);
47066
47035
  };
47067
47036
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
47068
- var import_react_compiler_runtime91 = require("react-compiler-runtime");
47037
+ var import_react_compiler_runtime89 = require("react-compiler-runtime");
47069
47038
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
47070
- var import_react_compiler_runtime90 = require("react-compiler-runtime");
47071
- var import_react69 = require("react");
47039
+ var import_react_compiler_runtime88 = require("react-compiler-runtime");
47040
+ var import_react68 = require("react");
47072
47041
  // src/hooks/misc/usePermission/index.ts
47073
- var import_react_compiler_runtime87 = require("react-compiler-runtime");
47074
- var import_react65 = require("react");
47042
+ var import_react_compiler_runtime86 = require("react-compiler-runtime");
47043
+ var import_react64 = require("react");
47075
47044
  // src/hooks/misc/usePermission/util.ts
47076
47045
  var noop = function() {};
47077
47046
  function on(obj) {
@@ -47094,8 +47063,8 @@ function off(obj) {
47094
47063
  }
47095
47064
  // src/hooks/misc/usePermission/index.ts
47096
47065
  var usePermission = function(permissionDesc) {
47097
- var $ = (0, import_react_compiler_runtime87.c)(3);
47098
- var _ref = _sliced_to_array((0, import_react65.useState)(""), 2), state = _ref[0], setState = _ref[1];
47066
+ var $ = (0, import_react_compiler_runtime86.c)(3);
47067
+ var _ref = _sliced_to_array((0, import_react64.useState)(""), 2), state = _ref[0], setState = _ref[1];
47099
47068
  var t0;
47100
47069
  var t1;
47101
47070
  if ($[0] !== permissionDesc) {
@@ -47134,20 +47103,20 @@ var usePermission = function(permissionDesc) {
47134
47103
  t0 = $[1];
47135
47104
  t1 = $[2];
47136
47105
  }
47137
- (0, import_react65.useEffect)(t0, t1);
47106
+ (0, import_react64.useEffect)(t0, t1);
47138
47107
  return state;
47139
47108
  };
47140
47109
  // src/hooks/audioThreads/useRecorder/index.ts
47141
47110
  var import_dayjs3 = __toESM(require("dayjs"), 1);
47142
47111
  var import_use_audio_capture = require("@supercorp/use-audio-capture");
47143
- var import_react67 = require("react");
47112
+ var import_react66 = require("react");
47144
47113
  var import_react_use_audio_player = require("react-use-audio-player");
47145
47114
  // src/hooks/misc/useInterval.ts
47146
- var import_react_compiler_runtime88 = require("react-compiler-runtime");
47147
- var import_react66 = require("react");
47115
+ var import_react_compiler_runtime87 = require("react-compiler-runtime");
47116
+ var import_react65 = require("react");
47148
47117
  var useInterval = function(callback, delay) {
47149
- var $ = (0, import_react_compiler_runtime88.c)(5);
47150
- var savedCallback = (0, import_react66.useRef)(_temp8);
47118
+ var $ = (0, import_react_compiler_runtime87.c)(5);
47119
+ var savedCallback = (0, import_react65.useRef)(_temp8);
47151
47120
  var t0;
47152
47121
  if ($[0] !== callback) {
47153
47122
  t0 = function() {
@@ -47158,7 +47127,7 @@ var useInterval = function(callback, delay) {
47158
47127
  } else {
47159
47128
  t0 = $[1];
47160
47129
  }
47161
- (0, import_react66.useEffect)(t0);
47130
+ (0, import_react65.useEffect)(t0);
47162
47131
  var t1;
47163
47132
  var t2;
47164
47133
  if ($[2] !== delay) {
@@ -47182,7 +47151,7 @@ var useInterval = function(callback, delay) {
47182
47151
  t1 = $[3];
47183
47152
  t2 = $[4];
47184
47153
  }
47185
- (0, import_react66.useEffect)(t1, t2);
47154
+ (0, import_react65.useEffect)(t1, t2);
47186
47155
  };
47187
47156
  function _temp8() {}
47188
47157
  // src/hooks/audioThreads/useRecorder/index.ts
@@ -47254,14 +47223,14 @@ function _asyncToGenerator10(n) {
47254
47223
  }
47255
47224
  var useRecorder = function(_ref) {
47256
47225
  var isStopOnSilence = _ref.isStopOnSilence, _onStart = _ref.onStart, _onStop = _ref.onStop;
47257
- var _$_ref = _sliced_to_array((0, import_react67.useState)(null), 2), silenceStart = _$_ref[0], setSilenceStart = _$_ref[1];
47258
- var _$_ref1 = _sliced_to_array((0, import_react67.useState)(null), 2), noiseStart = _$_ref1[0], setNoiseStart = _$_ref1[1];
47259
- var _$_ref2 = _sliced_to_array((0, import_react67.useState)(null), 2), mediaStream = _$_ref2[0], setMediaStream = _$_ref2[1];
47260
- var _$_ref3 = _sliced_to_array((0, import_react67.useState)("idle"), 2), status = _$_ref3[0], setStatus = _$_ref3[1];
47226
+ var _$_ref = _sliced_to_array((0, import_react66.useState)(null), 2), silenceStart = _$_ref[0], setSilenceStart = _$_ref[1];
47227
+ var _$_ref1 = _sliced_to_array((0, import_react66.useState)(null), 2), noiseStart = _$_ref1[0], setNoiseStart = _$_ref1[1];
47228
+ var _$_ref2 = _sliced_to_array((0, import_react66.useState)(null), 2), mediaStream = _$_ref2[0], setMediaStream = _$_ref2[1];
47229
+ var _$_ref3 = _sliced_to_array((0, import_react66.useState)("idle"), 2), status = _$_ref3[0], setStatus = _$_ref3[1];
47261
47230
  var startAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
47262
47231
  var endAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
47263
- var _$_ref4 = _sliced_to_array((0, import_react67.useState)(false), 2), isLoaded = _$_ref4[0], setIsLoaded = _$_ref4[1];
47264
- (0, import_react67.useEffect)(function() {
47232
+ var _$_ref4 = _sliced_to_array((0, import_react66.useState)(false), 2), isLoaded = _$_ref4[0], setIsLoaded = _$_ref4[1];
47233
+ (0, import_react66.useEffect)(function() {
47265
47234
  if (isLoaded) return;
47266
47235
  setIsLoaded(true);
47267
47236
  }, [
@@ -47321,9 +47290,9 @@ var useRecorder = function(_ref) {
47321
47290
  setNoiseStart(null);
47322
47291
  }
47323
47292
  });
47324
- var _$_ref5 = _sliced_to_array((0, import_react67.useState)(null), 2), audioEngine = _$_ref5[0], setAudioEngine = _$_ref5[1];
47325
- var isInited = (0, import_react67.useRef)(false);
47326
- (0, import_react67.useEffect)(function() {
47293
+ var _$_ref5 = _sliced_to_array((0, import_react66.useState)(null), 2), audioEngine = _$_ref5[0], setAudioEngine = _$_ref5[1];
47294
+ var isInited = (0, import_react66.useRef)(false);
47295
+ (0, import_react66.useEffect)(function() {
47327
47296
  if (!mediaStream) return;
47328
47297
  if (isInited.current) return;
47329
47298
  isInited.current = true;
@@ -47336,7 +47305,7 @@ var useRecorder = function(_ref) {
47336
47305
  isInited,
47337
47306
  mediaStream
47338
47307
  ]);
47339
- var visualizationAnalyser = (0, import_react67.useMemo)(function() {
47308
+ var visualizationAnalyser = (0, import_react66.useMemo)(function() {
47340
47309
  if (!audioEngine) return null;
47341
47310
  var result = audioEngine.audioContext.createAnalyser();
47342
47311
  audioEngine.source.connect(result);
@@ -47344,7 +47313,7 @@ var useRecorder = function(_ref) {
47344
47313
  }, [
47345
47314
  audioEngine
47346
47315
  ]);
47347
- var silenceAnalyser = (0, import_react67.useMemo)(function() {
47316
+ var silenceAnalyser = (0, import_react66.useMemo)(function() {
47348
47317
  if (!audioEngine) return null;
47349
47318
  var result_0 = audioEngine.audioContext.createAnalyser();
47350
47319
  result_0.minDecibels = -60;
@@ -47353,7 +47322,7 @@ var useRecorder = function(_ref) {
47353
47322
  }, [
47354
47323
  audioEngine
47355
47324
  ]);
47356
- var handleSilence = (0, import_react67.useCallback)(function() {
47325
+ var handleSilence = (0, import_react66.useCallback)(function() {
47357
47326
  if (!silenceAnalyser) return;
47358
47327
  var frequencyData = new Uint8Array(silenceAnalyser.frequencyBinCount);
47359
47328
  silenceAnalyser.getByteFrequencyData(frequencyData);
@@ -47376,7 +47345,7 @@ var useRecorder = function(_ref) {
47376
47345
  setNoiseStart,
47377
47346
  setSilenceStart
47378
47347
  ]);
47379
- (0, import_react67.useEffect)(function() {
47348
+ (0, import_react66.useEffect)(function() {
47380
47349
  if (!isStopOnSilence) return;
47381
47350
  requestAnimationFrame(function() {
47382
47351
  return handleSilence();
@@ -47399,8 +47368,7 @@ var useRecorder = function(_ref) {
47399
47368
  });
47400
47369
  };
47401
47370
  // src/hooks/audioThreads/useMessageAudio/index.ts
47402
- var import_react_compiler_runtime89 = require("react-compiler-runtime");
47403
- var import_react68 = require("react");
47371
+ var import_react67 = require("react");
47404
47372
  var import_compromise = __toESM(require("compromise"), 1);
47405
47373
  var import_howler = require("howler");
47406
47374
  var import_react_use_audio_player2 = require("react-use-audio-player");
@@ -47479,424 +47447,222 @@ var getMessageSentences = function(_ref) {
47479
47447
  };
47480
47448
  });
47481
47449
  };
47482
- var useMessageAudio = function(t0) {
47483
- var _latestMessageProps$l, _latestMessageProps$l4, _latestMessageProps$l5;
47484
- var $ = (0, import_react_compiler_runtime89.c)(68);
47485
- var _onEnd = t0.onEnd, passedPlay = t0.play, t1 = t0.fullSentenceRegex;
47486
- var t2;
47487
- if ($[0] !== t1) {
47488
- t2 = t1 === void 0 ? /[\.?!]$/ : t1;
47489
- $[0] = t1;
47490
- $[1] = t2;
47491
- } else {
47492
- t2 = $[1];
47493
- }
47494
- var fullSentenceRegex = t2;
47495
- var _ref = _sliced_to_array((0, import_react68.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
47496
- var t3;
47497
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
47498
- t3 = [];
47499
- $[2] = t3;
47500
- } else {
47501
- t3 = $[2];
47502
- }
47503
- var _ref1 = _sliced_to_array((0, import_react68.useState)(t3), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
47504
- var t4;
47505
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
47506
- t4 = [];
47507
- $[3] = t4;
47508
- } else {
47509
- t4 = $[3];
47510
- }
47511
- var _ref2 = _sliced_to_array((0, import_react68.useState)(t4), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
47450
+ var useMessageAudio = function(_ref2) {
47451
+ var _latestMessageProps$l2;
47452
+ var _onEnd = _ref2.onEnd, passedPlay = _ref2.play, _ref2_fullSentenceRegex = _ref2.fullSentenceRegex, fullSentenceRegex = _ref2_fullSentenceRegex === void 0 ? /[\.?!]$/ : _ref2_fullSentenceRegex;
47453
+ var _ref = _sliced_to_array((0, import_react67.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
47454
+ var _ref1 = _sliced_to_array((0, import_react67.useState)([]), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
47455
+ var _ref3 = _sliced_to_array((0, import_react67.useState)([]), 2), playedMessageSentences = _ref3[0], setPlayedMessageSentences = _ref3[1];
47512
47456
  var audioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
47513
47457
  var nextAudioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
47514
47458
  var superinterfaceContext = useSuperinterfaceContext();
47515
- var _ref3 = _sliced_to_array((0, import_react68.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
47516
- var isLastSentencePlayedRef = (0, import_react68.useRef)(false);
47459
+ var _ref4 = _sliced_to_array((0, import_react67.useState)(false), 2), isPlaying = _ref4[0], setIsPlaying = _ref4[1];
47460
+ var isLastSentencePlayedRef = (0, import_react67.useRef)(false);
47517
47461
  var latestMessageProps = useLatestMessage();
47518
- var t5;
47519
- var t6;
47520
- if ($[4] !== isPlaying) {
47521
- t5 = function() {
47522
- if (!isPlaying) {
47523
- return;
47524
- }
47525
- isLastSentencePlayedRef.current = false;
47526
- };
47527
- t6 = [
47528
- isPlaying
47529
- ];
47530
- $[4] = isPlaying;
47531
- $[5] = t5;
47532
- $[6] = t6;
47533
- } else {
47534
- t5 = $[5];
47535
- t6 = $[6];
47536
- }
47537
- (0, import_react68.useEffect)(t5, t6);
47538
- var t7;
47539
- bb0: {
47540
- if (!latestMessageProps.latestMessage) {
47541
- var _t;
47542
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
47543
- _t = [];
47544
- $[7] = _t;
47545
- } else {
47546
- _t = $[7];
47547
- }
47548
- t7 = _t;
47549
- break bb0;
47550
- }
47551
- if (latestMessageProps.latestMessage.role !== "assistant") {
47552
- var _t2;
47553
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
47554
- _t2 = [];
47555
- $[8] = _t2;
47556
- } else {
47557
- _t2 = $[8];
47558
- }
47559
- t7 = _t2;
47560
- break bb0;
47561
- }
47562
- if (stoppedMessageIds.includes(latestMessageProps.latestMessage.id)) {
47563
- var _t3;
47564
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
47565
- _t3 = [];
47566
- $[9] = _t3;
47567
- } else {
47568
- _t3 = $[9];
47569
- }
47570
- t7 = _t3;
47571
- break bb0;
47572
- }
47573
- var _t4;
47574
- if ($[10] !== latestMessageProps.latestMessage || $[11] !== playedMessageSentences) {
47575
- var input2 = input({
47576
- message: latestMessageProps.latestMessage
47577
- });
47578
- if (!input2) {
47579
- var _t5;
47580
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
47581
- _t5 = [];
47582
- $[14] = _t5;
47583
- } else {
47584
- _t5 = $[14];
47585
- }
47586
- t7 = _t5;
47587
- break bb0;
47588
- }
47589
- var messageSentences = getMessageSentences({
47590
- messageId: latestMessageProps.latestMessage.id,
47591
- input: input2
47592
- });
47593
- var _t6;
47594
- if ($[15] !== playedMessageSentences) {
47595
- _t6 = function(ms) {
47596
- return !playedMessageSentences.find(function(pms) {
47597
- return pms.messageId === ms.messageId && pms.sentence === ms.sentence;
47598
- });
47599
- };
47600
- $[15] = playedMessageSentences;
47601
- $[16] = _t6;
47602
- } else {
47603
- _t6 = $[16];
47604
- }
47605
- _t4 = messageSentences.filter(_t6);
47606
- $[10] = latestMessageProps.latestMessage;
47607
- $[11] = playedMessageSentences;
47608
- $[12] = _t4;
47609
- $[13] = t7;
47610
- } else {
47611
- _t4 = $[12];
47612
- t7 = $[13];
47613
- }
47614
- t7 = _t4;
47615
- }
47616
- var unplayedMessageSentences = t7;
47617
- var t8;
47618
- if ($[17] !== audioPlayer || $[18] !== fullSentenceRegex || $[19] !== isAudioPlayed || $[20] !== nextAudioPlayer || $[21] !== superinterfaceContext || $[22] !== unplayedMessageSentences[1]) {
47619
- t8 = function(t92) {
47620
- var input_0 = t92.input, onPlay = t92.onPlay, onStop = t92.onStop, onEnd_0 = t92.onEnd;
47621
- var searchParams = new URLSearchParams(_objectSpread47({
47462
+ var messagesProps = useMessages();
47463
+ (0, import_react67.useEffect)(function() {
47464
+ if (!isPlaying) return;
47465
+ isLastSentencePlayedRef.current = false;
47466
+ }, [
47467
+ isPlaying
47468
+ ]);
47469
+ var unplayedMessageSentences = (0, import_react67.useMemo)(function() {
47470
+ var playableMessages = messagesProps.messages.filter(function(message) {
47471
+ if (message.role !== "assistant") return false;
47472
+ if (stoppedMessageIds.includes(message.id)) return false;
47473
+ return true;
47474
+ });
47475
+ var messageInputs = playableMessages.map(function(message_0) {
47476
+ return {
47477
+ message: message_0,
47478
+ input: input({
47479
+ message: message_0
47480
+ })
47481
+ };
47482
+ }).filter(function(_ref3) {
47483
+ var input2 = _ref3.input;
47484
+ return input2 !== null;
47485
+ });
47486
+ var messageSentences = messageInputs.flatMap(function(_ref4) {
47487
+ var message_1 = _ref4.message, input_0 = _ref4.input;
47488
+ return getMessageSentences({
47489
+ messageId: message_1.id,
47622
47490
  input: input_0
47623
- }, superinterfaceContext.variables));
47624
- audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
47625
- format: "mp3",
47626
- autoplay: isAudioPlayed,
47627
- html5: isHtmlAudioSupported,
47628
- onplay: onPlay,
47629
- onstop: onStop,
47630
- onload: function() {
47631
- var nextUnplayedMessageSentence = unplayedMessageSentences[1];
47632
- if (!nextUnplayedMessageSentence) {
47633
- return;
47634
- }
47635
- var isNextFullSentence = fullSentenceRegex.test(nextUnplayedMessageSentence.sentence);
47636
- if (!isNextFullSentence) {
47637
- return;
47638
- }
47639
- var nextSearchParams = new URLSearchParams(_objectSpread47({
47640
- input: nextUnplayedMessageSentence.sentence
47641
- }, superinterfaceContext.variables));
47642
- nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
47643
- format: "mp3",
47644
- autoplay: false,
47645
- html5: isHtmlAudioSupported
47646
- });
47647
- },
47648
- onend: onEnd_0
47649
- });
47650
- };
47651
- $[17] = audioPlayer;
47652
- $[18] = fullSentenceRegex;
47653
- $[19] = isAudioPlayed;
47654
- $[20] = nextAudioPlayer;
47655
- $[21] = superinterfaceContext;
47656
- $[22] = unplayedMessageSentences[1];
47657
- $[23] = t8;
47658
- } else {
47659
- t8 = $[23];
47660
- }
47661
- var defaultPlay = t8;
47662
- var t9;
47663
- t9 = passedPlay || defaultPlay;
47664
- var play = t9;
47665
- var t10;
47666
- if ($[24] !== audioPlayer.playing || $[25] !== fullSentenceRegex || $[26] !== isPlaying || $[27] !== latestMessageProps.latestMessage || $[28] !== _onEnd || $[29] !== play || $[30] !== unplayedMessageSentences[0] || $[31] !== unplayedMessageSentences.length) {
47667
- t10 = function() {
47668
- if (isPlaying) {
47669
- return;
47670
- }
47671
- if (audioPlayer.playing) {
47672
- return;
47673
- }
47674
- if (!latestMessageProps.latestMessage) {
47675
- return;
47676
- }
47677
- if (latestMessageProps.latestMessage.role !== "assistant") {
47678
- return;
47679
- }
47680
- var firstUnplayedMessageSentence = unplayedMessageSentences[0];
47681
- if (!firstUnplayedMessageSentence) {
47682
- return;
47683
- }
47684
- var isFullSentence = isOptimistic({
47685
- id: latestMessageProps.latestMessage.id
47686
- }) || latestMessageProps.latestMessage.status !== "in_progress" || fullSentenceRegex.test(firstUnplayedMessageSentence.sentence);
47687
- if (!isFullSentence) {
47688
- return;
47689
- }
47690
- setIsPlaying(true);
47691
- setPlayedMessageSentences(function(prev) {
47692
- return _to_consumable_array(prev).concat([
47693
- firstUnplayedMessageSentence
47694
- ]);
47695
47491
  });
47696
- var input_1 = firstUnplayedMessageSentence.sentence;
47697
- play({
47698
- input: input_1,
47699
- onPlay: function() {
47700
- setIsAudioPlayed(true);
47701
- },
47702
- onStop: function() {
47703
- setStoppedMessageIds(function(prev_0) {
47704
- return _to_consumable_array(prev_0).concat([
47705
- firstUnplayedMessageSentence.messageId
47706
- ]);
47707
- });
47708
- setIsPlaying(false);
47709
- },
47710
- onEnd: function() {
47711
- setIsPlaying(false);
47712
- isLastSentencePlayedRef.current = unplayedMessageSentences.length === 1;
47713
- if (isLastSentencePlayedRef.current && latestMessageProps.latestMessage.status !== "in_progress") {
47714
- _onEnd();
47715
- isLastSentencePlayedRef.current = false;
47716
- }
47717
- }
47492
+ });
47493
+ return messageSentences.filter(function(ms) {
47494
+ return !playedMessageSentences.find(function(pms) {
47495
+ return pms.messageId === ms.messageId && pms.sentence === ms.sentence;
47718
47496
  });
47719
- };
47720
- $[24] = audioPlayer.playing;
47721
- $[25] = fullSentenceRegex;
47722
- $[26] = isPlaying;
47723
- $[27] = latestMessageProps.latestMessage;
47724
- $[28] = _onEnd;
47725
- $[29] = play;
47726
- $[30] = unplayedMessageSentences[0];
47727
- $[31] = unplayedMessageSentences.length;
47728
- $[32] = t10;
47729
- } else {
47730
- t10 = $[32];
47731
- }
47732
- var t11;
47733
- if ($[33] !== audioPlayer || $[34] !== fullSentenceRegex || $[35] !== isPlaying || $[36] !== latestMessageProps || $[37] !== nextAudioPlayer || $[38] !== _onEnd || $[39] !== play || $[40] !== playedMessageSentences || $[41] !== superinterfaceContext || $[42] !== unplayedMessageSentences) {
47734
- t11 = [
47735
- unplayedMessageSentences,
47736
- isPlaying,
47737
- superinterfaceContext,
47738
- latestMessageProps,
47739
- audioPlayer,
47740
- nextAudioPlayer,
47741
- playedMessageSentences,
47742
- _onEnd,
47743
- play,
47744
- fullSentenceRegex
47745
- ];
47746
- $[33] = audioPlayer;
47747
- $[34] = fullSentenceRegex;
47748
- $[35] = isPlaying;
47749
- $[36] = latestMessageProps;
47750
- $[37] = nextAudioPlayer;
47751
- $[38] = _onEnd;
47752
- $[39] = play;
47753
- $[40] = playedMessageSentences;
47754
- $[41] = superinterfaceContext;
47755
- $[42] = unplayedMessageSentences;
47756
- $[43] = t11;
47757
- } else {
47758
- t11 = $[43];
47759
- }
47760
- (0, import_react68.useEffect)(t10, t11);
47761
- var t12;
47762
- if ($[44] !== isPlaying || $[45] !== ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) || $[46] !== _onEnd || $[47] !== unplayedMessageSentences.length) {
47763
- var _latestMessageProps$l3;
47764
- t12 = function() {
47765
- var _latestMessageProps$l2;
47766
- if (isLastSentencePlayedRef.current && !isPlaying && unplayedMessageSentences.length === 0 && ((_latestMessageProps$l2 = latestMessageProps.latestMessage) === null || _latestMessageProps$l2 === void 0 ? void 0 : _latestMessageProps$l2.status) !== "in_progress") {
47767
- _onEnd();
47768
- isLastSentencePlayedRef.current = false;
47769
- }
47770
- };
47771
- $[44] = isPlaying;
47772
- $[45] = (_latestMessageProps$l3 = latestMessageProps.latestMessage) === null || _latestMessageProps$l3 === void 0 ? void 0 : _latestMessageProps$l3.status;
47773
- $[46] = _onEnd;
47774
- $[47] = unplayedMessageSentences.length;
47775
- $[48] = t12;
47776
- } else {
47777
- t12 = $[48];
47778
- }
47779
- var t13 = (_latestMessageProps$l4 = latestMessageProps.latestMessage) === null || _latestMessageProps$l4 === void 0 ? void 0 : _latestMessageProps$l4.status;
47780
- var t14;
47781
- if ($[49] !== isPlaying || $[50] !== _onEnd || $[51] !== t13 || $[52] !== unplayedMessageSentences.length) {
47782
- t14 = [
47783
- isPlaying,
47784
- unplayedMessageSentences.length,
47785
- t13,
47786
- _onEnd
47787
- ];
47788
- $[49] = isPlaying;
47789
- $[50] = _onEnd;
47790
- $[51] = t13;
47791
- $[52] = unplayedMessageSentences.length;
47792
- $[53] = t14;
47793
- } else {
47794
- t14 = $[53];
47795
- }
47796
- (0, import_react68.useEffect)(t12, t14);
47797
- var t15;
47798
- if ($[54] !== audioPlayer) {
47799
- t15 = [
47800
- audioPlayer
47801
- ];
47802
- $[54] = audioPlayer;
47803
- $[55] = t15;
47804
- } else {
47805
- t15 = $[55];
47806
- }
47807
- (0, import_react68.useEffect)(_temp9, t15);
47808
- var _ref4 = _sliced_to_array((0, import_react68.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
47809
- var isAudioEngineInited = (0, import_react68.useRef)(false);
47810
- var t16;
47811
- if ($[56] !== audioPlayer.playing) {
47812
- t16 = function() {
47813
- if (!audioPlayer.playing) {
47814
- return;
47815
- }
47816
- if (isAudioEngineInited.current) {
47817
- return;
47818
- }
47819
- isAudioEngineInited.current = true;
47820
- if (isHtmlAudioSupported) {
47821
- var audioContext = new AudioContext();
47822
- setAudioEngine({
47823
- source: audioContext.createMediaElementSource(import_howler.Howler._howls[0]._sounds[0]._node),
47824
- audioContext: audioContext
47497
+ });
47498
+ }, [
47499
+ messagesProps,
47500
+ playedMessageSentences
47501
+ ]);
47502
+ var defaultPlay = (0, import_react67.useCallback)(function(_ref5) {
47503
+ var input_1 = _ref5.input, onPlay = _ref5.onPlay, onStop = _ref5.onStop, onEnd_0 = _ref5.onEnd;
47504
+ var searchParams = new URLSearchParams(_objectSpread47({
47505
+ input: input_1
47506
+ }, superinterfaceContext.variables));
47507
+ audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
47508
+ format: "mp3",
47509
+ autoplay: isAudioPlayed,
47510
+ html5: isHtmlAudioSupported,
47511
+ onplay: onPlay,
47512
+ onstop: onStop,
47513
+ onload: function() {
47514
+ var nextUnplayedMessageSentence = unplayedMessageSentences[1];
47515
+ if (!nextUnplayedMessageSentence) return;
47516
+ var isNextFullSentence = fullSentenceRegex.test(nextUnplayedMessageSentence.sentence);
47517
+ if (!isNextFullSentence) return;
47518
+ var nextSearchParams = new URLSearchParams(_objectSpread47({
47519
+ input: nextUnplayedMessageSentence.sentence
47520
+ }, superinterfaceContext.variables));
47521
+ nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
47522
+ format: "mp3",
47523
+ autoplay: false,
47524
+ html5: isHtmlAudioSupported
47825
47525
  });
47826
- } else {
47827
- setAudioEngine({
47828
- source: import_howler.Howler.masterGain,
47829
- audioContext: import_howler.Howler.ctx
47526
+ },
47527
+ onend: onEnd_0
47528
+ });
47529
+ }, [
47530
+ superinterfaceContext,
47531
+ unplayedMessageSentences,
47532
+ audioPlayer,
47533
+ nextAudioPlayer,
47534
+ isAudioPlayed,
47535
+ fullSentenceRegex
47536
+ ]);
47537
+ var play = (0, import_react67.useMemo)(function() {
47538
+ return passedPlay || defaultPlay;
47539
+ }, [
47540
+ passedPlay,
47541
+ defaultPlay
47542
+ ]);
47543
+ (0, import_react67.useEffect)(function() {
47544
+ if (isPlaying) return;
47545
+ if (audioPlayer.playing) return;
47546
+ if (!latestMessageProps.latestMessage) return;
47547
+ if (latestMessageProps.latestMessage.role !== "assistant") return;
47548
+ var firstUnplayedMessageSentence = unplayedMessageSentences[0];
47549
+ if (!firstUnplayedMessageSentence) {
47550
+ return;
47551
+ }
47552
+ var isFullSentence = isOptimistic({
47553
+ id: latestMessageProps.latestMessage.id
47554
+ }) || latestMessageProps.latestMessage.status !== "in_progress" || fullSentenceRegex.test(firstUnplayedMessageSentence.sentence);
47555
+ if (!isFullSentence) return;
47556
+ setIsPlaying(true);
47557
+ setPlayedMessageSentences(function(prev) {
47558
+ return _to_consumable_array(prev).concat([
47559
+ firstUnplayedMessageSentence
47560
+ ]);
47561
+ });
47562
+ var input_2 = firstUnplayedMessageSentence.sentence;
47563
+ play({
47564
+ input: input_2,
47565
+ onPlay: function() {
47566
+ setIsAudioPlayed(true);
47567
+ },
47568
+ onStop: function() {
47569
+ setStoppedMessageIds(function(prev_0) {
47570
+ return _to_consumable_array(prev_0).concat([
47571
+ firstUnplayedMessageSentence.messageId
47572
+ ]);
47830
47573
  });
47574
+ setIsPlaying(false);
47575
+ },
47576
+ onEnd: function() {
47577
+ setIsPlaying(false);
47578
+ isLastSentencePlayedRef.current = unplayedMessageSentences.length === 1;
47579
+ if (isLastSentencePlayedRef.current && latestMessageProps.latestMessage.status !== "in_progress") {
47580
+ _onEnd();
47581
+ isLastSentencePlayedRef.current = false;
47582
+ }
47831
47583
  }
47832
- };
47833
- $[56] = audioPlayer.playing;
47834
- $[57] = t16;
47835
- } else {
47836
- t16 = $[57];
47837
- }
47838
- var t17;
47839
- if ($[58] !== audioPlayer) {
47840
- t17 = [
47841
- audioPlayer,
47842
- isAudioEngineInited
47843
- ];
47844
- $[58] = audioPlayer;
47845
- $[59] = t17;
47846
- } else {
47847
- t17 = $[59];
47848
- }
47849
- (0, import_react68.useEffect)(t16, t17);
47850
- var t18;
47851
- bb1: {
47852
- if (!audioEngine) {
47853
- t18 = null;
47854
- break bb1;
47855
- }
47856
- var result;
47857
- if ($[60] !== audioEngine.audioContext || $[61] !== audioEngine.source) {
47858
- result = audioEngine.audioContext.createAnalyser();
47859
- audioEngine.source.connect(audioEngine.audioContext.destination);
47860
- audioEngine.source.connect(result);
47861
- $[60] = audioEngine.audioContext;
47862
- $[61] = audioEngine.source;
47863
- $[62] = result;
47584
+ });
47585
+ }, [
47586
+ unplayedMessageSentences,
47587
+ isPlaying,
47588
+ superinterfaceContext,
47589
+ latestMessageProps,
47590
+ audioPlayer,
47591
+ nextAudioPlayer,
47592
+ playedMessageSentences,
47593
+ _onEnd,
47594
+ play,
47595
+ fullSentenceRegex
47596
+ ]);
47597
+ (0, import_react67.useEffect)(function() {
47598
+ var _latestMessageProps$l;
47599
+ if (isLastSentencePlayedRef.current && !isPlaying && unplayedMessageSentences.length === 0 && ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) !== "in_progress") {
47600
+ _onEnd();
47601
+ isLastSentencePlayedRef.current = false;
47602
+ }
47603
+ }, [
47604
+ isPlaying,
47605
+ unplayedMessageSentences.length,
47606
+ (_latestMessageProps$l2 = latestMessageProps.latestMessage) === null || _latestMessageProps$l2 === void 0 ? void 0 : _latestMessageProps$l2.status,
47607
+ _onEnd
47608
+ ]);
47609
+ (0, import_react67.useEffect)(function() {
47610
+ if (isHtmlAudioSupported) {
47611
+ var _Howler$_howls$;
47612
+ if (!(import_howler.Howler !== null && import_howler.Howler !== void 0 && (_Howler$_howls$ = import_howler.Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) return;
47613
+ import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
47614
+ }
47615
+ }, [
47616
+ audioPlayer
47617
+ ]);
47618
+ var _ref5 = _sliced_to_array((0, import_react67.useState)(null), 2), audioEngine = _ref5[0], setAudioEngine = _ref5[1];
47619
+ var isAudioEngineInited = (0, import_react67.useRef)(false);
47620
+ (0, import_react67.useEffect)(function() {
47621
+ if (!audioPlayer.playing) return;
47622
+ if (isAudioEngineInited.current) return;
47623
+ isAudioEngineInited.current = true;
47624
+ if (isHtmlAudioSupported) {
47625
+ var audioContext = new AudioContext();
47626
+ setAudioEngine({
47627
+ // @ts-ignore-next-line
47628
+ source: audioContext.createMediaElementSource(// @ts-ignore-next-line
47629
+ import_howler.Howler._howls[0]._sounds[0]._node),
47630
+ audioContext: audioContext
47631
+ });
47864
47632
  } else {
47865
- result = $[62];
47633
+ setAudioEngine({
47634
+ source: import_howler.Howler.masterGain,
47635
+ audioContext: import_howler.Howler.ctx
47636
+ });
47866
47637
  }
47867
- t18 = result;
47868
- }
47869
- var visualizationAnalyser = t18;
47870
- var t19;
47871
- t19 = isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l5 = latestMessageProps.latestMessage) === null || _latestMessageProps$l5 === void 0 ? void 0 : _latestMessageProps$l5.status) === "in_progress";
47872
- var isPending = t19;
47873
- var t20;
47874
- if ($[63] !== audioPlayer || $[64] !== isAudioPlayed || $[65] !== isPending || $[66] !== visualizationAnalyser) {
47875
- t20 = _objectSpread47(_objectSpread47({
47876
- isPending: isPending,
47877
- isAudioPlayed: isAudioPlayed
47878
- }, audioPlayer), {}, {
47879
- visualizationAnalyser: visualizationAnalyser
47880
- });
47881
- $[63] = audioPlayer;
47882
- $[64] = isAudioPlayed;
47883
- $[65] = isPending;
47884
- $[66] = visualizationAnalyser;
47885
- $[67] = t20;
47886
- } else {
47887
- t20 = $[67];
47888
- }
47889
- return t20;
47638
+ }, [
47639
+ audioPlayer,
47640
+ isAudioEngineInited
47641
+ ]);
47642
+ var visualizationAnalyser = (0, import_react67.useMemo)(function() {
47643
+ if (!audioEngine) return null;
47644
+ var result = audioEngine.audioContext.createAnalyser();
47645
+ audioEngine.source.connect(audioEngine.audioContext.destination);
47646
+ audioEngine.source.connect(result);
47647
+ return result;
47648
+ }, [
47649
+ audioEngine
47650
+ ]);
47651
+ var isPending = (0, import_react67.useMemo)(function() {
47652
+ var _latestMessageProps$l3;
47653
+ return isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l3 = latestMessageProps.latestMessage) === null || _latestMessageProps$l3 === void 0 ? void 0 : _latestMessageProps$l3.status) === "in_progress";
47654
+ }, [
47655
+ isPlaying,
47656
+ unplayedMessageSentences,
47657
+ latestMessageProps
47658
+ ]);
47659
+ return _objectSpread47(_objectSpread47({
47660
+ isPending: isPending,
47661
+ isAudioPlayed: isAudioPlayed
47662
+ }, audioPlayer), {}, {
47663
+ visualizationAnalyser: visualizationAnalyser
47664
+ });
47890
47665
  };
47891
- function _temp9() {
47892
- if (isHtmlAudioSupported) {
47893
- var _Howler$_howls$;
47894
- if (!(import_howler.Howler !== null && import_howler.Howler !== void 0 && (_Howler$_howls$ = import_howler.Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) {
47895
- return;
47896
- }
47897
- import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
47898
- }
47899
- }
47900
47666
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
47901
47667
  var import_react_query10 = require("@tanstack/react-query");
47902
47668
  // src/hooks/audioRuntimes/useTtsAudioRuntime/blobToData.ts
@@ -47934,7 +47700,7 @@ function _asyncToGenerator11(n) {
47934
47700
  };
47935
47701
  }
47936
47702
  var useTtsAudioRuntime = function(t0) {
47937
- var $ = (0, import_react_compiler_runtime90.c)(30);
47703
+ var $ = (0, import_react_compiler_runtime88.c)(30);
47938
47704
  var play = t0.play, passedOnEnd = t0.onEnd;
47939
47705
  var addToast = useToasts().addToast;
47940
47706
  var queryClient = (0, import_react_query10.useQueryClient)();
@@ -47963,7 +47729,7 @@ var useTtsAudioRuntime = function(t0) {
47963
47729
  if ($[1] !== createMessageProps) {
47964
47730
  t2 = {
47965
47731
  isStopOnSilence: true,
47966
- onStart: _temp10,
47732
+ onStart: _temp9,
47967
47733
  onStop: function() {
47968
47734
  var _onStop = _asyncToGenerator11(function(_event, chunks) {
47969
47735
  var blob, audioContent;
@@ -48104,7 +47870,7 @@ var useTtsAudioRuntime = function(t0) {
48104
47870
  t5 = t8;
48105
47871
  return t5;
48106
47872
  };
48107
- function _temp10() {
47873
+ function _temp9() {
48108
47874
  return _temp24.apply(this, arguments);
48109
47875
  }
48110
47876
  function _temp24() {
@@ -48118,9 +47884,9 @@ function _temp24() {
48118
47884
  return _temp24.apply(this, arguments);
48119
47885
  }
48120
47886
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
48121
- var import_jsx_runtime88 = require("react/jsx-runtime");
47887
+ var import_jsx_runtime87 = require("react/jsx-runtime");
48122
47888
  var TtsAudioRuntimeProvider = function(t0) {
48123
- var $ = (0, import_react_compiler_runtime91.c)(8);
47889
+ var $ = (0, import_react_compiler_runtime89.c)(8);
48124
47890
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
48125
47891
  var t1;
48126
47892
  if ($[0] !== onEnd || $[1] !== play) {
@@ -48147,7 +47913,7 @@ var TtsAudioRuntimeProvider = function(t0) {
48147
47913
  }
48148
47914
  var t3;
48149
47915
  if ($[5] !== children || $[6] !== t2) {
48150
- t3 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(AudioThreadContext.Provider, {
47916
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(AudioThreadContext.Provider, {
48151
47917
  value: t2,
48152
47918
  children: children
48153
47919
  });
@@ -48160,7 +47926,7 @@ var TtsAudioRuntimeProvider = function(t0) {
48160
47926
  return t3;
48161
47927
  };
48162
47928
  // src/components/threads/AudioThread/Root/index.tsx
48163
- var import_jsx_runtime89 = require("react/jsx-runtime");
47929
+ var import_jsx_runtime88 = require("react/jsx-runtime");
48164
47930
  var _excluded5 = [
48165
47931
  "children"
48166
47932
  ];
@@ -48233,11 +47999,11 @@ function _objectWithoutPropertiesLoose5(r, e) {
48233
47999
  return t;
48234
48000
  }
48235
48001
  var Content9 = function(t0) {
48236
- var $ = (0, import_react_compiler_runtime92.c)(4);
48002
+ var $ = (0, import_react_compiler_runtime90.c)(4);
48237
48003
  var children = t0.children, className = t0.className, style = t0.style;
48238
48004
  var t1;
48239
48005
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
48240
- t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes58.Flex, {
48006
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes58.Flex, {
48241
48007
  direction: "column",
48242
48008
  flexGrow: "1",
48243
48009
  p: "9",
@@ -48255,7 +48021,7 @@ var Content9 = function(t0) {
48255
48021
  return t1;
48256
48022
  };
48257
48023
  var AudioRuntimeProvider = function(t0) {
48258
- var $ = (0, import_react_compiler_runtime92.c)(4);
48024
+ var $ = (0, import_react_compiler_runtime90.c)(4);
48259
48025
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
48260
48026
  var audioThreadContext = useAudioThreadContext();
48261
48027
  if (audioThreadContext.audioRuntime) {
@@ -48263,7 +48029,7 @@ var AudioRuntimeProvider = function(t0) {
48263
48029
  }
48264
48030
  var t1;
48265
48031
  if ($[0] !== children || $[1] !== onEnd || $[2] !== play) {
48266
- t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TtsAudioRuntimeProvider, {
48032
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TtsAudioRuntimeProvider, {
48267
48033
  play: play,
48268
48034
  onEnd: onEnd,
48269
48035
  children: children
@@ -48278,7 +48044,7 @@ var AudioRuntimeProvider = function(t0) {
48278
48044
  return t1;
48279
48045
  };
48280
48046
  var Provider5 = function(t0) {
48281
- var $ = (0, import_react_compiler_runtime92.c)(9);
48047
+ var $ = (0, import_react_compiler_runtime90.c)(9);
48282
48048
  var children;
48283
48049
  var rest;
48284
48050
  if ($[0] !== t0) {
@@ -48305,7 +48071,7 @@ var Provider5 = function(t0) {
48305
48071
  }
48306
48072
  var t2;
48307
48073
  if ($[6] !== children || $[7] !== t1) {
48308
- t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(AudioThreadContext.Provider, {
48074
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(AudioThreadContext.Provider, {
48309
48075
  value: t1,
48310
48076
  children: children
48311
48077
  });
@@ -48318,7 +48084,7 @@ var Provider5 = function(t0) {
48318
48084
  return t2;
48319
48085
  };
48320
48086
  var Root16 = function(t0) {
48321
- var $ = (0, import_react_compiler_runtime92.c)(18);
48087
+ var $ = (0, import_react_compiler_runtime90.c)(18);
48322
48088
  var children;
48323
48089
  var className;
48324
48090
  var onEnd;
@@ -48348,8 +48114,8 @@ var Root16 = function(t0) {
48348
48114
  }
48349
48115
  var t1;
48350
48116
  if ($[7] !== children || $[8] !== className || $[9] !== style) {
48351
- t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ToastsProvider, {
48352
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Content9, {
48117
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ToastsProvider, {
48118
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Content9, {
48353
48119
  className: className,
48354
48120
  style: style,
48355
48121
  children: children
@@ -48364,7 +48130,7 @@ var Root16 = function(t0) {
48364
48130
  }
48365
48131
  var t2;
48366
48132
  if ($[11] !== onEnd || $[12] !== play || $[13] !== t1) {
48367
- t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(AudioRuntimeProvider, {
48133
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(AudioRuntimeProvider, {
48368
48134
  play: play,
48369
48135
  onEnd: onEnd,
48370
48136
  children: t1
@@ -48378,7 +48144,7 @@ var Root16 = function(t0) {
48378
48144
  }
48379
48145
  var t3;
48380
48146
  if ($[15] !== rest || $[16] !== t2) {
48381
- t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Provider5, _objectSpread48(_objectSpread48({}, rest), {}, {
48147
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Provider5, _objectSpread48(_objectSpread48({}, rest), {}, {
48382
48148
  children: t2
48383
48149
  }));
48384
48150
  $[15] = rest;
@@ -48390,21 +48156,21 @@ var Root16 = function(t0) {
48390
48156
  return t3;
48391
48157
  };
48392
48158
  // src/components/threads/AudioThread/Visualization/index.tsx
48393
- var import_react_compiler_runtime94 = require("react-compiler-runtime");
48394
- var import_react72 = require("react");
48159
+ var import_react_compiler_runtime92 = require("react-compiler-runtime");
48160
+ var import_react71 = require("react");
48395
48161
  var import_lodash9 = __toESM(require("lodash"), 1);
48396
48162
  var import_themes60 = require("@radix-ui/themes");
48397
48163
  // src/components/threads/AudioThread/BarsVisualizer/index.tsx
48398
48164
  var import_lodash8 = __toESM(require("lodash"), 1);
48399
48165
  var import_themes59 = require("@radix-ui/themes");
48400
- var import_react70 = require("react");
48166
+ var import_react69 = require("react");
48401
48167
  var import_radash17 = require("radash");
48402
- var import_jsx_runtime90 = require("react/jsx-runtime");
48168
+ var import_jsx_runtime89 = require("react/jsx-runtime");
48403
48169
  var barCount = 4;
48404
48170
  var BarsVisualizer = function(_ref) {
48405
48171
  var visualizationAnalyser = _ref.visualizationAnalyser, backgroundColor = _ref.backgroundColor, height = _ref.height, barWidth = _ref.barWidth;
48406
- var _$_ref = _sliced_to_array((0, import_react70.useState)([]), 2), barHeights = _$_ref[0], setBarHeights = _$_ref[1];
48407
- var draw = (0, import_react70.useCallback)(function(_ref2) {
48172
+ var _$_ref = _sliced_to_array((0, import_react69.useState)([]), 2), barHeights = _$_ref[0], setBarHeights = _$_ref[1];
48173
+ var draw = (0, import_react69.useCallback)(function(_ref2) {
48408
48174
  var visualizationAnalyser_0 = _ref2.visualizationAnalyser;
48409
48175
  if (!visualizationAnalyser_0) {
48410
48176
  setBarHeights(Array(barCount).fill(0));
@@ -48422,7 +48188,7 @@ var BarsVisualizer = function(_ref) {
48422
48188
  });
48423
48189
  });
48424
48190
  }, []);
48425
- (0, import_react70.useEffect)(function() {
48191
+ (0, import_react69.useEffect)(function() {
48426
48192
  draw({
48427
48193
  visualizationAnalyser: visualizationAnalyser
48428
48194
  });
@@ -48430,7 +48196,7 @@ var BarsVisualizer = function(_ref) {
48430
48196
  draw,
48431
48197
  visualizationAnalyser
48432
48198
  ]);
48433
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes59.Grid, {
48199
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes59.Grid, {
48434
48200
  columns: "".concat(barCount),
48435
48201
  gap: "1",
48436
48202
  width: "auto",
@@ -48439,12 +48205,12 @@ var BarsVisualizer = function(_ref) {
48439
48205
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
48440
48206
  },
48441
48207
  children: barHeights.map(function(barHeight, index) {
48442
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes59.Flex, {
48208
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes59.Flex, {
48443
48209
  direction: "column",
48444
48210
  align: "center",
48445
48211
  justify: "center",
48446
48212
  height: height,
48447
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes59.Flex, {
48213
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes59.Flex, {
48448
48214
  minHeight: "50%",
48449
48215
  maxHeight: "100%",
48450
48216
  height: "".concat(barHeight + 20, "%"),
@@ -48459,10 +48225,10 @@ var BarsVisualizer = function(_ref) {
48459
48225
  });
48460
48226
  };
48461
48227
  // src/hooks/audioThreads/useStatus/index.ts
48462
- var import_react_compiler_runtime93 = require("react-compiler-runtime");
48463
- var import_react71 = require("react");
48228
+ var import_react_compiler_runtime91 = require("react-compiler-runtime");
48229
+ var import_react70 = require("react");
48464
48230
  var useStatus = function() {
48465
- var $ = (0, import_react_compiler_runtime93.c)(2);
48231
+ var $ = (0, import_react_compiler_runtime91.c)(2);
48466
48232
  var audioRuntime = useAudioThreadContext().audioRuntime;
48467
48233
  var t0;
48468
48234
  bb0: {
@@ -48510,7 +48276,7 @@ var useStatus = function() {
48510
48276
  return t1;
48511
48277
  };
48512
48278
  // src/components/threads/AudioThread/Visualization/index.tsx
48513
- var import_jsx_runtime91 = require("react/jsx-runtime");
48279
+ var import_jsx_runtime90 = require("react/jsx-runtime");
48514
48280
  var _excluded6 = [
48515
48281
  "children"
48516
48282
  ];
@@ -48584,14 +48350,14 @@ function _objectWithoutPropertiesLoose6(r, e) {
48584
48350
  }
48585
48351
  return t;
48586
48352
  }
48587
- var AudioThreadVisualizationContext = /* @__PURE__ */ (0, import_react72.createContext)({
48353
+ var AudioThreadVisualizationContext = /* @__PURE__ */ (0, import_react71.createContext)({
48588
48354
  scale: 0
48589
48355
  });
48590
48356
  var Provider6 = function(_ref) {
48591
48357
  var children = _ref.children;
48592
48358
  var audioThreadContext = useAudioThreadContext();
48593
- var _$_ref = _sliced_to_array((0, import_react72.useState)(0), 2), scale = _$_ref[0], setScale = _$_ref[1];
48594
- var draw = (0, import_react72.useCallback)(function(_ref2) {
48359
+ var _$_ref = _sliced_to_array((0, import_react71.useState)(0), 2), scale = _$_ref[0], setScale = _$_ref[1];
48360
+ var draw = (0, import_react71.useCallback)(function(_ref2) {
48595
48361
  var visualizationAnalyser = _ref2.visualizationAnalyser;
48596
48362
  if (!visualizationAnalyser) {
48597
48363
  setScale(1);
@@ -48606,7 +48372,7 @@ var Provider6 = function(_ref) {
48606
48372
  });
48607
48373
  });
48608
48374
  }, []);
48609
- (0, import_react72.useEffect)(function() {
48375
+ (0, import_react71.useEffect)(function() {
48610
48376
  draw({
48611
48377
  visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser
48612
48378
  });
@@ -48614,7 +48380,7 @@ var Provider6 = function(_ref) {
48614
48380
  draw,
48615
48381
  audioThreadContext
48616
48382
  ]);
48617
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AudioThreadVisualizationContext.Provider, {
48383
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(AudioThreadVisualizationContext.Provider, {
48618
48384
  value: {
48619
48385
  scale: scale
48620
48386
  },
@@ -48622,7 +48388,7 @@ var Provider6 = function(_ref) {
48622
48388
  });
48623
48389
  };
48624
48390
  var Root17 = function(t0) {
48625
- var $ = (0, import_react_compiler_runtime94.c)(6);
48391
+ var $ = (0, import_react_compiler_runtime92.c)(6);
48626
48392
  var children;
48627
48393
  var rest;
48628
48394
  if ($[0] !== t0) {
@@ -48639,8 +48405,8 @@ var Root17 = function(t0) {
48639
48405
  }
48640
48406
  var t1;
48641
48407
  if ($[3] !== children || $[4] !== rest) {
48642
- t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Provider6, {
48643
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48408
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Provider6, {
48409
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48644
48410
  direction: "column",
48645
48411
  align: "center",
48646
48412
  justify: "center",
@@ -48659,7 +48425,7 @@ var Root17 = function(t0) {
48659
48425
  return t1;
48660
48426
  };
48661
48427
  var BarsVisualizer2 = function(t0) {
48662
- var $ = (0, import_react_compiler_runtime94.c)(10);
48428
+ var $ = (0, import_react_compiler_runtime92.c)(10);
48663
48429
  var rest;
48664
48430
  var t1;
48665
48431
  var t2;
@@ -48685,7 +48451,7 @@ var BarsVisualizer2 = function(t0) {
48685
48451
  var t3 = status === "playing" ? "var(--accent-11)" : "var(--gray-11)";
48686
48452
  var t4;
48687
48453
  if ($[4] !== audioThreadContext.audioRuntime.assistant.visualizationAnalyser || $[5] !== barWidth || $[6] !== height || $[7] !== rest || $[8] !== t3) {
48688
- t4 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BarsVisualizer, _objectSpread49({
48454
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BarsVisualizer, _objectSpread49({
48689
48455
  visualizationAnalyser: audioThreadContext.audioRuntime.assistant.visualizationAnalyser,
48690
48456
  backgroundColor: t3,
48691
48457
  height: height,
@@ -48703,7 +48469,7 @@ var BarsVisualizer2 = function(t0) {
48703
48469
  return t4;
48704
48470
  };
48705
48471
  var AssistantVisualizationRoot = function(t0) {
48706
- var $ = (0, import_react_compiler_runtime94.c)(17);
48472
+ var $ = (0, import_react_compiler_runtime92.c)(17);
48707
48473
  var children;
48708
48474
  var rest;
48709
48475
  var t1;
@@ -48728,7 +48494,7 @@ var AssistantVisualizationRoot = function(t0) {
48728
48494
  var height = t1 === void 0 ? "200px" : t1;
48729
48495
  var width2 = t2 === void 0 ? "200px" : t2;
48730
48496
  var status = useStatus().status;
48731
- var scale = (0, import_react72.useContext)(AudioThreadVisualizationContext).scale;
48497
+ var scale = (0, import_react71.useContext)(AudioThreadVisualizationContext).scale;
48732
48498
  var t3 = status === "playing" ? "var(--accent-4)" : "var(--gray-4)";
48733
48499
  var t4;
48734
48500
  if ($[5] !== rest.style) {
@@ -48755,7 +48521,7 @@ var AssistantVisualizationRoot = function(t0) {
48755
48521
  }
48756
48522
  var t6;
48757
48523
  if ($[11] !== children || $[12] !== height || $[13] !== rest || $[14] !== t5 || $[15] !== width2) {
48758
- t6 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48524
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48759
48525
  align: "center",
48760
48526
  justify: "center",
48761
48527
  height: height,
@@ -48776,17 +48542,17 @@ var AssistantVisualizationRoot = function(t0) {
48776
48542
  return t6;
48777
48543
  };
48778
48544
  var AssistantVisualization = function(props) {
48779
- var $ = (0, import_react_compiler_runtime94.c)(3);
48545
+ var $ = (0, import_react_compiler_runtime92.c)(3);
48780
48546
  var t0;
48781
48547
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48782
- t0 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BarsVisualizer2, {});
48548
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BarsVisualizer2, {});
48783
48549
  $[0] = t0;
48784
48550
  } else {
48785
48551
  t0 = $[0];
48786
48552
  }
48787
48553
  var t1;
48788
48554
  if ($[1] !== props) {
48789
- t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AssistantVisualizationRoot, _objectSpread49(_objectSpread49({}, props), {}, {
48555
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(AssistantVisualizationRoot, _objectSpread49(_objectSpread49({}, props), {}, {
48790
48556
  children: t0
48791
48557
  }));
48792
48558
  $[1] = props;
@@ -48799,18 +48565,18 @@ var AssistantVisualization = function(props) {
48799
48565
  AssistantVisualization.Root = AssistantVisualizationRoot;
48800
48566
  AssistantVisualization.BarsVisualizer = BarsVisualizer2;
48801
48567
  var AssistantInfo = function(props) {
48802
- var $ = (0, import_react_compiler_runtime94.c)(6);
48803
- var assistantNameContext = (0, import_react72.useContext)(AssistantNameContext);
48568
+ var $ = (0, import_react_compiler_runtime92.c)(6);
48569
+ var assistantNameContext = (0, import_react71.useContext)(AssistantNameContext);
48804
48570
  var t0;
48805
48571
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48806
- t0 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MessageGroup.AssistantAvatar, {});
48572
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MessageGroup.AssistantAvatar, {});
48807
48573
  $[0] = t0;
48808
48574
  } else {
48809
48575
  t0 = $[0];
48810
48576
  }
48811
48577
  var t1;
48812
48578
  if ($[1] !== assistantNameContext) {
48813
- t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MessageGroup.Name, {
48579
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MessageGroup.Name, {
48814
48580
  children: assistantNameContext
48815
48581
  });
48816
48582
  $[1] = assistantNameContext;
@@ -48820,7 +48586,7 @@ var AssistantInfo = function(props) {
48820
48586
  }
48821
48587
  var t2;
48822
48588
  if ($[3] !== props || $[4] !== t1) {
48823
- t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48589
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_themes60.Flex, _objectSpread49(_objectSpread49({
48824
48590
  ml: "-22.5px",
48825
48591
  gap: "3",
48826
48592
  pt: "5"
@@ -48839,12 +48605,12 @@ var AssistantInfo = function(props) {
48839
48605
  return t2;
48840
48606
  };
48841
48607
  var Visualization = function(props) {
48842
- var $ = (0, import_react_compiler_runtime94.c)(4);
48608
+ var $ = (0, import_react_compiler_runtime92.c)(4);
48843
48609
  var t0;
48844
48610
  var t1;
48845
48611
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48846
- t0 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AssistantVisualization, {});
48847
- t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AssistantInfo, {});
48612
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(AssistantVisualization, {});
48613
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(AssistantInfo, {});
48848
48614
  $[0] = t0;
48849
48615
  $[1] = t1;
48850
48616
  } else {
@@ -48853,7 +48619,7 @@ var Visualization = function(props) {
48853
48619
  }
48854
48620
  var t2;
48855
48621
  if ($[2] !== props) {
48856
- t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root17, _objectSpread49(_objectSpread49({}, props), {}, {
48622
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Root17, _objectSpread49(_objectSpread49({}, props), {}, {
48857
48623
  children: [
48858
48624
  t0,
48859
48625
  t1
@@ -48871,11 +48637,11 @@ Visualization.Provider = Provider6;
48871
48637
  Visualization.AssistantVisualization = AssistantVisualization;
48872
48638
  Visualization.AssistantInfo = AssistantInfo;
48873
48639
  // src/components/threads/AudioThread/Status/index.tsx
48874
- var import_react_compiler_runtime96 = require("react-compiler-runtime");
48640
+ var import_react_compiler_runtime94 = require("react-compiler-runtime");
48875
48641
  // src/components/threads/AudioThread/Status/StatusMessages.tsx
48876
- var import_react_compiler_runtime95 = require("react-compiler-runtime");
48642
+ var import_react_compiler_runtime93 = require("react-compiler-runtime");
48877
48643
  var import_themes61 = require("@radix-ui/themes");
48878
- var import_jsx_runtime92 = require("react/jsx-runtime");
48644
+ var import_jsx_runtime91 = require("react/jsx-runtime");
48879
48645
  var html = function(_ref) {
48880
48646
  var texts = _ref.texts;
48881
48647
  return "\n .status-messages-texts:after {\n content: '".concat(texts[0], "';\n animation: texts ").concat(texts.length * 5, "s linear infinite;\n }\n\n @keyframes texts {\n ").concat(texts.map(function(_10, i) {
@@ -48883,11 +48649,11 @@ var html = function(_ref) {
48883
48649
  }).join(""), "\n }");
48884
48650
  };
48885
48651
  var StatusMessages = function(t0) {
48886
- var $ = (0, import_react_compiler_runtime95.c)(9);
48652
+ var $ = (0, import_react_compiler_runtime93.c)(9);
48887
48653
  var texts = t0.texts, className = t0.className, style = t0.style;
48888
48654
  var t1;
48889
48655
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48890
- t1 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_themes61.Text, {
48656
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes61.Text, {
48891
48657
  size: "2",
48892
48658
  weight: "regular",
48893
48659
  color: "gray",
@@ -48910,7 +48676,7 @@ var StatusMessages = function(t0) {
48910
48676
  }
48911
48677
  var t3;
48912
48678
  if ($[3] !== t2) {
48913
- t3 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("style", {
48679
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("style", {
48914
48680
  dangerouslySetInnerHTML: {
48915
48681
  __html: t2
48916
48682
  }
@@ -48922,7 +48688,7 @@ var StatusMessages = function(t0) {
48922
48688
  }
48923
48689
  var t4;
48924
48690
  if ($[5] !== className || $[6] !== style || $[7] !== t3) {
48925
- t4 = /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_themes61.Flex, {
48691
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_themes61.Flex, {
48926
48692
  justify: "center",
48927
48693
  pb: "5",
48928
48694
  className: className,
@@ -48942,7 +48708,7 @@ var StatusMessages = function(t0) {
48942
48708
  return t4;
48943
48709
  };
48944
48710
  // src/components/threads/AudioThread/Status/index.tsx
48945
- var import_jsx_runtime93 = require("react/jsx-runtime");
48711
+ var import_jsx_runtime92 = require("react/jsx-runtime");
48946
48712
  function ownKeys50(e, r) {
48947
48713
  var t = Object.keys(e);
48948
48714
  if (Object.getOwnPropertySymbols) {
@@ -48987,7 +48753,7 @@ function _toPrimitive50(t, r) {
48987
48753
  return ("string" === r ? String : Number)(t);
48988
48754
  }
48989
48755
  var Status = function(props) {
48990
- var $ = (0, import_react_compiler_runtime96.c)(12);
48756
+ var $ = (0, import_react_compiler_runtime94.c)(12);
48991
48757
  var status = useStatus().status;
48992
48758
  if (status === "recording") {
48993
48759
  var _t;
@@ -49004,7 +48770,7 @@ var Status = function(props) {
49004
48770
  }
49005
48771
  var _t2;
49006
48772
  if ($[1] !== props) {
49007
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
48773
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(StatusMessages, _objectSpread50({
49008
48774
  texts: _t
49009
48775
  }, props));
49010
48776
  $[1] = props;
@@ -49030,7 +48796,7 @@ var Status = function(props) {
49030
48796
  }
49031
48797
  var _t4;
49032
48798
  if ($[4] !== props) {
49033
- _t4 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
48799
+ _t4 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(StatusMessages, _objectSpread50({
49034
48800
  texts: _t3
49035
48801
  }, props));
49036
48802
  $[4] = props;
@@ -49052,7 +48818,7 @@ var Status = function(props) {
49052
48818
  }
49053
48819
  var _t6;
49054
48820
  if ($[7] !== props) {
49055
- _t6 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
48821
+ _t6 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(StatusMessages, _objectSpread50({
49056
48822
  texts: _t5
49057
48823
  }, props));
49058
48824
  $[7] = props;
@@ -49073,7 +48839,7 @@ var Status = function(props) {
49073
48839
  }
49074
48840
  var t1;
49075
48841
  if ($[10] !== props) {
49076
- t1 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
48842
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(StatusMessages, _objectSpread50({
49077
48843
  texts: t0
49078
48844
  }, props));
49079
48845
  $[10] = props;
@@ -49084,11 +48850,11 @@ var Status = function(props) {
49084
48850
  return t1;
49085
48851
  };
49086
48852
  // src/components/threads/AudioThread/Form/index.tsx
49087
- var import_react_compiler_runtime99 = require("react-compiler-runtime");
48853
+ var import_react_compiler_runtime97 = require("react-compiler-runtime");
49088
48854
  var import_themes63 = require("@radix-ui/themes");
49089
48855
  // src/components/threads/AudioThread/Form/MicIcon.tsx
49090
- var import_react_compiler_runtime97 = require("react-compiler-runtime");
49091
- var import_jsx_runtime94 = require("react/jsx-runtime");
48856
+ var import_react_compiler_runtime95 = require("react-compiler-runtime");
48857
+ var import_jsx_runtime93 = require("react/jsx-runtime");
49092
48858
  function ownKeys51(e, r) {
49093
48859
  var t = Object.keys(e);
49094
48860
  if (Object.getOwnPropertySymbols) {
@@ -49133,10 +48899,10 @@ function _toPrimitive51(t, r) {
49133
48899
  return ("string" === r ? String : Number)(t);
49134
48900
  }
49135
48901
  var MicIcon = function(props) {
49136
- var $ = (0, import_react_compiler_runtime97.c)(3);
48902
+ var $ = (0, import_react_compiler_runtime95.c)(3);
49137
48903
  var t0;
49138
48904
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49139
- t0 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", {
48905
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("path", {
49140
48906
  stroke: "none",
49141
48907
  d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
49142
48908
  });
@@ -49146,7 +48912,7 @@ var MicIcon = function(props) {
49146
48912
  }
49147
48913
  var t1;
49148
48914
  if ($[1] !== props) {
49149
- t1 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", _objectSpread51(_objectSpread51({
48915
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("svg", _objectSpread51(_objectSpread51({
49150
48916
  xmlns: "http://www.w3.org/2000/svg",
49151
48917
  fill: "currentColor",
49152
48918
  stroke: "currentColor",
@@ -49165,29 +48931,29 @@ var MicIcon = function(props) {
49165
48931
  return t1;
49166
48932
  };
49167
48933
  // src/components/threads/AudioThread/Form/ActionButton/index.tsx
49168
- var import_react_compiler_runtime98 = require("react-compiler-runtime");
48934
+ var import_react_compiler_runtime96 = require("react-compiler-runtime");
49169
48935
  var import_themes62 = require("@radix-ui/themes");
49170
48936
  var import_react_icons17 = require("@radix-ui/react-icons");
49171
- var import_jsx_runtime95 = require("react/jsx-runtime");
48937
+ var import_jsx_runtime94 = require("react/jsx-runtime");
49172
48938
  var ActionButton = function() {
49173
- var $ = (0, import_react_compiler_runtime98.c)(27);
48939
+ var $ = (0, import_react_compiler_runtime96.c)(27);
49174
48940
  var status = useStatus().status;
49175
48941
  var audioThreadContext = useAudioThreadContext();
49176
48942
  var superinterfaceContext = useSuperinterfaceContext();
49177
48943
  if (status === "recording") {
49178
48944
  var _t;
49179
48945
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49180
- _t = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_icons17.PauseIcon, {});
48946
+ _t = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons17.PauseIcon, {});
49181
48947
  $[0] = _t;
49182
48948
  } else {
49183
48949
  _t = $[0];
49184
48950
  }
49185
48951
  var t1;
49186
48952
  if ($[1] !== audioThreadContext.audioRuntime.user.pause) {
49187
- t1 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.Flex, {
48953
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.Flex, {
49188
48954
  mr: "3",
49189
48955
  ml: "-7",
49190
- children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
48956
+ children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49191
48957
  onClick: audioThreadContext.audioRuntime.user.pause,
49192
48958
  color: "gray",
49193
48959
  variant: "soft",
@@ -49202,14 +48968,14 @@ var ActionButton = function() {
49202
48968
  }
49203
48969
  var t2;
49204
48970
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
49205
- t2 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_icons17.ArrowUpIcon, {});
48971
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons17.ArrowUpIcon, {});
49206
48972
  $[3] = t2;
49207
48973
  } else {
49208
48974
  t2 = $[3];
49209
48975
  }
49210
48976
  var t3;
49211
48977
  if ($[4] !== audioThreadContext.audioRuntime.user.stop) {
49212
- t3 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
48978
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49213
48979
  onClick: audioThreadContext.audioRuntime.user.stop,
49214
48980
  highContrast: true,
49215
48981
  variant: "soft",
@@ -49223,7 +48989,7 @@ var ActionButton = function() {
49223
48989
  }
49224
48990
  var t4;
49225
48991
  if ($[6] !== t1 || $[7] !== t3) {
49226
- t4 = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_themes62.Flex, {
48992
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_themes62.Flex, {
49227
48993
  align: "center",
49228
48994
  children: [
49229
48995
  t1,
@@ -49241,14 +49007,14 @@ var ActionButton = function() {
49241
49007
  if (status === "recorderPaused") {
49242
49008
  var _t2;
49243
49009
  if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
49244
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_icons17.ResumeIcon, {});
49010
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons17.ResumeIcon, {});
49245
49011
  $[9] = _t2;
49246
49012
  } else {
49247
49013
  _t2 = $[9];
49248
49014
  }
49249
49015
  var _t3;
49250
49016
  if ($[10] !== audioThreadContext.audioRuntime.user.resume) {
49251
- _t3 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
49017
+ _t3 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49252
49018
  onClick: audioThreadContext.audioRuntime.user.resume,
49253
49019
  color: "red",
49254
49020
  size: "4",
@@ -49264,7 +49030,7 @@ var ActionButton = function() {
49264
49030
  if (status === "idle") {
49265
49031
  var _t4;
49266
49032
  if ($[12] !== audioThreadContext.audioRuntime.user) {
49267
- _t4 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
49033
+ _t4 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49268
49034
  onClick: function() {
49269
49035
  return audioThreadContext.audioRuntime.user.start();
49270
49036
  },
@@ -49296,14 +49062,14 @@ var ActionButton = function() {
49296
49062
  }
49297
49063
  var _t6;
49298
49064
  if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
49299
- _t6 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_icons17.StopIcon, {});
49065
+ _t6 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons17.StopIcon, {});
49300
49066
  $[18] = _t6;
49301
49067
  } else {
49302
49068
  _t6 = $[18];
49303
49069
  }
49304
49070
  var _t7;
49305
49071
  if ($[19] !== _t5) {
49306
- _t7 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
49072
+ _t7 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49307
49073
  onClick: _t5,
49308
49074
  size: "4",
49309
49075
  color: "gray",
@@ -49330,14 +49096,14 @@ var ActionButton = function() {
49330
49096
  }
49331
49097
  var _t9;
49332
49098
  if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
49333
- _t9 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_icons17.ResumeIcon, {});
49099
+ _t9 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons17.ResumeIcon, {});
49334
49100
  $[23] = _t9;
49335
49101
  } else {
49336
49102
  _t9 = $[23];
49337
49103
  }
49338
49104
  var _t0;
49339
49105
  if ($[24] !== _t8) {
49340
- _t0 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
49106
+ _t0 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49341
49107
  onClick: _t8,
49342
49108
  size: "4",
49343
49109
  children: _t9
@@ -49351,7 +49117,7 @@ var ActionButton = function() {
49351
49117
  }
49352
49118
  var t0;
49353
49119
  if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
49354
- t0 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes62.IconButton, {
49120
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes62.IconButton, {
49355
49121
  size: "4",
49356
49122
  variant: "soft",
49357
49123
  disabled: true
@@ -49363,7 +49129,7 @@ var ActionButton = function() {
49363
49129
  return t0;
49364
49130
  };
49365
49131
  // src/components/threads/AudioThread/Form/index.tsx
49366
- var import_jsx_runtime96 = require("react/jsx-runtime");
49132
+ var import_jsx_runtime95 = require("react/jsx-runtime");
49367
49133
  function ownKeys52(e, r) {
49368
49134
  var t = Object.keys(e);
49369
49135
  if (Object.getOwnPropertySymbols) {
@@ -49408,17 +49174,17 @@ function _toPrimitive52(t, r) {
49408
49174
  return ("string" === r ? String : Number)(t);
49409
49175
  }
49410
49176
  var Form = function(props) {
49411
- var $ = (0, import_react_compiler_runtime99.c)(17);
49177
+ var $ = (0, import_react_compiler_runtime97.c)(17);
49412
49178
  var status = useStatus().status;
49413
49179
  var audioThreadContext = useAudioThreadContext();
49414
49180
  var t0 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
49415
49181
  var t1;
49416
49182
  if ($[0] !== t0) {
49417
- t1 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes63.Flex, {
49183
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes63.Flex, {
49418
49184
  ml: "-22.5px",
49419
49185
  mr: "2",
49420
49186
  align: "center",
49421
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(MicIcon, {
49187
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(MicIcon, {
49422
49188
  style: {
49423
49189
  color: t0
49424
49190
  }
@@ -49444,7 +49210,7 @@ var Form = function(props) {
49444
49210
  var t4 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
49445
49211
  var t5;
49446
49212
  if ($[4] !== audioThreadContext.audioRuntime.user.visualizationAnalyser || $[5] !== t4) {
49447
- t5 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BarsVisualizer, {
49213
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(BarsVisualizer, {
49448
49214
  visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser,
49449
49215
  backgroundColor: t4,
49450
49216
  height: "20px",
@@ -49458,7 +49224,7 @@ var Form = function(props) {
49458
49224
  }
49459
49225
  var t6;
49460
49226
  if ($[7] !== t3 || $[8] !== t5) {
49461
- t6 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes63.Flex, {
49227
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes63.Flex, {
49462
49228
  px: "2",
49463
49229
  py: "1",
49464
49230
  style: t3,
@@ -49472,7 +49238,7 @@ var Form = function(props) {
49472
49238
  }
49473
49239
  var t7;
49474
49240
  if ($[10] !== t1 || $[11] !== t6) {
49475
- t7 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes63.Flex, {
49241
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_themes63.Flex, {
49476
49242
  pb: "3",
49477
49243
  align: "center",
49478
49244
  children: [
@@ -49488,14 +49254,14 @@ var Form = function(props) {
49488
49254
  }
49489
49255
  var t8;
49490
49256
  if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
49491
- t8 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ActionButton, {});
49257
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ActionButton, {});
49492
49258
  $[13] = t8;
49493
49259
  } else {
49494
49260
  t8 = $[13];
49495
49261
  }
49496
49262
  var t9;
49497
49263
  if ($[14] !== props || $[15] !== t7) {
49498
- t9 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes63.Flex, _objectSpread52(_objectSpread52({
49264
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_themes63.Flex, _objectSpread52(_objectSpread52({
49499
49265
  direction: "column",
49500
49266
  align: "center"
49501
49267
  }, props), {}, {
@@ -49513,7 +49279,7 @@ var Form = function(props) {
49513
49279
  return t9;
49514
49280
  };
49515
49281
  // src/components/threads/AudioThread/index.tsx
49516
- var import_jsx_runtime97 = require("react/jsx-runtime");
49282
+ var import_jsx_runtime96 = require("react/jsx-runtime");
49517
49283
  function ownKeys53(e, r) {
49518
49284
  var t = Object.keys(e);
49519
49285
  if (Object.getOwnPropertySymbols) {
@@ -49558,14 +49324,14 @@ function _toPrimitive53(t, r) {
49558
49324
  return ("string" === r ? String : Number)(t);
49559
49325
  }
49560
49326
  var AudioThread = function(props) {
49561
- var $ = (0, import_react_compiler_runtime100.c)(5);
49327
+ var $ = (0, import_react_compiler_runtime98.c)(5);
49562
49328
  var t0;
49563
49329
  var t1;
49564
49330
  var t2;
49565
49331
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49566
- t0 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Visualization, {});
49567
- t1 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Status, {});
49568
- t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Form, {});
49332
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Visualization, {});
49333
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Status, {});
49334
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Form, {});
49569
49335
  $[0] = t0;
49570
49336
  $[1] = t1;
49571
49337
  $[2] = t2;
@@ -49576,7 +49342,7 @@ var AudioThread = function(props) {
49576
49342
  }
49577
49343
  var t3;
49578
49344
  if ($[3] !== props) {
49579
- t3 = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Root16, _objectSpread53(_objectSpread53({}, props), {}, {
49345
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Root16, _objectSpread53(_objectSpread53({}, props), {}, {
49580
49346
  children: [
49581
49347
  t0,
49582
49348
  t1,
@@ -49595,7 +49361,7 @@ AudioThread.Visualization = Visualization;
49595
49361
  AudioThread.Status = Status;
49596
49362
  AudioThread.Form = Form;
49597
49363
  // src/components/threads/AudioThreadDialog/index.tsx
49598
- var import_jsx_runtime98 = require("react/jsx-runtime");
49364
+ var import_jsx_runtime97 = require("react/jsx-runtime");
49599
49365
  function ownKeys54(e, r) {
49600
49366
  var t = Object.keys(e);
49601
49367
  if (Object.getOwnPropertySymbols) {
@@ -49640,14 +49406,14 @@ function _toPrimitive54(t, r) {
49640
49406
  return ("string" === r ? String : Number)(t);
49641
49407
  }
49642
49408
  var AudioThreadDialog = function(props) {
49643
- var $ = (0, import_react_compiler_runtime101.c)(4);
49409
+ var $ = (0, import_react_compiler_runtime99.c)(4);
49644
49410
  var t0;
49645
49411
  var t1;
49646
49412
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49647
- t0 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Content8.Root, {
49648
- children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(AudioThread, {})
49413
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Content8.Root, {
49414
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(AudioThread, {})
49649
49415
  });
49650
- t1 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Trigger, {});
49416
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Trigger, {});
49651
49417
  $[0] = t0;
49652
49418
  $[1] = t1;
49653
49419
  } else {
@@ -49656,7 +49422,7 @@ var AudioThreadDialog = function(props) {
49656
49422
  }
49657
49423
  var t2;
49658
49424
  if ($[2] !== props) {
49659
- t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Root13, _objectSpread54(_objectSpread54({}, props), {}, {
49425
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Root13, _objectSpread54(_objectSpread54({}, props), {}, {
49660
49426
  children: [
49661
49427
  t0,
49662
49428
  t1
@@ -49673,7 +49439,7 @@ AudioThreadDialog.Root = Root13;
49673
49439
  AudioThreadDialog.Trigger = Trigger;
49674
49440
  AudioThreadDialog.Content = Content8;
49675
49441
  // src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
49676
- var import_react73 = require("react");
49442
+ var import_react72 = require("react");
49677
49443
  function asyncGeneratorStep12(n, t, e, r, o, a, c) {
49678
49444
  try {
49679
49445
  var i = n[a](c), u = i.value;
@@ -49762,22 +49528,22 @@ var useWebrtcAudioRuntime = function() {
49762
49528
  console.warn("Could not build analyzers:", err_0);
49763
49529
  }
49764
49530
  };
49765
- var _ref = _sliced_to_array((0, import_react73.useState)("idle"), 2), recorderStatus = _ref[0], setRecorderStatus = _ref[1];
49531
+ var _ref = _sliced_to_array((0, import_react72.useState)("idle"), 2), recorderStatus = _ref[0], setRecorderStatus = _ref[1];
49766
49532
  var superinterfaceContext = useSuperinterfaceContext();
49767
- var _ref1 = _sliced_to_array((0, import_react73.useState)(false), 2), userIsPending = _ref1[0], setUserIsPending = _ref1[1];
49768
- var _ref2 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantPlaying = _ref2[0], setAssistantPlaying = _ref2[1];
49769
- var _ref3 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantPaused = _ref3[0], setAssistantPaused = _ref3[1];
49770
- var _ref4 = _sliced_to_array((0, import_react73.useState)(true), 2), assistantIsPending = _ref4[0], setAssistantIsPending = _ref4[1];
49771
- var _ref5 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantIsReady = _ref5[0], setAssistantIsReady = _ref5[1];
49772
- var _ref6 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantAudioPlayed = _ref6[0], setAssistantAudioPlayed = _ref6[1];
49773
- var sessionStartedRef = (0, import_react73.useRef)(false);
49774
- var pcRef = (0, import_react73.useRef)(null);
49775
- var localStreamRef = (0, import_react73.useRef)(null);
49776
- var remoteStreamRef = (0, import_react73.useRef)(null);
49777
- var userAnalyserRef = (0, import_react73.useRef)(null);
49778
- var assistantAnalyserRef = (0, import_react73.useRef)(null);
49779
- var assistantAudioElRef = (0, import_react73.useRef)(null);
49780
- (0, import_react73.useEffect)(function() {
49533
+ var _ref1 = _sliced_to_array((0, import_react72.useState)(false), 2), userIsPending = _ref1[0], setUserIsPending = _ref1[1];
49534
+ var _ref2 = _sliced_to_array((0, import_react72.useState)(false), 2), assistantPlaying = _ref2[0], setAssistantPlaying = _ref2[1];
49535
+ var _ref3 = _sliced_to_array((0, import_react72.useState)(false), 2), assistantPaused = _ref3[0], setAssistantPaused = _ref3[1];
49536
+ var _ref4 = _sliced_to_array((0, import_react72.useState)(true), 2), assistantIsPending = _ref4[0], setAssistantIsPending = _ref4[1];
49537
+ var _ref5 = _sliced_to_array((0, import_react72.useState)(false), 2), assistantIsReady = _ref5[0], setAssistantIsReady = _ref5[1];
49538
+ var _ref6 = _sliced_to_array((0, import_react72.useState)(false), 2), assistantAudioPlayed = _ref6[0], setAssistantAudioPlayed = _ref6[1];
49539
+ var sessionStartedRef = (0, import_react72.useRef)(false);
49540
+ var pcRef = (0, import_react72.useRef)(null);
49541
+ var localStreamRef = (0, import_react72.useRef)(null);
49542
+ var remoteStreamRef = (0, import_react72.useRef)(null);
49543
+ var userAnalyserRef = (0, import_react72.useRef)(null);
49544
+ var assistantAnalyserRef = (0, import_react72.useRef)(null);
49545
+ var assistantAudioElRef = (0, import_react72.useRef)(null);
49546
+ (0, import_react72.useEffect)(function() {
49781
49547
  return function() {
49782
49548
  if (pcRef.current) {
49783
49549
  pcRef.current.close();
@@ -50113,7 +49879,7 @@ var useWebrtcAudioRuntime = function() {
50113
49879
  return _ref7.apply(this, arguments);
50114
49880
  };
50115
49881
  }();
50116
- return (0, import_react73.useMemo)(function() {
49882
+ return (0, import_react72.useMemo)(function() {
50117
49883
  return {
50118
49884
  webrtcAudioRuntime: {
50119
49885
  user: {
@@ -50162,10 +49928,10 @@ var useWebrtcAudioRuntime = function() {
50162
49928
  ]);
50163
49929
  };
50164
49930
  // src/components/audioRuntimes/WebrtcAudioRuntimeProvider.tsx
50165
- var import_react_compiler_runtime102 = require("react-compiler-runtime");
50166
- var import_jsx_runtime99 = require("react/jsx-runtime");
49931
+ var import_react_compiler_runtime100 = require("react-compiler-runtime");
49932
+ var import_jsx_runtime98 = require("react/jsx-runtime");
50167
49933
  var WebrtcAudioRuntimeProvider = function(t0) {
50168
- var $ = (0, import_react_compiler_runtime102.c)(5);
49934
+ var $ = (0, import_react_compiler_runtime100.c)(5);
50169
49935
  var children = t0.children;
50170
49936
  var webrtcAudioRuntime = useWebrtcAudioRuntime().webrtcAudioRuntime;
50171
49937
  var t1;
@@ -50180,7 +49946,7 @@ var WebrtcAudioRuntimeProvider = function(t0) {
50180
49946
  }
50181
49947
  var t2;
50182
49948
  if ($[2] !== children || $[3] !== t1) {
50183
- t2 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(AudioThreadContext.Provider, {
49949
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(AudioThreadContext.Provider, {
50184
49950
  value: t1,
50185
49951
  children: children
50186
49952
  });
@@ -50193,20 +49959,20 @@ var WebrtcAudioRuntimeProvider = function(t0) {
50193
49959
  return t2;
50194
49960
  };
50195
49961
  // src/components/gui/Gui/index.tsx
50196
- var import_react_compiler_runtime105 = require("react-compiler-runtime");
50197
- var import_react76 = require("react");
49962
+ var import_react_compiler_runtime103 = require("react-compiler-runtime");
49963
+ var import_react75 = require("react");
50198
49964
  var import_themes64 = require("@radix-ui/themes");
50199
49965
  // src/hooks/messages/useLatestAssistantMessage/index.ts
50200
- var import_react_compiler_runtime103 = require("react-compiler-runtime");
50201
- var import_react74 = require("react");
49966
+ var import_react_compiler_runtime101 = require("react-compiler-runtime");
49967
+ var import_react73 = require("react");
50202
49968
  var useLatestAssistantMessage = function() {
50203
- var $ = (0, import_react_compiler_runtime103.c)(4);
49969
+ var $ = (0, import_react_compiler_runtime101.c)(4);
50204
49970
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50205
49971
  var t0;
50206
49972
  var t1;
50207
49973
  if ($[0] !== messages2) {
50208
49974
  var _messages$find;
50209
- t1 = (_messages$find = messages2.find(_temp11)) !== null && _messages$find !== void 0 ? _messages$find : null;
49975
+ t1 = (_messages$find = messages2.find(_temp10)) !== null && _messages$find !== void 0 ? _messages$find : null;
50210
49976
  $[0] = messages2;
50211
49977
  $[1] = t1;
50212
49978
  } else {
@@ -50225,15 +49991,15 @@ var useLatestAssistantMessage = function() {
50225
49991
  t0 = t2;
50226
49992
  return t0;
50227
49993
  };
50228
- function _temp11(message) {
49994
+ function _temp10(message) {
50229
49995
  return message.role === "assistant";
50230
49996
  }
50231
49997
  // src/hooks/messages/useLatestAssistantMessageWithContent/index.ts
50232
- var import_react_compiler_runtime104 = require("react-compiler-runtime");
49998
+ var import_react_compiler_runtime102 = require("react-compiler-runtime");
50233
49999
  var import_radash18 = require("radash");
50234
- var import_react75 = require("react");
50000
+ var import_react74 = require("react");
50235
50001
  var useLatestAssistantMessageWithContent = function() {
50236
- var $ = (0, import_react_compiler_runtime104.c)(4);
50002
+ var $ = (0, import_react_compiler_runtime102.c)(4);
50237
50003
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50238
50004
  var t0;
50239
50005
  var t1;
@@ -50258,21 +50024,21 @@ var useLatestAssistantMessageWithContent = function() {
50258
50024
  t0 = t2;
50259
50025
  return t0;
50260
50026
  };
50261
- function _temp12(content2) {
50027
+ function _temp11(content2) {
50262
50028
  return content2.type === "text" && !(0, import_radash18.isEmpty)(content2.text.value);
50263
50029
  }
50264
50030
  function _temp25(message) {
50265
- return message.role === "assistant" && message.content.some(_temp12);
50031
+ return message.role === "assistant" && message.content.some(_temp11);
50266
50032
  }
50267
50033
  // src/components/gui/Gui/index.tsx
50268
- var import_jsx_runtime100 = require("react/jsx-runtime");
50034
+ var import_jsx_runtime99 = require("react/jsx-runtime");
50269
50035
  var StartingToolCalls3 = function() {
50270
- var $ = (0, import_react_compiler_runtime105.c)(2);
50036
+ var $ = (0, import_react_compiler_runtime103.c)(2);
50271
50037
  var _useComponents = useComponents(), t0 = _useComponents.components;
50272
50038
  var StartingToolCalls4 = t0.StartingToolCalls;
50273
50039
  var t1;
50274
50040
  if ($[0] !== StartingToolCalls4) {
50275
- t1 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(StartingToolCalls4, {});
50041
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(StartingToolCalls4, {});
50276
50042
  $[0] = StartingToolCalls4;
50277
50043
  $[1] = t1;
50278
50044
  } else {
@@ -50281,7 +50047,7 @@ var StartingToolCalls3 = function() {
50281
50047
  return t1;
50282
50048
  };
50283
50049
  var Content10 = function(t0) {
50284
- var $ = (0, import_react_compiler_runtime105.c)(5);
50050
+ var $ = (0, import_react_compiler_runtime103.c)(5);
50285
50051
  var latestRunStep = t0.latestRunStep;
50286
50052
  var t1;
50287
50053
  bb0: {
@@ -50303,7 +50069,7 @@ var Content10 = function(t0) {
50303
50069
  if (!latestRunStep || latestRunStep.step_details.type !== "tool_calls") {
50304
50070
  var _t;
50305
50071
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
50306
- _t = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Spinner, {});
50072
+ _t = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Spinner, {});
50307
50073
  $[0] = _t;
50308
50074
  } else {
50309
50075
  _t = $[0];
@@ -50313,7 +50079,7 @@ var Content10 = function(t0) {
50313
50079
  if (!latestToolCall) {
50314
50080
  var _t2;
50315
50081
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
50316
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(StartingToolCalls3, {});
50082
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(StartingToolCalls3, {});
50317
50083
  $[1] = _t2;
50318
50084
  } else {
50319
50085
  _t2 = $[1];
@@ -50322,7 +50088,7 @@ var Content10 = function(t0) {
50322
50088
  }
50323
50089
  var t2;
50324
50090
  if ($[2] !== latestRunStep || $[3] !== latestToolCall) {
50325
- t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ToolCall, {
50091
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ToolCall, {
50326
50092
  runStep: latestRunStep,
50327
50093
  toolCall: latestToolCall
50328
50094
  });
@@ -50335,14 +50101,14 @@ var Content10 = function(t0) {
50335
50101
  return t2;
50336
50102
  };
50337
50103
  var Progress2 = function(t0) {
50338
- var $ = (0, import_react_compiler_runtime105.c)(5);
50104
+ var $ = (0, import_react_compiler_runtime103.c)(5);
50339
50105
  var latestAssistantMessage = t0.latestAssistantMessage;
50340
50106
  var isMutatingMessage = useIsMutatingMessage();
50341
50107
  var t1;
50342
50108
  var t2;
50343
50109
  if ($[0] !== latestAssistantMessage.runSteps) {
50344
50110
  var _latestAssistantMessa;
50345
- t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp13)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
50111
+ t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp12)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
50346
50112
  $[0] = latestAssistantMessage.runSteps;
50347
50113
  $[1] = t2;
50348
50114
  } else {
@@ -50369,10 +50135,10 @@ var Progress2 = function(t0) {
50369
50135
  }
50370
50136
  var t4;
50371
50137
  if ($[3] !== latestRunStep) {
50372
- t4 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Flex, {
50138
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Flex, {
50373
50139
  style: t3,
50374
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Card, {
50375
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Content10, {
50140
+ children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Card, {
50141
+ children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Content10, {
50376
50142
  latestRunStep: latestRunStep
50377
50143
  })
50378
50144
  })
@@ -50385,20 +50151,20 @@ var Progress2 = function(t0) {
50385
50151
  return t4;
50386
50152
  };
50387
50153
  var Gui = function() {
50388
- var $ = (0, import_react_compiler_runtime105.c)(8);
50154
+ var $ = (0, import_react_compiler_runtime103.c)(8);
50389
50155
  var latestAssistantMessage = useLatestAssistantMessage().latestAssistantMessage;
50390
50156
  var latestAssistantMessageWithContent = useLatestAssistantMessageWithContent().latestAssistantMessageWithContent;
50391
50157
  if (!latestAssistantMessage || !latestAssistantMessageWithContent) {
50392
50158
  var _t3;
50393
50159
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
50394
- _t3 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Flex, {
50160
+ _t3 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Flex, {
50395
50161
  direction: "column",
50396
50162
  flexGrow: "1",
50397
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Flex, {
50163
+ children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Flex, {
50398
50164
  align: "center",
50399
50165
  justify: "center",
50400
50166
  flexGrow: "1",
50401
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes64.Spinner, {
50167
+ children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes64.Spinner, {
50402
50168
  size: "3"
50403
50169
  })
50404
50170
  })
@@ -50411,7 +50177,7 @@ var Gui = function() {
50411
50177
  }
50412
50178
  var t0;
50413
50179
  if ($[1] !== latestAssistantMessageWithContent) {
50414
- t0 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(MessageContent, {
50180
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(MessageContent, {
50415
50181
  message: latestAssistantMessageWithContent
50416
50182
  });
50417
50183
  $[1] = latestAssistantMessageWithContent;
@@ -50421,7 +50187,7 @@ var Gui = function() {
50421
50187
  }
50422
50188
  var t1;
50423
50189
  if ($[3] !== latestAssistantMessage) {
50424
- t1 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Progress2, {
50190
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Progress2, {
50425
50191
  latestAssistantMessage: latestAssistantMessage
50426
50192
  });
50427
50193
  $[3] = latestAssistantMessage;
@@ -50431,7 +50197,7 @@ var Gui = function() {
50431
50197
  }
50432
50198
  var t2;
50433
50199
  if ($[5] !== t0 || $[6] !== t1) {
50434
- t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_themes64.Flex, {
50200
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_themes64.Flex, {
50435
50201
  direction: "column",
50436
50202
  flexGrow: "1",
50437
50203
  children: [
@@ -50447,13 +50213,13 @@ var Gui = function() {
50447
50213
  }
50448
50214
  return t2;
50449
50215
  };
50450
- function _temp13(rs) {
50216
+ function _temp12(rs) {
50451
50217
  return rs.status === "in_progress";
50452
50218
  }
50453
50219
  // src/components/markdown/MarkdownProvider/index.tsx
50454
- var import_react_compiler_runtime106 = require("react-compiler-runtime");
50455
- var import_react77 = require("react");
50456
- var import_jsx_runtime101 = require("react/jsx-runtime");
50220
+ var import_react_compiler_runtime104 = require("react-compiler-runtime");
50221
+ var import_react76 = require("react");
50222
+ var import_jsx_runtime100 = require("react/jsx-runtime");
50457
50223
  var _excluded7 = [
50458
50224
  "children"
50459
50225
  ];
@@ -50476,7 +50242,7 @@ function _objectWithoutPropertiesLoose7(r, e) {
50476
50242
  return t;
50477
50243
  }
50478
50244
  var MarkdownProvider = function(t0) {
50479
- var $ = (0, import_react_compiler_runtime106.c)(9);
50245
+ var $ = (0, import_react_compiler_runtime104.c)(9);
50480
50246
  var children;
50481
50247
  var rest;
50482
50248
  if ($[0] !== t0) {
@@ -50506,7 +50272,7 @@ var MarkdownProvider = function(t0) {
50506
50272
  var value = t1;
50507
50273
  var t3;
50508
50274
  if ($[6] !== children || $[7] !== value) {
50509
- t3 = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(MarkdownContext.Provider, {
50275
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(MarkdownContext.Provider, {
50510
50276
  value: value,
50511
50277
  children: children
50512
50278
  });
@@ -50519,18 +50285,18 @@ var MarkdownProvider = function(t0) {
50519
50285
  return t3;
50520
50286
  };
50521
50287
  // src/components/annotations/SourceAnnotation/index.tsx
50522
- var import_react_compiler_runtime109 = require("react-compiler-runtime");
50288
+ var import_react_compiler_runtime107 = require("react-compiler-runtime");
50523
50289
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50524
- var import_react_compiler_runtime108 = require("react-compiler-runtime");
50525
- var import_react78 = require("react");
50290
+ var import_react_compiler_runtime106 = require("react-compiler-runtime");
50291
+ var import_react77 = require("react");
50526
50292
  var import_react_icons18 = require("@radix-ui/react-icons");
50527
50293
  var import_themes66 = require("@radix-ui/themes");
50528
50294
  // src/components/annotations/SourceAnnotation/FileCitation/Content.tsx
50529
- var import_react_compiler_runtime107 = require("react-compiler-runtime");
50295
+ var import_react_compiler_runtime105 = require("react-compiler-runtime");
50530
50296
  var import_themes65 = require("@radix-ui/themes");
50531
- var import_jsx_runtime102 = require("react/jsx-runtime");
50297
+ var import_jsx_runtime101 = require("react/jsx-runtime");
50532
50298
  var Content11 = function(t0) {
50533
- var $ = (0, import_react_compiler_runtime107.c)(5);
50299
+ var $ = (0, import_react_compiler_runtime105.c)(5);
50534
50300
  var fileId = t0.fileId;
50535
50301
  var superinterfaceContext = useSuperinterfaceContext();
50536
50302
  var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
@@ -50567,18 +50333,18 @@ var Content11 = function(t0) {
50567
50333
  }
50568
50334
  var t5;
50569
50335
  if ($[3] !== t3) {
50570
- t5 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes65.Flex, {
50336
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_themes65.Flex, {
50571
50337
  direction: "column",
50572
50338
  flexGrow: "1",
50573
50339
  gap: "3",
50574
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes65.Card, {
50340
+ children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_themes65.Card, {
50575
50341
  style: t1,
50576
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes65.Inset, {
50342
+ children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_themes65.Inset, {
50577
50343
  clip: "padding-box",
50578
50344
  style: t2,
50579
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes65.Flex, {
50345
+ children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_themes65.Flex, {
50580
50346
  flexGrow: "1",
50581
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("embed", {
50347
+ children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("embed", {
50582
50348
  src: t3,
50583
50349
  style: t4
50584
50350
  })
@@ -50594,11 +50360,11 @@ var Content11 = function(t0) {
50594
50360
  return t5;
50595
50361
  };
50596
50362
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50597
- var import_jsx_runtime103 = require("react/jsx-runtime");
50363
+ var import_jsx_runtime102 = require("react/jsx-runtime");
50598
50364
  var FileCitation = function(t0) {
50599
- var $ = (0, import_react_compiler_runtime108.c)(18);
50365
+ var $ = (0, import_react_compiler_runtime106.c)(18);
50600
50366
  var annotation = t0.annotation;
50601
- var _ref = _sliced_to_array((0, import_react78.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
50367
+ var _ref = _sliced_to_array((0, import_react77.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
50602
50368
  var t1;
50603
50369
  if ($[0] !== annotation.file_citation.file_id) {
50604
50370
  t1 = function() {
@@ -50611,14 +50377,14 @@ var FileCitation = function(t0) {
50611
50377
  }
50612
50378
  var t2;
50613
50379
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
50614
- t2 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_react_icons18.QuoteIcon, {});
50380
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_icons18.QuoteIcon, {});
50615
50381
  $[2] = t2;
50616
50382
  } else {
50617
50383
  t2 = $[2];
50618
50384
  }
50619
50385
  var t3;
50620
50386
  if ($[3] !== t1) {
50621
- t3 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_themes66.IconButton, {
50387
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes66.IconButton, {
50622
50388
  variant: "soft",
50623
50389
  color: "gray",
50624
50390
  size: "1",
@@ -50654,9 +50420,9 @@ var FileCitation = function(t0) {
50654
50420
  }
50655
50421
  var t7;
50656
50422
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
50657
- t7 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_themes66.VisuallyHidden, {
50423
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes66.VisuallyHidden, {
50658
50424
  asChild: true,
50659
- children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_themes66.Dialog.Title, {
50425
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes66.Dialog.Title, {
50660
50426
  children: "Source"
50661
50427
  })
50662
50428
  });
@@ -50666,7 +50432,7 @@ var FileCitation = function(t0) {
50666
50432
  }
50667
50433
  var t8;
50668
50434
  if ($[8] !== activeFileId) {
50669
- t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Content11, {
50435
+ t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Content11, {
50670
50436
  fileId: activeFileId
50671
50437
  });
50672
50438
  $[8] = activeFileId;
@@ -50676,7 +50442,7 @@ var FileCitation = function(t0) {
50676
50442
  }
50677
50443
  var t9;
50678
50444
  if ($[10] !== t8) {
50679
- t9 = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_themes66.Dialog.Content, {
50445
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_themes66.Dialog.Content, {
50680
50446
  width: "1000px",
50681
50447
  height: "90vh",
50682
50448
  maxWidth: "calc(100vw - 2 * var(--space-4))",
@@ -50694,7 +50460,7 @@ var FileCitation = function(t0) {
50694
50460
  }
50695
50461
  var t10;
50696
50462
  if ($[12] !== t4 || $[13] !== t9) {
50697
- t10 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_themes66.Dialog.Root, {
50463
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_themes66.Dialog.Root, {
50698
50464
  open: t4,
50699
50465
  onOpenChange: t5,
50700
50466
  children: t9
@@ -50707,7 +50473,7 @@ var FileCitation = function(t0) {
50707
50473
  }
50708
50474
  var t11;
50709
50475
  if ($[15] !== t10 || $[16] !== t3) {
50710
- t11 = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, {
50476
+ t11 = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, {
50711
50477
  children: [
50712
50478
  t3,
50713
50479
  t10
@@ -50722,7 +50488,7 @@ var FileCitation = function(t0) {
50722
50488
  return t11;
50723
50489
  };
50724
50490
  // src/components/annotations/SourceAnnotation/index.tsx
50725
- var import_jsx_runtime104 = require("react/jsx-runtime");
50491
+ var import_jsx_runtime103 = require("react/jsx-runtime");
50726
50492
  var _excluded8 = [
50727
50493
  "children"
50728
50494
  ];
@@ -50745,7 +50511,7 @@ function _objectWithoutPropertiesLoose8(r, e) {
50745
50511
  return t;
50746
50512
  }
50747
50513
  var SourceAnnotation = function(t0) {
50748
- var $ = (0, import_react_compiler_runtime109.c)(10);
50514
+ var $ = (0, import_react_compiler_runtime107.c)(10);
50749
50515
  var children;
50750
50516
  var rest;
50751
50517
  if ($[0] !== t0) {
@@ -50773,7 +50539,7 @@ var SourceAnnotation = function(t0) {
50773
50539
  if (annotation.type === "file_citation") {
50774
50540
  var t2;
50775
50541
  if ($[5] !== annotation) {
50776
- t2 = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(FileCitation, {
50542
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(FileCitation, {
50777
50543
  annotation: annotation
50778
50544
  });
50779
50545
  $[5] = annotation;
@@ -50786,7 +50552,7 @@ var SourceAnnotation = function(t0) {
50786
50552
  if (annotation.type === "file_path") {
50787
50553
  var _t2;
50788
50554
  if ($[7] !== annotation || $[8] !== children) {
50789
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(FilePathAnnotation, {
50555
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(FilePathAnnotation, {
50790
50556
  annotation: annotation,
50791
50557
  children: children
50792
50558
  });
@@ -50802,7 +50568,7 @@ var SourceAnnotation = function(t0) {
50802
50568
  return null;
50803
50569
  };
50804
50570
  // src/components/avatars/Avatar.tsx
50805
- var import_react_compiler_runtime112 = require("react-compiler-runtime");
50571
+ var import_react_compiler_runtime110 = require("react-compiler-runtime");
50806
50572
  // src/enums/index.ts
50807
50573
  var IconAvatarName = /* @__PURE__ */ function(IconAvatarName2) {
50808
50574
  IconAvatarName2["BACKPACK"] = "BACKPACK";
@@ -50827,7 +50593,7 @@ var AvatarType = /* @__PURE__ */ function(AvatarType2) {
50827
50593
  // src/components/avatars/Avatar.tsx
50828
50594
  var import_themes69 = require("@radix-ui/themes");
50829
50595
  // src/components/imageAvatars/ImageAvatar/index.tsx
50830
- var import_react_compiler_runtime110 = require("react-compiler-runtime");
50596
+ var import_react_compiler_runtime108 = require("react-compiler-runtime");
50831
50597
  var import_themes67 = require("@radix-ui/themes");
50832
50598
  // src/components/imageAvatars/ImageAvatar/lib/optimizedSrc/path.ts
50833
50599
  var width = function(_ref) {
@@ -50879,9 +50645,9 @@ var optimizedSrc = function(_ref) {
50879
50645
  }));
50880
50646
  };
50881
50647
  // src/components/imageAvatars/ImageAvatar/index.tsx
50882
- var import_jsx_runtime105 = require("react/jsx-runtime");
50648
+ var import_jsx_runtime104 = require("react/jsx-runtime");
50883
50649
  var ImageAvatar = function(t0) {
50884
- var $ = (0, import_react_compiler_runtime110.c)(9);
50650
+ var $ = (0, import_react_compiler_runtime108.c)(9);
50885
50651
  var imageAvatar = t0.imageAvatar, size = t0.size, className = t0.className, style = t0.style;
50886
50652
  var superinterfaceContext = useSuperinterfaceContext();
50887
50653
  var t1;
@@ -50900,7 +50666,7 @@ var ImageAvatar = function(t0) {
50900
50666
  }
50901
50667
  var t2;
50902
50668
  if ($[4] !== className || $[5] !== size || $[6] !== style || $[7] !== t1) {
50903
- t2 = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_themes67.Avatar, {
50669
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_themes67.Avatar, {
50904
50670
  className: className,
50905
50671
  style: style,
50906
50672
  fallback: "",
@@ -50918,24 +50684,24 @@ var ImageAvatar = function(t0) {
50918
50684
  return t2;
50919
50685
  };
50920
50686
  // src/components/iconAvatars/IconAvatar.tsx
50921
- var import_react_compiler_runtime111 = require("react-compiler-runtime");
50922
- var import_react79 = require("react");
50687
+ var import_react_compiler_runtime109 = require("react-compiler-runtime");
50688
+ var import_react78 = require("react");
50923
50689
  var import_themes68 = require("@radix-ui/themes");
50924
50690
  // src/lib/iconAvatars/iconAvatarComponents.ts
50925
50691
  var import_react_icons19 = require("@radix-ui/react-icons");
50926
50692
  var _obj;
50927
50693
  var iconAvatarComponents = (_obj = {}, _define_property(_obj, IconAvatarName.BACKPACK, import_react_icons19.BackpackIcon), _define_property(_obj, IconAvatarName.ROCKET, import_react_icons19.RocketIcon), _define_property(_obj, IconAvatarName.MAGIC_WAND, import_react_icons19.MagicWandIcon), _define_property(_obj, IconAvatarName.CUBE, import_react_icons19.CubeIcon), _define_property(_obj, IconAvatarName.TARGET, import_react_icons19.TargetIcon), _define_property(_obj, IconAvatarName.DISC, import_react_icons19.DiscIcon), _define_property(_obj, IconAvatarName.GLOBE, import_react_icons19.GlobeIcon), _define_property(_obj, IconAvatarName.STAR, import_react_icons19.StarIcon), _define_property(_obj, IconAvatarName.LIGHTNING_BOLT, import_react_icons19.LightningBoltIcon), _define_property(_obj, IconAvatarName.FACE, import_react_icons19.FaceIcon), _define_property(_obj, IconAvatarName.PERSON, import_react_icons19.PersonIcon), _define_property(_obj, IconAvatarName.HEART, import_react_icons19.HeartIcon), _obj);
50928
50694
  // src/components/iconAvatars/IconAvatar.tsx
50929
- var import_jsx_runtime106 = require("react/jsx-runtime");
50695
+ var import_jsx_runtime105 = require("react/jsx-runtime");
50930
50696
  var IconAvatar = function(t0) {
50931
- var $ = (0, import_react_compiler_runtime111.c)(7);
50697
+ var $ = (0, import_react_compiler_runtime109.c)(7);
50932
50698
  var iconAvatar = t0.iconAvatar, size = t0.size, className = t0.className, style = t0.style;
50933
50699
  var t1;
50934
50700
  t1 = iconAvatarComponents[iconAvatar.name];
50935
50701
  var Component2 = t1;
50936
50702
  var t2;
50937
50703
  if ($[0] !== Component2) {
50938
- t2 = Component2 ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Component2, {}) : "";
50704
+ t2 = Component2 ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Component2, {}) : "";
50939
50705
  $[0] = Component2;
50940
50706
  $[1] = t2;
50941
50707
  } else {
@@ -50943,7 +50709,7 @@ var IconAvatar = function(t0) {
50943
50709
  }
50944
50710
  var t3;
50945
50711
  if ($[2] !== className || $[3] !== size || $[4] !== style || $[5] !== t2) {
50946
- t3 = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_themes68.Avatar, {
50712
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_themes68.Avatar, {
50947
50713
  className: className,
50948
50714
  style: style,
50949
50715
  size: size,
@@ -50960,16 +50726,16 @@ var IconAvatar = function(t0) {
50960
50726
  return t3;
50961
50727
  };
50962
50728
  // src/components/avatars/Avatar.tsx
50963
- var import_jsx_runtime107 = require("react/jsx-runtime");
50729
+ var import_jsx_runtime106 = require("react/jsx-runtime");
50964
50730
  var Avatar6 = function(t0) {
50965
- var $ = (0, import_react_compiler_runtime112.c)(14);
50731
+ var $ = (0, import_react_compiler_runtime110.c)(14);
50966
50732
  var avatar = t0.avatar, t1 = t0.size, className = t0.className, style = t0.style;
50967
50733
  var size = t1 === void 0 ? "1" : t1;
50968
50734
  if (avatar) {
50969
50735
  if (avatar.type === AvatarType.IMAGE && avatar.imageAvatar) {
50970
50736
  var _t;
50971
50737
  if ($[0] !== avatar.imageAvatar || $[1] !== className || $[2] !== size || $[3] !== style) {
50972
- _t = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ImageAvatar, {
50738
+ _t = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ImageAvatar, {
50973
50739
  imageAvatar: avatar.imageAvatar,
50974
50740
  size: size,
50975
50741
  className: className,
@@ -50988,7 +50754,7 @@ var Avatar6 = function(t0) {
50988
50754
  if (avatar.type === AvatarType.ICON && avatar.iconAvatar) {
50989
50755
  var _t2;
50990
50756
  if ($[5] !== avatar.iconAvatar || $[6] !== className || $[7] !== size || $[8] !== style) {
50991
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(IconAvatar, {
50757
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(IconAvatar, {
50992
50758
  iconAvatar: avatar.iconAvatar,
50993
50759
  size: size,
50994
50760
  className: className,
@@ -51007,7 +50773,7 @@ var Avatar6 = function(t0) {
51007
50773
  }
51008
50774
  var t2;
51009
50775
  if ($[10] !== className || $[11] !== size || $[12] !== style) {
51010
- t2 = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_themes69.Avatar, {
50776
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_themes69.Avatar, {
51011
50777
  fallback: "",
51012
50778
  size: size,
51013
50779
  className: className,
@@ -51023,9 +50789,9 @@ var Avatar6 = function(t0) {
51023
50789
  return t2;
51024
50790
  };
51025
50791
  // src/components/components/ComponentsProvider.tsx
51026
- var import_react_compiler_runtime113 = require("react-compiler-runtime");
51027
- var import_react80 = require("react");
51028
- var import_jsx_runtime108 = require("react/jsx-runtime");
50792
+ var import_react_compiler_runtime111 = require("react-compiler-runtime");
50793
+ var import_react79 = require("react");
50794
+ var import_jsx_runtime107 = require("react/jsx-runtime");
51029
50795
  var _excluded9 = [
51030
50796
  "children"
51031
50797
  ];
@@ -51048,7 +50814,7 @@ function _objectWithoutPropertiesLoose9(r, e) {
51048
50814
  return t;
51049
50815
  }
51050
50816
  var ComponentsProvider = function(t0) {
51051
- var $ = (0, import_react_compiler_runtime113.c)(9);
50817
+ var $ = (0, import_react_compiler_runtime111.c)(9);
51052
50818
  var children;
51053
50819
  var rest;
51054
50820
  if ($[0] !== t0) {
@@ -51078,7 +50844,7 @@ var ComponentsProvider = function(t0) {
51078
50844
  var value = t1;
51079
50845
  var t3;
51080
50846
  if ($[6] !== children || $[7] !== value) {
51081
- t3 = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ComponentsContext.Provider, {
50847
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ComponentsContext.Provider, {
51082
50848
  value: value,
51083
50849
  children: children
51084
50850
  });
@@ -51091,11 +50857,11 @@ var ComponentsProvider = function(t0) {
51091
50857
  return t3;
51092
50858
  };
51093
50859
  // src/components/assistants/AssistantProvider/index.tsx
51094
- var import_react_compiler_runtime114 = require("react-compiler-runtime");
51095
- var import_jsx_runtime109 = require("react/jsx-runtime");
50860
+ var import_react_compiler_runtime112 = require("react-compiler-runtime");
50861
+ var import_jsx_runtime108 = require("react/jsx-runtime");
51096
50862
  var AssistantProvider = function(t0) {
51097
50863
  var _assistant$name;
51098
- var $ = (0, import_react_compiler_runtime114.c)(10);
50864
+ var $ = (0, import_react_compiler_runtime112.c)(10);
51099
50865
  var children = t0.children;
51100
50866
  var superinterfaceContext = useSuperinterfaceContext();
51101
50867
  var t1;
@@ -51113,7 +50879,7 @@ var AssistantProvider = function(t0) {
51113
50879
  var t3 = assistant === null || assistant === void 0 ? void 0 : assistant.avatar;
51114
50880
  var t4;
51115
50881
  if ($[2] !== t3) {
51116
- t4 = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Avatar6, {
50882
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Avatar6, {
51117
50883
  avatar: t3
51118
50884
  });
51119
50885
  $[2] = t3;
@@ -51123,7 +50889,7 @@ var AssistantProvider = function(t0) {
51123
50889
  }
51124
50890
  var t5;
51125
50891
  if ($[4] !== children || $[5] !== t4) {
51126
- t5 = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(AssistantAvatarContext.Provider, {
50892
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AssistantAvatarContext.Provider, {
51127
50893
  value: t4,
51128
50894
  children: children
51129
50895
  });
@@ -51135,7 +50901,7 @@ var AssistantProvider = function(t0) {
51135
50901
  }
51136
50902
  var t6;
51137
50903
  if ($[7] !== t2 || $[8] !== t5) {
51138
- t6 = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(AssistantNameContext.Provider, {
50904
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AssistantNameContext.Provider, {
51139
50905
  value: t2,
51140
50906
  children: t5
51141
50907
  });