@workflow/web 4.1.6 → 4.1.7

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-BcILn2ch.js","assets/index-DQa-BExo.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-D1wKXrjI.js","assets/index-DQa-BExo.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -15539,7 +15539,7 @@ const WorkflowRunBaseSchema = object({
15539
15539
  // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
15540
15540
  specVersion: number$2().optional(),
15541
15541
  executionContext: record(string$2(), any()).optional(),
15542
- input: SerializedDataSchema,
15542
+ input: SerializedDataSchema.optional(),
15543
15543
  output: SerializedDataSchema.optional(),
15544
15544
  error: StructuredErrorSchema.optional(),
15545
15545
  expiredAt: date().optional(),
@@ -15610,7 +15610,7 @@ object({
15610
15610
  */
15611
15611
  stepName: string$2(),
15612
15612
  status: StepStatusSchema,
15613
- input: SerializedDataSchema,
15613
+ input: SerializedDataSchema.optional(),
15614
15614
  output: SerializedDataSchema.optional(),
15615
15615
  /**
15616
15616
  * The error from a step_retrying or step_failed event.
@@ -15913,251 +15913,1340 @@ function Spinner({ size: size2 = 14, color: color5 }) {
15913
15913
  animationDelay: `${delay}ms`
15914
15914
  } }, delay))] });
15915
15915
  }
15916
- var __create = Object.create;
15917
- var __defProp2 = Object.defineProperty;
15918
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15919
- var __getOwnPropNames = Object.getOwnPropertyNames;
15920
- var __getProtoOf = Object.getPrototypeOf;
15921
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15922
- var __commonJS = (cb, mod) => function __require() {
15923
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15916
+ function __insertCSS(code2) {
15917
+ if (typeof document == "undefined") return;
15918
+ let head = document.head || document.getElementsByTagName("head")[0];
15919
+ let style2 = document.createElement("style");
15920
+ style2.type = "text/css";
15921
+ head.appendChild(style2);
15922
+ style2.styleSheet ? style2.styleSheet.cssText = code2 : style2.appendChild(document.createTextNode(code2));
15923
+ }
15924
+ const getAsset = (type) => {
15925
+ switch (type) {
15926
+ case "success":
15927
+ return SuccessIcon;
15928
+ case "info":
15929
+ return InfoIcon;
15930
+ case "warning":
15931
+ return WarningIcon;
15932
+ case "error":
15933
+ return ErrorIcon;
15934
+ default:
15935
+ return null;
15936
+ }
15924
15937
  };
15925
- var __export = (target2, all2) => {
15926
- for (var name2 in all2)
15927
- __defProp2(target2, name2, { get: all2[name2], enumerable: true });
15938
+ const bars = Array(12).fill(0);
15939
+ const Loader = ({ visible, className }) => {
15940
+ return /* @__PURE__ */ ReactExports.createElement("div", {
15941
+ className: [
15942
+ "sonner-loading-wrapper",
15943
+ className
15944
+ ].filter(Boolean).join(" "),
15945
+ "data-visible": visible
15946
+ }, /* @__PURE__ */ ReactExports.createElement("div", {
15947
+ className: "sonner-spinner"
15948
+ }, bars.map((_2, i) => /* @__PURE__ */ ReactExports.createElement("div", {
15949
+ className: "sonner-loading-bar",
15950
+ key: `spinner-bar-${i}`
15951
+ }))));
15928
15952
  };
15929
- var __copyProps = (to2, from, except, desc) => {
15930
- if (from && typeof from === "object" || typeof from === "function") {
15931
- for (let key of __getOwnPropNames(from))
15932
- if (!__hasOwnProp.call(to2, key) && key !== except)
15933
- __defProp2(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15934
- }
15935
- return to2;
15953
+ const SuccessIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
15954
+ xmlns: "http://www.w3.org/2000/svg",
15955
+ viewBox: "0 0 20 20",
15956
+ fill: "currentColor",
15957
+ height: "20",
15958
+ width: "20"
15959
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
15960
+ fillRule: "evenodd",
15961
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
15962
+ clipRule: "evenodd"
15963
+ }));
15964
+ const WarningIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
15965
+ xmlns: "http://www.w3.org/2000/svg",
15966
+ viewBox: "0 0 24 24",
15967
+ fill: "currentColor",
15968
+ height: "20",
15969
+ width: "20"
15970
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
15971
+ fillRule: "evenodd",
15972
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
15973
+ clipRule: "evenodd"
15974
+ }));
15975
+ const InfoIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
15976
+ xmlns: "http://www.w3.org/2000/svg",
15977
+ viewBox: "0 0 20 20",
15978
+ fill: "currentColor",
15979
+ height: "20",
15980
+ width: "20"
15981
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
15982
+ fillRule: "evenodd",
15983
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
15984
+ clipRule: "evenodd"
15985
+ }));
15986
+ const ErrorIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
15987
+ xmlns: "http://www.w3.org/2000/svg",
15988
+ viewBox: "0 0 20 20",
15989
+ fill: "currentColor",
15990
+ height: "20",
15991
+ width: "20"
15992
+ }, /* @__PURE__ */ ReactExports.createElement("path", {
15993
+ fillRule: "evenodd",
15994
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
15995
+ clipRule: "evenodd"
15996
+ }));
15997
+ const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
15998
+ xmlns: "http://www.w3.org/2000/svg",
15999
+ width: "12",
16000
+ height: "12",
16001
+ viewBox: "0 0 24 24",
16002
+ fill: "none",
16003
+ stroke: "currentColor",
16004
+ strokeWidth: "1.5",
16005
+ strokeLinecap: "round",
16006
+ strokeLinejoin: "round"
16007
+ }, /* @__PURE__ */ ReactExports.createElement("line", {
16008
+ x1: "18",
16009
+ y1: "6",
16010
+ x2: "6",
16011
+ y2: "18"
16012
+ }), /* @__PURE__ */ ReactExports.createElement("line", {
16013
+ x1: "6",
16014
+ y1: "6",
16015
+ x2: "18",
16016
+ y2: "18"
16017
+ }));
16018
+ const useIsDocumentHidden = () => {
16019
+ const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
16020
+ ReactExports.useEffect(() => {
16021
+ const callback = () => {
16022
+ setIsDocumentHidden(document.hidden);
16023
+ };
16024
+ document.addEventListener("visibilitychange", callback);
16025
+ return () => window.removeEventListener("visibilitychange", callback);
16026
+ }, []);
16027
+ return isDocumentHidden;
15936
16028
  };
15937
- var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
15938
- // If the importer is in node compatibility mode or this is not an ESM
15939
- // file that has been converted to a CommonJS file using a Babel-
15940
- // compatible transform (i.e. "__esModule" has not been set), then set
15941
- // "default" to the CommonJS "module.exports" for node compatibility.
15942
- __defProp2(target2, "default", { value: mod, enumerable: true }),
15943
- mod
15944
- ));
15945
- var require_is_object = __commonJS({
15946
- "node_modules/is-object/index.js"(exports$1, module) {
15947
- module.exports = function isObject2(x2) {
15948
- return typeof x2 === "object" && x2 !== null;
16029
+ let toastsCounter = 1;
16030
+ class Observer {
16031
+ constructor() {
16032
+ this.subscribe = (subscriber) => {
16033
+ this.subscribers.push(subscriber);
16034
+ return () => {
16035
+ const index2 = this.subscribers.indexOf(subscriber);
16036
+ this.subscribers.splice(index2, 1);
16037
+ };
15949
16038
  };
15950
- }
15951
- });
15952
- var require_is_window = __commonJS({
15953
- "node_modules/is-window/index.js"(exports$1, module) {
15954
- module.exports = function(obj) {
15955
- if (obj == null) {
15956
- return false;
16039
+ this.publish = (data) => {
16040
+ this.subscribers.forEach((subscriber) => subscriber(data));
16041
+ };
16042
+ this.addToast = (data) => {
16043
+ this.publish(data);
16044
+ this.toasts = [
16045
+ ...this.toasts,
16046
+ data
16047
+ ];
16048
+ };
16049
+ this.create = (data) => {
16050
+ var _data_id;
16051
+ const { message, ...rest } = data;
16052
+ const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
16053
+ const alreadyExists = this.toasts.find((toast2) => {
16054
+ return toast2.id === id;
16055
+ });
16056
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
16057
+ if (this.dismissedToasts.has(id)) {
16058
+ this.dismissedToasts.delete(id);
15957
16059
  }
15958
- var o = Object(obj);
15959
- return o === o.window;
16060
+ if (alreadyExists) {
16061
+ this.toasts = this.toasts.map((toast2) => {
16062
+ if (toast2.id === id) {
16063
+ this.publish({
16064
+ ...toast2,
16065
+ ...data,
16066
+ id,
16067
+ title: message
16068
+ });
16069
+ return {
16070
+ ...toast2,
16071
+ ...data,
16072
+ id,
16073
+ dismissible,
16074
+ title: message
16075
+ };
16076
+ }
16077
+ return toast2;
16078
+ });
16079
+ } else {
16080
+ this.addToast({
16081
+ title: message,
16082
+ ...rest,
16083
+ dismissible,
16084
+ id
16085
+ });
16086
+ }
16087
+ return id;
15960
16088
  };
15961
- }
15962
- });
15963
- var require_is_dom = __commonJS({
15964
- "node_modules/is-dom/index.js"(exports$1, module) {
15965
- var isObject2 = require_is_object();
15966
- var isWindow = require_is_window();
15967
- function isNode2(val) {
15968
- if (!isObject2(val) || !isWindow(window) || typeof window.Node !== "function") {
15969
- return false;
16089
+ this.dismiss = (id) => {
16090
+ if (id) {
16091
+ this.dismissedToasts.add(id);
16092
+ requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
16093
+ id,
16094
+ dismiss: true
16095
+ })));
16096
+ } else {
16097
+ this.toasts.forEach((toast2) => {
16098
+ this.subscribers.forEach((subscriber) => subscriber({
16099
+ id: toast2.id,
16100
+ dismiss: true
16101
+ }));
16102
+ });
15970
16103
  }
15971
- return typeof val.nodeType === "number" && typeof val.nodeName === "string";
15972
- }
15973
- module.exports = isNode2;
16104
+ return id;
16105
+ };
16106
+ this.message = (message, data) => {
16107
+ return this.create({
16108
+ ...data,
16109
+ message
16110
+ });
16111
+ };
16112
+ this.error = (message, data) => {
16113
+ return this.create({
16114
+ ...data,
16115
+ message,
16116
+ type: "error"
16117
+ });
16118
+ };
16119
+ this.success = (message, data) => {
16120
+ return this.create({
16121
+ ...data,
16122
+ type: "success",
16123
+ message
16124
+ });
16125
+ };
16126
+ this.info = (message, data) => {
16127
+ return this.create({
16128
+ ...data,
16129
+ type: "info",
16130
+ message
16131
+ });
16132
+ };
16133
+ this.warning = (message, data) => {
16134
+ return this.create({
16135
+ ...data,
16136
+ type: "warning",
16137
+ message
16138
+ });
16139
+ };
16140
+ this.loading = (message, data) => {
16141
+ return this.create({
16142
+ ...data,
16143
+ type: "loading",
16144
+ message
16145
+ });
16146
+ };
16147
+ this.promise = (promise, data) => {
16148
+ if (!data) {
16149
+ return;
16150
+ }
16151
+ let id = void 0;
16152
+ if (data.loading !== void 0) {
16153
+ id = this.create({
16154
+ ...data,
16155
+ promise,
16156
+ type: "loading",
16157
+ message: data.loading,
16158
+ description: typeof data.description !== "function" ? data.description : void 0
16159
+ });
16160
+ }
16161
+ const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
16162
+ let shouldDismiss = id !== void 0;
16163
+ let result;
16164
+ const originalPromise = p2.then(async (response) => {
16165
+ result = [
16166
+ "resolve",
16167
+ response
16168
+ ];
16169
+ const isReactElementResponse = ReactExports.isValidElement(response);
16170
+ if (isReactElementResponse) {
16171
+ shouldDismiss = false;
16172
+ this.create({
16173
+ id,
16174
+ type: "default",
16175
+ message: response
16176
+ });
16177
+ } else if (isHttpResponse(response) && !response.ok) {
16178
+ shouldDismiss = false;
16179
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
16180
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
16181
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
16182
+ const toastSettings = isExtendedResult ? promiseData : {
16183
+ message: promiseData
16184
+ };
16185
+ this.create({
16186
+ id,
16187
+ type: "error",
16188
+ description,
16189
+ ...toastSettings
16190
+ });
16191
+ } else if (response instanceof Error) {
16192
+ shouldDismiss = false;
16193
+ const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
16194
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
16195
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
16196
+ const toastSettings = isExtendedResult ? promiseData : {
16197
+ message: promiseData
16198
+ };
16199
+ this.create({
16200
+ id,
16201
+ type: "error",
16202
+ description,
16203
+ ...toastSettings
16204
+ });
16205
+ } else if (data.success !== void 0) {
16206
+ shouldDismiss = false;
16207
+ const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
16208
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
16209
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
16210
+ const toastSettings = isExtendedResult ? promiseData : {
16211
+ message: promiseData
16212
+ };
16213
+ this.create({
16214
+ id,
16215
+ type: "success",
16216
+ description,
16217
+ ...toastSettings
16218
+ });
16219
+ }
16220
+ }).catch(async (error) => {
16221
+ result = [
16222
+ "reject",
16223
+ error
16224
+ ];
16225
+ if (data.error !== void 0) {
16226
+ shouldDismiss = false;
16227
+ const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
16228
+ const description = typeof data.description === "function" ? await data.description(error) : data.description;
16229
+ const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
16230
+ const toastSettings = isExtendedResult ? promiseData : {
16231
+ message: promiseData
16232
+ };
16233
+ this.create({
16234
+ id,
16235
+ type: "error",
16236
+ description,
16237
+ ...toastSettings
16238
+ });
16239
+ }
16240
+ }).finally(() => {
16241
+ if (shouldDismiss) {
16242
+ this.dismiss(id);
16243
+ id = void 0;
16244
+ }
16245
+ data.finally == null ? void 0 : data.finally.call(data);
16246
+ });
16247
+ const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
16248
+ if (typeof id !== "string" && typeof id !== "number") {
16249
+ return {
16250
+ unwrap
16251
+ };
16252
+ } else {
16253
+ return Object.assign(id, {
16254
+ unwrap
16255
+ });
16256
+ }
16257
+ };
16258
+ this.custom = (jsx, data) => {
16259
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
16260
+ this.create({
16261
+ jsx: jsx(id),
16262
+ id,
16263
+ ...data
16264
+ });
16265
+ return id;
16266
+ };
16267
+ this.getActiveToasts = () => {
16268
+ return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
16269
+ };
16270
+ this.subscribers = [];
16271
+ this.toasts = [];
16272
+ this.dismissedToasts = /* @__PURE__ */ new Set();
15974
16273
  }
15975
- });
15976
- var themes_exports = {};
15977
- __export(themes_exports, {
15978
- chromeDark: () => theme,
15979
- chromeLight: () => theme2
15980
- });
15981
- var theme = {
15982
- BASE_FONT_FAMILY: "Menlo, monospace",
15983
- BASE_FONT_SIZE: "11px",
15984
- BASE_LINE_HEIGHT: 1.2,
15985
- BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
15986
- BASE_COLOR: "rgb(213, 213, 213)",
15987
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
15988
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
15989
- OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
15990
- OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
15991
- OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
15992
- OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
15993
- OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
15994
- OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
15995
- OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
15996
- OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
15997
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
15998
- HTML_TAG_COLOR: "rgb(93, 176, 215)",
15999
- HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
16000
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
16001
- HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
16002
- HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
16003
- HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
16004
- HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
16005
- ARROW_COLOR: "rgb(145, 145, 145)",
16006
- ARROW_MARGIN_RIGHT: 3,
16007
- ARROW_FONT_SIZE: 12,
16008
- ARROW_ANIMATION_DURATION: "0",
16009
- TREENODE_FONT_FAMILY: "Menlo, monospace",
16010
- TREENODE_FONT_SIZE: "11px",
16011
- TREENODE_LINE_HEIGHT: 1.2,
16012
- TREENODE_PADDING_LEFT: 12,
16013
- TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
16014
- TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
16015
- TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
16016
- TABLE_SORT_ICON_COLOR: "black",
16017
- //'rgb(48, 57, 66)',
16018
- TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
16019
- TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
16020
- };
16021
- var theme2 = {
16022
- BASE_FONT_FAMILY: "Menlo, monospace",
16023
- BASE_FONT_SIZE: "11px",
16024
- BASE_LINE_HEIGHT: 1.2,
16025
- BASE_BACKGROUND_COLOR: "white",
16026
- BASE_COLOR: "black",
16027
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
16028
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
16029
- OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
16030
- OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
16031
- OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
16032
- OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
16033
- OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
16034
- OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
16035
- OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
16036
- OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
16037
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
16038
- HTML_TAG_COLOR: "rgb(168, 148, 166)",
16039
- HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
16040
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
16041
- HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
16042
- HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
16043
- HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
16044
- HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
16045
- ARROW_COLOR: "#6e6e6e",
16046
- ARROW_MARGIN_RIGHT: 3,
16047
- ARROW_FONT_SIZE: 12,
16048
- ARROW_ANIMATION_DURATION: "0",
16049
- TREENODE_FONT_FAMILY: "Menlo, monospace",
16050
- TREENODE_FONT_SIZE: "11px",
16051
- TREENODE_LINE_HEIGHT: 1.2,
16052
- TREENODE_PADDING_LEFT: 12,
16053
- TABLE_BORDER_COLOR: "#aaa",
16054
- TABLE_TH_BACKGROUND_COLOR: "#eee",
16055
- TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
16056
- TABLE_SORT_ICON_COLOR: "#6e6e6e",
16057
- TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
16058
- TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
16274
+ }
16275
+ const ToastState = new Observer();
16276
+ const toastFunction = (message, data) => {
16277
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
16278
+ ToastState.addToast({
16279
+ title: message,
16280
+ ...data,
16281
+ id
16282
+ });
16283
+ return id;
16059
16284
  };
16060
- var ExpandedPathsContext = reactExports.createContext([{}, () => {
16061
- }]);
16062
- var unselectable = {
16063
- WebkitTouchCallout: "none",
16064
- WebkitUserSelect: "none",
16065
- KhtmlUserSelect: "none",
16066
- MozUserSelect: "none",
16067
- msUserSelect: "none",
16068
- OUserSelect: "none",
16069
- userSelect: "none"
16285
+ const isHttpResponse = (data) => {
16286
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
16070
16287
  };
16071
- var createTheme = (theme3) => ({
16072
- DOMNodePreview: {
16073
- htmlOpenTag: {
16074
- base: {
16075
- color: theme3.HTML_TAG_COLOR
16076
- },
16077
- tagName: {
16078
- color: theme3.HTML_TAGNAME_COLOR,
16079
- textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
16080
- },
16081
- htmlAttributeName: {
16082
- color: theme3.HTML_ATTRIBUTE_NAME_COLOR
16083
- },
16084
- htmlAttributeValue: {
16085
- color: theme3.HTML_ATTRIBUTE_VALUE_COLOR
16288
+ const basicToast = toastFunction;
16289
+ const getHistory = () => ToastState.toasts;
16290
+ const getToasts = () => ToastState.getActiveToasts();
16291
+ const toast = Object.assign(basicToast, {
16292
+ success: ToastState.success,
16293
+ info: ToastState.info,
16294
+ warning: ToastState.warning,
16295
+ error: ToastState.error,
16296
+ custom: ToastState.custom,
16297
+ message: ToastState.message,
16298
+ promise: ToastState.promise,
16299
+ dismiss: ToastState.dismiss,
16300
+ loading: ToastState.loading
16301
+ }, {
16302
+ getHistory,
16303
+ getToasts
16304
+ });
16305
+ __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
16306
+ function isAction(action) {
16307
+ return action.label !== void 0;
16308
+ }
16309
+ const VISIBLE_TOASTS_AMOUNT = 3;
16310
+ const VIEWPORT_OFFSET = "24px";
16311
+ const MOBILE_VIEWPORT_OFFSET = "16px";
16312
+ const TOAST_LIFETIME = 4e3;
16313
+ const TOAST_WIDTH = 356;
16314
+ const GAP = 14;
16315
+ const SWIPE_THRESHOLD = 45;
16316
+ const TIME_BEFORE_UNMOUNT = 200;
16317
+ function cn$3(...classes) {
16318
+ return classes.filter(Boolean).join(" ");
16319
+ }
16320
+ function getDefaultSwipeDirections(position2) {
16321
+ const [y2, x2] = position2.split("-");
16322
+ const directions = [];
16323
+ if (y2) {
16324
+ directions.push(y2);
16325
+ }
16326
+ if (x2) {
16327
+ directions.push(x2);
16328
+ }
16329
+ return directions;
16330
+ }
16331
+ const Toast = (props) => {
16332
+ var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
16333
+ const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
16334
+ const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
16335
+ const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
16336
+ const [mounted, setMounted] = ReactExports.useState(false);
16337
+ const [removed, setRemoved] = ReactExports.useState(false);
16338
+ const [swiping, setSwiping] = ReactExports.useState(false);
16339
+ const [swipeOut, setSwipeOut] = ReactExports.useState(false);
16340
+ const [isSwiped, setIsSwiped] = ReactExports.useState(false);
16341
+ const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
16342
+ const [initialHeight, setInitialHeight] = ReactExports.useState(0);
16343
+ const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
16344
+ const dragStartTime = ReactExports.useRef(null);
16345
+ const toastRef = ReactExports.useRef(null);
16346
+ const isFront = index2 === 0;
16347
+ const isVisible = index2 + 1 <= visibleToasts;
16348
+ const toastType = toast2.type;
16349
+ const dismissible = toast2.dismissible !== false;
16350
+ const toastClassname = toast2.className || "";
16351
+ const toastDescriptionClassname = toast2.descriptionClassName || "";
16352
+ const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
16353
+ heights,
16354
+ toast2.id
16355
+ ]);
16356
+ const closeButton = ReactExports.useMemo(() => {
16357
+ var _toast_closeButton;
16358
+ return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
16359
+ }, [
16360
+ toast2.closeButton,
16361
+ closeButtonFromToaster
16362
+ ]);
16363
+ const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
16364
+ toast2.duration,
16365
+ durationFromToaster
16366
+ ]);
16367
+ const closeTimerStartTimeRef = ReactExports.useRef(0);
16368
+ const offset2 = ReactExports.useRef(0);
16369
+ const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
16370
+ const pointerStartRef = ReactExports.useRef(null);
16371
+ const [y2, x2] = position2.split("-");
16372
+ const toastsHeightBefore = ReactExports.useMemo(() => {
16373
+ return heights.reduce((prev, curr, reducerIndex) => {
16374
+ if (reducerIndex >= heightIndex) {
16375
+ return prev;
16086
16376
  }
16087
- },
16088
- htmlCloseTag: {
16089
- base: {
16090
- color: theme3.HTML_TAG_COLOR
16091
- },
16092
- offsetLeft: {
16093
- /* hack: offset placeholder */
16094
- marginLeft: -theme3.TREENODE_PADDING_LEFT
16095
- },
16096
- tagName: {
16097
- color: theme3.HTML_TAGNAME_COLOR,
16098
- textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
16377
+ return prev + curr.height;
16378
+ }, 0);
16379
+ }, [
16380
+ heights,
16381
+ heightIndex
16382
+ ]);
16383
+ const isDocumentHidden = useIsDocumentHidden();
16384
+ const invert = toast2.invert || ToasterInvert;
16385
+ const disabled = toastType === "loading";
16386
+ offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
16387
+ heightIndex,
16388
+ toastsHeightBefore
16389
+ ]);
16390
+ ReactExports.useEffect(() => {
16391
+ remainingTime.current = duration2;
16392
+ }, [
16393
+ duration2
16394
+ ]);
16395
+ ReactExports.useEffect(() => {
16396
+ setMounted(true);
16397
+ }, []);
16398
+ ReactExports.useEffect(() => {
16399
+ const toastNode = toastRef.current;
16400
+ if (toastNode) {
16401
+ const height = toastNode.getBoundingClientRect().height;
16402
+ setInitialHeight(height);
16403
+ setHeights((h2) => [
16404
+ {
16405
+ toastId: toast2.id,
16406
+ height,
16407
+ position: toast2.position
16408
+ },
16409
+ ...h2
16410
+ ]);
16411
+ return () => setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
16412
+ }
16413
+ }, [
16414
+ setHeights,
16415
+ toast2.id
16416
+ ]);
16417
+ ReactExports.useLayoutEffect(() => {
16418
+ if (!mounted) return;
16419
+ const toastNode = toastRef.current;
16420
+ const originalHeight = toastNode.style.height;
16421
+ toastNode.style.height = "auto";
16422
+ const newHeight = toastNode.getBoundingClientRect().height;
16423
+ toastNode.style.height = originalHeight;
16424
+ setInitialHeight(newHeight);
16425
+ setHeights((heights2) => {
16426
+ const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
16427
+ if (!alreadyExists) {
16428
+ return [
16429
+ {
16430
+ toastId: toast2.id,
16431
+ height: newHeight,
16432
+ position: toast2.position
16433
+ },
16434
+ ...heights2
16435
+ ];
16436
+ } else {
16437
+ return heights2.map((height) => height.toastId === toast2.id ? {
16438
+ ...height,
16439
+ height: newHeight
16440
+ } : height);
16099
16441
  }
16100
- },
16101
- htmlComment: {
16102
- color: theme3.HTML_COMMENT_COLOR
16103
- },
16104
- htmlDoctype: {
16105
- color: theme3.HTML_DOCTYPE_COLOR
16442
+ });
16443
+ }, [
16444
+ mounted,
16445
+ toast2.title,
16446
+ toast2.description,
16447
+ setHeights,
16448
+ toast2.id,
16449
+ toast2.jsx,
16450
+ toast2.action,
16451
+ toast2.cancel
16452
+ ]);
16453
+ const deleteToast = ReactExports.useCallback(() => {
16454
+ setRemoved(true);
16455
+ setOffsetBeforeRemove(offset2.current);
16456
+ setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
16457
+ setTimeout(() => {
16458
+ removeToast(toast2);
16459
+ }, TIME_BEFORE_UNMOUNT);
16460
+ }, [
16461
+ toast2,
16462
+ removeToast,
16463
+ setHeights,
16464
+ offset2
16465
+ ]);
16466
+ ReactExports.useEffect(() => {
16467
+ if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
16468
+ let timeoutId;
16469
+ const pauseTimer = () => {
16470
+ if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
16471
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
16472
+ remainingTime.current = remainingTime.current - elapsedTime;
16473
+ }
16474
+ lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
16475
+ };
16476
+ const startTimer = () => {
16477
+ if (remainingTime.current === Infinity) return;
16478
+ closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
16479
+ timeoutId = setTimeout(() => {
16480
+ toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
16481
+ deleteToast();
16482
+ }, remainingTime.current);
16483
+ };
16484
+ if (expanded2 || interacting || isDocumentHidden) {
16485
+ pauseTimer();
16486
+ } else {
16487
+ startTimer();
16106
16488
  }
16107
- },
16108
- ObjectPreview: {
16109
- objectDescription: {
16110
- fontStyle: "italic"
16111
- },
16112
- preview: {
16113
- fontStyle: "italic"
16114
- },
16115
- arrayMaxProperties: theme3.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
16116
- objectMaxProperties: theme3.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
16117
- },
16118
- ObjectName: {
16119
- base: {
16120
- color: theme3.OBJECT_NAME_COLOR
16121
- },
16122
- dimmed: {
16123
- opacity: 0.6
16489
+ return () => clearTimeout(timeoutId);
16490
+ }, [
16491
+ expanded2,
16492
+ interacting,
16493
+ toast2,
16494
+ toastType,
16495
+ isDocumentHidden,
16496
+ deleteToast
16497
+ ]);
16498
+ ReactExports.useEffect(() => {
16499
+ if (toast2.delete) {
16500
+ deleteToast();
16501
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
16124
16502
  }
16125
- },
16126
- ObjectValue: {
16127
- objectValueNull: {
16128
- color: theme3.OBJECT_VALUE_NULL_COLOR
16129
- },
16130
- objectValueUndefined: {
16131
- color: theme3.OBJECT_VALUE_UNDEFINED_COLOR
16503
+ }, [
16504
+ deleteToast,
16505
+ toast2.delete
16506
+ ]);
16507
+ function getLoadingIcon() {
16508
+ var _toast_classNames9;
16509
+ if (icons == null ? void 0 : icons.loading) {
16510
+ var _toast_classNames12;
16511
+ return /* @__PURE__ */ ReactExports.createElement("div", {
16512
+ className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
16513
+ "data-visible": toastType === "loading"
16514
+ }, icons.loading);
16515
+ }
16516
+ return /* @__PURE__ */ ReactExports.createElement(Loader, {
16517
+ className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
16518
+ visible: toastType === "loading"
16519
+ });
16520
+ }
16521
+ const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
16522
+ var _toast_richColors, _icons_close;
16523
+ return /* @__PURE__ */ ReactExports.createElement("li", {
16524
+ tabIndex: 0,
16525
+ ref: toastRef,
16526
+ className: cn$3(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
16527
+ "data-sonner-toast": "",
16528
+ "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
16529
+ "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
16530
+ "data-mounted": mounted,
16531
+ "data-promise": Boolean(toast2.promise),
16532
+ "data-swiped": isSwiped,
16533
+ "data-removed": removed,
16534
+ "data-visible": isVisible,
16535
+ "data-y-position": y2,
16536
+ "data-x-position": x2,
16537
+ "data-index": index2,
16538
+ "data-front": isFront,
16539
+ "data-swiping": swiping,
16540
+ "data-dismissible": dismissible,
16541
+ "data-type": toastType,
16542
+ "data-invert": invert,
16543
+ "data-swipe-out": swipeOut,
16544
+ "data-swipe-direction": swipeOutDirection,
16545
+ "data-expanded": Boolean(expanded2 || expandByDefault && mounted),
16546
+ "data-testid": toast2.testId,
16547
+ style: {
16548
+ "--index": index2,
16549
+ "--toasts-before": index2,
16550
+ "--z-index": toasts.length - index2,
16551
+ "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
16552
+ "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
16553
+ ...style2,
16554
+ ...toast2.style
16132
16555
  },
16133
- objectValueRegExp: {
16134
- color: theme3.OBJECT_VALUE_REGEXP_COLOR
16556
+ onDragEnd: () => {
16557
+ setSwiping(false);
16558
+ setSwipeDirection(null);
16559
+ pointerStartRef.current = null;
16135
16560
  },
16136
- objectValueString: {
16137
- color: theme3.OBJECT_VALUE_STRING_COLOR
16561
+ onPointerDown: (event) => {
16562
+ if (event.button === 2) return;
16563
+ if (disabled || !dismissible) return;
16564
+ dragStartTime.current = /* @__PURE__ */ new Date();
16565
+ setOffsetBeforeRemove(offset2.current);
16566
+ event.target.setPointerCapture(event.pointerId);
16567
+ if (event.target.tagName === "BUTTON") return;
16568
+ setSwiping(true);
16569
+ pointerStartRef.current = {
16570
+ x: event.clientX,
16571
+ y: event.clientY
16572
+ };
16138
16573
  },
16139
- objectValueSymbol: {
16140
- color: theme3.OBJECT_VALUE_SYMBOL_COLOR
16574
+ onPointerUp: () => {
16575
+ var _toastRef_current, _toastRef_current1, _dragStartTime_current;
16576
+ if (swipeOut || !dismissible) return;
16577
+ pointerStartRef.current = null;
16578
+ const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
16579
+ const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
16580
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
16581
+ const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
16582
+ const velocity = Math.abs(swipeAmount) / timeTaken;
16583
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
16584
+ setOffsetBeforeRemove(offset2.current);
16585
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
16586
+ if (swipeDirection === "x") {
16587
+ setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
16588
+ } else {
16589
+ setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
16590
+ }
16591
+ deleteToast();
16592
+ setSwipeOut(true);
16593
+ return;
16594
+ } else {
16595
+ var _toastRef_current2, _toastRef_current3;
16596
+ (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
16597
+ (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
16598
+ }
16599
+ setIsSwiped(false);
16600
+ setSwiping(false);
16601
+ setSwipeDirection(null);
16141
16602
  },
16142
- objectValueNumber: {
16143
- color: theme3.OBJECT_VALUE_NUMBER_COLOR
16603
+ onPointerMove: (event) => {
16604
+ var _window_getSelection, _toastRef_current, _toastRef_current1;
16605
+ if (!pointerStartRef.current || !dismissible) return;
16606
+ const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
16607
+ if (isHighlighted) return;
16608
+ const yDelta = event.clientY - pointerStartRef.current.y;
16609
+ const xDelta = event.clientX - pointerStartRef.current.x;
16610
+ var _props_swipeDirections;
16611
+ const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
16612
+ if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
16613
+ setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
16614
+ }
16615
+ let swipeAmount = {
16616
+ x: 0,
16617
+ y: 0
16618
+ };
16619
+ const getDampening = (delta) => {
16620
+ const factor = Math.abs(delta) / 20;
16621
+ return 1 / (1.5 + factor);
16622
+ };
16623
+ if (swipeDirection === "y") {
16624
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
16625
+ if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
16626
+ swipeAmount.y = yDelta;
16627
+ } else {
16628
+ const dampenedDelta = yDelta * getDampening(yDelta);
16629
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
16630
+ }
16631
+ }
16632
+ } else if (swipeDirection === "x") {
16633
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
16634
+ if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
16635
+ swipeAmount.x = xDelta;
16636
+ } else {
16637
+ const dampenedDelta = xDelta * getDampening(xDelta);
16638
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
16639
+ }
16640
+ }
16641
+ }
16642
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
16643
+ setIsSwiped(true);
16644
+ }
16645
+ (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
16646
+ (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
16647
+ }
16648
+ }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ ReactExports.createElement("button", {
16649
+ "aria-label": closeButtonAriaLabel,
16650
+ "data-disabled": disabled,
16651
+ "data-close-button": true,
16652
+ onClick: disabled || !dismissible ? () => {
16653
+ } : () => {
16654
+ deleteToast();
16655
+ toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
16144
16656
  },
16145
- objectValueBoolean: {
16146
- color: theme3.OBJECT_VALUE_BOOLEAN_COLOR
16657
+ className: cn$3(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
16658
+ }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ ReactExports.createElement("div", {
16659
+ "data-icon": "",
16660
+ className: cn$3(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
16661
+ }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ ReactExports.createElement("div", {
16662
+ "data-content": "",
16663
+ className: cn$3(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
16664
+ }, /* @__PURE__ */ ReactExports.createElement("div", {
16665
+ "data-title": "",
16666
+ className: cn$3(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
16667
+ }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ ReactExports.createElement("div", {
16668
+ "data-description": "",
16669
+ className: cn$3(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
16670
+ }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ ReactExports.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ ReactExports.createElement("button", {
16671
+ "data-button": true,
16672
+ "data-cancel": true,
16673
+ style: toast2.cancelButtonStyle || cancelButtonStyle,
16674
+ onClick: (event) => {
16675
+ if (!isAction(toast2.cancel)) return;
16676
+ if (!dismissible) return;
16677
+ toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
16678
+ deleteToast();
16147
16679
  },
16148
- objectValueFunctionPrefix: {
16149
- color: theme3.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
16150
- fontStyle: "italic"
16680
+ className: cn$3(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
16681
+ }, toast2.cancel.label) : null, /* @__PURE__ */ ReactExports.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ ReactExports.createElement("button", {
16682
+ "data-button": true,
16683
+ "data-action": true,
16684
+ style: toast2.actionButtonStyle || actionButtonStyle,
16685
+ onClick: (event) => {
16686
+ if (!isAction(toast2.action)) return;
16687
+ toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
16688
+ if (event.defaultPrevented) return;
16689
+ deleteToast();
16151
16690
  },
16152
- objectValueFunctionName: {
16153
- fontStyle: "italic"
16691
+ className: cn$3(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
16692
+ }, toast2.action.label) : null);
16693
+ };
16694
+ function getDocumentDirection() {
16695
+ if (typeof window === "undefined") return "ltr";
16696
+ if (typeof document === "undefined") return "ltr";
16697
+ const dirAttribute = document.documentElement.getAttribute("dir");
16698
+ if (dirAttribute === "auto" || !dirAttribute) {
16699
+ return window.getComputedStyle(document.documentElement).direction;
16700
+ }
16701
+ return dirAttribute;
16702
+ }
16703
+ function assignOffset(defaultOffset, mobileOffset) {
16704
+ const styles2 = {};
16705
+ [
16706
+ defaultOffset,
16707
+ mobileOffset
16708
+ ].forEach((offset2, index2) => {
16709
+ const isMobile = index2 === 1;
16710
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
16711
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
16712
+ function assignAll(offset3) {
16713
+ [
16714
+ "top",
16715
+ "right",
16716
+ "bottom",
16717
+ "left"
16718
+ ].forEach((key) => {
16719
+ styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
16720
+ });
16154
16721
  }
16155
- },
16156
- TreeView: {
16157
- treeViewOutline: {
16158
- padding: 0,
16159
- margin: 0,
16160
- listStyleType: "none"
16722
+ if (typeof offset2 === "number" || typeof offset2 === "string") {
16723
+ assignAll(offset2);
16724
+ } else if (typeof offset2 === "object") {
16725
+ [
16726
+ "top",
16727
+ "right",
16728
+ "bottom",
16729
+ "left"
16730
+ ].forEach((key) => {
16731
+ if (offset2[key] === void 0) {
16732
+ styles2[`${prefix}-${key}`] = defaultValue;
16733
+ } else {
16734
+ styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
16735
+ }
16736
+ });
16737
+ } else {
16738
+ assignAll(defaultValue);
16739
+ }
16740
+ });
16741
+ return styles2;
16742
+ }
16743
+ const Toaster = /* @__PURE__ */ ReactExports.forwardRef(function Toaster2(props, ref) {
16744
+ const { id, invert, position: position2 = "bottom-right", hotkey = [
16745
+ "altKey",
16746
+ "KeyT"
16747
+ ], expand, closeButton, className, offset: offset2, mobileOffset, theme: theme3 = "light", richColors, duration: duration2, style: style2, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
16748
+ const [toasts, setToasts] = ReactExports.useState([]);
16749
+ const filteredToasts = ReactExports.useMemo(() => {
16750
+ if (id) {
16751
+ return toasts.filter((toast2) => toast2.toasterId === id);
16752
+ }
16753
+ return toasts.filter((toast2) => !toast2.toasterId);
16754
+ }, [
16755
+ toasts,
16756
+ id
16757
+ ]);
16758
+ const possiblePositions = ReactExports.useMemo(() => {
16759
+ return Array.from(new Set([
16760
+ position2
16761
+ ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
16762
+ }, [
16763
+ filteredToasts,
16764
+ position2
16765
+ ]);
16766
+ const [heights, setHeights] = ReactExports.useState([]);
16767
+ const [expanded2, setExpanded] = ReactExports.useState(false);
16768
+ const [interacting, setInteracting] = ReactExports.useState(false);
16769
+ const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
16770
+ const listRef = ReactExports.useRef(null);
16771
+ const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
16772
+ const lastFocusedElementRef = ReactExports.useRef(null);
16773
+ const isFocusWithinRef = ReactExports.useRef(false);
16774
+ const removeToast = ReactExports.useCallback((toastToRemove) => {
16775
+ setToasts((toasts2) => {
16776
+ var _toasts_find;
16777
+ if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
16778
+ ToastState.dismiss(toastToRemove.id);
16779
+ }
16780
+ return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
16781
+ });
16782
+ }, []);
16783
+ ReactExports.useEffect(() => {
16784
+ return ToastState.subscribe((toast2) => {
16785
+ if (toast2.dismiss) {
16786
+ requestAnimationFrame(() => {
16787
+ setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
16788
+ ...t,
16789
+ delete: true
16790
+ } : t));
16791
+ });
16792
+ return;
16793
+ }
16794
+ setTimeout(() => {
16795
+ ReactDOM.flushSync(() => {
16796
+ setToasts((toasts2) => {
16797
+ const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
16798
+ if (indexOfExistingToast !== -1) {
16799
+ return [
16800
+ ...toasts2.slice(0, indexOfExistingToast),
16801
+ {
16802
+ ...toasts2[indexOfExistingToast],
16803
+ ...toast2
16804
+ },
16805
+ ...toasts2.slice(indexOfExistingToast + 1)
16806
+ ];
16807
+ }
16808
+ return [
16809
+ toast2,
16810
+ ...toasts2
16811
+ ];
16812
+ });
16813
+ });
16814
+ });
16815
+ });
16816
+ }, [
16817
+ toasts
16818
+ ]);
16819
+ ReactExports.useEffect(() => {
16820
+ if (theme3 !== "system") {
16821
+ setActualTheme(theme3);
16822
+ return;
16823
+ }
16824
+ if (theme3 === "system") {
16825
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
16826
+ setActualTheme("dark");
16827
+ } else {
16828
+ setActualTheme("light");
16829
+ }
16830
+ }
16831
+ if (typeof window === "undefined") return;
16832
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
16833
+ try {
16834
+ darkMediaQuery.addEventListener("change", ({ matches }) => {
16835
+ if (matches) {
16836
+ setActualTheme("dark");
16837
+ } else {
16838
+ setActualTheme("light");
16839
+ }
16840
+ });
16841
+ } catch (error) {
16842
+ darkMediaQuery.addListener(({ matches }) => {
16843
+ try {
16844
+ if (matches) {
16845
+ setActualTheme("dark");
16846
+ } else {
16847
+ setActualTheme("light");
16848
+ }
16849
+ } catch (e) {
16850
+ console.error(e);
16851
+ }
16852
+ });
16853
+ }
16854
+ }, [
16855
+ theme3
16856
+ ]);
16857
+ ReactExports.useEffect(() => {
16858
+ if (toasts.length <= 1) {
16859
+ setExpanded(false);
16860
+ }
16861
+ }, [
16862
+ toasts
16863
+ ]);
16864
+ ReactExports.useEffect(() => {
16865
+ const handleKeyDown = (event) => {
16866
+ var _listRef_current;
16867
+ const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
16868
+ if (isHotkeyPressed) {
16869
+ var _listRef_current1;
16870
+ setExpanded(true);
16871
+ (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
16872
+ }
16873
+ if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
16874
+ setExpanded(false);
16875
+ }
16876
+ };
16877
+ document.addEventListener("keydown", handleKeyDown);
16878
+ return () => document.removeEventListener("keydown", handleKeyDown);
16879
+ }, [
16880
+ hotkey
16881
+ ]);
16882
+ ReactExports.useEffect(() => {
16883
+ if (listRef.current) {
16884
+ return () => {
16885
+ if (lastFocusedElementRef.current) {
16886
+ lastFocusedElementRef.current.focus({
16887
+ preventScroll: true
16888
+ });
16889
+ lastFocusedElementRef.current = null;
16890
+ isFocusWithinRef.current = false;
16891
+ }
16892
+ };
16893
+ }
16894
+ }, [
16895
+ listRef.current
16896
+ ]);
16897
+ return (
16898
+ // Remove item from normal navigation flow, only available via hotkey
16899
+ /* @__PURE__ */ ReactExports.createElement("section", {
16900
+ ref,
16901
+ "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
16902
+ tabIndex: -1,
16903
+ "aria-live": "polite",
16904
+ "aria-relevant": "additions text",
16905
+ "aria-atomic": "false",
16906
+ suppressHydrationWarning: true
16907
+ }, possiblePositions.map((position3, index2) => {
16908
+ var _heights_;
16909
+ const [y2, x2] = position3.split("-");
16910
+ if (!filteredToasts.length) return null;
16911
+ return /* @__PURE__ */ ReactExports.createElement("ol", {
16912
+ key: position3,
16913
+ dir: dir === "auto" ? getDocumentDirection() : dir,
16914
+ tabIndex: -1,
16915
+ ref: listRef,
16916
+ className,
16917
+ "data-sonner-toaster": true,
16918
+ "data-sonner-theme": actualTheme,
16919
+ "data-y-position": y2,
16920
+ "data-x-position": x2,
16921
+ style: {
16922
+ "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
16923
+ "--width": `${TOAST_WIDTH}px`,
16924
+ "--gap": `${gap}px`,
16925
+ ...style2,
16926
+ ...assignOffset(offset2, mobileOffset)
16927
+ },
16928
+ onBlur: (event) => {
16929
+ if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
16930
+ isFocusWithinRef.current = false;
16931
+ if (lastFocusedElementRef.current) {
16932
+ lastFocusedElementRef.current.focus({
16933
+ preventScroll: true
16934
+ });
16935
+ lastFocusedElementRef.current = null;
16936
+ }
16937
+ }
16938
+ },
16939
+ onFocus: (event) => {
16940
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
16941
+ if (isNotDismissible) return;
16942
+ if (!isFocusWithinRef.current) {
16943
+ isFocusWithinRef.current = true;
16944
+ lastFocusedElementRef.current = event.relatedTarget;
16945
+ }
16946
+ },
16947
+ onMouseEnter: () => setExpanded(true),
16948
+ onMouseMove: () => setExpanded(true),
16949
+ onMouseLeave: () => {
16950
+ if (!interacting) {
16951
+ setExpanded(false);
16952
+ }
16953
+ },
16954
+ onDragEnd: () => setExpanded(false),
16955
+ onPointerDown: (event) => {
16956
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
16957
+ if (isNotDismissible) return;
16958
+ setInteracting(true);
16959
+ },
16960
+ onPointerUp: () => setInteracting(false)
16961
+ }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
16962
+ var _toastOptions_duration, _toastOptions_closeButton;
16963
+ return /* @__PURE__ */ ReactExports.createElement(Toast, {
16964
+ key: toast2.id,
16965
+ icons,
16966
+ index: index3,
16967
+ toast: toast2,
16968
+ defaultRichColors: richColors,
16969
+ duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
16970
+ className: toastOptions == null ? void 0 : toastOptions.className,
16971
+ descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
16972
+ invert,
16973
+ visibleToasts,
16974
+ closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
16975
+ interacting,
16976
+ position: position3,
16977
+ style: toastOptions == null ? void 0 : toastOptions.style,
16978
+ unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
16979
+ classNames: toastOptions == null ? void 0 : toastOptions.classNames,
16980
+ cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
16981
+ actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
16982
+ closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
16983
+ removeToast,
16984
+ toasts: filteredToasts.filter((t) => t.position == toast2.position),
16985
+ heights: heights.filter((h2) => h2.position == toast2.position),
16986
+ setHeights,
16987
+ expandByDefault: expand,
16988
+ gap,
16989
+ expanded: expanded2,
16990
+ swipeDirections: props.swipeDirections
16991
+ });
16992
+ }));
16993
+ }))
16994
+ );
16995
+ });
16996
+ const defaultAdapter = {
16997
+ success: (msg, opts) => toast.success(msg, opts),
16998
+ error: (msg, opts) => toast.error(msg, opts),
16999
+ info: (msg, opts) => toast.info(msg, opts)
17000
+ };
17001
+ const ToastContext = reactExports.createContext(defaultAdapter);
17002
+ function useToast() {
17003
+ return reactExports.useContext(ToastContext);
17004
+ }
17005
+ var __create = Object.create;
17006
+ var __defProp2 = Object.defineProperty;
17007
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17008
+ var __getOwnPropNames = Object.getOwnPropertyNames;
17009
+ var __getProtoOf = Object.getPrototypeOf;
17010
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17011
+ var __commonJS = (cb, mod) => function __require() {
17012
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17013
+ };
17014
+ var __export = (target2, all2) => {
17015
+ for (var name2 in all2)
17016
+ __defProp2(target2, name2, { get: all2[name2], enumerable: true });
17017
+ };
17018
+ var __copyProps = (to2, from, except, desc) => {
17019
+ if (from && typeof from === "object" || typeof from === "function") {
17020
+ for (let key of __getOwnPropNames(from))
17021
+ if (!__hasOwnProp.call(to2, key) && key !== except)
17022
+ __defProp2(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17023
+ }
17024
+ return to2;
17025
+ };
17026
+ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17027
+ // If the importer is in node compatibility mode or this is not an ESM
17028
+ // file that has been converted to a CommonJS file using a Babel-
17029
+ // compatible transform (i.e. "__esModule" has not been set), then set
17030
+ // "default" to the CommonJS "module.exports" for node compatibility.
17031
+ __defProp2(target2, "default", { value: mod, enumerable: true }),
17032
+ mod
17033
+ ));
17034
+ var require_is_object = __commonJS({
17035
+ "node_modules/is-object/index.js"(exports$1, module) {
17036
+ module.exports = function isObject2(x2) {
17037
+ return typeof x2 === "object" && x2 !== null;
17038
+ };
17039
+ }
17040
+ });
17041
+ var require_is_window = __commonJS({
17042
+ "node_modules/is-window/index.js"(exports$1, module) {
17043
+ module.exports = function(obj) {
17044
+ if (obj == null) {
17045
+ return false;
17046
+ }
17047
+ var o = Object(obj);
17048
+ return o === o.window;
17049
+ };
17050
+ }
17051
+ });
17052
+ var require_is_dom = __commonJS({
17053
+ "node_modules/is-dom/index.js"(exports$1, module) {
17054
+ var isObject2 = require_is_object();
17055
+ var isWindow = require_is_window();
17056
+ function isNode2(val) {
17057
+ if (!isObject2(val) || !isWindow(window) || typeof window.Node !== "function") {
17058
+ return false;
17059
+ }
17060
+ return typeof val.nodeType === "number" && typeof val.nodeName === "string";
17061
+ }
17062
+ module.exports = isNode2;
17063
+ }
17064
+ });
17065
+ var themes_exports = {};
17066
+ __export(themes_exports, {
17067
+ chromeDark: () => theme,
17068
+ chromeLight: () => theme2
17069
+ });
17070
+ var theme = {
17071
+ BASE_FONT_FAMILY: "Menlo, monospace",
17072
+ BASE_FONT_SIZE: "11px",
17073
+ BASE_LINE_HEIGHT: 1.2,
17074
+ BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
17075
+ BASE_COLOR: "rgb(213, 213, 213)",
17076
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
17077
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
17078
+ OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
17079
+ OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
17080
+ OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
17081
+ OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
17082
+ OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
17083
+ OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
17084
+ OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
17085
+ OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
17086
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
17087
+ HTML_TAG_COLOR: "rgb(93, 176, 215)",
17088
+ HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
17089
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
17090
+ HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
17091
+ HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
17092
+ HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
17093
+ HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
17094
+ ARROW_COLOR: "rgb(145, 145, 145)",
17095
+ ARROW_MARGIN_RIGHT: 3,
17096
+ ARROW_FONT_SIZE: 12,
17097
+ ARROW_ANIMATION_DURATION: "0",
17098
+ TREENODE_FONT_FAMILY: "Menlo, monospace",
17099
+ TREENODE_FONT_SIZE: "11px",
17100
+ TREENODE_LINE_HEIGHT: 1.2,
17101
+ TREENODE_PADDING_LEFT: 12,
17102
+ TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
17103
+ TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
17104
+ TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
17105
+ TABLE_SORT_ICON_COLOR: "black",
17106
+ //'rgb(48, 57, 66)',
17107
+ TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
17108
+ TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
17109
+ };
17110
+ var theme2 = {
17111
+ BASE_FONT_FAMILY: "Menlo, monospace",
17112
+ BASE_FONT_SIZE: "11px",
17113
+ BASE_LINE_HEIGHT: 1.2,
17114
+ BASE_BACKGROUND_COLOR: "white",
17115
+ BASE_COLOR: "black",
17116
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
17117
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
17118
+ OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
17119
+ OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
17120
+ OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
17121
+ OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
17122
+ OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
17123
+ OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
17124
+ OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
17125
+ OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
17126
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
17127
+ HTML_TAG_COLOR: "rgb(168, 148, 166)",
17128
+ HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
17129
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
17130
+ HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
17131
+ HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
17132
+ HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
17133
+ HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
17134
+ ARROW_COLOR: "#6e6e6e",
17135
+ ARROW_MARGIN_RIGHT: 3,
17136
+ ARROW_FONT_SIZE: 12,
17137
+ ARROW_ANIMATION_DURATION: "0",
17138
+ TREENODE_FONT_FAMILY: "Menlo, monospace",
17139
+ TREENODE_FONT_SIZE: "11px",
17140
+ TREENODE_LINE_HEIGHT: 1.2,
17141
+ TREENODE_PADDING_LEFT: 12,
17142
+ TABLE_BORDER_COLOR: "#aaa",
17143
+ TABLE_TH_BACKGROUND_COLOR: "#eee",
17144
+ TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
17145
+ TABLE_SORT_ICON_COLOR: "#6e6e6e",
17146
+ TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
17147
+ TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
17148
+ };
17149
+ var ExpandedPathsContext = reactExports.createContext([{}, () => {
17150
+ }]);
17151
+ var unselectable = {
17152
+ WebkitTouchCallout: "none",
17153
+ WebkitUserSelect: "none",
17154
+ KhtmlUserSelect: "none",
17155
+ MozUserSelect: "none",
17156
+ msUserSelect: "none",
17157
+ OUserSelect: "none",
17158
+ userSelect: "none"
17159
+ };
17160
+ var createTheme = (theme3) => ({
17161
+ DOMNodePreview: {
17162
+ htmlOpenTag: {
17163
+ base: {
17164
+ color: theme3.HTML_TAG_COLOR
17165
+ },
17166
+ tagName: {
17167
+ color: theme3.HTML_TAGNAME_COLOR,
17168
+ textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
17169
+ },
17170
+ htmlAttributeName: {
17171
+ color: theme3.HTML_ATTRIBUTE_NAME_COLOR
17172
+ },
17173
+ htmlAttributeValue: {
17174
+ color: theme3.HTML_ATTRIBUTE_VALUE_COLOR
17175
+ }
17176
+ },
17177
+ htmlCloseTag: {
17178
+ base: {
17179
+ color: theme3.HTML_TAG_COLOR
17180
+ },
17181
+ offsetLeft: {
17182
+ /* hack: offset placeholder */
17183
+ marginLeft: -theme3.TREENODE_PADDING_LEFT
17184
+ },
17185
+ tagName: {
17186
+ color: theme3.HTML_TAGNAME_COLOR,
17187
+ textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
17188
+ }
17189
+ },
17190
+ htmlComment: {
17191
+ color: theme3.HTML_COMMENT_COLOR
17192
+ },
17193
+ htmlDoctype: {
17194
+ color: theme3.HTML_DOCTYPE_COLOR
17195
+ }
17196
+ },
17197
+ ObjectPreview: {
17198
+ objectDescription: {
17199
+ fontStyle: "italic"
17200
+ },
17201
+ preview: {
17202
+ fontStyle: "italic"
17203
+ },
17204
+ arrayMaxProperties: theme3.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
17205
+ objectMaxProperties: theme3.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
17206
+ },
17207
+ ObjectName: {
17208
+ base: {
17209
+ color: theme3.OBJECT_NAME_COLOR
17210
+ },
17211
+ dimmed: {
17212
+ opacity: 0.6
17213
+ }
17214
+ },
17215
+ ObjectValue: {
17216
+ objectValueNull: {
17217
+ color: theme3.OBJECT_VALUE_NULL_COLOR
17218
+ },
17219
+ objectValueUndefined: {
17220
+ color: theme3.OBJECT_VALUE_UNDEFINED_COLOR
17221
+ },
17222
+ objectValueRegExp: {
17223
+ color: theme3.OBJECT_VALUE_REGEXP_COLOR
17224
+ },
17225
+ objectValueString: {
17226
+ color: theme3.OBJECT_VALUE_STRING_COLOR
17227
+ },
17228
+ objectValueSymbol: {
17229
+ color: theme3.OBJECT_VALUE_SYMBOL_COLOR
17230
+ },
17231
+ objectValueNumber: {
17232
+ color: theme3.OBJECT_VALUE_NUMBER_COLOR
17233
+ },
17234
+ objectValueBoolean: {
17235
+ color: theme3.OBJECT_VALUE_BOOLEAN_COLOR
17236
+ },
17237
+ objectValueFunctionPrefix: {
17238
+ color: theme3.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
17239
+ fontStyle: "italic"
17240
+ },
17241
+ objectValueFunctionName: {
17242
+ fontStyle: "italic"
17243
+ }
17244
+ },
17245
+ TreeView: {
17246
+ treeViewOutline: {
17247
+ padding: 0,
17248
+ margin: 0,
17249
+ listStyleType: "none"
16161
17250
  }
16162
17251
  },
16163
17252
  TreeNode: {
@@ -16271,1787 +17360,698 @@ var createTheme = (theme3) => ({
16271
17360
  right: 0,
16272
17361
  bottom: 0,
16273
17362
  borderTop: "0 none transparent",
16274
- margin: 0,
16275
- // prevent user agent stylesheet overrides
16276
- backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
16277
- backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
16278
- tableLayout: "fixed",
16279
- // table
16280
- borderSpacing: 0,
16281
- borderCollapse: "separate",
16282
- // height: '100%',
16283
- width: "100%",
16284
- fontSize: theme3.BASE_FONT_SIZE,
16285
- lineHeight: "120%"
16286
- }
16287
- },
16288
- TableInspectorTH: {
16289
- base: {
16290
- position: "relative",
16291
- // anchor for sort icon container
16292
- height: "auto",
16293
- textAlign: "left",
16294
- backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
16295
- borderBottom: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
16296
- fontWeight: "normal",
16297
- verticalAlign: "middle",
16298
- padding: "0 4px",
16299
- whiteSpace: "nowrap",
16300
- textOverflow: "ellipsis",
16301
- overflow: "hidden",
16302
- lineHeight: "14px",
16303
- ":hover": {
16304
- backgroundColor: theme3.TABLE_TH_HOVER_COLOR
16305
- }
16306
- },
16307
- div: {
16308
- whiteSpace: "nowrap",
16309
- textOverflow: "ellipsis",
16310
- overflow: "hidden",
16311
- // prevent user agent stylesheet overrides
16312
- fontSize: theme3.BASE_FONT_SIZE,
16313
- lineHeight: "120%"
16314
- }
16315
- },
16316
- TableInspectorLeftBorder: {
16317
- none: {
16318
- borderLeft: "none"
16319
- },
16320
- solid: {
16321
- borderLeft: `1px solid ${theme3.TABLE_BORDER_COLOR}`
16322
- }
16323
- },
16324
- TableInspectorSortIcon: {
16325
- display: "block",
16326
- marginRight: 3,
16327
- // 4,
16328
- width: 8,
16329
- height: 7,
16330
- marginTop: -7,
16331
- color: theme3.TABLE_SORT_ICON_COLOR,
16332
- fontSize: 12,
16333
- // lineHeight: 14
16334
- ...unselectable
16335
- }
16336
- });
16337
- var DEFAULT_THEME_NAME = "chromeLight";
16338
- var ThemeContext = reactExports.createContext(createTheme(themes_exports[DEFAULT_THEME_NAME]));
16339
- var useStyles = (baseStylesKey) => {
16340
- const themeStyles = reactExports.useContext(ThemeContext);
16341
- return themeStyles[baseStylesKey];
16342
- };
16343
- var themeAcceptor = (WrappedComponent) => {
16344
- const ThemeAcceptor = ({ theme: theme3 = DEFAULT_THEME_NAME, ...restProps }) => {
16345
- const themeStyles = reactExports.useMemo(() => {
16346
- switch (Object.prototype.toString.call(theme3)) {
16347
- case "[object String]":
16348
- return createTheme(themes_exports[theme3]);
16349
- case "[object Object]":
16350
- return createTheme(theme3);
16351
- default:
16352
- return createTheme(themes_exports[DEFAULT_THEME_NAME]);
16353
- }
16354
- }, [theme3]);
16355
- return /* @__PURE__ */ ReactExports.createElement(ThemeContext.Provider, { value: themeStyles }, /* @__PURE__ */ ReactExports.createElement(WrappedComponent, { ...restProps }));
16356
- };
16357
- return ThemeAcceptor;
16358
- };
16359
- var Arrow = ({ expanded: expanded2, styles: styles2 }) => /* @__PURE__ */ ReactExports.createElement(
16360
- "span",
16361
- {
16362
- style: {
16363
- ...styles2.base,
16364
- ...expanded2 ? styles2.expanded : styles2.collapsed
16365
- }
16366
- },
16367
- "▶"
16368
- );
16369
- var TreeNode = reactExports.memo((props) => {
16370
- props = {
16371
- expanded: true,
16372
- nodeRenderer: ({ name: name2 }) => /* @__PURE__ */ ReactExports.createElement("span", null, name2),
16373
- onClick: () => {
16374
- },
16375
- shouldShowArrow: false,
16376
- shouldShowPlaceholder: true,
16377
- ...props
16378
- };
16379
- const { expanded: expanded2, onClick, children: children2, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
16380
- const styles2 = useStyles("TreeNode");
16381
- const NodeRenderer2 = nodeRenderer;
16382
- return /* @__PURE__ */ ReactExports.createElement("li", { "aria-expanded": expanded2, role: "treeitem", style: styles2.treeNodeBase, title }, /* @__PURE__ */ ReactExports.createElement("div", { style: styles2.treeNodePreviewContainer, onClick }, shouldShowArrow || reactExports.Children.count(children2) > 0 ? /* @__PURE__ */ ReactExports.createElement(Arrow, { expanded: expanded2, styles: styles2.treeNodeArrow }) : shouldShowPlaceholder && /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.treeNodePlaceholder }, " "), /* @__PURE__ */ ReactExports.createElement(NodeRenderer2, { ...props })), /* @__PURE__ */ ReactExports.createElement("ol", { role: "group", style: styles2.treeNodeChildNodesContainer }, expanded2 ? children2 : void 0));
16383
- });
16384
- var DEFAULT_ROOT_PATH = "$";
16385
- var WILDCARD = "*";
16386
- function hasChildNodes(data, dataIterator) {
16387
- return !dataIterator(data).next().done;
16388
- }
16389
- var wildcardPathsFromLevel = (level) => {
16390
- return Array.from(
16391
- { length: level },
16392
- (_2, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join(".")
16393
- );
16394
- };
16395
- var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
16396
- const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path2) => typeof path2 === "string");
16397
- const expandedPaths = [];
16398
- wildcardPaths.forEach((wildcardPath) => {
16399
- const keyPaths = wildcardPath.split(".");
16400
- const populatePaths = (curData, curPath, depth) => {
16401
- if (depth === keyPaths.length) {
16402
- expandedPaths.push(curPath);
16403
- return;
16404
- }
16405
- const key = keyPaths[depth];
16406
- if (depth === 0) {
16407
- if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) {
16408
- populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1);
16409
- }
16410
- } else {
16411
- if (key === WILDCARD) {
16412
- for (const { name: name2, data: data2 } of dataIterator(curData)) {
16413
- if (hasChildNodes(data2, dataIterator)) {
16414
- populatePaths(data2, `${curPath}.${name2}`, depth + 1);
16415
- }
16416
- }
16417
- } else {
16418
- const value = curData[key];
16419
- if (hasChildNodes(value, dataIterator)) {
16420
- populatePaths(value, `${curPath}.${key}`, depth + 1);
16421
- }
16422
- }
16423
- }
16424
- };
16425
- populatePaths(data, "", 0);
16426
- });
16427
- return expandedPaths.reduce(
16428
- (obj, path2) => {
16429
- obj[path2] = true;
16430
- return obj;
16431
- },
16432
- { ...prevExpandedPaths }
16433
- );
16434
- };
16435
- var ConnectedTreeNode = reactExports.memo((props) => {
16436
- const { data, dataIterator, path: path2, depth, nodeRenderer } = props;
16437
- const [expandedPaths, setExpandedPaths] = reactExports.useContext(ExpandedPathsContext);
16438
- const nodeHasChildNodes = hasChildNodes(data, dataIterator);
16439
- const expanded2 = !!expandedPaths[path2];
16440
- const handleClick = reactExports.useCallback(
16441
- () => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
16442
- ...prevExpandedPaths,
16443
- [path2]: !expanded2
16444
- })),
16445
- [nodeHasChildNodes, setExpandedPaths, path2, expanded2]
16446
- );
16447
- return /* @__PURE__ */ ReactExports.createElement(
16448
- TreeNode,
16449
- {
16450
- expanded: expanded2,
16451
- onClick: handleClick,
16452
- shouldShowArrow: nodeHasChildNodes,
16453
- shouldShowPlaceholder: depth > 0,
16454
- nodeRenderer,
16455
- ...props
16456
- },
16457
- // only render if the node is expanded
16458
- expanded2 ? [...dataIterator(data)].map(({ name: name2, data: data2, ...renderNodeProps }) => {
16459
- return /* @__PURE__ */ ReactExports.createElement(
16460
- ConnectedTreeNode,
16461
- {
16462
- name: name2,
16463
- data: data2,
16464
- depth: depth + 1,
16465
- path: `${path2}.${name2}`,
16466
- key: name2,
16467
- dataIterator,
16468
- nodeRenderer,
16469
- ...renderNodeProps
16470
- }
16471
- );
16472
- }) : null
16473
- );
16474
- });
16475
- var TreeView = reactExports.memo(({ name: name2, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
16476
- const styles2 = useStyles("TreeView");
16477
- const stateAndSetter = reactExports.useState({});
16478
- const [, setExpandedPaths] = stateAndSetter;
16479
- reactExports.useLayoutEffect(
16480
- () => setExpandedPaths(
16481
- (prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)
16482
- ),
16483
- [data, dataIterator, expandPaths, expandLevel]
16484
- );
16485
- return /* @__PURE__ */ ReactExports.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, /* @__PURE__ */ ReactExports.createElement("ol", { role: "tree", style: styles2.treeViewOutline }, /* @__PURE__ */ ReactExports.createElement(
16486
- ConnectedTreeNode,
16487
- {
16488
- name: name2,
16489
- data,
16490
- dataIterator,
16491
- depth: 0,
16492
- path: DEFAULT_ROOT_PATH,
16493
- nodeRenderer
16494
- }
16495
- )));
16496
- });
16497
- var ObjectName = ({ name: name2, dimmed = false, styles: styles2 = {} }) => {
16498
- const themeStyles = useStyles("ObjectName");
16499
- const appliedStyles = {
16500
- ...themeStyles.base,
16501
- ...dimmed ? themeStyles["dimmed"] : {},
16502
- ...styles2
16503
- };
16504
- return /* @__PURE__ */ ReactExports.createElement("span", { style: appliedStyles }, name2);
16505
- };
16506
- var ObjectValue = ({ object: object2, styles: styles2 }) => {
16507
- const themeStyles = useStyles("ObjectValue");
16508
- const mkStyle = (key) => ({ ...themeStyles[key], ...styles2 });
16509
- switch (typeof object2) {
16510
- case "bigint":
16511
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2), "n");
16512
- case "number":
16513
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2));
16514
- case "string":
16515
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueString") }, '"', object2, '"');
16516
- case "boolean":
16517
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueBoolean") }, String(object2));
16518
- case "undefined":
16519
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueUndefined") }, "undefined");
16520
- case "object":
16521
- if (object2 === null) {
16522
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNull") }, "null");
16523
- }
16524
- if (object2 instanceof Date) {
16525
- return /* @__PURE__ */ ReactExports.createElement("span", null, object2.toString());
16526
- }
16527
- if (object2 instanceof RegExp) {
16528
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueRegExp") }, object2.toString());
16529
- }
16530
- if (Array.isArray(object2)) {
16531
- return /* @__PURE__ */ ReactExports.createElement("span", null, `Array(${object2.length})`);
16532
- }
16533
- if (!object2.constructor) {
16534
- return /* @__PURE__ */ ReactExports.createElement("span", null, "Object");
16535
- }
16536
- if (typeof object2.constructor.isBuffer === "function" && object2.constructor.isBuffer(object2)) {
16537
- return /* @__PURE__ */ ReactExports.createElement("span", null, `Buffer[${object2.length}]`);
16538
- }
16539
- return /* @__PURE__ */ ReactExports.createElement("span", null, object2.constructor.name);
16540
- case "function":
16541
- return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionPrefix") }, "ƒ "), /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionName") }, object2.name, "()"));
16542
- case "symbol":
16543
- return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueSymbol") }, object2.toString());
16544
- default:
16545
- return /* @__PURE__ */ ReactExports.createElement("span", null);
16546
- }
16547
- };
16548
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
16549
- var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
16550
- function getPropertyValue(object2, propertyName) {
16551
- const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
16552
- if (propertyDescriptor.get) {
16553
- try {
16554
- return propertyDescriptor.get();
16555
- } catch {
16556
- return propertyDescriptor.get;
16557
- }
16558
- }
16559
- return object2[propertyName];
16560
- }
16561
- function intersperse(arr, sep) {
16562
- if (arr.length === 0) {
16563
- return [];
16564
- }
16565
- return arr.slice(1).reduce((xs, x2) => xs.concat([sep, x2]), [arr[0]]);
16566
- }
16567
- var ObjectPreview = ({ data }) => {
16568
- const styles2 = useStyles("ObjectPreview");
16569
- const object2 = data;
16570
- if (typeof object2 !== "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp) {
16571
- return /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 });
16572
- }
16573
- if (Array.isArray(object2)) {
16574
- const maxProperties = styles2.arrayMaxProperties;
16575
- const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
16576
- if (object2.length > maxProperties) {
16577
- previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
16578
- }
16579
- const arrayLength = object2.length;
16580
- return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
16581
- } else {
16582
- const maxProperties = styles2.objectMaxProperties;
16583
- const propertyNodes = [];
16584
- for (const propertyName in object2) {
16585
- if (hasOwnProperty$1.call(object2, propertyName)) {
16586
- let ellipsis;
16587
- if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
16588
- ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…");
16589
- }
16590
- const propertyValue2 = getPropertyValue(object2, propertyName);
16591
- propertyNodes.push(
16592
- /* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
16593
- );
16594
- if (ellipsis) break;
16595
- }
16596
- }
16597
- const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
16598
- return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
16599
- }
16600
- };
16601
- var ObjectRootLabel = ({ name: name2, data }) => {
16602
- if (typeof name2 === "string") {
16603
- return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data }));
16604
- } else {
16605
- return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
16606
- }
16607
- };
16608
- var ObjectLabel = ({ name: name2, data, isNonenumerable = false }) => {
16609
- const object2 = data;
16610
- return /* @__PURE__ */ ReactExports.createElement("span", null, typeof name2 === "string" ? /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2, dimmed: isNonenumerable }) : /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 }));
16611
- };
16612
- var createIterator = (showNonenumerable, sortObjectKeys) => {
16613
- const objectIterator = function* (data) {
16614
- const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
16615
- if (!shouldIterate) return;
16616
- const dataIsArray = Array.isArray(data);
16617
- if (!dataIsArray && data[Symbol.iterator]) {
16618
- let i = 0;
16619
- for (const entry of data) {
16620
- if (Array.isArray(entry) && entry.length === 2) {
16621
- const [k2, v2] = entry;
16622
- yield {
16623
- name: k2,
16624
- data: v2
16625
- };
16626
- } else {
16627
- yield {
16628
- name: i.toString(),
16629
- data: entry
16630
- };
16631
- }
16632
- i++;
16633
- }
16634
- } else {
16635
- const keys2 = Object.getOwnPropertyNames(data);
16636
- if (sortObjectKeys === true && !dataIsArray) {
16637
- keys2.sort();
16638
- } else if (typeof sortObjectKeys === "function") {
16639
- keys2.sort(sortObjectKeys);
16640
- }
16641
- for (const propertyName of keys2) {
16642
- if (propertyIsEnumerable.call(data, propertyName)) {
16643
- const propertyValue2 = getPropertyValue(data, propertyName);
16644
- yield {
16645
- name: propertyName || `""`,
16646
- data: propertyValue2
16647
- };
16648
- } else if (showNonenumerable) {
16649
- let propertyValue2;
16650
- try {
16651
- propertyValue2 = getPropertyValue(data, propertyName);
16652
- } catch (e) {
16653
- }
16654
- if (propertyValue2 !== void 0) {
16655
- yield {
16656
- name: propertyName,
16657
- data: propertyValue2,
16658
- isNonenumerable: true
16659
- };
16660
- }
16661
- }
16662
- }
16663
- if (showNonenumerable && data !== Object.prototype) {
16664
- yield {
16665
- name: "__proto__",
16666
- data: Object.getPrototypeOf(data),
16667
- isNonenumerable: true
16668
- };
16669
- }
16670
- }
16671
- };
16672
- return objectIterator;
16673
- };
16674
- var defaultNodeRenderer = ({ depth, name: name2, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ ReactExports.createElement(ObjectRootLabel, { name: name2, data }) : /* @__PURE__ */ ReactExports.createElement(ObjectLabel, { name: name2, data, isNonenumerable });
16675
- var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
16676
- const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
16677
- const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
16678
- return /* @__PURE__ */ ReactExports.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
16679
- };
16680
- var themedObjectInspector = themeAcceptor(ObjectInspector);
16681
- __toESM(require_is_dom());
16682
- const useDarkMode = () => {
16683
- const [isDark, setIsDark] = reactExports.useState(() => {
16684
- if (typeof document === "undefined")
16685
- return false;
16686
- return document.documentElement.classList.contains("dark");
16687
- });
16688
- reactExports.useEffect(() => {
16689
- if (typeof document === "undefined")
16690
- return;
16691
- const observer = new MutationObserver(() => {
16692
- setIsDark(document.documentElement.classList.contains("dark"));
16693
- });
16694
- observer.observe(document.documentElement, {
16695
- attributes: true,
16696
- attributeFilter: ["class"]
16697
- });
16698
- return () => observer.disconnect();
16699
- }, []);
16700
- return isDark;
16701
- };
16702
- const inspectorThemeExtendedLight = {
16703
- OBJECT_VALUE_DATE_COLOR: "#a21caf"
16704
- // fuchsia-700
16705
- };
16706
- const inspectorThemeExtendedDark = {
16707
- OBJECT_VALUE_DATE_COLOR: "#e879f9"
16708
- // fuchsia-400
16709
- };
16710
- const shared = {
16711
- BASE_FONT_SIZE: "11px",
16712
- BASE_LINE_HEIGHT: 1.4,
16713
- BASE_BACKGROUND_COLOR: "transparent",
16714
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
16715
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
16716
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
16717
- ARROW_MARGIN_RIGHT: 3,
16718
- ARROW_FONT_SIZE: 12,
16719
- TREENODE_FONT_FAMILY: "var(--font-mono)",
16720
- TREENODE_FONT_SIZE: "11px",
16721
- TREENODE_LINE_HEIGHT: 1.4,
16722
- TREENODE_PADDING_LEFT: 12,
16723
- TABLE_DATA_BACKGROUND_IMAGE: "none",
16724
- TABLE_DATA_BACKGROUND_SIZE: "0"
16725
- };
16726
- const inspectorThemeLight = {
16727
- ...shared,
16728
- // Base text
16729
- BASE_COLOR: "var(--ds-gray-1000)",
16730
- // Property names — unstyled, same as base foreground (Node: no style)
16731
- OBJECT_NAME_COLOR: "var(--ds-gray-900)",
16732
- // Strings & symbols — green (Node: 'green')
16733
- OBJECT_VALUE_STRING_COLOR: "#16a34a",
16734
- // green-600
16735
- OBJECT_VALUE_SYMBOL_COLOR: "#16a34a",
16736
- // Numbers & booleans — yellow/amber (Node: 'yellow')
16737
- OBJECT_VALUE_NUMBER_COLOR: "#b45309",
16738
- // amber-700 (readable on white)
16739
- OBJECT_VALUE_BOOLEAN_COLOR: "#b45309",
16740
- // null — bold foreground (Node: 'bold')
16741
- OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-900)",
16742
- // undefined — grey (Node: 'grey')
16743
- OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
16744
- // RegExp — red (Node regexp base uses green/red/yellow palette)
16745
- OBJECT_VALUE_REGEXP_COLOR: "#dc2626",
16746
- // red-600
16747
- // Functions — cyan (Node: 'special' → 'cyan')
16748
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#0891b2",
16749
- // cyan-600
16750
- // HTML (less relevant for data inspection, but reasonable defaults)
16751
- HTML_TAG_COLOR: "var(--ds-gray-500)",
16752
- HTML_TAGNAME_COLOR: "#0891b2",
16753
- HTML_ATTRIBUTE_NAME_COLOR: "#b45309",
16754
- HTML_ATTRIBUTE_VALUE_COLOR: "#16a34a",
16755
- HTML_COMMENT_COLOR: "var(--ds-gray-400)",
16756
- HTML_DOCTYPE_COLOR: "var(--ds-gray-400)",
16757
- // Structural
16758
- ARROW_COLOR: "var(--ds-gray-500)",
16759
- TABLE_BORDER_COLOR: "var(--ds-gray-300)",
16760
- TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
16761
- TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
16762
- TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
16763
- };
16764
- const inspectorThemeDark = {
16765
- ...shared,
16766
- // Base text
16767
- BASE_COLOR: "var(--ds-gray-1000)",
16768
- // Property names — white/light foreground (Node: unstyled = white in dark terminal)
16769
- OBJECT_NAME_COLOR: "var(--ds-gray-900)",
16770
- // Strings & symbols — green (Node: 'green')
16771
- OBJECT_VALUE_STRING_COLOR: "#4ade80",
16772
- // green-400
16773
- OBJECT_VALUE_SYMBOL_COLOR: "#4ade80",
16774
- // Numbers & booleans — yellow (Node: 'yellow')
16775
- OBJECT_VALUE_NUMBER_COLOR: "#facc15",
16776
- // yellow-400
16777
- OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
16778
- // null — bold foreground / white (Node: 'bold')
16779
- OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
16780
- // undefined — grey (Node: 'grey')
16781
- OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
16782
- // RegExp — red (Node regexp palette)
16783
- OBJECT_VALUE_REGEXP_COLOR: "#f87171",
16784
- // red-400
16785
- // Functions — cyan (Node: 'special' → 'cyan')
16786
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
16787
- // cyan-400
16788
- // HTML
16789
- HTML_TAG_COLOR: "var(--ds-gray-500)",
16790
- HTML_TAGNAME_COLOR: "#22d3ee",
16791
- HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
16792
- HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
16793
- HTML_COMMENT_COLOR: "var(--ds-gray-500)",
16794
- HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
16795
- // Structural
16796
- ARROW_COLOR: "var(--ds-gray-500)",
16797
- TABLE_BORDER_COLOR: "var(--ds-gray-300)",
16798
- TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
16799
- TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
16800
- TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
16801
- };
16802
- const STREAM_REF_TYPE = "__workflow_stream_ref__";
16803
- const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
16804
- function isStreamRef(value) {
16805
- return value !== null && typeof value === "object" && "__type" in value && value.__type === STREAM_REF_TYPE;
16806
- }
16807
- function isClassInstanceRef(value) {
16808
- return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
16809
- }
16810
- const StreamClickContext = reactExports.createContext(void 0);
16811
- const DecryptClickContext = reactExports.createContext(void 0);
16812
- function EncryptedInlineLabel() {
16813
- const ctx = reactExports.useContext(DecryptClickContext);
16814
- if (ctx) {
16815
- return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
16816
- backgroundColor: "var(--ds-gray-100)",
16817
- color: "var(--ds-gray-700)",
16818
- border: "1px solid var(--ds-gray-400)",
16819
- fontStyle: "italic",
16820
- opacity: ctx.isDecrypting ? 0.6 : 1
16821
- }, disabled: ctx.isDecrypting, onClick: (e) => {
16822
- e.stopPropagation();
16823
- ctx.onDecrypt();
16824
- }, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
16825
- }
16826
- return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
16827
- display: "inline",
16828
- verticalAlign: "middle",
16829
- marginRight: "3px",
16830
- marginTop: "-1px"
16831
- } }), "Encrypted"] });
16832
- }
16833
- function StreamRefInline({ streamRef }) {
16834
- const onStreamClick = reactExports.useContext(StreamClickContext);
16835
- return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer", style: {
16836
- backgroundColor: "var(--ds-blue-100)",
16837
- color: "var(--ds-blue-800)",
16838
- border: "1px solid var(--ds-blue-300)"
16839
- }, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
16840
- }
16841
- const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
16842
- function NodeRenderer({ depth, name: name2, data, isNonenumerable }) {
16843
- var _a3;
16844
- const extendedTheme = reactExports.useContext(ExtendedThemeContext);
16845
- if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
16846
- const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
16847
- if (depth === 0) {
16848
- return label;
16849
- }
16850
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), label] });
16851
- }
16852
- if (isStreamRef(data)) {
16853
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
16854
- }
16855
- if (isClassInstanceRef(data)) {
16856
- if (depth === 0) {
16857
- return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
16858
- }
16859
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsxs("span", { style: { fontStyle: "italic" }, children: [data.className, " "] }), jsxRuntimeExports.jsx(ObjectValue, { object: data.data })] });
16860
- }
16861
- if (data instanceof Date) {
16862
- const dateStr = data.toISOString();
16863
- if (depth === 0) {
16864
- return jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr });
16865
- }
16866
- return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr })] });
16867
- }
16868
- if (depth === 0) {
16869
- return jsxRuntimeExports.jsx(ObjectRootLabel, { name: name2, data });
16870
- }
16871
- return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
16872
- }
16873
- function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
16874
- const stableData = useStableInspectorData(data);
16875
- const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
16876
- const isDark = useDarkMode();
16877
- const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
16878
- reactExports.useEffect(() => {
16879
- setInitialExpandLevel(0);
16880
- }, []);
16881
- const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
16882
- data: stableData,
16883
- name: name2,
16884
- // @ts-expect-error react-inspector accepts theme objects at runtime despite
16885
- // types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
16886
- theme: isDark ? inspectorThemeDark : inspectorThemeLight,
16887
- expandLevel: initialExpandLevel,
16888
- nodeRenderer: NodeRenderer
16889
- }) });
16890
- let wrapped = content2;
16891
- if (onStreamClick) {
16892
- wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
16893
- }
16894
- if (onDecrypt) {
16895
- wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
16896
- }
16897
- return wrapped;
16898
- }
16899
- function useStableInspectorData(next2) {
16900
- const previousRef = reactExports.useRef(next2);
16901
- if (!isDeepEqual(previousRef.current, next2)) {
16902
- previousRef.current = next2;
16903
- }
16904
- return previousRef.current;
16905
- }
16906
- function isObjectLike(value) {
16907
- return typeof value === "object" && value !== null;
16908
- }
16909
- function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
16910
- if (Object.is(a2, b2))
16911
- return true;
16912
- if (a2 instanceof Date && b2 instanceof Date) {
16913
- return a2.getTime() === b2.getTime();
16914
- }
16915
- if (a2 instanceof RegExp && b2 instanceof RegExp) {
16916
- return a2.source === b2.source && a2.flags === b2.flags;
16917
- }
16918
- if (a2 instanceof Map && b2 instanceof Map) {
16919
- if (a2.size !== b2.size)
16920
- return false;
16921
- for (const [key, value] of a2.entries()) {
16922
- if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen2))
16923
- return false;
16924
- }
16925
- return true;
16926
- }
16927
- if (a2 instanceof Set && b2 instanceof Set) {
16928
- if (a2.size !== b2.size)
16929
- return false;
16930
- for (const value of a2.values()) {
16931
- if (!b2.has(value))
16932
- return false;
16933
- }
16934
- return true;
16935
- }
16936
- if (!isObjectLike(a2) || !isObjectLike(b2)) {
16937
- return false;
16938
- }
16939
- if (seen2.get(a2) === b2)
16940
- return true;
16941
- seen2.set(a2, b2);
16942
- const aIsArray = Array.isArray(a2);
16943
- const bIsArray = Array.isArray(b2);
16944
- if (aIsArray !== bIsArray)
16945
- return false;
16946
- if (aIsArray && bIsArray) {
16947
- if (a2.length !== b2.length)
16948
- return false;
16949
- for (let i = 0; i < a2.length; i += 1) {
16950
- if (!isDeepEqual(a2[i], b2[i], seen2))
16951
- return false;
16952
- }
16953
- return true;
16954
- }
16955
- const aKeys = Object.keys(a2);
16956
- const bKeys = Object.keys(b2);
16957
- if (aKeys.length !== bKeys.length)
16958
- return false;
16959
- for (const key of aKeys) {
16960
- if (!Object.hasOwn(b2, key))
16961
- return false;
16962
- if (!isDeepEqual(a2[key], b2[key], seen2))
16963
- return false;
16964
- }
16965
- return true;
16966
- }
16967
- function __insertCSS(code2) {
16968
- if (typeof document == "undefined") return;
16969
- let head = document.head || document.getElementsByTagName("head")[0];
16970
- let style2 = document.createElement("style");
16971
- style2.type = "text/css";
16972
- head.appendChild(style2);
16973
- style2.styleSheet ? style2.styleSheet.cssText = code2 : style2.appendChild(document.createTextNode(code2));
16974
- }
16975
- const getAsset = (type) => {
16976
- switch (type) {
16977
- case "success":
16978
- return SuccessIcon;
16979
- case "info":
16980
- return InfoIcon;
16981
- case "warning":
16982
- return WarningIcon;
16983
- case "error":
16984
- return ErrorIcon;
16985
- default:
16986
- return null;
16987
- }
16988
- };
16989
- const bars = Array(12).fill(0);
16990
- const Loader = ({ visible, className }) => {
16991
- return /* @__PURE__ */ ReactExports.createElement("div", {
16992
- className: [
16993
- "sonner-loading-wrapper",
16994
- className
16995
- ].filter(Boolean).join(" "),
16996
- "data-visible": visible
16997
- }, /* @__PURE__ */ ReactExports.createElement("div", {
16998
- className: "sonner-spinner"
16999
- }, bars.map((_2, i) => /* @__PURE__ */ ReactExports.createElement("div", {
17000
- className: "sonner-loading-bar",
17001
- key: `spinner-bar-${i}`
17002
- }))));
17003
- };
17004
- const SuccessIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
17005
- xmlns: "http://www.w3.org/2000/svg",
17006
- viewBox: "0 0 20 20",
17007
- fill: "currentColor",
17008
- height: "20",
17009
- width: "20"
17010
- }, /* @__PURE__ */ ReactExports.createElement("path", {
17011
- fillRule: "evenodd",
17012
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
17013
- clipRule: "evenodd"
17014
- }));
17015
- const WarningIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
17016
- xmlns: "http://www.w3.org/2000/svg",
17017
- viewBox: "0 0 24 24",
17018
- fill: "currentColor",
17019
- height: "20",
17020
- width: "20"
17021
- }, /* @__PURE__ */ ReactExports.createElement("path", {
17022
- fillRule: "evenodd",
17023
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
17024
- clipRule: "evenodd"
17025
- }));
17026
- const InfoIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
17027
- xmlns: "http://www.w3.org/2000/svg",
17028
- viewBox: "0 0 20 20",
17029
- fill: "currentColor",
17030
- height: "20",
17031
- width: "20"
17032
- }, /* @__PURE__ */ ReactExports.createElement("path", {
17033
- fillRule: "evenodd",
17034
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
17035
- clipRule: "evenodd"
17036
- }));
17037
- const ErrorIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
17038
- xmlns: "http://www.w3.org/2000/svg",
17039
- viewBox: "0 0 20 20",
17040
- fill: "currentColor",
17041
- height: "20",
17042
- width: "20"
17043
- }, /* @__PURE__ */ ReactExports.createElement("path", {
17044
- fillRule: "evenodd",
17045
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
17046
- clipRule: "evenodd"
17047
- }));
17048
- const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
17049
- xmlns: "http://www.w3.org/2000/svg",
17050
- width: "12",
17051
- height: "12",
17052
- viewBox: "0 0 24 24",
17053
- fill: "none",
17054
- stroke: "currentColor",
17055
- strokeWidth: "1.5",
17056
- strokeLinecap: "round",
17057
- strokeLinejoin: "round"
17058
- }, /* @__PURE__ */ ReactExports.createElement("line", {
17059
- x1: "18",
17060
- y1: "6",
17061
- x2: "6",
17062
- y2: "18"
17063
- }), /* @__PURE__ */ ReactExports.createElement("line", {
17064
- x1: "6",
17065
- y1: "6",
17066
- x2: "18",
17067
- y2: "18"
17068
- }));
17069
- const useIsDocumentHidden = () => {
17070
- const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
17071
- ReactExports.useEffect(() => {
17072
- const callback = () => {
17073
- setIsDocumentHidden(document.hidden);
17074
- };
17075
- document.addEventListener("visibilitychange", callback);
17076
- return () => window.removeEventListener("visibilitychange", callback);
17077
- }, []);
17078
- return isDocumentHidden;
17079
- };
17080
- let toastsCounter = 1;
17081
- class Observer {
17082
- constructor() {
17083
- this.subscribe = (subscriber) => {
17084
- this.subscribers.push(subscriber);
17085
- return () => {
17086
- const index2 = this.subscribers.indexOf(subscriber);
17087
- this.subscribers.splice(index2, 1);
17088
- };
17089
- };
17090
- this.publish = (data) => {
17091
- this.subscribers.forEach((subscriber) => subscriber(data));
17092
- };
17093
- this.addToast = (data) => {
17094
- this.publish(data);
17095
- this.toasts = [
17096
- ...this.toasts,
17097
- data
17098
- ];
17099
- };
17100
- this.create = (data) => {
17101
- var _data_id;
17102
- const { message, ...rest } = data;
17103
- const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
17104
- const alreadyExists = this.toasts.find((toast2) => {
17105
- return toast2.id === id;
17106
- });
17107
- const dismissible = data.dismissible === void 0 ? true : data.dismissible;
17108
- if (this.dismissedToasts.has(id)) {
17109
- this.dismissedToasts.delete(id);
17110
- }
17111
- if (alreadyExists) {
17112
- this.toasts = this.toasts.map((toast2) => {
17113
- if (toast2.id === id) {
17114
- this.publish({
17115
- ...toast2,
17116
- ...data,
17117
- id,
17118
- title: message
17119
- });
17120
- return {
17121
- ...toast2,
17122
- ...data,
17123
- id,
17124
- dismissible,
17125
- title: message
17126
- };
17127
- }
17128
- return toast2;
17129
- });
17130
- } else {
17131
- this.addToast({
17132
- title: message,
17133
- ...rest,
17134
- dismissible,
17135
- id
17136
- });
17363
+ margin: 0,
17364
+ // prevent user agent stylesheet overrides
17365
+ backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
17366
+ backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
17367
+ tableLayout: "fixed",
17368
+ // table
17369
+ borderSpacing: 0,
17370
+ borderCollapse: "separate",
17371
+ // height: '100%',
17372
+ width: "100%",
17373
+ fontSize: theme3.BASE_FONT_SIZE,
17374
+ lineHeight: "120%"
17375
+ }
17376
+ },
17377
+ TableInspectorTH: {
17378
+ base: {
17379
+ position: "relative",
17380
+ // anchor for sort icon container
17381
+ height: "auto",
17382
+ textAlign: "left",
17383
+ backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
17384
+ borderBottom: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
17385
+ fontWeight: "normal",
17386
+ verticalAlign: "middle",
17387
+ padding: "0 4px",
17388
+ whiteSpace: "nowrap",
17389
+ textOverflow: "ellipsis",
17390
+ overflow: "hidden",
17391
+ lineHeight: "14px",
17392
+ ":hover": {
17393
+ backgroundColor: theme3.TABLE_TH_HOVER_COLOR
17137
17394
  }
17138
- return id;
17139
- };
17140
- this.dismiss = (id) => {
17141
- if (id) {
17142
- this.dismissedToasts.add(id);
17143
- requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
17144
- id,
17145
- dismiss: true
17146
- })));
17147
- } else {
17148
- this.toasts.forEach((toast2) => {
17149
- this.subscribers.forEach((subscriber) => subscriber({
17150
- id: toast2.id,
17151
- dismiss: true
17152
- }));
17153
- });
17395
+ },
17396
+ div: {
17397
+ whiteSpace: "nowrap",
17398
+ textOverflow: "ellipsis",
17399
+ overflow: "hidden",
17400
+ // prevent user agent stylesheet overrides
17401
+ fontSize: theme3.BASE_FONT_SIZE,
17402
+ lineHeight: "120%"
17403
+ }
17404
+ },
17405
+ TableInspectorLeftBorder: {
17406
+ none: {
17407
+ borderLeft: "none"
17408
+ },
17409
+ solid: {
17410
+ borderLeft: `1px solid ${theme3.TABLE_BORDER_COLOR}`
17411
+ }
17412
+ },
17413
+ TableInspectorSortIcon: {
17414
+ display: "block",
17415
+ marginRight: 3,
17416
+ // 4,
17417
+ width: 8,
17418
+ height: 7,
17419
+ marginTop: -7,
17420
+ color: theme3.TABLE_SORT_ICON_COLOR,
17421
+ fontSize: 12,
17422
+ // lineHeight: 14
17423
+ ...unselectable
17424
+ }
17425
+ });
17426
+ var DEFAULT_THEME_NAME = "chromeLight";
17427
+ var ThemeContext = reactExports.createContext(createTheme(themes_exports[DEFAULT_THEME_NAME]));
17428
+ var useStyles = (baseStylesKey) => {
17429
+ const themeStyles = reactExports.useContext(ThemeContext);
17430
+ return themeStyles[baseStylesKey];
17431
+ };
17432
+ var themeAcceptor = (WrappedComponent) => {
17433
+ const ThemeAcceptor = ({ theme: theme3 = DEFAULT_THEME_NAME, ...restProps }) => {
17434
+ const themeStyles = reactExports.useMemo(() => {
17435
+ switch (Object.prototype.toString.call(theme3)) {
17436
+ case "[object String]":
17437
+ return createTheme(themes_exports[theme3]);
17438
+ case "[object Object]":
17439
+ return createTheme(theme3);
17440
+ default:
17441
+ return createTheme(themes_exports[DEFAULT_THEME_NAME]);
17154
17442
  }
17155
- return id;
17156
- };
17157
- this.message = (message, data) => {
17158
- return this.create({
17159
- ...data,
17160
- message
17161
- });
17162
- };
17163
- this.error = (message, data) => {
17164
- return this.create({
17165
- ...data,
17166
- message,
17167
- type: "error"
17168
- });
17169
- };
17170
- this.success = (message, data) => {
17171
- return this.create({
17172
- ...data,
17173
- type: "success",
17174
- message
17175
- });
17176
- };
17177
- this.info = (message, data) => {
17178
- return this.create({
17179
- ...data,
17180
- type: "info",
17181
- message
17182
- });
17183
- };
17184
- this.warning = (message, data) => {
17185
- return this.create({
17186
- ...data,
17187
- type: "warning",
17188
- message
17189
- });
17190
- };
17191
- this.loading = (message, data) => {
17192
- return this.create({
17193
- ...data,
17194
- type: "loading",
17195
- message
17196
- });
17197
- };
17198
- this.promise = (promise, data) => {
17199
- if (!data) {
17443
+ }, [theme3]);
17444
+ return /* @__PURE__ */ ReactExports.createElement(ThemeContext.Provider, { value: themeStyles }, /* @__PURE__ */ ReactExports.createElement(WrappedComponent, { ...restProps }));
17445
+ };
17446
+ return ThemeAcceptor;
17447
+ };
17448
+ var Arrow = ({ expanded: expanded2, styles: styles2 }) => /* @__PURE__ */ ReactExports.createElement(
17449
+ "span",
17450
+ {
17451
+ style: {
17452
+ ...styles2.base,
17453
+ ...expanded2 ? styles2.expanded : styles2.collapsed
17454
+ }
17455
+ },
17456
+ "▶"
17457
+ );
17458
+ var TreeNode = reactExports.memo((props) => {
17459
+ props = {
17460
+ expanded: true,
17461
+ nodeRenderer: ({ name: name2 }) => /* @__PURE__ */ ReactExports.createElement("span", null, name2),
17462
+ onClick: () => {
17463
+ },
17464
+ shouldShowArrow: false,
17465
+ shouldShowPlaceholder: true,
17466
+ ...props
17467
+ };
17468
+ const { expanded: expanded2, onClick, children: children2, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
17469
+ const styles2 = useStyles("TreeNode");
17470
+ const NodeRenderer2 = nodeRenderer;
17471
+ return /* @__PURE__ */ ReactExports.createElement("li", { "aria-expanded": expanded2, role: "treeitem", style: styles2.treeNodeBase, title }, /* @__PURE__ */ ReactExports.createElement("div", { style: styles2.treeNodePreviewContainer, onClick }, shouldShowArrow || reactExports.Children.count(children2) > 0 ? /* @__PURE__ */ ReactExports.createElement(Arrow, { expanded: expanded2, styles: styles2.treeNodeArrow }) : shouldShowPlaceholder && /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.treeNodePlaceholder }, " "), /* @__PURE__ */ ReactExports.createElement(NodeRenderer2, { ...props })), /* @__PURE__ */ ReactExports.createElement("ol", { role: "group", style: styles2.treeNodeChildNodesContainer }, expanded2 ? children2 : void 0));
17472
+ });
17473
+ var DEFAULT_ROOT_PATH = "$";
17474
+ var WILDCARD = "*";
17475
+ function hasChildNodes(data, dataIterator) {
17476
+ return !dataIterator(data).next().done;
17477
+ }
17478
+ var wildcardPathsFromLevel = (level) => {
17479
+ return Array.from(
17480
+ { length: level },
17481
+ (_2, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join(".")
17482
+ );
17483
+ };
17484
+ var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
17485
+ const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path2) => typeof path2 === "string");
17486
+ const expandedPaths = [];
17487
+ wildcardPaths.forEach((wildcardPath) => {
17488
+ const keyPaths = wildcardPath.split(".");
17489
+ const populatePaths = (curData, curPath, depth) => {
17490
+ if (depth === keyPaths.length) {
17491
+ expandedPaths.push(curPath);
17200
17492
  return;
17201
17493
  }
17202
- let id = void 0;
17203
- if (data.loading !== void 0) {
17204
- id = this.create({
17205
- ...data,
17206
- promise,
17207
- type: "loading",
17208
- message: data.loading,
17209
- description: typeof data.description !== "function" ? data.description : void 0
17210
- });
17211
- }
17212
- const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
17213
- let shouldDismiss = id !== void 0;
17214
- let result;
17215
- const originalPromise = p2.then(async (response) => {
17216
- result = [
17217
- "resolve",
17218
- response
17219
- ];
17220
- const isReactElementResponse = ReactExports.isValidElement(response);
17221
- if (isReactElementResponse) {
17222
- shouldDismiss = false;
17223
- this.create({
17224
- id,
17225
- type: "default",
17226
- message: response
17227
- });
17228
- } else if (isHttpResponse(response) && !response.ok) {
17229
- shouldDismiss = false;
17230
- const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
17231
- const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
17232
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
17233
- const toastSettings = isExtendedResult ? promiseData : {
17234
- message: promiseData
17235
- };
17236
- this.create({
17237
- id,
17238
- type: "error",
17239
- description,
17240
- ...toastSettings
17241
- });
17242
- } else if (response instanceof Error) {
17243
- shouldDismiss = false;
17244
- const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
17245
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
17246
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
17247
- const toastSettings = isExtendedResult ? promiseData : {
17248
- message: promiseData
17249
- };
17250
- this.create({
17251
- id,
17252
- type: "error",
17253
- description,
17254
- ...toastSettings
17255
- });
17256
- } else if (data.success !== void 0) {
17257
- shouldDismiss = false;
17258
- const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
17259
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
17260
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
17261
- const toastSettings = isExtendedResult ? promiseData : {
17262
- message: promiseData
17263
- };
17264
- this.create({
17265
- id,
17266
- type: "success",
17267
- description,
17268
- ...toastSettings
17269
- });
17270
- }
17271
- }).catch(async (error) => {
17272
- result = [
17273
- "reject",
17274
- error
17275
- ];
17276
- if (data.error !== void 0) {
17277
- shouldDismiss = false;
17278
- const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
17279
- const description = typeof data.description === "function" ? await data.description(error) : data.description;
17280
- const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
17281
- const toastSettings = isExtendedResult ? promiseData : {
17282
- message: promiseData
17283
- };
17284
- this.create({
17285
- id,
17286
- type: "error",
17287
- description,
17288
- ...toastSettings
17289
- });
17290
- }
17291
- }).finally(() => {
17292
- if (shouldDismiss) {
17293
- this.dismiss(id);
17294
- id = void 0;
17494
+ const key = keyPaths[depth];
17495
+ if (depth === 0) {
17496
+ if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) {
17497
+ populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1);
17295
17498
  }
17296
- data.finally == null ? void 0 : data.finally.call(data);
17297
- });
17298
- const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
17299
- if (typeof id !== "string" && typeof id !== "number") {
17300
- return {
17301
- unwrap
17302
- };
17303
17499
  } else {
17304
- return Object.assign(id, {
17305
- unwrap
17306
- });
17500
+ if (key === WILDCARD) {
17501
+ for (const { name: name2, data: data2 } of dataIterator(curData)) {
17502
+ if (hasChildNodes(data2, dataIterator)) {
17503
+ populatePaths(data2, `${curPath}.${name2}`, depth + 1);
17504
+ }
17505
+ }
17506
+ } else {
17507
+ const value = curData[key];
17508
+ if (hasChildNodes(value, dataIterator)) {
17509
+ populatePaths(value, `${curPath}.${key}`, depth + 1);
17510
+ }
17511
+ }
17307
17512
  }
17308
17513
  };
17309
- this.custom = (jsx, data) => {
17310
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
17311
- this.create({
17312
- jsx: jsx(id),
17313
- id,
17314
- ...data
17315
- });
17316
- return id;
17317
- };
17318
- this.getActiveToasts = () => {
17319
- return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
17320
- };
17321
- this.subscribers = [];
17322
- this.toasts = [];
17323
- this.dismissedToasts = /* @__PURE__ */ new Set();
17324
- }
17325
- }
17326
- const ToastState = new Observer();
17327
- const toastFunction = (message, data) => {
17328
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
17329
- ToastState.addToast({
17330
- title: message,
17331
- ...data,
17332
- id
17514
+ populatePaths(data, "", 0);
17333
17515
  });
17334
- return id;
17335
- };
17336
- const isHttpResponse = (data) => {
17337
- return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
17516
+ return expandedPaths.reduce(
17517
+ (obj, path2) => {
17518
+ obj[path2] = true;
17519
+ return obj;
17520
+ },
17521
+ { ...prevExpandedPaths }
17522
+ );
17338
17523
  };
17339
- const basicToast = toastFunction;
17340
- const getHistory = () => ToastState.toasts;
17341
- const getToasts = () => ToastState.getActiveToasts();
17342
- const toast = Object.assign(basicToast, {
17343
- success: ToastState.success,
17344
- info: ToastState.info,
17345
- warning: ToastState.warning,
17346
- error: ToastState.error,
17347
- custom: ToastState.custom,
17348
- message: ToastState.message,
17349
- promise: ToastState.promise,
17350
- dismiss: ToastState.dismiss,
17351
- loading: ToastState.loading
17352
- }, {
17353
- getHistory,
17354
- getToasts
17355
- });
17356
- __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
17357
- function isAction(action) {
17358
- return action.label !== void 0;
17359
- }
17360
- const VISIBLE_TOASTS_AMOUNT = 3;
17361
- const VIEWPORT_OFFSET = "24px";
17362
- const MOBILE_VIEWPORT_OFFSET = "16px";
17363
- const TOAST_LIFETIME = 4e3;
17364
- const TOAST_WIDTH = 356;
17365
- const GAP = 14;
17366
- const SWIPE_THRESHOLD = 45;
17367
- const TIME_BEFORE_UNMOUNT = 200;
17368
- function cn$3(...classes) {
17369
- return classes.filter(Boolean).join(" ");
17370
- }
17371
- function getDefaultSwipeDirections(position2) {
17372
- const [y2, x2] = position2.split("-");
17373
- const directions = [];
17374
- if (y2) {
17375
- directions.push(y2);
17376
- }
17377
- if (x2) {
17378
- directions.push(x2);
17379
- }
17380
- return directions;
17381
- }
17382
- const Toast = (props) => {
17383
- var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
17384
- const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
17385
- const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
17386
- const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
17387
- const [mounted, setMounted] = ReactExports.useState(false);
17388
- const [removed, setRemoved] = ReactExports.useState(false);
17389
- const [swiping, setSwiping] = ReactExports.useState(false);
17390
- const [swipeOut, setSwipeOut] = ReactExports.useState(false);
17391
- const [isSwiped, setIsSwiped] = ReactExports.useState(false);
17392
- const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
17393
- const [initialHeight, setInitialHeight] = ReactExports.useState(0);
17394
- const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
17395
- const dragStartTime = ReactExports.useRef(null);
17396
- const toastRef = ReactExports.useRef(null);
17397
- const isFront = index2 === 0;
17398
- const isVisible = index2 + 1 <= visibleToasts;
17399
- const toastType = toast2.type;
17400
- const dismissible = toast2.dismissible !== false;
17401
- const toastClassname = toast2.className || "";
17402
- const toastDescriptionClassname = toast2.descriptionClassName || "";
17403
- const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
17404
- heights,
17405
- toast2.id
17406
- ]);
17407
- const closeButton = ReactExports.useMemo(() => {
17408
- var _toast_closeButton;
17409
- return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
17410
- }, [
17411
- toast2.closeButton,
17412
- closeButtonFromToaster
17413
- ]);
17414
- const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
17415
- toast2.duration,
17416
- durationFromToaster
17417
- ]);
17418
- const closeTimerStartTimeRef = ReactExports.useRef(0);
17419
- const offset2 = ReactExports.useRef(0);
17420
- const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
17421
- const pointerStartRef = ReactExports.useRef(null);
17422
- const [y2, x2] = position2.split("-");
17423
- const toastsHeightBefore = ReactExports.useMemo(() => {
17424
- return heights.reduce((prev, curr, reducerIndex) => {
17425
- if (reducerIndex >= heightIndex) {
17426
- return prev;
17427
- }
17428
- return prev + curr.height;
17429
- }, 0);
17430
- }, [
17431
- heights,
17432
- heightIndex
17433
- ]);
17434
- const isDocumentHidden = useIsDocumentHidden();
17435
- const invert = toast2.invert || ToasterInvert;
17436
- const disabled = toastType === "loading";
17437
- offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
17438
- heightIndex,
17439
- toastsHeightBefore
17440
- ]);
17441
- ReactExports.useEffect(() => {
17442
- remainingTime.current = duration2;
17443
- }, [
17444
- duration2
17445
- ]);
17446
- ReactExports.useEffect(() => {
17447
- setMounted(true);
17448
- }, []);
17449
- ReactExports.useEffect(() => {
17450
- const toastNode = toastRef.current;
17451
- if (toastNode) {
17452
- const height = toastNode.getBoundingClientRect().height;
17453
- setInitialHeight(height);
17454
- setHeights((h2) => [
17524
+ var ConnectedTreeNode = reactExports.memo((props) => {
17525
+ const { data, dataIterator, path: path2, depth, nodeRenderer } = props;
17526
+ const [expandedPaths, setExpandedPaths] = reactExports.useContext(ExpandedPathsContext);
17527
+ const nodeHasChildNodes = hasChildNodes(data, dataIterator);
17528
+ const expanded2 = !!expandedPaths[path2];
17529
+ const handleClick = reactExports.useCallback(
17530
+ () => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
17531
+ ...prevExpandedPaths,
17532
+ [path2]: !expanded2
17533
+ })),
17534
+ [nodeHasChildNodes, setExpandedPaths, path2, expanded2]
17535
+ );
17536
+ return /* @__PURE__ */ ReactExports.createElement(
17537
+ TreeNode,
17538
+ {
17539
+ expanded: expanded2,
17540
+ onClick: handleClick,
17541
+ shouldShowArrow: nodeHasChildNodes,
17542
+ shouldShowPlaceholder: depth > 0,
17543
+ nodeRenderer,
17544
+ ...props
17545
+ },
17546
+ // only render if the node is expanded
17547
+ expanded2 ? [...dataIterator(data)].map(({ name: name2, data: data2, ...renderNodeProps }) => {
17548
+ return /* @__PURE__ */ ReactExports.createElement(
17549
+ ConnectedTreeNode,
17455
17550
  {
17456
- toastId: toast2.id,
17457
- height,
17458
- position: toast2.position
17459
- },
17460
- ...h2
17461
- ]);
17462
- return () => setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
17551
+ name: name2,
17552
+ data: data2,
17553
+ depth: depth + 1,
17554
+ path: `${path2}.${name2}`,
17555
+ key: name2,
17556
+ dataIterator,
17557
+ nodeRenderer,
17558
+ ...renderNodeProps
17559
+ }
17560
+ );
17561
+ }) : null
17562
+ );
17563
+ });
17564
+ var TreeView = reactExports.memo(({ name: name2, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
17565
+ const styles2 = useStyles("TreeView");
17566
+ const stateAndSetter = reactExports.useState({});
17567
+ const [, setExpandedPaths] = stateAndSetter;
17568
+ reactExports.useLayoutEffect(
17569
+ () => setExpandedPaths(
17570
+ (prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)
17571
+ ),
17572
+ [data, dataIterator, expandPaths, expandLevel]
17573
+ );
17574
+ return /* @__PURE__ */ ReactExports.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, /* @__PURE__ */ ReactExports.createElement("ol", { role: "tree", style: styles2.treeViewOutline }, /* @__PURE__ */ ReactExports.createElement(
17575
+ ConnectedTreeNode,
17576
+ {
17577
+ name: name2,
17578
+ data,
17579
+ dataIterator,
17580
+ depth: 0,
17581
+ path: DEFAULT_ROOT_PATH,
17582
+ nodeRenderer
17463
17583
  }
17464
- }, [
17465
- setHeights,
17466
- toast2.id
17467
- ]);
17468
- ReactExports.useLayoutEffect(() => {
17469
- if (!mounted) return;
17470
- const toastNode = toastRef.current;
17471
- const originalHeight = toastNode.style.height;
17472
- toastNode.style.height = "auto";
17473
- const newHeight = toastNode.getBoundingClientRect().height;
17474
- toastNode.style.height = originalHeight;
17475
- setInitialHeight(newHeight);
17476
- setHeights((heights2) => {
17477
- const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
17478
- if (!alreadyExists) {
17479
- return [
17480
- {
17481
- toastId: toast2.id,
17482
- height: newHeight,
17483
- position: toast2.position
17484
- },
17485
- ...heights2
17486
- ];
17487
- } else {
17488
- return heights2.map((height) => height.toastId === toast2.id ? {
17489
- ...height,
17490
- height: newHeight
17491
- } : height);
17584
+ )));
17585
+ });
17586
+ var ObjectName = ({ name: name2, dimmed = false, styles: styles2 = {} }) => {
17587
+ const themeStyles = useStyles("ObjectName");
17588
+ const appliedStyles = {
17589
+ ...themeStyles.base,
17590
+ ...dimmed ? themeStyles["dimmed"] : {},
17591
+ ...styles2
17592
+ };
17593
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: appliedStyles }, name2);
17594
+ };
17595
+ var ObjectValue = ({ object: object2, styles: styles2 }) => {
17596
+ const themeStyles = useStyles("ObjectValue");
17597
+ const mkStyle = (key) => ({ ...themeStyles[key], ...styles2 });
17598
+ switch (typeof object2) {
17599
+ case "bigint":
17600
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2), "n");
17601
+ case "number":
17602
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2));
17603
+ case "string":
17604
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueString") }, '"', object2, '"');
17605
+ case "boolean":
17606
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueBoolean") }, String(object2));
17607
+ case "undefined":
17608
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueUndefined") }, "undefined");
17609
+ case "object":
17610
+ if (object2 === null) {
17611
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNull") }, "null");
17492
17612
  }
17493
- });
17494
- }, [
17495
- mounted,
17496
- toast2.title,
17497
- toast2.description,
17498
- setHeights,
17499
- toast2.id,
17500
- toast2.jsx,
17501
- toast2.action,
17502
- toast2.cancel
17503
- ]);
17504
- const deleteToast = ReactExports.useCallback(() => {
17505
- setRemoved(true);
17506
- setOffsetBeforeRemove(offset2.current);
17507
- setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
17508
- setTimeout(() => {
17509
- removeToast(toast2);
17510
- }, TIME_BEFORE_UNMOUNT);
17511
- }, [
17512
- toast2,
17513
- removeToast,
17514
- setHeights,
17515
- offset2
17516
- ]);
17517
- ReactExports.useEffect(() => {
17518
- if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
17519
- let timeoutId;
17520
- const pauseTimer = () => {
17521
- if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
17522
- const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
17523
- remainingTime.current = remainingTime.current - elapsedTime;
17613
+ if (object2 instanceof Date) {
17614
+ return /* @__PURE__ */ ReactExports.createElement("span", null, object2.toString());
17524
17615
  }
17525
- lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
17526
- };
17527
- const startTimer = () => {
17528
- if (remainingTime.current === Infinity) return;
17529
- closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
17530
- timeoutId = setTimeout(() => {
17531
- toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
17532
- deleteToast();
17533
- }, remainingTime.current);
17534
- };
17535
- if (expanded2 || interacting || isDocumentHidden) {
17536
- pauseTimer();
17537
- } else {
17538
- startTimer();
17616
+ if (object2 instanceof RegExp) {
17617
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueRegExp") }, object2.toString());
17618
+ }
17619
+ if (Array.isArray(object2)) {
17620
+ return /* @__PURE__ */ ReactExports.createElement("span", null, `Array(${object2.length})`);
17621
+ }
17622
+ if (!object2.constructor) {
17623
+ return /* @__PURE__ */ ReactExports.createElement("span", null, "Object");
17624
+ }
17625
+ if (typeof object2.constructor.isBuffer === "function" && object2.constructor.isBuffer(object2)) {
17626
+ return /* @__PURE__ */ ReactExports.createElement("span", null, `Buffer[${object2.length}]`);
17627
+ }
17628
+ return /* @__PURE__ */ ReactExports.createElement("span", null, object2.constructor.name);
17629
+ case "function":
17630
+ return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionPrefix") }, "ƒ "), /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionName") }, object2.name, "()"));
17631
+ case "symbol":
17632
+ return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueSymbol") }, object2.toString());
17633
+ default:
17634
+ return /* @__PURE__ */ ReactExports.createElement("span", null);
17635
+ }
17636
+ };
17637
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
17638
+ var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
17639
+ function getPropertyValue(object2, propertyName) {
17640
+ const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
17641
+ if (propertyDescriptor.get) {
17642
+ try {
17643
+ return propertyDescriptor.get();
17644
+ } catch {
17645
+ return propertyDescriptor.get;
17539
17646
  }
17540
- return () => clearTimeout(timeoutId);
17541
- }, [
17542
- expanded2,
17543
- interacting,
17544
- toast2,
17545
- toastType,
17546
- isDocumentHidden,
17547
- deleteToast
17548
- ]);
17549
- ReactExports.useEffect(() => {
17550
- if (toast2.delete) {
17551
- deleteToast();
17552
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
17647
+ }
17648
+ return object2[propertyName];
17649
+ }
17650
+ function intersperse(arr, sep) {
17651
+ if (arr.length === 0) {
17652
+ return [];
17653
+ }
17654
+ return arr.slice(1).reduce((xs, x2) => xs.concat([sep, x2]), [arr[0]]);
17655
+ }
17656
+ var ObjectPreview = ({ data }) => {
17657
+ const styles2 = useStyles("ObjectPreview");
17658
+ const object2 = data;
17659
+ if (typeof object2 !== "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp) {
17660
+ return /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 });
17661
+ }
17662
+ if (Array.isArray(object2)) {
17663
+ const maxProperties = styles2.arrayMaxProperties;
17664
+ const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
17665
+ if (object2.length > maxProperties) {
17666
+ previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
17553
17667
  }
17554
- }, [
17555
- deleteToast,
17556
- toast2.delete
17557
- ]);
17558
- function getLoadingIcon() {
17559
- var _toast_classNames9;
17560
- if (icons == null ? void 0 : icons.loading) {
17561
- var _toast_classNames12;
17562
- return /* @__PURE__ */ ReactExports.createElement("div", {
17563
- className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
17564
- "data-visible": toastType === "loading"
17565
- }, icons.loading);
17668
+ const arrayLength = object2.length;
17669
+ return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
17670
+ } else {
17671
+ const maxProperties = styles2.objectMaxProperties;
17672
+ const propertyNodes = [];
17673
+ for (const propertyName in object2) {
17674
+ if (hasOwnProperty$1.call(object2, propertyName)) {
17675
+ let ellipsis;
17676
+ if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
17677
+ ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "");
17678
+ }
17679
+ const propertyValue2 = getPropertyValue(object2, propertyName);
17680
+ propertyNodes.push(
17681
+ /* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
17682
+ );
17683
+ if (ellipsis) break;
17684
+ }
17566
17685
  }
17567
- return /* @__PURE__ */ ReactExports.createElement(Loader, {
17568
- className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
17569
- visible: toastType === "loading"
17570
- });
17686
+ const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
17687
+ return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
17571
17688
  }
17572
- const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
17573
- var _toast_richColors, _icons_close;
17574
- return /* @__PURE__ */ ReactExports.createElement("li", {
17575
- tabIndex: 0,
17576
- ref: toastRef,
17577
- className: cn$3(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
17578
- "data-sonner-toast": "",
17579
- "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
17580
- "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
17581
- "data-mounted": mounted,
17582
- "data-promise": Boolean(toast2.promise),
17583
- "data-swiped": isSwiped,
17584
- "data-removed": removed,
17585
- "data-visible": isVisible,
17586
- "data-y-position": y2,
17587
- "data-x-position": x2,
17588
- "data-index": index2,
17589
- "data-front": isFront,
17590
- "data-swiping": swiping,
17591
- "data-dismissible": dismissible,
17592
- "data-type": toastType,
17593
- "data-invert": invert,
17594
- "data-swipe-out": swipeOut,
17595
- "data-swipe-direction": swipeOutDirection,
17596
- "data-expanded": Boolean(expanded2 || expandByDefault && mounted),
17597
- "data-testid": toast2.testId,
17598
- style: {
17599
- "--index": index2,
17600
- "--toasts-before": index2,
17601
- "--z-index": toasts.length - index2,
17602
- "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
17603
- "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
17604
- ...style2,
17605
- ...toast2.style
17606
- },
17607
- onDragEnd: () => {
17608
- setSwiping(false);
17609
- setSwipeDirection(null);
17610
- pointerStartRef.current = null;
17611
- },
17612
- onPointerDown: (event) => {
17613
- if (event.button === 2) return;
17614
- if (disabled || !dismissible) return;
17615
- dragStartTime.current = /* @__PURE__ */ new Date();
17616
- setOffsetBeforeRemove(offset2.current);
17617
- event.target.setPointerCapture(event.pointerId);
17618
- if (event.target.tagName === "BUTTON") return;
17619
- setSwiping(true);
17620
- pointerStartRef.current = {
17621
- x: event.clientX,
17622
- y: event.clientY
17623
- };
17624
- },
17625
- onPointerUp: () => {
17626
- var _toastRef_current, _toastRef_current1, _dragStartTime_current;
17627
- if (swipeOut || !dismissible) return;
17628
- pointerStartRef.current = null;
17629
- const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
17630
- const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
17631
- const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
17632
- const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
17633
- const velocity = Math.abs(swipeAmount) / timeTaken;
17634
- if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
17635
- setOffsetBeforeRemove(offset2.current);
17636
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
17637
- if (swipeDirection === "x") {
17638
- setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
17689
+ };
17690
+ var ObjectRootLabel = ({ name: name2, data }) => {
17691
+ if (typeof name2 === "string") {
17692
+ return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data }));
17693
+ } else {
17694
+ return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
17695
+ }
17696
+ };
17697
+ var ObjectLabel = ({ name: name2, data, isNonenumerable = false }) => {
17698
+ const object2 = data;
17699
+ return /* @__PURE__ */ ReactExports.createElement("span", null, typeof name2 === "string" ? /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2, dimmed: isNonenumerable }) : /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 }));
17700
+ };
17701
+ var createIterator = (showNonenumerable, sortObjectKeys) => {
17702
+ const objectIterator = function* (data) {
17703
+ const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
17704
+ if (!shouldIterate) return;
17705
+ const dataIsArray = Array.isArray(data);
17706
+ if (!dataIsArray && data[Symbol.iterator]) {
17707
+ let i = 0;
17708
+ for (const entry of data) {
17709
+ if (Array.isArray(entry) && entry.length === 2) {
17710
+ const [k2, v2] = entry;
17711
+ yield {
17712
+ name: k2,
17713
+ data: v2
17714
+ };
17639
17715
  } else {
17640
- setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
17716
+ yield {
17717
+ name: i.toString(),
17718
+ data: entry
17719
+ };
17641
17720
  }
17642
- deleteToast();
17643
- setSwipeOut(true);
17644
- return;
17645
- } else {
17646
- var _toastRef_current2, _toastRef_current3;
17647
- (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
17648
- (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
17721
+ i++;
17649
17722
  }
17650
- setIsSwiped(false);
17651
- setSwiping(false);
17652
- setSwipeDirection(null);
17653
- },
17654
- onPointerMove: (event) => {
17655
- var _window_getSelection, _toastRef_current, _toastRef_current1;
17656
- if (!pointerStartRef.current || !dismissible) return;
17657
- const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
17658
- if (isHighlighted) return;
17659
- const yDelta = event.clientY - pointerStartRef.current.y;
17660
- const xDelta = event.clientX - pointerStartRef.current.x;
17661
- var _props_swipeDirections;
17662
- const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
17663
- if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
17664
- setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
17723
+ } else {
17724
+ const keys2 = Object.getOwnPropertyNames(data);
17725
+ if (sortObjectKeys === true && !dataIsArray) {
17726
+ keys2.sort();
17727
+ } else if (typeof sortObjectKeys === "function") {
17728
+ keys2.sort(sortObjectKeys);
17665
17729
  }
17666
- let swipeAmount = {
17667
- x: 0,
17668
- y: 0
17669
- };
17670
- const getDampening = (delta) => {
17671
- const factor = Math.abs(delta) / 20;
17672
- return 1 / (1.5 + factor);
17673
- };
17674
- if (swipeDirection === "y") {
17675
- if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
17676
- if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
17677
- swipeAmount.y = yDelta;
17678
- } else {
17679
- const dampenedDelta = yDelta * getDampening(yDelta);
17680
- swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
17730
+ for (const propertyName of keys2) {
17731
+ if (propertyIsEnumerable.call(data, propertyName)) {
17732
+ const propertyValue2 = getPropertyValue(data, propertyName);
17733
+ yield {
17734
+ name: propertyName || `""`,
17735
+ data: propertyValue2
17736
+ };
17737
+ } else if (showNonenumerable) {
17738
+ let propertyValue2;
17739
+ try {
17740
+ propertyValue2 = getPropertyValue(data, propertyName);
17741
+ } catch (e) {
17681
17742
  }
17682
- }
17683
- } else if (swipeDirection === "x") {
17684
- if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
17685
- if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
17686
- swipeAmount.x = xDelta;
17687
- } else {
17688
- const dampenedDelta = xDelta * getDampening(xDelta);
17689
- swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
17743
+ if (propertyValue2 !== void 0) {
17744
+ yield {
17745
+ name: propertyName,
17746
+ data: propertyValue2,
17747
+ isNonenumerable: true
17748
+ };
17690
17749
  }
17691
17750
  }
17692
17751
  }
17693
- if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
17694
- setIsSwiped(true);
17752
+ if (showNonenumerable && data !== Object.prototype) {
17753
+ yield {
17754
+ name: "__proto__",
17755
+ data: Object.getPrototypeOf(data),
17756
+ isNonenumerable: true
17757
+ };
17695
17758
  }
17696
- (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
17697
- (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
17698
17759
  }
17699
- }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ ReactExports.createElement("button", {
17700
- "aria-label": closeButtonAriaLabel,
17701
- "data-disabled": disabled,
17702
- "data-close-button": true,
17703
- onClick: disabled || !dismissible ? () => {
17704
- } : () => {
17705
- deleteToast();
17706
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
17707
- },
17708
- className: cn$3(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
17709
- }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ ReactExports.createElement("div", {
17710
- "data-icon": "",
17711
- className: cn$3(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
17712
- }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ ReactExports.createElement("div", {
17713
- "data-content": "",
17714
- className: cn$3(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
17715
- }, /* @__PURE__ */ ReactExports.createElement("div", {
17716
- "data-title": "",
17717
- className: cn$3(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
17718
- }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ ReactExports.createElement("div", {
17719
- "data-description": "",
17720
- className: cn$3(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
17721
- }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ ReactExports.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ ReactExports.createElement("button", {
17722
- "data-button": true,
17723
- "data-cancel": true,
17724
- style: toast2.cancelButtonStyle || cancelButtonStyle,
17725
- onClick: (event) => {
17726
- if (!isAction(toast2.cancel)) return;
17727
- if (!dismissible) return;
17728
- toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
17729
- deleteToast();
17730
- },
17731
- className: cn$3(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
17732
- }, toast2.cancel.label) : null, /* @__PURE__ */ ReactExports.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ ReactExports.createElement("button", {
17733
- "data-button": true,
17734
- "data-action": true,
17735
- style: toast2.actionButtonStyle || actionButtonStyle,
17736
- onClick: (event) => {
17737
- if (!isAction(toast2.action)) return;
17738
- toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
17739
- if (event.defaultPrevented) return;
17740
- deleteToast();
17741
- },
17742
- className: cn$3(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
17743
- }, toast2.action.label) : null);
17760
+ };
17761
+ return objectIterator;
17762
+ };
17763
+ var defaultNodeRenderer = ({ depth, name: name2, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ ReactExports.createElement(ObjectRootLabel, { name: name2, data }) : /* @__PURE__ */ ReactExports.createElement(ObjectLabel, { name: name2, data, isNonenumerable });
17764
+ var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
17765
+ const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
17766
+ const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
17767
+ return /* @__PURE__ */ ReactExports.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
17768
+ };
17769
+ var themedObjectInspector = themeAcceptor(ObjectInspector);
17770
+ __toESM(require_is_dom());
17771
+ const useDarkMode = () => {
17772
+ const [isDark, setIsDark] = reactExports.useState(() => {
17773
+ if (typeof document === "undefined")
17774
+ return false;
17775
+ return document.documentElement.classList.contains("dark");
17776
+ });
17777
+ reactExports.useEffect(() => {
17778
+ if (typeof document === "undefined")
17779
+ return;
17780
+ const observer = new MutationObserver(() => {
17781
+ setIsDark(document.documentElement.classList.contains("dark"));
17782
+ });
17783
+ observer.observe(document.documentElement, {
17784
+ attributes: true,
17785
+ attributeFilter: ["class"]
17786
+ });
17787
+ return () => observer.disconnect();
17788
+ }, []);
17789
+ return isDark;
17790
+ };
17791
+ const inspectorThemeExtendedLight = {
17792
+ OBJECT_VALUE_DATE_COLOR: "#a21caf"
17793
+ // fuchsia-700
17794
+ };
17795
+ const inspectorThemeExtendedDark = {
17796
+ OBJECT_VALUE_DATE_COLOR: "#e879f9"
17797
+ // fuchsia-400
17798
+ };
17799
+ const shared = {
17800
+ BASE_FONT_SIZE: "11px",
17801
+ BASE_LINE_HEIGHT: 1.4,
17802
+ BASE_BACKGROUND_COLOR: "transparent",
17803
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
17804
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
17805
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
17806
+ ARROW_MARGIN_RIGHT: 3,
17807
+ ARROW_FONT_SIZE: 12,
17808
+ TREENODE_FONT_FAMILY: "var(--font-mono)",
17809
+ TREENODE_FONT_SIZE: "11px",
17810
+ TREENODE_LINE_HEIGHT: 1.4,
17811
+ TREENODE_PADDING_LEFT: 12,
17812
+ TABLE_DATA_BACKGROUND_IMAGE: "none",
17813
+ TABLE_DATA_BACKGROUND_SIZE: "0"
17814
+ };
17815
+ const inspectorThemeLight = {
17816
+ ...shared,
17817
+ // Base text
17818
+ BASE_COLOR: "var(--ds-gray-1000)",
17819
+ // Property names — unstyled, same as base foreground (Node: no style)
17820
+ OBJECT_NAME_COLOR: "var(--ds-gray-900)",
17821
+ // Strings & symbols — green (Node: 'green')
17822
+ OBJECT_VALUE_STRING_COLOR: "#16a34a",
17823
+ // green-600
17824
+ OBJECT_VALUE_SYMBOL_COLOR: "#16a34a",
17825
+ // Numbers & booleans — yellow/amber (Node: 'yellow')
17826
+ OBJECT_VALUE_NUMBER_COLOR: "#b45309",
17827
+ // amber-700 (readable on white)
17828
+ OBJECT_VALUE_BOOLEAN_COLOR: "#b45309",
17829
+ // null — bold foreground (Node: 'bold')
17830
+ OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-900)",
17831
+ // undefined — grey (Node: 'grey')
17832
+ OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
17833
+ // RegExp — red (Node regexp base uses green/red/yellow palette)
17834
+ OBJECT_VALUE_REGEXP_COLOR: "#dc2626",
17835
+ // red-600
17836
+ // Functions — cyan (Node: 'special' → 'cyan')
17837
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#0891b2",
17838
+ // cyan-600
17839
+ // HTML (less relevant for data inspection, but reasonable defaults)
17840
+ HTML_TAG_COLOR: "var(--ds-gray-500)",
17841
+ HTML_TAGNAME_COLOR: "#0891b2",
17842
+ HTML_ATTRIBUTE_NAME_COLOR: "#b45309",
17843
+ HTML_ATTRIBUTE_VALUE_COLOR: "#16a34a",
17844
+ HTML_COMMENT_COLOR: "var(--ds-gray-400)",
17845
+ HTML_DOCTYPE_COLOR: "var(--ds-gray-400)",
17846
+ // Structural
17847
+ ARROW_COLOR: "var(--ds-gray-500)",
17848
+ TABLE_BORDER_COLOR: "var(--ds-gray-300)",
17849
+ TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
17850
+ TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
17851
+ TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
17744
17852
  };
17745
- function getDocumentDirection() {
17746
- if (typeof window === "undefined") return "ltr";
17747
- if (typeof document === "undefined") return "ltr";
17748
- const dirAttribute = document.documentElement.getAttribute("dir");
17749
- if (dirAttribute === "auto" || !dirAttribute) {
17750
- return window.getComputedStyle(document.documentElement).direction;
17853
+ const inspectorThemeDark = {
17854
+ ...shared,
17855
+ // Base text
17856
+ BASE_COLOR: "var(--ds-gray-1000)",
17857
+ // Property names — white/light foreground (Node: unstyled = white in dark terminal)
17858
+ OBJECT_NAME_COLOR: "var(--ds-gray-900)",
17859
+ // Strings & symbols — green (Node: 'green')
17860
+ OBJECT_VALUE_STRING_COLOR: "#4ade80",
17861
+ // green-400
17862
+ OBJECT_VALUE_SYMBOL_COLOR: "#4ade80",
17863
+ // Numbers & booleans — yellow (Node: 'yellow')
17864
+ OBJECT_VALUE_NUMBER_COLOR: "#facc15",
17865
+ // yellow-400
17866
+ OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
17867
+ // null — bold foreground / white (Node: 'bold')
17868
+ OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
17869
+ // undefined — grey (Node: 'grey')
17870
+ OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
17871
+ // RegExp — red (Node regexp palette)
17872
+ OBJECT_VALUE_REGEXP_COLOR: "#f87171",
17873
+ // red-400
17874
+ // Functions — cyan (Node: 'special' → 'cyan')
17875
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
17876
+ // cyan-400
17877
+ // HTML
17878
+ HTML_TAG_COLOR: "var(--ds-gray-500)",
17879
+ HTML_TAGNAME_COLOR: "#22d3ee",
17880
+ HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
17881
+ HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
17882
+ HTML_COMMENT_COLOR: "var(--ds-gray-500)",
17883
+ HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
17884
+ // Structural
17885
+ ARROW_COLOR: "var(--ds-gray-500)",
17886
+ TABLE_BORDER_COLOR: "var(--ds-gray-300)",
17887
+ TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
17888
+ TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
17889
+ TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
17890
+ };
17891
+ const STREAM_REF_TYPE = "__workflow_stream_ref__";
17892
+ const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
17893
+ function isStreamRef(value) {
17894
+ return value !== null && typeof value === "object" && "__type" in value && value.__type === STREAM_REF_TYPE;
17895
+ }
17896
+ function isClassInstanceRef(value) {
17897
+ return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
17898
+ }
17899
+ const StreamClickContext = reactExports.createContext(void 0);
17900
+ const DecryptClickContext = reactExports.createContext(void 0);
17901
+ function EncryptedInlineLabel() {
17902
+ const ctx = reactExports.useContext(DecryptClickContext);
17903
+ if (ctx) {
17904
+ return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
17905
+ backgroundColor: "var(--ds-gray-100)",
17906
+ color: "var(--ds-gray-700)",
17907
+ border: "1px solid var(--ds-gray-400)",
17908
+ fontStyle: "italic",
17909
+ opacity: ctx.isDecrypting ? 0.6 : 1
17910
+ }, disabled: ctx.isDecrypting, onClick: (e) => {
17911
+ e.stopPropagation();
17912
+ ctx.onDecrypt();
17913
+ }, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
17751
17914
  }
17752
- return dirAttribute;
17915
+ return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
17916
+ display: "inline",
17917
+ verticalAlign: "middle",
17918
+ marginRight: "3px",
17919
+ marginTop: "-1px"
17920
+ } }), "Encrypted"] });
17753
17921
  }
17754
- function assignOffset(defaultOffset, mobileOffset) {
17755
- const styles2 = {};
17756
- [
17757
- defaultOffset,
17758
- mobileOffset
17759
- ].forEach((offset2, index2) => {
17760
- const isMobile = index2 === 1;
17761
- const prefix = isMobile ? "--mobile-offset" : "--offset";
17762
- const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
17763
- function assignAll(offset3) {
17764
- [
17765
- "top",
17766
- "right",
17767
- "bottom",
17768
- "left"
17769
- ].forEach((key) => {
17770
- styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
17771
- });
17772
- }
17773
- if (typeof offset2 === "number" || typeof offset2 === "string") {
17774
- assignAll(offset2);
17775
- } else if (typeof offset2 === "object") {
17776
- [
17777
- "top",
17778
- "right",
17779
- "bottom",
17780
- "left"
17781
- ].forEach((key) => {
17782
- if (offset2[key] === void 0) {
17783
- styles2[`${prefix}-${key}`] = defaultValue;
17784
- } else {
17785
- styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
17786
- }
17787
- });
17788
- } else {
17789
- assignAll(defaultValue);
17790
- }
17791
- });
17792
- return styles2;
17922
+ function StreamRefInline({ streamRef }) {
17923
+ const onStreamClick = reactExports.useContext(StreamClickContext);
17924
+ return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer", style: {
17925
+ backgroundColor: "var(--ds-blue-100)",
17926
+ color: "var(--ds-blue-800)",
17927
+ border: "1px solid var(--ds-blue-300)"
17928
+ }, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
17793
17929
  }
17794
- const Toaster = /* @__PURE__ */ ReactExports.forwardRef(function Toaster2(props, ref) {
17795
- const { id, invert, position: position2 = "bottom-right", hotkey = [
17796
- "altKey",
17797
- "KeyT"
17798
- ], expand, closeButton, className, offset: offset2, mobileOffset, theme: theme3 = "light", richColors, duration: duration2, style: style2, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
17799
- const [toasts, setToasts] = ReactExports.useState([]);
17800
- const filteredToasts = ReactExports.useMemo(() => {
17801
- if (id) {
17802
- return toasts.filter((toast2) => toast2.toasterId === id);
17930
+ const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
17931
+ function NodeRenderer({ depth, name: name2, data, isNonenumerable }) {
17932
+ var _a3;
17933
+ const extendedTheme = reactExports.useContext(ExtendedThemeContext);
17934
+ if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
17935
+ const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
17936
+ if (depth === 0) {
17937
+ return label;
17803
17938
  }
17804
- return toasts.filter((toast2) => !toast2.toasterId);
17805
- }, [
17806
- toasts,
17807
- id
17808
- ]);
17809
- const possiblePositions = ReactExports.useMemo(() => {
17810
- return Array.from(new Set([
17811
- position2
17812
- ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
17813
- }, [
17814
- filteredToasts,
17815
- position2
17816
- ]);
17817
- const [heights, setHeights] = ReactExports.useState([]);
17818
- const [expanded2, setExpanded] = ReactExports.useState(false);
17819
- const [interacting, setInteracting] = ReactExports.useState(false);
17820
- const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
17821
- const listRef = ReactExports.useRef(null);
17822
- const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
17823
- const lastFocusedElementRef = ReactExports.useRef(null);
17824
- const isFocusWithinRef = ReactExports.useRef(false);
17825
- const removeToast = ReactExports.useCallback((toastToRemove) => {
17826
- setToasts((toasts2) => {
17827
- var _toasts_find;
17828
- if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
17829
- ToastState.dismiss(toastToRemove.id);
17830
- }
17831
- return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
17832
- });
17833
- }, []);
17834
- ReactExports.useEffect(() => {
17835
- return ToastState.subscribe((toast2) => {
17836
- if (toast2.dismiss) {
17837
- requestAnimationFrame(() => {
17838
- setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
17839
- ...t,
17840
- delete: true
17841
- } : t));
17842
- });
17843
- return;
17844
- }
17845
- setTimeout(() => {
17846
- ReactDOM.flushSync(() => {
17847
- setToasts((toasts2) => {
17848
- const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
17849
- if (indexOfExistingToast !== -1) {
17850
- return [
17851
- ...toasts2.slice(0, indexOfExistingToast),
17852
- {
17853
- ...toasts2[indexOfExistingToast],
17854
- ...toast2
17855
- },
17856
- ...toasts2.slice(indexOfExistingToast + 1)
17857
- ];
17858
- }
17859
- return [
17860
- toast2,
17861
- ...toasts2
17862
- ];
17863
- });
17864
- });
17865
- });
17866
- });
17867
- }, [
17868
- toasts
17869
- ]);
17870
- ReactExports.useEffect(() => {
17871
- if (theme3 !== "system") {
17872
- setActualTheme(theme3);
17873
- return;
17939
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), label] });
17940
+ }
17941
+ if (isStreamRef(data)) {
17942
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
17943
+ }
17944
+ if (isClassInstanceRef(data)) {
17945
+ if (depth === 0) {
17946
+ return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
17874
17947
  }
17875
- if (theme3 === "system") {
17876
- if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
17877
- setActualTheme("dark");
17878
- } else {
17879
- setActualTheme("light");
17880
- }
17948
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsxs("span", { style: { fontStyle: "italic" }, children: [data.className, " "] }), jsxRuntimeExports.jsx(ObjectValue, { object: data.data })] });
17949
+ }
17950
+ if (data instanceof Date) {
17951
+ const dateStr = data.toISOString();
17952
+ if (depth === 0) {
17953
+ return jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr });
17881
17954
  }
17882
- if (typeof window === "undefined") return;
17883
- const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
17884
- try {
17885
- darkMediaQuery.addEventListener("change", ({ matches }) => {
17886
- if (matches) {
17887
- setActualTheme("dark");
17888
- } else {
17889
- setActualTheme("light");
17890
- }
17891
- });
17892
- } catch (error) {
17893
- darkMediaQuery.addListener(({ matches }) => {
17894
- try {
17895
- if (matches) {
17896
- setActualTheme("dark");
17897
- } else {
17898
- setActualTheme("light");
17899
- }
17900
- } catch (e) {
17901
- console.error(e);
17902
- }
17903
- });
17955
+ return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr })] });
17956
+ }
17957
+ if (depth === 0) {
17958
+ return jsxRuntimeExports.jsx(ObjectRootLabel, { name: name2, data });
17959
+ }
17960
+ return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
17961
+ }
17962
+ function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
17963
+ const stableData = useStableInspectorData(data);
17964
+ const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
17965
+ const isDark = useDarkMode();
17966
+ const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
17967
+ reactExports.useEffect(() => {
17968
+ setInitialExpandLevel(0);
17969
+ }, []);
17970
+ const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
17971
+ data: stableData,
17972
+ name: name2,
17973
+ // @ts-expect-error react-inspector accepts theme objects at runtime despite
17974
+ // types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
17975
+ theme: isDark ? inspectorThemeDark : inspectorThemeLight,
17976
+ expandLevel: initialExpandLevel,
17977
+ nodeRenderer: NodeRenderer
17978
+ }) });
17979
+ let wrapped = content2;
17980
+ if (onStreamClick) {
17981
+ wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
17982
+ }
17983
+ if (onDecrypt) {
17984
+ wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
17985
+ }
17986
+ return wrapped;
17987
+ }
17988
+ function useStableInspectorData(next2) {
17989
+ const previousRef = reactExports.useRef(next2);
17990
+ if (!isDeepEqual(previousRef.current, next2)) {
17991
+ previousRef.current = next2;
17992
+ }
17993
+ return previousRef.current;
17994
+ }
17995
+ function isObjectLike(value) {
17996
+ return typeof value === "object" && value !== null;
17997
+ }
17998
+ function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
17999
+ if (Object.is(a2, b2))
18000
+ return true;
18001
+ if (a2 instanceof Date && b2 instanceof Date) {
18002
+ return a2.getTime() === b2.getTime();
18003
+ }
18004
+ if (a2 instanceof RegExp && b2 instanceof RegExp) {
18005
+ return a2.source === b2.source && a2.flags === b2.flags;
18006
+ }
18007
+ if (a2 instanceof Map && b2 instanceof Map) {
18008
+ if (a2.size !== b2.size)
18009
+ return false;
18010
+ for (const [key, value] of a2.entries()) {
18011
+ if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen2))
18012
+ return false;
17904
18013
  }
17905
- }, [
17906
- theme3
17907
- ]);
17908
- ReactExports.useEffect(() => {
17909
- if (toasts.length <= 1) {
17910
- setExpanded(false);
18014
+ return true;
18015
+ }
18016
+ if (a2 instanceof Set && b2 instanceof Set) {
18017
+ if (a2.size !== b2.size)
18018
+ return false;
18019
+ for (const value of a2.values()) {
18020
+ if (!b2.has(value))
18021
+ return false;
17911
18022
  }
17912
- }, [
17913
- toasts
17914
- ]);
17915
- ReactExports.useEffect(() => {
17916
- const handleKeyDown = (event) => {
17917
- var _listRef_current;
17918
- const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
17919
- if (isHotkeyPressed) {
17920
- var _listRef_current1;
17921
- setExpanded(true);
17922
- (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
17923
- }
17924
- if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
17925
- setExpanded(false);
17926
- }
17927
- };
17928
- document.addEventListener("keydown", handleKeyDown);
17929
- return () => document.removeEventListener("keydown", handleKeyDown);
17930
- }, [
17931
- hotkey
17932
- ]);
17933
- ReactExports.useEffect(() => {
17934
- if (listRef.current) {
17935
- return () => {
17936
- if (lastFocusedElementRef.current) {
17937
- lastFocusedElementRef.current.focus({
17938
- preventScroll: true
17939
- });
17940
- lastFocusedElementRef.current = null;
17941
- isFocusWithinRef.current = false;
17942
- }
17943
- };
18023
+ return true;
18024
+ }
18025
+ if (!isObjectLike(a2) || !isObjectLike(b2)) {
18026
+ return false;
18027
+ }
18028
+ if (seen2.get(a2) === b2)
18029
+ return true;
18030
+ seen2.set(a2, b2);
18031
+ const aIsArray = Array.isArray(a2);
18032
+ const bIsArray = Array.isArray(b2);
18033
+ if (aIsArray !== bIsArray)
18034
+ return false;
18035
+ if (aIsArray && bIsArray) {
18036
+ if (a2.length !== b2.length)
18037
+ return false;
18038
+ for (let i = 0; i < a2.length; i += 1) {
18039
+ if (!isDeepEqual(a2[i], b2[i], seen2))
18040
+ return false;
17944
18041
  }
17945
- }, [
17946
- listRef.current
17947
- ]);
17948
- return (
17949
- // Remove item from normal navigation flow, only available via hotkey
17950
- /* @__PURE__ */ ReactExports.createElement("section", {
17951
- ref,
17952
- "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
17953
- tabIndex: -1,
17954
- "aria-live": "polite",
17955
- "aria-relevant": "additions text",
17956
- "aria-atomic": "false",
17957
- suppressHydrationWarning: true
17958
- }, possiblePositions.map((position3, index2) => {
17959
- var _heights_;
17960
- const [y2, x2] = position3.split("-");
17961
- if (!filteredToasts.length) return null;
17962
- return /* @__PURE__ */ ReactExports.createElement("ol", {
17963
- key: position3,
17964
- dir: dir === "auto" ? getDocumentDirection() : dir,
17965
- tabIndex: -1,
17966
- ref: listRef,
17967
- className,
17968
- "data-sonner-toaster": true,
17969
- "data-sonner-theme": actualTheme,
17970
- "data-y-position": y2,
17971
- "data-x-position": x2,
17972
- style: {
17973
- "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
17974
- "--width": `${TOAST_WIDTH}px`,
17975
- "--gap": `${gap}px`,
17976
- ...style2,
17977
- ...assignOffset(offset2, mobileOffset)
17978
- },
17979
- onBlur: (event) => {
17980
- if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
17981
- isFocusWithinRef.current = false;
17982
- if (lastFocusedElementRef.current) {
17983
- lastFocusedElementRef.current.focus({
17984
- preventScroll: true
17985
- });
17986
- lastFocusedElementRef.current = null;
17987
- }
17988
- }
17989
- },
17990
- onFocus: (event) => {
17991
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
17992
- if (isNotDismissible) return;
17993
- if (!isFocusWithinRef.current) {
17994
- isFocusWithinRef.current = true;
17995
- lastFocusedElementRef.current = event.relatedTarget;
17996
- }
17997
- },
17998
- onMouseEnter: () => setExpanded(true),
17999
- onMouseMove: () => setExpanded(true),
18000
- onMouseLeave: () => {
18001
- if (!interacting) {
18002
- setExpanded(false);
18003
- }
18004
- },
18005
- onDragEnd: () => setExpanded(false),
18006
- onPointerDown: (event) => {
18007
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
18008
- if (isNotDismissible) return;
18009
- setInteracting(true);
18010
- },
18011
- onPointerUp: () => setInteracting(false)
18012
- }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
18013
- var _toastOptions_duration, _toastOptions_closeButton;
18014
- return /* @__PURE__ */ ReactExports.createElement(Toast, {
18015
- key: toast2.id,
18016
- icons,
18017
- index: index3,
18018
- toast: toast2,
18019
- defaultRichColors: richColors,
18020
- duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
18021
- className: toastOptions == null ? void 0 : toastOptions.className,
18022
- descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
18023
- invert,
18024
- visibleToasts,
18025
- closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
18026
- interacting,
18027
- position: position3,
18028
- style: toastOptions == null ? void 0 : toastOptions.style,
18029
- unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
18030
- classNames: toastOptions == null ? void 0 : toastOptions.classNames,
18031
- cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
18032
- actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
18033
- closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
18034
- removeToast,
18035
- toasts: filteredToasts.filter((t) => t.position == toast2.position),
18036
- heights: heights.filter((h2) => h2.position == toast2.position),
18037
- setHeights,
18038
- expandByDefault: expand,
18039
- gap,
18040
- expanded: expanded2,
18041
- swipeDirections: props.swipeDirections
18042
- });
18043
- }));
18044
- }))
18045
- );
18046
- });
18047
- const defaultAdapter = {
18048
- success: (msg, opts) => toast.success(msg, opts),
18049
- error: (msg, opts) => toast.error(msg, opts),
18050
- info: (msg, opts) => toast.info(msg, opts)
18051
- };
18052
- const ToastContext = reactExports.createContext(defaultAdapter);
18053
- function useToast() {
18054
- return reactExports.useContext(ToastContext);
18042
+ return true;
18043
+ }
18044
+ const aKeys = Object.keys(a2);
18045
+ const bKeys = Object.keys(b2);
18046
+ if (aKeys.length !== bKeys.length)
18047
+ return false;
18048
+ for (const key of aKeys) {
18049
+ if (!Object.hasOwn(b2, key))
18050
+ return false;
18051
+ if (!isDeepEqual(a2[key], b2[key], seen2))
18052
+ return false;
18053
+ }
18054
+ return true;
18055
18055
  }
18056
18056
  function Skeleton$1({ className, style: style2, ...props }) {
18057
18057
  return jsxRuntimeExports.jsx("div", { ...props, className: cn$4("rounded-md", className), style: { backgroundColor: "var(--ds-gray-200)", ...style2 } });
@@ -42818,7 +42818,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
42818
42818
  var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
42819
42819
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
42820
42820
  var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
42821
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-BcILn2ch.js"), true ? __vite__mapDeps([0,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
42821
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-D1wKXrjI.js"), true ? __vite__mapDeps([0,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
42822
42822
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
42823
42823
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
42824
42824
  return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
@@ -47923,6 +47923,13 @@ async function fetchEvents(worldEnv, runId, params) {
47923
47923
  async function fetchEvent(worldEnv, runId, eventId, resolveData = "all") {
47924
47924
  return rpc("fetchEvent", { worldEnv, runId, eventId, resolveData });
47925
47925
  }
47926
+ async function fetchEventsByCorrelationId(worldEnv, correlationId, params) {
47927
+ return rpc("fetchEventsByCorrelationId", {
47928
+ worldEnv,
47929
+ correlationId,
47930
+ params
47931
+ });
47932
+ }
47926
47933
  async function fetchHooks(worldEnv, params) {
47927
47934
  return rpc("fetchHooks", { worldEnv, params });
47928
47935
  }
@@ -48001,26 +48008,27 @@ export {
48001
48008
  formatWallClockTime as a8,
48002
48009
  useImmediateStyle as a9,
48003
48010
  getWebRevivers as aA,
48004
- LIVE_UPDATE_INTERVAL_MS as aB,
48005
- fetchEvent as aC,
48006
- getEncryptionKeyForRun as aD,
48007
- StreamViewer as aE,
48008
- cn$4 as aF,
48009
- composeRefs as aG,
48010
- useFloating as aH,
48011
- offset as aI,
48012
- shift as aJ,
48013
- limitShift as aK,
48014
- flip as aL,
48015
- size as aM,
48016
- arrow as aN,
48017
- hide as aO,
48018
- autoUpdate as aP,
48019
- cancelRun as aQ,
48020
- reenqueueRun as aR,
48021
- wakeUpRun as aS,
48022
- resumeHook as aT,
48023
- recreateRun as aU,
48011
+ fetchEvent as aB,
48012
+ fetchEventsByCorrelationId as aC,
48013
+ LIVE_UPDATE_INTERVAL_MS as aD,
48014
+ getEncryptionKeyForRun as aE,
48015
+ StreamViewer as aF,
48016
+ cn$4 as aG,
48017
+ composeRefs as aH,
48018
+ useFloating as aI,
48019
+ offset as aJ,
48020
+ shift as aK,
48021
+ limitShift as aL,
48022
+ flip as aM,
48023
+ size as aN,
48024
+ arrow as aO,
48025
+ hide as aP,
48026
+ autoUpdate as aQ,
48027
+ cancelRun as aR,
48028
+ reenqueueRun as aS,
48029
+ wakeUpRun as aT,
48030
+ resumeHook as aU,
48031
+ recreateRun as aV,
48024
48032
  TIMELINE_PADDING as aa,
48025
48033
  formatTimeSelection as ab,
48026
48034
  MARKER_HEIGHT as ac,