@nqlib/nqui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +28 -0
  2. package/dist/{base-80a1f760-BOlg5Ney.js → base-80a1f760-C2sIm9yE.js} +1 -1
  3. package/dist/{base-80a1f760-MXO_OFow.cjs → base-80a1f760-DM2Ub6Fb.cjs} +1 -1
  4. package/dist/components/AppLayout.d.ts +2 -0
  5. package/dist/components/AppLayout.d.ts.map +1 -1
  6. package/dist/components/app-sidebar.d.ts.map +1 -1
  7. package/dist/components/custom/enhanced-calendar.d.ts +21 -0
  8. package/dist/components/custom/enhanced-calendar.d.ts.map +1 -0
  9. package/dist/components/custom/enhanced-progress.d.ts +1 -1
  10. package/dist/components/custom/enhanced-select.d.ts +10 -5
  11. package/dist/components/custom/enhanced-select.d.ts.map +1 -1
  12. package/dist/components/custom/table-of-contents.d.ts.map +1 -1
  13. package/dist/components/ui/card.d.ts +6 -0
  14. package/dist/components/ui/card.d.ts.map +1 -1
  15. package/dist/components/ui/frosted-glass.d.ts +33 -0
  16. package/dist/components/ui/frosted-glass.d.ts.map +1 -0
  17. package/dist/components/ui/progress.d.ts +1 -1
  18. package/dist/components/ui/shadcn-io/code-block/index.d.ts.map +1 -1
  19. package/dist/{consoleHook-59e792cb-D3_AFTLt.cjs → consoleHook-59e792cb-B67m1I9f.cjs} +1 -1
  20. package/dist/{consoleHook-59e792cb-Ct_fyIfV.js → consoleHook-59e792cb-DRl3o_41.js} +1 -1
  21. package/dist/hooks/use-detect-touch.d.ts +7 -0
  22. package/dist/hooks/use-detect-touch.d.ts.map +1 -0
  23. package/dist/{index-B-Ce_5Ox.cjs → index-4IcpRQSK.cjs} +1 -1
  24. package/dist/{index-599aeaf7-Cj4NrBQi.js → index-599aeaf7-D4HUN6ws.js} +3 -3
  25. package/dist/{index-599aeaf7-C4YpDJZ0.cjs → index-599aeaf7-HICAzEVY.cjs} +1 -1
  26. package/dist/{index-CoqUgEly.js → index-BEb70cIe.js} +3 -3
  27. package/dist/{index-BzeTMijQ.js → index-Bgku8TKO.js} +13119 -12807
  28. package/dist/{index-D38BT2Ua.cjs → index-CK94xvaj.cjs} +1 -1
  29. package/dist/{index-CqS3p5dh.cjs → index-DWdbLDAC.cjs} +155 -95
  30. package/dist/{index-Br_yIFcf.js → index-J28hkDB5.js} +2 -2
  31. package/dist/{index-CflweVrB.cjs → index-_Bcbl3L5.cjs} +1 -1
  32. package/dist/{index-D14fsO7i.js → index-kEV2bTam.js} +1 -1
  33. package/dist/index.d.ts +6 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/nqui.cjs.js +1 -1
  36. package/dist/nqui.es.js +342 -338
  37. package/dist/pages/Dashboard.d.ts.map +1 -1
  38. package/dist/styles.css +37 -0
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -78,6 +78,8 @@ See [Troubleshooting](#troubleshooting) for more details.
78
78
  @import "@nqlib/nqui/styles";
79
79
  ```
80
80
 
81
+ **Note:** Vite does NOT require `@source` directives. Tailwind CSS v4 automatically scans files when using the `@tailwindcss/vite` plugin. Only Next.js requires `@source` directives.
82
+
81
83
  2. **Use components:**
82
84
 
83
85
  ```tsx
@@ -222,6 +224,32 @@ All components are framework-agnostic and work with any React setup.
222
224
 
223
225
  ## Troubleshooting
224
226
 
227
+ ### @source Directives: Next.js vs Vite
228
+
229
+ **Problem:** Tailwind classes not working, or confusion about whether to use `@source` directives
230
+
231
+ **Solution:**
232
+ - **Next.js REQUIRES `@source` directives** in your CSS file:
233
+ ```css
234
+ @import "tailwindcss";
235
+ @source "./**/*.{js,ts,jsx,tsx,mdx}";
236
+ @source "../components/**/*.{js,ts,jsx,tsx,mdx}";
237
+ @source "../node_modules/@nqlib/nqui/dist/**/*.js";
238
+ @import "tw-animate-css";
239
+ @import "@nqlib/nqui/styles";
240
+ ```
241
+
242
+ - **Vite does NOT need `@source` directives** - Tailwind automatically scans files:
243
+ ```css
244
+ @import "tailwindcss";
245
+ @import "tw-animate-css";
246
+ @import "@nqlib/nqui/styles";
247
+ ```
248
+
249
+ **Why the difference?** Next.js has a different file structure and build process, so Tailwind needs explicit paths. Vite's `@tailwindcss/vite` plugin automatically handles file scanning.
250
+
251
+ **Common mistake:** Adding `@source` directives to Vite projects (not needed and may cause issues) or missing them in Next.js projects (will cause Tailwind to not find classes).
252
+
225
253
  ### Module Resolution Issues (Next.js 16+)
226
254
 
227
255
  If you encounter `Module not found: Can't resolve '@nqlib/nqui'` when using `npm link` or `file:` protocol, switch to Webpack:
@@ -1,4 +1,4 @@
1
- import { O as n } from "./index-BzeTMijQ.js";
1
+ import { O as n } from "./index-Bgku8TKO.js";
2
2
  var p = (
3
3
  /** @class */
4
4
  (function() {
@@ -1 +1 @@
1
- "use strict";const n=require("./index-CqS3p5dh.cjs");var r=(function(){function e(t,i,o){o===void 0&&(o={}),this.status="idle",this.options=o,this.sandboxSetup=i,this.iframeSelector=t}return e.prototype.updateOptions=function(t){n.dequal(this.options,t)||(this.options=t,this.updateSandbox())},e.prototype.updateSandbox=function(t,i){throw t===void 0&&(t=this.sandboxSetup),Error("Method not implemented")},e.prototype.destroy=function(){throw Error("Method not implemented")},e.prototype.dispatch=function(t){throw Error("Method not implemented")},e.prototype.listen=function(t){throw Error("Method not implemented")},e})();exports.SandpackClient=r;
1
+ "use strict";const n=require("./index-DWdbLDAC.cjs");var r=(function(){function e(t,i,o){o===void 0&&(o={}),this.status="idle",this.options=o,this.sandboxSetup=i,this.iframeSelector=t}return e.prototype.updateOptions=function(t){n.dequal(this.options,t)||(this.options=t,this.updateSandbox())},e.prototype.updateSandbox=function(t,i){throw t===void 0&&(t=this.sandboxSetup),Error("Method not implemented")},e.prototype.destroy=function(){throw Error("Method not implemented")},e.prototype.dispatch=function(t){throw Error("Method not implemented")},e.prototype.listen=function(t){throw Error("Method not implemented")},e})();exports.SandpackClient=r;
@@ -1,2 +1,4 @@
1
+ import * as React from "react";
2
+ export declare const ScrollContainerContext: React.Context<React.RefObject<HTMLDivElement> | null>;
1
3
  export declare function AppLayout(): import("react/jsx-runtime").JSX.Element;
2
4
  //# sourceMappingURL=AppLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../src/components/AppLayout.tsx"],"names":[],"mappings":"AAmIA,wBAAgB,SAAS,4CAOxB"}
1
+ {"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../src/components/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyD9B,eAAO,MAAM,sBAAsB,uDAAoE,CAAA;AAmKvG,wBAAgB,SAAS,4CAOxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/app-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,OAAO,EACL,OAAO,EAWR,MAAM,yBAAyB,CAAA;AA4IhC,wBAAgB,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,2CAuN5E"}
1
+ {"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/components/app-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,OAAO,EACL,OAAO,EAWR,MAAM,yBAAyB,CAAA;AAqJhC,wBAAgB,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,2CAuN5E"}
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import { DayPicker } from "react-day-picker";
3
+ export type EnhancedCalendarProps = React.ComponentProps<typeof DayPicker> & {
4
+ /**
5
+ * Enable touch drag functionality for range selection on touch devices
6
+ * Only works when mode="range"
7
+ */
8
+ touchDragEnabled?: boolean;
9
+ };
10
+ /**
11
+ * Enhanced Calendar with touch drag and hover preview features
12
+ *
13
+ * Features:
14
+ * - Touch drag for range selection on mobile/touch devices (when mode="range" and touchDragEnabled=true)
15
+ * - Hover preview for range selection on desktop (when mode="range")
16
+ */
17
+ export declare function EnhancedCalendar({ touchDragEnabled, ...props }: EnhancedCalendarProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare namespace EnhancedCalendar {
19
+ var displayName: string;
20
+ }
21
+ //# sourceMappingURL=enhanced-calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enhanced-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/custom/enhanced-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC3E;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,gBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAuXvB;yBA1Xe,gBAAgB"}
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const progressBlockVariants: (props?: ({
4
- variant?: "default" | "error" | "success" | "warning" | "neutral" | null | undefined;
4
+ variant?: "error" | "default" | "success" | "warning" | "neutral" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface EnhancedProgressProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof progressBlockVariants> {
7
7
  /**
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Select as SelectPrimitive } from "radix-ui";
3
+ import { SelectScrollUpButton, SelectScrollDownButton } from "@/components/ui/select";
3
4
  /**
4
5
  * Enhanced Select components with button-like 3D effects (no gradient)
5
6
  *
@@ -12,14 +13,18 @@ import { Select as SelectPrimitive } from "radix-ui";
12
13
  declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
13
14
  declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
14
15
  declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
15
- declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
16
+ interface SelectTriggerProps extends React.ComponentProps<typeof SelectPrimitive.Trigger> {
16
17
  size?: "sm" | "default";
17
- }): import("react/jsx-runtime").JSX.Element;
18
- declare function SelectContent({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Minimum width for the trigger. Set to "fit" to allow content-based sizing without min-width.
20
+ * @default "120px"
21
+ */
22
+ minWidth?: "fit" | string;
23
+ }
24
+ declare function SelectTrigger({ className, size, children, minWidth, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
19
26
  declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
20
27
  declare function SelectItem({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
21
28
  declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
22
- declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
23
- declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
24
29
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
25
30
  //# sourceMappingURL=enhanced-select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhanced-select.d.ts","sourceRoot":"","sources":["../../../src/components/custom/enhanced-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAMpD;;;;;;;;GAQG;AAEH,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,2CA4HA;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAExD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAE7D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAE/D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
1
+ {"version":3,"file":"enhanced-select.d.ts","sourceRoot":"","sources":["../../../src/components/custom/enhanced-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAwK,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAM3P;;;;;;;;GAQG;AAEH,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC;IACvF,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAC1B;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAgB,EAChB,QAAQ,EACR,QAAkB,EAClB,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA8HpB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAyB,EACzB,KAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CA+BtD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAExD;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"table-of-contents.d.ts","sourceRoot":"","sources":["../../../src/components/custom/table-of-contents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;CACrB;AAaD,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAChF;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IACtE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAA;CACzC;AA+FD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,eAAe,6FAyNpB,CAAA;AA09BD,OAAO,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"table-of-contents.d.ts","sourceRoot":"","sources":["../../../src/components/custom/table-of-contents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;CACrB;AAaD,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAChF;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IACtE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAA;CACzC;AA+FD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,eAAe,6FAqOpB,CAAA;AA09BD,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -4,6 +4,12 @@ declare const cardVariants: (props?: ({
4
4
  variant?: "default" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
7
+ /**
8
+ * Enable sticky header with frosted glass effect
9
+ * When true, CardHeader becomes sticky and CardContent becomes scrollable with fade mask
10
+ * @default false
11
+ */
12
+ stickyHeader?: boolean;
7
13
  }
8
14
  declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
9
15
  declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AA0CjE,QAAA,MAAM,YAAY;;8EAiBjB,CAAA;AAED,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAExC,QAAA,MAAM,IAAI,kFAQT,CAAA;AAGD,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,QAAA,MAAM,SAAS,6GAYb,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAKf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AA4CjE,QAAA,MAAM,YAAY;;8EAiBjB,CAAA;AAOD,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,QAAA,MAAM,IAAI,kFAeT,CAAA;AAGD,QAAA,MAAM,UAAU,6GA2Bd,CAAA;AAGF,QAAA,MAAM,SAAS,6GAYb,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAqBf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,33 @@
1
+ interface FrostedGlassProps {
2
+ /**
3
+ * Blur radius in pixels
4
+ * @default 16
5
+ */
6
+ blur?: number;
7
+ /**
8
+ * Border radius in pixels
9
+ * @default 0
10
+ */
11
+ borderRadius?: number;
12
+ /**
13
+ * Additional CSS classes
14
+ */
15
+ className?: string;
16
+ }
17
+ /**
18
+ * FrostedGlass component creates an Apple-inspired frosted glass effect
19
+ * using backdrop-filter with extended backdrop to capture nearby elements.
20
+ *
21
+ * Based on Josh Comeau's method: https://www.joshwcomeau.com/css/backdrop-filter/
22
+ *
23
+ * Key features:
24
+ * - Extended backdrop (height: 200%) to capture nearby elements for blur
25
+ * - SVG mask for rounded corners
26
+ * - Gradient background to prevent top-edge flickering
27
+ * - Pointer events disabled to allow interactions
28
+ * - Feature queries for browser support
29
+ */
30
+ declare function FrostedGlass({ blur, borderRadius, className, }: FrostedGlassProps): import("react/jsx-runtime").JSX.Element;
31
+ export { FrostedGlass };
32
+ export type { FrostedGlassProps };
33
+ //# sourceMappingURL=frosted-glass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frosted-glass.d.ts","sourceRoot":"","sources":["../../../src/components/ui/frosted-glass.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,YAAY,CAAC,EACpB,IAAS,EACT,YAAgB,EAChB,SAAS,GACV,EAAE,iBAAiB,2CA+DnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { Progress as ProgressPrimitive } from "radix-ui";
3
3
  import { type VariantProps } from "class-variance-authority";
4
4
  declare const progressIndicatorVariants: (props?: ({
5
- variant?: "default" | "error" | "success" | "warning" | "neutral" | null | undefined;
5
+ variant?: "error" | "default" | "success" | "warning" | "neutral" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Root>, VariantProps<typeof progressIndicatorVariants> {
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/shadcn-io/code-block/index.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/shadcn-io/code-block/index.tsx"],"names":[],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";const p=require("./index-CqS3p5dh.cjs");var M=(function(){function t(){this.listeners={},this.listenersCount=0,this.channelId=Math.floor(Math.random()*1e6),this.listeners=[]}return t.prototype.cleanup=function(){this.listeners={},this.listenersCount=0},t.prototype.dispatch=function(r){Object.values(this.listeners).forEach(function(e){return e(r)})},t.prototype.listener=function(r){var e=this;if(typeof r!="function")return function(){};var s=this.listenersCount;return this.listeners[s]=r,this.listenersCount++,function(){delete e.listeners[s]}},t})();function v(t){return/[a-zA-Z.]/.test(t)}function b(t){return/[a-zA-Z]/.test(t)}function w(t){return/\s/.test(t)}function y(t){return/[&|]/.test(t)}function g(t){return/-/.test(t)}function E(t){return/["']/.test(t)}function _(t){return b(t)&&t===t.toUpperCase()}var a;(function(t){t.OR="OR",t.AND="AND",t.PIPE="PIPE",t.Command="Command",t.Argument="Argument",t.String="String",t.EnvVar="EnvVar"})(a||(a={}));var O=new Map([["&&",{type:a.AND}],["||",{type:a.OR}],["|",{type:a.PIPE}],["-",{type:a.Argument}]]);function T(t){var r=0,e=[];function s(){for(var n="";v(t[r])&&r<t.length;)n+=t[r],r++;return{type:a.Command,value:n}}function f(){for(var n="";y(t[r])&&r<t.length;)n+=t[r],r++;return O.get(n)}function d(){for(var n="";(g(t[r])||b(t[r]))&&r<t.length;)n+=t[r],r++;return{type:a.Argument,value:n}}function c(){var n=t[r],u=t[r];for(r++;t[r]!==n&&r<t.length;)u+=t[r],r++;return u+=t[r],r++,{type:a.String,value:u}}function h(){for(var n={},u=function(){for(var l="",o="";t[r]!=="="&&r<t.length;)l+=t[r],r++;for(t[r]==="="&&r++;t[r]!==" "&&r<t.length;)o+=t[r],r++;n[l]=o};_(t[r])&&r<t.length;)u(),r++;return{type:a.EnvVar,value:n}}for(;r<t.length;){var i=t[r];if(w(i)){r++;continue}switch(!0){case _(i):e.push(h());break;case v(i):e.push(s());break;case y(i):e.push(f());break;case g(i):e.push(d());break;case E(i):e.push(c());break;default:throw new Error("Unknown character: ".concat(i))}}return e}var A=0;function j(){var t=Date.now(),r=Math.round(Math.random()*1e4),e=A+=1;return(+"".concat(t).concat(r).concat(e)).toString(16)}var S=function(t){return typeof t=="string"?new TextEncoder().encode(t):t},k=function(t){return typeof t=="string"?t:new TextDecoder().decode(t)},z=function(t){return Object.entries(t).reduce(function(r,e){var s=e[0],f=e[1];return r[s]=S(f.code),r},{})},C=function(t){var r={},e=["dev","start"];try{r=JSON.parse(t).scripts}catch(c){throw p.createError("Could not parse package.json file: "+c.message)}p.invariant(r,"Failed to start. Please provide a `start` or `dev` script on the package.json");for(var s=function(c){if(e[c]in r){var h=e[c],i=r[h],n={},u="",l=[];return T(i).forEach(function(o){var m=u==="";o.type===a.EnvVar&&(n=o.value),o.type===a.Command&&m&&(u=o.value),(o.type===a.Argument||!m&&o.type===a.Command)&&l.push(o.value)}),{value:[u,l,{env:n}]}}},f=0;f<e.length;f++){var d=s(f);if(typeof d=="object")return d.value}throw p.createError("Failed to start. Please provide a `start` or `dev` script on the package.json")},D=function(t){return typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message:p.createError("The server could not be reached. Make sure that the node script is running and that a port has been started.")},I=`var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e={},n={};!function(t){t.__esModule=!0,t.default=["log","debug","info","warn","error","table","clear","time","timeEnd","count","assert","command","result"]}(n);var a,o={},i={};(a=i).__esModule=!0,a.default=function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+"-"+Date.now()};var u={},s={__esModule:!0};s.update=s.state=void 0,s.update=function(t){s.state=t};var f={},c={};!function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)};r.__esModule=!0,r.initialState=void 0,r.initialState={timings:{},count:{}};var n=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()};r.default=function(t,a){var o,i,u;switch(void 0===t&&(t=r.initialState),a.type){case"COUNT":var s=t.count[a.name]||0;return e(e({},t),{count:e(e({},t.count),(o={},o[a.name]=s+1,o))});case"TIME_START":return e(e({},t),{timings:e(e({},t.timings),(i={},i[a.name]={start:n()},i))});case"TIME_END":var f=t.timings[a.name],c=n(),l=c-f.start;return e(e({},t),{timings:e(e({},t.timings),(u={},u[a.name]=e(e({},f),{end:c,time:l}),u))});default:return t}}}(c),function(r){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var n=e(c),a=s;r.default=function(t){a.update(n.default(a.state,t))}}(f);var l={__esModule:!0};l.timeEnd=l.timeStart=l.count=void 0,l.count=function(t){return{type:"COUNT",name:t}},l.timeStart=function(t){return{type:"TIME_START",name:t}},l.timeEnd=function(t){return{type:"TIME_END",name:t}};var d=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};u.__esModule=!0,u.stop=u.start=void 0;var p=s,h=d(f),m=l;u.start=function(t){h.default(m.timeStart(t))},u.stop=function(t){var r=null===p.state||void 0===p.state?void 0:p.state.timings[t];return r&&!r.end?(h.default(m.timeEnd(t)),{method:"log",data:[t+": "+p.state.timings[t].time+"ms"]}):{method:"warn",data:["Timer '"+t+"' does not exist"]}};var y={},v=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};y.__esModule=!0,y.increment=void 0;var _=s,b=v(f),g=l;y.increment=function(t){return b.default(g.count(t)),{method:"log",data:[t+": "+_.state.count[t]]}};var M={},T=t&&t.__spreadArrays||function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),a=0;for(r=0;r<e;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n};M.__esModule=!0,M.test=void 0,M.test=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return!t&&(0===r.length&&r.push("console.assert"),{method:"error",data:T(["Assertion failed:"],r)})},function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)},n=t&&t.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),a=t&&t.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),o=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&n(r,t,e);return a(r,t),r},s=t&&t.__spreadArrays||function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),a=0;for(r=0;r<e;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n},f=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var c=f(i),l=o(u),d=o(y),p=o(M);r.default=function(t,r,n){var a=n||c.default();switch(t){case"clear":return{method:t,id:a};case"count":return!!(o="string"==typeof r[0]?r[0]:"default")&&e(e({},d.increment(o)),{id:a});case"time":case"timeEnd":var o;return!!(o="string"==typeof r[0]?r[0]:"default")&&("time"===t?(l.start(o),!1):e(e({},l.stop(o)),{id:a}));case"assert":if(0!==r.length){var i=p.test.apply(p,s([r[0]],r.slice(1)));if(i)return e(e({},i),{id:a})}return!1;case"error":return{method:t,id:a,data:r.map((function(t){try{return t.stack||t}catch(r){return t}}))};default:return{method:t,id:a,data:r}}}}(o);var S={},O={};!function(t){var r;t.__esModule=!0,function(t){t[t.infinity=0]="infinity",t[t.minusInfinity=1]="minusInfinity",t[t.minusZero=2]="minusZero"}(r||(r={})),t.default={type:"Arithmetic",lookup:Number,shouldTransform:function(t,r){return"number"===t&&(r===1/0||r===-1/0||function(t){return 1/t==-1/0}(r))},toSerializable:function(t){return t===1/0?r.infinity:t===-1/0?r.minusInfinity:r.minusZero},fromSerializable:function(t){return t===r.infinity?1/0:t===r.minusInfinity?-1/0:t===r.minusZero?-0:t}}}(O);var w={};!function(t){t.__esModule=!0,t.default={type:"Function",lookup:Function,shouldTransform:function(t,r){return"function"==typeof r},toSerializable:function(t){var r="";try{r=t.toString().substring(r.indexOf("{")+1,r.lastIndexOf("}"))}catch(t){}return{name:t.name,body:r,proto:Object.getPrototypeOf(t).constructor.name}},fromSerializable:function(t){try{var r=function(){};return"string"==typeof t.name&&Object.defineProperty(r,"name",{value:t.name,writable:!1}),"string"==typeof t.body&&Object.defineProperty(r,"body",{value:t.body,writable:!1}),"string"==typeof t.proto&&(r.constructor={name:t.proto}),r}catch(r){return t}}}}(w);var A={};!function(t){var r;function e(t){for(var r={},e=0,n=t.attributes;e<n.length;e++){var a=n[e];r[a.name]=a.value}return r}t.__esModule=!0,t.default={type:"HTMLElement",shouldTransform:function(t,r){return r&&r.children&&"string"==typeof r.innerHTML&&"string"==typeof r.tagName},toSerializable:function(t){return{tagName:t.tagName.toLowerCase(),attributes:e(t),innerHTML:t.innerHTML}},fromSerializable:function(t){try{var e=(r||(r=document.implementation.createHTMLDocument("sandbox"))).createElement(t.tagName);e.innerHTML=t.innerHTML;for(var n=0,a=Object.keys(t.attributes);n<a.length;n++){var o=a[n];try{e.setAttribute(o,t.attributes[o])}catch(t){}}return e}catch(r){return t}}}}(A);var j={};!function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)};r.__esModule=!0,r.default={type:"Map",shouldTransform:function(t,r){return r&&r.constructor&&"Map"===r.constructor.name},toSerializable:function(t){var r={};return t.forEach((function(t,e){var n="object"==typeof e?JSON.stringify(e):e;r[n]=t})),{name:"Map",body:r,proto:Object.getPrototypeOf(t).constructor.name}},fromSerializable:function(t){var r=t.body,n=e({},r);return"string"==typeof t.proto&&(n.constructor={name:t.proto}),n}}}(j);var z={};!function(t){t.__esModule=!0;var r="@t",e=/^#*@(t|r)$/,n=(0,eval)("this"),a="function"==typeof ArrayBuffer,o="function"==typeof Map,i="function"==typeof Set,u=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],s=Array.prototype.slice,f={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}},c=function(){function t(t,r){this.references=t,this.transforms=r,this.transformsMap=this._makeTransformsMap(),this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}return t._createRefMark=function(t){var r=Object.create(null);return r["@r"]=t,r},t.prototype._createCircularCandidate=function(t,r,e){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:r,key:e,refIdx:-1})},t.prototype._applyTransform=function(t,e,n,a){var o=Object.create(null),i=a.toSerializable(t);return"object"==typeof i&&this._createCircularCandidate(t,e,n),o[r]=a.type,o.data=this._handleValue((function(){return i}),e,n),o},t.prototype._handleArray=function(t){for(var r=[],e=function(e){r[e]=n._handleValue((function(){return t[e]}),r,e)},n=this,a=0;a<t.length;a++)e(a);return r},t.prototype._handlePlainObject=function(t){var r,n,a=Object.create(null),o=function(r){if(Reflect.has(t,r)){var n=e.test(r)?"#"+r:r;a[n]=i._handleValue((function(){return t[r]}),a,n)}},i=this;for(var u in t)o(u);var s=null===(n=null===(r=null==t?void 0:t.__proto__)||void 0===r?void 0:r.constructor)||void 0===n?void 0:n.name;return s&&"Object"!==s&&(a.constructor={name:s}),a},t.prototype._handleObject=function(t,r,e){return this._createCircularCandidate(t,r,e),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},t.prototype._ensureCircularReference=function(r){var e=this.circularCandidates.indexOf(r);if(e>-1){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),t._createRefMark(n.refIdx)}return null},t.prototype._handleValue=function(t,r,e){try{var n=t(),a=typeof n,o="object"===a&&null!==n;if(o){var i=this._ensureCircularReference(n);if(i)return i}var u=this._findTransform(a,n);return u?this._applyTransform(n,r,e,u):o?this._handleObject(n,r,e):n}catch(t){try{return this._handleValue((function(){return t instanceof Error?t:new Error(t)}),r,e)}catch(t){return null}}},t.prototype._makeTransformsMap=function(){if(o){var t=new Map;return this.transforms.forEach((function(r){r.lookup&&t.set(r.lookup,r)})),t}},t.prototype._findTransform=function(t,r){if(o&&r&&r.constructor&&(null==(a=this.transformsMap.get(r.constructor))?void 0:a.shouldTransform(t,r)))return a;for(var e=0,n=this.transforms;e<n.length;e++){var a;if((a=n[e]).shouldTransform(t,r))return a}},t.prototype.transform=function(){for(var r=this,e=[this._handleValue((function(){return r.references}),null,null)],n=0,a=this.circularCandidatesDescrs;n<a.length;n++){var o=a[n];o.refIdx>0&&(e[o.refIdx]=o.parent[o.key],o.parent[o.key]=t._createRefMark(o.refIdx))}return e},t}(),l=function(){function t(t,r){this.activeTransformsStack=[],this.visitedRefs=Object.create(null),this.references=t,this.transformMap=r}return t.prototype._handlePlainObject=function(t){var r=Object.create(null);for(var n in"constructor"in t&&(t.constructor&&"string"==typeof t.constructor.name||(t.constructor={name:"Object"})),t)t.hasOwnProperty(n)&&(this._handleValue(t[n],t,n),e.test(n)&&(r[n.substring(1)]=t[n],delete t[n]));for(var a in r)t[a]=r[a]},t.prototype._handleTransformedObject=function(t,e,n){var a=t[r],o=this.transformMap[a];if(!o)throw new Error("Can't find transform for \\""+a+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=o.fromSerializable(t.data)},t.prototype._handleCircularSelfRefDuringTransform=function(t,r,e){var n=this.references;Object.defineProperty(r,e,{val:void 0,configurable:!0,enumerable:!0,get:function(){return void 0===this.val&&(this.val=n[t]),this.val},set:function(t){this.val=t}})},t.prototype._handleCircularRef=function(t,r,e){this.activeTransformsStack.includes(this.references[t])?this._handleCircularSelfRefDuringTransform(t,r,e):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),r[e]=this.references[t])},t.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var a=t["@r"];if(void 0!==a)this._handleCircularRef(a,e,n);else if(t[r])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var o=0;o<t.length;o++)this._handleValue(t[o],t,o);else this._handlePlainObject(t)}},t.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]},t}(),d=[{type:"[[NaN]]",shouldTransform:function(t,r){return"number"===t&&isNaN(r)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",lookup:Date,shouldTransform:function(t,r){return r instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var r=new Date;return r.setTime(t),r}},{type:"[[RegExp]]",lookup:RegExp,shouldTransform:function(t,r){return r instanceof RegExp},toSerializable:function(t){var r={src:t.source,flags:""};return t.globalThis&&(r.flags+="g"),t.ignoreCase&&(r.flags+="i"),t.multiline&&(r.flags+="m"),r},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",lookup:Error,shouldTransform:function(t,r){return r instanceof Error},toSerializable:function(t){var r,e;return t.stack||null===(e=(r=Error).captureStackTrace)||void 0===e||e.call(r,t),{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var r=new(n[t.name]||Error)(t.message);return r.stack=t.stack,r}},{type:"[[ArrayBuffer]]",lookup:a&&ArrayBuffer,shouldTransform:function(t,r){return a&&r instanceof ArrayBuffer},toSerializable:function(t){var r=new Int8Array(t);return s.call(r)},fromSerializable:function(t){if(a){var r=new ArrayBuffer(t.length);return new Int8Array(r).set(t),r}return t}},{type:"[[TypedArray]]",shouldTransform:function(t,r){if(a)return ArrayBuffer.isView(r)&&!(r instanceof DataView);for(var e=0,o=u;e<o.length;e++){var i=o[e];if("function"==typeof n[i]&&r instanceof n[i])return!0}return!1},toSerializable:function(t){return{ctorName:t.constructor.name,arr:s.call(t)}},fromSerializable:function(t){return"function"==typeof n[t.ctorName]?new n[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",lookup:o&&Map,shouldTransform:function(t,r){return o&&r instanceof Map},toSerializable:function(t){var r=[];return t.forEach((function(t,e){r.push(e),r.push(t)})),r},fromSerializable:function(t){if(o){for(var r=new Map,e=0;e<t.length;e+=2)r.set(t[e],t[e+1]);return r}for(var n=[],a=0;a<t.length;a+=2)n.push([t[e],t[e+1]]);return n}},{type:"[[Set]]",lookup:i&&Set,shouldTransform:function(t,r){return i&&r instanceof Set},toSerializable:function(t){var r=[];return t.forEach((function(t){r.push(t)})),r},fromSerializable:function(t){if(i){for(var r=new Set,e=0;e<t.length;e++)r.add(t[e]);return r}return t}}],p=function(){function t(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||f,this.addTransforms(d)}return t.prototype.addTransforms=function(t){for(var r=0,e=t=Array.isArray(t)?t:[t];r<e.length;r++){var n=e[r];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},t.prototype.removeTransforms=function(t){for(var r=0,e=t=Array.isArray(t)?t:[t];r<e.length;r++){var n=e[r],a=this.transforms.indexOf(n);a>-1&&this.transforms.splice(a,1),delete this.transformsMap[n.type]}return this},t.prototype.encode=function(t){var r=new c(t,this.transforms).transform();return this.serializer.serialize(r)},t.prototype.decode=function(t){var r=this.serializer.deserialize(t);return new l(r,this.transformsMap).transform()},t}();t.default=p}(z);var E=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};S.__esModule=!0,S.Decode=P=S.Encode=void 0;var k=E(O),C=E(w),D=E(A),I=E(j),N=E(z),R=[D.default,C.default,k.default,I.default],x=new N.default;x.addTransforms(R);var P=S.Encode=function(t){return JSON.parse(x.encode(t))};S.Decode=function(t){return x.decode(JSON.stringify(t))},function(r){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var a=e(n),i=e(o),u=S;r.default=function(t,r,e){void 0===e&&(e=!0);for(var n=t,o={pointers:{},src:{npm:"https://npmjs.com/package/console-feed",github:"https://github.com/samdenty99/console-feed"}},s=function(t){var a=n[t];n[t]=function(){a.apply(this,arguments);var n=[].slice.call(arguments);setTimeout((function(){var a=i.default(t,n);if(a){var o=a;e&&(o=u.Encode(a)),r(o,a)}}))},o.pointers[t]=a},f=0,c=a.default;f<c.length;f++)s(c[f]);return n.feed=o,n}}(e),r(e)(window.console,(function(t){var r=P(t);parent.postMessage({type:"console",codesandbox:!0,log:Array.isArray(r)?r[0]:r,channelId:scope.channelId},"*")}));
1
+ "use strict";const p=require("./index-DWdbLDAC.cjs");var M=(function(){function t(){this.listeners={},this.listenersCount=0,this.channelId=Math.floor(Math.random()*1e6),this.listeners=[]}return t.prototype.cleanup=function(){this.listeners={},this.listenersCount=0},t.prototype.dispatch=function(r){Object.values(this.listeners).forEach(function(e){return e(r)})},t.prototype.listener=function(r){var e=this;if(typeof r!="function")return function(){};var s=this.listenersCount;return this.listeners[s]=r,this.listenersCount++,function(){delete e.listeners[s]}},t})();function v(t){return/[a-zA-Z.]/.test(t)}function b(t){return/[a-zA-Z]/.test(t)}function w(t){return/\s/.test(t)}function y(t){return/[&|]/.test(t)}function g(t){return/-/.test(t)}function E(t){return/["']/.test(t)}function _(t){return b(t)&&t===t.toUpperCase()}var a;(function(t){t.OR="OR",t.AND="AND",t.PIPE="PIPE",t.Command="Command",t.Argument="Argument",t.String="String",t.EnvVar="EnvVar"})(a||(a={}));var O=new Map([["&&",{type:a.AND}],["||",{type:a.OR}],["|",{type:a.PIPE}],["-",{type:a.Argument}]]);function T(t){var r=0,e=[];function s(){for(var n="";v(t[r])&&r<t.length;)n+=t[r],r++;return{type:a.Command,value:n}}function f(){for(var n="";y(t[r])&&r<t.length;)n+=t[r],r++;return O.get(n)}function d(){for(var n="";(g(t[r])||b(t[r]))&&r<t.length;)n+=t[r],r++;return{type:a.Argument,value:n}}function c(){var n=t[r],u=t[r];for(r++;t[r]!==n&&r<t.length;)u+=t[r],r++;return u+=t[r],r++,{type:a.String,value:u}}function h(){for(var n={},u=function(){for(var l="",o="";t[r]!=="="&&r<t.length;)l+=t[r],r++;for(t[r]==="="&&r++;t[r]!==" "&&r<t.length;)o+=t[r],r++;n[l]=o};_(t[r])&&r<t.length;)u(),r++;return{type:a.EnvVar,value:n}}for(;r<t.length;){var i=t[r];if(w(i)){r++;continue}switch(!0){case _(i):e.push(h());break;case v(i):e.push(s());break;case y(i):e.push(f());break;case g(i):e.push(d());break;case E(i):e.push(c());break;default:throw new Error("Unknown character: ".concat(i))}}return e}var A=0;function j(){var t=Date.now(),r=Math.round(Math.random()*1e4),e=A+=1;return(+"".concat(t).concat(r).concat(e)).toString(16)}var S=function(t){return typeof t=="string"?new TextEncoder().encode(t):t},k=function(t){return typeof t=="string"?t:new TextDecoder().decode(t)},z=function(t){return Object.entries(t).reduce(function(r,e){var s=e[0],f=e[1];return r[s]=S(f.code),r},{})},C=function(t){var r={},e=["dev","start"];try{r=JSON.parse(t).scripts}catch(c){throw p.createError("Could not parse package.json file: "+c.message)}p.invariant(r,"Failed to start. Please provide a `start` or `dev` script on the package.json");for(var s=function(c){if(e[c]in r){var h=e[c],i=r[h],n={},u="",l=[];return T(i).forEach(function(o){var m=u==="";o.type===a.EnvVar&&(n=o.value),o.type===a.Command&&m&&(u=o.value),(o.type===a.Argument||!m&&o.type===a.Command)&&l.push(o.value)}),{value:[u,l,{env:n}]}}},f=0;f<e.length;f++){var d=s(f);if(typeof d=="object")return d.value}throw p.createError("Failed to start. Please provide a `start` or `dev` script on the package.json")},D=function(t){return typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message:p.createError("The server could not be reached. Make sure that the node script is running and that a port has been started.")},I=`var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e={},n={};!function(t){t.__esModule=!0,t.default=["log","debug","info","warn","error","table","clear","time","timeEnd","count","assert","command","result"]}(n);var a,o={},i={};(a=i).__esModule=!0,a.default=function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+"-"+Date.now()};var u={},s={__esModule:!0};s.update=s.state=void 0,s.update=function(t){s.state=t};var f={},c={};!function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)};r.__esModule=!0,r.initialState=void 0,r.initialState={timings:{},count:{}};var n=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()};r.default=function(t,a){var o,i,u;switch(void 0===t&&(t=r.initialState),a.type){case"COUNT":var s=t.count[a.name]||0;return e(e({},t),{count:e(e({},t.count),(o={},o[a.name]=s+1,o))});case"TIME_START":return e(e({},t),{timings:e(e({},t.timings),(i={},i[a.name]={start:n()},i))});case"TIME_END":var f=t.timings[a.name],c=n(),l=c-f.start;return e(e({},t),{timings:e(e({},t.timings),(u={},u[a.name]=e(e({},f),{end:c,time:l}),u))});default:return t}}}(c),function(r){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var n=e(c),a=s;r.default=function(t){a.update(n.default(a.state,t))}}(f);var l={__esModule:!0};l.timeEnd=l.timeStart=l.count=void 0,l.count=function(t){return{type:"COUNT",name:t}},l.timeStart=function(t){return{type:"TIME_START",name:t}},l.timeEnd=function(t){return{type:"TIME_END",name:t}};var d=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};u.__esModule=!0,u.stop=u.start=void 0;var p=s,h=d(f),m=l;u.start=function(t){h.default(m.timeStart(t))},u.stop=function(t){var r=null===p.state||void 0===p.state?void 0:p.state.timings[t];return r&&!r.end?(h.default(m.timeEnd(t)),{method:"log",data:[t+": "+p.state.timings[t].time+"ms"]}):{method:"warn",data:["Timer '"+t+"' does not exist"]}};var y={},v=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};y.__esModule=!0,y.increment=void 0;var _=s,b=v(f),g=l;y.increment=function(t){return b.default(g.count(t)),{method:"log",data:[t+": "+_.state.count[t]]}};var M={},T=t&&t.__spreadArrays||function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),a=0;for(r=0;r<e;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n};M.__esModule=!0,M.test=void 0,M.test=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return!t&&(0===r.length&&r.push("console.assert"),{method:"error",data:T(["Assertion failed:"],r)})},function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)},n=t&&t.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),a=t&&t.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),o=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&n(r,t,e);return a(r,t),r},s=t&&t.__spreadArrays||function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),a=0;for(r=0;r<e;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n},f=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var c=f(i),l=o(u),d=o(y),p=o(M);r.default=function(t,r,n){var a=n||c.default();switch(t){case"clear":return{method:t,id:a};case"count":return!!(o="string"==typeof r[0]?r[0]:"default")&&e(e({},d.increment(o)),{id:a});case"time":case"timeEnd":var o;return!!(o="string"==typeof r[0]?r[0]:"default")&&("time"===t?(l.start(o),!1):e(e({},l.stop(o)),{id:a}));case"assert":if(0!==r.length){var i=p.test.apply(p,s([r[0]],r.slice(1)));if(i)return e(e({},i),{id:a})}return!1;case"error":return{method:t,id:a,data:r.map((function(t){try{return t.stack||t}catch(r){return t}}))};default:return{method:t,id:a,data:r}}}}(o);var S={},O={};!function(t){var r;t.__esModule=!0,function(t){t[t.infinity=0]="infinity",t[t.minusInfinity=1]="minusInfinity",t[t.minusZero=2]="minusZero"}(r||(r={})),t.default={type:"Arithmetic",lookup:Number,shouldTransform:function(t,r){return"number"===t&&(r===1/0||r===-1/0||function(t){return 1/t==-1/0}(r))},toSerializable:function(t){return t===1/0?r.infinity:t===-1/0?r.minusInfinity:r.minusZero},fromSerializable:function(t){return t===r.infinity?1/0:t===r.minusInfinity?-1/0:t===r.minusZero?-0:t}}}(O);var w={};!function(t){t.__esModule=!0,t.default={type:"Function",lookup:Function,shouldTransform:function(t,r){return"function"==typeof r},toSerializable:function(t){var r="";try{r=t.toString().substring(r.indexOf("{")+1,r.lastIndexOf("}"))}catch(t){}return{name:t.name,body:r,proto:Object.getPrototypeOf(t).constructor.name}},fromSerializable:function(t){try{var r=function(){};return"string"==typeof t.name&&Object.defineProperty(r,"name",{value:t.name,writable:!1}),"string"==typeof t.body&&Object.defineProperty(r,"body",{value:t.body,writable:!1}),"string"==typeof t.proto&&(r.constructor={name:t.proto}),r}catch(r){return t}}}}(w);var A={};!function(t){var r;function e(t){for(var r={},e=0,n=t.attributes;e<n.length;e++){var a=n[e];r[a.name]=a.value}return r}t.__esModule=!0,t.default={type:"HTMLElement",shouldTransform:function(t,r){return r&&r.children&&"string"==typeof r.innerHTML&&"string"==typeof r.tagName},toSerializable:function(t){return{tagName:t.tagName.toLowerCase(),attributes:e(t),innerHTML:t.innerHTML}},fromSerializable:function(t){try{var e=(r||(r=document.implementation.createHTMLDocument("sandbox"))).createElement(t.tagName);e.innerHTML=t.innerHTML;for(var n=0,a=Object.keys(t.attributes);n<a.length;n++){var o=a[n];try{e.setAttribute(o,t.attributes[o])}catch(t){}}return e}catch(r){return t}}}}(A);var j={};!function(r){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},e.apply(this,arguments)};r.__esModule=!0,r.default={type:"Map",shouldTransform:function(t,r){return r&&r.constructor&&"Map"===r.constructor.name},toSerializable:function(t){var r={};return t.forEach((function(t,e){var n="object"==typeof e?JSON.stringify(e):e;r[n]=t})),{name:"Map",body:r,proto:Object.getPrototypeOf(t).constructor.name}},fromSerializable:function(t){var r=t.body,n=e({},r);return"string"==typeof t.proto&&(n.constructor={name:t.proto}),n}}}(j);var z={};!function(t){t.__esModule=!0;var r="@t",e=/^#*@(t|r)$/,n=(0,eval)("this"),a="function"==typeof ArrayBuffer,o="function"==typeof Map,i="function"==typeof Set,u=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],s=Array.prototype.slice,f={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}},c=function(){function t(t,r){this.references=t,this.transforms=r,this.transformsMap=this._makeTransformsMap(),this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}return t._createRefMark=function(t){var r=Object.create(null);return r["@r"]=t,r},t.prototype._createCircularCandidate=function(t,r,e){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:r,key:e,refIdx:-1})},t.prototype._applyTransform=function(t,e,n,a){var o=Object.create(null),i=a.toSerializable(t);return"object"==typeof i&&this._createCircularCandidate(t,e,n),o[r]=a.type,o.data=this._handleValue((function(){return i}),e,n),o},t.prototype._handleArray=function(t){for(var r=[],e=function(e){r[e]=n._handleValue((function(){return t[e]}),r,e)},n=this,a=0;a<t.length;a++)e(a);return r},t.prototype._handlePlainObject=function(t){var r,n,a=Object.create(null),o=function(r){if(Reflect.has(t,r)){var n=e.test(r)?"#"+r:r;a[n]=i._handleValue((function(){return t[r]}),a,n)}},i=this;for(var u in t)o(u);var s=null===(n=null===(r=null==t?void 0:t.__proto__)||void 0===r?void 0:r.constructor)||void 0===n?void 0:n.name;return s&&"Object"!==s&&(a.constructor={name:s}),a},t.prototype._handleObject=function(t,r,e){return this._createCircularCandidate(t,r,e),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},t.prototype._ensureCircularReference=function(r){var e=this.circularCandidates.indexOf(r);if(e>-1){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),t._createRefMark(n.refIdx)}return null},t.prototype._handleValue=function(t,r,e){try{var n=t(),a=typeof n,o="object"===a&&null!==n;if(o){var i=this._ensureCircularReference(n);if(i)return i}var u=this._findTransform(a,n);return u?this._applyTransform(n,r,e,u):o?this._handleObject(n,r,e):n}catch(t){try{return this._handleValue((function(){return t instanceof Error?t:new Error(t)}),r,e)}catch(t){return null}}},t.prototype._makeTransformsMap=function(){if(o){var t=new Map;return this.transforms.forEach((function(r){r.lookup&&t.set(r.lookup,r)})),t}},t.prototype._findTransform=function(t,r){if(o&&r&&r.constructor&&(null==(a=this.transformsMap.get(r.constructor))?void 0:a.shouldTransform(t,r)))return a;for(var e=0,n=this.transforms;e<n.length;e++){var a;if((a=n[e]).shouldTransform(t,r))return a}},t.prototype.transform=function(){for(var r=this,e=[this._handleValue((function(){return r.references}),null,null)],n=0,a=this.circularCandidatesDescrs;n<a.length;n++){var o=a[n];o.refIdx>0&&(e[o.refIdx]=o.parent[o.key],o.parent[o.key]=t._createRefMark(o.refIdx))}return e},t}(),l=function(){function t(t,r){this.activeTransformsStack=[],this.visitedRefs=Object.create(null),this.references=t,this.transformMap=r}return t.prototype._handlePlainObject=function(t){var r=Object.create(null);for(var n in"constructor"in t&&(t.constructor&&"string"==typeof t.constructor.name||(t.constructor={name:"Object"})),t)t.hasOwnProperty(n)&&(this._handleValue(t[n],t,n),e.test(n)&&(r[n.substring(1)]=t[n],delete t[n]));for(var a in r)t[a]=r[a]},t.prototype._handleTransformedObject=function(t,e,n){var a=t[r],o=this.transformMap[a];if(!o)throw new Error("Can't find transform for \\""+a+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=o.fromSerializable(t.data)},t.prototype._handleCircularSelfRefDuringTransform=function(t,r,e){var n=this.references;Object.defineProperty(r,e,{val:void 0,configurable:!0,enumerable:!0,get:function(){return void 0===this.val&&(this.val=n[t]),this.val},set:function(t){this.val=t}})},t.prototype._handleCircularRef=function(t,r,e){this.activeTransformsStack.includes(this.references[t])?this._handleCircularSelfRefDuringTransform(t,r,e):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),r[e]=this.references[t])},t.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var a=t["@r"];if(void 0!==a)this._handleCircularRef(a,e,n);else if(t[r])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var o=0;o<t.length;o++)this._handleValue(t[o],t,o);else this._handlePlainObject(t)}},t.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]},t}(),d=[{type:"[[NaN]]",shouldTransform:function(t,r){return"number"===t&&isNaN(r)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",lookup:Date,shouldTransform:function(t,r){return r instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var r=new Date;return r.setTime(t),r}},{type:"[[RegExp]]",lookup:RegExp,shouldTransform:function(t,r){return r instanceof RegExp},toSerializable:function(t){var r={src:t.source,flags:""};return t.globalThis&&(r.flags+="g"),t.ignoreCase&&(r.flags+="i"),t.multiline&&(r.flags+="m"),r},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",lookup:Error,shouldTransform:function(t,r){return r instanceof Error},toSerializable:function(t){var r,e;return t.stack||null===(e=(r=Error).captureStackTrace)||void 0===e||e.call(r,t),{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var r=new(n[t.name]||Error)(t.message);return r.stack=t.stack,r}},{type:"[[ArrayBuffer]]",lookup:a&&ArrayBuffer,shouldTransform:function(t,r){return a&&r instanceof ArrayBuffer},toSerializable:function(t){var r=new Int8Array(t);return s.call(r)},fromSerializable:function(t){if(a){var r=new ArrayBuffer(t.length);return new Int8Array(r).set(t),r}return t}},{type:"[[TypedArray]]",shouldTransform:function(t,r){if(a)return ArrayBuffer.isView(r)&&!(r instanceof DataView);for(var e=0,o=u;e<o.length;e++){var i=o[e];if("function"==typeof n[i]&&r instanceof n[i])return!0}return!1},toSerializable:function(t){return{ctorName:t.constructor.name,arr:s.call(t)}},fromSerializable:function(t){return"function"==typeof n[t.ctorName]?new n[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",lookup:o&&Map,shouldTransform:function(t,r){return o&&r instanceof Map},toSerializable:function(t){var r=[];return t.forEach((function(t,e){r.push(e),r.push(t)})),r},fromSerializable:function(t){if(o){for(var r=new Map,e=0;e<t.length;e+=2)r.set(t[e],t[e+1]);return r}for(var n=[],a=0;a<t.length;a+=2)n.push([t[e],t[e+1]]);return n}},{type:"[[Set]]",lookup:i&&Set,shouldTransform:function(t,r){return i&&r instanceof Set},toSerializable:function(t){var r=[];return t.forEach((function(t){r.push(t)})),r},fromSerializable:function(t){if(i){for(var r=new Set,e=0;e<t.length;e++)r.add(t[e]);return r}return t}}],p=function(){function t(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||f,this.addTransforms(d)}return t.prototype.addTransforms=function(t){for(var r=0,e=t=Array.isArray(t)?t:[t];r<e.length;r++){var n=e[r];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},t.prototype.removeTransforms=function(t){for(var r=0,e=t=Array.isArray(t)?t:[t];r<e.length;r++){var n=e[r],a=this.transforms.indexOf(n);a>-1&&this.transforms.splice(a,1),delete this.transformsMap[n.type]}return this},t.prototype.encode=function(t){var r=new c(t,this.transforms).transform();return this.serializer.serialize(r)},t.prototype.decode=function(t){var r=this.serializer.deserialize(t);return new l(r,this.transformsMap).transform()},t}();t.default=p}(z);var E=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};S.__esModule=!0,S.Decode=P=S.Encode=void 0;var k=E(O),C=E(w),D=E(A),I=E(j),N=E(z),R=[D.default,C.default,k.default,I.default],x=new N.default;x.addTransforms(R);var P=S.Encode=function(t){return JSON.parse(x.encode(t))};S.Decode=function(t){return x.decode(JSON.stringify(t))},function(r){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r.__esModule=!0;var a=e(n),i=e(o),u=S;r.default=function(t,r,e){void 0===e&&(e=!0);for(var n=t,o={pointers:{},src:{npm:"https://npmjs.com/package/console-feed",github:"https://github.com/samdenty99/console-feed"}},s=function(t){var a=n[t];n[t]=function(){a.apply(this,arguments);var n=[].slice.call(arguments);setTimeout((function(){var a=i.default(t,n);if(a){var o=a;e&&(o=u.Encode(a)),r(o,a)}}))},o.pointers[t]=a},f=0,c=a.default;f<c.length;f++)s(c[f]);return n.feed=o,n}}(e),r(e)(window.console,(function(t){var r=P(t);parent.postMessage({type:"console",codesandbox:!0,log:Array.isArray(r)?r[0]:r,channelId:scope.channelId},"*")}));
2
2
  `;exports.EventEmitter=M;exports.consoleHook=I;exports.findStartScriptPackageJson=C;exports.fromBundlerFilesToFS=z;exports.generateRandomId=j;exports.getMessageFromError=D;exports.readBuffer=k;exports.writeBuffer=S;
@@ -1,4 +1,4 @@
1
- import { P as h, Q as M } from "./index-BzeTMijQ.js";
1
+ import { P as h, Q as M } from "./index-Bgku8TKO.js";
2
2
  var k = (
3
3
  /** @class */
4
4
  (function() {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hook to detect if the device supports touch events
3
+ * Returns true if touch events are detected, false otherwise
4
+ * Universal hook available for all components
5
+ */
6
+ export declare function useDetectTouch(): boolean;
7
+ //# sourceMappingURL=use-detect-touch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-detect-touch.d.ts","sourceRoot":"","sources":["../../src/hooks/use-detect-touch.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAkBxC"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CqS3p5dh.cjs"),V=require("./base-80a1f760-MXO_OFow.cjs"),g=require("./consoleHook-59e792cb-D3_AFTLt.cjs");var z=Object.create,F=Object.defineProperty,G=Object.getOwnPropertyDescriptor,U=Object.getOwnPropertyNames,J=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,K=(t,n,e)=>n in t?F(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,P=(t,n)=>function(){return n||(0,t[U(t)[0]])((n={exports:{}}).exports,n),n.exports},X=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of U(n))!Y.call(t,s)&&s!==e&&F(t,s,{get:()=>n[s],enumerable:!(r=G(n,s))||r.enumerable});return t},j=(t,n,e)=>(e=t!=null?z(J(t)):{},X(!t||!t.__esModule?F(e,"default",{value:t,enumerable:!0}):e,t)),Q=(t,n,e)=>(K(t,n+"",e),e),x=(t,n,e)=>{if(!n.has(t))throw TypeError("Cannot "+e)},_=(t,n,e)=>(x(t,n,"read from private field"),e?e.call(t):n.get(t)),M=(t,n,e)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,e)},k=(t,n,e,r)=>(x(t,n,"write to private field"),n.set(t,e),e),E=(t,n,e)=>(x(t,n,"access private method"),e),B=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/pad.js"(t,n){n.exports=function(r,s){var i="000000000"+r;return i.substr(i.length-s)}}}),Z=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/fingerprint.browser.js"(t,n){var e=B(),r=typeof window=="object"?window:self,s=Object.keys(r).length,i=navigator.mimeTypes?navigator.mimeTypes.length:0,o=e((i+navigator.userAgent.length).toString(36)+s.toString(36),4);n.exports=function(){return o}}}),$=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/getRandomValue.browser.js"(t,n){var e,r=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof self<"u"&&self.crypto;r?(s=Math.pow(2,32)-1,e=function(){return Math.abs(r.getRandomValues(new Uint32Array(1))[0]/s)}):e=Math.random;var s;n.exports=e}}),W=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/index.js"(t,n){var e=Z(),r=B(),s=$(),i=0,o=4,a=36,d=Math.pow(a,o);function l(){return r((s()*d<<0).toString(a),o)}function f(){return i=i<d?i:0,i++,i-1}function m(){var v="c",w=new Date().getTime().toString(a),b=r(f().toString(a),o),c=e(),u=l()+l();return v+w+b+c+u}m.slug=function(){var w=new Date().getTime().toString(36),b=f().toString(36).slice(-4),c=e().slice(0,1)+e().slice(-1),u=l().slice(-2);return w.slice(-2)+b+c+u},m.isCuid=function(w){return typeof w!="string"?!1:!!w.startsWith("c")},m.isSlug=function(w){if(typeof w!="string")return!1;var b=w.length;return b>=7&&b<=10},m.fingerprint=e,n.exports=m}}),N=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/createDeferredExecutor.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredExecutor=void 0;function n(){const e=(r,s)=>{e.state="pending",e.resolve=i=>{if(e.state!=="pending")return;e.result=i;const o=a=>(e.state="fulfilled",a);return r(i instanceof Promise?i:Promise.resolve(i).then(o))},e.reject=i=>{if(e.state==="pending")return queueMicrotask(()=>{e.state="rejected"}),s(e.rejectionReason=i)}};return e}t.createDeferredExecutor=n}}),ee=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/DeferredPromise.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=void 0;var n=N(),e=class extends Promise{#e;resolve;reject;constructor(r=null){const s=(0,n.createDeferredExecutor)();super((i,o)=>{s(i,o),r?.(s.resolve,s.reject)}),this.#e=s,this.resolve=this.#e.resolve,this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(r,s){return this.#t(super.then(r,s))}catch(r){return this.#t(super.catch(r))}finally(r){return this.#t(super.finally(r))}#t(r){return Object.defineProperties(r,{resolve:{configurable:!0,value:this.resolve},reject:{configurable:!0,value:this.reject}})}};t.DeferredPromise=e}}),A=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(N(),t),e(ee(),t)}}),q=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/MemoryLeakError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryLeakError=void 0;var n=class extends Error{emitter;type;count;constructor(e,r,s){super(`Possible EventEmitter memory leak detected. ${s} ${r.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=r,this.count=s,this.name="MaxListenersExceededWarning"}};t.MemoryLeakError=n}}),te=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/Emitter.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var n=q(),e,r,s,i,o,a,d,l,f,m,v,w=class{constructor(){M(this,i),M(this,a),M(this,l),M(this,m),M(this,e,void 0),M(this,r,void 0),M(this,s,void 0),k(this,e,new Map),k(this,r,w.defaultMaxListeners),k(this,s,!1)}static listenerCount(c,u){return c.listenerCount(u)}setMaxListeners(c){return k(this,r,c),this}getMaxListeners(){return _(this,r)}eventNames(){return Array.from(_(this,e).keys())}emit(c,...u){const p=E(this,i,o).call(this,c);return p.forEach(I=>{I.apply(this,u)}),p.length>0}addListener(c,u){E(this,m,v).call(this,"newListener",c,u);const p=E(this,i,o).call(this,c).concat(u);if(_(this,e).set(c,p),_(this,r)>0&&this.listenerCount(c)>_(this,r)&&!_(this,s)){k(this,s,!0);const I=new n.MemoryLeakError(this,c,this.listenerCount(c));console.warn(I)}return this}on(c,u){return this.addListener(c,u)}once(c,u){return this.addListener(c,E(this,l,f).call(this,c,u))}prependListener(c,u){const p=E(this,i,o).call(this,c);if(p.length>0){const I=[u].concat(p);_(this,e).set(c,I)}else _(this,e).set(c,p.concat(u));return this}prependOnceListener(c,u){return this.prependListener(c,E(this,l,f).call(this,c,u))}removeListener(c,u){const p=E(this,i,o).call(this,c);return p.length>0&&(E(this,a,d).call(this,p,u),_(this,e).set(c,p),E(this,m,v).call(this,"removeListener",c,u)),this}off(c,u){return this.removeListener(c,u)}removeAllListeners(c){return c?_(this,e).delete(c):_(this,e).clear(),this}listeners(c){return Array.from(E(this,i,o).call(this,c))}listenerCount(c){return E(this,i,o).call(this,c).length}rawListeners(c){return this.listeners(c)}},b=w;e=new WeakMap,r=new WeakMap,s=new WeakMap,i=new WeakSet,o=function(c){return _(this,e).get(c)||[]},a=new WeakSet,d=function(c,u){const p=c.indexOf(u);return p>-1&&c.splice(p,1),[]},l=new WeakSet,f=function(c,u){const p=(...I)=>{this.removeListener(c,p),u.apply(this,I)};return p},m=new WeakSet,v=function(c,u,p){this.emit(c,u,p)},Q(b,"defaultMaxListeners",10),t.Emitter=b}}),re=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(te(),t),e(q(),t)}}),ne=j(W()),ie=/(%?)(%([sdjo]))/g;function se(t,n){switch(n){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const e=JSON.stringify(t);return e==="{}"||e==="[]"||/^\[object .+?\]$/.test(e)?t:e}}}function y(t,...n){if(n.length===0)return t;let e=0,r=t.replace(ie,(s,i,o,a)=>{const d=n[e],l=se(d,a);return i?s:(e++,l)});return e<n.length&&(r+=` ${n.slice(e).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var oe=2;function ae(t){if(!t.stack)return;const n=t.stack.split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-DWdbLDAC.cjs"),V=require("./base-80a1f760-DM2Ub6Fb.cjs"),g=require("./consoleHook-59e792cb-B67m1I9f.cjs");var z=Object.create,F=Object.defineProperty,G=Object.getOwnPropertyDescriptor,U=Object.getOwnPropertyNames,J=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,K=(t,n,e)=>n in t?F(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,P=(t,n)=>function(){return n||(0,t[U(t)[0]])((n={exports:{}}).exports,n),n.exports},X=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of U(n))!Y.call(t,s)&&s!==e&&F(t,s,{get:()=>n[s],enumerable:!(r=G(n,s))||r.enumerable});return t},j=(t,n,e)=>(e=t!=null?z(J(t)):{},X(!t||!t.__esModule?F(e,"default",{value:t,enumerable:!0}):e,t)),Q=(t,n,e)=>(K(t,n+"",e),e),x=(t,n,e)=>{if(!n.has(t))throw TypeError("Cannot "+e)},_=(t,n,e)=>(x(t,n,"read from private field"),e?e.call(t):n.get(t)),M=(t,n,e)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,e)},k=(t,n,e,r)=>(x(t,n,"write to private field"),n.set(t,e),e),E=(t,n,e)=>(x(t,n,"access private method"),e),B=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/pad.js"(t,n){n.exports=function(r,s){var i="000000000"+r;return i.substr(i.length-s)}}}),Z=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/fingerprint.browser.js"(t,n){var e=B(),r=typeof window=="object"?window:self,s=Object.keys(r).length,i=navigator.mimeTypes?navigator.mimeTypes.length:0,o=e((i+navigator.userAgent.length).toString(36)+s.toString(36),4);n.exports=function(){return o}}}),$=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/getRandomValue.browser.js"(t,n){var e,r=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof self<"u"&&self.crypto;r?(s=Math.pow(2,32)-1,e=function(){return Math.abs(r.getRandomValues(new Uint32Array(1))[0]/s)}):e=Math.random;var s;n.exports=e}}),W=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/index.js"(t,n){var e=Z(),r=B(),s=$(),i=0,o=4,a=36,d=Math.pow(a,o);function l(){return r((s()*d<<0).toString(a),o)}function f(){return i=i<d?i:0,i++,i-1}function m(){var v="c",w=new Date().getTime().toString(a),b=r(f().toString(a),o),c=e(),u=l()+l();return v+w+b+c+u}m.slug=function(){var w=new Date().getTime().toString(36),b=f().toString(36).slice(-4),c=e().slice(0,1)+e().slice(-1),u=l().slice(-2);return w.slice(-2)+b+c+u},m.isCuid=function(w){return typeof w!="string"?!1:!!w.startsWith("c")},m.isSlug=function(w){if(typeof w!="string")return!1;var b=w.length;return b>=7&&b<=10},m.fingerprint=e,n.exports=m}}),N=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/createDeferredExecutor.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredExecutor=void 0;function n(){const e=(r,s)=>{e.state="pending",e.resolve=i=>{if(e.state!=="pending")return;e.result=i;const o=a=>(e.state="fulfilled",a);return r(i instanceof Promise?i:Promise.resolve(i).then(o))},e.reject=i=>{if(e.state==="pending")return queueMicrotask(()=>{e.state="rejected"}),s(e.rejectionReason=i)}};return e}t.createDeferredExecutor=n}}),ee=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/DeferredPromise.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=void 0;var n=N(),e=class extends Promise{#e;resolve;reject;constructor(r=null){const s=(0,n.createDeferredExecutor)();super((i,o)=>{s(i,o),r?.(s.resolve,s.reject)}),this.#e=s,this.resolve=this.#e.resolve,this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(r,s){return this.#t(super.then(r,s))}catch(r){return this.#t(super.catch(r))}finally(r){return this.#t(super.finally(r))}#t(r){return Object.defineProperties(r,{resolve:{configurable:!0,value:this.resolve},reject:{configurable:!0,value:this.reject}})}};t.DeferredPromise=e}}),A=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(N(),t),e(ee(),t)}}),q=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/MemoryLeakError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryLeakError=void 0;var n=class extends Error{emitter;type;count;constructor(e,r,s){super(`Possible EventEmitter memory leak detected. ${s} ${r.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=r,this.count=s,this.name="MaxListenersExceededWarning"}};t.MemoryLeakError=n}}),te=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/Emitter.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var n=q(),e,r,s,i,o,a,d,l,f,m,v,w=class{constructor(){M(this,i),M(this,a),M(this,l),M(this,m),M(this,e,void 0),M(this,r,void 0),M(this,s,void 0),k(this,e,new Map),k(this,r,w.defaultMaxListeners),k(this,s,!1)}static listenerCount(c,u){return c.listenerCount(u)}setMaxListeners(c){return k(this,r,c),this}getMaxListeners(){return _(this,r)}eventNames(){return Array.from(_(this,e).keys())}emit(c,...u){const p=E(this,i,o).call(this,c);return p.forEach(I=>{I.apply(this,u)}),p.length>0}addListener(c,u){E(this,m,v).call(this,"newListener",c,u);const p=E(this,i,o).call(this,c).concat(u);if(_(this,e).set(c,p),_(this,r)>0&&this.listenerCount(c)>_(this,r)&&!_(this,s)){k(this,s,!0);const I=new n.MemoryLeakError(this,c,this.listenerCount(c));console.warn(I)}return this}on(c,u){return this.addListener(c,u)}once(c,u){return this.addListener(c,E(this,l,f).call(this,c,u))}prependListener(c,u){const p=E(this,i,o).call(this,c);if(p.length>0){const I=[u].concat(p);_(this,e).set(c,I)}else _(this,e).set(c,p.concat(u));return this}prependOnceListener(c,u){return this.prependListener(c,E(this,l,f).call(this,c,u))}removeListener(c,u){const p=E(this,i,o).call(this,c);return p.length>0&&(E(this,a,d).call(this,p,u),_(this,e).set(c,p),E(this,m,v).call(this,"removeListener",c,u)),this}off(c,u){return this.removeListener(c,u)}removeAllListeners(c){return c?_(this,e).delete(c):_(this,e).clear(),this}listeners(c){return Array.from(E(this,i,o).call(this,c))}listenerCount(c){return E(this,i,o).call(this,c).length}rawListeners(c){return this.listeners(c)}},b=w;e=new WeakMap,r=new WeakMap,s=new WeakMap,i=new WeakSet,o=function(c){return _(this,e).get(c)||[]},a=new WeakSet,d=function(c,u){const p=c.indexOf(u);return p>-1&&c.splice(p,1),[]},l=new WeakSet,f=function(c,u){const p=(...I)=>{this.removeListener(c,p),u.apply(this,I)};return p},m=new WeakSet,v=function(c,u,p){this.emit(c,u,p)},Q(b,"defaultMaxListeners",10),t.Emitter=b}}),re=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(te(),t),e(q(),t)}}),ne=j(W()),ie=/(%?)(%([sdjo]))/g;function se(t,n){switch(n){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const e=JSON.stringify(t);return e==="{}"||e==="[]"||/^\[object .+?\]$/.test(e)?t:e}}}function y(t,...n){if(n.length===0)return t;let e=0,r=t.replace(ie,(s,i,o,a)=>{const d=n[e],l=se(d,a);return i?s:(e++,l)});return e<n.length&&(r+=` ${n.slice(e).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var oe=2;function ae(t){if(!t.stack)return;const n=t.stack.split(`
2
2
  `);n.splice(1,oe),t.stack=n.join(`
3
3
  `)}var ce=class extends Error{constructor(t,...n){super(t),this.message=t,this.name="Invariant Violation",this.message=y(t,...n),ae(this)}},S=(t,n,...e)=>{if(!t)throw new ce(n,...e)};S.as=(t,n,e,...r)=>{if(!n)throw t.prototype.name!=null?new t(y(e,r)):t(y(e,r))};var C=j(A()),de=window.localStorage.CSB_EMULATOR_DEBUG,le="\x1B[0m",ue="\x1B[32;1m",he="\x1B[31m",fe="\x1B[34m",pe="\x1B[33;1m",me="\x1B[35;1m",D="\x1B[36;1m",ve={preview:pe,emulator:me,runtime:D,bridge:fe,"runtime:worker":D};function H(t){return function(e,...r){if(de==="true"){const s=()=>e.includes("sender")?`${ue}sender`:e.includes("receiver")?`${he}receiver`:"",i=e.replace(/\[.+\]:/,"");console.debug(`${ve[t]}${t}:${s()}${le}:${i}`,...r)}}}var L=H("emulator"),we=class{constructor(t){this.target=t,this.emitter=new EventTarget,this.channel=new MessageChannel,this.receiverPort=this.channel.port1;const n=new C.DeferredPromise,e=r=>{r.data.type==="internal/ready"&&(L("[message-sender]: runtime is ready"),n.resolve())};window.addEventListener("message",e),n.then(()=>{window.removeEventListener("message",e)}),this.receiverReadyPromise=n,this.receiverPort.onmessage=r=>{const s=r.data;s.type!=null&&(L('[message-sender]: emitting "%s" event...',s.type,s.payload),this.emitter.dispatchEvent(new MessageEvent(s.type,{data:s.payload})))}}emitter;channel;receiverPort;receiverReadyPromise;async handshake(){const t=new C.DeferredPromise;await this.receiverReadyPromise,L("[message-sender]: sending handshake"),this.target.postMessage({type:"internal/handshake"},"*",[this.channel.port2]),this.on("internal/handshake/done",()=>{t.resolve(),clearTimeout(n)});const n=setTimeout(()=>{t.reject(new Error("MessageSender: Handshake timeout"))},5e3);return t}on(t,n,e){L('[message-sender]: add listener "%s"',t),this.emitter.addEventListener(t,r=>{r instanceof MessageEvent&&n(r)},e)}off(t,n,e){this.emitter.removeEventListener(t,n,e)}async send(t,...n){const e=new C.DeferredPromise,r=(0,ne.default)(),s=n[0]||{};L('[message-sender]: send "%s" (%s)',t,r,s),this.receiverPort.postMessage({type:t,payload:{operationId:r,payload:s}}),L('[message-sender]: adding done listener for "%s" (%s)',t,r);const i=a=>{const{data:d}=a;if(d.operationId===r){const l=d.listenerPayload||{};L('[message-sender]: resolving "%s (%s) promise!',t,r),e.resolve({...l,operationId:d.operationId})}},o=a=>{const{data:d}=a;d.operationId===r&&(L('[message-sender]: rejecting "%s (%s) promise!',t,r),e.reject(d.error))};return this.on("internal/operation/done",i),this.on("internal/operation/failed",o),e.finally(()=>{this.emitter.removeEventListener("internal/operation/done",i),this.emitter.removeEventListener("internal/operation/failed",o)})}},T=j(A()),ge=j(W()),ye=class{constructor(t){this.channel=t}async init(t){await this.channel.send("fs/init",{files:t})}async readFile(t,n){const e=await this.channel.send("fs/readFile",{path:t,encoding:n}).catch(r=>{throw new Error(y('Failed to read file at path "%s"',t),{cause:r})});if(!e)throw new Error("File not found");return e.data}async writeFile(t,n,e){let r,s=!1;typeof e=="object"?(r=e.encoding,s=!!e.recursive):typeof e=="string"&&(r=e),await this.channel.send("fs/writeFile",{path:t,content:n,encoding:r,recursive:s}).catch(i=>{throw new Error(y('Failed to write file at path "%s"',t),{cause:i})})}async readdir(t){const n=await this.channel.send("fs/readdir",{path:t}).catch(e=>{throw new Error(y('Failed to read directory at path "%s"',t),{cause:e})});if(!n)throw new Error("Directory not found");return n.data}async mkdir(t,n){const e=!!n?.recursive;await this.channel.send("fs/mkdir",{path:t,recursive:e}).catch(r=>{throw new Error(y('Failed to make directory at path "%s"',t),{cause:r})})}async stat(t){const n=await this.channel.send("fs/stat",{path:t}).catch(e=>{throw new Error(y('Failed to stat file at path "%s"',t),{cause:e})});if(!n)throw new Error("File not found");return n.data}async rm(t,n){const{force:e,recursive:r}=n||{};await this.channel.send("fs/rm",{path:t,force:e,recursive:r}).catch(s=>{throw new Error(y('Failed to remove file at path "%s"',t),{cause:s})})}async watch(t,n,e){const r=(0,ge.default)();return await this.channel.send("fs/watch",{watcherId:r,includes:t,excludes:n}),this.channel.on("fs/watch-event",({data:s})=>{if(s.watcherId===r&&e){const i={...s};delete i.watcherId,e(i)}}),{dispose:()=>this.channel.send("fs/unwatch",{watcherId:r})}}},R=j(re()),_e=class{constructor(t){this.channel=t}create(){return new Ee(this.channel)}},Ee=class{constructor(t){this.channel=t,this.state="running",this.stdout=new R.Emitter,this.stderr=new R.Emitter,this.stdin={write:n=>{if(!this.id)throw new Error("Failed to write to stdin, no process is currently running");return this.channel.send("shell/stdin",{data:n,workerId:this.id})}},this.forwardStdEvents()}id;state;stdout;stderr;stdin;forwardStdEvents(){this.channel.on("worker/tty",t=>{const{data:n}=t;if(n.workerId===this.id)switch(n.payload.type){case"out":{this.stdout.emit("data",n.payload.data);break}case"err":{this.stderr.emit("data",n.payload.data);break}}})}async runCommand(t,n,e={}){S(!this.id,'Failed to run "runCommand" on a ShellProcess: there is already a process running.');const r=await this.channel.send("shell/runCommand",{command:t,args:n,options:e});return S(r,'Failed to run "runCommand" on a ShellProcess: was not able to retrieve a running process.'),this.id=r.id,this.state="running",r}async on(t,n){switch(t){case"progress":{this.channel.on("worker/progress",({data:e})=>{n(e.status)});return}case"exit":{this.channel.on("worker/exit",({data:e})=>{e.workerId===this.id&&n(e.exitCode,e.error)});return}}}async kill(){S(this.id,'Failed to run "kill" on a ShellProcess: there is no process running. Did you forget to run it?'),this.state="idle",await this.channel.send("shell/exit",{id:this.id}).catch(t=>{throw new Error(y('Failed to kill shell with ID "%s"',this.id),{cause:t})}),this.id=void 0}},Pe=j(A()),be=2e4,Se=class{constructor(t){this.channel=t}async waitFor(t,n,e=be){const r=new Pe.DeferredPromise,s=setTimeout(()=>{r.reject()},e),i=await this.channel.send("preview/get/info",t).catch(a=>{r.reject(new Error(y('Failed to look up preview information for shell ID "%s" (port: %d)',t.sourceShellId,t.port)))}),o=i&&n(i);return o&&r.resolve({url:i.url,port:i.port,sourceShellId:i.sourceShellId}),this.channel.on("preview/port/ready",({data:a})=>{!o&&n(a)&&r.resolve({url:a.url,port:a.port,sourceShellId:a.sourceShellId})}),r.finally(()=>{clearTimeout(s)})}async getByShellId(t,n){return this.waitFor({sourceShellId:t},e=>e.sourceShellId===t,n).catch(e=>{throw new Error(y('Failed to get shell by ID "%s"',t),{cause:e})})}async waitForPort(t,n){return this.waitFor({port:t},e=>e.port===t,n).catch(e=>{throw new Error(y("Failed to await port %d",t),{cause:e})})}},Le="https://nodebox-runtime.codesandbox.io",O=H("emulator"),Ie=class{constructor(t){this.options=t,S(this.options.iframe,'Failed to create a Nodebox: expected "iframe" argument to be a reference to an <iframe> element but got %j',this.options.iframe),this.url=this.options.runtimeUrl||Le,this.isConnected=!1}channel=null;isConnected;url;fileSystemApi=null;shellApi=null;previewApi=null;async connect(){const{iframe:t,cdnUrl:n}=this.options;O("[message-sender]: Connecting to node emulator...");const e=new T.DeferredPromise;this.url||e.reject(new Error("Nodebox URL is missing. Did you forget to provide it when creating this Nodebox instance?")),S(t.contentWindow,"Failed to create a MessageChannel with the Nodebox iframe: no content window found"),this.channel=new we(t.contentWindow);const r=new T.DeferredPromise;return t.setAttribute("src",this.url),t.addEventListener("load",()=>{r.resolve()},{once:!0}),t.addEventListener("error",s=>{r.reject(s.error)},{once:!0}),await r,O("[message-sender]: IFrame loaded..."),await this.channel.handshake(),O("[message-sender]: Handshake completed..."),this.channel.send("connect",{cdnUrl:n}),this.channel.on("runtime/ready",()=>{e.resolve()}),e.then(()=>{O("[message-sender]: Connected to runtime..."),this.isConnected=!0})}get fs(){return S(this.isConnected,'Failed to access the File System API: consumer is not connected. Did you forget to run "connect()"?'),this.fileSystemApi?this.fileSystemApi:(this.fileSystemApi=new ye(this.channel),this.fileSystemApi)}get shell(){return S(this.isConnected,'Failed to access the Shell API: consumer is not connected. Did you forget to run "connect()"?'),this.shellApi?this.shellApi:(this.shellApi=new _e(this.channel),this.shellApi)}get preview(){return S(this.isConnected,'Failed to access the Preview API: consumer is not connected. Did you forget to run "connect()"?'),this.previewApi?this.previewApi:(this.previewApi=new Se(this.channel),this.previewApi)}},Me="INJECT_AND_INVOKE",je="PREVIEW_LOADED";function ke(t,n){return h.__awaiter(this,void 0,void 0,function(){var e,r,s,i,o;return h.__generator(this,function(a){return e=t.contentWindow,h.nullthrows(e,"Failed to await preview iframe: no content window found"),r=9e4,s=20,i=0,[2,new Promise(function(d,l){var f=function(){var m=function(){clearTimeout(o),i=s,d(),t.removeEventListener("load",m)};if(i>=s){l(h.createError("Could not able to connect to preview."));return}t.setAttribute("src",n),o=setTimeout(function(){f(),t.removeEventListener("load",m)},r),i=i+1,t.addEventListener("load",m)};t.addEventListener("error",function(){return l(new Error("Iframe error"))}),t.addEventListener("abort",function(){return l(new Error("Aborted"))}),f()})]})})}var Oe=function(t,n){t.style.border="0",t.style.width=n.width||"100%",t.style.height=n.height||"100%",t.style.overflow="hidden",t.allow="cross-origin-isolated"};function Ce(t){var n=t.scope,e=window.history.__proto__,r=[],s=0,i=function(d){parent.postMessage({type:"urlchange",url:d,back:s>0,forward:s<r.length-1,channelId:n.channelId},"*")};function o(d,l){r.splice(s+1),r.push({url:d,state:l}),s=r.length-1}Object.assign(window.history,{go:function(d){var l=s+d;if(l>=0&&l<=r.length-1){s=l;var f=r[s],m=f.url,v=f.state;e.replaceState.call(window.history,v,"",m);var w=document.location.href;i(w),window.dispatchEvent(new PopStateEvent("popstate",{state:v}))}},back:function(){window.history.go(-1)},forward:function(){window.history.go(1)},pushState:function(d,l,f){e.replaceState.call(window.history,d,l,f),o(f,d),i(document.location.href)},replaceState:function(d,l,f){e.replaceState.call(window.history,d,l,f),r[s]={state:d,url:f},i(document.location.href)}});function a(d){var l=d.data;l.type==="urlback"?history.back():l.type==="urlforward"?history.forward():l.type==="refresh"&&document.location.reload()}window.addEventListener("message",a)}function Fe(t){var n=t.scope,e=0;function r(){if(typeof window>"u")return 0;var a=document.body,d=document.documentElement;return Math.max(a.scrollHeight,a.offsetHeight,d.offsetHeight)}function s(){var a=r();e!==a&&window.parent.postMessage({type:"resize",height:a,codesandbox:!0,channelId:n.channelId},"*"),e=a}s();var i,o=new MutationObserver(function(){i===void 0&&(s(),i=setTimeout(function(){i=void 0},300))});o.observe(document,{attributes:!0,childList:!0,subtree:!0}),setInterval(s,300)}var xe=[{code:Ce.toString(),id:"historyListener"},{code:"function consoleHook({ scope }) {"+g.consoleHook+`
4
4
  };`,id:"consoleHook"},{code:Fe.toString(),id:"watchResize"}],Ae=function(t,n){xe.forEach(function(e){var r,s=e.code,i=e.id,o={uid:i,type:Me,code:"exports.activate = ".concat(s),scope:{channelId:n}};(r=t.contentWindow)===null||r===void 0||r.postMessage(o,"*")})},De=(function(t){h.__extends(n,t);function n(e,r,s){s===void 0&&(s={});var i=t.call(this,e,r,h.__assign(h.__assign({},s),{bundlerURL:s.bundlerURL}))||this;return i._modulesCache=new Map,i.messageChannelId=g.generateRandomId(),i._initPromise=null,i.emitter=new g.EventEmitter,i.manageIframes(e),i.emulator=new Ie({iframe:i.emulatorIframe,runtimeUrl:i.options.bundlerURL}),i.updateSandbox(r),i}return n.prototype._init=function(e){return h.__awaiter(this,void 0,void 0,function(){return h.__generator(this,function(r){switch(r.label){case 0:return[4,this.emulator.connect()];case 1:return r.sent(),[4,this.emulator.fs.init(e)];case 2:return r.sent(),[4,this.globalListeners()];case 3:return r.sent(),[2]}})})},n.prototype.compile=function(e){return h.__awaiter(this,void 0,void 0,function(){var r,s;return h.__generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.status="initializing",this.dispatch({type:"start",firstLoad:!0}),this._initPromise||(this._initPromise=this._init(e)),[4,this._initPromise];case 1:return i.sent(),this.dispatch({type:"connected"}),[4,this.createShellProcessFromTask(e)];case 2:return r=i.sent().id,[4,this.createPreviewURLFromId(r)];case 3:return i.sent(),[4,this.setLocationURLIntoIFrame()];case 4:return i.sent(),this.dispatchDoneMessage(),[3,6];case 5:return s=i.sent(),this.dispatch({type:"action",action:"notification",notificationType:"error",title:g.getMessageFromError(s)}),this.dispatch({type:"done",compilatonError:!0}),[3,6];case 6:return[2]}})})},n.prototype.createShellProcessFromTask=function(e){return h.__awaiter(this,void 0,void 0,function(){var r,s,i=this;return h.__generator(this,function(o){switch(o.label){case 0:return r=g.readBuffer(e["/package.json"]),this.emulatorCommand=g.findStartScriptPackageJson(r),this.emulatorShellProcess=this.emulator.shell.create(),[4,this.emulatorShellProcess.on("exit",function(a){i.dispatch({type:"action",action:"notification",notificationType:"error",title:h.createError("Error: process.exit(".concat(a,") called."))})})];case 1:return o.sent(),[4,this.emulatorShellProcess.on("progress",function(a){var d,l;if(a.state==="command_running"||a.state==="starting_command"){i.dispatch({type:"shell/progress",data:h.__assign(h.__assign({},a),{command:[(d=i.emulatorCommand)===null||d===void 0?void 0:d[0],(l=i.emulatorCommand)===null||l===void 0?void 0:l[1].join(" ")].join(" ")})}),i.status="installing-dependencies";return}i.dispatch({type:"shell/progress",data:a})})];case 2:return o.sent(),this.emulatorShellProcess.stdout.on("data",function(a){i.dispatch({type:"stdout",payload:{data:a,type:"out"}})}),this.emulatorShellProcess.stderr.on("data",function(a){i.dispatch({type:"stdout",payload:{data:a,type:"err"}})}),[4,(s=this.emulatorShellProcess).runCommand.apply(s,this.emulatorCommand)];case 3:return[2,o.sent()]}})})},n.prototype.createPreviewURLFromId=function(e){var r;return h.__awaiter(this,void 0,void 0,function(){var s;return h.__generator(this,function(i){switch(i.label){case 0:return this.iframePreviewUrl=void 0,[4,this.emulator.preview.getByShellId(e)];case 1:return s=i.sent().url,this.iframePreviewUrl=s+((r=this.options.startRoute)!==null&&r!==void 0?r:""),[2]}})})},n.prototype.manageIframes=function(e){var r;if(typeof e=="string"){var s=document.querySelector(e);h.nullthrows(s,"The element '".concat(e,"' was not found")),this.iframe=document.createElement("iframe"),s?.appendChild(this.iframe)}else this.iframe=e;Oe(this.iframe,this.options),h.nullthrows(this.iframe.parentNode,"The given iframe does not have a parent."),this.emulatorIframe=document.createElement("iframe"),this.emulatorIframe.classList.add("sp-bridge-frame"),(r=this.iframe.parentNode)===null||r===void 0||r.appendChild(this.emulatorIframe)},n.prototype.setLocationURLIntoIFrame=function(){return h.__awaiter(this,void 0,void 0,function(){return h.__generator(this,function(e){switch(e.label){case 0:return this.iframePreviewUrl?[4,ke(this.iframe,this.iframePreviewUrl)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.prototype.dispatchDoneMessage=function(){this.status="done",this.dispatch({type:"done",compilatonError:!1}),this.iframePreviewUrl&&this.dispatch({type:"urlchange",url:this.iframePreviewUrl,back:!1,forward:!1})},n.prototype.globalListeners=function(){return h.__awaiter(this,void 0,void 0,function(){var e=this;return h.__generator(this,function(r){switch(r.label){case 0:return window.addEventListener("message",function(s){s.data.type===je&&Ae(e.iframe,e.messageChannelId),s.data.type==="urlchange"&&s.data.channelId===e.messageChannelId?e.dispatch({type:"urlchange",url:s.data.url,back:s.data.back,forward:s.data.forward}):s.data.channelId===e.messageChannelId&&e.dispatch(s.data)}),[4,this.emulator.fs.watch(["*"],[".next","node_modules","build","dist","vendor",".config",".vuepress"],function(s){return h.__awaiter(e,void 0,void 0,function(){var i,o,a,d,l,f,m;return h.__generator(this,function(v){switch(v.label){case 0:return s?(i=s,o="newPath"in i?i.newPath:"path"in i?i.path:"",[4,this.emulator.fs.stat(o)]):[2];case 1:if(a=v.sent().type,a!=="file")return[2,null];v.label=2;case 2:switch(v.trys.push([2,10,,11]),d=i.type,d){case"change":return[3,3];case"create":return[3,3];case"remove":return[3,5];case"rename":return[3,6];case"close":return[3,8]}return[3,9];case 3:return[4,this.emulator.fs.readFile(i.path,"utf8")];case 4:return l=v.sent(),this.dispatch({type:"fs/change",path:i.path,content:l}),this._modulesCache.set(i.path,g.writeBuffer(l)),[3,9];case 5:return this.dispatch({type:"fs/remove",path:i.path}),this._modulesCache.delete(i.path),[3,9];case 6:return this.dispatch({type:"fs/remove",path:i.oldPath}),this._modulesCache.delete(i.oldPath),[4,this.emulator.fs.readFile(i.newPath,"utf8")];case 7:return f=v.sent(),this.dispatch({type:"fs/change",path:i.newPath,content:f}),this._modulesCache.set(i.newPath,g.writeBuffer(f)),[3,9];case 8:return[3,9];case 9:return[3,11];case 10:return m=v.sent(),this.dispatch({type:"action",action:"notification",notificationType:"error",title:g.getMessageFromError(m)}),[3,11];case 11:return[2]}})})})];case 1:return r.sent(),[2]}})})},n.prototype.restartShellProcess=function(){var e;return h.__awaiter(this,void 0,void 0,function(){return h.__generator(this,function(r){switch(r.label){case 0:return this.emulatorShellProcess&&this.emulatorCommand?(this.dispatch({type:"start",firstLoad:!0}),this.status="initializing",[4,this.emulatorShellProcess.kill()]):[3,3];case 1:return r.sent(),(e=this.iframe)===null||e===void 0||e.removeAttribute("attr"),this.emulator.fs.rm("/node_modules/.vite",{recursive:!0,force:!0}),[4,this.compile(Object.fromEntries(this._modulesCache))];case 2:r.sent(),r.label=3;case 3:return[2]}})})},n.prototype.updateSandbox=function(e){var r=this,s,i=g.fromBundlerFilesToFS(e.files);if(((s=this.emulatorShellProcess)===null||s===void 0?void 0:s.state)==="running"){Object.entries(i).forEach(function(o){var a=o[0],d=o[1];(!r._modulesCache.get(a)||g.readBuffer(d)!==g.readBuffer(r._modulesCache.get(a)))&&r.emulator.fs.writeFile(a,d,{recursive:!0})});return}this.dispatch({codesandbox:!0,modules:i,template:e.template,type:"compile"}),Object.entries(i).forEach(function(o){var a=o[0],d=o[1];r._modulesCache.set(a,g.writeBuffer(d))})},n.prototype.dispatch=function(e){var r,s;return h.__awaiter(this,void 0,void 0,function(){var i;return h.__generator(this,function(o){switch(o.label){case 0:switch(i=e.type,i){case"compile":return[3,1];case"refresh":return[3,2];case"urlback":return[3,4];case"urlforward":return[3,4];case"shell/restart":return[3,5];case"shell/openPreview":return[3,6]}return[3,7];case 1:return this.compile(e.modules),[3,8];case 2:return[4,this.setLocationURLIntoIFrame()];case 3:return o.sent(),[3,8];case 4:return(s=(r=this.iframe)===null||r===void 0?void 0:r.contentWindow)===null||s===void 0||s.postMessage(e,"*"),[3,8];case 5:return this.restartShellProcess(),[3,8];case 6:return window.open(this.iframePreviewUrl,"_blank"),[3,8];case 7:this.emitter.dispatch(e),o.label=8;case 8:return[2]}})})},n.prototype.listen=function(e){return this.emitter.listener(e)},n.prototype.destroy=function(){this.emulatorIframe.remove(),this.emitter.cleanup()},n})(V.SandpackClient);exports.SandpackNode=De;
@@ -1,6 +1,6 @@
1
- import { _ as R, R as A, T as L } from "./index-BzeTMijQ.js";
2
- import { a as $, E as H, b as N, c as W } from "./consoleHook-59e792cb-Ct_fyIfV.js";
3
- import { S as D } from "./base-80a1f760-BOlg5Ney.js";
1
+ import { _ as R, R as A, T as L } from "./index-Bgku8TKO.js";
2
+ import { a as $, E as H, b as N, c as W } from "./consoleHook-59e792cb-DRl3o_41.js";
3
+ import { S as D } from "./base-80a1f760-C2sIm9yE.js";
4
4
  var k, U;
5
5
  function B() {
6
6
  if (U) return k;