react-grab 0.1.44-dev.9348b5e → 0.1.44-dev.a87d070

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 (41) hide show
  1. package/dist/action-shortcuts-CXtmnvxR.cjs +9 -0
  2. package/dist/action-shortcuts-pUfvO-Dy.js +9 -0
  3. package/dist/{index-aMJqwVQq.d.cts → copy-content-DRlueR0M.d.ts} +243 -19
  4. package/dist/copy-content-SZMeykhZ.cjs +10 -0
  5. package/dist/{index-qewm1CVI.d.ts → copy-content-eDj6R0dJ.d.cts} +243 -19
  6. package/dist/copy-content-nHZP0ohp.js +10 -0
  7. package/dist/core/index.cjs +1 -1
  8. package/dist/core/index.d.cts +3 -3
  9. package/dist/core/index.d.ts +3 -3
  10. package/dist/core/index.js +1 -1
  11. package/dist/core-CTOj-RWZ.js +15 -0
  12. package/dist/core-Dq59m_vR.cjs +15 -0
  13. package/dist/freeze-updates-Bv-A-CYT.js +51 -0
  14. package/dist/freeze-updates-DTJrGHPo.cjs +51 -0
  15. package/dist/index-BtTNtQm_.d.cts +27 -0
  16. package/dist/index-CxiTsW9m.d.ts +27 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.global.js +19 -19
  21. package/dist/index.js +1 -1
  22. package/dist/primitives.cjs +2 -2
  23. package/dist/primitives.d.cts +1 -1
  24. package/dist/primitives.d.ts +1 -1
  25. package/dist/primitives.js +2 -2
  26. package/dist/renderer-BESiqt5S.js +9 -0
  27. package/dist/renderer-OCYYBn9_.cjs +9 -0
  28. package/dist/styles.css +1 -1
  29. package/package.json +3 -3
  30. package/dist/action-shortcuts-BCwfvUjv.js +0 -9
  31. package/dist/action-shortcuts-BP2l6fVk.cjs +0 -9
  32. package/dist/copy-content-3pnWacho.d.cts +0 -218
  33. package/dist/copy-content-CbwpEdYS.cjs +0 -9
  34. package/dist/copy-content-CqqX064U.js +0 -9
  35. package/dist/copy-content-DH6fBB50.d.ts +0 -218
  36. package/dist/core-C53wHQqX.js +0 -11
  37. package/dist/core-DjyzqxeH.cjs +0 -11
  38. package/dist/freeze-updates-BMPwD2tW.js +0 -52
  39. package/dist/freeze-updates-Dkhhra2U.cjs +0 -52
  40. package/dist/renderer--UEnBH3q.cjs +0 -13
  41. package/dist/renderer-DovD-ZQ1.js +0 -13
@@ -6,8 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { n as StackFrame } from "./copy-content-DH6fBB50.js";
10
-
11
9
  //#region ../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/types/reactive/observable.d.ts
12
10
  declare global {
13
11
  interface SymbolConstructor {
@@ -195,10 +193,30 @@ interface EnumEditableProperty extends EditablePropertyBase {
195
193
  options: ReadonlyArray<EnumEditableOption>;
196
194
  }
197
195
  type EditableProperty = NumericEditableProperty | ColorEditableProperty | EnumEditableProperty;
196
+ interface NumericPendingEdit {
197
+ kind: "numeric";
198
+ key: string;
199
+ cssProperties: readonly string[];
200
+ value: number;
201
+ unit: string;
202
+ }
203
+ interface ColorPendingEdit {
204
+ kind: "color";
205
+ key: string;
206
+ cssProperties: readonly string[];
207
+ value: string;
208
+ }
209
+ interface EnumPendingEdit {
210
+ kind: "enum";
211
+ key: string;
212
+ cssProperties: readonly string[];
213
+ value: string;
214
+ }
215
+ type PendingEdit = NumericPendingEdit | ColorPendingEdit | EnumPendingEdit;
216
+ type PendingEdits = PendingEdit[];
198
217
  interface PreviewStyles {
199
218
  apply: (cssProperties: readonly string[], cssValue: string) => void;
200
219
  restore: () => void;
201
- forget: () => void;
202
220
  hasAppliedStyles: () => boolean;
203
221
  }
204
222
  interface EditPanelState {
@@ -213,6 +231,7 @@ interface EditPanelState {
213
231
  tagName?: string;
214
232
  htmlPreview?: string;
215
233
  initialSearchQuery?: string;
234
+ hasSessionEdits?: boolean;
216
235
  }
217
236
  interface ContextMenuAction {
218
237
  id: string;
@@ -435,7 +454,8 @@ interface ReactGrabRendererProps {
435
454
  editPanelState?: EditPanelState | null;
436
455
  editPanelPosition?: DropdownAnchor | null;
437
456
  onEditPanelDismiss?: () => void;
438
- onEditPanelSubmit?: (prompt: string) => void;
457
+ onEditPanelSubmit?: (pendingEdits: PendingEdits) => void;
458
+ onEditPanelPendingEditsChange?: (pendingEdits: PendingEdits) => void;
439
459
  onEditPanelInteractingChange?: (interacting: boolean) => void;
440
460
  }
441
461
  interface GrabbedBox {
@@ -456,24 +476,228 @@ interface DragRect {
456
476
  width: number;
457
477
  height: number;
458
478
  }
459
- //#endregion
460
- //#region src/core/context.d.ts
461
- declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
462
- interface StackContextOptions {
463
- maxLines?: number;
479
+ interface SourceLocation extends SourceInfo {
480
+ columnNumber: number | null;
481
+ }
482
+ interface ReactGrabStackFrame {
483
+ functionName?: string;
484
+ fileName?: string;
485
+ lineNumber?: number;
486
+ columnNumber?: number;
487
+ isServer?: boolean;
488
+ isSymbolicated?: boolean;
489
+ }
490
+ interface ReactGrabEntry {
491
+ tagName?: string;
492
+ componentName?: string;
493
+ content: string;
494
+ commentText?: string;
495
+ source?: SourceLocation | null;
496
+ stackContext?: string;
497
+ frames?: ReactGrabStackFrame[];
464
498
  }
465
- declare const getElementContext: (element: Element, options?: StackContextOptions) => Promise<string>;
466
499
  //#endregion
467
- //#region src/core/theme.d.ts
468
- declare const DEFAULT_THEME: Required<Theme>;
500
+ //#region ../../node_modules/.pnpm/bippy@0.5.41_react@19.2.6/node_modules/bippy/dist/core.d.ts
501
+ type Flags = number;
502
+ type Lanes = number;
503
+ type TypeOfMode = number;
504
+ type WorkTag = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
505
+ type HookType = "useState" | "useReducer" | "useContext" | "useRef" | "useEffect" | "useLayoutEffect" | "useCallback" | "useMemo" | "useImperativeHandle" | "useDebugValue" | "useDeferredValue" | "useTransition" | "useMutableSource" | "useOpaqueIdentifier" | "useCacheRefresh";
506
+ type FiberRoot = any;
507
+ interface Source {
508
+ fileName: string;
509
+ lineNumber: number;
510
+ }
511
+ interface RefObject {
512
+ current: any;
513
+ }
514
+ interface ReactContext<T> {
515
+ $$typeof: symbol | number;
516
+ Consumer: ReactContext<T>;
517
+ Provider: ReactProviderType<T>;
518
+ _calculateChangedBits: ((a: T, b: T) => number) | null;
519
+ _currentValue: T;
520
+ _currentValue2: T;
521
+ _threadCount: number;
522
+ _currentRenderer?: Record<string, any> | null;
523
+ _currentRenderer2?: Record<string, any> | null;
524
+ displayName?: string;
525
+ }
526
+ interface ReactProviderType<T> {
527
+ $$typeof: symbol | number;
528
+ _context: ReactContext<T>;
529
+ }
530
+ interface ReactFiber {
531
+ tag: WorkTag;
532
+ key: null | string;
533
+ elementType: any;
534
+ type: any;
535
+ stateNode: any;
536
+ return: ReactFiber | null;
537
+ child: ReactFiber | null;
538
+ sibling: ReactFiber | null;
539
+ index: number;
540
+ ref: null | (((handle: unknown) => void) & {
541
+ _stringRef?: string | null;
542
+ }) | RefObject;
543
+ pendingProps: any;
544
+ memoizedProps: any;
545
+ updateQueue: unknown;
546
+ memoizedState: any;
547
+ dependencies: Dependencies | null;
548
+ mode: TypeOfMode;
549
+ flags: Flags;
550
+ subtreeFlags: Flags;
551
+ deletions: ReactFiber[] | null;
552
+ nextEffect: ReactFiber | null;
553
+ firstEffect: ReactFiber | null;
554
+ lastEffect: ReactFiber | null;
555
+ lanes: Lanes;
556
+ childLanes: Lanes;
557
+ alternate: ReactFiber | null;
558
+ actualDuration?: number;
559
+ actualStartTime?: number;
560
+ selfBaseDuration?: number;
561
+ treeBaseDuration?: number;
562
+ _debugID?: number;
563
+ _debugSource?: Source | null;
564
+ _debugOwner?: ReactFiber | null;
565
+ _debugIsCurrentlyTiming?: boolean;
566
+ _debugNeedsRemount?: boolean;
567
+ _debugHookTypes?: HookType[] | null;
568
+ }
569
+ interface ContextDependency<T> {
570
+ context: ReactContext<T>;
571
+ memoizedValue: T;
572
+ next: ContextDependency<unknown> | null;
573
+ observedBits: number;
574
+ }
575
+ interface Dependencies {
576
+ firstContext: ContextDependency<unknown> | null;
577
+ lanes: Lanes;
578
+ }
579
+ interface Effect {
580
+ [key: string]: unknown;
581
+ create: (...args: unknown[]) => unknown;
582
+ deps: null | unknown[];
583
+ destroy: ((...args: unknown[]) => unknown) | null;
584
+ next: Effect | null;
585
+ tag: number;
586
+ }
587
+ interface Family {
588
+ current: unknown;
589
+ }
590
+ /**
591
+ * Represents a react-internal Fiber node.
592
+ */
593
+ type Fiber<T = any> = Omit<ReactFiber, "alternate" | "child" | "dependencies" | "memoizedProps" | "memoizedState" | "pendingProps" | "return" | "sibling" | "stateNode" | "updateQueue"> & {
594
+ _debugInfo?: Array<{
595
+ debugLocation?: unknown;
596
+ env?: string;
597
+ name?: string;
598
+ }>;
599
+ _debugOwner?: Fiber;
600
+ _debugSource?: {
601
+ columnNumber?: number;
602
+ fileName: string;
603
+ lineNumber: number;
604
+ };
605
+ _debugStack?: Error & {
606
+ stack: string;
607
+ };
608
+ alternate: Fiber | null;
609
+ child: Fiber | null;
610
+ dependencies: Dependencies | null;
611
+ memoizedProps: Props;
612
+ memoizedState: MemoizedState;
613
+ pendingProps: Props;
614
+ return: Fiber | null;
615
+ sibling: Fiber | null;
616
+ stateNode: T;
617
+ updateQueue: {
618
+ [key: string]: unknown;
619
+ lastEffect: Effect | null;
620
+ };
621
+ };
622
+ interface MemoizedState {
623
+ [key: string]: unknown;
624
+ memoizedState: unknown;
625
+ next: MemoizedState | null;
626
+ }
627
+ interface Props {
628
+ [key: string]: unknown;
629
+ }
630
+ interface ReactDevToolsGlobalHook {
631
+ _instrumentationIsActive?: boolean;
632
+ _instrumentationSource?: string;
633
+ checkDCE: (fn: unknown) => void;
634
+ hasUnsupportedRendererAttached: boolean;
635
+ inject: (renderer: ReactRenderer) => number;
636
+ on: () => void;
637
+ onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: number | void) => void;
638
+ onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
639
+ onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
640
+ renderers: Map<number, ReactRenderer>;
641
+ supportsFiber: boolean;
642
+ supportsFlight: boolean;
643
+ }
644
+ interface ReactRenderer {
645
+ bundleType: 0 | 1;
646
+ currentDispatcherRef: any;
647
+ findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
648
+ getCurrentFiber?: (fiber: Fiber) => Fiber | null;
649
+ overrideContext?: (fiber: Fiber, contextType: unknown, path: string[], value: unknown) => void;
650
+ overrideHookState?: (fiber: Fiber, id: string, path: string[], value: unknown) => void;
651
+ overrideHookStateDeletePath?: (fiber: Fiber, id: number, path: Array<number | string>) => void;
652
+ overrideHookStateRenamePath?: (fiber: Fiber, id: number, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
653
+ overrideProps?: (fiber: Fiber, path: string[], value: unknown) => void;
654
+ overridePropsDeletePath?: (fiber: Fiber, path: Array<number | string>) => void;
655
+ overridePropsRenamePath?: (fiber: Fiber, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
656
+ reconcilerVersion: string;
657
+ rendererPackageName: string;
658
+ scheduleRefresh?: (root: FiberRoot, update: {
659
+ staleFamilies: Set<Family>;
660
+ updatedFamilies: Set<Family>;
661
+ }) => void;
662
+ scheduleRoot?: (root: FiberRoot, element: React.ReactNode) => void;
663
+ scheduleUpdate?: (fiber: Fiber) => void;
664
+ setErrorHandler?: (newShouldErrorImpl: (fiber: Fiber) => boolean) => void;
665
+ setRefreshHandler?: (handler: ((fiber: Fiber) => Family | null) | null) => void;
666
+ setSuspenseHandler?: (newShouldSuspendImpl: (suspenseInstance: unknown) => void) => void;
667
+ version: string;
668
+ }
669
+ declare global {
670
+ var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook | undefined;
671
+ } //#endregion
672
+ //#region src/rdt-hook.d.ts
673
+ /**
674
+ * Returns `true` if bippy's instrumentation is active.
675
+ */
676
+ declare const isInstrumentationActive: () => boolean;
677
+ /**
678
+ * Returns the latest fiber (since it may be double-buffered).
679
+ */
469
680
  //#endregion
470
- //#region src/utils/generate-snippet.d.ts
471
- interface GenerateSnippetOptions {
472
- maxLines?: number;
681
+ //#region ../../node_modules/.pnpm/bippy@0.5.41_react@19.2.6/node_modules/bippy/dist/source.d.ts
682
+ //#region src/source/parse-stack.d.ts
683
+ interface StackFrame {
684
+ args?: unknown[];
685
+ columnNumber?: number;
686
+ lineNumber?: number;
687
+ fileName?: string;
688
+ functionName?: string;
689
+ source?: string;
690
+ isServer?: boolean;
691
+ isSymbolicated?: boolean;
473
692
  }
474
- declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOptions) => Promise<string[]>;
475
693
  //#endregion
476
- //#region src/core/index.d.ts
477
- declare const init: (rawOptions?: Options) => ReactGrabAPI;
694
+ //#region src/utils/copy-content.d.ts
695
+ interface CopyContentOptions {
696
+ componentName?: string;
697
+ tagName?: string;
698
+ commentText?: string;
699
+ entries?: ReactGrabEntry[];
700
+ }
701
+ declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
478
702
  //#endregion
479
- export { Theme as A, PromptModeContext as C, Rect as D, ReactGrabState as E, SettableOptions as O, Position as S, ReactGrabRendererProps as T, Options as _, getStack as a, PluginConfig as b, ActivationMode as c, ContextMenuActionContext as d, DeepPartial as f, GrabbedBox as g, ElementLabelVariant as h, getElementContext as i, ToolbarState as j, SourceInfo as k, AgentContext as l, ElementLabelContext as m, generateSnippet as n, ActionContext as o, DragRect as p, DEFAULT_THEME as r, ActionContextHooks as s, init as t, ContextMenuAction as u, OverlayBounds as v, ReactGrabAPI as w, PluginHooks as x, Plugin as y };
703
+ export { ToolbarState as A, ReactGrabAPI as C, SettableOptions as D, Rect as E, SourceInfo as O, PromptModeContext as S, ReactGrabState as T, OverlayBounds as _, ActionContext as a, PluginHooks as b, AgentContext as c, DeepPartial as d, DragRect as f, Options as g, GrabbedBox as h, isInstrumentationActive as i, Theme as k, ContextMenuAction as l, ElementLabelVariant as m, StackFrame as n, ActionContextHooks as o, ElementLabelContext as p, Fiber as r, ActivationMode as s, copyContent as t, ContextMenuActionContext as u, Plugin as v, ReactGrabRendererProps as w, Position as x, PluginConfig as y };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import{A as e,At as t,C as n,Ct as r,D as i,E as a,Et as o,F as s,M as c,Mt as l,N as u,O as d,P as f,R as p,S as m,T as ee,Tt as te,j as h,k as ne,ut as re,w as ie,wt as ae,x as oe}from"./freeze-updates-Bv-A-CYT.js";var g=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},se=class extends g{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},ce=class extends g{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},le=class extends g{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},ue=class extends g{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const _=e=>{try{return decodeURIComponent(e)}catch{return e}},de=/(?:^|[/\\])node_modules[/\\]/,fe=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,v=/\.[mc]?[jt]sx?$/i,pe=/^chunk-[A-Za-z0-9_-]+$/,me=/[/\\]/,he=/^(.+?)@v?\d/,y=e=>e.split(me).filter(Boolean),ge=e=>{let[t,n]=y(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},_e=e=>{let t=y(e)[0];if(!t)return null;let n=t.replace(v,``);if(pe.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},b=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},x=e=>e?.match(he)?.[1]??null,ve=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=y(t.pathname).map(_);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=x(n[e+1]);if(r)return`${t}/${r}`;continue}let r=x(t);if(r)return r}return null},ye=e=>b(e,fe,_e)??b(e,de,ge),be=e=>{if(!e)return null;let t=d(e);return t&&(ye(_(t))||ve(e))||null},xe=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,Se=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Ce=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),we=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),Te=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},Ee=e=>{let t=Te(_(d(e)));if(t.startsWith(`/`))return null;let[n,r,...i]=y(t);return!n||!r||i.length===0||!xe.test(n)||we.has(n.slice(1))||!Se.test(r)||v.test(r)||Ce.has(r)?null:`${n}/${r}`},De=e=>e?be(e)??Ee(e):null,S=e=>{if(!e)return{origin:`unknown`,packageName:null};let t=De(e);return t?{origin:`package`,packageName:t}:a(e)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},Oe=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),C=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},ke=(e,t)=>{let n=Oe.has(e)||e.startsWith(`data-`)&&C(e),r=C(t)&&t.length<100||t.startsWith(`#`)&&C(t.slice(1));return n&&r},w=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},Ae=e=>{let t=0;for(let n of e)t+=n.penalty;return t},T=(e,t)=>Ae(e)-Ae(t),E=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},je=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,D=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,Me=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&C(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)C(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=E(e,i);a!==void 0&&n.push({name:D(i,a),penalty:10});let o=E(e);return o!==void 0&&n.push({name:je(i,o),penalty:50}),n},O=(e,t=re,n=[])=>{if(t<=0)return[];if(e.length===0)return[n];let r=[];for(let i of e[0]){let a=t-r.length;if(a<=0)break;r.push(...O(e.slice(1),a,[...n,i]))}return r},Ne=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},k=(e,t)=>t.querySelectorAll(w(e)).length===1,Pe=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=E(n,e);if(t===void 0)return;r.push({name:D(e,t),penalty:10}),n=n.parentElement}return k(r,t)?r:void 0},Fe=(e,t,n,r)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new se;if(e.tagName.toLowerCase()===`html`)return`html`;let i=Ne(t,e),a=Date.now(),o=[],s=e,c=0,l;for(;s&&s!==i&&!l;)if(o.push(Me(s,r)),s=s.parentElement,c++,c>=3){let t=O(o);t.sort(T);for(let r of t){if(Date.now()-a>n){let t=Pe(e,i);if(!t)throw new ce(n);return w(t)}if(k(r,i)){l=r;break}}}if(!l&&c<3){let e=O(o);e.sort(T);for(let t of e){if(Date.now()-a>n)break;if(k(t,i)){l=t;break}}}if(!l)throw new le;return w(l)},Ie=e=>e.ownerDocument.body??e.ownerDocument.documentElement,A=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),j=e=>e.length>0&&e.length<=120,M=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},Le=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(M(e,t))return t}for(let t of A){let n=e.getAttribute(t);if(!n||!j(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(M(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(M(e,i))return i}return null},Re=e=>{let t=[],n=Ie(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},N=e=>{let t=Le(e);if(t)return t;try{let t=Fe(e,Ie(e),200,(e,t)=>ke(e,t)||A.has(e)&&j(t));if(t)return t}catch{}return Re(e)},P=[`about://React/`,`rsc://React/`],ze=e=>P.some(t=>e.startsWith(t)),Be=e=>{for(let t of P){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return _(i>r?e.slice(r,i):e.slice(r))}return e},Ve=async e=>{let n=[],r=[];for(let t=0;t<e.length;t++){let i=e[t];!i.isServer||!i.fileName||(n.push(t),r.push({file:Be(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(r.length===0)return e;let i=new AbortController,a=setTimeout(()=>i.abort(),t);try{let t=await fetch(`${oe()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:r,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),signal:i.signal});if(!t.ok)return e;let a=await t.json(),o=[...e];for(let t=0;t<n.length;t++){let r=a[t];if(r?.status!==`fulfilled`)continue;let i=r.value?.originalStackFrame;if(!i?.file||i.ignored)continue;let s=n[t];o[s]={...e[s],fileName:i.file,lineNumber:i.line1??void 0,columnNumber:i.column1??void 0,isSymbolicated:!0}}return o}catch{return e}finally{clearTimeout(a)}},He=t=>{let n=new Map;return h(t,t=>{if(!ne(t))return!1;let r=ee(t._debugStack.stack);if(!r)return!1;for(let t of e(r))!t.functionName||!t.fileName||ze(t.fileName)&&(n.has(t.functionName)||n.set(t.functionName,{...t,isServer:!0}));return!1},!0),n},Ue=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=He(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})},F=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,We=e=>e.startsWith(`data-react-grab-`),I=e=>e.replace(/\s+/g,` `).trim(),Ge=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=I(n.textContent??``);e&&t.push(e)}return t.join(` `)},L=e=>e.getAttribute(`aria-hidden`)===`true`||e.hasAttribute(`hidden`)?!0:o.has(e.tagName.toLowerCase()),R=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=I(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||L(e))return n;for(let r of e.childNodes)if(n=R(r,t,n),n<=0)break;return n},z=(e,t)=>{if(L(e))return``;let n=Ge(e);if(!r.has(t)||n&&e.children.length===0)return n;let i=[];return R(e,i,100),i.join(` `)},B=e=>F(e,15),Ke=e=>{let t=[];for(let n of te){let r=e.getAttribute(n);r&&t.push(`${n}="${r}"`)}return t.length>0?` ${t.join(` `)}`:``},qe=e=>e===`class`||e===`className`||e===`style`,V=e=>{let t=[],n=[],r=``;for(let{name:i,value:a}of e.attributes)if(!We(i)){if(qe(i)){i!==`style`&&a&&(r=` class="${B(a)}"`);continue}ae.has(i)?t.push(a?` ${i}="${a}"`:` ${i}`):a&&n.push(` ${i}="${B(a)}"`)}return t.join(``)+n.join(``)+r},H=e=>e.length===0?``:e.length<=2?e.map(e=>`<${p(e)} ...>`).join(`
10
+ `):`(${e.length} elements)`,Je=e=>{let t=p(e);if(!(e instanceof HTMLElement))return`<${t}${Ke(e)} />`;let n=V(e),r=F(z(e,t),100);return r?`<${t}${n}>${r}</${t}>`:`<${t}${n} />`},U=e=>{let t=p(e),n=V(e),i=z(e,t),a=[],o=[],s=!1;for(let t of e.childNodes)t.nodeType!==Node.COMMENT_NODE&&(t.nodeType===Node.TEXT_NODE?t.textContent&&t.textContent.trim().length>0&&(s=!0):t instanceof Element&&(s?o.push(t):a.push(t)));let c=i.length>0&&r.has(t),l=``,u=H(a);u&&!c&&(l+=`\n ${u}`),i&&(l+=`\n ${F(i,100)}`);let d=H(o);return d&&!c&&(l+=`\n ${d}`),l.length>0?`<${t}${n}>${l}\n</${t}>`:`<${t}${n} />`},Ye=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),Xe=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),Ze=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),Qe=new Set([`MotionDOMComponent`]),W=e=>{if(Xe.has(e)||Ze.has(e)||Qe.has(e))return!0;for(let t of Ye)if(e.startsWith(t))return!0;return!1},$e=e=>!(!e||W(e)||e===`SlotClone`||e===`Slot`),et=e=>!(e.length<=1||W(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),G=e=>e&&et(e)?e:null,K=e=>{if(!c())return e;let t=e;for(;t;){if(f(t))return t;t=t.parentElement}return e},q=new WeakMap,J=new WeakMap,tt=async e=>{try{let t=f(e);if(!t)return null;let n=await i(t);return m()?await Ve(Ue(t,n)):n}catch{return null}},Y=e=>{if(!c())return Promise.resolve([]);let t=K(e),n=q.get(t);if(n)return n;let r=tt(t);return q.set(t,r),r},nt=async e=>{if(!c())return null;let t=await Y(e);if(!t)return null;for(let e of t){let t=G(e.functionName);if(t)return t}return null},rt=e=>e.find(e=>!!G(e.functionName))??e[0]??null,it=e=>!e||!s(e)?null:G(u(e.type)),at=async e=>{let t=f(K(e));if(!t)return null;try{let e=await ie(t);return e?.fileName?{filePath:n(e.fileName),lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:G(e.functionName)??it(t._debugOwner),origin:S(e.fileName).origin}:null}catch{return null}},X=e=>{let t=K(e),n=J.get(t);if(n)return n;let r=at(t).then(e=>(e||J.delete(t),e));return J.set(t,r),r},ot=[`app`,`package`],st=(e,t)=>{for(let r of ot){if(e?.origin===r)return e;let i=rt(t.filter(e=>S(e.fileName).origin===r));if(i?.fileName)return{filePath:n(i.fileName),lineNumber:i.lineNumber??null,columnNumber:i.columnNumber??null,componentName:G(i.functionName),origin:r}}return null},ct=async e=>{let t=await X(e);return t?.origin===`app`?t:st(t,await Y(e)??[])},lt=e=>Z(K(e),1)[0]??null,Z=(e,t)=>{if(!c())return[];let n=f(e);if(!n)return[];let r=[];return h(n,e=>{if(r.length>=t)return!0;if(s(e)){let t=u(e.type);t&&$e(t)&&r.push(t)}return!1},!0),r},ut=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],dt=(e,t)=>{let r=n(e);if(!t||!r.startsWith(`/`))return r;for(let e of ut){let t=r.indexOf(e);if(t!==-1)return`/./${r.slice(t+1)}`}return r},Q=(e,t)=>{let n=dt(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},ft=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,isTrustedSource:!1}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,isTrustedSource:!1}:i?{text:`\n in ${i}`,isTrustedSource:!1}:a?{text:Q({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isTrustedSource:!0}:null},pt=(e,t={},n=null)=>{let{maxLines:r=3}=t,i=Math.max(r,20),a=m(),o=[],s=null,c=!1,l=!1,u=0;n&&(l=n.origin===`app`,u+=1,o.push(Q(n,a)));for(let t of e){if(u>=r||o.length>=i)break;let e=S(t.fileName),d=G(t.functionName),f=e.packageName?`${e.packageName}:${d??``}:${t.isServer?`server`:`client`}`:null;if(f&&f===s)continue;if(!c&&d&&d===n?.componentName){c=!0;continue}let p=ft(t,e,d,a);p!==null&&(p.isTrustedSource&&(l=!0,u+=1),o.push(p.text),s=f)}return{text:o.join(``),shouldAppendSelectorHint:!l}},mt=async e=>{let t=await X(e);return t?.origin===`app`?t:null},$=async(e,t={})=>{let n=await mt(e),r=pt(await Y(e)??[],t,n);if(r.text)return r;let i=Z(K(e),t.maxLines??3);return i.length>0?{text:i.map(e=>`\n in ${e}`).join(``),shouldAppendSelectorHint:!0}:{text:``,shouldAppendSelectorHint:!0}},ht=async(e,t={})=>(await $(e,t)).text,gt=(e,t)=>{let n=t.shouldAppendSelectorHint?`\n selector: ${N(e)}`:``;return`${t.text}${n}`},_t=async(e,t={})=>{let n=await $(e,t);return`${Je(e)}${gt(e,n).replace(/\n\s+/g,` `)}`},vt=async(e,t={})=>{let n=K(e);return`${U(n)}${gt(n,await $(n,t))}`},yt=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),bt=(e,t)=>{let n=t?.componentName??`div`,r={version:l,content:e,entries:t?.entries??[{tagName:t?.tagName,componentName:n,content:e,commentText:t?.commentText}],timestamp:Date.now()},i=t=>{t.preventDefault(),t.clipboardData?.setData(`text/plain`,e),t.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${yt(e)}</code></pre>`),t.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(r))};document.addEventListener(`copy`,i);let a=document.createElement(`textarea`);a.value=e,a.style.position=`fixed`,a.style.left=`-9999px`,a.ariaHidden=`true`,document.body.appendChild(a),a.select();try{return typeof document.execCommand==`function`?document.execCommand(`copy`):!1}finally{document.removeEventListener(`copy`,i),a.remove()}};export{nt as a,ct as c,ue as d,_t as i,U as l,vt as n,Y as o,lt as r,ht as s,bt as t,N as u};
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../core-DjyzqxeH.cjs`),t=require(`../freeze-updates-Dkhhra2U.cjs`),n=require(`../copy-content-CbwpEdYS.cjs`);exports.DEFAULT_THEME=e.a,exports.copyContent=n.t,exports.formatElementInfo=t.S,exports.generateSnippet=e.n,exports.getStack=t.E,exports.init=e.t,exports.isInstrumentationActive=t.A;
9
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../core-Dq59m_vR.cjs`),t=require(`../freeze-updates-DTJrGHPo.cjs`),n=require(`../copy-content-SZMeykhZ.cjs`);exports.DEFAULT_THEME=e.a,exports.copyContent=n.t,exports.formatElementInfo=n.n,exports.generateSnippet=e.n,exports.getStack=n.o,exports.init=e.t,exports.isInstrumentationActive=t.M;
@@ -6,6 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { O as SettableOptions, T as ReactGrabRendererProps, _ as Options, a as getStack, b as PluginConfig, i as getElementContext, k as SourceInfo, l as AgentContext, n as generateSnippet, o as ActionContext, r as DEFAULT_THEME, t as init, u as ContextMenuAction, v as OverlayBounds, w as ReactGrabAPI, x as PluginHooks, y as Plugin } from "../index-aMJqwVQq.cjs";
10
- import { i as isInstrumentationActive, t as copyContent } from "../copy-content-3pnWacho.cjs";
11
- export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, getElementContext as formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
9
+ import { C as ReactGrabAPI, D as SettableOptions, O as SourceInfo, _ as OverlayBounds, a as ActionContext, b as PluginHooks, c as AgentContext, g as Options, i as isInstrumentationActive, l as ContextMenuAction, t as copyContent, v as Plugin, w as ReactGrabRendererProps, y as PluginConfig } from "../copy-content-eDj6R0dJ.cjs";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-BtTNtQm_.cjs";
11
+ export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
@@ -6,6 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { O as SettableOptions, T as ReactGrabRendererProps, _ as Options, a as getStack, b as PluginConfig, i as getElementContext, k as SourceInfo, l as AgentContext, n as generateSnippet, o as ActionContext, r as DEFAULT_THEME, t as init, u as ContextMenuAction, v as OverlayBounds, w as ReactGrabAPI, x as PluginHooks, y as Plugin } from "../index-qewm1CVI.js";
10
- import { i as isInstrumentationActive, t as copyContent } from "../copy-content-DH6fBB50.js";
11
- export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, getElementContext as formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
9
+ import { C as ReactGrabAPI, D as SettableOptions, O as SourceInfo, _ as OverlayBounds, a as ActionContext, b as PluginHooks, c as AgentContext, g as Options, i as isInstrumentationActive, l as ContextMenuAction, t as copyContent, v as Plugin, w as ReactGrabRendererProps, y as PluginConfig } from "../copy-content-DRlueR0M.js";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-CxiTsW9m.js";
11
+ export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import{a as e,n as t,t as n}from"../core-C53wHQqX.js";import{A as r,E as i,S as a}from"../freeze-updates-BMPwD2tW.js";import{t as o}from"../copy-content-CqqX064U.js";export{e as DEFAULT_THEME,o as copyContent,a as formatElementInfo,t as generateSnippet,i as getStack,n as init,r as isInstrumentationActive};
9
+ import{a as e,n as t,t as n}from"../core-CTOj-RWZ.js";import{M as r}from"../freeze-updates-Bv-A-CYT.js";import{n as i,o as a,t as o}from"../copy-content-nHZP0ohp.js";export{e as DEFAULT_THEME,o as copyContent,i as formatElementInfo,t as generateSnippet,a as getStack,n as init,r as isInstrumentationActive};